From 4be86b2a5171d75e7dd2ced69e5ee6b872857dec Mon Sep 17 00:00:00 2001 From: Tat Dat Duong Date: Thu, 10 Apr 2025 17:03:03 +0200 Subject: [PATCH] feat(docs): update typedoc references for auth --- docs/docs/concepts/auth.md | 1 + docs/docs/how-tos/auth/custom_auth.md | 4 -- libs/sdk-js/package.json | 2 +- libs/sdk-js/src/auth/index.ts | 4 ++ libs/sdk-js/src/auth/types.ts | 63 +++++++++++++++++++++++++++ libs/sdk-js/typedoc.auth.json | 5 +++ 6 files changed, 74 insertions(+), 5 deletions(-) create mode 100644 libs/sdk-js/typedoc.auth.json diff --git a/docs/docs/concepts/auth.md b/docs/docs/concepts/auth.md index 91980ecc0..713e24e68 100644 --- a/docs/docs/concepts/auth.md +++ b/docs/docs/concepts/auth.md @@ -419,6 +419,7 @@ Here are all the supported action handlers: | | `@auth.on.crons.search` | Listing cron jobs | [`CronsSearch`](../cloud/reference/sdk/python_sdk_ref.md#langgraph_sdk.auth.types.CronsSearch) | ???+ note "About Runs" + Runs are scoped to their parent thread for access control. This means permissions are typically inherited from the thread, reflecting the conversational nature of the data model. All run operations (reading, listing) except creation are controlled by the thread's handlers. There is a specific `create_run` handler for creating new runs because it had more arguments that you can view in the handler. diff --git a/docs/docs/how-tos/auth/custom_auth.md b/docs/docs/how-tos/auth/custom_auth.md index de85f6cda..9ae62b169 100644 --- a/docs/docs/how-tos/auth/custom_auth.md +++ b/docs/docs/how-tos/auth/custom_auth.md @@ -9,10 +9,6 @@ For a more guided walkthrough, see [**setting up custom authentication**](../../tutorials/auth/getting_started.md) tutorial. -???+ note "Python only" - - We currently only support custom authentication and authorization in Python deployments with `langgraph-api>=0.0.11`. Support for LangGraph.JS will be added soon. - ???+ note "Support by deployment type" Custom auth is supported for all deployments in the **managed LangGraph Cloud**, as well as **Enterprise** self-hosted plans. It is not supported for **Lite** self-hosted plans. diff --git a/libs/sdk-js/package.json b/libs/sdk-js/package.json index 168c73bda..3251a12aa 100644 --- a/libs/sdk-js/package.json +++ b/libs/sdk-js/package.json @@ -11,7 +11,7 @@ "format": "prettier --write src", "lint": "prettier --check src && tsc --noEmit", "test": "NODE_OPTIONS=--experimental-vm-modules jest --testPathIgnorePatterns=\\.int\\.test.ts", - "typedoc": "typedoc && typedoc src/react/index.ts --out docs/react --options typedoc.react.json" + "typedoc": "typedoc && typedoc src/react/index.ts --out docs/react --options typedoc.react.json && typedoc src/auth/index.ts --out docs/auth --options typedoc.auth.json" }, "main": "index.js", "license": "MIT", diff --git a/libs/sdk-js/src/auth/index.ts b/libs/sdk-js/src/auth/index.ts index 2b0818f4a..c7b1ffb1f 100644 --- a/libs/sdk-js/src/auth/index.ts +++ b/libs/sdk-js/src/auth/index.ts @@ -13,6 +13,10 @@ export class Auth< TAuthReturn extends BaseAuthReturn = BaseAuthReturn, TUser extends BaseUser = ToUserLike, > { + /** + * @internal + * @ignore + */ "~handlerCache": { authenticate?: AuthenticateCallback; callbacks?: Record; diff --git a/libs/sdk-js/src/auth/types.ts b/libs/sdk-js/src/auth/types.ts index e9329bf54..cc12c4e5b 100644 --- a/libs/sdk-js/src/auth/types.ts +++ b/libs/sdk-js/src/auth/types.ts @@ -11,6 +11,9 @@ interface AssistantConfig { }>; } +/** + * @inline + */ interface AssistantCreate { assistant_id?: Maybe; metadata?: Maybe>; @@ -20,11 +23,17 @@ interface AssistantCreate { graph_id: string; } +/** + * @inline + */ interface AssistantRead { assistant_id: string; metadata?: Maybe>; } +/** + * @inline + */ interface AssistantUpdate { assistant_id: string; metadata?: Maybe>; @@ -34,10 +43,16 @@ interface AssistantUpdate { version?: Maybe; } +/** + * @inline + */ interface AssistantDelete { assistant_id: string; } +/** + * @inline + */ interface AssistantSearch { graph_id?: Maybe; metadata?: Maybe>; @@ -45,27 +60,42 @@ interface AssistantSearch { offset?: Maybe; } +/** + * @inline + */ interface ThreadCreate { thread_id?: Maybe; metadata?: Maybe>; if_exists?: Maybe<"raise" | "do_nothing">; } +/** + * @inline + */ interface ThreadRead { thread_id?: Maybe; } +/** + * @inline + */ interface ThreadUpdate { thread_id?: Maybe; metadata?: Maybe>; action?: Maybe<"interrupt" | "rollback">; } +/** + * @inline + */ interface ThreadDelete { thread_id?: Maybe; run_id?: Maybe; } +/** + * @inline + */ interface ThreadSearch { thread_id?: Maybe; status?: Maybe<"idle" | "busy" | "interrupted" | "error" | (string & {})>; @@ -75,6 +105,9 @@ interface ThreadSearch { offset?: Maybe; } +/** + * @inline + */ interface CronCreate { payload?: Maybe>; schedule: string; @@ -84,20 +117,32 @@ interface CronCreate { end_time?: Maybe; } +/** + * @inline + */ interface CronRead { cron_id: string; } +/** + * @inline + */ interface CronUpdate { cron_id: string; payload?: Maybe>; schedule?: Maybe; } +/** + * @inline + */ interface CronDelete { cron_id: string; } +/** + * @inline + */ interface CronSearch { assistant_id?: Maybe; thread_id?: Maybe; @@ -105,17 +150,26 @@ interface CronSearch { offset?: Maybe; } +/** + * @inline + */ interface StorePut { namespace: string[]; key: string; value: Record; } +/** + * @inline + */ interface StoreGet { namespace: Maybe; key: string; } +/** + * @inline + */ interface StoreSearch { namespace?: Maybe; filter?: Maybe>; @@ -124,6 +178,9 @@ interface StoreSearch { query?: Maybe; } +/** + * @inline + */ interface StoreListNamespaces { namespace?: Maybe; suffix?: Maybe; @@ -132,11 +189,17 @@ interface StoreListNamespaces { offset?: Maybe; } +/** + * @inline + */ interface StoreDelete { namespace?: Maybe; key: string; } +/** + * @inline + */ interface RunsCreate { thread_id?: Maybe; assistant_id: string; diff --git a/libs/sdk-js/typedoc.auth.json b/libs/sdk-js/typedoc.auth.json new file mode 100644 index 000000000..1cb718f4a --- /dev/null +++ b/libs/sdk-js/typedoc.auth.json @@ -0,0 +1,5 @@ +{ + "pageTitleTemplates": { + "index": "{projectName}/auth" + } +}