@productcraft/platform-auth 1.0.1 → 1.0.3
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/api.md +54 -54
- package/dist/index.cjs +55 -55
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +56 -56
- package/dist/index.d.ts +56 -56
- package/dist/index.js +55 -55
- package/dist/index.js.map +1 -1
- package/manifest.json +46 -46
- package/package.json +25 -8
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/_generated/resources.ts","../src/_generated/types.ts","../src/_generated/client.ts","../src/_generated/errors.ts"],"names":["PlatformAuth","APIClient","PC_BASE_URL","createOpenAPIClient"],"mappings":";;;;;;;;;AAgBA,SAAS,SAAA,CAAa,QAAW,KAAA,EAAiB;AAChD,EAAA,IAAI,KAAA,CAAM,QAAA,KAAa,MAAA,EAAW,OAAO,MAAA;AACzC,EAAA,MAAM,CAAA,GAAK,UAAU,EAAC;AACtB,EAAA,OAAQ,CAAA,CAAE,aAAa,MAAA,GAAY,EAAE,GAAG,CAAA,EAAG,QAAA,EAAU,KAAA,CAAM,QAAA,EAAS,GAAI,CAAA;AAC1E;AAGA,SAAS,SAAS,MAAA,EAAsC;AACtD,EAAA,MAAM,IAAA,GAAO,IAAI,QAAA,EAAS;AAC1B,EAAA,KAAA,MAAW,CAAC,GAAG,CAAC,CAAA,IAAK,OAAO,OAAA,CAAQ,MAAA,IAAU,EAAE,CAAA,EAAG;AACjD,IAAA,IAAI,CAAA,KAAM,MAAA,IAAa,CAAA,KAAM,IAAA,EAAM;AACnC,IAAA,IAAI,CAAA,YAAa,IAAA,EAAM,IAAA,CAAK,MAAA,CAAO,GAAG,CAAC,CAAA;AAAA,SAClC,IAAA,CAAK,MAAA,CAAO,CAAA,EAAG,OAAO,CAAA,KAAM,QAAA,GAAW,IAAA,CAAK,SAAA,CAAU,CAAC,CAAA,GAAI,MAAA,CAAO,CAAC,C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EAAoB,iBAAA,EAAmB,gBAAA,EAAkB,yBAAyB,uBAAA,EAAyB,iBAAA,EAAmB,YAAA,EAAc,mBAAA,EAAqB,wBAAwB,CAAA","file":"index.cjs","sourcesContent":["// Generated by scripts/gen-sdk.mjs from Specs/platform-auth.json. Do not edit.\n\nimport type { APIClient, APIPromise, PagePromise, PollOptions, RequestOptions } from \"@productcraft/core\";\nimport type * as T from \"./types.js\";\n\ntype Bound = Readonly<Record<string, string | undefined>>;\n\n/** Split params into [picked, rest] by key. */\nfunction split(params: object | undefined, keys: readonly string[]): [Record<string, unknown>, Record<string, unknown>] {\n const picked: Record<string, unknown> = {};\n const rest: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(params ?? {})) (keys.includes(k) ? picked : rest)[k] = v;\n return [picked, rest];\n}\n\n/** Fill `actor_id` from a scope bound with `.as(actorId)`, unless the call passes one. */\nfunction fillActor<P>(params: P, bound: Bound): P {\n if (bound.actor_id === undefined) return params;\n const p = (params ?? {}) as Record<string, unknown>;\n return (p.actor_id === undefined ? { ...p, actor_id: bound.actor_id } : p) as P;\n}\n\n/** A form upload as FormData: Blobs (and Files, with their names) as they are, everything else as a string. */\nfunction formData(fields: object | undefined): FormData {\n const form = new FormData();\n for (const [k, v] of Object.entries(fields ?? {})) {\n if (v === undefined || v === null) continue;\n if (v instanceof Blob) form.append(k, v);\n else form.append(k, typeof v === \"object\" ? JSON.stringify(v) : String(v));\n }\n return form;\n}\n\nexport class APIResource {\n protected readonly _client: APIClient;\n /** Path parameters (and `actor_id`) bound by the enclosing scope. */\n protected readonly _b: Bound;\n constructor(client: APIClient, bound: Bound = {}) {\n this._client = client;\n this._b = bound;\n }\n}\n\nvoid split;\nvoid fillActor;\n/** `account` */\nexport class AccountResource extends APIResource {\n /**\n * Delete the calling account. Auto-promotes the oldest admin (or oldest non-self member) to owner in any workspace where the departing account is the sole owner. Linked provider grants that require server-side revocation (Sign in with Apple) are revoked with the provider.\n *\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The session lacks the required action for self-account deletion (defence-in-depth — the route is guarded but the cookie may be present without action access).\n * @throws {NotFoundError} 404 NOT_FOUND: No account row exists for the session principal. Should never fire for a valid session — surfaced for SDKs.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/account\n * @see https://productcraft.co/docs/platform/api-reference#delete-v1-account\n * @example\n * ```ts\n * await platform.account.erase();\n * ```\n */\n erase(options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/account\" }, options);\n }\n}\n\n/** `apiKeys` */\nexport class ApiKeysResource extends APIResource {\n /**\n * Describe the workspace key making this request: its name, workspace, expiry and what it may do in plain sentences. Call it with `Authorization: Bearer pcft_live_…` to test a key right after minting it.\n *\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: No bearer, or the key is unknown, revoked or expired.\n * @throws {PermissionDeniedError} 403 FORBIDDEN, WORKSPACE_KEY_REQUIRED: Signed in with a session or another token instead of a workspace key (`WORKSPACE_KEY_REQUIRED`). Send the `pcft_live_…` key as the bearer.\n * @throws {NotFoundError} 404 NOT_FOUND, PAK_NOT_FOUND: The key was deleted while the request was in flight (`PAK_NOT_FOUND`).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/api-keys/self\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-api-keys-self\n * @example\n * ```ts\n * const apiKeySelf = await platform.apiKeys.self();\n * ```\n */\n self(options?: RequestOptions): APIPromise<T.WithLastResponse<T.ApiKeySelf>> {\n return this._client.request({ method: \"GET\", path: \"/v1/api-keys/self\" }, options);\n }\n}\n\n/** `auth.password` */\nexport class AuthPasswordResource extends APIResource {\n /**\n * Request a password reset email. Neither the response nor its timing reveals whether the email matched an account.\n *\n * @param params - `PlatformAuth.AuthPasswordRequestResetParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Body failed validation (`email` missing or not an email address). Depends only on the request shape, never on whether an account exists.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: more than 10 requests/min from this IP (strict `auth` bucket). `Retry-After` header set. Per-IP limit: rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/auth/password/request-reset\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-auth-password-request-reset\n * @example\n * ```ts\n * await platform.auth.password.requestReset({ email: \"user@example.com\" });\n * ```\n */\n requestReset(params: T.AuthPasswordRequestResetParams, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"POST\", path: \"/v1/auth/password/request-reset\", body: params, public: true }, options);\n }\n /**\n * Reset password using the email-delivered reset token.\n *\n * @param params - `PlatformAuth.AuthPasswordResetParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, PASSWORD_RESET_INVALID: Body failed validation, the new password fails the password policy, or the reset token is invalid or expired (`PASSWORD_RESET_INVALID`).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: more than 10 requests/min from this IP (strict `auth` bucket). `Retry-After` header set. Per-IP limit: rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/auth/password/reset\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-auth-password-reset\n * @example\n * ```ts\n * await platform.auth.password.reset({ new_password: \"MyNewPassword123\", token: \"123456\" });\n * ```\n */\n reset(params: T.AuthPasswordResetParams, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"POST\", path: \"/v1/auth/password/reset\", body: params, public: true }, options);\n }\n}\n\n/** `auth` */\nexport class AuthResource extends APIResource {\n #password?: AuthPasswordResource;\n get password(): AuthPasswordResource {\n return (this.#password ??= new AuthPasswordResource(this._client, this._b));\n }\n /**\n * Logout by revoking refresh token\n *\n * @param params - `PlatformAuth.AuthLogoutParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failed or invalid token\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/auth/logout\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-auth-logout\n * @example\n * ```ts\n * await platform.auth.logout({ refresh_token: \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\" });\n * ```\n */\n logout(params: T.AuthLogoutParams, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"POST\", path: \"/v1/auth/logout\", body: params, public: true }, options);\n }\n /**\n * Revoke the server-side session tied to the caller’s current access token\n *\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid access token\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/auth/logout-current\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-auth-logout-current\n * @example\n * ```ts\n * await platform.auth.logoutCurrent();\n * ```\n */\n logoutCurrent(options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"POST\", path: \"/v1/auth/logout-current\" }, options);\n }\n /**\n * Refresh access token using refresh token\n *\n * @param params - `PlatformAuth.AuthRefreshParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failed or invalid token\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/auth/refresh\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-auth-refresh\n * @example\n * ```ts\n * const token = await platform.auth.refresh({ refresh_token: \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\" });\n * ```\n */\n refresh(params: T.AuthRefreshParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Token>> {\n return this._client.request({ method: \"POST\", path: \"/v1/auth/refresh\", body: params, public: true }, options);\n }\n /**\n * Sign in with email/username and password\n *\n * Every failed attempt answers `401 INVALID_CREDENTIALS`, whatever went wrong: unknown identifier, wrong password, an account with no password credential, an account locked out through a different identifier, an account an operator has blocked, and a wrong password against a suspended or deactivated account. The responses are deliberately identical in body, timing, DB round trips and Redis ops, so signin is not an account-existence oracle. See core/block/CLAUDE.md.\n *\n * @param params - `PlatformAuth.AuthSigninParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failed\n * @throws {AuthenticationError} 401 UNAUTHORIZED, INVALID_CREDENTIALS: Invalid credentials (`INVALID_CREDENTIALS`). Returned for every failed attempt, including a correct password offered while the account is locked out or blocked, and a wrong password against a suspended or deactivated account. The body never says which.\n * @throws {PermissionDeniedError} 403 FORBIDDEN, ACCOUNT_SUSPENDED, ACCOUNT_DEACTIVATED: The account is suspended (`ACCOUNT_SUSPENDED`) or deactivated (`ACCOUNT_DEACTIVATED`). Only reachable once the caller has proven the password — a wrong password against such an account is a 401.\n * @throws {RateLimitError} 429 RATE_LIMITED, TOO_MANY_ATTEMPTS: Too many attempts for this identifier (`TOO_MANY_ATTEMPTS`). Two counters produce it, both keyed purely by the submitted identifier: a burst limit of 5 attempts per minute, and a 15-minute lock after 4 failed attempts. Both fire on the same attempt for a registered and an unregistered identifier. Per-IP limit: rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/auth/signin\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-auth-signin\n * @example\n * ```ts\n * const token = await platform.auth.signin({ identifier: \"user@example.com\", password: \"MySecurePassword123\" });\n * ```\n */\n signin(params: T.AuthSigninParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Token>> {\n return this._client.request({ method: \"POST\", path: \"/v1/auth/signin\", body: params, public: true }, options);\n }\n /**\n * Create a new account and sign in\n *\n * @param params - `PlatformAuth.AuthSignupParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failed\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/auth/signup\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-auth-signup\n * @example\n * ```ts\n * const token = await platform.auth.signup({ email: \"user@example.com\", password: \"MySecurePassword123\", username: \"john_doe\" });\n * ```\n */\n signup(params: T.AuthSignupParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Token>> {\n return this._client.request({ method: \"POST\", path: \"/v1/auth/signup\", body: params, public: true }, options);\n }\n}\n\n/** `introspect.workspaces` */\nexport class IntrospectWorkspacesResource extends APIResource {\n /**\n * Introspect caller's membership + effective policy + enabled services in a workspace\n *\n * @param workspaceId - Id of the workspace.\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session. Also a session that has been signed out (`SESSION_REVOKED`).\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found (unknown slug or id). Known workspaces the caller is not a member of answer 200 with `is_member: false`.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/introspect/workspaces/{workspace_id}\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-introspect-workspaces-workspace-id\n * @example\n * ```ts\n * const introspectWorkspace = await platform.introspect.workspaces.retrieve(\"workspace\");\n * ```\n */\n retrieve(workspaceId: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.IntrospectWorkspace>> {\n return this._client.request({ method: \"GET\", path: \"/v1/introspect/workspaces/{workspace_id}\", pathParams: { workspace_id: workspaceId } }, options);\n }\n}\n\n/** `introspect` */\nexport class IntrospectResource extends APIResource {\n #workspaces?: IntrospectWorkspacesResource;\n get workspaces(): IntrospectWorkspacesResource {\n return (this.#workspaces ??= new IntrospectWorkspacesResource(this._client, this._b));\n }\n /**\n * Resolve a Platform API Key (PAK) to its workspace + IAM-style policy. Downstream services use this with a 60s LRU cache and evaluate the policy via @repo/authz-nestjs evaluatePolicy().\n *\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or malformed `Authorization: Bearer` header, or the PAK is unknown, revoked or expired.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/introspect/api-key\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-introspect-api-key\n * @example\n * ```ts\n * const introspectApiKey = await platform.introspect.apiKey();\n * ```\n */\n apiKey(options?: RequestOptions): APIPromise<T.WithLastResponse<T.IntrospectApiKey>> {\n return this._client.request({ method: \"POST\", path: \"/v1/introspect/api-key\" }, options);\n }\n /**\n * Introspect current user with workspace list\n *\n * @param options - Per-request options.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: more than 60 requests/min from this IP (default bucket). Anonymous callers, and callers whose session has been signed out, otherwise get 200 with `is_authenticated: false`, never 401. Per-IP limit: rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/introspect\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-introspect\n * @example\n * ```ts\n * const introspect = await platform.introspect.retrieve();\n * ```\n */\n retrieve(options?: RequestOptions): APIPromise<T.WithLastResponse<T.Introspect>> {\n return this._client.request({ method: \"GET\", path: \"/v1/introspect\" }, options);\n }\n}\n\n/** `me.avatar` */\nexport class MeAvatarResource extends APIResource {\n /**\n * Clear the caller's avatar and delete the stored object.\n *\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: No session.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/me/avatar\n * @see https://productcraft.co/docs/platform/api-reference#delete-v1-me-avatar\n * @example\n * ```ts\n * await platform.me.avatar.clear();\n * ```\n */\n clear(options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/me/avatar\" }, options);\n }\n /**\n * Upload (or replace) the caller's avatar. PNG/JPEG/WEBP only — SVG is rejected because user-uploaded SVG from a productcraft.co origin is a stored-XSS vector. ≤2 MB. Magic bytes are sniffed; a mislabeled file is rejected.\n *\n * @param params - `PlatformAuth.MeAvatarUploadParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid file: wrong mimetype, oversized, or content does not match the declared type.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: No session.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/me/avatar\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-me-avatar\n * @example\n * ```ts\n * const avatarUrl = await platform.me.avatar.upload({ file: new File([\"…\"], \"image.png\", { type: \"image/png\" }) });\n * ```\n */\n upload(params: T.MeAvatarUploadParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.AvatarUrl>> {\n return this._client.request({ method: \"POST\", path: \"/v1/me/avatar\", body: formData(params) }, options);\n }\n}\n\n/** `me.hiddenGuides` */\nexport class MeHiddenGuidesResource extends APIResource {\n /**\n * Hide a getting-started guide for the caller.\n *\n * Idempotent: hiding a guide that is already hidden returns it unchanged, with its first `hidden_at`. At most 200 are kept; hiding one more drops the oldest.\n *\n * @param key - The guide: a surface name, optionally followed by `:` and a resource id, e.g. `dashboard:<workspace id>` or `all`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: The key is not a valid guide key.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: No session.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller authenticated with a non-human principal (e.g. a workspace API key). Hidden guides are a person's console preference.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PUT /v1/me/hidden-guides/{key}\n * @see https://productcraft.co/docs/platform/api-reference#put-v1-me-hidden-guides-key\n * @example\n * ```ts\n * const hiddenGuide = await platform.me.hiddenGuides.hide(\"key\");\n * ```\n */\n hide(key: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.HiddenGuide>> {\n return this._client.request({ method: \"PUT\", path: \"/v1/me/hidden-guides/{key}\", pathParams: { key } }, options);\n }\n /**\n * List the getting-started guides the caller has hidden.\n *\n * Every guide the caller has hidden in the console, newest first. Hiding is presentation only: the setup status behind a guide is unchanged.\n *\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: No session.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller authenticated with a non-human principal (e.g. a workspace API key). Hidden guides are a person's console preference.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/me/hidden-guides\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-me-hidden-guides\n * @example\n * ```ts\n * const hiddenGuides = await platform.me.hiddenGuides.list();\n * ```\n */\n list(options?: RequestOptions): APIPromise<T.WithLastResponse<T.HiddenGuides>> {\n return this._client.request({ method: \"GET\", path: \"/v1/me/hidden-guides\" }, options);\n }\n /**\n * Show every getting-started guide again.\n *\n * Removes every hidden guide for the caller, `all` included. Idempotent.\n *\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: No session.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller authenticated with a non-human principal (e.g. a workspace API key). Hidden guides are a person's console preference.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/me/hidden-guides\n * @see https://productcraft.co/docs/platform/api-reference#delete-v1-me-hidden-guides\n * @example\n * ```ts\n * await platform.me.hiddenGuides.reset();\n * ```\n */\n reset(options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/me/hidden-guides\" }, options);\n }\n /**\n * Show a hidden getting-started guide again.\n *\n * Idempotent: showing a guide that is not hidden is a no-op.\n *\n * @param key - The guide: a surface name, optionally followed by `:` and a resource id, e.g. `dashboard:<workspace id>` or `all`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: The key is not a valid guide key.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: No session.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller authenticated with a non-human principal (e.g. a workspace API key). Hidden guides are a person's console preference.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/me/hidden-guides/{key}\n * @see https://productcraft.co/docs/platform/api-reference#delete-v1-me-hidden-guides-key\n * @example\n * ```ts\n * await platform.me.hiddenGuides.unhide(\"key\");\n * ```\n */\n unhide(key: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/me/hidden-guides/{key}\", pathParams: { key } }, options);\n }\n}\n\n/** `me.profile` */\nexport class MeProfileResource extends APIResource {\n /**\n * Update the caller's profile. Currently only `displayName` is editable. An empty body is a no-op that returns the current profile. Cookie/JWT only — this is a human-self-service surface, not a PAK-mutation surface.\n *\n * @param params - `PlatformAuth.MeProfileUpdateParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failed (e.g. displayName outside 1-128 chars).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: No session.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller authenticated with a non-human principal (e.g. PAK). Profile is per-human; only the human owner can mutate their own row.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PATCH /v1/me/profile\n * @see https://productcraft.co/docs/platform/api-reference#patch-v1-me-profile\n * @example\n * ```ts\n * const meProfile = await platform.me.profile.update({ display_name: \"string\" });\n * ```\n */\n update(params?: T.MeProfileUpdateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.MeProfile>> {\n return this._client.request({ method: \"PATCH\", path: \"/v1/me/profile\", body: params }, options);\n }\n}\n\n/** `me` */\nexport class MeResource extends APIResource {\n #avatar?: MeAvatarResource;\n #hiddenGuides?: MeHiddenGuidesResource;\n #profile?: MeProfileResource;\n get avatar(): MeAvatarResource {\n return (this.#avatar ??= new MeAvatarResource(this._client, this._b));\n }\n get hiddenGuides(): MeHiddenGuidesResource {\n return (this.#hiddenGuides ??= new MeHiddenGuidesResource(this._client, this._b));\n }\n get profile(): MeProfileResource {\n return (this.#profile ??= new MeProfileResource(this._client, this._b));\n }\n /**\n * Read the caller's account profile.\n *\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: No session.\n * @throws {NotFoundError} 404 NOT_FOUND: No account row for the session principal. Should never fire for a valid session — surfaced for SDKs.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/me\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-me\n * @example\n * ```ts\n * const meProfile = await platform.me.retrieve();\n * ```\n */\n retrieve(options?: RequestOptions): APIPromise<T.WithLastResponse<T.MeProfile>> {\n return this._client.request({ method: \"GET\", path: \"/v1/me\" }, options);\n }\n}\n\n/** `oauth.connections` */\nexport class OauthConnectionsResource extends APIResource {\n /**\n * Disconnect a client\n *\n * Revokes the whole grant family — the grant, its authorization codes, its refresh tokens and every live access token — in one transaction.\n *\n * @param grantId - Id of the grant.\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.\n * @throws {NotFoundError} 404 NOT_FOUND: No such connection for this human.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/oauth/connections/{grant_id}\n * @see https://productcraft.co/docs/platform/api-reference#delete-v1-oauth-connections-grant-id\n * @example\n * ```ts\n * await platform.oauth.connections.delete(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * ```\n */\n delete(grantId: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/oauth/connections/{grant_id}\", pathParams: { grant_id: grantId } }, options);\n }\n /**\n * List clients this human has connected\n *\n * The user-facing half of revocation: which third-party clients hold a grant, in which workspace, carrying which policy.\n *\n * @param params - `PlatformAuth.OauthConnectionListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/oauth/connections\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-oauth-connections\n * @example\n * ```ts\n * for await (const connection of platform.oauth.connections.list()) {\n * console.log(connection);\n * }\n * const page = await platform.oauth.connections.list({}, { timeout: 5_000 });\n * ```\n */\n list(params?: T.OauthConnectionListParams, options?: RequestOptions): PagePromise<T.ConnectedClient> {\n return this._client.list({ method: \"GET\", path: \"/v1/oauth/connections\", query: params }, options);\n }\n}\n\n/** `oauth.workspaces.connections` */\nexport class OauthWorkspacesConnectionsResource extends APIResource {\n /**\n * Disconnect a client on behalf of the workspace\n *\n * Revokes the whole grant family for a grant made by any member of this workspace — the lever a workspace owner needs when an employee leaves and their MCP client is still running. Requires `workspace.connection.revoke`.\n *\n * @param workspaceId - Id of the workspace.\n * @param grantId - Id of the grant.\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: Not a member, or lacks `workspace.connection.revoke`.\n * @throws {NotFoundError} 404 NOT_FOUND: No such connection in this workspace.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/oauth/workspaces/{workspace_id}/connections/{grant_id}\n * @see https://productcraft.co/docs/platform/api-reference#delete-v1-oauth-workspaces-workspace-id-connections-grant-id\n * @example\n * ```ts\n * await platform.oauth.workspaces.connections.delete(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\", \"5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6\");\n * ```\n */\n delete(workspaceId: string, grantId: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/oauth/workspaces/{workspace_id}/connections/{grant_id}\", pathParams: { workspace_id: workspaceId, grant_id: grantId } }, options);\n }\n /**\n * List every client connected to a workspace\n *\n * The workspace-side half of revocation, for owners and admins: every grant made against this workspace, by any member, including grants made by people who have since left. Requires `workspace.connection.read`.\n *\n * @param workspaceId - Id of the workspace.\n * @param params - `PlatformAuth.OauthWorkspaceConnectionListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: Not a member, or lacks `workspace.connection.read`.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/oauth/workspaces/{workspace_id}/connections\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-oauth-workspaces-workspace-id-connections\n * @example\n * ```ts\n * for await (const connection of platform.oauth.workspaces.connections.list(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\")) {\n * console.log(connection);\n * }\n * const page = await platform.oauth.workspaces.connections.list(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\", {}, { timeout: 5_000 });\n * ```\n */\n list(workspaceId: string, params?: T.OauthWorkspaceConnectionListParams, options?: RequestOptions): PagePromise<T.ConnectedClient> {\n return this._client.list({ method: \"GET\", path: \"/v1/oauth/workspaces/{workspace_id}/connections\", pathParams: { workspace_id: workspaceId }, query: params }, options);\n }\n /**\n * Lift a workspace revocation so the member may reconnect\n *\n * A workspace revocation is durable: the member re-running the connect flow does not undo it, so an administrator has to. This clears the block only — every token minted under the old grant stays revoked and the member still has to approve a fresh consent screen. Requires `workspace.connection.revoke`.\n *\n * @param workspaceId - Id of the workspace.\n * @param grantId - Id of the grant.\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session, or a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN: Not a member, or lacks `workspace.connection.revoke`.\n * @throws {NotFoundError} 404 NOT_FOUND: No such connection in this workspace.\n * @throws {ConflictError} 409 CONFLICT: The connection was not revoked by an administrator — there is nothing to lift.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/oauth/workspaces/{workspace_id}/connections/{grant_id}/restore\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-oauth-workspaces-workspace-id-connections-grant-id-restore\n * @example\n * ```ts\n * await platform.oauth.workspaces.connections.restore(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\", \"5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6\");\n * ```\n */\n restore(workspaceId: string, grantId: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"POST\", path: \"/v1/oauth/workspaces/{workspace_id}/connections/{grant_id}/restore\", pathParams: { workspace_id: workspaceId, grant_id: grantId } }, options);\n }\n}\n\n/** `oauth.workspaces` */\nexport class OauthWorkspacesResource extends APIResource {\n #connections?: OauthWorkspacesConnectionsResource;\n get connections(): OauthWorkspacesConnectionsResource {\n return (this.#connections ??= new OauthWorkspacesConnectionsResource(this._client, this._b));\n }\n}\n\n/** `oauth` */\nexport class OauthResource extends APIResource {\n #connections?: OauthConnectionsResource;\n #workspaces?: OauthWorkspacesResource;\n get connections(): OauthConnectionsResource {\n return (this.#connections ??= new OauthConnectionsResource(this._client, this._b));\n }\n get workspaces(): OauthWorkspacesResource {\n return (this.#workspaces ??= new OauthWorkspacesResource(this._client, this._b));\n }\n}\n\n/** `sessions` */\nexport class SessionsResource extends APIResource {\n /**\n * Revoke one of the caller's own sessions. Takes effect immediately — the refresh token stops working straight away, not at the end of its window.\n *\n * @param id - Id of the session.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `id` is not a UUID.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Unauthorized\n * @throws {NotFoundError} 404 NOT_FOUND: No such session, or it belongs to somebody else — deliberately the same response, so this cannot be used to probe which session ids exist.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/session/{id}\n * @see https://productcraft.co/docs/platform/api-reference#delete-v1-session-id\n * @example\n * ```ts\n * const revokeSession = await platform.sessions.delete(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * ```\n */\n delete(id: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.RevokeSession>> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/session/{id}\", pathParams: { id } }, options);\n }\n /**\n * List active sessions\n *\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Unauthorized\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/session\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-session\n * @example\n * ```ts\n * const result = await platform.sessions.list();\n * ```\n */\n list(options?: RequestOptions): APIPromise<T.WithLastResponse<T.SessionListResponse>> {\n return this._client.request({ method: \"GET\", path: \"/v1/session\" }, options);\n }\n /**\n * Sign out every other session of the caller, keeping the one this request was made with. Takes effect immediately for the revoked sessions. Idempotent: a repeat call revokes 0.\n *\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Unauthorized\n * @throws {ConflictError} 409 CONFLICT: The access token maps to no session (minted before sessions tracked token ids), so the current session cannot be kept. Sign in again.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/session/revoke-others\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-session-revoke-others\n * @example\n * ```ts\n * const revokeOtherSessions = await platform.sessions.revokeOthers();\n * ```\n */\n revokeOthers(options?: RequestOptions): APIPromise<T.WithLastResponse<T.RevokeOtherSessions>> {\n return this._client.request({ method: \"POST\", path: \"/v1/session/revoke-others\" }, options);\n }\n}\n\n/** `stats` */\nexport class StatsResource extends APIResource {\n /**\n * Workspace stats\n *\n * Member count, active platform API keys, admin changes in the window with a daily series, the last admin change and the last API-key use, for the console dashboard.\n *\n * Admin changes are workspace audit events that record a mutation. Reads (any action ending `.read`), sign-ins (`auth.signin.succeeded`) and MCP tool-call rows (`workspace.mcp_tool.*`) are not counted, so opening the console does not move the numbers. Days are UTC. Counts and timestamps only: no actor identifiers. Cached for up to 60 seconds (`generated_at`).\n *\n * @param params - `PlatformAuth.StatsRetrieveParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `window` is not one of 1d, 7d, 30d, or `workspaceId` is the slug of a workspace the caller can read rather than its UUID.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of the workspace (`NOT_A_MEMBER`) or lacks `workspace.audit.read` on it.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this id (or slug). Same answer as the service's other workspace routes.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/stats\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-id-stats\n * @example\n * ```ts\n * const workspaceStats = await platform.stats.retrieve();\n * ```\n */\n retrieve(params?: T.StatsRetrieveParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.WorkspaceStats>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/stats\", query: params }, options);\n }\n}\n\n/** `verification` */\nexport class VerificationResource extends APIResource {\n /**\n * Resend verification email\n *\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Unauthorized\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/verification/resend\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-verification-resend\n * @example\n * ```ts\n * const feedback = await platform.verification.resend();\n * ```\n */\n resend(options?: RequestOptions): APIPromise<T.WithLastResponse<T.Feedback>> {\n return this._client.request({ method: \"POST\", path: \"/v1/verification/resend\" }, options);\n }\n /**\n * Verify an email code\n *\n * @param params - `PlatformAuth.VerificationVerifyParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid or expired verification code\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/verification/verify\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-verification-verify\n * @example\n * ```ts\n * const feedback = await platform.verification.verify({ code: \"a1b2c3d4…\" });\n * ```\n */\n verify(params: T.VerificationVerifyParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Feedback>> {\n return this._client.request({ method: \"POST\", path: \"/v1/verification/verify\", body: params, public: true }, options);\n }\n}\n\n/** `wellKnown` */\nexport class WellKnownResource extends APIResource {\n /**\n * Public JWKS for verifying platform-issued JWTs (issuer `https://api.auth.productcraft.co`).\n *\n * @param options - Per-request options.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /.well-known/jwks.json\n * @see https://productcraft.co/docs/platform/api-reference#get-well-known-jwks-json\n * @example\n * ```ts\n * const jwks = await platform.wellKnown.jwks();\n * ```\n */\n jwks(options?: RequestOptions): APIPromise<T.WithLastResponse<T.Jwks>> {\n return this._client.request({ method: \"GET\", path: \"/.well-known/jwks.json\", public: true }, options);\n }\n /**\n * OAuth 2.1 authorization server metadata (RFC 8414)\n *\n * Discovery document for third-party clients (Claude Desktop, Cursor, the ProductCraft MCP server). PKCE with `S256` is mandatory; no other code-challenge method is advertised or accepted. `scopes_supported` lists **presets**, not scopes: authority is the policy document on the grant (`authority_model`).\n *\n * @param options - Per-request options.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /.well-known/oauth-authorization-server\n * @see https://productcraft.co/docs/platform/api-reference#get-well-known-oauth-authorization-server\n * @example\n * ```ts\n * const authorizationServerMetadata = await platform.wellKnown.oauthAuthorizationServer();\n * ```\n */\n oauthAuthorizationServer(options?: RequestOptions): APIPromise<T.WithLastResponse<T.AuthorizationServerMetadata>> {\n return this._client.request({ method: \"GET\", path: \"/.well-known/oauth-authorization-server\", public: true }, options);\n }\n}\n\n/** `workspaces.apiKeys.presets` */\nexport class WorkspacesApiKeysPresetsResource extends APIResource {\n /**\n * List the ready-made permission sets a workspace key can be minted with (`preset` on create), each with a label, a description and what it allows in this workspace, in plain sentences. A preset a key has already used reads its stored policy, so edits show.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, malformed or invalid session.\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.apikey.read`.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_slug}/api-keys/presets\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-api-keys-presets\n * @example\n * ```ts\n * for await (const preset of platform.workspaces.apiKeys.presets.list(\"workspace\")) {\n * console.log(preset);\n * }\n * ```\n */\n list(workspaceSlug: string, options?: RequestOptions): PagePromise<T.PakPreset> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_slug}/api-keys/presets\", pathParams: { workspace_slug: workspaceSlug } }, options);\n }\n}\n\n/** `workspaces.apiKeys` */\nexport class WorkspacesApiKeysResource extends APIResource {\n #presets?: WorkspacesApiKeysPresetsResource;\n get presets(): WorkspacesApiKeysPresetsResource {\n return (this.#presets ??= new WorkspacesApiKeysPresetsResource(this._client, this._b));\n }\n /**\n * Mint a new PAK. Choose what it can do with `preset` (a ready-made set such as `mail-send`) or `policy_ids` (managed policies you wrote), never both. The plaintext `token` is returned ONCE — store it now, then call `GET /v1/api-keys/self` with it to check what it can do. The minter can grant at most their own effective permissions. Cookie/JWT only — PAKs cannot mint other PAKs. Send an `Idempotency-Key` to make a retry safe: a retry of a mint that succeeded mints nothing and answers `409 PAK_ALREADY_MINTED` with that key's `id` (the token itself is never cached).\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param params - `PlatformAuth.WorkspaceApiKeyCreateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, PAK_NAME_REQUIRED, PAK_NAME_TOO_LONG: Body failed validation (`VALIDATION_ERROR`): neither or both of `policy_ids` and `preset`, an unknown `preset`, an empty `policy_ids`, more than 25 policies, or a blank/overlong `name` (`PAK_NAME_REQUIRED` / `PAK_NAME_TOO_LONG`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing, malformed or invalid session. Also a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is a PAK (`pcft_live_*`) — mint requires a human-issued session; or is not a member (`NOT_A_MEMBER`), lacks `workspace.apikey.create`, or cannot grant one or more actions in the chosen preset or policies.\n * @throws {NotFoundError} 404 NOT_FOUND, POLICY_NOT_FOUND: Workspace not found, or one of `policy_ids` does not exist in this workspace (`POLICY_NOT_FOUND`).\n * @throws {ConflictError} 409 CONFLICT, PAK_ALREADY_MINTED, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `PAK_ALREADY_MINTED`: this `Idempotency-Key` already minted a key (its `id` is in `details`); the token was shown once, so rotate that key for a new one. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_slug}/api-keys\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-workspace-slug-api-keys\n * @example\n * ```ts\n * const mintPak = await platform.workspaces.apiKeys.create(\"workspace\", { name: \"Production social client\" });\n * ```\n */\n create(workspaceSlug: string, params: T.WorkspaceApiKeyCreateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.MintPak>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_slug}/api-keys\", pathParams: { workspace_slug: workspaceSlug }, body: params, idempotent: true }, options);\n }\n /**\n * Revoke a PAK. Default behaviour: introspect returns null on the next upstream call; downstream services fail-closed within the 60s cache TTL window. Pass `?force=true` to additionally publish a Redis fan-out that evicts the matching cache entry across every PAK-consuming service immediately — use it when rotating a leaked PAK and the 60s window matters.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param id - Id of the api key.\n * @param params - `PlatformAuth.WorkspaceApiKeyDeleteParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `id` is not a UUID.\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing, malformed or invalid session, or a PAK bearer (this route accepts cookie/JWT sessions only). Also a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.apikey.delete`.\n * @throws {NotFoundError} 404 NOT_FOUND, PAK_NOT_FOUND: Workspace not found, or PAK not found in this workspace (`PAK_NOT_FOUND`). Revoking an already-revoked PAK is a 204 no-op.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_slug}/api-keys/{id}\n * @see https://productcraft.co/docs/platform/api-reference#delete-v1-workspaces-workspace-slug-api-keys-id\n * @example\n * ```ts\n * await platform.workspaces.apiKeys.delete(\"workspace\", \"5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6\");\n * ```\n */\n delete(workspaceSlug: string, id: string, params?: T.WorkspaceApiKeyDeleteParams, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_slug}/api-keys/{id}\", pathParams: { workspace_slug: workspaceSlug, id }, query: params }, options);\n }\n /**\n * List the API keys in this workspace\n *\n * Newest first, as the standard cursor-paginated `{data, pagination}` envelope (20 per page, at most 100). Plaintext tokens are never returned, only prefixes and metadata.\n *\n * **Deprecated legacy shape:** a request that sends neither `limit` nor `cursor` gets a bare JSON array of every key (capped at 1000), unless its `User-Agent` is a ProductCraft SDK (`productcraft-…`), which always gets the envelope. The array is kept only for `@productcraft/platform-auth` 0.0.x clients and is removed in the platform API's next major version; send `limit` (or use an SDK).\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param params - `PlatformAuth.WorkspaceApiKeyListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`, or `include_revoked` is not `true` or `false` (`VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_slug}/api-keys\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-api-keys\n * @example\n * ```ts\n * for await (const apiKey of platform.workspaces.apiKeys.list(\"workspace\")) {\n * console.log(apiKey);\n * }\n * const page = await platform.workspaces.apiKeys.list(\"workspace\", {}, { timeout: 5_000 });\n * ```\n */\n list(workspaceSlug: string, params?: T.WorkspaceApiKeyListParams, options?: RequestOptions): PagePromise<T.PublicApiKey> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_slug}/api-keys\", pathParams: { workspace_slug: workspaceSlug }, query: params }, options);\n }\n /**\n * Describe the key a mint with this `preset` or these `policy_ids` would create, without creating anything: what it could do in plain sentences, and whether you may mint it. Read-only, so it takes no `Idempotency-Key`. Powers the review step of the console key wizard.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param params - `PlatformAuth.WorkspaceApiKeyPreviewParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Body failed validation (`VALIDATION_ERROR`): neither or both of `policy_ids` and `preset`, an unknown `preset`, or an empty or oversized `policy_ids`.\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing, malformed or invalid session. Also a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is a PAK, is not a member (`NOT_A_MEMBER`), or lacks `workspace.apikey.create`. A key you could not mint is NOT a 403 here: it comes back with `grantable: false`.\n * @throws {NotFoundError} 404 NOT_FOUND, POLICY_NOT_FOUND: Workspace not found, or one of `policy_ids` does not exist in this workspace (`POLICY_NOT_FOUND`).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_slug}/api-keys/preview\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-workspace-slug-api-keys-preview\n * @example\n * ```ts\n * const pakGrantPreview = await platform.workspaces.apiKeys.preview(\"workspace\", { policy_ids: [\"11111111-1111-1111-1111-111111111111\"] });\n * ```\n */\n preview(workspaceSlug: string, params?: T.WorkspaceApiKeyPreviewParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.PakGrantPreview>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_slug}/api-keys/preview\", pathParams: { workspace_slug: workspaceSlug }, body: params }, options);\n }\n /**\n * Get a single PAK by id.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param id - Id of the api key.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `id` is not a UUID.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, malformed or invalid session, or a PAK bearer (this route accepts cookie/JWT sessions only).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.apikey.read`.\n * @throws {NotFoundError} 404 NOT_FOUND, PAK_NOT_FOUND: Workspace not found, or PAK not found in this workspace (`PAK_NOT_FOUND`).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_slug}/api-keys/{id}\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-api-keys-id\n * @example\n * ```ts\n * const publicApiKey = await platform.workspaces.apiKeys.retrieve(\"workspace\", \"5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6\");\n * ```\n */\n retrieve(workspaceSlug: string, id: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.PublicApiKey>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_slug}/api-keys/{id}\", pathParams: { workspace_slug: workspaceSlug, id } }, options);\n }\n /**\n * Mint a replacement for an existing PAK, carrying its name, description and policy bindings over. The outgoing key keeps working for `grace_hours` (24 by default) so a fleet can roll over without downtime. The plaintext `token` is returned ONCE. Cookie/JWT only — a PAK cannot rotate a PAK, for the same reason it cannot mint one.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param id - Id of the api key.\n * @param params - `PlatformAuth.WorkspaceApiKeyRotateParams`.\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session, or a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN: Caller is a PAK (`pcft_live_*`), or cannot grant one or more actions in the bindings being carried across.\n * @throws {NotFoundError} 404 NOT_FOUND: PAK not found in this workspace.\n * @throws {ConflictError} 409 CONFLICT, PAK_REVOKED, PAK_EXPIRED: The key is revoked (`PAK_REVOKED`), already expired (`PAK_EXPIRED`), or has no policy bindings to carry across.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_slug}/api-keys/{id}/rotate\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-workspace-slug-api-keys-id-rotate\n * @example\n * ```ts\n * const rotatePak = await platform.workspaces.apiKeys.rotate(\"workspace\", \"5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6\", { grace_hours: 24 });\n * ```\n */\n rotate(workspaceSlug: string, id: string, params?: T.WorkspaceApiKeyRotateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.RotatePak>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_slug}/api-keys/{id}/rotate\", pathParams: { workspace_slug: workspaceSlug, id }, body: params }, options);\n }\n /**\n * Update a PAK’s name or description (does not touch bindings).\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param id - Id of the api key.\n * @param params - `PlatformAuth.WorkspaceApiKeyUpdateParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, PAK_NAME_REQUIRED: `id` is not a UUID, body failed validation, or `name` is blank (`PAK_NAME_REQUIRED`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing, malformed or invalid session, or a PAK bearer (this route accepts cookie/JWT sessions only). Also a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.apikey.update`.\n * @throws {NotFoundError} 404 NOT_FOUND, PAK_NOT_FOUND: Workspace not found, or PAK not found in this workspace (`PAK_NOT_FOUND`).\n * @throws {ConflictError} 409 CONFLICT, PAK_REVOKED: PAK is revoked (`PAK_REVOKED`).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PATCH /v1/workspaces/{workspace_slug}/api-keys/{id}\n * @see https://productcraft.co/docs/platform/api-reference#patch-v1-workspaces-workspace-slug-api-keys-id\n * @example\n * ```ts\n * const publicApiKey = await platform.workspaces.apiKeys.update(\"workspace\", \"5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6\", { description: \"string\" });\n * ```\n */\n update(workspaceSlug: string, id: string, params?: T.WorkspaceApiKeyUpdateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.PublicApiKey>> {\n return this._client.request({ method: \"PATCH\", path: \"/v1/workspaces/{workspace_slug}/api-keys/{id}\", pathParams: { workspace_slug: workspaceSlug, id }, body: params }, options);\n }\n /**\n * Replace the managed-policy bindings on a PAK. Re-runs caller-narrowing on the merged union of statements.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param id - Id of the api key.\n * @param params - `PlatformAuth.WorkspaceApiKeyUpdateBindingsParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: One of: bound > 25 policies; merged > 200 statements; one of the policy ids does not exist or lives in a different workspace.\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session, or a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN: Caller cannot grant one or more actions in the merged statement set.\n * @throws {NotFoundError} 404 NOT_FOUND: PAK not found in this workspace.\n * @throws {ConflictError} 409 CONFLICT: Empty bindings — revoke the PAK instead of leaving it unbound.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PATCH /v1/workspaces/{workspace_slug}/api-keys/{id}/bindings\n * @see https://productcraft.co/docs/platform/api-reference#patch-v1-workspaces-workspace-slug-api-keys-id-bindings\n * @example\n * ```ts\n * const publicApiKey = await platform.workspaces.apiKeys.updateBindings(\"workspace\", \"5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6\", { policy_ids: [\"string\"] });\n * ```\n */\n updateBindings(workspaceSlug: string, id: string, params: T.WorkspaceApiKeyUpdateBindingsParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.PublicApiKey>> {\n return this._client.request({ method: \"PATCH\", path: \"/v1/workspaces/{workspace_slug}/api-keys/{id}/bindings\", pathParams: { workspace_slug: workspaceSlug, id }, body: params }, options);\n }\n}\n\n/** `workspaces.auditFeed` */\nexport class WorkspacesAuditFeedResource extends APIResource {\n /**\n * Unified workspace audit feed (cursor-paginated)\n *\n * Audit timeline for workspace-scoped events — workspace, member, role, invite, service-activation, PAK and OAuth-consent mutations, plus successful sign-ins and completed password resets. Per-app Auth rows are NOT merged in: they live in another database with no cursor that spans both, and they are served by `GET /v1/apps/:appId/audit-logs` (paginated), `.../audit-logs/export` (streamed) and the per-app audit sink. The `sources` field reports that explicitly rather than implying a pending follow-up.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param params - `PlatformAuth.WorkspaceAuditFeedListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid query params — `actor_id` is not a well-formed UUID, or `cursor` is not a cursor this endpoint minted. `since`/`until` that do not parse as ISO-8601 are ignored rather than rejected, and `sources` silently drops unknown names; an empty result set after those filters still returns 200.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller is signed in but lacks `workspace.audit.read` for this workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: The `:workspaceSlug` path param does not resolve to a workspace the caller can see.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_slug}/audit-feed\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-audit-feed\n * @example\n * ```ts\n * for await (const auditFeed of platform.workspaces.auditFeed.list(\"workspace\")) {\n * console.log(auditFeed);\n * }\n * const page = await platform.workspaces.auditFeed.list(\"workspace\", {}, { timeout: 5_000 });\n * ```\n */\n list(workspaceSlug: string, params?: T.WorkspaceAuditFeedListParams, options?: RequestOptions): PagePromise<T.FeedItem> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_slug}/audit-feed\", pathParams: { workspace_slug: workspaceSlug }, query: fillActor(params, this._b) }, options);\n }\n}\n\n/** `workspaces.auditLogs` */\nexport class WorkspacesAuditLogsResource extends APIResource {\n /**\n * Stream the workspace audit log as NDJSON or CSV, applying the same `?action=` / `?actor_id=` / `?since=` / `?until=` filters as the list. Newest first. Reading the export is itself audited.\n *\n * The response is streamed: rows are walked in keyset batches and written as they are read, so neither the service nor the client holds the whole log. This is the SOC 2 / GDPR export the platform docs promise. Hard cap of 1,000,000 rows per call; a wider request is refused with 413 before any body is written, so a truncated file can never masquerade as a complete one.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param params - `PlatformAuth.WorkspaceAuditLogExportParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Unknown `format`, or malformed `since` / `until`.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `workspace.audit.read`.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found.\n * @throws {APIError} 413 PAYLOAD_TOO_LARGE: More than 1,000,000 rows match. Narrow the window with `since` / `until` and retry.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_slug}/audit-logs/export\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-audit-logs-export\n * @example\n * ```ts\n * const response = await platform.workspaces.auditLogs.export(\"workspace\");\n * const text = await response.text();\n * ```\n */\n export(workspaceSlug: string, params?: T.WorkspaceAuditLogExportParams, options?: RequestOptions): APIPromise<Response> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_slug}/audit-logs/export\", pathParams: { workspace_slug: workspaceSlug }, query: fillActor(params, this._b), raw: true }, options);\n }\n /**\n * List workspace audit log entries, newest first. Filter by `?action=`, `?actor_id=`, and/or the `?since=` / `?until=` date range. 20/page (max 100), cursor-paginated.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param params - `PlatformAuth.WorkspaceAuditLogListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`, `since`, or `until`.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_slug}/audit-logs\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-audit-logs\n * @example\n * ```ts\n * for await (const auditLog of platform.workspaces.auditLogs.list(\"workspace\")) {\n * console.log(auditLog);\n * }\n * const page = await platform.workspaces.auditLogs.list(\"workspace\", {}, { timeout: 5_000 });\n * ```\n */\n list(workspaceSlug: string, params?: T.WorkspaceAuditLogListParams, options?: RequestOptions): PagePromise<T.WorkspaceAuditLogEntry> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_slug}/audit-logs\", pathParams: { workspace_slug: workspaceSlug }, query: fillActor(params, this._b) }, options);\n }\n}\n\n/** `workspaces.avatar` */\nexport class WorkspacesAvatarResource extends APIResource {\n /**\n * Clear the workspace avatar and delete the stored object. Gated by `workspace.settings.update`.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid session.\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.settings.update`.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found (unknown slug or id).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_slug}/avatar\n * @see https://productcraft.co/docs/platform/api-reference#delete-v1-workspaces-workspace-slug-avatar\n * @example\n * ```ts\n * await platform.workspaces.avatar.clear(\"workspace\");\n * ```\n */\n clear(workspaceSlug: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_slug}/avatar\", pathParams: { workspace_slug: workspaceSlug } }, options);\n }\n /**\n * Upload (or replace) the workspace identity avatar. Gated by `workspace.settings.update` (owner + admin). PNG/JPEG/WEBP only, ≤2 MB, magic-byte sniffed. SVG is rejected (stored-XSS).\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param params - `PlatformAuth.WorkspaceAvatarUploadParams`.\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: Caller is not a member of this workspace, or lacks workspace.settings.update.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_slug}/avatar\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-workspace-slug-avatar\n * @example\n * ```ts\n * const workspaceAvatarUrl = await platform.workspaces.avatar.upload(\"workspace\", { file: new File([\"…\"], \"image.png\", { type: \"image/png\" }) });\n * ```\n */\n upload(workspaceSlug: string, params: T.WorkspaceAvatarUploadParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.WorkspaceAvatarUrl>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_slug}/avatar\", pathParams: { workspace_slug: workspaceSlug }, body: formData(params) }, options);\n }\n}\n\n/** `workspaces.invites` */\nexport class WorkspacesInvitesResource extends APIResource {\n /**\n * Accept a workspace invite by code. Cookie/JWT only — invite acceptance binds a human identity to a workspace.\n *\n * @param params - `PlatformAuth.WorkspaceInviteAcceptParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Body failed validation (`code` missing or empty).\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session. Also a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, EMAIL_NOT_VERIFIED, INVITE_EMAIL_MISMATCH: Caller is a PAK (`pcft_live_*`), email not verified (`EMAIL_NOT_VERIFIED`), or the invite is restricted to a different email (`INVITE_EMAIL_MISMATCH`).\n * @throws {NotFoundError} 404 NOT_FOUND, INVITE_INVALID: Invite code not found (`INVITE_INVALID`).\n * @throws {ConflictError} 409 CONFLICT, ALREADY_A_MEMBER: Caller is already a member of this workspace (`ALREADY_A_MEMBER`).\n * @throws {APIError} 410 GONE, INVITE_REVOKED, INVITE_EXPIRED, INVITE_EXHAUSTED: Invite revoked (`INVITE_REVOKED`), expired (`INVITE_EXPIRED`) or out of uses (`INVITE_EXHAUSTED`).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: more than 10 requests/min from this IP (strict `auth` bucket). `Retry-After` header set. Per-IP limit: rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/invites/accept\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-invites-accept\n * @example\n * ```ts\n * const workspace = await platform.workspaces.invites.accept({ code: \"inv_…\" });\n * ```\n */\n accept(params: T.WorkspaceInviteAcceptParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Workspace>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/invites/accept\", body: params }, options);\n }\n /**\n * Create a workspace invite link. Cookie/JWT only — invites bring new humans into the workspace.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param params - `PlatformAuth.WorkspaceInviteCreateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Body failed validation.\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session. Also a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, EMAIL_NOT_VERIFIED, NOT_A_MEMBER, OWNER_ROLE_REQUIRED, MEMBER_RANK_EXCEEDED: Caller is a PAK (`pcft_live_*`), email not verified (`EMAIL_NOT_VERIFIED`), not a member (`NOT_A_MEMBER`), lacks `workspace.member.invite`, a non-owner tried to invite an owner (`OWNER_ROLE_REQUIRED`), or the role holds permissions the caller does not (`MEMBER_RANK_EXCEEDED`).\n * @throws {NotFoundError} 404 NOT_FOUND, ROLE_NOT_FOUND: Workspace not found, or role not found in this workspace (`ROLE_NOT_FOUND`).\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_slug}/invites\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-workspace-slug-invites\n * @example\n * ```ts\n * const workspaceInvite = await platform.workspaces.invites.create(\"workspace\", { email: \"alice@example.com\" });\n * ```\n */\n create(workspaceSlug: string, params?: T.WorkspaceInviteCreateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.WorkspaceInvite>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_slug}/invites\", pathParams: { workspace_slug: workspaceSlug }, body: params, idempotent: true }, options);\n }\n /**\n * Revoke a workspace invite. Cookie/JWT only.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param inviteId - Id of the invite.\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session. Also a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is a PAK (`pcft_live_*`), not a member of the invite’s workspace (`NOT_A_MEMBER`), or lacks `workspace.member.invite`.\n * @throws {NotFoundError} 404 NOT_FOUND, INVITE_NOT_FOUND: Workspace not found, or invite not found (`INVITE_NOT_FOUND`).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_slug}/invites/{invite_id}\n * @see https://productcraft.co/docs/platform/api-reference#delete-v1-workspaces-workspace-slug-invites-invite-id\n * @example\n * ```ts\n * await platform.workspaces.invites.delete(\"workspace\", \"invite\");\n * ```\n */\n delete(workspaceSlug: string, inviteId: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_slug}/invites/{invite_id}\", pathParams: { workspace_slug: workspaceSlug, invite_id: inviteId } }, options);\n }\n /**\n * List workspace invites, newest first. Cursor-paginated.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param params - `PlatformAuth.WorkspaceInviteListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid session.\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.member.invite`.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found (unknown slug or id).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_slug}/invites\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-invites\n * @example\n * ```ts\n * for await (const invite of platform.workspaces.invites.list(\"workspace\")) {\n * console.log(invite);\n * }\n * const page = await platform.workspaces.invites.list(\"workspace\", {}, { timeout: 5_000 });\n * ```\n */\n list(workspaceSlug: string, params?: T.WorkspaceInviteListParams, options?: RequestOptions): PagePromise<T.WorkspaceInviteListItem> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_slug}/invites\", pathParams: { workspace_slug: workspaceSlug }, query: params }, options);\n }\n}\n\n/** `workspaces.members` */\nexport class WorkspacesMembersResource extends APIResource {\n /**\n * Remove a member from a workspace (or self-leave)\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param accountId - Id of the account.\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session. Also a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER, MEMBER_RANK_EXCEEDED: Caller is not a member of this workspace (`NOT_A_MEMBER`), lacks `workspace.member.remove` (not required for self-leave), or the target outranks the caller (`MEMBER_RANK_EXCEEDED`: only an owner can remove an owner, and the target role's permissions must all be held by the caller).\n * @throws {NotFoundError} 404 NOT_FOUND, NOT_A_MEMBER: Workspace not found, or target account is not a member (`NOT_A_MEMBER`).\n * @throws {ConflictError} 409 CONFLICT, LAST_MEMBER, SOLE_OWNER: Target is the last member (`LAST_MEMBER`) or the sole owner (`SOLE_OWNER`).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_slug}/members/{account_id}\n * @see https://productcraft.co/docs/platform/api-reference#delete-v1-workspaces-workspace-slug-members-account-id\n * @example\n * ```ts\n * await platform.workspaces.members.delete(\"workspace\", \"account\");\n * ```\n */\n delete(workspaceSlug: string, accountId: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_slug}/members/{account_id}\", pathParams: { workspace_slug: workspaceSlug, account_id: accountId } }, options);\n }\n /**\n * List workspace members, oldest join first. Narrow with `?q=` (name / username / email substring) and/or `?role=`. Cursor-paginated.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param params - `PlatformAuth.WorkspaceMemberListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid session.\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.member.read`.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found (unknown slug or id).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_slug}/members\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-members\n * @example\n * ```ts\n * for await (const member of platform.workspaces.members.list(\"workspace\")) {\n * console.log(member);\n * }\n * const page = await platform.workspaces.members.list(\"workspace\", {}, { timeout: 5_000 });\n * ```\n */\n list(workspaceSlug: string, params?: T.WorkspaceMemberListParams, options?: RequestOptions): PagePromise<T.WorkspaceMember> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_slug}/members\", pathParams: { workspace_slug: workspaceSlug }, query: params }, options);\n }\n /**\n * Update a member's role. Body: { roleId } or { role: \"owner\"|\"admin\"|\"member\" }.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param accountId - Id of the account.\n * @param params - `PlatformAuth.WorkspaceMemberUpdateRoleParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Body failed validation.\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session. Also a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER, OWNER_ROLE_REQUIRED, MEMBER_RANK_EXCEEDED: Caller is not a member of this workspace (`NOT_A_MEMBER`), lacks `workspace.member.update-role`, a non-owner tried to assign the owner role or change an owner (`OWNER_ROLE_REQUIRED`), or a non-owner tried to change a role to or from one holding permissions the caller lacks (`MEMBER_RANK_EXCEEDED`). Admins may make admins, never owners.\n * @throws {NotFoundError} 404 NOT_FOUND, NOT_A_MEMBER, ROLE_NOT_FOUND: Workspace not found, target account is not a member (`NOT_A_MEMBER`), or role not found in this workspace (`ROLE_NOT_FOUND`).\n * @throws {ConflictError} 409 CONFLICT, SOLE_OWNER: Would demote the only owner (`SOLE_OWNER`). Assign another owner first.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PATCH /v1/workspaces/{workspace_slug}/members/{account_id}/role\n * @see https://productcraft.co/docs/platform/api-reference#patch-v1-workspaces-workspace-slug-members-account-id-role\n * @example\n * ```ts\n * const updateMemberRole = await platform.workspaces.members.updateRole(\"workspace\", \"account\", { role: \"owner\" });\n * ```\n */\n updateRole(workspaceSlug: string, accountId: string, params?: T.WorkspaceMemberUpdateRoleParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.UpdateMemberRole>> {\n return this._client.request({ method: \"PATCH\", path: \"/v1/workspaces/{workspace_slug}/members/{account_id}/role\", pathParams: { workspace_slug: workspaceSlug, account_id: accountId }, body: params }, options);\n }\n}\n\n/** `workspaces.policies.actions` */\nexport class WorkspacesPoliciesActionsResource extends APIResource {\n /**\n * List every known workspace action (catalog of statement actions).\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, malformed or invalid session, or a PAK bearer (this route accepts cookie/JWT sessions only).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.policy.read`.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found (unknown slug or id).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_slug}/policies/actions/catalog\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-policies-actions-catalog\n * @example\n * ```ts\n * const workspaceActionCatalog = await platform.workspaces.policies.actions.catalog(\"workspace\");\n * ```\n */\n catalog(workspaceSlug: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.WorkspaceActionCatalog>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_slug}/policies/actions/catalog\", pathParams: { workspace_slug: workspaceSlug } }, options);\n }\n}\n\n/** `workspaces.policies` */\nexport class WorkspacesPoliciesResource extends APIResource {\n #actions?: WorkspacesPoliciesActionsResource;\n get actions(): WorkspacesPoliciesActionsResource {\n return (this.#actions ??= new WorkspacesPoliciesActionsResource(this._client, this._b));\n }\n /**\n * Create a managed policy. Cookie/JWT only — policy authoring is a human-admin surface.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param params - `PlatformAuth.WorkspacePolicyCreateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid policy shape, name, or condition block.\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session, or a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member (`NOT_A_MEMBER`), lacks `workspace.policy.create` (owner and admin hold it by default), or the policy grants an action the caller does not hold.\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: Name already in use, or the workspace already has 100 policies. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_slug}/policies\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-workspace-slug-policies\n * @example\n * ```ts\n * const managedPolicy = await platform.workspaces.policies.create(\"workspace\", {\n * name: \"mail-readonly\",\n * policy: [{ actions: [\"mail.read\", \"mail.list\"], effect: \"allow\", resources: [\"*\"] }],\n * });\n * ```\n */\n create(workspaceSlug: string, params: T.WorkspacePolicyCreateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.ManagedPolicy>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_slug}/policies\", pathParams: { workspace_slug: workspaceSlug }, body: params, idempotent: true }, options);\n }\n /**\n * Delete a managed policy. Cascades: API keys lose the binding (deny-all if no other bindings remain); roles fall back to their inline policy column. Owners and admins; a policy bound to a role, or a preset policy, only an owner can delete. Cookie/JWT only.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param policyId - Id of the policy.\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session, or a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, OWNER_ROLE_REQUIRED: Caller lacks `workspace.policy.delete`, or is not an owner and the policy is bound to a role or is a preset policy (`OWNER_ROLE_REQUIRED`).\n * @throws {NotFoundError} 404 NOT_FOUND, POLICY_NOT_FOUND: Policy not found in this workspace (`POLICY_NOT_FOUND`).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_slug}/policies/{policy_id}\n * @see https://productcraft.co/docs/platform/api-reference#delete-v1-workspaces-workspace-slug-policies-policy-id\n * @example\n * ```ts\n * const managedPolicyDeleted = await platform.workspaces.policies.delete(\"workspace\", \"5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6\");\n * ```\n */\n delete(workspaceSlug: string, policyId: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.ManagedPolicyDeleted>> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_slug}/policies/{policy_id}\", pathParams: { workspace_slug: workspaceSlug, policy_id: policyId } }, options);\n }\n /**\n * List managed policies in a workspace, alphabetically. 20/page (max 100), cursor-paginated.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param params - `PlatformAuth.WorkspacePolicyListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_slug}/policies\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-policies\n * @example\n * ```ts\n * for await (const policy of platform.workspaces.policies.list(\"workspace\")) {\n * console.log(policy);\n * }\n * const page = await platform.workspaces.policies.list(\"workspace\", {}, { timeout: 5_000 });\n * ```\n */\n list(workspaceSlug: string, params?: T.WorkspacePolicyListParams, options?: RequestOptions): PagePromise<T.ManagedPolicy> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_slug}/policies\", pathParams: { workspace_slug: workspaceSlug }, query: params }, options);\n }\n /**\n * Get a managed policy by id\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param policyId - Id of the policy.\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.\n * @throws {NotFoundError} 404 NOT_FOUND: Policy not found in this workspace.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_slug}/policies/{policy_id}\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-policies-policy-id\n * @example\n * ```ts\n * const managedPolicyDetail = await platform.workspaces.policies.retrieve(\"workspace\", \"5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6\");\n * ```\n */\n retrieve(workspaceSlug: string, policyId: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.ManagedPolicyDetail>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_slug}/policies/{policy_id}\", pathParams: { workspace_slug: workspaceSlug, policy_id: policyId } }, options);\n }\n /**\n * Update a managed policy. Owners and admins; a policy bound to a role, or a preset policy, only an owner can edit. Cookie/JWT only — policy authoring is a human-admin surface.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param policyId - Id of the policy.\n * @param params - `PlatformAuth.WorkspacePolicyUpdateParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid policy shape, name, or condition block.\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session, or a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, OWNER_ROLE_REQUIRED: Caller lacks `workspace.policy.update`, cannot grant one or more requested actions, or is not an owner and the policy is bound to a role or is a preset policy (`OWNER_ROLE_REQUIRED`).\n * @throws {NotFoundError} 404 NOT_FOUND, POLICY_NOT_FOUND: Policy not found in this workspace (`POLICY_NOT_FOUND`).\n * @throws {ConflictError} 409 CONFLICT, POLICY_NAME_TAKEN: Name already in use (`POLICY_NAME_TAKEN`).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PATCH /v1/workspaces/{workspace_slug}/policies/{policy_id}\n * @see https://productcraft.co/docs/platform/api-reference#patch-v1-workspaces-workspace-slug-policies-policy-id\n * @example\n * ```ts\n * const managedPolicyDetail = await platform.workspaces.policies.update(\"workspace\", \"5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6\", { description: \"Read-only access to all Mail resources\" });\n * ```\n */\n update(workspaceSlug: string, policyId: string, params?: T.WorkspacePolicyUpdateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.ManagedPolicyDetail>> {\n return this._client.request({ method: \"PATCH\", path: \"/v1/workspaces/{workspace_slug}/policies/{policy_id}\", pathParams: { workspace_slug: workspaceSlug, policy_id: policyId }, body: params }, options);\n }\n}\n\n/** `workspaces.roles` */\nexport class WorkspacesRolesResource extends APIResource {\n /**\n * Create a new custom role. Cookie/JWT only — role authoring is a human-admin surface.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param params - `PlatformAuth.WorkspaceRoleCreateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, POLICY_INVALID: Body failed validation, invalid role name, malformed policy, both `policy_id` and `policy` sent, or an action pattern matches no known permission (`POLICY_INVALID`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing, malformed or invalid session, or a PAK bearer (this route accepts cookie/JWT sessions only). Also a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER, ACTIONS_NOT_GRANTABLE: Caller is not a member of this workspace (`NOT_A_MEMBER`), lacks `workspace.role.create`, or the policy grants actions the caller does not hold (`ACTIONS_NOT_GRANTABLE`).\n * @throws {NotFoundError} 404 NOT_FOUND, POLICY_NOT_FOUND: Workspace not found, or `policy_id` not found in this workspace (`POLICY_NOT_FOUND`).\n * @throws {ConflictError} 409 CONFLICT, ROLE_NAME_TAKEN, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: Role name already in use or reserved for a system role (`ROLE_NAME_TAKEN`). Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_slug}/roles\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-workspace-slug-roles\n * @example\n * ```ts\n * const workspaceRole = await platform.workspaces.roles.create(\"workspace\", { name: \"BillingAdmin\" });\n * ```\n */\n create(workspaceSlug: string, params: T.WorkspaceRoleCreateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.WorkspaceRole>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_slug}/roles\", pathParams: { workspace_slug: workspaceSlug }, body: params, idempotent: true }, options);\n }\n /**\n * Delete a custom role (fails if it has members). Cookie/JWT only — role authoring is a human-admin surface.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param roleId - Id of the role.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `roleId` is not a UUID.\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing, malformed or invalid session, or a PAK bearer (this route accepts cookie/JWT sessions only). Also a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.role.delete`.\n * @throws {NotFoundError} 404 NOT_FOUND, ROLE_NOT_FOUND: Workspace not found, or role not found in this workspace (`ROLE_NOT_FOUND`).\n * @throws {ConflictError} 409 CONFLICT, ROLE_SYSTEM_IMMUTABLE, ROLE_HAS_MEMBERS: Role is a system role (`ROLE_SYSTEM_IMMUTABLE`) or still has members (`ROLE_HAS_MEMBERS`).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_slug}/roles/{role_id}\n * @see https://productcraft.co/docs/platform/api-reference#delete-v1-workspaces-workspace-slug-roles-role-id\n * @example\n * ```ts\n * await platform.workspaces.roles.delete(\"workspace\", \"5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6\");\n * ```\n */\n delete(workspaceSlug: string, roleId: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_slug}/roles/{role_id}\", pathParams: { workspace_slug: workspaceSlug, role_id: roleId } }, options);\n }\n /**\n * List roles in a workspace. System roles first, then alphabetical. 20/page (max 100), cursor-paginated.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param params - `PlatformAuth.WorkspaceRoleListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_slug}/roles\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-roles\n * @example\n * ```ts\n * for await (const role of platform.workspaces.roles.list(\"workspace\")) {\n * console.log(role);\n * }\n * const page = await platform.workspaces.roles.list(\"workspace\", {}, { timeout: 5_000 });\n * ```\n */\n list(workspaceSlug: string, params?: T.WorkspaceRoleListParams, options?: RequestOptions): PagePromise<T.WorkspaceRole> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_slug}/roles\", pathParams: { workspace_slug: workspaceSlug }, query: params }, options);\n }\n /**\n * Get a role + its permissions\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param roleId - Id of the role.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `roleId` is not a UUID.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, malformed or invalid session, or a PAK bearer (this route accepts cookie/JWT sessions only).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.role.read`.\n * @throws {NotFoundError} 404 NOT_FOUND, ROLE_NOT_FOUND: Workspace not found, or role not found in this workspace (`ROLE_NOT_FOUND`).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_slug}/roles/{role_id}\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-roles-role-id\n * @example\n * ```ts\n * const workspaceRole = await platform.workspaces.roles.retrieve(\"workspace\", \"5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6\");\n * ```\n */\n retrieve(workspaceSlug: string, roleId: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.WorkspaceRole>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_slug}/roles/{role_id}\", pathParams: { workspace_slug: workspaceSlug, role_id: roleId } }, options);\n }\n /**\n * Update a role or replace its permission set. Cookie/JWT only — role authoring is a human-admin surface.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param roleId - Id of the role.\n * @param params - `PlatformAuth.WorkspaceRoleUpdateParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `roleId` is not a UUID, body failed validation, malformed policy, both `policy_id` and `policy` sent, or an action pattern matches no known permission.\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing, malformed or invalid session, or a PAK bearer (this route accepts cookie/JWT sessions only). Also a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER, ACTIONS_NOT_GRANTABLE: Caller is not a member of this workspace (`NOT_A_MEMBER`), lacks `workspace.role.update`, or the policy grants actions the caller does not hold (`ACTIONS_NOT_GRANTABLE`).\n * @throws {NotFoundError} 404 NOT_FOUND, ROLE_NOT_FOUND, POLICY_NOT_FOUND: Workspace, role (`ROLE_NOT_FOUND`) or bound policy (`POLICY_NOT_FOUND`) not found in this workspace.\n * @throws {ConflictError} 409 CONFLICT, ROLE_SYSTEM_IMMUTABLE, ROLE_NAME_TAKEN: System roles cannot be renamed, edited or bound (`ROLE_SYSTEM_IMMUTABLE`), or the new name is taken (`ROLE_NAME_TAKEN`).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PATCH /v1/workspaces/{workspace_slug}/roles/{role_id}\n * @see https://productcraft.co/docs/platform/api-reference#patch-v1-workspaces-workspace-slug-roles-role-id\n * @example\n * ```ts\n * const workspaceRole = await platform.workspaces.roles.update(\"workspace\", \"5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6\", { description: \"string\" });\n * ```\n */\n update(workspaceSlug: string, roleId: string, params?: T.WorkspaceRoleUpdateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.WorkspaceRole>> {\n return this._client.request({ method: \"PATCH\", path: \"/v1/workspaces/{workspace_slug}/roles/{role_id}\", pathParams: { workspace_slug: workspaceSlug, role_id: roleId }, body: params }, options);\n }\n}\n\n/** `workspaces.services` */\nexport class WorkspacesServicesResource extends APIResource {\n /**\n * Disable a service (settings are retained)\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param service - The product: `auth`, `mail`, `waitlist`, `social` or `trawl`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, SERVICE_UNKNOWN: Unknown service name (`SERVICE_UNKNOWN`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, malformed or invalid session, or a PAK bearer (this route accepts cookie/JWT sessions only).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.service.disable`.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found (unknown slug or id).\n * @throws {ConflictError} 409 CONFLICT, SERVICE_NOT_ENABLED: Service is not currently enabled (`SERVICE_NOT_ENABLED`).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_slug}/services/{service}\n * @see https://productcraft.co/docs/platform/api-reference#delete-v1-workspaces-workspace-slug-services-service\n * @example\n * ```ts\n * await platform.workspaces.services.disable(\"workspace\", \"service\");\n * ```\n */\n disable(workspaceSlug: string, service: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_slug}/services/{service}\", pathParams: { workspace_slug: workspaceSlug, service } }, options);\n }\n /**\n * Enable (or re-enable) a service for this workspace\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param service - The product: `auth`, `mail`, `waitlist`, `social` or `trawl`.\n * @param params - `PlatformAuth.WorkspaceServiceEnableParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, SERVICE_UNKNOWN: Unknown service name (`SERVICE_UNKNOWN`) or body failed validation.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, malformed or invalid session, or a PAK bearer (this route accepts cookie/JWT sessions only).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.service.enable`.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found (unknown slug or id).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_slug}/services/{service}\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-workspace-slug-services-service\n * @example\n * ```ts\n * const workspaceServiceState = await platform.workspaces.services.enable(\"workspace\", \"service\", { settings: {} });\n * ```\n */\n enable(workspaceSlug: string, service: string, params?: T.WorkspaceServiceEnableParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.WorkspaceServiceState>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_slug}/services/{service}\", pathParams: { workspace_slug: workspaceSlug, service }, body: params }, options);\n }\n /**\n * List services activated on this workspace. Complete — one row per product, not paginated.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, malformed or invalid session, or a PAK bearer (this route accepts cookie/JWT sessions only).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.service.read`.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found (unknown slug or id).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_slug}/services\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-services\n * @example\n * ```ts\n * const listWorkspaceServices = await platform.workspaces.services.list(\"workspace\");\n * ```\n */\n list(workspaceSlug: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.ListWorkspaceServices>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_slug}/services\", pathParams: { workspace_slug: workspaceSlug } }, options);\n }\n /**\n * Replace the settings jsonb for an active service\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param service - The product: `auth`, `mail`, `waitlist`, `social` or `trawl`.\n * @param params - `PlatformAuth.WorkspaceServiceUpdateSettingsParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, SERVICE_UNKNOWN: Unknown service name (`SERVICE_UNKNOWN`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, malformed or invalid session, or a PAK bearer (this route accepts cookie/JWT sessions only).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.service.enable`.\n * @throws {NotFoundError} 404 NOT_FOUND, SERVICE_NOT_ACTIVATED: Workspace not found, or the service was never activated on it (`SERVICE_NOT_ACTIVATED`).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PATCH /v1/workspaces/{workspace_slug}/services/{service}/settings\n * @see https://productcraft.co/docs/platform/api-reference#patch-v1-workspaces-workspace-slug-services-service-settings\n * @example\n * ```ts\n * const workspaceServiceState = await platform.workspaces.services.updateSettings(\"workspace\", \"service\", { default_sender: \"noreply@acme.com\" });\n * ```\n */\n updateSettings(workspaceSlug: string, service: string, params?: T.WorkspaceServiceUpdateSettingsParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.WorkspaceServiceState>> {\n return this._client.request({ method: \"PATCH\", path: \"/v1/workspaces/{workspace_slug}/services/{service}/settings\", pathParams: { workspace_slug: workspaceSlug, service }, body: params }, options);\n }\n}\n\n/** `workspaces` */\nexport class WorkspacesResource extends APIResource {\n #apiKeys?: WorkspacesApiKeysResource;\n #auditFeed?: WorkspacesAuditFeedResource;\n #auditLogs?: WorkspacesAuditLogsResource;\n #avatar?: WorkspacesAvatarResource;\n #invites?: WorkspacesInvitesResource;\n #members?: WorkspacesMembersResource;\n #policies?: WorkspacesPoliciesResource;\n #roles?: WorkspacesRolesResource;\n #services?: WorkspacesServicesResource;\n get apiKeys(): WorkspacesApiKeysResource {\n return (this.#apiKeys ??= new WorkspacesApiKeysResource(this._client, this._b));\n }\n get auditFeed(): WorkspacesAuditFeedResource {\n return (this.#auditFeed ??= new WorkspacesAuditFeedResource(this._client, this._b));\n }\n get auditLogs(): WorkspacesAuditLogsResource {\n return (this.#auditLogs ??= new WorkspacesAuditLogsResource(this._client, this._b));\n }\n get avatar(): WorkspacesAvatarResource {\n return (this.#avatar ??= new WorkspacesAvatarResource(this._client, this._b));\n }\n get invites(): WorkspacesInvitesResource {\n return (this.#invites ??= new WorkspacesInvitesResource(this._client, this._b));\n }\n get members(): WorkspacesMembersResource {\n return (this.#members ??= new WorkspacesMembersResource(this._client, this._b));\n }\n get policies(): WorkspacesPoliciesResource {\n return (this.#policies ??= new WorkspacesPoliciesResource(this._client, this._b));\n }\n get roles(): WorkspacesRolesResource {\n return (this.#roles ??= new WorkspacesRolesResource(this._client, this._b));\n }\n get services(): WorkspacesServicesResource {\n return (this.#services ??= new WorkspacesServicesResource(this._client, this._b));\n }\n /**\n * Create a new workspace. Cookie/JWT only — PAKs are workspace-scoped credentials and cannot create new workspaces.\n *\n * @param params - `PlatformAuth.WorkspaceCreateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: Caller is a PAK (`pcft_live_*`). Workspace creation requires a human-issued session.\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-workspaces\n * @example\n * ```ts\n * const workspace = await platform.workspaces.create({ display_name: \"Acme Corp\", slug: \"acme-corp\" });\n * ```\n */\n create(params: T.WorkspaceCreateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Workspace>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces\", body: params, idempotent: true }, options);\n }\n /**\n * Delete a workspace (requires workspace.delete). Cookie/JWT only — irreversible workspace destruction needs a human-attributed audit row.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session, or a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN: Caller is a PAK (`pcft_live_*`). Workspace deletion requires a human-issued session.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_slug}\n * @see https://productcraft.co/docs/platform/api-reference#delete-v1-workspaces-workspace-slug\n * @example\n * ```ts\n * await platform.workspaces.delete(\"workspace\");\n * ```\n */\n delete(workspaceSlug: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_slug}\", pathParams: { workspace_slug: workspaceSlug } }, options);\n }\n /**\n * List workspaces the current user belongs to\n *\n * @param params - `PlatformAuth.WorkspaceListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid session.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces\n * @example\n * ```ts\n * for await (const workspace of platform.workspaces.list()) {\n * console.log(workspace);\n * }\n * const page = await platform.workspaces.list({}, { timeout: 5_000 });\n * ```\n */\n list(params?: T.WorkspaceListParams, options?: RequestOptions): PagePromise<T.WorkspaceListItem> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces\", query: params }, options);\n }\n /**\n * Get workspace details\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid session.\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`).\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found (unknown slug or id).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_slug}\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug\n * @example\n * ```ts\n * const workspace = await platform.workspaces.retrieve(\"workspace\");\n * ```\n */\n retrieve(workspaceSlug: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Workspace>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_slug}\", pathParams: { workspace_slug: workspaceSlug } }, options);\n }\n /**\n * Update workspace display name, slug, or settings. Slug renames broadcast a `workspace.renamed` event so denormalised consumers (waitlist-api) sync.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param params - `PlatformAuth.WorkspaceUpdateParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid slug or display name.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found.\n * @throws {ConflictError} 409 CONFLICT: Slug already taken by another workspace.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PATCH /v1/workspaces/{workspace_slug}\n * @see https://productcraft.co/docs/platform/api-reference#patch-v1-workspaces-workspace-slug\n * @example\n * ```ts\n * const workspace = await platform.workspaces.update(\"workspace\", { display_name: \"string\" });\n * ```\n */\n update(workspaceSlug: string, params?: T.WorkspaceUpdateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Workspace>> {\n return this._client.request({ method: \"PATCH\", path: \"/v1/workspaces/{workspace_slug}\", pathParams: { workspace_slug: workspaceSlug }, body: params }, options);\n }\n}\n\n/** `platform` */\nexport class PlatformAuthResources extends APIResource {\n #account?: AccountResource;\n #apiKeys?: ApiKeysResource;\n #auth?: AuthResource;\n #introspect?: IntrospectResource;\n #me?: MeResource;\n #oauth?: OauthResource;\n #sessions?: SessionsResource;\n #stats?: StatsResource;\n #verification?: VerificationResource;\n #wellKnown?: WellKnownResource;\n #workspaces?: WorkspacesResource;\n get account(): AccountResource {\n return (this.#account ??= new AccountResource(this._client, this._b));\n }\n get apiKeys(): ApiKeysResource {\n return (this.#apiKeys ??= new ApiKeysResource(this._client, this._b));\n }\n get auth(): AuthResource {\n return (this.#auth ??= new AuthResource(this._client, this._b));\n }\n get introspect(): IntrospectResource {\n return (this.#introspect ??= new IntrospectResource(this._client, this._b));\n }\n get me(): MeResource {\n return (this.#me ??= new MeResource(this._client, this._b));\n }\n get oauth(): OauthResource {\n return (this.#oauth ??= new OauthResource(this._client, this._b));\n }\n get sessions(): SessionsResource {\n return (this.#sessions ??= new SessionsResource(this._client, this._b));\n }\n get stats(): StatsResource {\n return (this.#stats ??= new StatsResource(this._client, this._b));\n }\n get verification(): VerificationResource {\n return (this.#verification ??= new VerificationResource(this._client, this._b));\n }\n get wellKnown(): WellKnownResource {\n return (this.#wellKnown ??= new WellKnownResource(this._client, this._b));\n }\n get workspaces(): WorkspacesResource {\n return (this.#workspaces ??= new WorkspacesResource(this._client, this._b));\n }\n}\n","// Generated by scripts/gen-sdk.mjs from Specs/platform-auth.json. Do not edit.\n\nimport type { LastResponse } from \"@productcraft/core\";\nimport type { components, paths } from \"./paths.js\";\n\ntype IsUnion<T, U = T> = T extends unknown ? ([U] extends [T] ? false : true) : never;\ntype OpenString<T extends string> = string extends T ? T : true extends IsUnion<T> ? T | (string & {}) : T;\ntype OpenValue<T> = [T] extends [string] ? OpenString<T> : T extends readonly (infer I)[] ? Open<I>[] : T extends object ? { [K in keyof T]: Open<T[K]> } : T;\n/** A response type: string-literal unions also accept values added after this SDK was built. */\nexport type Open<T> = OpenValue<Exclude<T, null | undefined>> | Extract<T, null | undefined>;\n/** What a method resolves to: the parsed body plus non-enumerable `lastResponse`. */\nexport type WithLastResponse<T> = T & { readonly lastResponse: LastResponse };\n/** Params inside a scope bound with `.as(actorId)`: `actor_id` may be left out. */\nexport type WithOptionalActor<P> = P extends { actor_id: unknown } ? Omit<P, \"actor_id\"> & { actor_id?: P[\"actor_id\"] } : P;\n/** A polled model whose free-form `K` the caller types as `R` (`createAndPoll<R>`); optional and nullable stay as declared. */\nexport type WithResult<M, K extends keyof M, R> = Omit<M, K> & { [P in keyof M as P extends K ? P : never]: R | Extract<M[P], null> };\n\nexport type ApiKeyPresetKey = components[\"schemas\"][\"ApiKeyPresetKey\"];\nexport const ApiKeyPresetKey = { values: [\"mail-send\", \"waitlist-write\", \"trawl-jobs\", \"readonly\", \"full\"] as const };\n\nexport type ApiKeyStatus = components[\"schemas\"][\"ApiKeyStatus\"];\nexport const ApiKeyStatus = { values: [\"active\", \"expired\", \"revoked\"] as const };\n\nexport type AuditActorType = components[\"schemas\"][\"AuditActorType\"];\nexport const AuditActorType = { values: [\"platform_user\", \"system\", \"pat\"] as const };\n\nexport type AuditFeedSource = components[\"schemas\"][\"AuditFeedSource\"];\nexport const AuditFeedSource = { values: [\"workspace_audit\", \"heimdall_audit\", \"agora_moderation\"] as const };\n\nexport type McpProduct = components[\"schemas\"][\"McpProduct\"];\nexport const McpProduct = { values: [\"auth\", \"mail\", \"waitlist\", \"social\", \"trawl\"] as const };\n\nexport type PolicyEffect = components[\"schemas\"][\"PolicyEffect\"];\nexport const PolicyEffect = { values: [\"allow\", \"deny\"] as const };\n\nexport type StatsGranularity = components[\"schemas\"][\"StatsGranularity\"];\nexport const StatsGranularity = { values: [\"day\"] as const };\n\nexport type StatsMetric = components[\"schemas\"][\"StatsMetric\"];\nexport const StatsMetric = { values: [\"audit_events\"] as const };\n\nexport type StatsWindow = components[\"schemas\"][\"StatsWindow\"];\nexport const StatsWindow = { values: [\"1d\", \"7d\", \"30d\"] as const };\n\nexport type ApiKeySelf = Open<components[\"schemas\"][\"ApiKeySelfResponseDto\"]>;\nexport type ApiKeySelfWorkspace = Open<components[\"schemas\"][\"ApiKeySelfWorkspaceDto\"]>;\nexport type AuditFeed = Open<components[\"schemas\"][\"AuditFeedResponseDto\"]>;\nexport type AuthorizationServerMetadata = Open<components[\"schemas\"][\"AuthorizationServerMetadataDto\"]>;\nexport type AvatarUrl = Open<components[\"schemas\"][\"AvatarUrlResponseDto\"]>;\nexport type BoundPolicySummary = Open<components[\"schemas\"][\"BoundPolicySummaryDto\"]>;\nexport type ConnectedClient = Open<components[\"schemas\"][\"ConnectedClientDto\"]>;\nexport type ConnectedClientList = Open<components[\"schemas\"][\"ConnectedClientListDto\"]>;\nexport type FeedItem = Open<components[\"schemas\"][\"FeedItemDto\"]>;\nexport type Feedback = Open<components[\"schemas\"][\"FeedbackResponseDto\"]>;\nexport type HiddenGuide = Open<components[\"schemas\"][\"HiddenGuideDto\"]>;\nexport type HiddenGuides = Open<components[\"schemas\"][\"HiddenGuidesDto\"]>;\nexport type IntrospectAccount = Open<components[\"schemas\"][\"IntrospectAccountDto\"]>;\nexport type IntrospectApiKey = Open<components[\"schemas\"][\"IntrospectApiKeyResponseDto\"]>;\nexport type IntrospectPrincipal = Open<components[\"schemas\"][\"IntrospectPrincipalDto\"]>;\nexport type Introspect = Open<components[\"schemas\"][\"IntrospectResponseDto\"]>;\nexport type IntrospectRole = Open<components[\"schemas\"][\"IntrospectRoleDto\"]>;\nexport type IntrospectWorkspaceListItem = Open<components[\"schemas\"][\"IntrospectWorkspaceListItemDto\"]>;\nexport type IntrospectWorkspace = Open<components[\"schemas\"][\"IntrospectWorkspaceResponseDto\"]>;\nexport type Jwk = Open<components[\"schemas\"][\"JwkDto\"]>;\nexport type Jwks = Open<components[\"schemas\"][\"JwksResponseDto\"]>;\nexport type ListManagedPolicies = Open<components[\"schemas\"][\"ListManagedPoliciesResponseDto\"]>;\nexport type ListPakPresets = Open<components[\"schemas\"][\"ListPakPresetsResponseDto\"]>;\nexport type ListPlatformApiKeys = Open<components[\"schemas\"][\"ListPlatformApiKeysResponseDto\"]>;\nexport type ListWorkspaceAuditLogs = Open<components[\"schemas\"][\"ListWorkspaceAuditLogsResponseDto\"]>;\nexport type ListWorkspaceInvites = Open<components[\"schemas\"][\"ListWorkspaceInvitesResponseDto\"]>;\nexport type ListWorkspaceMembers = Open<components[\"schemas\"][\"ListWorkspaceMembersResponseDto\"]>;\nexport type ListWorkspaceRoles = Open<components[\"schemas\"][\"ListWorkspaceRolesResponseDto\"]>;\nexport type ListWorkspaceServices = Open<components[\"schemas\"][\"ListWorkspaceServicesResponseDto\"]>;\nexport type ListWorkspaces = Open<components[\"schemas\"][\"ListWorkspacesResponseDto\"]>;\nexport type ManagedPolicyDeleted = Open<components[\"schemas\"][\"ManagedPolicyDeletedResponseDto\"]>;\nexport type ManagedPolicyDetail = Open<components[\"schemas\"][\"ManagedPolicyDetailResponseDto\"]>;\nexport type ManagedPolicy = Open<components[\"schemas\"][\"ManagedPolicyResponseDto\"]>;\nexport type MeProfile = Open<components[\"schemas\"][\"MeProfileDto\"]>;\nexport type MintPak = Open<components[\"schemas\"][\"MintPakResponseDto\"]>;\nexport type Pagination = Open<components[\"schemas\"][\"PaginationDto\"]>;\nexport type PakGrantPreview = Open<components[\"schemas\"][\"PakGrantPreviewDto\"]>;\nexport type PakPreset = Open<components[\"schemas\"][\"PakPresetDto\"]>;\nexport type PolicyBindingCount = Open<components[\"schemas\"][\"PolicyBindingCountDto\"]>;\nexport type PolicyStatement = Open<components[\"schemas\"][\"PolicyStatementDto\"]>;\nexport type PublicApiKey = Open<components[\"schemas\"][\"PublicApiKeyDto\"]>;\nexport type RevokeOtherSessions = Open<components[\"schemas\"][\"RevokeOtherSessionsResponseDto\"]>;\nexport type RevokeSession = Open<components[\"schemas\"][\"RevokeSessionResponseDto\"]>;\nexport type RotatePak = Open<components[\"schemas\"][\"RotatePakResponseDto\"]>;\nexport type Session = Open<components[\"schemas\"][\"SessionDto\"]>;\nexport type SourceDiagnostic = Open<components[\"schemas\"][\"SourceDiagnosticDto\"]>;\nexport type StatsSeriesPoint = Open<components[\"schemas\"][\"StatsSeriesPointDto\"]>;\nexport type Token = Open<components[\"schemas\"][\"TokenResponseDto\"]>;\nexport type UpdateMemberRole = Open<components[\"schemas\"][\"UpdateMemberRoleResponseDto\"]>;\nexport type WorkspaceActionCatalog = Open<components[\"schemas\"][\"WorkspaceActionCatalogResponseDto\"]>;\nexport type WorkspaceAuditLogEntry = Open<components[\"schemas\"][\"WorkspaceAuditLogEntryDto\"]>;\nexport type WorkspaceAvatarUrl = Open<components[\"schemas\"][\"WorkspaceAvatarUrlResponseDto\"]>;\nexport type WorkspaceInviteListItem = Open<components[\"schemas\"][\"WorkspaceInviteListItemDto\"]>;\nexport type WorkspaceInvite = Open<components[\"schemas\"][\"WorkspaceInviteResponseDto\"]>;\nexport type WorkspaceListItem = Open<components[\"schemas\"][\"WorkspaceListItemDto\"]>;\nexport type WorkspaceMember = Open<components[\"schemas\"][\"WorkspaceMemberResponseDto\"]>;\nexport type Workspace = Open<components[\"schemas\"][\"WorkspaceResponseDto\"]>;\nexport type WorkspaceRole = Open<components[\"schemas\"][\"WorkspaceRoleResponseDto\"]>;\nexport type WorkspaceServiceState = Open<components[\"schemas\"][\"WorkspaceServiceStateDto\"]>;\nexport type WorkspaceStats = Open<components[\"schemas\"][\"WorkspaceStatsDto\"]>;\nexport type WorkspaceStatsInWindow = Open<components[\"schemas\"][\"WorkspaceStatsInWindowDto\"]>;\nexport type WorkspaceStatsSeries = Open<components[\"schemas\"][\"WorkspaceStatsSeriesDto\"]>;\nexport type WorkspaceStatsTotals = Open<components[\"schemas\"][\"WorkspaceStatsTotalsDto\"]>;\n\n/** Params for `auth.logout` (POST /v1/auth/logout). */\nexport type AuthLogoutParams = NonNullable<paths[\"/v1/auth/logout\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `auth.password.requestReset` (POST /v1/auth/password/request-reset). */\nexport type AuthPasswordRequestResetParams = NonNullable<paths[\"/v1/auth/password/request-reset\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `auth.password.reset` (POST /v1/auth/password/reset). */\nexport type AuthPasswordResetParams = NonNullable<paths[\"/v1/auth/password/reset\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `auth.refresh` (POST /v1/auth/refresh). */\nexport type AuthRefreshParams = NonNullable<paths[\"/v1/auth/refresh\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `auth.signin` (POST /v1/auth/signin). */\nexport type AuthSigninParams = NonNullable<paths[\"/v1/auth/signin\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `auth.signup` (POST /v1/auth/signup). */\nexport type AuthSignupParams = NonNullable<paths[\"/v1/auth/signup\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `me.avatar.upload` (POST /v1/me/avatar). */\nexport type MeAvatarUploadParams = { /** PNG, JPEG, or WEBP image, ≤2 MB. */ file: Blob };\n/** Params for `me.profile.update` (PATCH /v1/me/profile). */\nexport type MeProfileUpdateParams = NonNullable<paths[\"/v1/me/profile\"][\"patch\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `oauth.connections.list` (GET /v1/oauth/connections). */\nexport type OauthConnectionListParams = NonNullable<paths[\"/v1/oauth/connections\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `oauth.workspaces.connections.list` (GET /v1/oauth/workspaces/{workspace_id}/connections). */\nexport type OauthWorkspaceConnectionListParams = NonNullable<paths[\"/v1/oauth/workspaces/{workspace_id}/connections\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Response of `sessions.list`. */\nexport type SessionListResponse = Open<paths[\"/v1/session\"][\"get\"][\"responses\"][200][\"content\"][\"application/json\"]>;\n/** Params for `verification.verify` (POST /v1/verification/verify). */\nexport type VerificationVerifyParams = NonNullable<paths[\"/v1/verification/verify\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `workspaces.list` (GET /v1/workspaces). */\nexport type WorkspaceListParams = NonNullable<paths[\"/v1/workspaces\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `workspaces.create` (POST /v1/workspaces). */\nexport type WorkspaceCreateParams = NonNullable<paths[\"/v1/workspaces\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `workspaces.invites.accept` (POST /v1/workspaces/invites/accept). */\nexport type WorkspaceInviteAcceptParams = NonNullable<paths[\"/v1/workspaces/invites/accept\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `stats.retrieve` (GET /v1/workspaces/{workspace_id}/stats). */\nexport type StatsRetrieveParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/stats\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `workspaces.update` (PATCH /v1/workspaces/{workspace_slug}). */\nexport type WorkspaceUpdateParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}\"][\"patch\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `workspaces.apiKeys.list` (GET /v1/workspaces/{workspace_slug}/api-keys). */\nexport type WorkspaceApiKeyListParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/api-keys\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `workspaces.apiKeys.create` (POST /v1/workspaces/{workspace_slug}/api-keys). */\nexport type WorkspaceApiKeyCreateParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/api-keys\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `workspaces.apiKeys.preview` (POST /v1/workspaces/{workspace_slug}/api-keys/preview). */\nexport type WorkspaceApiKeyPreviewParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/api-keys/preview\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `workspaces.apiKeys.update` (PATCH /v1/workspaces/{workspace_slug}/api-keys/{id}). */\nexport type WorkspaceApiKeyUpdateParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/api-keys/{id}\"][\"patch\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `workspaces.apiKeys.delete` (DELETE /v1/workspaces/{workspace_slug}/api-keys/{id}). */\nexport type WorkspaceApiKeyDeleteParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/api-keys/{id}\"][\"delete\"][\"parameters\"][\"query\"]>;\n/** Params for `workspaces.apiKeys.updateBindings` (PATCH /v1/workspaces/{workspace_slug}/api-keys/{id}/bindings). */\nexport type WorkspaceApiKeyUpdateBindingsParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/api-keys/{id}/bindings\"][\"patch\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `workspaces.apiKeys.rotate` (POST /v1/workspaces/{workspace_slug}/api-keys/{id}/rotate). */\nexport type WorkspaceApiKeyRotateParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/api-keys/{id}/rotate\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `workspaces.auditFeed.list` (GET /v1/workspaces/{workspace_slug}/audit-feed). */\nexport type WorkspaceAuditFeedListParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/audit-feed\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `workspaces.auditLogs.list` (GET /v1/workspaces/{workspace_slug}/audit-logs). */\nexport type WorkspaceAuditLogListParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/audit-logs\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `workspaces.auditLogs.export` (GET /v1/workspaces/{workspace_slug}/audit-logs/export). */\nexport type WorkspaceAuditLogExportParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/audit-logs/export\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `workspaces.avatar.upload` (POST /v1/workspaces/{workspace_slug}/avatar). */\nexport type WorkspaceAvatarUploadParams = { /** PNG, JPEG, or WEBP image, ≤2 MB. Square images look best. */ file: Blob };\n/** Params for `workspaces.invites.list` (GET /v1/workspaces/{workspace_slug}/invites). */\nexport type WorkspaceInviteListParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/invites\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `workspaces.invites.create` (POST /v1/workspaces/{workspace_slug}/invites). */\nexport type WorkspaceInviteCreateParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/invites\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `workspaces.members.list` (GET /v1/workspaces/{workspace_slug}/members). */\nexport type WorkspaceMemberListParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/members\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `workspaces.members.updateRole` (PATCH /v1/workspaces/{workspace_slug}/members/{account_id}/role). */\nexport type WorkspaceMemberUpdateRoleParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/members/{account_id}/role\"][\"patch\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `workspaces.policies.list` (GET /v1/workspaces/{workspace_slug}/policies). */\nexport type WorkspacePolicyListParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/policies\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `workspaces.policies.create` (POST /v1/workspaces/{workspace_slug}/policies). */\nexport type WorkspacePolicyCreateParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/policies\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `workspaces.policies.update` (PATCH /v1/workspaces/{workspace_slug}/policies/{policy_id}). */\nexport type WorkspacePolicyUpdateParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/policies/{policy_id}\"][\"patch\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `workspaces.roles.list` (GET /v1/workspaces/{workspace_slug}/roles). */\nexport type WorkspaceRoleListParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/roles\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `workspaces.roles.create` (POST /v1/workspaces/{workspace_slug}/roles). */\nexport type WorkspaceRoleCreateParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/roles\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `workspaces.roles.update` (PATCH /v1/workspaces/{workspace_slug}/roles/{role_id}). */\nexport type WorkspaceRoleUpdateParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/roles/{role_id}\"][\"patch\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `workspaces.services.enable` (POST /v1/workspaces/{workspace_slug}/services/{service}). */\nexport type WorkspaceServiceEnableParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/services/{service}\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `workspaces.services.updateSettings` (PATCH /v1/workspaces/{workspace_slug}/services/{service}/settings). */\nexport type WorkspaceServiceUpdateSettingsParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/services/{service}/settings\"][\"patch\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n","// Generated by scripts/gen-sdk.mjs from Specs/platform-auth.json. Do not edit.\n\nimport { APIClient, createOpenAPIClient, PC_BASE_URL, type ClientOptions, type PollOptions as CorePollOptions, type RequestOptions as CoreRequestOptions } from \"@productcraft/core\";\nimport type { Client } from \"openapi-fetch\";\nimport type * as E from \"./errors.js\";\nimport type { paths } from \"./paths.js\";\nimport { PlatformAuthResources } from \"./resources.js\";\nimport * as T from \"./types.js\";\n\ndeclare const __PC_SDK_VERSION__: string | undefined;\nconst VERSION = typeof __PC_SDK_VERSION__ === \"string\" ? __PC_SDK_VERSION__ : \"0.0.0-dev\";\n\n/**\n * ProductCraft Platform API client (workspaces, members, roles, policies, API keys and introspection). Every method is generated from the API's OpenAPI document.\n *\n * @example\n * ```ts\n * import { PlatformAuth } from \"@productcraft/platform-auth\";\n * const platform = new PlatformAuth({ apiKey: process.env.PRODUCTCRAFT_API_KEY });\n * ```\n */\n\nexport class PlatformAuth extends PlatformAuthResources {\n #openapi?: Client<paths>;\n constructor(options: ClientOptions = {}) {\n super(new APIClient(options, PC_BASE_URL.platformAuth, { name: \"platform-auth\", version: VERSION }));\n }\n /** The typed `openapi-fetch` escape hatch over the same credential and base URL. It does not retry. */\n get client(): Client<paths> {\n return (this.#openapi ??= createOpenAPIClient<paths>(this._client));\n }\n}\n\ntype __RequestOptions = CoreRequestOptions;\ntype __PollOptions = CorePollOptions;\ntype __ApiKeyPresetKey = T.ApiKeyPresetKey;\ntype __ApiKeyStatus = T.ApiKeyStatus;\ntype __AuditActorType = T.AuditActorType;\ntype __AuditFeedSource = T.AuditFeedSource;\ntype __McpProduct = T.McpProduct;\ntype __PolicyEffect = T.PolicyEffect;\ntype __StatsGranularity = T.StatsGranularity;\ntype __StatsMetric = T.StatsMetric;\ntype __StatsWindow = T.StatsWindow;\ntype __ApiKeySelf = T.ApiKeySelf;\ntype __ApiKeySelfWorkspace = T.ApiKeySelfWorkspace;\ntype __AuditFeed = T.AuditFeed;\ntype __AuthorizationServerMetadata = T.AuthorizationServerMetadata;\ntype __AvatarUrl = T.AvatarUrl;\ntype __BoundPolicySummary = T.BoundPolicySummary;\ntype __ConnectedClient = T.ConnectedClient;\ntype __ConnectedClientList = T.ConnectedClientList;\ntype __FeedItem = T.FeedItem;\ntype __Feedback = T.Feedback;\ntype __HiddenGuide = T.HiddenGuide;\ntype __HiddenGuides = T.HiddenGuides;\ntype __IntrospectAccount = T.IntrospectAccount;\ntype __IntrospectApiKey = T.IntrospectApiKey;\ntype __IntrospectPrincipal = T.IntrospectPrincipal;\ntype __Introspect = T.Introspect;\ntype __IntrospectRole = T.IntrospectRole;\ntype __IntrospectWorkspaceListItem = T.IntrospectWorkspaceListItem;\ntype __IntrospectWorkspace = T.IntrospectWorkspace;\ntype __Jwk = T.Jwk;\ntype __Jwks = T.Jwks;\ntype __ListManagedPolicies = T.ListManagedPolicies;\ntype __ListPakPresets = T.ListPakPresets;\ntype __ListPlatformApiKeys = T.ListPlatformApiKeys;\ntype __ListWorkspaceAuditLogs = T.ListWorkspaceAuditLogs;\ntype __ListWorkspaceInvites = T.ListWorkspaceInvites;\ntype __ListWorkspaceMembers = T.ListWorkspaceMembers;\ntype __ListWorkspaceRoles = T.ListWorkspaceRoles;\ntype __ListWorkspaceServices = T.ListWorkspaceServices;\ntype __ListWorkspaces = T.ListWorkspaces;\ntype __ManagedPolicyDeleted = T.ManagedPolicyDeleted;\ntype __ManagedPolicyDetail = T.ManagedPolicyDetail;\ntype __ManagedPolicy = T.ManagedPolicy;\ntype __MeProfile = T.MeProfile;\ntype __MintPak = T.MintPak;\ntype __Pagination = T.Pagination;\ntype __PakGrantPreview = T.PakGrantPreview;\ntype __PakPreset = T.PakPreset;\ntype __PolicyBindingCount = T.PolicyBindingCount;\ntype __PolicyStatement = T.PolicyStatement;\ntype __PublicApiKey = T.PublicApiKey;\ntype __RevokeOtherSessions = T.RevokeOtherSessions;\ntype __RevokeSession = T.RevokeSession;\ntype __RotatePak = T.RotatePak;\ntype __Session = T.Session;\ntype __SourceDiagnostic = T.SourceDiagnostic;\ntype __StatsSeriesPoint = T.StatsSeriesPoint;\ntype __Token = T.Token;\ntype __UpdateMemberRole = T.UpdateMemberRole;\ntype __WorkspaceActionCatalog = T.WorkspaceActionCatalog;\ntype __WorkspaceAuditLogEntry = T.WorkspaceAuditLogEntry;\ntype __WorkspaceAvatarUrl = T.WorkspaceAvatarUrl;\ntype __WorkspaceInviteListItem = T.WorkspaceInviteListItem;\ntype __WorkspaceInvite = T.WorkspaceInvite;\ntype __WorkspaceListItem = T.WorkspaceListItem;\ntype __WorkspaceMember = T.WorkspaceMember;\ntype __Workspace = T.Workspace;\ntype __WorkspaceRole = T.WorkspaceRole;\ntype __WorkspaceServiceState = T.WorkspaceServiceState;\ntype __WorkspaceStats = T.WorkspaceStats;\ntype __WorkspaceStatsInWindow = T.WorkspaceStatsInWindow;\ntype __WorkspaceStatsSeries = T.WorkspaceStatsSeries;\ntype __WorkspaceStatsTotals = T.WorkspaceStatsTotals;\ntype __AuthLogoutParams = T.AuthLogoutParams;\ntype __AuthPasswordRequestResetParams = T.AuthPasswordRequestResetParams;\ntype __AuthPasswordResetParams = T.AuthPasswordResetParams;\ntype __AuthRefreshParams = T.AuthRefreshParams;\ntype __AuthSigninParams = T.AuthSigninParams;\ntype __AuthSignupParams = T.AuthSignupParams;\ntype __MeAvatarUploadParams = T.MeAvatarUploadParams;\ntype __MeProfileUpdateParams = T.MeProfileUpdateParams;\ntype __OauthConnectionListParams = T.OauthConnectionListParams;\ntype __OauthWorkspaceConnectionListParams = T.OauthWorkspaceConnectionListParams;\ntype __SessionListResponse = T.SessionListResponse;\ntype __VerificationVerifyParams = T.VerificationVerifyParams;\ntype __WorkspaceListParams = T.WorkspaceListParams;\ntype __WorkspaceCreateParams = T.WorkspaceCreateParams;\ntype __WorkspaceInviteAcceptParams = T.WorkspaceInviteAcceptParams;\ntype __StatsRetrieveParams = T.StatsRetrieveParams;\ntype __WorkspaceUpdateParams = T.WorkspaceUpdateParams;\ntype __WorkspaceApiKeyListParams = T.WorkspaceApiKeyListParams;\ntype __WorkspaceApiKeyCreateParams = T.WorkspaceApiKeyCreateParams;\ntype __WorkspaceApiKeyPreviewParams = T.WorkspaceApiKeyPreviewParams;\ntype __WorkspaceApiKeyUpdateParams = T.WorkspaceApiKeyUpdateParams;\ntype __WorkspaceApiKeyDeleteParams = T.WorkspaceApiKeyDeleteParams;\ntype __WorkspaceApiKeyUpdateBindingsParams = T.WorkspaceApiKeyUpdateBindingsParams;\ntype __WorkspaceApiKeyRotateParams = T.WorkspaceApiKeyRotateParams;\ntype __WorkspaceAuditFeedListParams = T.WorkspaceAuditFeedListParams;\ntype __WorkspaceAuditLogListParams = T.WorkspaceAuditLogListParams;\ntype __WorkspaceAuditLogExportParams = T.WorkspaceAuditLogExportParams;\ntype __WorkspaceAvatarUploadParams = T.WorkspaceAvatarUploadParams;\ntype __WorkspaceInviteListParams = T.WorkspaceInviteListParams;\ntype __WorkspaceInviteCreateParams = T.WorkspaceInviteCreateParams;\ntype __WorkspaceMemberListParams = T.WorkspaceMemberListParams;\ntype __WorkspaceMemberUpdateRoleParams = T.WorkspaceMemberUpdateRoleParams;\ntype __WorkspacePolicyListParams = T.WorkspacePolicyListParams;\ntype __WorkspacePolicyCreateParams = T.WorkspacePolicyCreateParams;\ntype __WorkspacePolicyUpdateParams = T.WorkspacePolicyUpdateParams;\ntype __WorkspaceRoleListParams = T.WorkspaceRoleListParams;\ntype __WorkspaceRoleCreateParams = T.WorkspaceRoleCreateParams;\ntype __WorkspaceRoleUpdateParams = T.WorkspaceRoleUpdateParams;\ntype __WorkspaceServiceEnableParams = T.WorkspaceServiceEnableParams;\ntype __WorkspaceServiceUpdateSettingsParams = T.WorkspaceServiceUpdateSettingsParams;\ntype __ErrorCode = E.PlatformAuthErrorCode;\n/** Public types: `PlatformAuth.ApiKeySelf`, `PlatformAuth.AuthLogoutParams`, … */\nexport namespace PlatformAuth {\n export type RequestOptions = __RequestOptions;\n export type PollOptions = __PollOptions;\n export type ApiKeyPresetKey = __ApiKeyPresetKey;\n export const ApiKeyPresetKey = T.ApiKeyPresetKey;\n export type ApiKeyStatus = __ApiKeyStatus;\n export const ApiKeyStatus = T.ApiKeyStatus;\n export type AuditActorType = __AuditActorType;\n export const AuditActorType = T.AuditActorType;\n export type AuditFeedSource = __AuditFeedSource;\n export const AuditFeedSource = T.AuditFeedSource;\n export type McpProduct = __McpProduct;\n export const McpProduct = T.McpProduct;\n export type PolicyEffect = __PolicyEffect;\n export const PolicyEffect = T.PolicyEffect;\n export type StatsGranularity = __StatsGranularity;\n export const StatsGranularity = T.StatsGranularity;\n export type StatsMetric = __StatsMetric;\n export const StatsMetric = T.StatsMetric;\n export type StatsWindow = __StatsWindow;\n export const StatsWindow = T.StatsWindow;\n export type ApiKeySelf = __ApiKeySelf;\n export type ApiKeySelfWorkspace = __ApiKeySelfWorkspace;\n export type AuditFeed = __AuditFeed;\n export type AuthorizationServerMetadata = __AuthorizationServerMetadata;\n export type AvatarUrl = __AvatarUrl;\n export type BoundPolicySummary = __BoundPolicySummary;\n export type ConnectedClient = __ConnectedClient;\n export type ConnectedClientList = __ConnectedClientList;\n export type FeedItem = __FeedItem;\n export type Feedback = __Feedback;\n export type HiddenGuide = __HiddenGuide;\n export type HiddenGuides = __HiddenGuides;\n export type IntrospectAccount = __IntrospectAccount;\n export type IntrospectApiKey = __IntrospectApiKey;\n export type IntrospectPrincipal = __IntrospectPrincipal;\n export type Introspect = __Introspect;\n export type IntrospectRole = __IntrospectRole;\n export type IntrospectWorkspaceListItem = __IntrospectWorkspaceListItem;\n export type IntrospectWorkspace = __IntrospectWorkspace;\n export type Jwk = __Jwk;\n export type Jwks = __Jwks;\n export type ListManagedPolicies = __ListManagedPolicies;\n export type ListPakPresets = __ListPakPresets;\n export type ListPlatformApiKeys = __ListPlatformApiKeys;\n export type ListWorkspaceAuditLogs = __ListWorkspaceAuditLogs;\n export type ListWorkspaceInvites = __ListWorkspaceInvites;\n export type ListWorkspaceMembers = __ListWorkspaceMembers;\n export type ListWorkspaceRoles = __ListWorkspaceRoles;\n export type ListWorkspaceServices = __ListWorkspaceServices;\n export type ListWorkspaces = __ListWorkspaces;\n export type ManagedPolicyDeleted = __ManagedPolicyDeleted;\n export type ManagedPolicyDetail = __ManagedPolicyDetail;\n export type ManagedPolicy = __ManagedPolicy;\n export type MeProfile = __MeProfile;\n export type MintPak = __MintPak;\n export type Pagination = __Pagination;\n export type PakGrantPreview = __PakGrantPreview;\n export type PakPreset = __PakPreset;\n export type PolicyBindingCount = __PolicyBindingCount;\n export type PolicyStatement = __PolicyStatement;\n export type PublicApiKey = __PublicApiKey;\n export type RevokeOtherSessions = __RevokeOtherSessions;\n export type RevokeSession = __RevokeSession;\n export type RotatePak = __RotatePak;\n export type Session = __Session;\n export type SourceDiagnostic = __SourceDiagnostic;\n export type StatsSeriesPoint = __StatsSeriesPoint;\n export type Token = __Token;\n export type UpdateMemberRole = __UpdateMemberRole;\n export type WorkspaceActionCatalog = __WorkspaceActionCatalog;\n export type WorkspaceAuditLogEntry = __WorkspaceAuditLogEntry;\n export type WorkspaceAvatarUrl = __WorkspaceAvatarUrl;\n export type WorkspaceInviteListItem = __WorkspaceInviteListItem;\n export type WorkspaceInvite = __WorkspaceInvite;\n export type WorkspaceListItem = __WorkspaceListItem;\n export type WorkspaceMember = __WorkspaceMember;\n export type Workspace = __Workspace;\n export type WorkspaceRole = __WorkspaceRole;\n export type WorkspaceServiceState = __WorkspaceServiceState;\n export type WorkspaceStats = __WorkspaceStats;\n export type WorkspaceStatsInWindow = __WorkspaceStatsInWindow;\n export type WorkspaceStatsSeries = __WorkspaceStatsSeries;\n export type WorkspaceStatsTotals = __WorkspaceStatsTotals;\n export type AuthLogoutParams = __AuthLogoutParams;\n export type AuthPasswordRequestResetParams = __AuthPasswordRequestResetParams;\n export type AuthPasswordResetParams = __AuthPasswordResetParams;\n export type AuthRefreshParams = __AuthRefreshParams;\n export type AuthSigninParams = __AuthSigninParams;\n export type AuthSignupParams = __AuthSignupParams;\n export type MeAvatarUploadParams = __MeAvatarUploadParams;\n export type MeProfileUpdateParams = __MeProfileUpdateParams;\n export type OauthConnectionListParams = __OauthConnectionListParams;\n export type OauthWorkspaceConnectionListParams = __OauthWorkspaceConnectionListParams;\n export type SessionListResponse = __SessionListResponse;\n export type VerificationVerifyParams = __VerificationVerifyParams;\n export type WorkspaceListParams = __WorkspaceListParams;\n export type WorkspaceCreateParams = __WorkspaceCreateParams;\n export type WorkspaceInviteAcceptParams = __WorkspaceInviteAcceptParams;\n export type StatsRetrieveParams = __StatsRetrieveParams;\n export type WorkspaceUpdateParams = __WorkspaceUpdateParams;\n export type WorkspaceApiKeyListParams = __WorkspaceApiKeyListParams;\n export type WorkspaceApiKeyCreateParams = __WorkspaceApiKeyCreateParams;\n export type WorkspaceApiKeyPreviewParams = __WorkspaceApiKeyPreviewParams;\n export type WorkspaceApiKeyUpdateParams = __WorkspaceApiKeyUpdateParams;\n export type WorkspaceApiKeyDeleteParams = __WorkspaceApiKeyDeleteParams;\n export type WorkspaceApiKeyUpdateBindingsParams = __WorkspaceApiKeyUpdateBindingsParams;\n export type WorkspaceApiKeyRotateParams = __WorkspaceApiKeyRotateParams;\n export type WorkspaceAuditFeedListParams = __WorkspaceAuditFeedListParams;\n export type WorkspaceAuditLogListParams = __WorkspaceAuditLogListParams;\n export type WorkspaceAuditLogExportParams = __WorkspaceAuditLogExportParams;\n export type WorkspaceAvatarUploadParams = __WorkspaceAvatarUploadParams;\n export type WorkspaceInviteListParams = __WorkspaceInviteListParams;\n export type WorkspaceInviteCreateParams = __WorkspaceInviteCreateParams;\n export type WorkspaceMemberListParams = __WorkspaceMemberListParams;\n export type WorkspaceMemberUpdateRoleParams = __WorkspaceMemberUpdateRoleParams;\n export type WorkspacePolicyListParams = __WorkspacePolicyListParams;\n export type WorkspacePolicyCreateParams = __WorkspacePolicyCreateParams;\n export type WorkspacePolicyUpdateParams = __WorkspacePolicyUpdateParams;\n export type WorkspaceRoleListParams = __WorkspaceRoleListParams;\n export type WorkspaceRoleCreateParams = __WorkspaceRoleCreateParams;\n export type WorkspaceRoleUpdateParams = __WorkspaceRoleUpdateParams;\n export type WorkspaceServiceEnableParams = __WorkspaceServiceEnableParams;\n export type WorkspaceServiceUpdateSettingsParams = __WorkspaceServiceUpdateSettingsParams;\n export type ErrorCode = __ErrorCode;\n}\n","// Generated by scripts/gen-sdk.mjs from Specs/platform-auth.json. Do not edit.\n\nexport { APIConnectionError, APIError, APITimeoutError, APIUserAbortError, AuthenticationError, BadRequestError, ConfigurationError, ConflictError, IdempotencyKeyReuseError, InternalServerError, NotFoundError, PermissionDeniedError, ProductCraftError, RateLimitError, UnprocessableEntityError, WebhookVerificationError } from \"@productcraft/core\";\n\n/** Error codes this API documents. Open: codes added later still type-check. See https://productcraft.co/docs/errors. */\nexport type PlatformAuthErrorCode = \"BAD_REQUEST\" | \"VALIDATION_ERROR\" | \"UNAUTHORIZED\" | \"PAYMENT_REQUIRED\" | \"FORBIDDEN\" | \"NOT_FOUND\" | \"METHOD_NOT_ALLOWED\" | \"NOT_ACCEPTABLE\" | \"REQUEST_TIMEOUT\" | \"CONFLICT\" | \"GONE\" | \"PRECONDITION_FAILED\" | \"PAYLOAD_TOO_LARGE\" | \"UNSUPPORTED_MEDIA_TYPE\" | \"UNPROCESSABLE_ENTITY\" | \"PRECONDITION_REQUIRED\" | \"RATE_LIMITED\" | \"INTERNAL_SERVER_ERROR\" | \"NOT_IMPLEMENTED\" | \"BAD_GATEWAY\" | \"SERVICE_UNAVAILABLE\" | \"GATEWAY_TIMEOUT\" | \"SERVICE_NOT_ENABLED\" | \"INVALID_CREDENTIALS\" | \"SESSION_REVOKED\" | \"MCP_NOT_PERMITTED\" | \"MCP_WORKSPACE_MISMATCH\" | \"PAK_NOT_PERMITTED\" | \"ACTIONS_NOT_GRANTABLE\" | \"IDEMPOTENCY_KEY_REUSE\" | \"IDEMPOTENCY_KEY_REQUIRED\" | \"IDEMPOTENCY_IN_PROGRESS\" | \"WEBHOOK_ENDPOINT_LIMIT\" | \"WEBHOOK_ENDPOINT_NOT_FOUND\" | \"WEBHOOK_ENDPOINT_NOT_SUBSCRIBED\" | \"WEBHOOK_EVENT_NOT_FOUND\" | \"WEBHOOK_EVENT_TYPE_UNKNOWN\" | \"ACCOUNT_DEACTIVATED\" | \"ACCOUNT_SUSPENDED\" | \"ALREADY_A_MEMBER\" | \"CROSS_ORIGIN_REJECTED\" | \"EMAIL_NOT_VERIFIED\" | \"INVITE_EMAIL_MISMATCH\" | \"INVITE_EXHAUSTED\" | \"INVITE_EXPIRED\" | \"INVITE_INVALID\" | \"INVITE_NOT_FOUND\" | \"INVITE_REVOKED\" | \"LAST_MEMBER\" | \"MEMBER_RANK_EXCEEDED\" | \"NOT_A_MEMBER\" | \"OAUTH_GRANT_ADMIN_REVOKED\" | \"OWNER_ROLE_REQUIRED\" | \"PAK_ALREADY_MINTED\" | \"PAK_EXPIRED\" | \"PAK_NAME_REQUIRED\" | \"PAK_NAME_TOO_LONG\" | \"PAK_NOT_FOUND\" | \"PAK_REVOKED\" | \"PASSWORD_RESET_INVALID\" | \"POLICY_INVALID\" | \"POLICY_NAME_TAKEN\" | \"POLICY_NOT_FOUND\" | \"ROLE_HAS_MEMBERS\" | \"ROLE_NAME_TAKEN\" | \"ROLE_NOT_FOUND\" | \"ROLE_SYSTEM_IMMUTABLE\" | \"SERVICE_NOT_ACTIVATED\" | \"SERVICE_UNKNOWN\" | \"SOLE_OWNER\" | \"TOO_MANY_ATTEMPTS\" | \"WORKSPACE_KEY_REQUIRED\" | (string & {});\nexport const PlatformAuthErrorCode = { values: [\"BAD_REQUEST\", \"VALIDATION_ERROR\", \"UNAUTHORIZED\", \"PAYMENT_REQUIRED\", \"FORBIDDEN\", \"NOT_FOUND\", \"METHOD_NOT_ALLOWED\", \"NOT_ACCEPTABLE\", \"REQUEST_TIMEOUT\", \"CONFLICT\", \"GONE\", \"PRECONDITION_FAILED\", \"PAYLOAD_TOO_LARGE\", \"UNSUPPORTED_MEDIA_TYPE\", \"UNPROCESSABLE_ENTITY\", \"PRECONDITION_REQUIRED\", \"RATE_LIMITED\", \"INTERNAL_SERVER_ERROR\", \"NOT_IMPLEMENTED\", \"BAD_GATEWAY\", \"SERVICE_UNAVAILABLE\", \"GATEWAY_TIMEOUT\", \"SERVICE_NOT_ENABLED\", \"INVALID_CREDENTIALS\", \"SESSION_REVOKED\", \"MCP_NOT_PERMITTED\", \"MCP_WORKSPACE_MISMATCH\", \"PAK_NOT_PERMITTED\", \"ACTIONS_NOT_GRANTABLE\", \"IDEMPOTENCY_KEY_REUSE\", \"IDEMPOTENCY_KEY_REQUIRED\", \"IDEMPOTENCY_IN_PROGRESS\", \"WEBHOOK_ENDPOINT_LIMIT\", \"WEBHOOK_ENDPOINT_NOT_FOUND\", \"WEBHOOK_ENDPOINT_NOT_SUBSCRIBED\", \"WEBHOOK_EVENT_NOT_FOUND\", \"WEBHOOK_EVENT_TYPE_UNKNOWN\", \"ACCOUNT_DEACTIVATED\", \"ACCOUNT_SUSPENDED\", \"ALREADY_A_MEMBER\", \"CROSS_ORIGIN_REJECTED\", \"EMAIL_NOT_VERIFIED\", \"INVITE_EMAIL_MISMATCH\", \"INVITE_EXHAUSTED\", \"INVITE_EXPIRED\", \"INVITE_INVALID\", \"INVITE_NOT_FOUND\", \"INVITE_REVOKED\", \"LAST_MEMBER\", \"MEMBER_RANK_EXCEEDED\", \"NOT_A_MEMBER\", \"OAUTH_GRANT_ADMIN_REVOKED\", \"OWNER_ROLE_REQUIRED\", \"PAK_ALREADY_MINTED\", \"PAK_EXPIRED\", \"PAK_NAME_REQUIRED\", \"PAK_NAME_TOO_LONG\", \"PAK_NOT_FOUND\", \"PAK_REVOKED\", \"PASSWORD_RESET_INVALID\", \"POLICY_INVALID\", \"POLICY_NAME_TAKEN\", \"POLICY_NOT_FOUND\", \"ROLE_HAS_MEMBERS\", \"ROLE_NAME_TAKEN\", \"ROLE_NOT_FOUND\", \"ROLE_SYSTEM_IMMUTABLE\", \"SERVICE_NOT_ACTIVATED\", \"SERVICE_UNKNOWN\", \"SOLE_OWNER\", \"TOO_MANY_ATTEMPTS\", \"WORKSPACE_KEY_REQUIRED\"] as const };\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/_generated/resources.ts","../src/_generated/types.ts","../src/_generated/client.ts","../src/_generated/errors.ts"],"names":["PlatformAuth","APIClient","PC_BASE_URL","createOpenAPIClient"],"mappings":";;;;;;;;;AAgBA,SAAS,SAAA,CAAa,QAAW,KAAA,EAAiB;AAChD,EAAA,IAAI,KAAA,CAAM,QAAA,KAAa,MAAA,EAAW,OAAO,MAAA;AACzC,EAAA,MAAM,CAAA,GAAK,UAAU,EAAC;A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AA,EAAyB,iBAAA,EAAmB,aAAA,EAAe,qBAAA,EAAuB,mBAAmB,qBAAA,EAAuB,qBAAA,EAAuB,iBAAA,EAAmB,mBAAA,EAAqB,0BAA0B,mBAAA,EAAqB,uBAAA,EAAyB,uBAAA,EAAyB,0BAAA,EAA4B,2BAA2B,wBAAA,EAA0B,4BAAA,EAA8B,iCAAA,EAAmC,yBAAA,EAA2B,8BAA8B,qBAAA,EAAuB,mBAAA,EAAqB,kBAAA,EAAoB,uBAAA,EAAyB,sBAAsB,uBAAA,EAAyB,kBAAA,EAAoB,gBAAA,EAAkB,gBAAA,EAAkB,oBAAoB,gBAAA,EAAkB,aAAA,EAAe,sBAAA,EAAwB,cAAA,EAAgB,6BAA6B,qBAAA,EAAuB,oBAAA,EAAsB,aAAA,EAAe,mBAAA,EAAqB,qBAAqB,eAAA,EAAiB,aAAA,EAAe,wBAAA,EAA0B,gBAAA,EAAkB,qBAAqB,kBAAA,EAAoB,kBAAA,EAAoB,iBAAA,EAAmB,gBAAA,EAAkB,yBAAyB,uBAAA,EAAyB,iBAAA,EAAmB,YAAA,EAAc,mBAAA,EAAqB,wBAAwB,CAAA","file":"index.cjs","sourcesContent":["// Generated by scripts/gen-sdk.mjs from Specs/platform-auth.json. Do not edit.\n\nimport type { APIClient, APIPromise, PagePromise, PollOptions, RequestOptions } from \"@productcraft/core\";\nimport type * as T from \"./types.js\";\n\ntype Bound = Readonly<Record<string, string | undefined>>;\n\n/** Split params into [picked, rest] by key. */\nfunction split(params: object | undefined, keys: readonly string[]): [Record<string, unknown>, Record<string, unknown>] {\n const picked: Record<string, unknown> = {};\n const rest: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(params ?? {})) (keys.includes(k) ? picked : rest)[k] = v;\n return [picked, rest];\n}\n\n/** Fill `actor_id` from a scope bound with `.as(actorId)`, unless the call passes one. */\nfunction fillActor<P>(params: P, bound: Bound): P {\n if (bound.actor_id === undefined) return params;\n const p = (params ?? {}) as Record<string, unknown>;\n return (p.actor_id === undefined ? { ...p, actor_id: bound.actor_id } : p) as P;\n}\n\n/** A form upload as FormData: Blobs (and Files, with their names) as they are, everything else as a string. */\nfunction formData(fields: object | undefined): FormData {\n const form = new FormData();\n for (const [k, v] of Object.entries(fields ?? {})) {\n if (v === undefined || v === null) continue;\n if (v instanceof Blob) form.append(k, v);\n else form.append(k, typeof v === \"object\" ? JSON.stringify(v) : String(v));\n }\n return form;\n}\n\nexport class APIResource {\n protected readonly _client: APIClient;\n /** Path parameters (and `actor_id`) bound by the enclosing scope. */\n protected readonly _b: Bound;\n constructor(client: APIClient, bound: Bound = {}) {\n this._client = client;\n this._b = bound;\n }\n}\n\nvoid split;\nvoid fillActor;\n/** `account` */\nexport class AccountResource extends APIResource {\n /**\n * Delete the calling account. Auto-promotes the oldest admin (or oldest non-self member) to owner in any workspace where the departing account is the sole owner. Linked provider grants that require server-side revocation (Sign in with Apple) are revoked with the provider.\n *\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The session lacks the required action for self-account deletion (defence-in-depth — the route is guarded but the cookie may be present without action access).\n * @throws {NotFoundError} 404 NOT_FOUND: No account row exists for the session principal. Should never fire for a valid session — surfaced for SDKs.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/account\n * @see https://productcraft.co/docs/platform/api-reference#delete-v1-account\n * @example\n * ```ts\n * await platform.account.erase();\n * ```\n */\n erase(options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/account\" }, options);\n }\n}\n\n/** `apiKeys` */\nexport class ApiKeysResource extends APIResource {\n /**\n * Describe the workspace key making this request: its name, workspace, expiry and what it may do in plain sentences. Call it with `Authorization: Bearer pcft_live_…` to test a key right after minting it.\n *\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: No bearer, or the key is unknown, revoked or expired.\n * @throws {PermissionDeniedError} 403 FORBIDDEN, WORKSPACE_KEY_REQUIRED: Signed in with a session or another token instead of a workspace key (`WORKSPACE_KEY_REQUIRED`). Send the `pcft_live_…` key as the bearer.\n * @throws {NotFoundError} 404 NOT_FOUND, PAK_NOT_FOUND: The key was deleted while the request was in flight (`PAK_NOT_FOUND`).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/api-keys/self\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-api-keys-self\n * @example\n * ```ts\n * const apiKeySelf = await platform.apiKeys.self();\n * ```\n */\n self(options?: RequestOptions): APIPromise<T.WithLastResponse<T.ApiKeySelf>> {\n return this._client.request({ method: \"GET\", path: \"/v1/api-keys/self\" }, options);\n }\n}\n\n/** `auth.password` */\nexport class AuthPasswordResource extends APIResource {\n /**\n * Request a password reset email. Neither the response nor its timing reveals whether the email matched an account.\n *\n * @param params - `PlatformAuth.AuthPasswordRequestResetParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Body failed validation (`email` missing or not an email address). Depends only on the request shape, never on whether an account exists.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: more than 10 requests/min from this IP (strict `auth` bucket). `Retry-After` header set. Per-IP limit: rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/auth/password/request-reset\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-auth-password-request-reset\n * @example\n * ```ts\n * await platform.auth.password.requestReset({ email: \"user@example.com\" });\n * ```\n */\n requestReset(params: T.AuthPasswordRequestResetParams, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"POST\", path: \"/v1/auth/password/request-reset\", body: params, public: true }, options);\n }\n /**\n * Reset password using the email-delivered reset token.\n *\n * @param params - `PlatformAuth.AuthPasswordResetParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, PASSWORD_RESET_INVALID: Body failed validation, the new password fails the password policy, or the reset token is invalid or expired (`PASSWORD_RESET_INVALID`).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: more than 10 requests/min from this IP (strict `auth` bucket). `Retry-After` header set. Per-IP limit: rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/auth/password/reset\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-auth-password-reset\n * @example\n * ```ts\n * await platform.auth.password.reset({ new_password: \"MyNewPassword123\", token: \"123456\" });\n * ```\n */\n reset(params: T.AuthPasswordResetParams, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"POST\", path: \"/v1/auth/password/reset\", body: params, public: true }, options);\n }\n}\n\n/** `auth` */\nexport class AuthResource extends APIResource {\n #password?: AuthPasswordResource;\n get password(): AuthPasswordResource {\n return (this.#password ??= new AuthPasswordResource(this._client, this._b));\n }\n /**\n * Logout by revoking refresh token\n *\n * @param params - `PlatformAuth.AuthLogoutParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failed or invalid token\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/auth/logout\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-auth-logout\n * @example\n * ```ts\n * await platform.auth.logout({ refresh_token: \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\" });\n * ```\n */\n logout(params: T.AuthLogoutParams, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"POST\", path: \"/v1/auth/logout\", body: params, public: true }, options);\n }\n /**\n * Revoke the server-side session tied to the caller’s current access token\n *\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid access token\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/auth/logout-current\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-auth-logout-current\n * @example\n * ```ts\n * await platform.auth.logoutCurrent();\n * ```\n */\n logoutCurrent(options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"POST\", path: \"/v1/auth/logout-current\" }, options);\n }\n /**\n * Refresh access token using refresh token\n *\n * @param params - `PlatformAuth.AuthRefreshParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failed or invalid token\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/auth/refresh\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-auth-refresh\n * @example\n * ```ts\n * const token = await platform.auth.refresh({ refresh_token: \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\" });\n * ```\n */\n refresh(params: T.AuthRefreshParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Token>> {\n return this._client.request({ method: \"POST\", path: \"/v1/auth/refresh\", body: params, public: true }, options);\n }\n /**\n * Sign in with email/username and password\n *\n * Every failed attempt answers `401 INVALID_CREDENTIALS`, whatever went wrong: unknown identifier, wrong password, an account with no password credential, an account locked out through a different identifier, an account an operator has blocked, and a wrong password against a suspended or deactivated account. The responses are deliberately identical in body, timing, DB round trips and Redis ops, so signin is not an account-existence oracle. See core/block/CLAUDE.md.\n *\n * @param params - `PlatformAuth.AuthSigninParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failed\n * @throws {AuthenticationError} 401 UNAUTHORIZED, INVALID_CREDENTIALS: Invalid credentials (`INVALID_CREDENTIALS`). Returned for every failed attempt, including a correct password offered while the account is locked out or blocked, and a wrong password against a suspended or deactivated account. The body never says which.\n * @throws {PermissionDeniedError} 403 FORBIDDEN, ACCOUNT_SUSPENDED, ACCOUNT_DEACTIVATED: The account is suspended (`ACCOUNT_SUSPENDED`) or deactivated (`ACCOUNT_DEACTIVATED`). Only reachable once the caller has proven the password — a wrong password against such an account is a 401.\n * @throws {RateLimitError} 429 RATE_LIMITED, TOO_MANY_ATTEMPTS: Too many attempts for this identifier (`TOO_MANY_ATTEMPTS`). Two counters produce it, both keyed purely by the submitted identifier: a burst limit of 5 attempts per minute, and a 15-minute lock after 4 failed attempts. Both fire on the same attempt for a registered and an unregistered identifier. Per-IP limit: rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/auth/signin\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-auth-signin\n * @example\n * ```ts\n * const token = await platform.auth.signin({ identifier: \"user@example.com\", password: \"MySecurePassword123\" });\n * ```\n */\n signin(params: T.AuthSigninParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Token>> {\n return this._client.request({ method: \"POST\", path: \"/v1/auth/signin\", body: params, public: true }, options);\n }\n /**\n * Create a new account and sign in\n *\n * @param params - `PlatformAuth.AuthSignupParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failed\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/auth/signup\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-auth-signup\n * @example\n * ```ts\n * const token = await platform.auth.signup({ email: \"user@example.com\", password: \"MySecurePassword123\", username: \"john_doe\" });\n * ```\n */\n signup(params: T.AuthSignupParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Token>> {\n return this._client.request({ method: \"POST\", path: \"/v1/auth/signup\", body: params, public: true }, options);\n }\n}\n\n/** `introspect.workspaces` */\nexport class IntrospectWorkspacesResource extends APIResource {\n /**\n * Introspect caller's membership + effective policy + enabled services in a workspace\n *\n * @param workspaceId - Id of the workspace.\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session. Also a session that has been signed out (`SESSION_REVOKED`).\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found (unknown slug or id). Known workspaces the caller is not a member of answer 200 with `is_member: false`.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/introspect/workspaces/{workspace_id}\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-introspect-workspaces-workspace-id\n * @example\n * ```ts\n * const introspectWorkspace = await platform.introspect.workspaces.retrieve(\"3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f\");\n * ```\n */\n retrieve(workspaceId: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.IntrospectWorkspace>> {\n return this._client.request({ method: \"GET\", path: \"/v1/introspect/workspaces/{workspace_id}\", pathParams: { workspace_id: workspaceId } }, options);\n }\n}\n\n/** `introspect` */\nexport class IntrospectResource extends APIResource {\n #workspaces?: IntrospectWorkspacesResource;\n get workspaces(): IntrospectWorkspacesResource {\n return (this.#workspaces ??= new IntrospectWorkspacesResource(this._client, this._b));\n }\n /**\n * Resolve a Platform API Key (PAK) to its workspace + IAM-style policy. Downstream services use this with a 60s LRU cache and evaluate the policy via @repo/authz-nestjs evaluatePolicy().\n *\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or malformed `Authorization: Bearer` header, or the PAK is unknown, revoked or expired.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/introspect/api-key\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-introspect-api-key\n * @example\n * ```ts\n * const introspectApiKey = await platform.introspect.apiKey();\n * ```\n */\n apiKey(options?: RequestOptions): APIPromise<T.WithLastResponse<T.IntrospectApiKey>> {\n return this._client.request({ method: \"POST\", path: \"/v1/introspect/api-key\" }, options);\n }\n /**\n * Introspect current user with workspace list\n *\n * @param options - Per-request options.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: more than 60 requests/min from this IP (default bucket). Anonymous callers, and callers whose session has been signed out, otherwise get 200 with `is_authenticated: false`, never 401. Per-IP limit: rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/introspect\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-introspect\n * @example\n * ```ts\n * const introspect = await platform.introspect.retrieve();\n * ```\n */\n retrieve(options?: RequestOptions): APIPromise<T.WithLastResponse<T.Introspect>> {\n return this._client.request({ method: \"GET\", path: \"/v1/introspect\" }, options);\n }\n}\n\n/** `me.avatar` */\nexport class MeAvatarResource extends APIResource {\n /**\n * Clear the caller's avatar and delete the stored object.\n *\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: No session.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/me/avatar\n * @see https://productcraft.co/docs/platform/api-reference#delete-v1-me-avatar\n * @example\n * ```ts\n * await platform.me.avatar.clear();\n * ```\n */\n clear(options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/me/avatar\" }, options);\n }\n /**\n * Upload (or replace) the caller's avatar. PNG/JPEG/WEBP only — SVG is rejected because user-uploaded SVG from a productcraft.co origin is a stored-XSS vector. ≤2 MB. Magic bytes are sniffed; a mislabeled file is rejected.\n *\n * @param params - `PlatformAuth.MeAvatarUploadParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid file: wrong mimetype, oversized, or content does not match the declared type.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: No session.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/me/avatar\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-me-avatar\n * @example\n * ```ts\n * const avatarUrl = await platform.me.avatar.upload({ file: new File([\"…\"], \"image.png\", { type: \"image/png\" }) });\n * ```\n */\n upload(params: T.MeAvatarUploadParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.AvatarUrl>> {\n return this._client.request({ method: \"POST\", path: \"/v1/me/avatar\", body: formData(params) }, options);\n }\n}\n\n/** `me.hiddenGuides` */\nexport class MeHiddenGuidesResource extends APIResource {\n /**\n * Hide a getting-started guide for the caller.\n *\n * Idempotent: hiding a guide that is already hidden returns it unchanged, with its first `hidden_at`. At most 200 are kept; hiding one more drops the oldest.\n *\n * @param key - The guide: a surface name, optionally followed by `:` and a resource id, e.g. `dashboard:<workspace id>` or `all`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: The key is not a valid guide key.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: No session.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller authenticated with a non-human principal (e.g. a workspace API key). Hidden guides are a person's console preference.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PUT /v1/me/hidden-guides/{key}\n * @see https://productcraft.co/docs/platform/api-reference#put-v1-me-hidden-guides-key\n * @example\n * ```ts\n * const hiddenGuide = await platform.me.hiddenGuides.hide(\"dashboard\");\n * ```\n */\n hide(key: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.HiddenGuide>> {\n return this._client.request({ method: \"PUT\", path: \"/v1/me/hidden-guides/{key}\", pathParams: { key } }, options);\n }\n /**\n * List the getting-started guides the caller has hidden.\n *\n * Every guide the caller has hidden in the console, newest first. Hiding is presentation only: the setup status behind a guide is unchanged.\n *\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: No session.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller authenticated with a non-human principal (e.g. a workspace API key). Hidden guides are a person's console preference.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/me/hidden-guides\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-me-hidden-guides\n * @example\n * ```ts\n * const hiddenGuides = await platform.me.hiddenGuides.list();\n * ```\n */\n list(options?: RequestOptions): APIPromise<T.WithLastResponse<T.HiddenGuides>> {\n return this._client.request({ method: \"GET\", path: \"/v1/me/hidden-guides\" }, options);\n }\n /**\n * Show every getting-started guide again.\n *\n * Removes every hidden guide for the caller, `all` included. Idempotent.\n *\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: No session.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller authenticated with a non-human principal (e.g. a workspace API key). Hidden guides are a person's console preference.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/me/hidden-guides\n * @see https://productcraft.co/docs/platform/api-reference#delete-v1-me-hidden-guides\n * @example\n * ```ts\n * await platform.me.hiddenGuides.reset();\n * ```\n */\n reset(options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/me/hidden-guides\" }, options);\n }\n /**\n * Show a hidden getting-started guide again.\n *\n * Idempotent: showing a guide that is not hidden is a no-op.\n *\n * @param key - The guide: a surface name, optionally followed by `:` and a resource id, e.g. `dashboard:<workspace id>` or `all`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: The key is not a valid guide key.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: No session.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller authenticated with a non-human principal (e.g. a workspace API key). Hidden guides are a person's console preference.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/me/hidden-guides/{key}\n * @see https://productcraft.co/docs/platform/api-reference#delete-v1-me-hidden-guides-key\n * @example\n * ```ts\n * await platform.me.hiddenGuides.unhide(\"dashboard\");\n * ```\n */\n unhide(key: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/me/hidden-guides/{key}\", pathParams: { key } }, options);\n }\n}\n\n/** `me.profile` */\nexport class MeProfileResource extends APIResource {\n /**\n * Update the caller's profile. Currently only `displayName` is editable. An empty body is a no-op that returns the current profile. Cookie/JWT only — this is a human-self-service surface, not a PAK-mutation surface.\n *\n * @param params - `PlatformAuth.MeProfileUpdateParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failed (e.g. displayName outside 1-128 chars).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: No session.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller authenticated with a non-human principal (e.g. PAK). Profile is per-human; only the human owner can mutate their own row.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PATCH /v1/me/profile\n * @see https://productcraft.co/docs/platform/api-reference#patch-v1-me-profile\n * @example\n * ```ts\n * const meProfile = await platform.me.profile.update({ display_name: \"string\" });\n * ```\n */\n update(params?: T.MeProfileUpdateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.MeProfile>> {\n return this._client.request({ method: \"PATCH\", path: \"/v1/me/profile\", body: params }, options);\n }\n}\n\n/** `me` */\nexport class MeResource extends APIResource {\n #avatar?: MeAvatarResource;\n #hiddenGuides?: MeHiddenGuidesResource;\n #profile?: MeProfileResource;\n get avatar(): MeAvatarResource {\n return (this.#avatar ??= new MeAvatarResource(this._client, this._b));\n }\n get hiddenGuides(): MeHiddenGuidesResource {\n return (this.#hiddenGuides ??= new MeHiddenGuidesResource(this._client, this._b));\n }\n get profile(): MeProfileResource {\n return (this.#profile ??= new MeProfileResource(this._client, this._b));\n }\n /**\n * Read the caller's account profile.\n *\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: No session.\n * @throws {NotFoundError} 404 NOT_FOUND: No account row for the session principal. Should never fire for a valid session — surfaced for SDKs.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/me\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-me\n * @example\n * ```ts\n * const meProfile = await platform.me.retrieve();\n * ```\n */\n retrieve(options?: RequestOptions): APIPromise<T.WithLastResponse<T.MeProfile>> {\n return this._client.request({ method: \"GET\", path: \"/v1/me\" }, options);\n }\n}\n\n/** `oauth.connections` */\nexport class OauthConnectionsResource extends APIResource {\n /**\n * Disconnect a client\n *\n * Revokes the whole grant family — the grant, its authorization codes, its refresh tokens and every live access token — in one transaction.\n *\n * @param grantId - Id of the grant.\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.\n * @throws {NotFoundError} 404 NOT_FOUND: No such connection for this human.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/oauth/connections/{grant_id}\n * @see https://productcraft.co/docs/platform/api-reference#delete-v1-oauth-connections-grant-id\n * @example\n * ```ts\n * await platform.oauth.connections.delete(\"3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f\");\n * ```\n */\n delete(grantId: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/oauth/connections/{grant_id}\", pathParams: { grant_id: grantId } }, options);\n }\n /**\n * List clients this human has connected\n *\n * The user-facing half of revocation: which third-party clients hold a grant, in which workspace, carrying which policy.\n *\n * @param params - `PlatformAuth.OauthConnectionListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/oauth/connections\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-oauth-connections\n * @example\n * ```ts\n * for await (const connection of platform.oauth.connections.list()) {\n * console.log(connection);\n * }\n * const page = await platform.oauth.connections.list({}, { timeout: 5_000 });\n * ```\n */\n list(params?: T.OauthConnectionListParams, options?: RequestOptions): PagePromise<T.ConnectedClient> {\n return this._client.list({ method: \"GET\", path: \"/v1/oauth/connections\", query: params }, options);\n }\n}\n\n/** `oauth.workspaces.connections` */\nexport class OauthWorkspacesConnectionsResource extends APIResource {\n /**\n * Disconnect a client on behalf of the workspace\n *\n * Revokes the whole grant family for a grant made by any member of this workspace — the lever a workspace owner needs when an employee leaves and their MCP client is still running. Requires `workspace.connection.revoke`.\n *\n * @param workspaceId - Id of the workspace.\n * @param grantId - Id of the grant.\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: Not a member, or lacks `workspace.connection.revoke`.\n * @throws {NotFoundError} 404 NOT_FOUND: No such connection in this workspace.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/oauth/workspaces/{workspace_id}/connections/{grant_id}\n * @see https://productcraft.co/docs/platform/api-reference#delete-v1-oauth-workspaces-workspace-id-connections-grant-id\n * @example\n * ```ts\n * await platform.oauth.workspaces.connections.delete(\"3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f\", \"3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f\");\n * ```\n */\n delete(workspaceId: string, grantId: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/oauth/workspaces/{workspace_id}/connections/{grant_id}\", pathParams: { workspace_id: workspaceId, grant_id: grantId } }, options);\n }\n /**\n * List every client connected to a workspace\n *\n * The workspace-side half of revocation, for owners and admins: every grant made against this workspace, by any member, including grants made by people who have since left. Requires `workspace.connection.read`.\n *\n * @param workspaceId - Id of the workspace.\n * @param params - `PlatformAuth.OauthWorkspaceConnectionListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: Not a member, or lacks `workspace.connection.read`.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/oauth/workspaces/{workspace_id}/connections\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-oauth-workspaces-workspace-id-connections\n * @example\n * ```ts\n * for await (const connection of platform.oauth.workspaces.connections.list(\"3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f\")) {\n * console.log(connection);\n * }\n * const page = await platform.oauth.workspaces.connections.list(\"3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f\", {}, { timeout: 5_000 });\n * ```\n */\n list(workspaceId: string, params?: T.OauthWorkspaceConnectionListParams, options?: RequestOptions): PagePromise<T.ConnectedClient> {\n return this._client.list({ method: \"GET\", path: \"/v1/oauth/workspaces/{workspace_id}/connections\", pathParams: { workspace_id: workspaceId }, query: params }, options);\n }\n /**\n * Lift a workspace revocation so the member may reconnect\n *\n * A workspace revocation is durable: the member re-running the connect flow does not undo it, so an administrator has to. This clears the block only — every token minted under the old grant stays revoked and the member still has to approve a fresh consent screen. Requires `workspace.connection.revoke`.\n *\n * @param workspaceId - Id of the workspace.\n * @param grantId - Id of the grant.\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session, or a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN: Not a member, or lacks `workspace.connection.revoke`.\n * @throws {NotFoundError} 404 NOT_FOUND: No such connection in this workspace.\n * @throws {ConflictError} 409 CONFLICT: The connection was not revoked by an administrator — there is nothing to lift.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/oauth/workspaces/{workspace_id}/connections/{grant_id}/restore\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-oauth-workspaces-workspace-id-connections-grant-id-restore\n * @example\n * ```ts\n * await platform.oauth.workspaces.connections.restore(\"3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f\", \"3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f\");\n * ```\n */\n restore(workspaceId: string, grantId: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"POST\", path: \"/v1/oauth/workspaces/{workspace_id}/connections/{grant_id}/restore\", pathParams: { workspace_id: workspaceId, grant_id: grantId } }, options);\n }\n}\n\n/** `oauth.workspaces` */\nexport class OauthWorkspacesResource extends APIResource {\n #connections?: OauthWorkspacesConnectionsResource;\n get connections(): OauthWorkspacesConnectionsResource {\n return (this.#connections ??= new OauthWorkspacesConnectionsResource(this._client, this._b));\n }\n}\n\n/** `oauth` */\nexport class OauthResource extends APIResource {\n #connections?: OauthConnectionsResource;\n #workspaces?: OauthWorkspacesResource;\n get connections(): OauthConnectionsResource {\n return (this.#connections ??= new OauthConnectionsResource(this._client, this._b));\n }\n get workspaces(): OauthWorkspacesResource {\n return (this.#workspaces ??= new OauthWorkspacesResource(this._client, this._b));\n }\n}\n\n/** `sessions` */\nexport class SessionsResource extends APIResource {\n /**\n * Revoke one of the caller's own sessions. Takes effect immediately — the refresh token stops working straight away, not at the end of its window.\n *\n * @param id - Id of the session.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `id` is not a UUID.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Unauthorized\n * @throws {NotFoundError} 404 NOT_FOUND: No such session, or it belongs to somebody else — deliberately the same response, so this cannot be used to probe which session ids exist.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/session/{id}\n * @see https://productcraft.co/docs/platform/api-reference#delete-v1-session-id\n * @example\n * ```ts\n * const revokeSession = await platform.sessions.delete(\"3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f\");\n * ```\n */\n delete(id: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.RevokeSession>> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/session/{id}\", pathParams: { id } }, options);\n }\n /**\n * List active sessions\n *\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Unauthorized\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/session\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-session\n * @example\n * ```ts\n * const result = await platform.sessions.list();\n * ```\n */\n list(options?: RequestOptions): APIPromise<T.WithLastResponse<T.SessionListResponse>> {\n return this._client.request({ method: \"GET\", path: \"/v1/session\" }, options);\n }\n /**\n * Sign out every other session of the caller, keeping the one this request was made with. Takes effect immediately for the revoked sessions. Idempotent: a repeat call revokes 0.\n *\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Unauthorized\n * @throws {ConflictError} 409 CONFLICT: The access token maps to no session (minted before sessions tracked token ids), so the current session cannot be kept. Sign in again.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/session/revoke-others\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-session-revoke-others\n * @example\n * ```ts\n * const revokeOtherSessions = await platform.sessions.revokeOthers();\n * ```\n */\n revokeOthers(options?: RequestOptions): APIPromise<T.WithLastResponse<T.RevokeOtherSessions>> {\n return this._client.request({ method: \"POST\", path: \"/v1/session/revoke-others\" }, options);\n }\n}\n\n/** `stats` */\nexport class StatsResource extends APIResource {\n /**\n * Workspace stats\n *\n * Member count, active platform API keys, admin changes in the window with a daily series, the last admin change and the last API-key use, for the console dashboard.\n *\n * Admin changes are workspace audit events that record a mutation. Reads (any action ending `.read`), sign-ins (`auth.signin.succeeded`) and MCP tool-call rows (`workspace.mcp_tool.*`) are not counted, so opening the console does not move the numbers. Days are UTC. Counts and timestamps only: no actor identifiers. Cached for up to 60 seconds (`generated_at`).\n *\n * @param params - `PlatformAuth.StatsRetrieveParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `window` is not one of 1d, 7d, 30d, or `workspaceId` is the slug of a workspace the caller can read rather than its UUID.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of the workspace (`NOT_A_MEMBER`) or lacks `workspace.audit.read` on it.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this id (or slug). Same answer as the service's other workspace routes.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/stats\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-id-stats\n * @example\n * ```ts\n * const workspaceStats = await platform.stats.retrieve();\n * ```\n */\n retrieve(params?: T.StatsRetrieveParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.WorkspaceStats>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/stats\", query: params }, options);\n }\n}\n\n/** `verification` */\nexport class VerificationResource extends APIResource {\n /**\n * Resend verification email\n *\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Unauthorized\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/verification/resend\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-verification-resend\n * @example\n * ```ts\n * const feedback = await platform.verification.resend();\n * ```\n */\n resend(options?: RequestOptions): APIPromise<T.WithLastResponse<T.Feedback>> {\n return this._client.request({ method: \"POST\", path: \"/v1/verification/resend\" }, options);\n }\n /**\n * Verify an email code\n *\n * @param params - `PlatformAuth.VerificationVerifyParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid or expired verification code\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/verification/verify\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-verification-verify\n * @example\n * ```ts\n * const feedback = await platform.verification.verify({ code: \"a1b2c3d4…\" });\n * ```\n */\n verify(params: T.VerificationVerifyParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Feedback>> {\n return this._client.request({ method: \"POST\", path: \"/v1/verification/verify\", body: params, public: true }, options);\n }\n}\n\n/** `wellKnown` */\nexport class WellKnownResource extends APIResource {\n /**\n * Public JWKS for verifying platform-issued JWTs (issuer `https://api.auth.productcraft.co`).\n *\n * @param options - Per-request options.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /.well-known/jwks.json\n * @see https://productcraft.co/docs/platform/api-reference#get-well-known-jwks-json\n * @example\n * ```ts\n * const jwks = await platform.wellKnown.jwks();\n * ```\n */\n jwks(options?: RequestOptions): APIPromise<T.WithLastResponse<T.Jwks>> {\n return this._client.request({ method: \"GET\", path: \"/.well-known/jwks.json\", public: true }, options);\n }\n /**\n * OAuth 2.1 authorization server metadata (RFC 8414)\n *\n * Discovery document for third-party clients (Claude Desktop, Cursor, the ProductCraft MCP server). PKCE with `S256` is mandatory; no other code-challenge method is advertised or accepted. `scopes_supported` lists **presets**, not scopes: authority is the policy document on the grant (`authority_model`).\n *\n * @param options - Per-request options.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /.well-known/oauth-authorization-server\n * @see https://productcraft.co/docs/platform/api-reference#get-well-known-oauth-authorization-server\n * @example\n * ```ts\n * const authorizationServerMetadata = await platform.wellKnown.oauthAuthorizationServer();\n * ```\n */\n oauthAuthorizationServer(options?: RequestOptions): APIPromise<T.WithLastResponse<T.AuthorizationServerMetadata>> {\n return this._client.request({ method: \"GET\", path: \"/.well-known/oauth-authorization-server\", public: true }, options);\n }\n}\n\n/** `workspaces.apiKeys.presets` */\nexport class WorkspacesApiKeysPresetsResource extends APIResource {\n /**\n * List the ready-made permission sets a workspace key can be minted with (`preset` on create), each with a label, a description and what it allows in this workspace, in plain sentences. A preset a key has already used reads its stored policy, so edits show.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, malformed or invalid session.\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.apikey.read`.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_slug}/api-keys/presets\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-api-keys-presets\n * @example\n * ```ts\n * for await (const preset of platform.workspaces.apiKeys.presets.list(\"acme\")) {\n * console.log(preset);\n * }\n * ```\n */\n list(workspaceSlug: string, options?: RequestOptions): PagePromise<T.PakPreset> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_slug}/api-keys/presets\", pathParams: { workspace_slug: workspaceSlug } }, options);\n }\n}\n\n/** `workspaces.apiKeys` */\nexport class WorkspacesApiKeysResource extends APIResource {\n #presets?: WorkspacesApiKeysPresetsResource;\n get presets(): WorkspacesApiKeysPresetsResource {\n return (this.#presets ??= new WorkspacesApiKeysPresetsResource(this._client, this._b));\n }\n /**\n * Mint a new PAK. Choose what it can do with `preset` (a ready-made set such as `mail-send`) or `policy_ids` (managed policies you wrote), never both. The plaintext `token` is returned ONCE — store it now, then call `GET /v1/api-keys/self` with it to check what it can do. The minter can grant at most their own effective permissions. Cookie/JWT only — PAKs cannot mint other PAKs. Send an `Idempotency-Key` to make a retry safe: a retry of a mint that succeeded mints nothing and answers `409 PAK_ALREADY_MINTED` with that key's `id` (the token itself is never cached).\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param params - `PlatformAuth.WorkspaceApiKeyCreateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, PAK_NAME_REQUIRED, PAK_NAME_TOO_LONG: Body failed validation (`VALIDATION_ERROR`): neither or both of `policy_ids` and `preset`, an unknown `preset`, an empty `policy_ids`, more than 25 policies, or a blank/overlong `name` (`PAK_NAME_REQUIRED` / `PAK_NAME_TOO_LONG`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing, malformed or invalid session. Also a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is a PAK (`pcft_live_*`) — mint requires a human-issued session; or is not a member (`NOT_A_MEMBER`), lacks `workspace.apikey.create`, or cannot grant one or more actions in the chosen preset or policies.\n * @throws {NotFoundError} 404 NOT_FOUND, POLICY_NOT_FOUND: Workspace not found, or one of `policy_ids` does not exist in this workspace (`POLICY_NOT_FOUND`).\n * @throws {ConflictError} 409 CONFLICT, PAK_ALREADY_MINTED, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `PAK_ALREADY_MINTED`: this `Idempotency-Key` already minted a key (its `id` is in `details`); the token was shown once, so rotate that key for a new one. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_slug}/api-keys\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-workspace-slug-api-keys\n * @example\n * ```ts\n * const mintPak = await platform.workspaces.apiKeys.create(\"acme\", { name: \"Production social client\" });\n * ```\n */\n create(workspaceSlug: string, params: T.WorkspaceApiKeyCreateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.MintPak>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_slug}/api-keys\", pathParams: { workspace_slug: workspaceSlug }, body: params, idempotent: true }, options);\n }\n /**\n * Revoke a PAK. Default behaviour: introspect returns null on the next upstream call; downstream services fail-closed within the 60s cache TTL window. Pass `?force=true` to additionally publish a Redis fan-out that evicts the matching cache entry across every PAK-consuming service immediately — use it when rotating a leaked PAK and the 60s window matters.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param id - Id of the api key.\n * @param params - `PlatformAuth.WorkspaceApiKeyDeleteParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `id` is not a UUID.\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing, malformed or invalid session, or a PAK bearer (this route accepts cookie/JWT sessions only). Also a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.apikey.delete`.\n * @throws {NotFoundError} 404 NOT_FOUND, PAK_NOT_FOUND: Workspace not found, or PAK not found in this workspace (`PAK_NOT_FOUND`). Revoking an already-revoked PAK is a 204 no-op.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_slug}/api-keys/{id}\n * @see https://productcraft.co/docs/platform/api-reference#delete-v1-workspaces-workspace-slug-api-keys-id\n * @example\n * ```ts\n * await platform.workspaces.apiKeys.delete(\"acme\", \"3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f\");\n * ```\n */\n delete(workspaceSlug: string, id: string, params?: T.WorkspaceApiKeyDeleteParams, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_slug}/api-keys/{id}\", pathParams: { workspace_slug: workspaceSlug, id }, query: params }, options);\n }\n /**\n * List the API keys in this workspace\n *\n * Newest first, as the standard cursor-paginated `{data, pagination}` envelope (20 per page, at most 100). Plaintext tokens are never returned, only prefixes and metadata.\n *\n * **Deprecated legacy shape:** a request that sends neither `limit` nor `cursor` gets a bare JSON array of every key (capped at 1000), unless its `User-Agent` is a ProductCraft SDK (`productcraft-…`), which always gets the envelope. The array is kept only for `@productcraft/platform-auth` 0.0.x clients and is removed in the platform API's next major version; send `limit` (or use an SDK).\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param params - `PlatformAuth.WorkspaceApiKeyListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`, or `include_revoked` is not `true` or `false` (`VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_slug}/api-keys\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-api-keys\n * @example\n * ```ts\n * for await (const apiKey of platform.workspaces.apiKeys.list(\"acme\")) {\n * console.log(apiKey);\n * }\n * const page = await platform.workspaces.apiKeys.list(\"acme\", {}, { timeout: 5_000 });\n * ```\n */\n list(workspaceSlug: string, params?: T.WorkspaceApiKeyListParams, options?: RequestOptions): PagePromise<T.PublicApiKey> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_slug}/api-keys\", pathParams: { workspace_slug: workspaceSlug }, query: params }, options);\n }\n /**\n * Describe the key a mint with this `preset` or these `policy_ids` would create, without creating anything: what it could do in plain sentences, and whether you may mint it. Read-only, so it takes no `Idempotency-Key`. Powers the review step of the console key wizard.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param params - `PlatformAuth.WorkspaceApiKeyPreviewParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Body failed validation (`VALIDATION_ERROR`): neither or both of `policy_ids` and `preset`, an unknown `preset`, or an empty or oversized `policy_ids`.\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing, malformed or invalid session. Also a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is a PAK, is not a member (`NOT_A_MEMBER`), or lacks `workspace.apikey.create`. A key you could not mint is NOT a 403 here: it comes back with `grantable: false`.\n * @throws {NotFoundError} 404 NOT_FOUND, POLICY_NOT_FOUND: Workspace not found, or one of `policy_ids` does not exist in this workspace (`POLICY_NOT_FOUND`).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_slug}/api-keys/preview\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-workspace-slug-api-keys-preview\n * @example\n * ```ts\n * const pakGrantPreview = await platform.workspaces.apiKeys.preview(\"acme\", { policy_ids: [\"11111111-1111-1111-1111-111111111111\"] });\n * ```\n */\n preview(workspaceSlug: string, params?: T.WorkspaceApiKeyPreviewParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.PakGrantPreview>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_slug}/api-keys/preview\", pathParams: { workspace_slug: workspaceSlug }, body: params }, options);\n }\n /**\n * Get a single PAK by id.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param id - Id of the api key.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `id` is not a UUID.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, malformed or invalid session, or a PAK bearer (this route accepts cookie/JWT sessions only).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.apikey.read`.\n * @throws {NotFoundError} 404 NOT_FOUND, PAK_NOT_FOUND: Workspace not found, or PAK not found in this workspace (`PAK_NOT_FOUND`).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_slug}/api-keys/{id}\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-api-keys-id\n * @example\n * ```ts\n * const publicApiKey = await platform.workspaces.apiKeys.retrieve(\"acme\", \"3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f\");\n * ```\n */\n retrieve(workspaceSlug: string, id: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.PublicApiKey>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_slug}/api-keys/{id}\", pathParams: { workspace_slug: workspaceSlug, id } }, options);\n }\n /**\n * Mint a replacement for an existing PAK, carrying its name, description and policy bindings over. The outgoing key keeps working for `grace_hours` (24 by default) so a fleet can roll over without downtime. The plaintext `token` is returned ONCE. Cookie/JWT only — a PAK cannot rotate a PAK, for the same reason it cannot mint one.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param id - Id of the api key.\n * @param params - `PlatformAuth.WorkspaceApiKeyRotateParams`.\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session, or a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN: Caller is a PAK (`pcft_live_*`), or cannot grant one or more actions in the bindings being carried across.\n * @throws {NotFoundError} 404 NOT_FOUND: PAK not found in this workspace.\n * @throws {ConflictError} 409 CONFLICT, PAK_REVOKED, PAK_EXPIRED: The key is revoked (`PAK_REVOKED`), already expired (`PAK_EXPIRED`), or has no policy bindings to carry across.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_slug}/api-keys/{id}/rotate\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-workspace-slug-api-keys-id-rotate\n * @example\n * ```ts\n * const rotatePak = await platform.workspaces.apiKeys.rotate(\"acme\", \"3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f\", { grace_hours: 24 });\n * ```\n */\n rotate(workspaceSlug: string, id: string, params?: T.WorkspaceApiKeyRotateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.RotatePak>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_slug}/api-keys/{id}/rotate\", pathParams: { workspace_slug: workspaceSlug, id }, body: params }, options);\n }\n /**\n * Update a PAK’s name or description (does not touch bindings).\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param id - Id of the api key.\n * @param params - `PlatformAuth.WorkspaceApiKeyUpdateParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, PAK_NAME_REQUIRED: `id` is not a UUID, body failed validation, or `name` is blank (`PAK_NAME_REQUIRED`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing, malformed or invalid session, or a PAK bearer (this route accepts cookie/JWT sessions only). Also a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.apikey.update`.\n * @throws {NotFoundError} 404 NOT_FOUND, PAK_NOT_FOUND: Workspace not found, or PAK not found in this workspace (`PAK_NOT_FOUND`).\n * @throws {ConflictError} 409 CONFLICT, PAK_REVOKED: PAK is revoked (`PAK_REVOKED`).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PATCH /v1/workspaces/{workspace_slug}/api-keys/{id}\n * @see https://productcraft.co/docs/platform/api-reference#patch-v1-workspaces-workspace-slug-api-keys-id\n * @example\n * ```ts\n * const publicApiKey = await platform.workspaces.apiKeys.update(\"acme\", \"3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f\", { description: \"string\" });\n * ```\n */\n update(workspaceSlug: string, id: string, params?: T.WorkspaceApiKeyUpdateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.PublicApiKey>> {\n return this._client.request({ method: \"PATCH\", path: \"/v1/workspaces/{workspace_slug}/api-keys/{id}\", pathParams: { workspace_slug: workspaceSlug, id }, body: params }, options);\n }\n /**\n * Replace the managed-policy bindings on a PAK. Re-runs caller-narrowing on the merged union of statements.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param id - Id of the api key.\n * @param params - `PlatformAuth.WorkspaceApiKeyUpdateBindingsParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: One of: bound > 25 policies; merged > 200 statements; one of the policy ids does not exist or lives in a different workspace.\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session, or a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN: Caller cannot grant one or more actions in the merged statement set.\n * @throws {NotFoundError} 404 NOT_FOUND: PAK not found in this workspace.\n * @throws {ConflictError} 409 CONFLICT: Empty bindings — revoke the PAK instead of leaving it unbound.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PATCH /v1/workspaces/{workspace_slug}/api-keys/{id}/bindings\n * @see https://productcraft.co/docs/platform/api-reference#patch-v1-workspaces-workspace-slug-api-keys-id-bindings\n * @example\n * ```ts\n * const publicApiKey = await platform.workspaces.apiKeys.updateBindings(\"acme\", \"3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f\", { policy_ids: [\"string\"] });\n * ```\n */\n updateBindings(workspaceSlug: string, id: string, params: T.WorkspaceApiKeyUpdateBindingsParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.PublicApiKey>> {\n return this._client.request({ method: \"PATCH\", path: \"/v1/workspaces/{workspace_slug}/api-keys/{id}/bindings\", pathParams: { workspace_slug: workspaceSlug, id }, body: params }, options);\n }\n}\n\n/** `workspaces.auditFeed` */\nexport class WorkspacesAuditFeedResource extends APIResource {\n /**\n * Unified workspace audit feed (cursor-paginated)\n *\n * Audit timeline for workspace-scoped events — workspace, member, role, invite, service-activation, PAK and OAuth-consent mutations, plus successful sign-ins and completed password resets. Per-app Auth rows are NOT merged in: they live in another database with no cursor that spans both, and they are served by `GET /v1/apps/:appId/audit-logs` (paginated), `.../audit-logs/export` (streamed) and the per-app audit sink. The `sources` field reports that explicitly rather than implying a pending follow-up.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param params - `PlatformAuth.WorkspaceAuditFeedListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid query params — `actor_id` is not a well-formed UUID, or `cursor` is not a cursor this endpoint minted. `since`/`until` that do not parse as ISO-8601 are ignored rather than rejected, and `sources` silently drops unknown names; an empty result set after those filters still returns 200.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller is signed in but lacks `workspace.audit.read` for this workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: The `:workspaceSlug` path param does not resolve to a workspace the caller can see.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_slug}/audit-feed\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-audit-feed\n * @example\n * ```ts\n * for await (const auditFeed of platform.workspaces.auditFeed.list(\"acme\")) {\n * console.log(auditFeed);\n * }\n * const page = await platform.workspaces.auditFeed.list(\"acme\", {}, { timeout: 5_000 });\n * ```\n */\n list(workspaceSlug: string, params?: T.WorkspaceAuditFeedListParams, options?: RequestOptions): PagePromise<T.FeedItem> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_slug}/audit-feed\", pathParams: { workspace_slug: workspaceSlug }, query: fillActor(params, this._b) }, options);\n }\n}\n\n/** `workspaces.auditLogs` */\nexport class WorkspacesAuditLogsResource extends APIResource {\n /**\n * Stream the workspace audit log as NDJSON or CSV, applying the same `?action=` / `?actor_id=` / `?since=` / `?until=` filters as the list. Newest first. Reading the export is itself audited.\n *\n * The response is streamed: rows are walked in keyset batches and written as they are read, so neither the service nor the client holds the whole log. This is the SOC 2 / GDPR export the platform docs promise. Hard cap of 1,000,000 rows per call; a wider request is refused with 413 before any body is written, so a truncated file can never masquerade as a complete one.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param params - `PlatformAuth.WorkspaceAuditLogExportParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Unknown `format`, or malformed `since` / `until`.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `workspace.audit.read`.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found.\n * @throws {APIError} 413 PAYLOAD_TOO_LARGE: More than 1,000,000 rows match. Narrow the window with `since` / `until` and retry.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_slug}/audit-logs/export\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-audit-logs-export\n * @example\n * ```ts\n * const response = await platform.workspaces.auditLogs.export(\"acme\");\n * const text = await response.text();\n * ```\n */\n export(workspaceSlug: string, params?: T.WorkspaceAuditLogExportParams, options?: RequestOptions): APIPromise<Response> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_slug}/audit-logs/export\", pathParams: { workspace_slug: workspaceSlug }, query: fillActor(params, this._b), raw: true }, options);\n }\n /**\n * List workspace audit log entries, newest first. Filter by `?action=`, `?actor_id=`, and/or the `?since=` / `?until=` date range. 20/page (max 100), cursor-paginated.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param params - `PlatformAuth.WorkspaceAuditLogListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`, `since`, or `until`.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_slug}/audit-logs\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-audit-logs\n * @example\n * ```ts\n * for await (const auditLog of platform.workspaces.auditLogs.list(\"acme\")) {\n * console.log(auditLog);\n * }\n * const page = await platform.workspaces.auditLogs.list(\"acme\", {}, { timeout: 5_000 });\n * ```\n */\n list(workspaceSlug: string, params?: T.WorkspaceAuditLogListParams, options?: RequestOptions): PagePromise<T.WorkspaceAuditLogEntry> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_slug}/audit-logs\", pathParams: { workspace_slug: workspaceSlug }, query: fillActor(params, this._b) }, options);\n }\n}\n\n/** `workspaces.avatar` */\nexport class WorkspacesAvatarResource extends APIResource {\n /**\n * Clear the workspace avatar and delete the stored object. Gated by `workspace.settings.update`.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid session.\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.settings.update`.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found (unknown slug or id).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_slug}/avatar\n * @see https://productcraft.co/docs/platform/api-reference#delete-v1-workspaces-workspace-slug-avatar\n * @example\n * ```ts\n * await platform.workspaces.avatar.clear(\"acme\");\n * ```\n */\n clear(workspaceSlug: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_slug}/avatar\", pathParams: { workspace_slug: workspaceSlug } }, options);\n }\n /**\n * Upload (or replace) the workspace identity avatar. Gated by `workspace.settings.update` (owner + admin). PNG/JPEG/WEBP only, ≤2 MB, magic-byte sniffed. SVG is rejected (stored-XSS).\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param params - `PlatformAuth.WorkspaceAvatarUploadParams`.\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: Caller is not a member of this workspace, or lacks workspace.settings.update.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_slug}/avatar\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-workspace-slug-avatar\n * @example\n * ```ts\n * const workspaceAvatarUrl = await platform.workspaces.avatar.upload(\"acme\", { file: new File([\"…\"], \"image.png\", { type: \"image/png\" }) });\n * ```\n */\n upload(workspaceSlug: string, params: T.WorkspaceAvatarUploadParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.WorkspaceAvatarUrl>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_slug}/avatar\", pathParams: { workspace_slug: workspaceSlug }, body: formData(params) }, options);\n }\n}\n\n/** `workspaces.invites` */\nexport class WorkspacesInvitesResource extends APIResource {\n /**\n * Accept a workspace invite by code. Cookie/JWT only — invite acceptance binds a human identity to a workspace.\n *\n * @param params - `PlatformAuth.WorkspaceInviteAcceptParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Body failed validation (`code` missing or empty).\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session. Also a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, EMAIL_NOT_VERIFIED, INVITE_EMAIL_MISMATCH: Caller is a PAK (`pcft_live_*`), email not verified (`EMAIL_NOT_VERIFIED`), or the invite is restricted to a different email (`INVITE_EMAIL_MISMATCH`).\n * @throws {NotFoundError} 404 NOT_FOUND, INVITE_INVALID: Invite code not found (`INVITE_INVALID`).\n * @throws {ConflictError} 409 CONFLICT, ALREADY_A_MEMBER: Caller is already a member of this workspace (`ALREADY_A_MEMBER`).\n * @throws {APIError} 410 GONE, INVITE_REVOKED, INVITE_EXPIRED, INVITE_EXHAUSTED: Invite revoked (`INVITE_REVOKED`), expired (`INVITE_EXPIRED`) or out of uses (`INVITE_EXHAUSTED`).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: more than 10 requests/min from this IP (strict `auth` bucket). `Retry-After` header set. Per-IP limit: rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/invites/accept\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-invites-accept\n * @example\n * ```ts\n * const workspace = await platform.workspaces.invites.accept({ code: \"inv_…\" });\n * ```\n */\n accept(params: T.WorkspaceInviteAcceptParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Workspace>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/invites/accept\", body: params }, options);\n }\n /**\n * Create a workspace invite link. Cookie/JWT only — invites bring new humans into the workspace.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param params - `PlatformAuth.WorkspaceInviteCreateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Body failed validation.\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session. Also a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, EMAIL_NOT_VERIFIED, NOT_A_MEMBER, OWNER_ROLE_REQUIRED, MEMBER_RANK_EXCEEDED: Caller is a PAK (`pcft_live_*`), email not verified (`EMAIL_NOT_VERIFIED`), not a member (`NOT_A_MEMBER`), lacks `workspace.member.invite`, a non-owner tried to invite an owner (`OWNER_ROLE_REQUIRED`), or the role holds permissions the caller does not (`MEMBER_RANK_EXCEEDED`).\n * @throws {NotFoundError} 404 NOT_FOUND, ROLE_NOT_FOUND: Workspace not found, or role not found in this workspace (`ROLE_NOT_FOUND`).\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_slug}/invites\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-workspace-slug-invites\n * @example\n * ```ts\n * const workspaceInvite = await platform.workspaces.invites.create(\"acme\", { email: \"alice@example.com\" });\n * ```\n */\n create(workspaceSlug: string, params?: T.WorkspaceInviteCreateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.WorkspaceInvite>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_slug}/invites\", pathParams: { workspace_slug: workspaceSlug }, body: params, idempotent: true }, options);\n }\n /**\n * Revoke a workspace invite. Cookie/JWT only.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param inviteId - Id of the invite.\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session. Also a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is a PAK (`pcft_live_*`), not a member of the invite’s workspace (`NOT_A_MEMBER`), or lacks `workspace.member.invite`.\n * @throws {NotFoundError} 404 NOT_FOUND, INVITE_NOT_FOUND: Workspace not found, or invite not found (`INVITE_NOT_FOUND`).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_slug}/invites/{invite_id}\n * @see https://productcraft.co/docs/platform/api-reference#delete-v1-workspaces-workspace-slug-invites-invite-id\n * @example\n * ```ts\n * await platform.workspaces.invites.delete(\"acme\", \"3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f\");\n * ```\n */\n delete(workspaceSlug: string, inviteId: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_slug}/invites/{invite_id}\", pathParams: { workspace_slug: workspaceSlug, invite_id: inviteId } }, options);\n }\n /**\n * List workspace invites, newest first. Cursor-paginated.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param params - `PlatformAuth.WorkspaceInviteListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid session.\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.member.invite`.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found (unknown slug or id).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_slug}/invites\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-invites\n * @example\n * ```ts\n * for await (const invite of platform.workspaces.invites.list(\"acme\")) {\n * console.log(invite);\n * }\n * const page = await platform.workspaces.invites.list(\"acme\", {}, { timeout: 5_000 });\n * ```\n */\n list(workspaceSlug: string, params?: T.WorkspaceInviteListParams, options?: RequestOptions): PagePromise<T.WorkspaceInviteListItem> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_slug}/invites\", pathParams: { workspace_slug: workspaceSlug }, query: params }, options);\n }\n}\n\n/** `workspaces.members` */\nexport class WorkspacesMembersResource extends APIResource {\n /**\n * Remove a member from a workspace (or self-leave)\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param accountId - Id of the account.\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session. Also a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER, MEMBER_RANK_EXCEEDED: Caller is not a member of this workspace (`NOT_A_MEMBER`), lacks `workspace.member.remove` (not required for self-leave), or the target outranks the caller (`MEMBER_RANK_EXCEEDED`: only an owner can remove an owner, and the target role's permissions must all be held by the caller).\n * @throws {NotFoundError} 404 NOT_FOUND, NOT_A_MEMBER: Workspace not found, or target account is not a member (`NOT_A_MEMBER`).\n * @throws {ConflictError} 409 CONFLICT, LAST_MEMBER, SOLE_OWNER: Target is the last member (`LAST_MEMBER`) or the sole owner (`SOLE_OWNER`).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_slug}/members/{account_id}\n * @see https://productcraft.co/docs/platform/api-reference#delete-v1-workspaces-workspace-slug-members-account-id\n * @example\n * ```ts\n * await platform.workspaces.members.delete(\"acme\", \"3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f\");\n * ```\n */\n delete(workspaceSlug: string, accountId: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_slug}/members/{account_id}\", pathParams: { workspace_slug: workspaceSlug, account_id: accountId } }, options);\n }\n /**\n * List workspace members, oldest join first. Narrow with `?q=` (name / username / email substring) and/or `?role=`. Cursor-paginated.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param params - `PlatformAuth.WorkspaceMemberListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid session.\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.member.read`.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found (unknown slug or id).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_slug}/members\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-members\n * @example\n * ```ts\n * for await (const member of platform.workspaces.members.list(\"acme\")) {\n * console.log(member);\n * }\n * const page = await platform.workspaces.members.list(\"acme\", {}, { timeout: 5_000 });\n * ```\n */\n list(workspaceSlug: string, params?: T.WorkspaceMemberListParams, options?: RequestOptions): PagePromise<T.WorkspaceMember> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_slug}/members\", pathParams: { workspace_slug: workspaceSlug }, query: params }, options);\n }\n /**\n * Update a member's role. Body: { roleId } or { role: \"owner\"|\"admin\"|\"member\" }.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param accountId - Id of the account.\n * @param params - `PlatformAuth.WorkspaceMemberUpdateRoleParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Body failed validation.\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session. Also a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER, OWNER_ROLE_REQUIRED, MEMBER_RANK_EXCEEDED: Caller is not a member of this workspace (`NOT_A_MEMBER`), lacks `workspace.member.update-role`, a non-owner tried to assign the owner role or change an owner (`OWNER_ROLE_REQUIRED`), or a non-owner tried to change a role to or from one holding permissions the caller lacks (`MEMBER_RANK_EXCEEDED`). Admins may make admins, never owners.\n * @throws {NotFoundError} 404 NOT_FOUND, NOT_A_MEMBER, ROLE_NOT_FOUND: Workspace not found, target account is not a member (`NOT_A_MEMBER`), or role not found in this workspace (`ROLE_NOT_FOUND`).\n * @throws {ConflictError} 409 CONFLICT, SOLE_OWNER: Would demote the only owner (`SOLE_OWNER`). Assign another owner first.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PATCH /v1/workspaces/{workspace_slug}/members/{account_id}/role\n * @see https://productcraft.co/docs/platform/api-reference#patch-v1-workspaces-workspace-slug-members-account-id-role\n * @example\n * ```ts\n * const updateMemberRole = await platform.workspaces.members.updateRole(\"acme\", \"3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f\", { role: \"owner\" });\n * ```\n */\n updateRole(workspaceSlug: string, accountId: string, params?: T.WorkspaceMemberUpdateRoleParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.UpdateMemberRole>> {\n return this._client.request({ method: \"PATCH\", path: \"/v1/workspaces/{workspace_slug}/members/{account_id}/role\", pathParams: { workspace_slug: workspaceSlug, account_id: accountId }, body: params }, options);\n }\n}\n\n/** `workspaces.policies.actions` */\nexport class WorkspacesPoliciesActionsResource extends APIResource {\n /**\n * List every known workspace action (catalog of statement actions).\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, malformed or invalid session, or a PAK bearer (this route accepts cookie/JWT sessions only).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.policy.read`.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found (unknown slug or id).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_slug}/policies/actions/catalog\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-policies-actions-catalog\n * @example\n * ```ts\n * const workspaceActionCatalog = await platform.workspaces.policies.actions.catalog(\"acme\");\n * ```\n */\n catalog(workspaceSlug: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.WorkspaceActionCatalog>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_slug}/policies/actions/catalog\", pathParams: { workspace_slug: workspaceSlug } }, options);\n }\n}\n\n/** `workspaces.policies` */\nexport class WorkspacesPoliciesResource extends APIResource {\n #actions?: WorkspacesPoliciesActionsResource;\n get actions(): WorkspacesPoliciesActionsResource {\n return (this.#actions ??= new WorkspacesPoliciesActionsResource(this._client, this._b));\n }\n /**\n * Create a managed policy. Cookie/JWT only — policy authoring is a human-admin surface.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param params - `PlatformAuth.WorkspacePolicyCreateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid policy shape, name, or condition block.\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session, or a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member (`NOT_A_MEMBER`), lacks `workspace.policy.create` (owner and admin hold it by default), or the policy grants an action the caller does not hold.\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: Name already in use, or the workspace already has 100 policies. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_slug}/policies\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-workspace-slug-policies\n * @example\n * ```ts\n * const managedPolicy = await platform.workspaces.policies.create(\"acme\", {\n * name: \"mail-readonly\",\n * policy: [{ actions: [\"mail.read\", \"mail.list\"], effect: \"allow\", resources: [\"*\"] }],\n * });\n * ```\n */\n create(workspaceSlug: string, params: T.WorkspacePolicyCreateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.ManagedPolicy>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_slug}/policies\", pathParams: { workspace_slug: workspaceSlug }, body: params, idempotent: true }, options);\n }\n /**\n * Delete a managed policy. Cascades: API keys lose the binding (deny-all if no other bindings remain); roles fall back to their inline policy column. Owners and admins; a policy bound to a role, or a preset policy, only an owner can delete. Cookie/JWT only.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param policyId - Id of the policy.\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session, or a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, OWNER_ROLE_REQUIRED: Caller lacks `workspace.policy.delete`, or is not an owner and the policy is bound to a role or is a preset policy (`OWNER_ROLE_REQUIRED`).\n * @throws {NotFoundError} 404 NOT_FOUND, POLICY_NOT_FOUND: Policy not found in this workspace (`POLICY_NOT_FOUND`).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_slug}/policies/{policy_id}\n * @see https://productcraft.co/docs/platform/api-reference#delete-v1-workspaces-workspace-slug-policies-policy-id\n * @example\n * ```ts\n * const managedPolicyDeleted = await platform.workspaces.policies.delete(\"acme\", \"3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f\");\n * ```\n */\n delete(workspaceSlug: string, policyId: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.ManagedPolicyDeleted>> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_slug}/policies/{policy_id}\", pathParams: { workspace_slug: workspaceSlug, policy_id: policyId } }, options);\n }\n /**\n * List managed policies in a workspace, alphabetically. 20/page (max 100), cursor-paginated.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param params - `PlatformAuth.WorkspacePolicyListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_slug}/policies\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-policies\n * @example\n * ```ts\n * for await (const policy of platform.workspaces.policies.list(\"acme\")) {\n * console.log(policy);\n * }\n * const page = await platform.workspaces.policies.list(\"acme\", {}, { timeout: 5_000 });\n * ```\n */\n list(workspaceSlug: string, params?: T.WorkspacePolicyListParams, options?: RequestOptions): PagePromise<T.ManagedPolicy> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_slug}/policies\", pathParams: { workspace_slug: workspaceSlug }, query: params }, options);\n }\n /**\n * Get a managed policy by id\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param policyId - Id of the policy.\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.\n * @throws {NotFoundError} 404 NOT_FOUND: Policy not found in this workspace.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_slug}/policies/{policy_id}\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-policies-policy-id\n * @example\n * ```ts\n * const managedPolicyDetail = await platform.workspaces.policies.retrieve(\"acme\", \"3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f\");\n * ```\n */\n retrieve(workspaceSlug: string, policyId: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.ManagedPolicyDetail>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_slug}/policies/{policy_id}\", pathParams: { workspace_slug: workspaceSlug, policy_id: policyId } }, options);\n }\n /**\n * Update a managed policy. Owners and admins; a policy bound to a role, or a preset policy, only an owner can edit. Cookie/JWT only — policy authoring is a human-admin surface.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param policyId - Id of the policy.\n * @param params - `PlatformAuth.WorkspacePolicyUpdateParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid policy shape, name, or condition block.\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session, or a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, OWNER_ROLE_REQUIRED: Caller lacks `workspace.policy.update`, cannot grant one or more requested actions, or is not an owner and the policy is bound to a role or is a preset policy (`OWNER_ROLE_REQUIRED`).\n * @throws {NotFoundError} 404 NOT_FOUND, POLICY_NOT_FOUND: Policy not found in this workspace (`POLICY_NOT_FOUND`).\n * @throws {ConflictError} 409 CONFLICT, POLICY_NAME_TAKEN: Name already in use (`POLICY_NAME_TAKEN`).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PATCH /v1/workspaces/{workspace_slug}/policies/{policy_id}\n * @see https://productcraft.co/docs/platform/api-reference#patch-v1-workspaces-workspace-slug-policies-policy-id\n * @example\n * ```ts\n * const managedPolicyDetail = await platform.workspaces.policies.update(\"acme\", \"3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f\", { description: \"Read-only access to all Mail resources\" });\n * ```\n */\n update(workspaceSlug: string, policyId: string, params?: T.WorkspacePolicyUpdateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.ManagedPolicyDetail>> {\n return this._client.request({ method: \"PATCH\", path: \"/v1/workspaces/{workspace_slug}/policies/{policy_id}\", pathParams: { workspace_slug: workspaceSlug, policy_id: policyId }, body: params }, options);\n }\n}\n\n/** `workspaces.roles` */\nexport class WorkspacesRolesResource extends APIResource {\n /**\n * Create a new custom role. Cookie/JWT only — role authoring is a human-admin surface.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param params - `PlatformAuth.WorkspaceRoleCreateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, POLICY_INVALID: Body failed validation, invalid role name, malformed policy, both `policy_id` and `policy` sent, or an action pattern matches no known permission (`POLICY_INVALID`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing, malformed or invalid session, or a PAK bearer (this route accepts cookie/JWT sessions only). Also a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER, ACTIONS_NOT_GRANTABLE: Caller is not a member of this workspace (`NOT_A_MEMBER`), lacks `workspace.role.create`, or the policy grants actions the caller does not hold (`ACTIONS_NOT_GRANTABLE`).\n * @throws {NotFoundError} 404 NOT_FOUND, POLICY_NOT_FOUND: Workspace not found, or `policy_id` not found in this workspace (`POLICY_NOT_FOUND`).\n * @throws {ConflictError} 409 CONFLICT, ROLE_NAME_TAKEN, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: Role name already in use or reserved for a system role (`ROLE_NAME_TAKEN`). Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_slug}/roles\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-workspace-slug-roles\n * @example\n * ```ts\n * const workspaceRole = await platform.workspaces.roles.create(\"acme\", { name: \"BillingAdmin\" });\n * ```\n */\n create(workspaceSlug: string, params: T.WorkspaceRoleCreateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.WorkspaceRole>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_slug}/roles\", pathParams: { workspace_slug: workspaceSlug }, body: params, idempotent: true }, options);\n }\n /**\n * Delete a custom role (fails if it has members). Cookie/JWT only — role authoring is a human-admin surface.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param roleId - Id of the role.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `roleId` is not a UUID.\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing, malformed or invalid session, or a PAK bearer (this route accepts cookie/JWT sessions only). Also a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.role.delete`.\n * @throws {NotFoundError} 404 NOT_FOUND, ROLE_NOT_FOUND: Workspace not found, or role not found in this workspace (`ROLE_NOT_FOUND`).\n * @throws {ConflictError} 409 CONFLICT, ROLE_SYSTEM_IMMUTABLE, ROLE_HAS_MEMBERS: Role is a system role (`ROLE_SYSTEM_IMMUTABLE`) or still has members (`ROLE_HAS_MEMBERS`).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_slug}/roles/{role_id}\n * @see https://productcraft.co/docs/platform/api-reference#delete-v1-workspaces-workspace-slug-roles-role-id\n * @example\n * ```ts\n * await platform.workspaces.roles.delete(\"acme\", \"3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f\");\n * ```\n */\n delete(workspaceSlug: string, roleId: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_slug}/roles/{role_id}\", pathParams: { workspace_slug: workspaceSlug, role_id: roleId } }, options);\n }\n /**\n * List roles in a workspace. System roles first, then alphabetical. 20/page (max 100), cursor-paginated.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param params - `PlatformAuth.WorkspaceRoleListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_slug}/roles\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-roles\n * @example\n * ```ts\n * for await (const role of platform.workspaces.roles.list(\"acme\")) {\n * console.log(role);\n * }\n * const page = await platform.workspaces.roles.list(\"acme\", {}, { timeout: 5_000 });\n * ```\n */\n list(workspaceSlug: string, params?: T.WorkspaceRoleListParams, options?: RequestOptions): PagePromise<T.WorkspaceRole> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_slug}/roles\", pathParams: { workspace_slug: workspaceSlug }, query: params }, options);\n }\n /**\n * Get a role + its permissions\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param roleId - Id of the role.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `roleId` is not a UUID.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, malformed or invalid session, or a PAK bearer (this route accepts cookie/JWT sessions only).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.role.read`.\n * @throws {NotFoundError} 404 NOT_FOUND, ROLE_NOT_FOUND: Workspace not found, or role not found in this workspace (`ROLE_NOT_FOUND`).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_slug}/roles/{role_id}\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-roles-role-id\n * @example\n * ```ts\n * const workspaceRole = await platform.workspaces.roles.retrieve(\"acme\", \"3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f\");\n * ```\n */\n retrieve(workspaceSlug: string, roleId: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.WorkspaceRole>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_slug}/roles/{role_id}\", pathParams: { workspace_slug: workspaceSlug, role_id: roleId } }, options);\n }\n /**\n * Update a role or replace its permission set. Cookie/JWT only — role authoring is a human-admin surface.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param roleId - Id of the role.\n * @param params - `PlatformAuth.WorkspaceRoleUpdateParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `roleId` is not a UUID, body failed validation, malformed policy, both `policy_id` and `policy` sent, or an action pattern matches no known permission.\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing, malformed or invalid session, or a PAK bearer (this route accepts cookie/JWT sessions only). Also a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER, ACTIONS_NOT_GRANTABLE: Caller is not a member of this workspace (`NOT_A_MEMBER`), lacks `workspace.role.update`, or the policy grants actions the caller does not hold (`ACTIONS_NOT_GRANTABLE`).\n * @throws {NotFoundError} 404 NOT_FOUND, ROLE_NOT_FOUND, POLICY_NOT_FOUND: Workspace, role (`ROLE_NOT_FOUND`) or bound policy (`POLICY_NOT_FOUND`) not found in this workspace.\n * @throws {ConflictError} 409 CONFLICT, ROLE_SYSTEM_IMMUTABLE, ROLE_NAME_TAKEN: System roles cannot be renamed, edited or bound (`ROLE_SYSTEM_IMMUTABLE`), or the new name is taken (`ROLE_NAME_TAKEN`).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PATCH /v1/workspaces/{workspace_slug}/roles/{role_id}\n * @see https://productcraft.co/docs/platform/api-reference#patch-v1-workspaces-workspace-slug-roles-role-id\n * @example\n * ```ts\n * const workspaceRole = await platform.workspaces.roles.update(\"acme\", \"3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f\", { description: \"string\" });\n * ```\n */\n update(workspaceSlug: string, roleId: string, params?: T.WorkspaceRoleUpdateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.WorkspaceRole>> {\n return this._client.request({ method: \"PATCH\", path: \"/v1/workspaces/{workspace_slug}/roles/{role_id}\", pathParams: { workspace_slug: workspaceSlug, role_id: roleId }, body: params }, options);\n }\n}\n\n/** `workspaces.services` */\nexport class WorkspacesServicesResource extends APIResource {\n /**\n * Disable a service (settings are retained)\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param service - The product: `auth`, `mail`, `waitlist`, `social` or `trawl`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, SERVICE_UNKNOWN: Unknown service name (`SERVICE_UNKNOWN`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, malformed or invalid session, or a PAK bearer (this route accepts cookie/JWT sessions only).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.service.disable`.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found (unknown slug or id).\n * @throws {ConflictError} 409 CONFLICT, SERVICE_NOT_ENABLED: Service is not currently enabled (`SERVICE_NOT_ENABLED`).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_slug}/services/{service}\n * @see https://productcraft.co/docs/platform/api-reference#delete-v1-workspaces-workspace-slug-services-service\n * @example\n * ```ts\n * await platform.workspaces.services.disable(\"acme\", \"mail\");\n * ```\n */\n disable(workspaceSlug: string, service: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_slug}/services/{service}\", pathParams: { workspace_slug: workspaceSlug, service } }, options);\n }\n /**\n * Enable (or re-enable) a service for this workspace\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param service - The product: `auth`, `mail`, `waitlist`, `social` or `trawl`.\n * @param params - `PlatformAuth.WorkspaceServiceEnableParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, SERVICE_UNKNOWN: Unknown service name (`SERVICE_UNKNOWN`) or body failed validation.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, malformed or invalid session, or a PAK bearer (this route accepts cookie/JWT sessions only).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.service.enable`.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found (unknown slug or id).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_slug}/services/{service}\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-workspace-slug-services-service\n * @example\n * ```ts\n * const workspaceServiceState = await platform.workspaces.services.enable(\"acme\", \"mail\", { settings: {} });\n * ```\n */\n enable(workspaceSlug: string, service: string, params?: T.WorkspaceServiceEnableParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.WorkspaceServiceState>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_slug}/services/{service}\", pathParams: { workspace_slug: workspaceSlug, service }, body: params }, options);\n }\n /**\n * List services activated on this workspace. Complete — one row per product, not paginated.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, malformed or invalid session, or a PAK bearer (this route accepts cookie/JWT sessions only).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.service.read`.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found (unknown slug or id).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_slug}/services\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-services\n * @example\n * ```ts\n * const listWorkspaceServices = await platform.workspaces.services.list(\"acme\");\n * ```\n */\n list(workspaceSlug: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.ListWorkspaceServices>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_slug}/services\", pathParams: { workspace_slug: workspaceSlug } }, options);\n }\n /**\n * Replace the settings jsonb for an active service\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param service - The product: `auth`, `mail`, `waitlist`, `social` or `trawl`.\n * @param params - `PlatformAuth.WorkspaceServiceUpdateSettingsParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, SERVICE_UNKNOWN: Unknown service name (`SERVICE_UNKNOWN`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, malformed or invalid session, or a PAK bearer (this route accepts cookie/JWT sessions only).\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.service.enable`.\n * @throws {NotFoundError} 404 NOT_FOUND, SERVICE_NOT_ACTIVATED: Workspace not found, or the service was never activated on it (`SERVICE_NOT_ACTIVATED`).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PATCH /v1/workspaces/{workspace_slug}/services/{service}/settings\n * @see https://productcraft.co/docs/platform/api-reference#patch-v1-workspaces-workspace-slug-services-service-settings\n * @example\n * ```ts\n * const workspaceServiceState = await platform.workspaces.services.updateSettings(\"acme\", \"mail\", { default_sender: \"noreply@acme.com\" });\n * ```\n */\n updateSettings(workspaceSlug: string, service: string, params?: T.WorkspaceServiceUpdateSettingsParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.WorkspaceServiceState>> {\n return this._client.request({ method: \"PATCH\", path: \"/v1/workspaces/{workspace_slug}/services/{service}/settings\", pathParams: { workspace_slug: workspaceSlug, service }, body: params }, options);\n }\n}\n\n/** `workspaces` */\nexport class WorkspacesResource extends APIResource {\n #apiKeys?: WorkspacesApiKeysResource;\n #auditFeed?: WorkspacesAuditFeedResource;\n #auditLogs?: WorkspacesAuditLogsResource;\n #avatar?: WorkspacesAvatarResource;\n #invites?: WorkspacesInvitesResource;\n #members?: WorkspacesMembersResource;\n #policies?: WorkspacesPoliciesResource;\n #roles?: WorkspacesRolesResource;\n #services?: WorkspacesServicesResource;\n get apiKeys(): WorkspacesApiKeysResource {\n return (this.#apiKeys ??= new WorkspacesApiKeysResource(this._client, this._b));\n }\n get auditFeed(): WorkspacesAuditFeedResource {\n return (this.#auditFeed ??= new WorkspacesAuditFeedResource(this._client, this._b));\n }\n get auditLogs(): WorkspacesAuditLogsResource {\n return (this.#auditLogs ??= new WorkspacesAuditLogsResource(this._client, this._b));\n }\n get avatar(): WorkspacesAvatarResource {\n return (this.#avatar ??= new WorkspacesAvatarResource(this._client, this._b));\n }\n get invites(): WorkspacesInvitesResource {\n return (this.#invites ??= new WorkspacesInvitesResource(this._client, this._b));\n }\n get members(): WorkspacesMembersResource {\n return (this.#members ??= new WorkspacesMembersResource(this._client, this._b));\n }\n get policies(): WorkspacesPoliciesResource {\n return (this.#policies ??= new WorkspacesPoliciesResource(this._client, this._b));\n }\n get roles(): WorkspacesRolesResource {\n return (this.#roles ??= new WorkspacesRolesResource(this._client, this._b));\n }\n get services(): WorkspacesServicesResource {\n return (this.#services ??= new WorkspacesServicesResource(this._client, this._b));\n }\n /**\n * Create a new workspace. Cookie/JWT only — PAKs are workspace-scoped credentials and cannot create new workspaces.\n *\n * @param params - `PlatformAuth.WorkspaceCreateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: Caller is a PAK (`pcft_live_*`). Workspace creation requires a human-issued session.\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces\n * @see https://productcraft.co/docs/platform/api-reference#post-v1-workspaces\n * @example\n * ```ts\n * const workspace = await platform.workspaces.create({ display_name: \"Acme Corp\", slug: \"acme-corp\" });\n * ```\n */\n create(params: T.WorkspaceCreateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Workspace>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces\", body: params, idempotent: true }, options);\n }\n /**\n * Delete a workspace (requires workspace.delete). Cookie/JWT only — irreversible workspace destruction needs a human-attributed audit row.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session, or a session that has been signed out (`SESSION_REVOKED`).\n * @throws {PermissionDeniedError} 403 FORBIDDEN: Caller is a PAK (`pcft_live_*`). Workspace deletion requires a human-issued session.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_slug}\n * @see https://productcraft.co/docs/platform/api-reference#delete-v1-workspaces-workspace-slug\n * @example\n * ```ts\n * await platform.workspaces.delete(\"acme\");\n * ```\n */\n delete(workspaceSlug: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_slug}\", pathParams: { workspace_slug: workspaceSlug } }, options);\n }\n /**\n * List workspaces the current user belongs to\n *\n * @param params - `PlatformAuth.WorkspaceListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid session.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces\n * @example\n * ```ts\n * for await (const workspace of platform.workspaces.list()) {\n * console.log(workspace);\n * }\n * const page = await platform.workspaces.list({}, { timeout: 5_000 });\n * ```\n */\n list(params?: T.WorkspaceListParams, options?: RequestOptions): PagePromise<T.WorkspaceListItem> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces\", query: params }, options);\n }\n /**\n * Get workspace details\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param options - Per-request options.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid session.\n * @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`).\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found (unknown slug or id).\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_slug}\n * @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug\n * @example\n * ```ts\n * const workspace = await platform.workspaces.retrieve(\"acme\");\n * ```\n */\n retrieve(workspaceSlug: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Workspace>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_slug}\", pathParams: { workspace_slug: workspaceSlug } }, options);\n }\n /**\n * Update workspace display name, slug, or settings. Slug renames broadcast a `workspace.renamed` event so denormalised consumers (waitlist-api) sync.\n *\n * @param workspaceSlug - Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve(\"acme\")`); the product APIs bind `workspace_id` instead.\n * @param params - `PlatformAuth.WorkspaceUpdateParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid slug or display name.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found.\n * @throws {ConflictError} 409 CONFLICT: Slug already taken by another workspace.\n * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PATCH /v1/workspaces/{workspace_slug}\n * @see https://productcraft.co/docs/platform/api-reference#patch-v1-workspaces-workspace-slug\n * @example\n * ```ts\n * const workspace = await platform.workspaces.update(\"acme\", { display_name: \"string\" });\n * ```\n */\n update(workspaceSlug: string, params?: T.WorkspaceUpdateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Workspace>> {\n return this._client.request({ method: \"PATCH\", path: \"/v1/workspaces/{workspace_slug}\", pathParams: { workspace_slug: workspaceSlug }, body: params }, options);\n }\n}\n\n/** `platform` */\nexport class PlatformAuthResources extends APIResource {\n #account?: AccountResource;\n #apiKeys?: ApiKeysResource;\n #auth?: AuthResource;\n #introspect?: IntrospectResource;\n #me?: MeResource;\n #oauth?: OauthResource;\n #sessions?: SessionsResource;\n #stats?: StatsResource;\n #verification?: VerificationResource;\n #wellKnown?: WellKnownResource;\n #workspaces?: WorkspacesResource;\n get account(): AccountResource {\n return (this.#account ??= new AccountResource(this._client, this._b));\n }\n get apiKeys(): ApiKeysResource {\n return (this.#apiKeys ??= new ApiKeysResource(this._client, this._b));\n }\n get auth(): AuthResource {\n return (this.#auth ??= new AuthResource(this._client, this._b));\n }\n get introspect(): IntrospectResource {\n return (this.#introspect ??= new IntrospectResource(this._client, this._b));\n }\n get me(): MeResource {\n return (this.#me ??= new MeResource(this._client, this._b));\n }\n get oauth(): OauthResource {\n return (this.#oauth ??= new OauthResource(this._client, this._b));\n }\n get sessions(): SessionsResource {\n return (this.#sessions ??= new SessionsResource(this._client, this._b));\n }\n get stats(): StatsResource {\n return (this.#stats ??= new StatsResource(this._client, this._b));\n }\n get verification(): VerificationResource {\n return (this.#verification ??= new VerificationResource(this._client, this._b));\n }\n get wellKnown(): WellKnownResource {\n return (this.#wellKnown ??= new WellKnownResource(this._client, this._b));\n }\n get workspaces(): WorkspacesResource {\n return (this.#workspaces ??= new WorkspacesResource(this._client, this._b));\n }\n}\n","// Generated by scripts/gen-sdk.mjs from Specs/platform-auth.json. Do not edit.\n\nimport type { LastResponse } from \"@productcraft/core\";\nimport type { components, paths } from \"./paths.js\";\n\ntype IsUnion<T, U = T> = T extends unknown ? ([U] extends [T] ? false : true) : never;\ntype OpenString<T extends string> = string extends T ? T : true extends IsUnion<T> ? T | (string & {}) : T;\ntype OpenValue<T> = [T] extends [string] ? OpenString<T> : T extends readonly (infer I)[] ? (OpenValue<Exclude<I, null | undefined>> | Extract<I, null | undefined>)[] : T extends object ? { [K in keyof T]: OpenValue<Exclude<T[K], null | undefined>> | Extract<T[K], null | undefined> } : T;\n/** A response type: string-literal unions also accept values added after this SDK was built. */\nexport type Open<T> = OpenValue<Exclude<T, null | undefined>> | Extract<T, null | undefined>;\n/** What a method resolves to: the parsed body plus non-enumerable `lastResponse`. */\nexport type WithLastResponse<T> = T & { readonly lastResponse: LastResponse };\n/** Params inside a scope bound with `.as(actorId)`: `actor_id` may be left out. */\nexport type WithOptionalActor<P> = P extends { actor_id: unknown } ? Omit<P, \"actor_id\"> & { actor_id?: P[\"actor_id\"] } : P;\n/** A polled model whose free-form `K` the caller types as `R` (`createAndPoll<R>`); optional and nullable stay as declared. */\nexport type WithResult<M, K extends keyof M, R> = Omit<M, K> & { [P in keyof M as P extends K ? P : never]: R | Extract<M[P], null> };\n\nexport type ApiKeyPresetKey = components[\"schemas\"][\"ApiKeyPresetKey\"];\nexport const ApiKeyPresetKey = { values: [\"mail-send\", \"waitlist-write\", \"trawl-jobs\", \"readonly\", \"full\"] as const };\n\nexport type ApiKeyStatus = components[\"schemas\"][\"ApiKeyStatus\"];\nexport const ApiKeyStatus = { values: [\"active\", \"expired\", \"revoked\"] as const };\n\nexport type AuditActorType = components[\"schemas\"][\"AuditActorType\"];\nexport const AuditActorType = { values: [\"platform_user\", \"system\", \"pat\"] as const };\n\nexport type AuditFeedSource = components[\"schemas\"][\"AuditFeedSource\"];\nexport const AuditFeedSource = { values: [\"workspace_audit\", \"heimdall_audit\", \"agora_moderation\"] as const };\n\nexport type McpProduct = components[\"schemas\"][\"McpProduct\"];\nexport const McpProduct = { values: [\"auth\", \"mail\", \"waitlist\", \"social\", \"trawl\"] as const };\n\nexport type PolicyEffect = components[\"schemas\"][\"PolicyEffect\"];\nexport const PolicyEffect = { values: [\"allow\", \"deny\"] as const };\n\nexport type StatsGranularity = components[\"schemas\"][\"StatsGranularity\"];\nexport const StatsGranularity = { values: [\"day\"] as const };\n\nexport type StatsMetric = components[\"schemas\"][\"StatsMetric\"];\nexport const StatsMetric = { values: [\"audit_events\"] as const };\n\nexport type StatsWindow = components[\"schemas\"][\"StatsWindow\"];\nexport const StatsWindow = { values: [\"1d\", \"7d\", \"30d\"] as const };\n\nexport type ApiKeySelf = Open<components[\"schemas\"][\"ApiKeySelfResponseDto\"]>;\nexport type ApiKeySelfWorkspace = Open<components[\"schemas\"][\"ApiKeySelfWorkspaceDto\"]>;\nexport type AuditFeed = Open<components[\"schemas\"][\"AuditFeedResponseDto\"]>;\nexport type AuthorizationServerMetadata = Open<components[\"schemas\"][\"AuthorizationServerMetadataDto\"]>;\nexport type AvatarUrl = Open<components[\"schemas\"][\"AvatarUrlResponseDto\"]>;\nexport type BoundPolicySummary = Open<components[\"schemas\"][\"BoundPolicySummaryDto\"]>;\nexport type ConnectedClient = Open<components[\"schemas\"][\"ConnectedClientDto\"]>;\nexport type ConnectedClientList = Open<components[\"schemas\"][\"ConnectedClientListDto\"]>;\nexport type FeedItem = Open<components[\"schemas\"][\"FeedItemDto\"]>;\nexport type Feedback = Open<components[\"schemas\"][\"FeedbackResponseDto\"]>;\nexport type HiddenGuide = Open<components[\"schemas\"][\"HiddenGuideDto\"]>;\nexport type HiddenGuides = Open<components[\"schemas\"][\"HiddenGuidesDto\"]>;\nexport type IntrospectAccount = Open<components[\"schemas\"][\"IntrospectAccountDto\"]>;\nexport type IntrospectApiKey = Open<components[\"schemas\"][\"IntrospectApiKeyResponseDto\"]>;\nexport type IntrospectPrincipal = Open<components[\"schemas\"][\"IntrospectPrincipalDto\"]>;\nexport type Introspect = Open<components[\"schemas\"][\"IntrospectResponseDto\"]>;\nexport type IntrospectRole = Open<components[\"schemas\"][\"IntrospectRoleDto\"]>;\nexport type IntrospectWorkspaceListItem = Open<components[\"schemas\"][\"IntrospectWorkspaceListItemDto\"]>;\nexport type IntrospectWorkspace = Open<components[\"schemas\"][\"IntrospectWorkspaceResponseDto\"]>;\nexport type Jwk = Open<components[\"schemas\"][\"JwkDto\"]>;\nexport type Jwks = Open<components[\"schemas\"][\"JwksResponseDto\"]>;\nexport type ListManagedPolicies = Open<components[\"schemas\"][\"ListManagedPoliciesResponseDto\"]>;\nexport type ListPakPresets = Open<components[\"schemas\"][\"ListPakPresetsResponseDto\"]>;\nexport type ListPlatformApiKeys = Open<components[\"schemas\"][\"ListPlatformApiKeysResponseDto\"]>;\nexport type ListWorkspaceAuditLogs = Open<components[\"schemas\"][\"ListWorkspaceAuditLogsResponseDto\"]>;\nexport type ListWorkspaceInvites = Open<components[\"schemas\"][\"ListWorkspaceInvitesResponseDto\"]>;\nexport type ListWorkspaceMembers = Open<components[\"schemas\"][\"ListWorkspaceMembersResponseDto\"]>;\nexport type ListWorkspaceRoles = Open<components[\"schemas\"][\"ListWorkspaceRolesResponseDto\"]>;\nexport type ListWorkspaceServices = Open<components[\"schemas\"][\"ListWorkspaceServicesResponseDto\"]>;\nexport type ListWorkspaces = Open<components[\"schemas\"][\"ListWorkspacesResponseDto\"]>;\nexport type ManagedPolicyDeleted = Open<components[\"schemas\"][\"ManagedPolicyDeletedResponseDto\"]>;\nexport type ManagedPolicyDetail = Open<components[\"schemas\"][\"ManagedPolicyDetailResponseDto\"]>;\nexport type ManagedPolicy = Open<components[\"schemas\"][\"ManagedPolicyResponseDto\"]>;\nexport type MeProfile = Open<components[\"schemas\"][\"MeProfileDto\"]>;\nexport type MintPak = Open<components[\"schemas\"][\"MintPakResponseDto\"]>;\nexport type Pagination = Open<components[\"schemas\"][\"PaginationDto\"]>;\nexport type PakGrantPreview = Open<components[\"schemas\"][\"PakGrantPreviewDto\"]>;\nexport type PakPreset = Open<components[\"schemas\"][\"PakPresetDto\"]>;\nexport type PolicyBindingCount = Open<components[\"schemas\"][\"PolicyBindingCountDto\"]>;\nexport type PolicyStatement = Open<components[\"schemas\"][\"PolicyStatementDto\"]>;\nexport type PublicApiKey = Open<components[\"schemas\"][\"PublicApiKeyDto\"]>;\nexport type RevokeOtherSessions = Open<components[\"schemas\"][\"RevokeOtherSessionsResponseDto\"]>;\nexport type RevokeSession = Open<components[\"schemas\"][\"RevokeSessionResponseDto\"]>;\nexport type RotatePak = Open<components[\"schemas\"][\"RotatePakResponseDto\"]>;\nexport type Session = Open<components[\"schemas\"][\"SessionDto\"]>;\nexport type SourceDiagnostic = Open<components[\"schemas\"][\"SourceDiagnosticDto\"]>;\nexport type StatsSeriesPoint = Open<components[\"schemas\"][\"StatsSeriesPointDto\"]>;\nexport type Token = Open<components[\"schemas\"][\"TokenResponseDto\"]>;\nexport type UpdateMemberRole = Open<components[\"schemas\"][\"UpdateMemberRoleResponseDto\"]>;\nexport type WorkspaceActionCatalog = Open<components[\"schemas\"][\"WorkspaceActionCatalogResponseDto\"]>;\nexport type WorkspaceAuditLogEntry = Open<components[\"schemas\"][\"WorkspaceAuditLogEntryDto\"]>;\nexport type WorkspaceAvatarUrl = Open<components[\"schemas\"][\"WorkspaceAvatarUrlResponseDto\"]>;\nexport type WorkspaceInviteListItem = Open<components[\"schemas\"][\"WorkspaceInviteListItemDto\"]>;\nexport type WorkspaceInvite = Open<components[\"schemas\"][\"WorkspaceInviteResponseDto\"]>;\nexport type WorkspaceListItem = Open<components[\"schemas\"][\"WorkspaceListItemDto\"]>;\nexport type WorkspaceMember = Open<components[\"schemas\"][\"WorkspaceMemberResponseDto\"]>;\nexport type Workspace = Open<components[\"schemas\"][\"WorkspaceResponseDto\"]>;\nexport type WorkspaceRole = Open<components[\"schemas\"][\"WorkspaceRoleResponseDto\"]>;\nexport type WorkspaceServiceState = Open<components[\"schemas\"][\"WorkspaceServiceStateDto\"]>;\nexport type WorkspaceStats = Open<components[\"schemas\"][\"WorkspaceStatsDto\"]>;\nexport type WorkspaceStatsInWindow = Open<components[\"schemas\"][\"WorkspaceStatsInWindowDto\"]>;\nexport type WorkspaceStatsSeries = Open<components[\"schemas\"][\"WorkspaceStatsSeriesDto\"]>;\nexport type WorkspaceStatsTotals = Open<components[\"schemas\"][\"WorkspaceStatsTotalsDto\"]>;\n\n/** Params for `auth.logout` (POST /v1/auth/logout). */\nexport type AuthLogoutParams = NonNullable<paths[\"/v1/auth/logout\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `auth.password.requestReset` (POST /v1/auth/password/request-reset). */\nexport type AuthPasswordRequestResetParams = NonNullable<paths[\"/v1/auth/password/request-reset\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `auth.password.reset` (POST /v1/auth/password/reset). */\nexport type AuthPasswordResetParams = NonNullable<paths[\"/v1/auth/password/reset\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `auth.refresh` (POST /v1/auth/refresh). */\nexport type AuthRefreshParams = NonNullable<paths[\"/v1/auth/refresh\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `auth.signin` (POST /v1/auth/signin). */\nexport type AuthSigninParams = NonNullable<paths[\"/v1/auth/signin\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `auth.signup` (POST /v1/auth/signup). */\nexport type AuthSignupParams = NonNullable<paths[\"/v1/auth/signup\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `me.avatar.upload` (POST /v1/me/avatar). */\nexport type MeAvatarUploadParams = { /** PNG, JPEG, or WEBP image, ≤2 MB. */ file: Blob };\n/** Params for `me.profile.update` (PATCH /v1/me/profile). */\nexport type MeProfileUpdateParams = NonNullable<paths[\"/v1/me/profile\"][\"patch\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `oauth.connections.list` (GET /v1/oauth/connections). */\nexport type OauthConnectionListParams = NonNullable<paths[\"/v1/oauth/connections\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `oauth.workspaces.connections.list` (GET /v1/oauth/workspaces/{workspace_id}/connections). */\nexport type OauthWorkspaceConnectionListParams = NonNullable<paths[\"/v1/oauth/workspaces/{workspace_id}/connections\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Response of `sessions.list`. */\nexport type SessionListResponse = Open<paths[\"/v1/session\"][\"get\"][\"responses\"][200][\"content\"][\"application/json\"]>;\n/** Params for `verification.verify` (POST /v1/verification/verify). */\nexport type VerificationVerifyParams = NonNullable<paths[\"/v1/verification/verify\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `workspaces.list` (GET /v1/workspaces). */\nexport type WorkspaceListParams = NonNullable<paths[\"/v1/workspaces\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `workspaces.create` (POST /v1/workspaces). */\nexport type WorkspaceCreateParams = NonNullable<paths[\"/v1/workspaces\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `workspaces.invites.accept` (POST /v1/workspaces/invites/accept). */\nexport type WorkspaceInviteAcceptParams = NonNullable<paths[\"/v1/workspaces/invites/accept\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `stats.retrieve` (GET /v1/workspaces/{workspace_id}/stats). */\nexport type StatsRetrieveParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/stats\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `workspaces.update` (PATCH /v1/workspaces/{workspace_slug}). */\nexport type WorkspaceUpdateParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}\"][\"patch\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `workspaces.apiKeys.list` (GET /v1/workspaces/{workspace_slug}/api-keys). */\nexport type WorkspaceApiKeyListParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/api-keys\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `workspaces.apiKeys.create` (POST /v1/workspaces/{workspace_slug}/api-keys). */\nexport type WorkspaceApiKeyCreateParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/api-keys\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `workspaces.apiKeys.preview` (POST /v1/workspaces/{workspace_slug}/api-keys/preview). */\nexport type WorkspaceApiKeyPreviewParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/api-keys/preview\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `workspaces.apiKeys.update` (PATCH /v1/workspaces/{workspace_slug}/api-keys/{id}). */\nexport type WorkspaceApiKeyUpdateParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/api-keys/{id}\"][\"patch\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `workspaces.apiKeys.delete` (DELETE /v1/workspaces/{workspace_slug}/api-keys/{id}). */\nexport type WorkspaceApiKeyDeleteParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/api-keys/{id}\"][\"delete\"][\"parameters\"][\"query\"]>;\n/** Params for `workspaces.apiKeys.updateBindings` (PATCH /v1/workspaces/{workspace_slug}/api-keys/{id}/bindings). */\nexport type WorkspaceApiKeyUpdateBindingsParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/api-keys/{id}/bindings\"][\"patch\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `workspaces.apiKeys.rotate` (POST /v1/workspaces/{workspace_slug}/api-keys/{id}/rotate). */\nexport type WorkspaceApiKeyRotateParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/api-keys/{id}/rotate\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `workspaces.auditFeed.list` (GET /v1/workspaces/{workspace_slug}/audit-feed). */\nexport type WorkspaceAuditFeedListParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/audit-feed\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `workspaces.auditLogs.list` (GET /v1/workspaces/{workspace_slug}/audit-logs). */\nexport type WorkspaceAuditLogListParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/audit-logs\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `workspaces.auditLogs.export` (GET /v1/workspaces/{workspace_slug}/audit-logs/export). */\nexport type WorkspaceAuditLogExportParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/audit-logs/export\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `workspaces.avatar.upload` (POST /v1/workspaces/{workspace_slug}/avatar). */\nexport type WorkspaceAvatarUploadParams = { /** PNG, JPEG, or WEBP image, ≤2 MB. Square images look best. */ file: Blob };\n/** Params for `workspaces.invites.list` (GET /v1/workspaces/{workspace_slug}/invites). */\nexport type WorkspaceInviteListParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/invites\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `workspaces.invites.create` (POST /v1/workspaces/{workspace_slug}/invites). */\nexport type WorkspaceInviteCreateParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/invites\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `workspaces.members.list` (GET /v1/workspaces/{workspace_slug}/members). */\nexport type WorkspaceMemberListParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/members\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `workspaces.members.updateRole` (PATCH /v1/workspaces/{workspace_slug}/members/{account_id}/role). */\nexport type WorkspaceMemberUpdateRoleParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/members/{account_id}/role\"][\"patch\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `workspaces.policies.list` (GET /v1/workspaces/{workspace_slug}/policies). */\nexport type WorkspacePolicyListParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/policies\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `workspaces.policies.create` (POST /v1/workspaces/{workspace_slug}/policies). */\nexport type WorkspacePolicyCreateParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/policies\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `workspaces.policies.update` (PATCH /v1/workspaces/{workspace_slug}/policies/{policy_id}). */\nexport type WorkspacePolicyUpdateParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/policies/{policy_id}\"][\"patch\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `workspaces.roles.list` (GET /v1/workspaces/{workspace_slug}/roles). */\nexport type WorkspaceRoleListParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/roles\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `workspaces.roles.create` (POST /v1/workspaces/{workspace_slug}/roles). */\nexport type WorkspaceRoleCreateParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/roles\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `workspaces.roles.update` (PATCH /v1/workspaces/{workspace_slug}/roles/{role_id}). */\nexport type WorkspaceRoleUpdateParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/roles/{role_id}\"][\"patch\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `workspaces.services.enable` (POST /v1/workspaces/{workspace_slug}/services/{service}). */\nexport type WorkspaceServiceEnableParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/services/{service}\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `workspaces.services.updateSettings` (PATCH /v1/workspaces/{workspace_slug}/services/{service}/settings). */\nexport type WorkspaceServiceUpdateSettingsParams = NonNullable<paths[\"/v1/workspaces/{workspace_slug}/services/{service}/settings\"][\"patch\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n","// Generated by scripts/gen-sdk.mjs from Specs/platform-auth.json. Do not edit.\n\nimport { APIClient, createOpenAPIClient, PC_BASE_URL, type ClientOptions, type PollOptions as CorePollOptions, type RequestOptions as CoreRequestOptions } from \"@productcraft/core\";\nimport type { Client } from \"openapi-fetch\";\nimport type * as E from \"./errors.js\";\nimport type { paths } from \"./paths.js\";\nimport { PlatformAuthResources } from \"./resources.js\";\nimport * as T from \"./types.js\";\n\ndeclare const __PC_SDK_VERSION__: string | undefined;\nconst VERSION = typeof __PC_SDK_VERSION__ === \"string\" ? __PC_SDK_VERSION__ : \"0.0.0-dev\";\n\n/**\n * ProductCraft Platform API client (workspaces, members, roles, policies, API keys and introspection). Every method is generated from the API's OpenAPI document.\n *\n * @example\n * ```ts\n * import { PlatformAuth } from \"@productcraft/platform-auth\";\n * const platform = new PlatformAuth({ apiKey: process.env.PRODUCTCRAFT_API_KEY });\n * ```\n */\n\nexport class PlatformAuth extends PlatformAuthResources {\n #openapi?: Client<paths>;\n constructor(options: ClientOptions = {}) {\n super(new APIClient(options, PC_BASE_URL.platformAuth, { name: \"platform-auth\", version: VERSION }));\n }\n /** The typed `openapi-fetch` escape hatch over the same credential and base URL. It does not retry. */\n get client(): Client<paths> {\n return (this.#openapi ??= createOpenAPIClient<paths>(this._client));\n }\n}\n\ntype __RequestOptions = CoreRequestOptions;\ntype __PollOptions = CorePollOptions;\ntype __ApiKeyPresetKey = T.ApiKeyPresetKey;\ntype __ApiKeyStatus = T.ApiKeyStatus;\ntype __AuditActorType = T.AuditActorType;\ntype __AuditFeedSource = T.AuditFeedSource;\ntype __McpProduct = T.McpProduct;\ntype __PolicyEffect = T.PolicyEffect;\ntype __StatsGranularity = T.StatsGranularity;\ntype __StatsMetric = T.StatsMetric;\ntype __StatsWindow = T.StatsWindow;\ntype __ApiKeySelf = T.ApiKeySelf;\ntype __ApiKeySelfWorkspace = T.ApiKeySelfWorkspace;\ntype __AuditFeed = T.AuditFeed;\ntype __AuthorizationServerMetadata = T.AuthorizationServerMetadata;\ntype __AvatarUrl = T.AvatarUrl;\ntype __BoundPolicySummary = T.BoundPolicySummary;\ntype __ConnectedClient = T.ConnectedClient;\ntype __ConnectedClientList = T.ConnectedClientList;\ntype __FeedItem = T.FeedItem;\ntype __Feedback = T.Feedback;\ntype __HiddenGuide = T.HiddenGuide;\ntype __HiddenGuides = T.HiddenGuides;\ntype __IntrospectAccount = T.IntrospectAccount;\ntype __IntrospectApiKey = T.IntrospectApiKey;\ntype __IntrospectPrincipal = T.IntrospectPrincipal;\ntype __Introspect = T.Introspect;\ntype __IntrospectRole = T.IntrospectRole;\ntype __IntrospectWorkspaceListItem = T.IntrospectWorkspaceListItem;\ntype __IntrospectWorkspace = T.IntrospectWorkspace;\ntype __Jwk = T.Jwk;\ntype __Jwks = T.Jwks;\ntype __ListManagedPolicies = T.ListManagedPolicies;\ntype __ListPakPresets = T.ListPakPresets;\ntype __ListPlatformApiKeys = T.ListPlatformApiKeys;\ntype __ListWorkspaceAuditLogs = T.ListWorkspaceAuditLogs;\ntype __ListWorkspaceInvites = T.ListWorkspaceInvites;\ntype __ListWorkspaceMembers = T.ListWorkspaceMembers;\ntype __ListWorkspaceRoles = T.ListWorkspaceRoles;\ntype __ListWorkspaceServices = T.ListWorkspaceServices;\ntype __ListWorkspaces = T.ListWorkspaces;\ntype __ManagedPolicyDeleted = T.ManagedPolicyDeleted;\ntype __ManagedPolicyDetail = T.ManagedPolicyDetail;\ntype __ManagedPolicy = T.ManagedPolicy;\ntype __MeProfile = T.MeProfile;\ntype __MintPak = T.MintPak;\ntype __Pagination = T.Pagination;\ntype __PakGrantPreview = T.PakGrantPreview;\ntype __PakPreset = T.PakPreset;\ntype __PolicyBindingCount = T.PolicyBindingCount;\ntype __PolicyStatement = T.PolicyStatement;\ntype __PublicApiKey = T.PublicApiKey;\ntype __RevokeOtherSessions = T.RevokeOtherSessions;\ntype __RevokeSession = T.RevokeSession;\ntype __RotatePak = T.RotatePak;\ntype __Session = T.Session;\ntype __SourceDiagnostic = T.SourceDiagnostic;\ntype __StatsSeriesPoint = T.StatsSeriesPoint;\ntype __Token = T.Token;\ntype __UpdateMemberRole = T.UpdateMemberRole;\ntype __WorkspaceActionCatalog = T.WorkspaceActionCatalog;\ntype __WorkspaceAuditLogEntry = T.WorkspaceAuditLogEntry;\ntype __WorkspaceAvatarUrl = T.WorkspaceAvatarUrl;\ntype __WorkspaceInviteListItem = T.WorkspaceInviteListItem;\ntype __WorkspaceInvite = T.WorkspaceInvite;\ntype __WorkspaceListItem = T.WorkspaceListItem;\ntype __WorkspaceMember = T.WorkspaceMember;\ntype __Workspace = T.Workspace;\ntype __WorkspaceRole = T.WorkspaceRole;\ntype __WorkspaceServiceState = T.WorkspaceServiceState;\ntype __WorkspaceStats = T.WorkspaceStats;\ntype __WorkspaceStatsInWindow = T.WorkspaceStatsInWindow;\ntype __WorkspaceStatsSeries = T.WorkspaceStatsSeries;\ntype __WorkspaceStatsTotals = T.WorkspaceStatsTotals;\ntype __AuthLogoutParams = T.AuthLogoutParams;\ntype __AuthPasswordRequestResetParams = T.AuthPasswordRequestResetParams;\ntype __AuthPasswordResetParams = T.AuthPasswordResetParams;\ntype __AuthRefreshParams = T.AuthRefreshParams;\ntype __AuthSigninParams = T.AuthSigninParams;\ntype __AuthSignupParams = T.AuthSignupParams;\ntype __MeAvatarUploadParams = T.MeAvatarUploadParams;\ntype __MeProfileUpdateParams = T.MeProfileUpdateParams;\ntype __OauthConnectionListParams = T.OauthConnectionListParams;\ntype __OauthWorkspaceConnectionListParams = T.OauthWorkspaceConnectionListParams;\ntype __SessionListResponse = T.SessionListResponse;\ntype __VerificationVerifyParams = T.VerificationVerifyParams;\ntype __WorkspaceListParams = T.WorkspaceListParams;\ntype __WorkspaceCreateParams = T.WorkspaceCreateParams;\ntype __WorkspaceInviteAcceptParams = T.WorkspaceInviteAcceptParams;\ntype __StatsRetrieveParams = T.StatsRetrieveParams;\ntype __WorkspaceUpdateParams = T.WorkspaceUpdateParams;\ntype __WorkspaceApiKeyListParams = T.WorkspaceApiKeyListParams;\ntype __WorkspaceApiKeyCreateParams = T.WorkspaceApiKeyCreateParams;\ntype __WorkspaceApiKeyPreviewParams = T.WorkspaceApiKeyPreviewParams;\ntype __WorkspaceApiKeyUpdateParams = T.WorkspaceApiKeyUpdateParams;\ntype __WorkspaceApiKeyDeleteParams = T.WorkspaceApiKeyDeleteParams;\ntype __WorkspaceApiKeyUpdateBindingsParams = T.WorkspaceApiKeyUpdateBindingsParams;\ntype __WorkspaceApiKeyRotateParams = T.WorkspaceApiKeyRotateParams;\ntype __WorkspaceAuditFeedListParams = T.WorkspaceAuditFeedListParams;\ntype __WorkspaceAuditLogListParams = T.WorkspaceAuditLogListParams;\ntype __WorkspaceAuditLogExportParams = T.WorkspaceAuditLogExportParams;\ntype __WorkspaceAvatarUploadParams = T.WorkspaceAvatarUploadParams;\ntype __WorkspaceInviteListParams = T.WorkspaceInviteListParams;\ntype __WorkspaceInviteCreateParams = T.WorkspaceInviteCreateParams;\ntype __WorkspaceMemberListParams = T.WorkspaceMemberListParams;\ntype __WorkspaceMemberUpdateRoleParams = T.WorkspaceMemberUpdateRoleParams;\ntype __WorkspacePolicyListParams = T.WorkspacePolicyListParams;\ntype __WorkspacePolicyCreateParams = T.WorkspacePolicyCreateParams;\ntype __WorkspacePolicyUpdateParams = T.WorkspacePolicyUpdateParams;\ntype __WorkspaceRoleListParams = T.WorkspaceRoleListParams;\ntype __WorkspaceRoleCreateParams = T.WorkspaceRoleCreateParams;\ntype __WorkspaceRoleUpdateParams = T.WorkspaceRoleUpdateParams;\ntype __WorkspaceServiceEnableParams = T.WorkspaceServiceEnableParams;\ntype __WorkspaceServiceUpdateSettingsParams = T.WorkspaceServiceUpdateSettingsParams;\ntype __ErrorCode = E.PlatformAuthErrorCode;\n/** Public types: `PlatformAuth.ApiKeySelf`, `PlatformAuth.AuthLogoutParams`, … */\nexport namespace PlatformAuth {\n export type RequestOptions = __RequestOptions;\n export type PollOptions = __PollOptions;\n export type ApiKeyPresetKey = __ApiKeyPresetKey;\n export const ApiKeyPresetKey = T.ApiKeyPresetKey;\n export type ApiKeyStatus = __ApiKeyStatus;\n export const ApiKeyStatus = T.ApiKeyStatus;\n export type AuditActorType = __AuditActorType;\n export const AuditActorType = T.AuditActorType;\n export type AuditFeedSource = __AuditFeedSource;\n export const AuditFeedSource = T.AuditFeedSource;\n export type McpProduct = __McpProduct;\n export const McpProduct = T.McpProduct;\n export type PolicyEffect = __PolicyEffect;\n export const PolicyEffect = T.PolicyEffect;\n export type StatsGranularity = __StatsGranularity;\n export const StatsGranularity = T.StatsGranularity;\n export type StatsMetric = __StatsMetric;\n export const StatsMetric = T.StatsMetric;\n export type StatsWindow = __StatsWindow;\n export const StatsWindow = T.StatsWindow;\n export type ApiKeySelf = __ApiKeySelf;\n export type ApiKeySelfWorkspace = __ApiKeySelfWorkspace;\n export type AuditFeed = __AuditFeed;\n export type AuthorizationServerMetadata = __AuthorizationServerMetadata;\n export type AvatarUrl = __AvatarUrl;\n export type BoundPolicySummary = __BoundPolicySummary;\n export type ConnectedClient = __ConnectedClient;\n export type ConnectedClientList = __ConnectedClientList;\n export type FeedItem = __FeedItem;\n export type Feedback = __Feedback;\n export type HiddenGuide = __HiddenGuide;\n export type HiddenGuides = __HiddenGuides;\n export type IntrospectAccount = __IntrospectAccount;\n export type IntrospectApiKey = __IntrospectApiKey;\n export type IntrospectPrincipal = __IntrospectPrincipal;\n export type Introspect = __Introspect;\n export type IntrospectRole = __IntrospectRole;\n export type IntrospectWorkspaceListItem = __IntrospectWorkspaceListItem;\n export type IntrospectWorkspace = __IntrospectWorkspace;\n export type Jwk = __Jwk;\n export type Jwks = __Jwks;\n export type ListManagedPolicies = __ListManagedPolicies;\n export type ListPakPresets = __ListPakPresets;\n export type ListPlatformApiKeys = __ListPlatformApiKeys;\n export type ListWorkspaceAuditLogs = __ListWorkspaceAuditLogs;\n export type ListWorkspaceInvites = __ListWorkspaceInvites;\n export type ListWorkspaceMembers = __ListWorkspaceMembers;\n export type ListWorkspaceRoles = __ListWorkspaceRoles;\n export type ListWorkspaceServices = __ListWorkspaceServices;\n export type ListWorkspaces = __ListWorkspaces;\n export type ManagedPolicyDeleted = __ManagedPolicyDeleted;\n export type ManagedPolicyDetail = __ManagedPolicyDetail;\n export type ManagedPolicy = __ManagedPolicy;\n export type MeProfile = __MeProfile;\n export type MintPak = __MintPak;\n export type Pagination = __Pagination;\n export type PakGrantPreview = __PakGrantPreview;\n export type PakPreset = __PakPreset;\n export type PolicyBindingCount = __PolicyBindingCount;\n export type PolicyStatement = __PolicyStatement;\n export type PublicApiKey = __PublicApiKey;\n export type RevokeOtherSessions = __RevokeOtherSessions;\n export type RevokeSession = __RevokeSession;\n export type RotatePak = __RotatePak;\n export type Session = __Session;\n export type SourceDiagnostic = __SourceDiagnostic;\n export type StatsSeriesPoint = __StatsSeriesPoint;\n export type Token = __Token;\n export type UpdateMemberRole = __UpdateMemberRole;\n export type WorkspaceActionCatalog = __WorkspaceActionCatalog;\n export type WorkspaceAuditLogEntry = __WorkspaceAuditLogEntry;\n export type WorkspaceAvatarUrl = __WorkspaceAvatarUrl;\n export type WorkspaceInviteListItem = __WorkspaceInviteListItem;\n export type WorkspaceInvite = __WorkspaceInvite;\n export type WorkspaceListItem = __WorkspaceListItem;\n export type WorkspaceMember = __WorkspaceMember;\n export type Workspace = __Workspace;\n export type WorkspaceRole = __WorkspaceRole;\n export type WorkspaceServiceState = __WorkspaceServiceState;\n export type WorkspaceStats = __WorkspaceStats;\n export type WorkspaceStatsInWindow = __WorkspaceStatsInWindow;\n export type WorkspaceStatsSeries = __WorkspaceStatsSeries;\n export type WorkspaceStatsTotals = __WorkspaceStatsTotals;\n export type AuthLogoutParams = __AuthLogoutParams;\n export type AuthPasswordRequestResetParams = __AuthPasswordRequestResetParams;\n export type AuthPasswordResetParams = __AuthPasswordResetParams;\n export type AuthRefreshParams = __AuthRefreshParams;\n export type AuthSigninParams = __AuthSigninParams;\n export type AuthSignupParams = __AuthSignupParams;\n export type MeAvatarUploadParams = __MeAvatarUploadParams;\n export type MeProfileUpdateParams = __MeProfileUpdateParams;\n export type OauthConnectionListParams = __OauthConnectionListParams;\n export type OauthWorkspaceConnectionListParams = __OauthWorkspaceConnectionListParams;\n export type SessionListResponse = __SessionListResponse;\n export type VerificationVerifyParams = __VerificationVerifyParams;\n export type WorkspaceListParams = __WorkspaceListParams;\n export type WorkspaceCreateParams = __WorkspaceCreateParams;\n export type WorkspaceInviteAcceptParams = __WorkspaceInviteAcceptParams;\n export type StatsRetrieveParams = __StatsRetrieveParams;\n export type WorkspaceUpdateParams = __WorkspaceUpdateParams;\n export type WorkspaceApiKeyListParams = __WorkspaceApiKeyListParams;\n export type WorkspaceApiKeyCreateParams = __WorkspaceApiKeyCreateParams;\n export type WorkspaceApiKeyPreviewParams = __WorkspaceApiKeyPreviewParams;\n export type WorkspaceApiKeyUpdateParams = __WorkspaceApiKeyUpdateParams;\n export type WorkspaceApiKeyDeleteParams = __WorkspaceApiKeyDeleteParams;\n export type WorkspaceApiKeyUpdateBindingsParams = __WorkspaceApiKeyUpdateBindingsParams;\n export type WorkspaceApiKeyRotateParams = __WorkspaceApiKeyRotateParams;\n export type WorkspaceAuditFeedListParams = __WorkspaceAuditFeedListParams;\n export type WorkspaceAuditLogListParams = __WorkspaceAuditLogListParams;\n export type WorkspaceAuditLogExportParams = __WorkspaceAuditLogExportParams;\n export type WorkspaceAvatarUploadParams = __WorkspaceAvatarUploadParams;\n export type WorkspaceInviteListParams = __WorkspaceInviteListParams;\n export type WorkspaceInviteCreateParams = __WorkspaceInviteCreateParams;\n export type WorkspaceMemberListParams = __WorkspaceMemberListParams;\n export type WorkspaceMemberUpdateRoleParams = __WorkspaceMemberUpdateRoleParams;\n export type WorkspacePolicyListParams = __WorkspacePolicyListParams;\n export type WorkspacePolicyCreateParams = __WorkspacePolicyCreateParams;\n export type WorkspacePolicyUpdateParams = __WorkspacePolicyUpdateParams;\n export type WorkspaceRoleListParams = __WorkspaceRoleListParams;\n export type WorkspaceRoleCreateParams = __WorkspaceRoleCreateParams;\n export type WorkspaceRoleUpdateParams = __WorkspaceRoleUpdateParams;\n export type WorkspaceServiceEnableParams = __WorkspaceServiceEnableParams;\n export type WorkspaceServiceUpdateSettingsParams = __WorkspaceServiceUpdateSettingsParams;\n export type ErrorCode = __ErrorCode;\n}\n","// Generated by scripts/gen-sdk.mjs from Specs/platform-auth.json. Do not edit.\n\nexport { APIConnectionError, APIError, APITimeoutError, APIUserAbortError, AuthenticationError, BadRequestError, ConfigurationError, ConflictError, IdempotencyKeyReuseError, InternalServerError, NotFoundError, PermissionDeniedError, ProductCraftError, RateLimitError, UnprocessableEntityError, WebhookVerificationError } from \"@productcraft/core\";\n\n/** Error codes this API documents. Open: codes added later still type-check. See https://productcraft.co/docs/errors. */\nexport type PlatformAuthErrorCode = \"BAD_REQUEST\" | \"VALIDATION_ERROR\" | \"UNAUTHORIZED\" | \"PAYMENT_REQUIRED\" | \"FORBIDDEN\" | \"NOT_FOUND\" | \"METHOD_NOT_ALLOWED\" | \"NOT_ACCEPTABLE\" | \"REQUEST_TIMEOUT\" | \"CONFLICT\" | \"GONE\" | \"PRECONDITION_FAILED\" | \"PAYLOAD_TOO_LARGE\" | \"UNSUPPORTED_MEDIA_TYPE\" | \"UNPROCESSABLE_ENTITY\" | \"PRECONDITION_REQUIRED\" | \"RATE_LIMITED\" | \"INTERNAL_SERVER_ERROR\" | \"NOT_IMPLEMENTED\" | \"BAD_GATEWAY\" | \"SERVICE_UNAVAILABLE\" | \"GATEWAY_TIMEOUT\" | \"SERVICE_NOT_ENABLED\" | \"INVALID_CREDENTIALS\" | \"SESSION_REVOKED\" | \"MCP_NOT_PERMITTED\" | \"MCP_WORKSPACE_MISMATCH\" | \"PAK_NOT_PERMITTED\" | \"ACTIONS_NOT_GRANTABLE\" | \"IDEMPOTENCY_KEY_REUSE\" | \"IDEMPOTENCY_KEY_REQUIRED\" | \"IDEMPOTENCY_IN_PROGRESS\" | \"WEBHOOK_ENDPOINT_LIMIT\" | \"WEBHOOK_ENDPOINT_NOT_FOUND\" | \"WEBHOOK_ENDPOINT_NOT_SUBSCRIBED\" | \"WEBHOOK_EVENT_NOT_FOUND\" | \"WEBHOOK_EVENT_TYPE_UNKNOWN\" | \"ACCOUNT_DEACTIVATED\" | \"ACCOUNT_SUSPENDED\" | \"ALREADY_A_MEMBER\" | \"CROSS_ORIGIN_REJECTED\" | \"EMAIL_NOT_VERIFIED\" | \"INVITE_EMAIL_MISMATCH\" | \"INVITE_EXHAUSTED\" | \"INVITE_EXPIRED\" | \"INVITE_INVALID\" | \"INVITE_NOT_FOUND\" | \"INVITE_REVOKED\" | \"LAST_MEMBER\" | \"MEMBER_RANK_EXCEEDED\" | \"NOT_A_MEMBER\" | \"OAUTH_GRANT_ADMIN_REVOKED\" | \"OWNER_ROLE_REQUIRED\" | \"PAK_ALREADY_MINTED\" | \"PAK_EXPIRED\" | \"PAK_NAME_REQUIRED\" | \"PAK_NAME_TOO_LONG\" | \"PAK_NOT_FOUND\" | \"PAK_REVOKED\" | \"PASSWORD_RESET_INVALID\" | \"POLICY_INVALID\" | \"POLICY_NAME_TAKEN\" | \"POLICY_NOT_FOUND\" | \"ROLE_HAS_MEMBERS\" | \"ROLE_NAME_TAKEN\" | \"ROLE_NOT_FOUND\" | \"ROLE_SYSTEM_IMMUTABLE\" | \"SERVICE_NOT_ACTIVATED\" | \"SERVICE_UNKNOWN\" | \"SOLE_OWNER\" | \"TOO_MANY_ATTEMPTS\" | \"WORKSPACE_KEY_REQUIRED\" | (string & {});\nexport const PlatformAuthErrorCode = { values: [\"BAD_REQUEST\", \"VALIDATION_ERROR\", \"UNAUTHORIZED\", \"PAYMENT_REQUIRED\", \"FORBIDDEN\", \"NOT_FOUND\", \"METHOD_NOT_ALLOWED\", \"NOT_ACCEPTABLE\", \"REQUEST_TIMEOUT\", \"CONFLICT\", \"GONE\", \"PRECONDITION_FAILED\", \"PAYLOAD_TOO_LARGE\", \"UNSUPPORTED_MEDIA_TYPE\", \"UNPROCESSABLE_ENTITY\", \"PRECONDITION_REQUIRED\", \"RATE_LIMITED\", \"INTERNAL_SERVER_ERROR\", \"NOT_IMPLEMENTED\", \"BAD_GATEWAY\", \"SERVICE_UNAVAILABLE\", \"GATEWAY_TIMEOUT\", \"SERVICE_NOT_ENABLED\", \"INVALID_CREDENTIALS\", \"SESSION_REVOKED\", \"MCP_NOT_PERMITTED\", \"MCP_WORKSPACE_MISMATCH\", \"PAK_NOT_PERMITTED\", \"ACTIONS_NOT_GRANTABLE\", \"IDEMPOTENCY_KEY_REUSE\", \"IDEMPOTENCY_KEY_REQUIRED\", \"IDEMPOTENCY_IN_PROGRESS\", \"WEBHOOK_ENDPOINT_LIMIT\", \"WEBHOOK_ENDPOINT_NOT_FOUND\", \"WEBHOOK_ENDPOINT_NOT_SUBSCRIBED\", \"WEBHOOK_EVENT_NOT_FOUND\", \"WEBHOOK_EVENT_TYPE_UNKNOWN\", \"ACCOUNT_DEACTIVATED\", \"ACCOUNT_SUSPENDED\", \"ALREADY_A_MEMBER\", \"CROSS_ORIGIN_REJECTED\", \"EMAIL_NOT_VERIFIED\", \"INVITE_EMAIL_MISMATCH\", \"INVITE_EXHAUSTED\", \"INVITE_EXPIRED\", \"INVITE_INVALID\", \"INVITE_NOT_FOUND\", \"INVITE_REVOKED\", \"LAST_MEMBER\", \"MEMBER_RANK_EXCEEDED\", \"NOT_A_MEMBER\", \"OAUTH_GRANT_ADMIN_REVOKED\", \"OWNER_ROLE_REQUIRED\", \"PAK_ALREADY_MINTED\", \"PAK_EXPIRED\", \"PAK_NAME_REQUIRED\", \"PAK_NAME_TOO_LONG\", \"PAK_NOT_FOUND\", \"PAK_REVOKED\", \"PASSWORD_RESET_INVALID\", \"POLICY_INVALID\", \"POLICY_NAME_TAKEN\", \"POLICY_NOT_FOUND\", \"ROLE_HAS_MEMBERS\", \"ROLE_NAME_TAKEN\", \"ROLE_NOT_FOUND\", \"ROLE_SYSTEM_IMMUTABLE\", \"SERVICE_NOT_ACTIVATED\", \"SERVICE_UNKNOWN\", \"SOLE_OWNER\", \"TOO_MANY_ATTEMPTS\", \"WORKSPACE_KEY_REQUIRED\"] as const };\n"]}
|