@langchain/langgraph-sdk 0.0.93 → 0.0.94
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/auth/index.cjs +13 -0
- package/dist/auth/index.d.ts +10 -0
- package/dist/auth/index.js +12 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/auth/index.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.HTTPException = exports.Auth = void 0;
|
|
4
|
+
exports.isStudioUser = isStudioUser;
|
|
4
5
|
class Auth {
|
|
5
6
|
constructor() {
|
|
6
7
|
/**
|
|
@@ -28,5 +29,17 @@ class Auth {
|
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
exports.Auth = Auth;
|
|
32
|
+
/**
|
|
33
|
+
* Check if the provided user was provided by LangGraph Studio.
|
|
34
|
+
*
|
|
35
|
+
* By default, if you add custom authorization on your resources, this will also apply to interactions made from the Studio.
|
|
36
|
+
* If you want, you can handle logged-in Studio users in a special way.
|
|
37
|
+
*
|
|
38
|
+
* @param user - The user to check
|
|
39
|
+
* @returns True if the user is a studio user, false otherwise
|
|
40
|
+
*/
|
|
41
|
+
function isStudioUser(user) {
|
|
42
|
+
return user.identity === "langgraph-studio-user";
|
|
43
|
+
}
|
|
31
44
|
var error_js_1 = require("./error.cjs");
|
|
32
45
|
Object.defineProperty(exports, "HTTPException", { enumerable: true, get: function () { return error_js_1.HTTPException; } });
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -12,5 +12,15 @@ TAuthReturn extends BaseAuthReturn = BaseAuthReturn, TUser extends BaseUser = To
|
|
|
12
12
|
authenticate<T extends BaseAuthReturn>(cb: AuthenticateCallback<T>): Auth<TExtra, T>;
|
|
13
13
|
on<T extends CallbackEvent>(event: T, callback: OnCallback<T, TUser>): this;
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Check if the provided user was provided by LangGraph Studio.
|
|
17
|
+
*
|
|
18
|
+
* By default, if you add custom authorization on your resources, this will also apply to interactions made from the Studio.
|
|
19
|
+
* If you want, you can handle logged-in Studio users in a special way.
|
|
20
|
+
*
|
|
21
|
+
* @param user - The user to check
|
|
22
|
+
* @returns True if the user is a studio user, false otherwise
|
|
23
|
+
*/
|
|
24
|
+
export declare function isStudioUser(user: BaseUser): boolean;
|
|
15
25
|
export type { Filters as AuthFilters, EventValueMap as AuthEventValueMap, } from "./types.js";
|
|
16
26
|
export { HTTPException } from "./error.js";
|
package/dist/auth/index.js
CHANGED
|
@@ -24,4 +24,16 @@ export class Auth {
|
|
|
24
24
|
return this;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Check if the provided user was provided by LangGraph Studio.
|
|
29
|
+
*
|
|
30
|
+
* By default, if you add custom authorization on your resources, this will also apply to interactions made from the Studio.
|
|
31
|
+
* If you want, you can handle logged-in Studio users in a special way.
|
|
32
|
+
*
|
|
33
|
+
* @param user - The user to check
|
|
34
|
+
* @returns True if the user is a studio user, false otherwise
|
|
35
|
+
*/
|
|
36
|
+
export function isStudioUser(user) {
|
|
37
|
+
return user.identity === "langgraph-studio-user";
|
|
38
|
+
}
|
|
27
39
|
export { HTTPException } from "./error.js";
|