@productcraft/platform-auth 0.2.0 → 1.0.0
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/README.md +123 -217
- package/api.md +1716 -0
- package/dist/index.cjs +1809 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1973 -19
- package/dist/index.d.ts +1973 -19
- package/dist/index.js +1744 -8
- package/dist/index.js.map +1 -1
- package/dist/testing.cjs +691 -0
- package/dist/testing.cjs.map +1 -0
- package/dist/testing.d.cts +32 -0
- package/dist/testing.d.ts +32 -0
- package/dist/testing.js +689 -0
- package/dist/testing.js.map +1 -0
- package/manifest.json +1115 -0
- package/package.json +14 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LastResponse, APIClient, RequestOptions, APIPromise, PagePromise, ClientOptions, PollOptions } from '@productcraft/core';
|
|
2
|
+
export { APIConnectionError, APIError, APITimeoutError, APIUserAbortError, AuthenticationError, BadRequestError, ConfigurationError, ConflictError, IdempotencyKeyReuseError, InternalServerError, NotFoundError, PermissionDeniedError, ProductCraftError, RateLimitError, UnprocessableEntityError, WebhookVerificationError } from '@productcraft/core';
|
|
3
|
+
import { Client } from 'openapi-fetch';
|
|
2
4
|
|
|
3
|
-
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
/** Error codes this API documents. Open: codes added later still type-check. See https://productcraft.co/docs/errors. */
|
|
6
|
+
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 & {});
|
|
7
|
+
declare const PlatformAuthErrorCode: {
|
|
8
|
+
values: readonly ["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"];
|
|
9
|
+
};
|
|
7
10
|
|
|
8
|
-
|
|
11
|
+
// Generated by scripts/gen-sdk.mjs from Specs/platform-auth.json. Do not edit.
|
|
12
|
+
type paths = {
|
|
9
13
|
"/.well-known/jwks.json": {
|
|
10
14
|
parameters: {
|
|
11
15
|
query?: never;
|
|
@@ -1309,8 +1313,8 @@ interface paths {
|
|
|
1309
1313
|
patch: operations["WorkspaceServiceController_updateSettings"];
|
|
1310
1314
|
trace?: never;
|
|
1311
1315
|
};
|
|
1312
|
-
}
|
|
1313
|
-
|
|
1316
|
+
};
|
|
1317
|
+
type components = {
|
|
1314
1318
|
schemas: {
|
|
1315
1319
|
AcceptWorkspaceInviteDto: {
|
|
1316
1320
|
/**
|
|
@@ -2754,7 +2758,7 @@ interface components {
|
|
|
2754
2758
|
* @default 24
|
|
2755
2759
|
* @example 24
|
|
2756
2760
|
*/
|
|
2757
|
-
grace_hours
|
|
2761
|
+
grace_hours?: number;
|
|
2758
2762
|
};
|
|
2759
2763
|
RotatePakResponseDto: {
|
|
2760
2764
|
/**
|
|
@@ -3461,7 +3465,7 @@ interface components {
|
|
|
3461
3465
|
RequestId: string;
|
|
3462
3466
|
};
|
|
3463
3467
|
pathItems: never;
|
|
3464
|
-
}
|
|
3468
|
+
};
|
|
3465
3469
|
interface operations {
|
|
3466
3470
|
JwksController_jwks: {
|
|
3467
3471
|
parameters: {
|
|
@@ -9619,16 +9623,1966 @@ interface operations {
|
|
|
9619
9623
|
};
|
|
9620
9624
|
}
|
|
9621
9625
|
|
|
9626
|
+
type IsUnion<T, U = T> = T extends unknown ? ([U] extends [T] ? false : true) : never;
|
|
9627
|
+
type OpenString<T extends string> = string extends T ? T : true extends IsUnion<T> ? T | (string & {}) : T;
|
|
9628
|
+
type OpenValue<T> = [T] extends [string] ? OpenString<T> : T extends readonly (infer I)[] ? Open<I>[] : T extends object ? {
|
|
9629
|
+
[K in keyof T]: Open<T[K]>;
|
|
9630
|
+
} : T;
|
|
9631
|
+
/** A response type: string-literal unions also accept values added after this SDK was built. */
|
|
9632
|
+
type Open<T> = OpenValue<Exclude<T, null | undefined>> | Extract<T, null | undefined>;
|
|
9633
|
+
/** What a method resolves to: the parsed body plus non-enumerable `lastResponse`. */
|
|
9634
|
+
type WithLastResponse<T> = T & {
|
|
9635
|
+
readonly lastResponse: LastResponse;
|
|
9636
|
+
};
|
|
9637
|
+
type ApiKeyPresetKey = components["schemas"]["ApiKeyPresetKey"];
|
|
9638
|
+
declare const ApiKeyPresetKey: {
|
|
9639
|
+
values: readonly ["mail-send", "waitlist-write", "trawl-jobs", "readonly", "full"];
|
|
9640
|
+
};
|
|
9641
|
+
type ApiKeyStatus = components["schemas"]["ApiKeyStatus"];
|
|
9642
|
+
declare const ApiKeyStatus: {
|
|
9643
|
+
values: readonly ["active", "expired", "revoked"];
|
|
9644
|
+
};
|
|
9645
|
+
type AuditActorType = components["schemas"]["AuditActorType"];
|
|
9646
|
+
declare const AuditActorType: {
|
|
9647
|
+
values: readonly ["platform_user", "system", "pat"];
|
|
9648
|
+
};
|
|
9649
|
+
type AuditFeedSource = components["schemas"]["AuditFeedSource"];
|
|
9650
|
+
declare const AuditFeedSource: {
|
|
9651
|
+
values: readonly ["workspace_audit", "heimdall_audit", "agora_moderation"];
|
|
9652
|
+
};
|
|
9653
|
+
type McpProduct = components["schemas"]["McpProduct"];
|
|
9654
|
+
declare const McpProduct: {
|
|
9655
|
+
values: readonly ["auth", "mail", "waitlist", "social", "trawl"];
|
|
9656
|
+
};
|
|
9657
|
+
type PolicyEffect = components["schemas"]["PolicyEffect"];
|
|
9658
|
+
declare const PolicyEffect: {
|
|
9659
|
+
values: readonly ["allow", "deny"];
|
|
9660
|
+
};
|
|
9661
|
+
type StatsGranularity = components["schemas"]["StatsGranularity"];
|
|
9662
|
+
declare const StatsGranularity: {
|
|
9663
|
+
values: readonly ["day"];
|
|
9664
|
+
};
|
|
9665
|
+
type StatsMetric = components["schemas"]["StatsMetric"];
|
|
9666
|
+
declare const StatsMetric: {
|
|
9667
|
+
values: readonly ["audit_events"];
|
|
9668
|
+
};
|
|
9669
|
+
type StatsWindow = components["schemas"]["StatsWindow"];
|
|
9670
|
+
declare const StatsWindow: {
|
|
9671
|
+
values: readonly ["1d", "7d", "30d"];
|
|
9672
|
+
};
|
|
9673
|
+
type ApiKeySelf = Open<components["schemas"]["ApiKeySelfResponseDto"]>;
|
|
9674
|
+
type ApiKeySelfWorkspace = Open<components["schemas"]["ApiKeySelfWorkspaceDto"]>;
|
|
9675
|
+
type AuditFeed = Open<components["schemas"]["AuditFeedResponseDto"]>;
|
|
9676
|
+
type AuthorizationServerMetadata = Open<components["schemas"]["AuthorizationServerMetadataDto"]>;
|
|
9677
|
+
type AvatarUrl = Open<components["schemas"]["AvatarUrlResponseDto"]>;
|
|
9678
|
+
type BoundPolicySummary = Open<components["schemas"]["BoundPolicySummaryDto"]>;
|
|
9679
|
+
type ConnectedClient = Open<components["schemas"]["ConnectedClientDto"]>;
|
|
9680
|
+
type ConnectedClientList = Open<components["schemas"]["ConnectedClientListDto"]>;
|
|
9681
|
+
type FeedItem = Open<components["schemas"]["FeedItemDto"]>;
|
|
9682
|
+
type Feedback = Open<components["schemas"]["FeedbackResponseDto"]>;
|
|
9683
|
+
type HiddenGuide = Open<components["schemas"]["HiddenGuideDto"]>;
|
|
9684
|
+
type HiddenGuides = Open<components["schemas"]["HiddenGuidesDto"]>;
|
|
9685
|
+
type IntrospectAccount = Open<components["schemas"]["IntrospectAccountDto"]>;
|
|
9686
|
+
type IntrospectApiKey = Open<components["schemas"]["IntrospectApiKeyResponseDto"]>;
|
|
9687
|
+
type IntrospectPrincipal = Open<components["schemas"]["IntrospectPrincipalDto"]>;
|
|
9688
|
+
type Introspect = Open<components["schemas"]["IntrospectResponseDto"]>;
|
|
9689
|
+
type IntrospectRole = Open<components["schemas"]["IntrospectRoleDto"]>;
|
|
9690
|
+
type IntrospectWorkspaceListItem = Open<components["schemas"]["IntrospectWorkspaceListItemDto"]>;
|
|
9691
|
+
type IntrospectWorkspace = Open<components["schemas"]["IntrospectWorkspaceResponseDto"]>;
|
|
9692
|
+
type Jwk = Open<components["schemas"]["JwkDto"]>;
|
|
9693
|
+
type Jwks = Open<components["schemas"]["JwksResponseDto"]>;
|
|
9694
|
+
type ListManagedPolicies = Open<components["schemas"]["ListManagedPoliciesResponseDto"]>;
|
|
9695
|
+
type ListPakPresets = Open<components["schemas"]["ListPakPresetsResponseDto"]>;
|
|
9696
|
+
type ListPlatformApiKeys = Open<components["schemas"]["ListPlatformApiKeysResponseDto"]>;
|
|
9697
|
+
type ListWorkspaceAuditLogs = Open<components["schemas"]["ListWorkspaceAuditLogsResponseDto"]>;
|
|
9698
|
+
type ListWorkspaceInvites = Open<components["schemas"]["ListWorkspaceInvitesResponseDto"]>;
|
|
9699
|
+
type ListWorkspaceMembers = Open<components["schemas"]["ListWorkspaceMembersResponseDto"]>;
|
|
9700
|
+
type ListWorkspaceRoles = Open<components["schemas"]["ListWorkspaceRolesResponseDto"]>;
|
|
9701
|
+
type ListWorkspaceServices = Open<components["schemas"]["ListWorkspaceServicesResponseDto"]>;
|
|
9702
|
+
type ListWorkspaces = Open<components["schemas"]["ListWorkspacesResponseDto"]>;
|
|
9703
|
+
type ManagedPolicyDeleted = Open<components["schemas"]["ManagedPolicyDeletedResponseDto"]>;
|
|
9704
|
+
type ManagedPolicyDetail = Open<components["schemas"]["ManagedPolicyDetailResponseDto"]>;
|
|
9705
|
+
type ManagedPolicy = Open<components["schemas"]["ManagedPolicyResponseDto"]>;
|
|
9706
|
+
type MeProfile = Open<components["schemas"]["MeProfileDto"]>;
|
|
9707
|
+
type MintPak = Open<components["schemas"]["MintPakResponseDto"]>;
|
|
9708
|
+
type Pagination = Open<components["schemas"]["PaginationDto"]>;
|
|
9709
|
+
type PakGrantPreview = Open<components["schemas"]["PakGrantPreviewDto"]>;
|
|
9710
|
+
type PakPreset = Open<components["schemas"]["PakPresetDto"]>;
|
|
9711
|
+
type PolicyBindingCount = Open<components["schemas"]["PolicyBindingCountDto"]>;
|
|
9712
|
+
type PolicyStatement = Open<components["schemas"]["PolicyStatementDto"]>;
|
|
9713
|
+
type PublicApiKey = Open<components["schemas"]["PublicApiKeyDto"]>;
|
|
9714
|
+
type RevokeOtherSessions = Open<components["schemas"]["RevokeOtherSessionsResponseDto"]>;
|
|
9715
|
+
type RevokeSession = Open<components["schemas"]["RevokeSessionResponseDto"]>;
|
|
9716
|
+
type RotatePak = Open<components["schemas"]["RotatePakResponseDto"]>;
|
|
9717
|
+
type Session = Open<components["schemas"]["SessionDto"]>;
|
|
9718
|
+
type SourceDiagnostic = Open<components["schemas"]["SourceDiagnosticDto"]>;
|
|
9719
|
+
type StatsSeriesPoint = Open<components["schemas"]["StatsSeriesPointDto"]>;
|
|
9720
|
+
type Token = Open<components["schemas"]["TokenResponseDto"]>;
|
|
9721
|
+
type UpdateMemberRole = Open<components["schemas"]["UpdateMemberRoleResponseDto"]>;
|
|
9722
|
+
type WorkspaceActionCatalog = Open<components["schemas"]["WorkspaceActionCatalogResponseDto"]>;
|
|
9723
|
+
type WorkspaceAuditLogEntry = Open<components["schemas"]["WorkspaceAuditLogEntryDto"]>;
|
|
9724
|
+
type WorkspaceAvatarUrl = Open<components["schemas"]["WorkspaceAvatarUrlResponseDto"]>;
|
|
9725
|
+
type WorkspaceInviteListItem = Open<components["schemas"]["WorkspaceInviteListItemDto"]>;
|
|
9726
|
+
type WorkspaceInvite = Open<components["schemas"]["WorkspaceInviteResponseDto"]>;
|
|
9727
|
+
type WorkspaceListItem = Open<components["schemas"]["WorkspaceListItemDto"]>;
|
|
9728
|
+
type WorkspaceMember = Open<components["schemas"]["WorkspaceMemberResponseDto"]>;
|
|
9729
|
+
type Workspace = Open<components["schemas"]["WorkspaceResponseDto"]>;
|
|
9730
|
+
type WorkspaceRole = Open<components["schemas"]["WorkspaceRoleResponseDto"]>;
|
|
9731
|
+
type WorkspaceServiceState = Open<components["schemas"]["WorkspaceServiceStateDto"]>;
|
|
9732
|
+
type WorkspaceStats = Open<components["schemas"]["WorkspaceStatsDto"]>;
|
|
9733
|
+
type WorkspaceStatsInWindow = Open<components["schemas"]["WorkspaceStatsInWindowDto"]>;
|
|
9734
|
+
type WorkspaceStatsSeries = Open<components["schemas"]["WorkspaceStatsSeriesDto"]>;
|
|
9735
|
+
type WorkspaceStatsTotals = Open<components["schemas"]["WorkspaceStatsTotalsDto"]>;
|
|
9736
|
+
/** Params for `auth.logout` (POST /v1/auth/logout). */
|
|
9737
|
+
type AuthLogoutParams = NonNullable<paths["/v1/auth/logout"]["post"]["requestBody"]>["content"]["application/json"];
|
|
9738
|
+
/** Params for `auth.password.requestReset` (POST /v1/auth/password/request-reset). */
|
|
9739
|
+
type AuthPasswordRequestResetParams = NonNullable<paths["/v1/auth/password/request-reset"]["post"]["requestBody"]>["content"]["application/json"];
|
|
9740
|
+
/** Params for `auth.password.reset` (POST /v1/auth/password/reset). */
|
|
9741
|
+
type AuthPasswordResetParams = NonNullable<paths["/v1/auth/password/reset"]["post"]["requestBody"]>["content"]["application/json"];
|
|
9742
|
+
/** Params for `auth.refresh` (POST /v1/auth/refresh). */
|
|
9743
|
+
type AuthRefreshParams = NonNullable<paths["/v1/auth/refresh"]["post"]["requestBody"]>["content"]["application/json"];
|
|
9744
|
+
/** Params for `auth.signin` (POST /v1/auth/signin). */
|
|
9745
|
+
type AuthSigninParams = NonNullable<paths["/v1/auth/signin"]["post"]["requestBody"]>["content"]["application/json"];
|
|
9746
|
+
/** Params for `auth.signup` (POST /v1/auth/signup). */
|
|
9747
|
+
type AuthSignupParams = NonNullable<paths["/v1/auth/signup"]["post"]["requestBody"]>["content"]["application/json"];
|
|
9748
|
+
/** Params for `me.avatar.upload` (POST /v1/me/avatar). */
|
|
9749
|
+
type MeAvatarUploadParams = {
|
|
9750
|
+
file: Blob;
|
|
9751
|
+
};
|
|
9752
|
+
/** Params for `me.profile.update` (PATCH /v1/me/profile). */
|
|
9753
|
+
type MeProfileUpdateParams = NonNullable<paths["/v1/me/profile"]["patch"]["requestBody"]>["content"]["application/json"];
|
|
9754
|
+
/** Params for `oauth.connections.list` (GET /v1/oauth/connections). */
|
|
9755
|
+
type OauthConnectionListParams = NonNullable<paths["/v1/oauth/connections"]["get"]["parameters"]["query"]>;
|
|
9756
|
+
/** Params for `oauth.workspaces.connections.list` (GET /v1/oauth/workspaces/{workspace_id}/connections). */
|
|
9757
|
+
type OauthWorkspaceConnectionListParams = NonNullable<paths["/v1/oauth/workspaces/{workspace_id}/connections"]["get"]["parameters"]["query"]>;
|
|
9758
|
+
/** Response of `sessions.list`. */
|
|
9759
|
+
type SessionListResponse = Open<paths["/v1/session"]["get"]["responses"][200]["content"]["application/json"]>;
|
|
9760
|
+
/** Params for `verification.verify` (POST /v1/verification/verify). */
|
|
9761
|
+
type VerificationVerifyParams = NonNullable<paths["/v1/verification/verify"]["post"]["requestBody"]>["content"]["application/json"];
|
|
9762
|
+
/** Params for `workspaces.list` (GET /v1/workspaces). */
|
|
9763
|
+
type WorkspaceListParams = NonNullable<paths["/v1/workspaces"]["get"]["parameters"]["query"]>;
|
|
9764
|
+
/** Params for `workspaces.create` (POST /v1/workspaces). */
|
|
9765
|
+
type WorkspaceCreateParams = NonNullable<paths["/v1/workspaces"]["post"]["requestBody"]>["content"]["application/json"];
|
|
9766
|
+
/** Params for `workspaces.invites.accept` (POST /v1/workspaces/invites/accept). */
|
|
9767
|
+
type WorkspaceInviteAcceptParams = NonNullable<paths["/v1/workspaces/invites/accept"]["post"]["requestBody"]>["content"]["application/json"];
|
|
9768
|
+
/** Params for `stats.retrieve` (GET /v1/workspaces/{workspace_id}/stats). */
|
|
9769
|
+
type StatsRetrieveParams = NonNullable<paths["/v1/workspaces/{workspace_id}/stats"]["get"]["parameters"]["query"]>;
|
|
9770
|
+
/** Params for `workspaces.update` (PATCH /v1/workspaces/{workspace_slug}). */
|
|
9771
|
+
type WorkspaceUpdateParams = NonNullable<paths["/v1/workspaces/{workspace_slug}"]["patch"]["requestBody"]>["content"]["application/json"];
|
|
9772
|
+
/** Params for `workspaces.apiKeys.list` (GET /v1/workspaces/{workspace_slug}/api-keys). */
|
|
9773
|
+
type WorkspaceApiKeyListParams = NonNullable<paths["/v1/workspaces/{workspace_slug}/api-keys"]["get"]["parameters"]["query"]>;
|
|
9774
|
+
/** Params for `workspaces.apiKeys.create` (POST /v1/workspaces/{workspace_slug}/api-keys). */
|
|
9775
|
+
type WorkspaceApiKeyCreateParams = NonNullable<paths["/v1/workspaces/{workspace_slug}/api-keys"]["post"]["requestBody"]>["content"]["application/json"];
|
|
9776
|
+
/** Params for `workspaces.apiKeys.preview` (POST /v1/workspaces/{workspace_slug}/api-keys/preview). */
|
|
9777
|
+
type WorkspaceApiKeyPreviewParams = NonNullable<paths["/v1/workspaces/{workspace_slug}/api-keys/preview"]["post"]["requestBody"]>["content"]["application/json"];
|
|
9778
|
+
/** Params for `workspaces.apiKeys.update` (PATCH /v1/workspaces/{workspace_slug}/api-keys/{id}). */
|
|
9779
|
+
type WorkspaceApiKeyUpdateParams = NonNullable<paths["/v1/workspaces/{workspace_slug}/api-keys/{id}"]["patch"]["requestBody"]>["content"]["application/json"];
|
|
9780
|
+
/** Params for `workspaces.apiKeys.delete` (DELETE /v1/workspaces/{workspace_slug}/api-keys/{id}). */
|
|
9781
|
+
type WorkspaceApiKeyDeleteParams = NonNullable<paths["/v1/workspaces/{workspace_slug}/api-keys/{id}"]["delete"]["parameters"]["query"]>;
|
|
9782
|
+
/** Params for `workspaces.apiKeys.updateBindings` (PATCH /v1/workspaces/{workspace_slug}/api-keys/{id}/bindings). */
|
|
9783
|
+
type WorkspaceApiKeyUpdateBindingsParams = NonNullable<paths["/v1/workspaces/{workspace_slug}/api-keys/{id}/bindings"]["patch"]["requestBody"]>["content"]["application/json"];
|
|
9784
|
+
/** Params for `workspaces.apiKeys.rotate` (POST /v1/workspaces/{workspace_slug}/api-keys/{id}/rotate). */
|
|
9785
|
+
type WorkspaceApiKeyRotateParams = NonNullable<paths["/v1/workspaces/{workspace_slug}/api-keys/{id}/rotate"]["post"]["requestBody"]>["content"]["application/json"];
|
|
9786
|
+
/** Params for `workspaces.auditFeed.list` (GET /v1/workspaces/{workspace_slug}/audit-feed). */
|
|
9787
|
+
type WorkspaceAuditFeedListParams = NonNullable<paths["/v1/workspaces/{workspace_slug}/audit-feed"]["get"]["parameters"]["query"]>;
|
|
9788
|
+
/** Params for `workspaces.auditLogs.list` (GET /v1/workspaces/{workspace_slug}/audit-logs). */
|
|
9789
|
+
type WorkspaceAuditLogListParams = NonNullable<paths["/v1/workspaces/{workspace_slug}/audit-logs"]["get"]["parameters"]["query"]>;
|
|
9790
|
+
/** Params for `workspaces.auditLogs.export` (GET /v1/workspaces/{workspace_slug}/audit-logs/export). */
|
|
9791
|
+
type WorkspaceAuditLogExportParams = NonNullable<paths["/v1/workspaces/{workspace_slug}/audit-logs/export"]["get"]["parameters"]["query"]>;
|
|
9792
|
+
/** Params for `workspaces.avatar.upload` (POST /v1/workspaces/{workspace_slug}/avatar). */
|
|
9793
|
+
type WorkspaceAvatarUploadParams = {
|
|
9794
|
+
file: Blob;
|
|
9795
|
+
};
|
|
9796
|
+
/** Params for `workspaces.invites.list` (GET /v1/workspaces/{workspace_slug}/invites). */
|
|
9797
|
+
type WorkspaceInviteListParams = NonNullable<paths["/v1/workspaces/{workspace_slug}/invites"]["get"]["parameters"]["query"]>;
|
|
9798
|
+
/** Params for `workspaces.invites.create` (POST /v1/workspaces/{workspace_slug}/invites). */
|
|
9799
|
+
type WorkspaceInviteCreateParams = NonNullable<paths["/v1/workspaces/{workspace_slug}/invites"]["post"]["requestBody"]>["content"]["application/json"];
|
|
9800
|
+
/** Params for `workspaces.members.list` (GET /v1/workspaces/{workspace_slug}/members). */
|
|
9801
|
+
type WorkspaceMemberListParams = NonNullable<paths["/v1/workspaces/{workspace_slug}/members"]["get"]["parameters"]["query"]>;
|
|
9802
|
+
/** Params for `workspaces.members.updateRole` (PATCH /v1/workspaces/{workspace_slug}/members/{account_id}/role). */
|
|
9803
|
+
type WorkspaceMemberUpdateRoleParams = NonNullable<paths["/v1/workspaces/{workspace_slug}/members/{account_id}/role"]["patch"]["requestBody"]>["content"]["application/json"];
|
|
9804
|
+
/** Params for `workspaces.policies.list` (GET /v1/workspaces/{workspace_slug}/policies). */
|
|
9805
|
+
type WorkspacePolicyListParams = NonNullable<paths["/v1/workspaces/{workspace_slug}/policies"]["get"]["parameters"]["query"]>;
|
|
9806
|
+
/** Params for `workspaces.policies.create` (POST /v1/workspaces/{workspace_slug}/policies). */
|
|
9807
|
+
type WorkspacePolicyCreateParams = NonNullable<paths["/v1/workspaces/{workspace_slug}/policies"]["post"]["requestBody"]>["content"]["application/json"];
|
|
9808
|
+
/** Params for `workspaces.policies.update` (PATCH /v1/workspaces/{workspace_slug}/policies/{policy_id}). */
|
|
9809
|
+
type WorkspacePolicyUpdateParams = NonNullable<paths["/v1/workspaces/{workspace_slug}/policies/{policy_id}"]["patch"]["requestBody"]>["content"]["application/json"];
|
|
9810
|
+
/** Params for `workspaces.roles.list` (GET /v1/workspaces/{workspace_slug}/roles). */
|
|
9811
|
+
type WorkspaceRoleListParams = NonNullable<paths["/v1/workspaces/{workspace_slug}/roles"]["get"]["parameters"]["query"]>;
|
|
9812
|
+
/** Params for `workspaces.roles.create` (POST /v1/workspaces/{workspace_slug}/roles). */
|
|
9813
|
+
type WorkspaceRoleCreateParams = NonNullable<paths["/v1/workspaces/{workspace_slug}/roles"]["post"]["requestBody"]>["content"]["application/json"];
|
|
9814
|
+
/** Params for `workspaces.roles.update` (PATCH /v1/workspaces/{workspace_slug}/roles/{role_id}). */
|
|
9815
|
+
type WorkspaceRoleUpdateParams = NonNullable<paths["/v1/workspaces/{workspace_slug}/roles/{role_id}"]["patch"]["requestBody"]>["content"]["application/json"];
|
|
9816
|
+
/** Params for `workspaces.services.enable` (POST /v1/workspaces/{workspace_slug}/services/{service}). */
|
|
9817
|
+
type WorkspaceServiceEnableParams = NonNullable<paths["/v1/workspaces/{workspace_slug}/services/{service}"]["post"]["requestBody"]>["content"]["application/json"];
|
|
9818
|
+
/** Params for `workspaces.services.updateSettings` (PATCH /v1/workspaces/{workspace_slug}/services/{service}/settings). */
|
|
9819
|
+
type WorkspaceServiceUpdateSettingsParams = NonNullable<paths["/v1/workspaces/{workspace_slug}/services/{service}/settings"]["patch"]["requestBody"]>["content"]["application/json"];
|
|
9820
|
+
|
|
9821
|
+
type Bound = Readonly<Record<string, string | undefined>>;
|
|
9822
|
+
declare class APIResource {
|
|
9823
|
+
protected readonly _client: APIClient;
|
|
9824
|
+
/** Path parameters (and `actor_id`) bound by the enclosing scope. */
|
|
9825
|
+
protected readonly _b: Bound;
|
|
9826
|
+
constructor(client: APIClient, bound?: Bound);
|
|
9827
|
+
}
|
|
9828
|
+
/** `account` */
|
|
9829
|
+
declare class AccountResource extends APIResource {
|
|
9830
|
+
/**
|
|
9831
|
+
* 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.
|
|
9832
|
+
*
|
|
9833
|
+
* @param options - Per-request options.
|
|
9834
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
9835
|
+
* @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).
|
|
9836
|
+
* @throws {NotFoundError} 404 NOT_FOUND: No account row exists for the session principal. Should never fire for a valid session — surfaced for SDKs.
|
|
9837
|
+
* @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.
|
|
9838
|
+
* @see DELETE /v1/account
|
|
9839
|
+
* @see https://productcraft.co/docs/platform/api-reference#delete-v1-account
|
|
9840
|
+
* @example
|
|
9841
|
+
* ```ts
|
|
9842
|
+
* await platform.account.erase();
|
|
9843
|
+
* ```
|
|
9844
|
+
*/
|
|
9845
|
+
erase(options?: RequestOptions): APIPromise<void>;
|
|
9846
|
+
}
|
|
9847
|
+
/** `apiKeys` */
|
|
9848
|
+
declare class ApiKeysResource extends APIResource {
|
|
9849
|
+
/**
|
|
9850
|
+
* 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.
|
|
9851
|
+
*
|
|
9852
|
+
* @param options - Per-request options.
|
|
9853
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: No bearer, or the key is unknown, revoked or expired.
|
|
9854
|
+
* @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.
|
|
9855
|
+
* @throws {NotFoundError} 404 NOT_FOUND, PAK_NOT_FOUND: The key was deleted while the request was in flight (`PAK_NOT_FOUND`).
|
|
9856
|
+
* @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.
|
|
9857
|
+
* @see GET /v1/api-keys/self
|
|
9858
|
+
* @see https://productcraft.co/docs/platform/api-reference#get-v1-api-keys-self
|
|
9859
|
+
* @example
|
|
9860
|
+
* ```ts
|
|
9861
|
+
* const apiKeySelf = await platform.apiKeys.self();
|
|
9862
|
+
* ```
|
|
9863
|
+
*/
|
|
9864
|
+
self(options?: RequestOptions): APIPromise<WithLastResponse<ApiKeySelf>>;
|
|
9865
|
+
}
|
|
9866
|
+
/** `auth.password` */
|
|
9867
|
+
declare class AuthPasswordResource extends APIResource {
|
|
9868
|
+
/**
|
|
9869
|
+
* Request a password reset email. Neither the response nor its timing reveals whether the email matched an account.
|
|
9870
|
+
*
|
|
9871
|
+
* @param params - `PlatformAuth.AuthPasswordRequestResetParams`.
|
|
9872
|
+
* @param options - Per-request options.
|
|
9873
|
+
* @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.
|
|
9874
|
+
* @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.
|
|
9875
|
+
* @see POST /v1/auth/password/request-reset
|
|
9876
|
+
* @see https://productcraft.co/docs/platform/api-reference#post-v1-auth-password-request-reset
|
|
9877
|
+
* @example
|
|
9878
|
+
* ```ts
|
|
9879
|
+
* await platform.auth.password.requestReset({ email: "user@example.com" });
|
|
9880
|
+
* ```
|
|
9881
|
+
*/
|
|
9882
|
+
requestReset(params: AuthPasswordRequestResetParams, options?: RequestOptions): APIPromise<void>;
|
|
9883
|
+
/**
|
|
9884
|
+
* Reset password using the email-delivered reset token.
|
|
9885
|
+
*
|
|
9886
|
+
* @param params - `PlatformAuth.AuthPasswordResetParams`.
|
|
9887
|
+
* @param options - Per-request options.
|
|
9888
|
+
* @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`).
|
|
9889
|
+
* @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.
|
|
9890
|
+
* @see POST /v1/auth/password/reset
|
|
9891
|
+
* @see https://productcraft.co/docs/platform/api-reference#post-v1-auth-password-reset
|
|
9892
|
+
* @example
|
|
9893
|
+
* ```ts
|
|
9894
|
+
* await platform.auth.password.reset({ new_password: "MyNewPassword123", token: "123456" });
|
|
9895
|
+
* ```
|
|
9896
|
+
*/
|
|
9897
|
+
reset(params: AuthPasswordResetParams, options?: RequestOptions): APIPromise<void>;
|
|
9898
|
+
}
|
|
9899
|
+
/** `auth` */
|
|
9900
|
+
declare class AuthResource extends APIResource {
|
|
9901
|
+
#private;
|
|
9902
|
+
get password(): AuthPasswordResource;
|
|
9903
|
+
/**
|
|
9904
|
+
* Logout by revoking refresh token
|
|
9905
|
+
*
|
|
9906
|
+
* @param params - `PlatformAuth.AuthLogoutParams`.
|
|
9907
|
+
* @param options - Per-request options.
|
|
9908
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failed or invalid token
|
|
9909
|
+
* @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.
|
|
9910
|
+
* @see POST /v1/auth/logout
|
|
9911
|
+
* @see https://productcraft.co/docs/platform/api-reference#post-v1-auth-logout
|
|
9912
|
+
* @example
|
|
9913
|
+
* ```ts
|
|
9914
|
+
* await platform.auth.logout({ refresh_token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." });
|
|
9915
|
+
* ```
|
|
9916
|
+
*/
|
|
9917
|
+
logout(params: AuthLogoutParams, options?: RequestOptions): APIPromise<void>;
|
|
9918
|
+
/**
|
|
9919
|
+
* Revoke the server-side session tied to the caller’s current access token
|
|
9920
|
+
*
|
|
9921
|
+
* @param options - Per-request options.
|
|
9922
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid access token
|
|
9923
|
+
* @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.
|
|
9924
|
+
* @see POST /v1/auth/logout-current
|
|
9925
|
+
* @see https://productcraft.co/docs/platform/api-reference#post-v1-auth-logout-current
|
|
9926
|
+
* @example
|
|
9927
|
+
* ```ts
|
|
9928
|
+
* await platform.auth.logoutCurrent();
|
|
9929
|
+
* ```
|
|
9930
|
+
*/
|
|
9931
|
+
logoutCurrent(options?: RequestOptions): APIPromise<void>;
|
|
9932
|
+
/**
|
|
9933
|
+
* Refresh access token using refresh token
|
|
9934
|
+
*
|
|
9935
|
+
* @param params - `PlatformAuth.AuthRefreshParams`.
|
|
9936
|
+
* @param options - Per-request options.
|
|
9937
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failed or invalid token
|
|
9938
|
+
* @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.
|
|
9939
|
+
* @see POST /v1/auth/refresh
|
|
9940
|
+
* @see https://productcraft.co/docs/platform/api-reference#post-v1-auth-refresh
|
|
9941
|
+
* @example
|
|
9942
|
+
* ```ts
|
|
9943
|
+
* const token = await platform.auth.refresh({ refresh_token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." });
|
|
9944
|
+
* ```
|
|
9945
|
+
*/
|
|
9946
|
+
refresh(params: AuthRefreshParams, options?: RequestOptions): APIPromise<WithLastResponse<Token>>;
|
|
9947
|
+
/**
|
|
9948
|
+
* Sign in with email/username and password
|
|
9949
|
+
*
|
|
9950
|
+
* 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.
|
|
9951
|
+
*
|
|
9952
|
+
* @param params - `PlatformAuth.AuthSigninParams`.
|
|
9953
|
+
* @param options - Per-request options.
|
|
9954
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failed
|
|
9955
|
+
* @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.
|
|
9956
|
+
* @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.
|
|
9957
|
+
* @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.
|
|
9958
|
+
* @see POST /v1/auth/signin
|
|
9959
|
+
* @see https://productcraft.co/docs/platform/api-reference#post-v1-auth-signin
|
|
9960
|
+
* @example
|
|
9961
|
+
* ```ts
|
|
9962
|
+
* const token = await platform.auth.signin({ identifier: "user@example.com", password: "MySecurePassword123" });
|
|
9963
|
+
* ```
|
|
9964
|
+
*/
|
|
9965
|
+
signin(params: AuthSigninParams, options?: RequestOptions): APIPromise<WithLastResponse<Token>>;
|
|
9966
|
+
/**
|
|
9967
|
+
* Create a new account and sign in
|
|
9968
|
+
*
|
|
9969
|
+
* @param params - `PlatformAuth.AuthSignupParams`.
|
|
9970
|
+
* @param options - Per-request options.
|
|
9971
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failed
|
|
9972
|
+
* @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.
|
|
9973
|
+
* @see POST /v1/auth/signup
|
|
9974
|
+
* @see https://productcraft.co/docs/platform/api-reference#post-v1-auth-signup
|
|
9975
|
+
* @example
|
|
9976
|
+
* ```ts
|
|
9977
|
+
* const token = await platform.auth.signup({ email: "user@example.com", password: "MySecurePassword123", username: "john_doe" });
|
|
9978
|
+
* ```
|
|
9979
|
+
*/
|
|
9980
|
+
signup(params: AuthSignupParams, options?: RequestOptions): APIPromise<WithLastResponse<Token>>;
|
|
9981
|
+
}
|
|
9982
|
+
/** `introspect.workspaces` */
|
|
9983
|
+
declare class IntrospectWorkspacesResource extends APIResource {
|
|
9984
|
+
/**
|
|
9985
|
+
* Introspect caller's membership + effective policy + enabled services in a workspace
|
|
9986
|
+
*
|
|
9987
|
+
* @param workspaceId - Id of the workspace.
|
|
9988
|
+
* @param options - Per-request options.
|
|
9989
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session. Also a session that has been signed out (`SESSION_REVOKED`).
|
|
9990
|
+
* @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`.
|
|
9991
|
+
* @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.
|
|
9992
|
+
* @see GET /v1/introspect/workspaces/{workspace_id}
|
|
9993
|
+
* @see https://productcraft.co/docs/platform/api-reference#get-v1-introspect-workspaces-workspace-id
|
|
9994
|
+
* @example
|
|
9995
|
+
* ```ts
|
|
9996
|
+
* const introspectWorkspace = await platform.introspect.workspaces.retrieve("workspace");
|
|
9997
|
+
* ```
|
|
9998
|
+
*/
|
|
9999
|
+
retrieve(workspaceId: string, options?: RequestOptions): APIPromise<WithLastResponse<IntrospectWorkspace>>;
|
|
10000
|
+
}
|
|
10001
|
+
/** `introspect` */
|
|
10002
|
+
declare class IntrospectResource extends APIResource {
|
|
10003
|
+
#private;
|
|
10004
|
+
get workspaces(): IntrospectWorkspacesResource;
|
|
10005
|
+
/**
|
|
10006
|
+
* 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().
|
|
10007
|
+
*
|
|
10008
|
+
* @param options - Per-request options.
|
|
10009
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or malformed `Authorization: Bearer` header, or the PAK is unknown, revoked or expired.
|
|
10010
|
+
* @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.
|
|
10011
|
+
* @see POST /v1/introspect/api-key
|
|
10012
|
+
* @see https://productcraft.co/docs/platform/api-reference#post-v1-introspect-api-key
|
|
10013
|
+
* @example
|
|
10014
|
+
* ```ts
|
|
10015
|
+
* const introspectApiKey = await platform.introspect.apiKey();
|
|
10016
|
+
* ```
|
|
10017
|
+
*/
|
|
10018
|
+
apiKey(options?: RequestOptions): APIPromise<WithLastResponse<IntrospectApiKey>>;
|
|
10019
|
+
/**
|
|
10020
|
+
* Introspect current user with workspace list
|
|
10021
|
+
*
|
|
10022
|
+
* @param options - Per-request options.
|
|
10023
|
+
* @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.
|
|
10024
|
+
* @see GET /v1/introspect
|
|
10025
|
+
* @see https://productcraft.co/docs/platform/api-reference#get-v1-introspect
|
|
10026
|
+
* @example
|
|
10027
|
+
* ```ts
|
|
10028
|
+
* const introspect = await platform.introspect.retrieve();
|
|
10029
|
+
* ```
|
|
10030
|
+
*/
|
|
10031
|
+
retrieve(options?: RequestOptions): APIPromise<WithLastResponse<Introspect>>;
|
|
10032
|
+
}
|
|
10033
|
+
/** `me.avatar` */
|
|
10034
|
+
declare class MeAvatarResource extends APIResource {
|
|
10035
|
+
/**
|
|
10036
|
+
* Clear the caller's avatar and delete the stored object.
|
|
10037
|
+
*
|
|
10038
|
+
* @param options - Per-request options.
|
|
10039
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: No session.
|
|
10040
|
+
* @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.
|
|
10041
|
+
* @see DELETE /v1/me/avatar
|
|
10042
|
+
* @see https://productcraft.co/docs/platform/api-reference#delete-v1-me-avatar
|
|
10043
|
+
* @example
|
|
10044
|
+
* ```ts
|
|
10045
|
+
* await platform.me.avatar.clear();
|
|
10046
|
+
* ```
|
|
10047
|
+
*/
|
|
10048
|
+
clear(options?: RequestOptions): APIPromise<void>;
|
|
10049
|
+
/**
|
|
10050
|
+
* 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.
|
|
10051
|
+
*
|
|
10052
|
+
* @param params - `PlatformAuth.MeAvatarUploadParams`.
|
|
10053
|
+
* @param options - Per-request options.
|
|
10054
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid file: wrong mimetype, oversized, or content does not match the declared type.
|
|
10055
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: No session.
|
|
10056
|
+
* @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.
|
|
10057
|
+
* @see POST /v1/me/avatar
|
|
10058
|
+
* @see https://productcraft.co/docs/platform/api-reference#post-v1-me-avatar
|
|
10059
|
+
* @example
|
|
10060
|
+
* ```ts
|
|
10061
|
+
* const avatarUrl = await platform.me.avatar.upload({ file: new File(["…"], "image.png", { type: "image/png" }) });
|
|
10062
|
+
* ```
|
|
10063
|
+
*/
|
|
10064
|
+
upload(params: MeAvatarUploadParams, options?: RequestOptions): APIPromise<WithLastResponse<AvatarUrl>>;
|
|
10065
|
+
}
|
|
10066
|
+
/** `me.hiddenGuides` */
|
|
10067
|
+
declare class MeHiddenGuidesResource extends APIResource {
|
|
10068
|
+
/**
|
|
10069
|
+
* Hide a getting-started guide for the caller.
|
|
10070
|
+
*
|
|
10071
|
+
* 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.
|
|
10072
|
+
*
|
|
10073
|
+
* @param key - The guide: a surface name, optionally followed by `:` and a resource id, e.g. `dashboard:<workspace id>` or `all`.
|
|
10074
|
+
* @param options - Per-request options.
|
|
10075
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: The key is not a valid guide key.
|
|
10076
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: No session.
|
|
10077
|
+
* @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.
|
|
10078
|
+
* @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.
|
|
10079
|
+
* @see PUT /v1/me/hidden-guides/{key}
|
|
10080
|
+
* @see https://productcraft.co/docs/platform/api-reference#put-v1-me-hidden-guides-key
|
|
10081
|
+
* @example
|
|
10082
|
+
* ```ts
|
|
10083
|
+
* const hiddenGuide = await platform.me.hiddenGuides.hide("key");
|
|
10084
|
+
* ```
|
|
10085
|
+
*/
|
|
10086
|
+
hide(key: string, options?: RequestOptions): APIPromise<WithLastResponse<HiddenGuide>>;
|
|
10087
|
+
/**
|
|
10088
|
+
* List the getting-started guides the caller has hidden.
|
|
10089
|
+
*
|
|
10090
|
+
* Every guide the caller has hidden in the console, newest first. Hiding is presentation only: the setup status behind a guide is unchanged.
|
|
10091
|
+
*
|
|
10092
|
+
* @param options - Per-request options.
|
|
10093
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: No session.
|
|
10094
|
+
* @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.
|
|
10095
|
+
* @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.
|
|
10096
|
+
* @see GET /v1/me/hidden-guides
|
|
10097
|
+
* @see https://productcraft.co/docs/platform/api-reference#get-v1-me-hidden-guides
|
|
10098
|
+
* @example
|
|
10099
|
+
* ```ts
|
|
10100
|
+
* const hiddenGuides = await platform.me.hiddenGuides.list();
|
|
10101
|
+
* ```
|
|
10102
|
+
*/
|
|
10103
|
+
list(options?: RequestOptions): APIPromise<WithLastResponse<HiddenGuides>>;
|
|
10104
|
+
/**
|
|
10105
|
+
* Show every getting-started guide again.
|
|
10106
|
+
*
|
|
10107
|
+
* Removes every hidden guide for the caller, `all` included. Idempotent.
|
|
10108
|
+
*
|
|
10109
|
+
* @param options - Per-request options.
|
|
10110
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: No session.
|
|
10111
|
+
* @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.
|
|
10112
|
+
* @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.
|
|
10113
|
+
* @see DELETE /v1/me/hidden-guides
|
|
10114
|
+
* @see https://productcraft.co/docs/platform/api-reference#delete-v1-me-hidden-guides
|
|
10115
|
+
* @example
|
|
10116
|
+
* ```ts
|
|
10117
|
+
* await platform.me.hiddenGuides.reset();
|
|
10118
|
+
* ```
|
|
10119
|
+
*/
|
|
10120
|
+
reset(options?: RequestOptions): APIPromise<void>;
|
|
10121
|
+
/**
|
|
10122
|
+
* Show a hidden getting-started guide again.
|
|
10123
|
+
*
|
|
10124
|
+
* Idempotent: showing a guide that is not hidden is a no-op.
|
|
10125
|
+
*
|
|
10126
|
+
* @param key - The guide: a surface name, optionally followed by `:` and a resource id, e.g. `dashboard:<workspace id>` or `all`.
|
|
10127
|
+
* @param options - Per-request options.
|
|
10128
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: The key is not a valid guide key.
|
|
10129
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: No session.
|
|
10130
|
+
* @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.
|
|
10131
|
+
* @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.
|
|
10132
|
+
* @see DELETE /v1/me/hidden-guides/{key}
|
|
10133
|
+
* @see https://productcraft.co/docs/platform/api-reference#delete-v1-me-hidden-guides-key
|
|
10134
|
+
* @example
|
|
10135
|
+
* ```ts
|
|
10136
|
+
* await platform.me.hiddenGuides.unhide("key");
|
|
10137
|
+
* ```
|
|
10138
|
+
*/
|
|
10139
|
+
unhide(key: string, options?: RequestOptions): APIPromise<void>;
|
|
10140
|
+
}
|
|
10141
|
+
/** `me.profile` */
|
|
10142
|
+
declare class MeProfileResource extends APIResource {
|
|
10143
|
+
/**
|
|
10144
|
+
* 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.
|
|
10145
|
+
*
|
|
10146
|
+
* @param params - `PlatformAuth.MeProfileUpdateParams`.
|
|
10147
|
+
* @param options - Per-request options.
|
|
10148
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failed (e.g. displayName outside 1-128 chars).
|
|
10149
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: No session.
|
|
10150
|
+
* @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.
|
|
10151
|
+
* @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.
|
|
10152
|
+
* @see PATCH /v1/me/profile
|
|
10153
|
+
* @see https://productcraft.co/docs/platform/api-reference#patch-v1-me-profile
|
|
10154
|
+
* @example
|
|
10155
|
+
* ```ts
|
|
10156
|
+
* const meProfile = await platform.me.profile.update({ display_name: "string" });
|
|
10157
|
+
* ```
|
|
10158
|
+
*/
|
|
10159
|
+
update(params?: MeProfileUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<MeProfile>>;
|
|
10160
|
+
}
|
|
10161
|
+
/** `me` */
|
|
10162
|
+
declare class MeResource extends APIResource {
|
|
10163
|
+
#private;
|
|
10164
|
+
get avatar(): MeAvatarResource;
|
|
10165
|
+
get hiddenGuides(): MeHiddenGuidesResource;
|
|
10166
|
+
get profile(): MeProfileResource;
|
|
10167
|
+
/**
|
|
10168
|
+
* Read the caller's account profile.
|
|
10169
|
+
*
|
|
10170
|
+
* @param options - Per-request options.
|
|
10171
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: No session.
|
|
10172
|
+
* @throws {NotFoundError} 404 NOT_FOUND: No account row for the session principal. Should never fire for a valid session — surfaced for SDKs.
|
|
10173
|
+
* @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.
|
|
10174
|
+
* @see GET /v1/me
|
|
10175
|
+
* @see https://productcraft.co/docs/platform/api-reference#get-v1-me
|
|
10176
|
+
* @example
|
|
10177
|
+
* ```ts
|
|
10178
|
+
* const meProfile = await platform.me.retrieve();
|
|
10179
|
+
* ```
|
|
10180
|
+
*/
|
|
10181
|
+
retrieve(options?: RequestOptions): APIPromise<WithLastResponse<MeProfile>>;
|
|
10182
|
+
}
|
|
10183
|
+
/** `oauth.connections` */
|
|
10184
|
+
declare class OauthConnectionsResource extends APIResource {
|
|
10185
|
+
/**
|
|
10186
|
+
* Disconnect a client
|
|
10187
|
+
*
|
|
10188
|
+
* Revokes the whole grant family — the grant, its authorization codes, its refresh tokens and every live access token — in one transaction.
|
|
10189
|
+
*
|
|
10190
|
+
* @param grantId - Id of the grant.
|
|
10191
|
+
* @param options - Per-request options.
|
|
10192
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
10193
|
+
* @throws {NotFoundError} 404 NOT_FOUND: No such connection for this human.
|
|
10194
|
+
* @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.
|
|
10195
|
+
* @see DELETE /v1/oauth/connections/{grant_id}
|
|
10196
|
+
* @see https://productcraft.co/docs/platform/api-reference#delete-v1-oauth-connections-grant-id
|
|
10197
|
+
* @example
|
|
10198
|
+
* ```ts
|
|
10199
|
+
* await platform.oauth.connections.delete("3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b");
|
|
10200
|
+
* ```
|
|
10201
|
+
*/
|
|
10202
|
+
delete(grantId: string, options?: RequestOptions): APIPromise<void>;
|
|
10203
|
+
/**
|
|
10204
|
+
* List clients this human has connected
|
|
10205
|
+
*
|
|
10206
|
+
* The user-facing half of revocation: which third-party clients hold a grant, in which workspace, carrying which policy.
|
|
10207
|
+
*
|
|
10208
|
+
* @param params - `PlatformAuth.OauthConnectionListParams`.
|
|
10209
|
+
* @param options - Per-request options.
|
|
10210
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`.
|
|
10211
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
10212
|
+
* @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.
|
|
10213
|
+
* @see GET /v1/oauth/connections
|
|
10214
|
+
* @see https://productcraft.co/docs/platform/api-reference#get-v1-oauth-connections
|
|
10215
|
+
* @example
|
|
10216
|
+
* ```ts
|
|
10217
|
+
* for await (const connection of platform.oauth.connections.list()) {
|
|
10218
|
+
* console.log(connection);
|
|
10219
|
+
* }
|
|
10220
|
+
* const page = await platform.oauth.connections.list({}, { timeout: 5_000 });
|
|
10221
|
+
* ```
|
|
10222
|
+
*/
|
|
10223
|
+
list(params?: OauthConnectionListParams, options?: RequestOptions): PagePromise<ConnectedClient>;
|
|
10224
|
+
}
|
|
10225
|
+
/** `oauth.workspaces.connections` */
|
|
10226
|
+
declare class OauthWorkspacesConnectionsResource extends APIResource {
|
|
10227
|
+
/**
|
|
10228
|
+
* Disconnect a client on behalf of the workspace
|
|
10229
|
+
*
|
|
10230
|
+
* 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`.
|
|
10231
|
+
*
|
|
10232
|
+
* @param workspaceId - Id of the workspace.
|
|
10233
|
+
* @param grantId - Id of the grant.
|
|
10234
|
+
* @param options - Per-request options.
|
|
10235
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
10236
|
+
* @throws {PermissionDeniedError} 403 FORBIDDEN: Not a member, or lacks `workspace.connection.revoke`.
|
|
10237
|
+
* @throws {NotFoundError} 404 NOT_FOUND: No such connection in this workspace.
|
|
10238
|
+
* @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.
|
|
10239
|
+
* @see DELETE /v1/oauth/workspaces/{workspace_id}/connections/{grant_id}
|
|
10240
|
+
* @see https://productcraft.co/docs/platform/api-reference#delete-v1-oauth-workspaces-workspace-id-connections-grant-id
|
|
10241
|
+
* @example
|
|
10242
|
+
* ```ts
|
|
10243
|
+
* await platform.oauth.workspaces.connections.delete("3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b", "5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6");
|
|
10244
|
+
* ```
|
|
10245
|
+
*/
|
|
10246
|
+
delete(workspaceId: string, grantId: string, options?: RequestOptions): APIPromise<void>;
|
|
10247
|
+
/**
|
|
10248
|
+
* List every client connected to a workspace
|
|
10249
|
+
*
|
|
10250
|
+
* 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`.
|
|
10251
|
+
*
|
|
10252
|
+
* @param workspaceId - Id of the workspace.
|
|
10253
|
+
* @param params - `PlatformAuth.OauthWorkspaceConnectionListParams`.
|
|
10254
|
+
* @param options - Per-request options.
|
|
10255
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`.
|
|
10256
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
10257
|
+
* @throws {PermissionDeniedError} 403 FORBIDDEN: Not a member, or lacks `workspace.connection.read`.
|
|
10258
|
+
* @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.
|
|
10259
|
+
* @see GET /v1/oauth/workspaces/{workspace_id}/connections
|
|
10260
|
+
* @see https://productcraft.co/docs/platform/api-reference#get-v1-oauth-workspaces-workspace-id-connections
|
|
10261
|
+
* @example
|
|
10262
|
+
* ```ts
|
|
10263
|
+
* for await (const connection of platform.oauth.workspaces.connections.list("3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b")) {
|
|
10264
|
+
* console.log(connection);
|
|
10265
|
+
* }
|
|
10266
|
+
* const page = await platform.oauth.workspaces.connections.list("3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b", {}, { timeout: 5_000 });
|
|
10267
|
+
* ```
|
|
10268
|
+
*/
|
|
10269
|
+
list(workspaceId: string, params?: OauthWorkspaceConnectionListParams, options?: RequestOptions): PagePromise<ConnectedClient>;
|
|
10270
|
+
/**
|
|
10271
|
+
* Lift a workspace revocation so the member may reconnect
|
|
10272
|
+
*
|
|
10273
|
+
* 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`.
|
|
10274
|
+
*
|
|
10275
|
+
* @param workspaceId - Id of the workspace.
|
|
10276
|
+
* @param grantId - Id of the grant.
|
|
10277
|
+
* @param options - Per-request options.
|
|
10278
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session, or a session that has been signed out (`SESSION_REVOKED`).
|
|
10279
|
+
* @throws {PermissionDeniedError} 403 FORBIDDEN: Not a member, or lacks `workspace.connection.revoke`.
|
|
10280
|
+
* @throws {NotFoundError} 404 NOT_FOUND: No such connection in this workspace.
|
|
10281
|
+
* @throws {ConflictError} 409 CONFLICT: The connection was not revoked by an administrator — there is nothing to lift.
|
|
10282
|
+
* @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.
|
|
10283
|
+
* @see POST /v1/oauth/workspaces/{workspace_id}/connections/{grant_id}/restore
|
|
10284
|
+
* @see https://productcraft.co/docs/platform/api-reference#post-v1-oauth-workspaces-workspace-id-connections-grant-id-restore
|
|
10285
|
+
* @example
|
|
10286
|
+
* ```ts
|
|
10287
|
+
* await platform.oauth.workspaces.connections.restore("3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b", "5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6");
|
|
10288
|
+
* ```
|
|
10289
|
+
*/
|
|
10290
|
+
restore(workspaceId: string, grantId: string, options?: RequestOptions): APIPromise<void>;
|
|
10291
|
+
}
|
|
10292
|
+
/** `oauth.workspaces` */
|
|
10293
|
+
declare class OauthWorkspacesResource extends APIResource {
|
|
10294
|
+
#private;
|
|
10295
|
+
get connections(): OauthWorkspacesConnectionsResource;
|
|
10296
|
+
}
|
|
10297
|
+
/** `oauth` */
|
|
10298
|
+
declare class OauthResource extends APIResource {
|
|
10299
|
+
#private;
|
|
10300
|
+
get connections(): OauthConnectionsResource;
|
|
10301
|
+
get workspaces(): OauthWorkspacesResource;
|
|
10302
|
+
}
|
|
10303
|
+
/** `sessions` */
|
|
10304
|
+
declare class SessionsResource extends APIResource {
|
|
10305
|
+
/**
|
|
10306
|
+
* 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.
|
|
10307
|
+
*
|
|
10308
|
+
* @param id - Id of the session.
|
|
10309
|
+
* @param options - Per-request options.
|
|
10310
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `id` is not a UUID.
|
|
10311
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Unauthorized
|
|
10312
|
+
* @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.
|
|
10313
|
+
* @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.
|
|
10314
|
+
* @see DELETE /v1/session/{id}
|
|
10315
|
+
* @see https://productcraft.co/docs/platform/api-reference#delete-v1-session-id
|
|
10316
|
+
* @example
|
|
10317
|
+
* ```ts
|
|
10318
|
+
* const revokeSession = await platform.sessions.delete("3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b");
|
|
10319
|
+
* ```
|
|
10320
|
+
*/
|
|
10321
|
+
delete(id: string, options?: RequestOptions): APIPromise<WithLastResponse<RevokeSession>>;
|
|
10322
|
+
/**
|
|
10323
|
+
* List active sessions
|
|
10324
|
+
*
|
|
10325
|
+
* @param options - Per-request options.
|
|
10326
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Unauthorized
|
|
10327
|
+
* @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.
|
|
10328
|
+
* @see GET /v1/session
|
|
10329
|
+
* @see https://productcraft.co/docs/platform/api-reference#get-v1-session
|
|
10330
|
+
* @example
|
|
10331
|
+
* ```ts
|
|
10332
|
+
* const result = await platform.sessions.list();
|
|
10333
|
+
* ```
|
|
10334
|
+
*/
|
|
10335
|
+
list(options?: RequestOptions): APIPromise<WithLastResponse<SessionListResponse>>;
|
|
10336
|
+
/**
|
|
10337
|
+
* 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.
|
|
10338
|
+
*
|
|
10339
|
+
* @param options - Per-request options.
|
|
10340
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Unauthorized
|
|
10341
|
+
* @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.
|
|
10342
|
+
* @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.
|
|
10343
|
+
* @see POST /v1/session/revoke-others
|
|
10344
|
+
* @see https://productcraft.co/docs/platform/api-reference#post-v1-session-revoke-others
|
|
10345
|
+
* @example
|
|
10346
|
+
* ```ts
|
|
10347
|
+
* const revokeOtherSessions = await platform.sessions.revokeOthers();
|
|
10348
|
+
* ```
|
|
10349
|
+
*/
|
|
10350
|
+
revokeOthers(options?: RequestOptions): APIPromise<WithLastResponse<RevokeOtherSessions>>;
|
|
10351
|
+
}
|
|
10352
|
+
/** `stats` */
|
|
10353
|
+
declare class StatsResource extends APIResource {
|
|
10354
|
+
/**
|
|
10355
|
+
* Workspace stats
|
|
10356
|
+
*
|
|
10357
|
+
* 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.
|
|
10358
|
+
*
|
|
10359
|
+
* 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`).
|
|
10360
|
+
*
|
|
10361
|
+
* @param params - `PlatformAuth.StatsRetrieveParams`.
|
|
10362
|
+
* @param options - Per-request options.
|
|
10363
|
+
* @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.
|
|
10364
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
10365
|
+
* @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.
|
|
10366
|
+
* @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this id (or slug). Same answer as the service's other workspace routes.
|
|
10367
|
+
* @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.
|
|
10368
|
+
* @see GET /v1/workspaces/{workspace_id}/stats
|
|
10369
|
+
* @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-id-stats
|
|
10370
|
+
* @example
|
|
10371
|
+
* ```ts
|
|
10372
|
+
* const workspaceStats = await platform.stats.retrieve();
|
|
10373
|
+
* ```
|
|
10374
|
+
*/
|
|
10375
|
+
retrieve(params?: StatsRetrieveParams, options?: RequestOptions): APIPromise<WithLastResponse<WorkspaceStats>>;
|
|
10376
|
+
}
|
|
10377
|
+
/** `verification` */
|
|
10378
|
+
declare class VerificationResource extends APIResource {
|
|
10379
|
+
/**
|
|
10380
|
+
* Resend verification email
|
|
10381
|
+
*
|
|
10382
|
+
* @param options - Per-request options.
|
|
10383
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Unauthorized
|
|
10384
|
+
* @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.
|
|
10385
|
+
* @see POST /v1/verification/resend
|
|
10386
|
+
* @see https://productcraft.co/docs/platform/api-reference#post-v1-verification-resend
|
|
10387
|
+
* @example
|
|
10388
|
+
* ```ts
|
|
10389
|
+
* const feedback = await platform.verification.resend();
|
|
10390
|
+
* ```
|
|
10391
|
+
*/
|
|
10392
|
+
resend(options?: RequestOptions): APIPromise<WithLastResponse<Feedback>>;
|
|
10393
|
+
/**
|
|
10394
|
+
* Verify an email code
|
|
10395
|
+
*
|
|
10396
|
+
* @param params - `PlatformAuth.VerificationVerifyParams`.
|
|
10397
|
+
* @param options - Per-request options.
|
|
10398
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid or expired verification code
|
|
10399
|
+
* @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.
|
|
10400
|
+
* @see POST /v1/verification/verify
|
|
10401
|
+
* @see https://productcraft.co/docs/platform/api-reference#post-v1-verification-verify
|
|
10402
|
+
* @example
|
|
10403
|
+
* ```ts
|
|
10404
|
+
* const feedback = await platform.verification.verify({ code: "a1b2c3d4…" });
|
|
10405
|
+
* ```
|
|
10406
|
+
*/
|
|
10407
|
+
verify(params: VerificationVerifyParams, options?: RequestOptions): APIPromise<WithLastResponse<Feedback>>;
|
|
10408
|
+
}
|
|
10409
|
+
/** `wellKnown` */
|
|
10410
|
+
declare class WellKnownResource extends APIResource {
|
|
10411
|
+
/**
|
|
10412
|
+
* Public JWKS for verifying platform-issued JWTs (issuer `https://api.auth.productcraft.co`).
|
|
10413
|
+
*
|
|
10414
|
+
* @param options - Per-request options.
|
|
10415
|
+
* @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.
|
|
10416
|
+
* @see GET /.well-known/jwks.json
|
|
10417
|
+
* @see https://productcraft.co/docs/platform/api-reference#get-well-known-jwks-json
|
|
10418
|
+
* @example
|
|
10419
|
+
* ```ts
|
|
10420
|
+
* const jwks = await platform.wellKnown.jwks();
|
|
10421
|
+
* ```
|
|
10422
|
+
*/
|
|
10423
|
+
jwks(options?: RequestOptions): APIPromise<WithLastResponse<Jwks>>;
|
|
10424
|
+
/**
|
|
10425
|
+
* OAuth 2.1 authorization server metadata (RFC 8414)
|
|
10426
|
+
*
|
|
10427
|
+
* 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`).
|
|
10428
|
+
*
|
|
10429
|
+
* @param options - Per-request options.
|
|
10430
|
+
* @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.
|
|
10431
|
+
* @see GET /.well-known/oauth-authorization-server
|
|
10432
|
+
* @see https://productcraft.co/docs/platform/api-reference#get-well-known-oauth-authorization-server
|
|
10433
|
+
* @example
|
|
10434
|
+
* ```ts
|
|
10435
|
+
* const authorizationServerMetadata = await platform.wellKnown.oauthAuthorizationServer();
|
|
10436
|
+
* ```
|
|
10437
|
+
*/
|
|
10438
|
+
oauthAuthorizationServer(options?: RequestOptions): APIPromise<WithLastResponse<AuthorizationServerMetadata>>;
|
|
10439
|
+
}
|
|
10440
|
+
/** `workspaces.apiKeys.presets` */
|
|
10441
|
+
declare class WorkspacesApiKeysPresetsResource extends APIResource {
|
|
10442
|
+
/**
|
|
10443
|
+
* 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.
|
|
10444
|
+
*
|
|
10445
|
+
* @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.
|
|
10446
|
+
* @param options - Per-request options.
|
|
10447
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, malformed or invalid session.
|
|
10448
|
+
* @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.apikey.read`.
|
|
10449
|
+
* @throws {NotFoundError} 404 NOT_FOUND: Workspace not found.
|
|
10450
|
+
* @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.
|
|
10451
|
+
* @see GET /v1/workspaces/{workspace_slug}/api-keys/presets
|
|
10452
|
+
* @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-api-keys-presets
|
|
10453
|
+
* @example
|
|
10454
|
+
* ```ts
|
|
10455
|
+
* for await (const preset of platform.workspaces.apiKeys.presets.list("workspace")) {
|
|
10456
|
+
* console.log(preset);
|
|
10457
|
+
* }
|
|
10458
|
+
* ```
|
|
10459
|
+
*/
|
|
10460
|
+
list(workspaceSlug: string, options?: RequestOptions): PagePromise<PakPreset>;
|
|
10461
|
+
}
|
|
10462
|
+
/** `workspaces.apiKeys` */
|
|
10463
|
+
declare class WorkspacesApiKeysResource extends APIResource {
|
|
10464
|
+
#private;
|
|
10465
|
+
get presets(): WorkspacesApiKeysPresetsResource;
|
|
10466
|
+
/**
|
|
10467
|
+
* 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).
|
|
10468
|
+
*
|
|
10469
|
+
* @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.
|
|
10470
|
+
* @param params - `PlatformAuth.WorkspaceApiKeyCreateParams`.
|
|
10471
|
+
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
10472
|
+
* @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`).
|
|
10473
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing, malformed or invalid session. Also a session that has been signed out (`SESSION_REVOKED`).
|
|
10474
|
+
* @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.
|
|
10475
|
+
* @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`).
|
|
10476
|
+
* @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).
|
|
10477
|
+
* @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.
|
|
10478
|
+
* @see POST /v1/workspaces/{workspace_slug}/api-keys
|
|
10479
|
+
* @see https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-workspace-slug-api-keys
|
|
10480
|
+
* @example
|
|
10481
|
+
* ```ts
|
|
10482
|
+
* const mintPak = await platform.workspaces.apiKeys.create("workspace", { name: "Production social client" });
|
|
10483
|
+
* ```
|
|
10484
|
+
*/
|
|
10485
|
+
create(workspaceSlug: string, params: WorkspaceApiKeyCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<MintPak>>;
|
|
10486
|
+
/**
|
|
10487
|
+
* 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.
|
|
10488
|
+
*
|
|
10489
|
+
* @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.
|
|
10490
|
+
* @param id - Id of the api key.
|
|
10491
|
+
* @param params - `PlatformAuth.WorkspaceApiKeyDeleteParams`.
|
|
10492
|
+
* @param options - Per-request options.
|
|
10493
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `id` is not a UUID.
|
|
10494
|
+
* @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`).
|
|
10495
|
+
* @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.apikey.delete`.
|
|
10496
|
+
* @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.
|
|
10497
|
+
* @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.
|
|
10498
|
+
* @see DELETE /v1/workspaces/{workspace_slug}/api-keys/{id}
|
|
10499
|
+
* @see https://productcraft.co/docs/platform/api-reference#delete-v1-workspaces-workspace-slug-api-keys-id
|
|
10500
|
+
* @example
|
|
10501
|
+
* ```ts
|
|
10502
|
+
* await platform.workspaces.apiKeys.delete("workspace", "5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6");
|
|
10503
|
+
* ```
|
|
10504
|
+
*/
|
|
10505
|
+
delete(workspaceSlug: string, id: string, params?: WorkspaceApiKeyDeleteParams, options?: RequestOptions): APIPromise<void>;
|
|
10506
|
+
/**
|
|
10507
|
+
* List the API keys in this workspace
|
|
10508
|
+
*
|
|
10509
|
+
* 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.
|
|
10510
|
+
*
|
|
10511
|
+
* **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).
|
|
10512
|
+
*
|
|
10513
|
+
* @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.
|
|
10514
|
+
* @param params - `PlatformAuth.WorkspaceApiKeyListParams`.
|
|
10515
|
+
* @param options - Per-request options.
|
|
10516
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`, or `include_revoked` is not `true` or `false` (`VALIDATION_ERROR`).
|
|
10517
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
10518
|
+
* @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.
|
|
10519
|
+
* @see GET /v1/workspaces/{workspace_slug}/api-keys
|
|
10520
|
+
* @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-api-keys
|
|
10521
|
+
* @example
|
|
10522
|
+
* ```ts
|
|
10523
|
+
* for await (const apiKey of platform.workspaces.apiKeys.list("workspace")) {
|
|
10524
|
+
* console.log(apiKey);
|
|
10525
|
+
* }
|
|
10526
|
+
* const page = await platform.workspaces.apiKeys.list("workspace", {}, { timeout: 5_000 });
|
|
10527
|
+
* ```
|
|
10528
|
+
*/
|
|
10529
|
+
list(workspaceSlug: string, params?: WorkspaceApiKeyListParams, options?: RequestOptions): PagePromise<PublicApiKey>;
|
|
10530
|
+
/**
|
|
10531
|
+
* 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.
|
|
10532
|
+
*
|
|
10533
|
+
* @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.
|
|
10534
|
+
* @param params - `PlatformAuth.WorkspaceApiKeyPreviewParams`.
|
|
10535
|
+
* @param options - Per-request options.
|
|
10536
|
+
* @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`.
|
|
10537
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing, malformed or invalid session. Also a session that has been signed out (`SESSION_REVOKED`).
|
|
10538
|
+
* @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`.
|
|
10539
|
+
* @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`).
|
|
10540
|
+
* @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.
|
|
10541
|
+
* @see POST /v1/workspaces/{workspace_slug}/api-keys/preview
|
|
10542
|
+
* @see https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-workspace-slug-api-keys-preview
|
|
10543
|
+
* @example
|
|
10544
|
+
* ```ts
|
|
10545
|
+
* const pakGrantPreview = await platform.workspaces.apiKeys.preview("workspace", { policy_ids: ["11111111-1111-1111-1111-111111111111"] });
|
|
10546
|
+
* ```
|
|
10547
|
+
*/
|
|
10548
|
+
preview(workspaceSlug: string, params?: WorkspaceApiKeyPreviewParams, options?: RequestOptions): APIPromise<WithLastResponse<PakGrantPreview>>;
|
|
10549
|
+
/**
|
|
10550
|
+
* Get a single PAK by id.
|
|
10551
|
+
*
|
|
10552
|
+
* @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.
|
|
10553
|
+
* @param id - Id of the api key.
|
|
10554
|
+
* @param options - Per-request options.
|
|
10555
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `id` is not a UUID.
|
|
10556
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, malformed or invalid session, or a PAK bearer (this route accepts cookie/JWT sessions only).
|
|
10557
|
+
* @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.apikey.read`.
|
|
10558
|
+
* @throws {NotFoundError} 404 NOT_FOUND, PAK_NOT_FOUND: Workspace not found, or PAK not found in this workspace (`PAK_NOT_FOUND`).
|
|
10559
|
+
* @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.
|
|
10560
|
+
* @see GET /v1/workspaces/{workspace_slug}/api-keys/{id}
|
|
10561
|
+
* @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-api-keys-id
|
|
10562
|
+
* @example
|
|
10563
|
+
* ```ts
|
|
10564
|
+
* const publicApiKey = await platform.workspaces.apiKeys.retrieve("workspace", "5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6");
|
|
10565
|
+
* ```
|
|
10566
|
+
*/
|
|
10567
|
+
retrieve(workspaceSlug: string, id: string, options?: RequestOptions): APIPromise<WithLastResponse<PublicApiKey>>;
|
|
10568
|
+
/**
|
|
10569
|
+
* 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.
|
|
10570
|
+
*
|
|
10571
|
+
* @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.
|
|
10572
|
+
* @param id - Id of the api key.
|
|
10573
|
+
* @param params - `PlatformAuth.WorkspaceApiKeyRotateParams`.
|
|
10574
|
+
* @param options - Per-request options.
|
|
10575
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session, or a session that has been signed out (`SESSION_REVOKED`).
|
|
10576
|
+
* @throws {PermissionDeniedError} 403 FORBIDDEN: Caller is a PAK (`pcft_live_*`), or cannot grant one or more actions in the bindings being carried across.
|
|
10577
|
+
* @throws {NotFoundError} 404 NOT_FOUND: PAK not found in this workspace.
|
|
10578
|
+
* @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.
|
|
10579
|
+
* @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.
|
|
10580
|
+
* @see POST /v1/workspaces/{workspace_slug}/api-keys/{id}/rotate
|
|
10581
|
+
* @see https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-workspace-slug-api-keys-id-rotate
|
|
10582
|
+
* @example
|
|
10583
|
+
* ```ts
|
|
10584
|
+
* const rotatePak = await platform.workspaces.apiKeys.rotate("workspace", "5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6", { grace_hours: 24 });
|
|
10585
|
+
* ```
|
|
10586
|
+
*/
|
|
10587
|
+
rotate(workspaceSlug: string, id: string, params?: WorkspaceApiKeyRotateParams, options?: RequestOptions): APIPromise<WithLastResponse<RotatePak>>;
|
|
10588
|
+
/**
|
|
10589
|
+
* Update a PAK’s name or description (does not touch bindings).
|
|
10590
|
+
*
|
|
10591
|
+
* @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.
|
|
10592
|
+
* @param id - Id of the api key.
|
|
10593
|
+
* @param params - `PlatformAuth.WorkspaceApiKeyUpdateParams`.
|
|
10594
|
+
* @param options - Per-request options.
|
|
10595
|
+
* @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`).
|
|
10596
|
+
* @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`).
|
|
10597
|
+
* @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.apikey.update`.
|
|
10598
|
+
* @throws {NotFoundError} 404 NOT_FOUND, PAK_NOT_FOUND: Workspace not found, or PAK not found in this workspace (`PAK_NOT_FOUND`).
|
|
10599
|
+
* @throws {ConflictError} 409 CONFLICT, PAK_REVOKED: PAK is revoked (`PAK_REVOKED`).
|
|
10600
|
+
* @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.
|
|
10601
|
+
* @see PATCH /v1/workspaces/{workspace_slug}/api-keys/{id}
|
|
10602
|
+
* @see https://productcraft.co/docs/platform/api-reference#patch-v1-workspaces-workspace-slug-api-keys-id
|
|
10603
|
+
* @example
|
|
10604
|
+
* ```ts
|
|
10605
|
+
* const publicApiKey = await platform.workspaces.apiKeys.update("workspace", "5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6", { description: "string" });
|
|
10606
|
+
* ```
|
|
10607
|
+
*/
|
|
10608
|
+
update(workspaceSlug: string, id: string, params?: WorkspaceApiKeyUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<PublicApiKey>>;
|
|
10609
|
+
/**
|
|
10610
|
+
* Replace the managed-policy bindings on a PAK. Re-runs caller-narrowing on the merged union of statements.
|
|
10611
|
+
*
|
|
10612
|
+
* @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.
|
|
10613
|
+
* @param id - Id of the api key.
|
|
10614
|
+
* @param params - `PlatformAuth.WorkspaceApiKeyUpdateBindingsParams`.
|
|
10615
|
+
* @param options - Per-request options.
|
|
10616
|
+
* @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.
|
|
10617
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session, or a session that has been signed out (`SESSION_REVOKED`).
|
|
10618
|
+
* @throws {PermissionDeniedError} 403 FORBIDDEN: Caller cannot grant one or more actions in the merged statement set.
|
|
10619
|
+
* @throws {NotFoundError} 404 NOT_FOUND: PAK not found in this workspace.
|
|
10620
|
+
* @throws {ConflictError} 409 CONFLICT: Empty bindings — revoke the PAK instead of leaving it unbound.
|
|
10621
|
+
* @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.
|
|
10622
|
+
* @see PATCH /v1/workspaces/{workspace_slug}/api-keys/{id}/bindings
|
|
10623
|
+
* @see https://productcraft.co/docs/platform/api-reference#patch-v1-workspaces-workspace-slug-api-keys-id-bindings
|
|
10624
|
+
* @example
|
|
10625
|
+
* ```ts
|
|
10626
|
+
* const publicApiKey = await platform.workspaces.apiKeys.updateBindings("workspace", "5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6", { policy_ids: ["string"] });
|
|
10627
|
+
* ```
|
|
10628
|
+
*/
|
|
10629
|
+
updateBindings(workspaceSlug: string, id: string, params: WorkspaceApiKeyUpdateBindingsParams, options?: RequestOptions): APIPromise<WithLastResponse<PublicApiKey>>;
|
|
10630
|
+
}
|
|
10631
|
+
/** `workspaces.auditFeed` */
|
|
10632
|
+
declare class WorkspacesAuditFeedResource extends APIResource {
|
|
10633
|
+
/**
|
|
10634
|
+
* Unified workspace audit feed (cursor-paginated)
|
|
10635
|
+
*
|
|
10636
|
+
* 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.
|
|
10637
|
+
*
|
|
10638
|
+
* @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.
|
|
10639
|
+
* @param params - `PlatformAuth.WorkspaceAuditFeedListParams`.
|
|
10640
|
+
* @param options - Per-request options.
|
|
10641
|
+
* @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.
|
|
10642
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
10643
|
+
* @throws {PermissionDeniedError} 403 FORBIDDEN: The caller is signed in but lacks `workspace.audit.read` for this workspace.
|
|
10644
|
+
* @throws {NotFoundError} 404 NOT_FOUND: The `:workspaceSlug` path param does not resolve to a workspace the caller can see.
|
|
10645
|
+
* @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.
|
|
10646
|
+
* @see GET /v1/workspaces/{workspace_slug}/audit-feed
|
|
10647
|
+
* @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-audit-feed
|
|
10648
|
+
* @example
|
|
10649
|
+
* ```ts
|
|
10650
|
+
* for await (const auditFeed of platform.workspaces.auditFeed.list("workspace")) {
|
|
10651
|
+
* console.log(auditFeed);
|
|
10652
|
+
* }
|
|
10653
|
+
* const page = await platform.workspaces.auditFeed.list("workspace", {}, { timeout: 5_000 });
|
|
10654
|
+
* ```
|
|
10655
|
+
*/
|
|
10656
|
+
list(workspaceSlug: string, params?: WorkspaceAuditFeedListParams, options?: RequestOptions): PagePromise<FeedItem>;
|
|
10657
|
+
}
|
|
10658
|
+
/** `workspaces.auditLogs` */
|
|
10659
|
+
declare class WorkspacesAuditLogsResource extends APIResource {
|
|
10660
|
+
/**
|
|
10661
|
+
* 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.
|
|
10662
|
+
*
|
|
10663
|
+
* 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.
|
|
10664
|
+
*
|
|
10665
|
+
* @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.
|
|
10666
|
+
* @param params - `PlatformAuth.WorkspaceAuditLogExportParams`.
|
|
10667
|
+
* @param options - Per-request options.
|
|
10668
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Unknown `format`, or malformed `since` / `until`.
|
|
10669
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
10670
|
+
* @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `workspace.audit.read`.
|
|
10671
|
+
* @throws {NotFoundError} 404 NOT_FOUND: Workspace not found.
|
|
10672
|
+
* @throws {APIError} 413 PAYLOAD_TOO_LARGE: More than 1,000,000 rows match. Narrow the window with `since` / `until` and retry.
|
|
10673
|
+
* @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.
|
|
10674
|
+
* @see GET /v1/workspaces/{workspace_slug}/audit-logs/export
|
|
10675
|
+
* @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-audit-logs-export
|
|
10676
|
+
* @example
|
|
10677
|
+
* ```ts
|
|
10678
|
+
* const response = await platform.workspaces.auditLogs.export("workspace");
|
|
10679
|
+
* const text = await response.text();
|
|
10680
|
+
* ```
|
|
10681
|
+
*/
|
|
10682
|
+
export(workspaceSlug: string, params?: WorkspaceAuditLogExportParams, options?: RequestOptions): APIPromise<Response>;
|
|
10683
|
+
/**
|
|
10684
|
+
* 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.
|
|
10685
|
+
*
|
|
10686
|
+
* @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.
|
|
10687
|
+
* @param params - `PlatformAuth.WorkspaceAuditLogListParams`.
|
|
10688
|
+
* @param options - Per-request options.
|
|
10689
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`, `since`, or `until`.
|
|
10690
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
10691
|
+
* @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.
|
|
10692
|
+
* @see GET /v1/workspaces/{workspace_slug}/audit-logs
|
|
10693
|
+
* @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-audit-logs
|
|
10694
|
+
* @example
|
|
10695
|
+
* ```ts
|
|
10696
|
+
* for await (const auditLog of platform.workspaces.auditLogs.list("workspace")) {
|
|
10697
|
+
* console.log(auditLog);
|
|
10698
|
+
* }
|
|
10699
|
+
* const page = await platform.workspaces.auditLogs.list("workspace", {}, { timeout: 5_000 });
|
|
10700
|
+
* ```
|
|
10701
|
+
*/
|
|
10702
|
+
list(workspaceSlug: string, params?: WorkspaceAuditLogListParams, options?: RequestOptions): PagePromise<WorkspaceAuditLogEntry>;
|
|
10703
|
+
}
|
|
10704
|
+
/** `workspaces.avatar` */
|
|
10705
|
+
declare class WorkspacesAvatarResource extends APIResource {
|
|
10706
|
+
/**
|
|
10707
|
+
* Clear the workspace avatar and delete the stored object. Gated by `workspace.settings.update`.
|
|
10708
|
+
*
|
|
10709
|
+
* @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.
|
|
10710
|
+
* @param options - Per-request options.
|
|
10711
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid session.
|
|
10712
|
+
* @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.settings.update`.
|
|
10713
|
+
* @throws {NotFoundError} 404 NOT_FOUND: Workspace not found (unknown slug or id).
|
|
10714
|
+
* @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.
|
|
10715
|
+
* @see DELETE /v1/workspaces/{workspace_slug}/avatar
|
|
10716
|
+
* @see https://productcraft.co/docs/platform/api-reference#delete-v1-workspaces-workspace-slug-avatar
|
|
10717
|
+
* @example
|
|
10718
|
+
* ```ts
|
|
10719
|
+
* await platform.workspaces.avatar.clear("workspace");
|
|
10720
|
+
* ```
|
|
10721
|
+
*/
|
|
10722
|
+
clear(workspaceSlug: string, options?: RequestOptions): APIPromise<void>;
|
|
10723
|
+
/**
|
|
10724
|
+
* 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).
|
|
10725
|
+
*
|
|
10726
|
+
* @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.
|
|
10727
|
+
* @param params - `PlatformAuth.WorkspaceAvatarUploadParams`.
|
|
10728
|
+
* @param options - Per-request options.
|
|
10729
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
10730
|
+
* @throws {PermissionDeniedError} 403 FORBIDDEN: Caller is not a member of this workspace, or lacks workspace.settings.update.
|
|
10731
|
+
* @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.
|
|
10732
|
+
* @see POST /v1/workspaces/{workspace_slug}/avatar
|
|
10733
|
+
* @see https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-workspace-slug-avatar
|
|
10734
|
+
* @example
|
|
10735
|
+
* ```ts
|
|
10736
|
+
* const workspaceAvatarUrl = await platform.workspaces.avatar.upload("workspace", { file: new File(["…"], "image.png", { type: "image/png" }) });
|
|
10737
|
+
* ```
|
|
10738
|
+
*/
|
|
10739
|
+
upload(workspaceSlug: string, params: WorkspaceAvatarUploadParams, options?: RequestOptions): APIPromise<WithLastResponse<WorkspaceAvatarUrl>>;
|
|
10740
|
+
}
|
|
10741
|
+
/** `workspaces.invites` */
|
|
10742
|
+
declare class WorkspacesInvitesResource extends APIResource {
|
|
10743
|
+
/**
|
|
10744
|
+
* Accept a workspace invite by code. Cookie/JWT only — invite acceptance binds a human identity to a workspace.
|
|
10745
|
+
*
|
|
10746
|
+
* @param params - `PlatformAuth.WorkspaceInviteAcceptParams`.
|
|
10747
|
+
* @param options - Per-request options.
|
|
10748
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Body failed validation (`code` missing or empty).
|
|
10749
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session. Also a session that has been signed out (`SESSION_REVOKED`).
|
|
10750
|
+
* @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`).
|
|
10751
|
+
* @throws {NotFoundError} 404 NOT_FOUND, INVITE_INVALID: Invite code not found (`INVITE_INVALID`).
|
|
10752
|
+
* @throws {ConflictError} 409 CONFLICT, ALREADY_A_MEMBER: Caller is already a member of this workspace (`ALREADY_A_MEMBER`).
|
|
10753
|
+
* @throws {APIError} 410 GONE, INVITE_REVOKED, INVITE_EXPIRED, INVITE_EXHAUSTED: Invite revoked (`INVITE_REVOKED`), expired (`INVITE_EXPIRED`) or out of uses (`INVITE_EXHAUSTED`).
|
|
10754
|
+
* @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.
|
|
10755
|
+
* @see POST /v1/workspaces/invites/accept
|
|
10756
|
+
* @see https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-invites-accept
|
|
10757
|
+
* @example
|
|
10758
|
+
* ```ts
|
|
10759
|
+
* const workspace = await platform.workspaces.invites.accept({ code: "inv_…" });
|
|
10760
|
+
* ```
|
|
10761
|
+
*/
|
|
10762
|
+
accept(params: WorkspaceInviteAcceptParams, options?: RequestOptions): APIPromise<WithLastResponse<Workspace>>;
|
|
10763
|
+
/**
|
|
10764
|
+
* Create a workspace invite link. Cookie/JWT only — invites bring new humans into the workspace.
|
|
10765
|
+
*
|
|
10766
|
+
* @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.
|
|
10767
|
+
* @param params - `PlatformAuth.WorkspaceInviteCreateParams`.
|
|
10768
|
+
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
10769
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Body failed validation.
|
|
10770
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session. Also a session that has been signed out (`SESSION_REVOKED`).
|
|
10771
|
+
* @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`).
|
|
10772
|
+
* @throws {NotFoundError} 404 NOT_FOUND, ROLE_NOT_FOUND: Workspace not found, or role not found in this workspace (`ROLE_NOT_FOUND`).
|
|
10773
|
+
* @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).
|
|
10774
|
+
* @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.
|
|
10775
|
+
* @see POST /v1/workspaces/{workspace_slug}/invites
|
|
10776
|
+
* @see https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-workspace-slug-invites
|
|
10777
|
+
* @example
|
|
10778
|
+
* ```ts
|
|
10779
|
+
* const workspaceInvite = await platform.workspaces.invites.create("workspace", { email: "alice@example.com" });
|
|
10780
|
+
* ```
|
|
10781
|
+
*/
|
|
10782
|
+
create(workspaceSlug: string, params?: WorkspaceInviteCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<WorkspaceInvite>>;
|
|
10783
|
+
/**
|
|
10784
|
+
* Revoke a workspace invite. Cookie/JWT only.
|
|
10785
|
+
*
|
|
10786
|
+
* @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.
|
|
10787
|
+
* @param inviteId - Id of the invite.
|
|
10788
|
+
* @param options - Per-request options.
|
|
10789
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session. Also a session that has been signed out (`SESSION_REVOKED`).
|
|
10790
|
+
* @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`.
|
|
10791
|
+
* @throws {NotFoundError} 404 NOT_FOUND, INVITE_NOT_FOUND: Workspace not found, or invite not found (`INVITE_NOT_FOUND`).
|
|
10792
|
+
* @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.
|
|
10793
|
+
* @see DELETE /v1/workspaces/{workspace_slug}/invites/{invite_id}
|
|
10794
|
+
* @see https://productcraft.co/docs/platform/api-reference#delete-v1-workspaces-workspace-slug-invites-invite-id
|
|
10795
|
+
* @example
|
|
10796
|
+
* ```ts
|
|
10797
|
+
* await platform.workspaces.invites.delete("workspace", "invite");
|
|
10798
|
+
* ```
|
|
10799
|
+
*/
|
|
10800
|
+
delete(workspaceSlug: string, inviteId: string, options?: RequestOptions): APIPromise<void>;
|
|
10801
|
+
/**
|
|
10802
|
+
* List workspace invites, newest first. Cursor-paginated.
|
|
10803
|
+
*
|
|
10804
|
+
* @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.
|
|
10805
|
+
* @param params - `PlatformAuth.WorkspaceInviteListParams`.
|
|
10806
|
+
* @param options - Per-request options.
|
|
10807
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`.
|
|
10808
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid session.
|
|
10809
|
+
* @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.member.invite`.
|
|
10810
|
+
* @throws {NotFoundError} 404 NOT_FOUND: Workspace not found (unknown slug or id).
|
|
10811
|
+
* @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.
|
|
10812
|
+
* @see GET /v1/workspaces/{workspace_slug}/invites
|
|
10813
|
+
* @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-invites
|
|
10814
|
+
* @example
|
|
10815
|
+
* ```ts
|
|
10816
|
+
* for await (const invite of platform.workspaces.invites.list("workspace")) {
|
|
10817
|
+
* console.log(invite);
|
|
10818
|
+
* }
|
|
10819
|
+
* const page = await platform.workspaces.invites.list("workspace", {}, { timeout: 5_000 });
|
|
10820
|
+
* ```
|
|
10821
|
+
*/
|
|
10822
|
+
list(workspaceSlug: string, params?: WorkspaceInviteListParams, options?: RequestOptions): PagePromise<WorkspaceInviteListItem>;
|
|
10823
|
+
}
|
|
10824
|
+
/** `workspaces.members` */
|
|
10825
|
+
declare class WorkspacesMembersResource extends APIResource {
|
|
10826
|
+
/**
|
|
10827
|
+
* Remove a member from a workspace (or self-leave)
|
|
10828
|
+
*
|
|
10829
|
+
* @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.
|
|
10830
|
+
* @param accountId - Id of the account.
|
|
10831
|
+
* @param options - Per-request options.
|
|
10832
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session. Also a session that has been signed out (`SESSION_REVOKED`).
|
|
10833
|
+
* @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).
|
|
10834
|
+
* @throws {NotFoundError} 404 NOT_FOUND, NOT_A_MEMBER: Workspace not found, or target account is not a member (`NOT_A_MEMBER`).
|
|
10835
|
+
* @throws {ConflictError} 409 CONFLICT, LAST_MEMBER, SOLE_OWNER: Target is the last member (`LAST_MEMBER`) or the sole owner (`SOLE_OWNER`).
|
|
10836
|
+
* @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.
|
|
10837
|
+
* @see DELETE /v1/workspaces/{workspace_slug}/members/{account_id}
|
|
10838
|
+
* @see https://productcraft.co/docs/platform/api-reference#delete-v1-workspaces-workspace-slug-members-account-id
|
|
10839
|
+
* @example
|
|
10840
|
+
* ```ts
|
|
10841
|
+
* await platform.workspaces.members.delete("workspace", "account");
|
|
10842
|
+
* ```
|
|
10843
|
+
*/
|
|
10844
|
+
delete(workspaceSlug: string, accountId: string, options?: RequestOptions): APIPromise<void>;
|
|
10845
|
+
/**
|
|
10846
|
+
* List workspace members, oldest join first. Narrow with `?q=` (name / username / email substring) and/or `?role=`. Cursor-paginated.
|
|
10847
|
+
*
|
|
10848
|
+
* @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.
|
|
10849
|
+
* @param params - `PlatformAuth.WorkspaceMemberListParams`.
|
|
10850
|
+
* @param options - Per-request options.
|
|
10851
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`.
|
|
10852
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid session.
|
|
10853
|
+
* @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.member.read`.
|
|
10854
|
+
* @throws {NotFoundError} 404 NOT_FOUND: Workspace not found (unknown slug or id).
|
|
10855
|
+
* @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.
|
|
10856
|
+
* @see GET /v1/workspaces/{workspace_slug}/members
|
|
10857
|
+
* @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-members
|
|
10858
|
+
* @example
|
|
10859
|
+
* ```ts
|
|
10860
|
+
* for await (const member of platform.workspaces.members.list("workspace")) {
|
|
10861
|
+
* console.log(member);
|
|
10862
|
+
* }
|
|
10863
|
+
* const page = await platform.workspaces.members.list("workspace", {}, { timeout: 5_000 });
|
|
10864
|
+
* ```
|
|
10865
|
+
*/
|
|
10866
|
+
list(workspaceSlug: string, params?: WorkspaceMemberListParams, options?: RequestOptions): PagePromise<WorkspaceMember>;
|
|
10867
|
+
/**
|
|
10868
|
+
* Update a member's role. Body: { roleId } or { role: "owner"|"admin"|"member" }.
|
|
10869
|
+
*
|
|
10870
|
+
* @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.
|
|
10871
|
+
* @param accountId - Id of the account.
|
|
10872
|
+
* @param params - `PlatformAuth.WorkspaceMemberUpdateRoleParams`.
|
|
10873
|
+
* @param options - Per-request options.
|
|
10874
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Body failed validation.
|
|
10875
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session. Also a session that has been signed out (`SESSION_REVOKED`).
|
|
10876
|
+
* @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.
|
|
10877
|
+
* @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`).
|
|
10878
|
+
* @throws {ConflictError} 409 CONFLICT, SOLE_OWNER: Would demote the only owner (`SOLE_OWNER`). Assign another owner first.
|
|
10879
|
+
* @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.
|
|
10880
|
+
* @see PATCH /v1/workspaces/{workspace_slug}/members/{account_id}/role
|
|
10881
|
+
* @see https://productcraft.co/docs/platform/api-reference#patch-v1-workspaces-workspace-slug-members-account-id-role
|
|
10882
|
+
* @example
|
|
10883
|
+
* ```ts
|
|
10884
|
+
* const updateMemberRole = await platform.workspaces.members.updateRole("workspace", "account", { role: "owner" });
|
|
10885
|
+
* ```
|
|
10886
|
+
*/
|
|
10887
|
+
updateRole(workspaceSlug: string, accountId: string, params?: WorkspaceMemberUpdateRoleParams, options?: RequestOptions): APIPromise<WithLastResponse<UpdateMemberRole>>;
|
|
10888
|
+
}
|
|
10889
|
+
/** `workspaces.policies.actions` */
|
|
10890
|
+
declare class WorkspacesPoliciesActionsResource extends APIResource {
|
|
10891
|
+
/**
|
|
10892
|
+
* List every known workspace action (catalog of statement actions).
|
|
10893
|
+
*
|
|
10894
|
+
* @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.
|
|
10895
|
+
* @param options - Per-request options.
|
|
10896
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, malformed or invalid session, or a PAK bearer (this route accepts cookie/JWT sessions only).
|
|
10897
|
+
* @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.policy.read`.
|
|
10898
|
+
* @throws {NotFoundError} 404 NOT_FOUND: Workspace not found (unknown slug or id).
|
|
10899
|
+
* @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.
|
|
10900
|
+
* @see GET /v1/workspaces/{workspace_slug}/policies/actions/catalog
|
|
10901
|
+
* @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-policies-actions-catalog
|
|
10902
|
+
* @example
|
|
10903
|
+
* ```ts
|
|
10904
|
+
* const workspaceActionCatalog = await platform.workspaces.policies.actions.catalog("workspace");
|
|
10905
|
+
* ```
|
|
10906
|
+
*/
|
|
10907
|
+
catalog(workspaceSlug: string, options?: RequestOptions): APIPromise<WithLastResponse<WorkspaceActionCatalog>>;
|
|
10908
|
+
}
|
|
10909
|
+
/** `workspaces.policies` */
|
|
10910
|
+
declare class WorkspacesPoliciesResource extends APIResource {
|
|
10911
|
+
#private;
|
|
10912
|
+
get actions(): WorkspacesPoliciesActionsResource;
|
|
10913
|
+
/**
|
|
10914
|
+
* Create a managed policy. Cookie/JWT only — policy authoring is a human-admin surface.
|
|
10915
|
+
*
|
|
10916
|
+
* @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.
|
|
10917
|
+
* @param params - `PlatformAuth.WorkspacePolicyCreateParams`.
|
|
10918
|
+
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
10919
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid policy shape, name, or condition block.
|
|
10920
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session, or a session that has been signed out (`SESSION_REVOKED`).
|
|
10921
|
+
* @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.
|
|
10922
|
+
* @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).
|
|
10923
|
+
* @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.
|
|
10924
|
+
* @see POST /v1/workspaces/{workspace_slug}/policies
|
|
10925
|
+
* @see https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-workspace-slug-policies
|
|
10926
|
+
* @example
|
|
10927
|
+
* ```ts
|
|
10928
|
+
* const managedPolicy = await platform.workspaces.policies.create("workspace", {
|
|
10929
|
+
* name: "mail-readonly",
|
|
10930
|
+
* policy: [{ actions: ["mail.read", "mail.list"], effect: "allow", resources: ["*"] }],
|
|
10931
|
+
* });
|
|
10932
|
+
* ```
|
|
10933
|
+
*/
|
|
10934
|
+
create(workspaceSlug: string, params: WorkspacePolicyCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<ManagedPolicy>>;
|
|
10935
|
+
/**
|
|
10936
|
+
* 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.
|
|
10937
|
+
*
|
|
10938
|
+
* @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.
|
|
10939
|
+
* @param policyId - Id of the policy.
|
|
10940
|
+
* @param options - Per-request options.
|
|
10941
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session, or a session that has been signed out (`SESSION_REVOKED`).
|
|
10942
|
+
* @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`).
|
|
10943
|
+
* @throws {NotFoundError} 404 NOT_FOUND, POLICY_NOT_FOUND: Policy not found in this workspace (`POLICY_NOT_FOUND`).
|
|
10944
|
+
* @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.
|
|
10945
|
+
* @see DELETE /v1/workspaces/{workspace_slug}/policies/{policy_id}
|
|
10946
|
+
* @see https://productcraft.co/docs/platform/api-reference#delete-v1-workspaces-workspace-slug-policies-policy-id
|
|
10947
|
+
* @example
|
|
10948
|
+
* ```ts
|
|
10949
|
+
* const managedPolicyDeleted = await platform.workspaces.policies.delete("workspace", "5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6");
|
|
10950
|
+
* ```
|
|
10951
|
+
*/
|
|
10952
|
+
delete(workspaceSlug: string, policyId: string, options?: RequestOptions): APIPromise<WithLastResponse<ManagedPolicyDeleted>>;
|
|
10953
|
+
/**
|
|
10954
|
+
* List managed policies in a workspace, alphabetically. 20/page (max 100), cursor-paginated.
|
|
10955
|
+
*
|
|
10956
|
+
* @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.
|
|
10957
|
+
* @param params - `PlatformAuth.WorkspacePolicyListParams`.
|
|
10958
|
+
* @param options - Per-request options.
|
|
10959
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`.
|
|
10960
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
10961
|
+
* @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.
|
|
10962
|
+
* @see GET /v1/workspaces/{workspace_slug}/policies
|
|
10963
|
+
* @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-policies
|
|
10964
|
+
* @example
|
|
10965
|
+
* ```ts
|
|
10966
|
+
* for await (const policy of platform.workspaces.policies.list("workspace")) {
|
|
10967
|
+
* console.log(policy);
|
|
10968
|
+
* }
|
|
10969
|
+
* const page = await platform.workspaces.policies.list("workspace", {}, { timeout: 5_000 });
|
|
10970
|
+
* ```
|
|
10971
|
+
*/
|
|
10972
|
+
list(workspaceSlug: string, params?: WorkspacePolicyListParams, options?: RequestOptions): PagePromise<ManagedPolicy>;
|
|
10973
|
+
/**
|
|
10974
|
+
* Get a managed policy by id
|
|
10975
|
+
*
|
|
10976
|
+
* @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.
|
|
10977
|
+
* @param policyId - Id of the policy.
|
|
10978
|
+
* @param options - Per-request options.
|
|
10979
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
10980
|
+
* @throws {NotFoundError} 404 NOT_FOUND: Policy not found in this workspace.
|
|
10981
|
+
* @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.
|
|
10982
|
+
* @see GET /v1/workspaces/{workspace_slug}/policies/{policy_id}
|
|
10983
|
+
* @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-policies-policy-id
|
|
10984
|
+
* @example
|
|
10985
|
+
* ```ts
|
|
10986
|
+
* const managedPolicyDetail = await platform.workspaces.policies.retrieve("workspace", "5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6");
|
|
10987
|
+
* ```
|
|
10988
|
+
*/
|
|
10989
|
+
retrieve(workspaceSlug: string, policyId: string, options?: RequestOptions): APIPromise<WithLastResponse<ManagedPolicyDetail>>;
|
|
10990
|
+
/**
|
|
10991
|
+
* 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.
|
|
10992
|
+
*
|
|
10993
|
+
* @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.
|
|
10994
|
+
* @param policyId - Id of the policy.
|
|
10995
|
+
* @param params - `PlatformAuth.WorkspacePolicyUpdateParams`.
|
|
10996
|
+
* @param options - Per-request options.
|
|
10997
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid policy shape, name, or condition block.
|
|
10998
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session, or a session that has been signed out (`SESSION_REVOKED`).
|
|
10999
|
+
* @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`).
|
|
11000
|
+
* @throws {NotFoundError} 404 NOT_FOUND, POLICY_NOT_FOUND: Policy not found in this workspace (`POLICY_NOT_FOUND`).
|
|
11001
|
+
* @throws {ConflictError} 409 CONFLICT, POLICY_NAME_TAKEN: Name already in use (`POLICY_NAME_TAKEN`).
|
|
11002
|
+
* @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.
|
|
11003
|
+
* @see PATCH /v1/workspaces/{workspace_slug}/policies/{policy_id}
|
|
11004
|
+
* @see https://productcraft.co/docs/platform/api-reference#patch-v1-workspaces-workspace-slug-policies-policy-id
|
|
11005
|
+
* @example
|
|
11006
|
+
* ```ts
|
|
11007
|
+
* const managedPolicyDetail = await platform.workspaces.policies.update("workspace", "5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6", { description: "Read-only access to all Mail resources" });
|
|
11008
|
+
* ```
|
|
11009
|
+
*/
|
|
11010
|
+
update(workspaceSlug: string, policyId: string, params?: WorkspacePolicyUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<ManagedPolicyDetail>>;
|
|
11011
|
+
}
|
|
11012
|
+
/** `workspaces.roles` */
|
|
11013
|
+
declare class WorkspacesRolesResource extends APIResource {
|
|
11014
|
+
/**
|
|
11015
|
+
* Create a new custom role. Cookie/JWT only — role authoring is a human-admin surface.
|
|
11016
|
+
*
|
|
11017
|
+
* @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.
|
|
11018
|
+
* @param params - `PlatformAuth.WorkspaceRoleCreateParams`.
|
|
11019
|
+
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
11020
|
+
* @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`).
|
|
11021
|
+
* @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`).
|
|
11022
|
+
* @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`).
|
|
11023
|
+
* @throws {NotFoundError} 404 NOT_FOUND, POLICY_NOT_FOUND: Workspace not found, or `policy_id` not found in this workspace (`POLICY_NOT_FOUND`).
|
|
11024
|
+
* @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).
|
|
11025
|
+
* @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.
|
|
11026
|
+
* @see POST /v1/workspaces/{workspace_slug}/roles
|
|
11027
|
+
* @see https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-workspace-slug-roles
|
|
11028
|
+
* @example
|
|
11029
|
+
* ```ts
|
|
11030
|
+
* const workspaceRole = await platform.workspaces.roles.create("workspace", { name: "BillingAdmin" });
|
|
11031
|
+
* ```
|
|
11032
|
+
*/
|
|
11033
|
+
create(workspaceSlug: string, params: WorkspaceRoleCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<WorkspaceRole>>;
|
|
11034
|
+
/**
|
|
11035
|
+
* Delete a custom role (fails if it has members). Cookie/JWT only — role authoring is a human-admin surface.
|
|
11036
|
+
*
|
|
11037
|
+
* @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.
|
|
11038
|
+
* @param roleId - Id of the role.
|
|
11039
|
+
* @param options - Per-request options.
|
|
11040
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `roleId` is not a UUID.
|
|
11041
|
+
* @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`).
|
|
11042
|
+
* @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.role.delete`.
|
|
11043
|
+
* @throws {NotFoundError} 404 NOT_FOUND, ROLE_NOT_FOUND: Workspace not found, or role not found in this workspace (`ROLE_NOT_FOUND`).
|
|
11044
|
+
* @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`).
|
|
11045
|
+
* @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.
|
|
11046
|
+
* @see DELETE /v1/workspaces/{workspace_slug}/roles/{role_id}
|
|
11047
|
+
* @see https://productcraft.co/docs/platform/api-reference#delete-v1-workspaces-workspace-slug-roles-role-id
|
|
11048
|
+
* @example
|
|
11049
|
+
* ```ts
|
|
11050
|
+
* await platform.workspaces.roles.delete("workspace", "5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6");
|
|
11051
|
+
* ```
|
|
11052
|
+
*/
|
|
11053
|
+
delete(workspaceSlug: string, roleId: string, options?: RequestOptions): APIPromise<void>;
|
|
11054
|
+
/**
|
|
11055
|
+
* List roles in a workspace. System roles first, then alphabetical. 20/page (max 100), cursor-paginated.
|
|
11056
|
+
*
|
|
11057
|
+
* @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.
|
|
11058
|
+
* @param params - `PlatformAuth.WorkspaceRoleListParams`.
|
|
11059
|
+
* @param options - Per-request options.
|
|
11060
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`.
|
|
11061
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
11062
|
+
* @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.
|
|
11063
|
+
* @see GET /v1/workspaces/{workspace_slug}/roles
|
|
11064
|
+
* @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-roles
|
|
11065
|
+
* @example
|
|
11066
|
+
* ```ts
|
|
11067
|
+
* for await (const role of platform.workspaces.roles.list("workspace")) {
|
|
11068
|
+
* console.log(role);
|
|
11069
|
+
* }
|
|
11070
|
+
* const page = await platform.workspaces.roles.list("workspace", {}, { timeout: 5_000 });
|
|
11071
|
+
* ```
|
|
11072
|
+
*/
|
|
11073
|
+
list(workspaceSlug: string, params?: WorkspaceRoleListParams, options?: RequestOptions): PagePromise<WorkspaceRole>;
|
|
11074
|
+
/**
|
|
11075
|
+
* Get a role + its permissions
|
|
11076
|
+
*
|
|
11077
|
+
* @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.
|
|
11078
|
+
* @param roleId - Id of the role.
|
|
11079
|
+
* @param options - Per-request options.
|
|
11080
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `roleId` is not a UUID.
|
|
11081
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, malformed or invalid session, or a PAK bearer (this route accepts cookie/JWT sessions only).
|
|
11082
|
+
* @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.role.read`.
|
|
11083
|
+
* @throws {NotFoundError} 404 NOT_FOUND, ROLE_NOT_FOUND: Workspace not found, or role not found in this workspace (`ROLE_NOT_FOUND`).
|
|
11084
|
+
* @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.
|
|
11085
|
+
* @see GET /v1/workspaces/{workspace_slug}/roles/{role_id}
|
|
11086
|
+
* @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-roles-role-id
|
|
11087
|
+
* @example
|
|
11088
|
+
* ```ts
|
|
11089
|
+
* const workspaceRole = await platform.workspaces.roles.retrieve("workspace", "5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6");
|
|
11090
|
+
* ```
|
|
11091
|
+
*/
|
|
11092
|
+
retrieve(workspaceSlug: string, roleId: string, options?: RequestOptions): APIPromise<WithLastResponse<WorkspaceRole>>;
|
|
11093
|
+
/**
|
|
11094
|
+
* Update a role or replace its permission set. Cookie/JWT only — role authoring is a human-admin surface.
|
|
11095
|
+
*
|
|
11096
|
+
* @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.
|
|
11097
|
+
* @param roleId - Id of the role.
|
|
11098
|
+
* @param params - `PlatformAuth.WorkspaceRoleUpdateParams`.
|
|
11099
|
+
* @param options - Per-request options.
|
|
11100
|
+
* @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.
|
|
11101
|
+
* @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`).
|
|
11102
|
+
* @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`).
|
|
11103
|
+
* @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.
|
|
11104
|
+
* @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`).
|
|
11105
|
+
* @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.
|
|
11106
|
+
* @see PATCH /v1/workspaces/{workspace_slug}/roles/{role_id}
|
|
11107
|
+
* @see https://productcraft.co/docs/platform/api-reference#patch-v1-workspaces-workspace-slug-roles-role-id
|
|
11108
|
+
* @example
|
|
11109
|
+
* ```ts
|
|
11110
|
+
* const workspaceRole = await platform.workspaces.roles.update("workspace", "5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6", { description: "string" });
|
|
11111
|
+
* ```
|
|
11112
|
+
*/
|
|
11113
|
+
update(workspaceSlug: string, roleId: string, params?: WorkspaceRoleUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<WorkspaceRole>>;
|
|
11114
|
+
}
|
|
11115
|
+
/** `workspaces.services` */
|
|
11116
|
+
declare class WorkspacesServicesResource extends APIResource {
|
|
11117
|
+
/**
|
|
11118
|
+
* Disable a service (settings are retained)
|
|
11119
|
+
*
|
|
11120
|
+
* @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.
|
|
11121
|
+
* @param service - The product: `auth`, `mail`, `waitlist`, `social` or `trawl`.
|
|
11122
|
+
* @param options - Per-request options.
|
|
11123
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, SERVICE_UNKNOWN: Unknown service name (`SERVICE_UNKNOWN`).
|
|
11124
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, malformed or invalid session, or a PAK bearer (this route accepts cookie/JWT sessions only).
|
|
11125
|
+
* @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.service.disable`.
|
|
11126
|
+
* @throws {NotFoundError} 404 NOT_FOUND: Workspace not found (unknown slug or id).
|
|
11127
|
+
* @throws {ConflictError} 409 CONFLICT, SERVICE_NOT_ENABLED: Service is not currently enabled (`SERVICE_NOT_ENABLED`).
|
|
11128
|
+
* @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.
|
|
11129
|
+
* @see DELETE /v1/workspaces/{workspace_slug}/services/{service}
|
|
11130
|
+
* @see https://productcraft.co/docs/platform/api-reference#delete-v1-workspaces-workspace-slug-services-service
|
|
11131
|
+
* @example
|
|
11132
|
+
* ```ts
|
|
11133
|
+
* await platform.workspaces.services.disable("workspace", "service");
|
|
11134
|
+
* ```
|
|
11135
|
+
*/
|
|
11136
|
+
disable(workspaceSlug: string, service: string, options?: RequestOptions): APIPromise<void>;
|
|
11137
|
+
/**
|
|
11138
|
+
* Enable (or re-enable) a service for this workspace
|
|
11139
|
+
*
|
|
11140
|
+
* @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.
|
|
11141
|
+
* @param service - The product: `auth`, `mail`, `waitlist`, `social` or `trawl`.
|
|
11142
|
+
* @param params - `PlatformAuth.WorkspaceServiceEnableParams`.
|
|
11143
|
+
* @param options - Per-request options.
|
|
11144
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, SERVICE_UNKNOWN: Unknown service name (`SERVICE_UNKNOWN`) or body failed validation.
|
|
11145
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, malformed or invalid session, or a PAK bearer (this route accepts cookie/JWT sessions only).
|
|
11146
|
+
* @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.service.enable`.
|
|
11147
|
+
* @throws {NotFoundError} 404 NOT_FOUND: Workspace not found (unknown slug or id).
|
|
11148
|
+
* @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.
|
|
11149
|
+
* @see POST /v1/workspaces/{workspace_slug}/services/{service}
|
|
11150
|
+
* @see https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-workspace-slug-services-service
|
|
11151
|
+
* @example
|
|
11152
|
+
* ```ts
|
|
11153
|
+
* const workspaceServiceState = await platform.workspaces.services.enable("workspace", "service", { settings: {} });
|
|
11154
|
+
* ```
|
|
11155
|
+
*/
|
|
11156
|
+
enable(workspaceSlug: string, service: string, params?: WorkspaceServiceEnableParams, options?: RequestOptions): APIPromise<WithLastResponse<WorkspaceServiceState>>;
|
|
11157
|
+
/**
|
|
11158
|
+
* List services activated on this workspace. Complete — one row per product, not paginated.
|
|
11159
|
+
*
|
|
11160
|
+
* @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.
|
|
11161
|
+
* @param options - Per-request options.
|
|
11162
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, malformed or invalid session, or a PAK bearer (this route accepts cookie/JWT sessions only).
|
|
11163
|
+
* @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.service.read`.
|
|
11164
|
+
* @throws {NotFoundError} 404 NOT_FOUND: Workspace not found (unknown slug or id).
|
|
11165
|
+
* @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.
|
|
11166
|
+
* @see GET /v1/workspaces/{workspace_slug}/services
|
|
11167
|
+
* @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-services
|
|
11168
|
+
* @example
|
|
11169
|
+
* ```ts
|
|
11170
|
+
* const listWorkspaceServices = await platform.workspaces.services.list("workspace");
|
|
11171
|
+
* ```
|
|
11172
|
+
*/
|
|
11173
|
+
list(workspaceSlug: string, options?: RequestOptions): APIPromise<WithLastResponse<ListWorkspaceServices>>;
|
|
11174
|
+
/**
|
|
11175
|
+
* Replace the settings jsonb for an active service
|
|
11176
|
+
*
|
|
11177
|
+
* @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.
|
|
11178
|
+
* @param service - The product: `auth`, `mail`, `waitlist`, `social` or `trawl`.
|
|
11179
|
+
* @param params - `PlatformAuth.WorkspaceServiceUpdateSettingsParams`.
|
|
11180
|
+
* @param options - Per-request options.
|
|
11181
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, SERVICE_UNKNOWN: Unknown service name (`SERVICE_UNKNOWN`).
|
|
11182
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, malformed or invalid session, or a PAK bearer (this route accepts cookie/JWT sessions only).
|
|
11183
|
+
* @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`), or lacks `workspace.service.enable`.
|
|
11184
|
+
* @throws {NotFoundError} 404 NOT_FOUND, SERVICE_NOT_ACTIVATED: Workspace not found, or the service was never activated on it (`SERVICE_NOT_ACTIVATED`).
|
|
11185
|
+
* @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.
|
|
11186
|
+
* @see PATCH /v1/workspaces/{workspace_slug}/services/{service}/settings
|
|
11187
|
+
* @see https://productcraft.co/docs/platform/api-reference#patch-v1-workspaces-workspace-slug-services-service-settings
|
|
11188
|
+
* @example
|
|
11189
|
+
* ```ts
|
|
11190
|
+
* const workspaceServiceState = await platform.workspaces.services.updateSettings("workspace", "service", { default_sender: "noreply@acme.com" });
|
|
11191
|
+
* ```
|
|
11192
|
+
*/
|
|
11193
|
+
updateSettings(workspaceSlug: string, service: string, params?: WorkspaceServiceUpdateSettingsParams, options?: RequestOptions): APIPromise<WithLastResponse<WorkspaceServiceState>>;
|
|
11194
|
+
}
|
|
11195
|
+
/** `workspaces` */
|
|
11196
|
+
declare class WorkspacesResource extends APIResource {
|
|
11197
|
+
#private;
|
|
11198
|
+
get apiKeys(): WorkspacesApiKeysResource;
|
|
11199
|
+
get auditFeed(): WorkspacesAuditFeedResource;
|
|
11200
|
+
get auditLogs(): WorkspacesAuditLogsResource;
|
|
11201
|
+
get avatar(): WorkspacesAvatarResource;
|
|
11202
|
+
get invites(): WorkspacesInvitesResource;
|
|
11203
|
+
get members(): WorkspacesMembersResource;
|
|
11204
|
+
get policies(): WorkspacesPoliciesResource;
|
|
11205
|
+
get roles(): WorkspacesRolesResource;
|
|
11206
|
+
get services(): WorkspacesServicesResource;
|
|
11207
|
+
/**
|
|
11208
|
+
* Create a new workspace. Cookie/JWT only — PAKs are workspace-scoped credentials and cannot create new workspaces.
|
|
11209
|
+
*
|
|
11210
|
+
* @param params - `PlatformAuth.WorkspaceCreateParams`.
|
|
11211
|
+
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
11212
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
11213
|
+
* @throws {PermissionDeniedError} 403 FORBIDDEN: Caller is a PAK (`pcft_live_*`). Workspace creation requires a human-issued session.
|
|
11214
|
+
* @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).
|
|
11215
|
+
* @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.
|
|
11216
|
+
* @see POST /v1/workspaces
|
|
11217
|
+
* @see https://productcraft.co/docs/platform/api-reference#post-v1-workspaces
|
|
11218
|
+
* @example
|
|
11219
|
+
* ```ts
|
|
11220
|
+
* const workspace = await platform.workspaces.create({ display_name: "Acme Corp", slug: "acme-corp" });
|
|
11221
|
+
* ```
|
|
11222
|
+
*/
|
|
11223
|
+
create(params: WorkspaceCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<Workspace>>;
|
|
11224
|
+
/**
|
|
11225
|
+
* Delete a workspace (requires workspace.delete). Cookie/JWT only — irreversible workspace destruction needs a human-attributed audit row.
|
|
11226
|
+
*
|
|
11227
|
+
* @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.
|
|
11228
|
+
* @param options - Per-request options.
|
|
11229
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED, SESSION_REVOKED: Missing or invalid session, or a session that has been signed out (`SESSION_REVOKED`).
|
|
11230
|
+
* @throws {PermissionDeniedError} 403 FORBIDDEN: Caller is a PAK (`pcft_live_*`). Workspace deletion requires a human-issued session.
|
|
11231
|
+
* @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.
|
|
11232
|
+
* @see DELETE /v1/workspaces/{workspace_slug}
|
|
11233
|
+
* @see https://productcraft.co/docs/platform/api-reference#delete-v1-workspaces-workspace-slug
|
|
11234
|
+
* @example
|
|
11235
|
+
* ```ts
|
|
11236
|
+
* await platform.workspaces.delete("workspace");
|
|
11237
|
+
* ```
|
|
11238
|
+
*/
|
|
11239
|
+
delete(workspaceSlug: string, options?: RequestOptions): APIPromise<void>;
|
|
11240
|
+
/**
|
|
11241
|
+
* List workspaces the current user belongs to
|
|
11242
|
+
*
|
|
11243
|
+
* @param params - `PlatformAuth.WorkspaceListParams`.
|
|
11244
|
+
* @param options - Per-request options.
|
|
11245
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`.
|
|
11246
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid session.
|
|
11247
|
+
* @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.
|
|
11248
|
+
* @see GET /v1/workspaces
|
|
11249
|
+
* @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces
|
|
11250
|
+
* @example
|
|
11251
|
+
* ```ts
|
|
11252
|
+
* for await (const workspace of platform.workspaces.list()) {
|
|
11253
|
+
* console.log(workspace);
|
|
11254
|
+
* }
|
|
11255
|
+
* const page = await platform.workspaces.list({}, { timeout: 5_000 });
|
|
11256
|
+
* ```
|
|
11257
|
+
*/
|
|
11258
|
+
list(params?: WorkspaceListParams, options?: RequestOptions): PagePromise<WorkspaceListItem>;
|
|
11259
|
+
/**
|
|
11260
|
+
* Get workspace details
|
|
11261
|
+
*
|
|
11262
|
+
* @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.
|
|
11263
|
+
* @param options - Per-request options.
|
|
11264
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid session.
|
|
11265
|
+
* @throws {PermissionDeniedError} 403 FORBIDDEN, NOT_A_MEMBER: Caller is not a member of this workspace (`NOT_A_MEMBER`).
|
|
11266
|
+
* @throws {NotFoundError} 404 NOT_FOUND: Workspace not found (unknown slug or id).
|
|
11267
|
+
* @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.
|
|
11268
|
+
* @see GET /v1/workspaces/{workspace_slug}
|
|
11269
|
+
* @see https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug
|
|
11270
|
+
* @example
|
|
11271
|
+
* ```ts
|
|
11272
|
+
* const workspace = await platform.workspaces.retrieve("workspace");
|
|
11273
|
+
* ```
|
|
11274
|
+
*/
|
|
11275
|
+
retrieve(workspaceSlug: string, options?: RequestOptions): APIPromise<WithLastResponse<Workspace>>;
|
|
11276
|
+
/**
|
|
11277
|
+
* Update workspace display name, slug, or settings. Slug renames broadcast a `workspace.renamed` event so denormalised consumers (waitlist-api) sync.
|
|
11278
|
+
*
|
|
11279
|
+
* @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.
|
|
11280
|
+
* @param params - `PlatformAuth.WorkspaceUpdateParams`.
|
|
11281
|
+
* @param options - Per-request options.
|
|
11282
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid slug or display name.
|
|
11283
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
11284
|
+
* @throws {NotFoundError} 404 NOT_FOUND: Workspace not found.
|
|
11285
|
+
* @throws {ConflictError} 409 CONFLICT: Slug already taken by another workspace.
|
|
11286
|
+
* @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.
|
|
11287
|
+
* @see PATCH /v1/workspaces/{workspace_slug}
|
|
11288
|
+
* @see https://productcraft.co/docs/platform/api-reference#patch-v1-workspaces-workspace-slug
|
|
11289
|
+
* @example
|
|
11290
|
+
* ```ts
|
|
11291
|
+
* const workspace = await platform.workspaces.update("workspace", { display_name: "string" });
|
|
11292
|
+
* ```
|
|
11293
|
+
*/
|
|
11294
|
+
update(workspaceSlug: string, params?: WorkspaceUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<Workspace>>;
|
|
11295
|
+
}
|
|
11296
|
+
/** `platform` */
|
|
11297
|
+
declare class PlatformAuthResources extends APIResource {
|
|
11298
|
+
#private;
|
|
11299
|
+
get account(): AccountResource;
|
|
11300
|
+
get apiKeys(): ApiKeysResource;
|
|
11301
|
+
get auth(): AuthResource;
|
|
11302
|
+
get introspect(): IntrospectResource;
|
|
11303
|
+
get me(): MeResource;
|
|
11304
|
+
get oauth(): OauthResource;
|
|
11305
|
+
get sessions(): SessionsResource;
|
|
11306
|
+
get stats(): StatsResource;
|
|
11307
|
+
get verification(): VerificationResource;
|
|
11308
|
+
get wellKnown(): WellKnownResource;
|
|
11309
|
+
get workspaces(): WorkspacesResource;
|
|
11310
|
+
}
|
|
11311
|
+
|
|
11312
|
+
type __RequestOptions = RequestOptions;
|
|
11313
|
+
type __PollOptions = PollOptions;
|
|
11314
|
+
type __ApiKeyPresetKey = ApiKeyPresetKey;
|
|
11315
|
+
type __ApiKeyStatus = ApiKeyStatus;
|
|
11316
|
+
type __AuditActorType = AuditActorType;
|
|
11317
|
+
type __AuditFeedSource = AuditFeedSource;
|
|
11318
|
+
type __McpProduct = McpProduct;
|
|
11319
|
+
type __PolicyEffect = PolicyEffect;
|
|
11320
|
+
type __StatsGranularity = StatsGranularity;
|
|
11321
|
+
type __StatsMetric = StatsMetric;
|
|
11322
|
+
type __StatsWindow = StatsWindow;
|
|
11323
|
+
type __ApiKeySelf = ApiKeySelf;
|
|
11324
|
+
type __ApiKeySelfWorkspace = ApiKeySelfWorkspace;
|
|
11325
|
+
type __AuditFeed = AuditFeed;
|
|
11326
|
+
type __AuthorizationServerMetadata = AuthorizationServerMetadata;
|
|
11327
|
+
type __AvatarUrl = AvatarUrl;
|
|
11328
|
+
type __BoundPolicySummary = BoundPolicySummary;
|
|
11329
|
+
type __ConnectedClient = ConnectedClient;
|
|
11330
|
+
type __ConnectedClientList = ConnectedClientList;
|
|
11331
|
+
type __FeedItem = FeedItem;
|
|
11332
|
+
type __Feedback = Feedback;
|
|
11333
|
+
type __HiddenGuide = HiddenGuide;
|
|
11334
|
+
type __HiddenGuides = HiddenGuides;
|
|
11335
|
+
type __IntrospectAccount = IntrospectAccount;
|
|
11336
|
+
type __IntrospectApiKey = IntrospectApiKey;
|
|
11337
|
+
type __IntrospectPrincipal = IntrospectPrincipal;
|
|
11338
|
+
type __Introspect = Introspect;
|
|
11339
|
+
type __IntrospectRole = IntrospectRole;
|
|
11340
|
+
type __IntrospectWorkspaceListItem = IntrospectWorkspaceListItem;
|
|
11341
|
+
type __IntrospectWorkspace = IntrospectWorkspace;
|
|
11342
|
+
type __Jwk = Jwk;
|
|
11343
|
+
type __Jwks = Jwks;
|
|
11344
|
+
type __ListManagedPolicies = ListManagedPolicies;
|
|
11345
|
+
type __ListPakPresets = ListPakPresets;
|
|
11346
|
+
type __ListPlatformApiKeys = ListPlatformApiKeys;
|
|
11347
|
+
type __ListWorkspaceAuditLogs = ListWorkspaceAuditLogs;
|
|
11348
|
+
type __ListWorkspaceInvites = ListWorkspaceInvites;
|
|
11349
|
+
type __ListWorkspaceMembers = ListWorkspaceMembers;
|
|
11350
|
+
type __ListWorkspaceRoles = ListWorkspaceRoles;
|
|
11351
|
+
type __ListWorkspaceServices = ListWorkspaceServices;
|
|
11352
|
+
type __ListWorkspaces = ListWorkspaces;
|
|
11353
|
+
type __ManagedPolicyDeleted = ManagedPolicyDeleted;
|
|
11354
|
+
type __ManagedPolicyDetail = ManagedPolicyDetail;
|
|
11355
|
+
type __ManagedPolicy = ManagedPolicy;
|
|
11356
|
+
type __MeProfile = MeProfile;
|
|
11357
|
+
type __MintPak = MintPak;
|
|
11358
|
+
type __Pagination = Pagination;
|
|
11359
|
+
type __PakGrantPreview = PakGrantPreview;
|
|
11360
|
+
type __PakPreset = PakPreset;
|
|
11361
|
+
type __PolicyBindingCount = PolicyBindingCount;
|
|
11362
|
+
type __PolicyStatement = PolicyStatement;
|
|
11363
|
+
type __PublicApiKey = PublicApiKey;
|
|
11364
|
+
type __RevokeOtherSessions = RevokeOtherSessions;
|
|
11365
|
+
type __RevokeSession = RevokeSession;
|
|
11366
|
+
type __RotatePak = RotatePak;
|
|
11367
|
+
type __Session = Session;
|
|
11368
|
+
type __SourceDiagnostic = SourceDiagnostic;
|
|
11369
|
+
type __StatsSeriesPoint = StatsSeriesPoint;
|
|
11370
|
+
type __Token = Token;
|
|
11371
|
+
type __UpdateMemberRole = UpdateMemberRole;
|
|
11372
|
+
type __WorkspaceActionCatalog = WorkspaceActionCatalog;
|
|
11373
|
+
type __WorkspaceAuditLogEntry = WorkspaceAuditLogEntry;
|
|
11374
|
+
type __WorkspaceAvatarUrl = WorkspaceAvatarUrl;
|
|
11375
|
+
type __WorkspaceInviteListItem = WorkspaceInviteListItem;
|
|
11376
|
+
type __WorkspaceInvite = WorkspaceInvite;
|
|
11377
|
+
type __WorkspaceListItem = WorkspaceListItem;
|
|
11378
|
+
type __WorkspaceMember = WorkspaceMember;
|
|
11379
|
+
type __Workspace = Workspace;
|
|
11380
|
+
type __WorkspaceRole = WorkspaceRole;
|
|
11381
|
+
type __WorkspaceServiceState = WorkspaceServiceState;
|
|
11382
|
+
type __WorkspaceStats = WorkspaceStats;
|
|
11383
|
+
type __WorkspaceStatsInWindow = WorkspaceStatsInWindow;
|
|
11384
|
+
type __WorkspaceStatsSeries = WorkspaceStatsSeries;
|
|
11385
|
+
type __WorkspaceStatsTotals = WorkspaceStatsTotals;
|
|
11386
|
+
type __AuthLogoutParams = AuthLogoutParams;
|
|
11387
|
+
type __AuthPasswordRequestResetParams = AuthPasswordRequestResetParams;
|
|
11388
|
+
type __AuthPasswordResetParams = AuthPasswordResetParams;
|
|
11389
|
+
type __AuthRefreshParams = AuthRefreshParams;
|
|
11390
|
+
type __AuthSigninParams = AuthSigninParams;
|
|
11391
|
+
type __AuthSignupParams = AuthSignupParams;
|
|
11392
|
+
type __MeAvatarUploadParams = MeAvatarUploadParams;
|
|
11393
|
+
type __MeProfileUpdateParams = MeProfileUpdateParams;
|
|
11394
|
+
type __OauthConnectionListParams = OauthConnectionListParams;
|
|
11395
|
+
type __OauthWorkspaceConnectionListParams = OauthWorkspaceConnectionListParams;
|
|
11396
|
+
type __SessionListResponse = SessionListResponse;
|
|
11397
|
+
type __VerificationVerifyParams = VerificationVerifyParams;
|
|
11398
|
+
type __WorkspaceListParams = WorkspaceListParams;
|
|
11399
|
+
type __WorkspaceCreateParams = WorkspaceCreateParams;
|
|
11400
|
+
type __WorkspaceInviteAcceptParams = WorkspaceInviteAcceptParams;
|
|
11401
|
+
type __StatsRetrieveParams = StatsRetrieveParams;
|
|
11402
|
+
type __WorkspaceUpdateParams = WorkspaceUpdateParams;
|
|
11403
|
+
type __WorkspaceApiKeyListParams = WorkspaceApiKeyListParams;
|
|
11404
|
+
type __WorkspaceApiKeyCreateParams = WorkspaceApiKeyCreateParams;
|
|
11405
|
+
type __WorkspaceApiKeyPreviewParams = WorkspaceApiKeyPreviewParams;
|
|
11406
|
+
type __WorkspaceApiKeyUpdateParams = WorkspaceApiKeyUpdateParams;
|
|
11407
|
+
type __WorkspaceApiKeyDeleteParams = WorkspaceApiKeyDeleteParams;
|
|
11408
|
+
type __WorkspaceApiKeyUpdateBindingsParams = WorkspaceApiKeyUpdateBindingsParams;
|
|
11409
|
+
type __WorkspaceApiKeyRotateParams = WorkspaceApiKeyRotateParams;
|
|
11410
|
+
type __WorkspaceAuditFeedListParams = WorkspaceAuditFeedListParams;
|
|
11411
|
+
type __WorkspaceAuditLogListParams = WorkspaceAuditLogListParams;
|
|
11412
|
+
type __WorkspaceAuditLogExportParams = WorkspaceAuditLogExportParams;
|
|
11413
|
+
type __WorkspaceAvatarUploadParams = WorkspaceAvatarUploadParams;
|
|
11414
|
+
type __WorkspaceInviteListParams = WorkspaceInviteListParams;
|
|
11415
|
+
type __WorkspaceInviteCreateParams = WorkspaceInviteCreateParams;
|
|
11416
|
+
type __WorkspaceMemberListParams = WorkspaceMemberListParams;
|
|
11417
|
+
type __WorkspaceMemberUpdateRoleParams = WorkspaceMemberUpdateRoleParams;
|
|
11418
|
+
type __WorkspacePolicyListParams = WorkspacePolicyListParams;
|
|
11419
|
+
type __WorkspacePolicyCreateParams = WorkspacePolicyCreateParams;
|
|
11420
|
+
type __WorkspacePolicyUpdateParams = WorkspacePolicyUpdateParams;
|
|
11421
|
+
type __WorkspaceRoleListParams = WorkspaceRoleListParams;
|
|
11422
|
+
type __WorkspaceRoleCreateParams = WorkspaceRoleCreateParams;
|
|
11423
|
+
type __WorkspaceRoleUpdateParams = WorkspaceRoleUpdateParams;
|
|
11424
|
+
type __WorkspaceServiceEnableParams = WorkspaceServiceEnableParams;
|
|
11425
|
+
type __WorkspaceServiceUpdateSettingsParams = WorkspaceServiceUpdateSettingsParams;
|
|
11426
|
+
type __ErrorCode = PlatformAuthErrorCode;
|
|
9622
11427
|
/**
|
|
9623
|
-
*
|
|
9624
|
-
*
|
|
9625
|
-
*
|
|
9626
|
-
*
|
|
11428
|
+
* ProductCraft Platform API client (workspaces, members, roles, policies, API keys and introspection). Every method is generated from the API's OpenAPI document.
|
|
11429
|
+
*
|
|
11430
|
+
* @example
|
|
11431
|
+
* ```ts
|
|
11432
|
+
* import { PlatformAuth } from "@productcraft/platform-auth";
|
|
11433
|
+
* const platform = new PlatformAuth({ apiKey: process.env.PRODUCTCRAFT_API_KEY });
|
|
11434
|
+
* ```
|
|
9627
11435
|
*/
|
|
9628
|
-
declare class PlatformAuth {
|
|
9629
|
-
|
|
9630
|
-
|
|
9631
|
-
|
|
11436
|
+
declare class PlatformAuth extends PlatformAuthResources {
|
|
11437
|
+
#private;
|
|
11438
|
+
constructor(options?: ClientOptions);
|
|
11439
|
+
/** The typed `openapi-fetch` escape hatch over the same credential and base URL. It does not retry. */
|
|
11440
|
+
get client(): Client<paths>;
|
|
11441
|
+
}
|
|
11442
|
+
/** Public types: `PlatformAuth.ApiKeySelf`, `PlatformAuth.AuthLogoutParams`, … */
|
|
11443
|
+
declare namespace PlatformAuth {
|
|
11444
|
+
type RequestOptions = __RequestOptions;
|
|
11445
|
+
type PollOptions = __PollOptions;
|
|
11446
|
+
type ApiKeyPresetKey = __ApiKeyPresetKey;
|
|
11447
|
+
const ApiKeyPresetKey: {
|
|
11448
|
+
values: readonly ["mail-send", "waitlist-write", "trawl-jobs", "readonly", "full"];
|
|
11449
|
+
};
|
|
11450
|
+
type ApiKeyStatus = __ApiKeyStatus;
|
|
11451
|
+
const ApiKeyStatus: {
|
|
11452
|
+
values: readonly ["active", "expired", "revoked"];
|
|
11453
|
+
};
|
|
11454
|
+
type AuditActorType = __AuditActorType;
|
|
11455
|
+
const AuditActorType: {
|
|
11456
|
+
values: readonly ["platform_user", "system", "pat"];
|
|
11457
|
+
};
|
|
11458
|
+
type AuditFeedSource = __AuditFeedSource;
|
|
11459
|
+
const AuditFeedSource: {
|
|
11460
|
+
values: readonly ["workspace_audit", "heimdall_audit", "agora_moderation"];
|
|
11461
|
+
};
|
|
11462
|
+
type McpProduct = __McpProduct;
|
|
11463
|
+
const McpProduct: {
|
|
11464
|
+
values: readonly ["auth", "mail", "waitlist", "social", "trawl"];
|
|
11465
|
+
};
|
|
11466
|
+
type PolicyEffect = __PolicyEffect;
|
|
11467
|
+
const PolicyEffect: {
|
|
11468
|
+
values: readonly ["allow", "deny"];
|
|
11469
|
+
};
|
|
11470
|
+
type StatsGranularity = __StatsGranularity;
|
|
11471
|
+
const StatsGranularity: {
|
|
11472
|
+
values: readonly ["day"];
|
|
11473
|
+
};
|
|
11474
|
+
type StatsMetric = __StatsMetric;
|
|
11475
|
+
const StatsMetric: {
|
|
11476
|
+
values: readonly ["audit_events"];
|
|
11477
|
+
};
|
|
11478
|
+
type StatsWindow = __StatsWindow;
|
|
11479
|
+
const StatsWindow: {
|
|
11480
|
+
values: readonly ["1d", "7d", "30d"];
|
|
11481
|
+
};
|
|
11482
|
+
type ApiKeySelf = __ApiKeySelf;
|
|
11483
|
+
type ApiKeySelfWorkspace = __ApiKeySelfWorkspace;
|
|
11484
|
+
type AuditFeed = __AuditFeed;
|
|
11485
|
+
type AuthorizationServerMetadata = __AuthorizationServerMetadata;
|
|
11486
|
+
type AvatarUrl = __AvatarUrl;
|
|
11487
|
+
type BoundPolicySummary = __BoundPolicySummary;
|
|
11488
|
+
type ConnectedClient = __ConnectedClient;
|
|
11489
|
+
type ConnectedClientList = __ConnectedClientList;
|
|
11490
|
+
type FeedItem = __FeedItem;
|
|
11491
|
+
type Feedback = __Feedback;
|
|
11492
|
+
type HiddenGuide = __HiddenGuide;
|
|
11493
|
+
type HiddenGuides = __HiddenGuides;
|
|
11494
|
+
type IntrospectAccount = __IntrospectAccount;
|
|
11495
|
+
type IntrospectApiKey = __IntrospectApiKey;
|
|
11496
|
+
type IntrospectPrincipal = __IntrospectPrincipal;
|
|
11497
|
+
type Introspect = __Introspect;
|
|
11498
|
+
type IntrospectRole = __IntrospectRole;
|
|
11499
|
+
type IntrospectWorkspaceListItem = __IntrospectWorkspaceListItem;
|
|
11500
|
+
type IntrospectWorkspace = __IntrospectWorkspace;
|
|
11501
|
+
type Jwk = __Jwk;
|
|
11502
|
+
type Jwks = __Jwks;
|
|
11503
|
+
type ListManagedPolicies = __ListManagedPolicies;
|
|
11504
|
+
type ListPakPresets = __ListPakPresets;
|
|
11505
|
+
type ListPlatformApiKeys = __ListPlatformApiKeys;
|
|
11506
|
+
type ListWorkspaceAuditLogs = __ListWorkspaceAuditLogs;
|
|
11507
|
+
type ListWorkspaceInvites = __ListWorkspaceInvites;
|
|
11508
|
+
type ListWorkspaceMembers = __ListWorkspaceMembers;
|
|
11509
|
+
type ListWorkspaceRoles = __ListWorkspaceRoles;
|
|
11510
|
+
type ListWorkspaceServices = __ListWorkspaceServices;
|
|
11511
|
+
type ListWorkspaces = __ListWorkspaces;
|
|
11512
|
+
type ManagedPolicyDeleted = __ManagedPolicyDeleted;
|
|
11513
|
+
type ManagedPolicyDetail = __ManagedPolicyDetail;
|
|
11514
|
+
type ManagedPolicy = __ManagedPolicy;
|
|
11515
|
+
type MeProfile = __MeProfile;
|
|
11516
|
+
type MintPak = __MintPak;
|
|
11517
|
+
type Pagination = __Pagination;
|
|
11518
|
+
type PakGrantPreview = __PakGrantPreview;
|
|
11519
|
+
type PakPreset = __PakPreset;
|
|
11520
|
+
type PolicyBindingCount = __PolicyBindingCount;
|
|
11521
|
+
type PolicyStatement = __PolicyStatement;
|
|
11522
|
+
type PublicApiKey = __PublicApiKey;
|
|
11523
|
+
type RevokeOtherSessions = __RevokeOtherSessions;
|
|
11524
|
+
type RevokeSession = __RevokeSession;
|
|
11525
|
+
type RotatePak = __RotatePak;
|
|
11526
|
+
type Session = __Session;
|
|
11527
|
+
type SourceDiagnostic = __SourceDiagnostic;
|
|
11528
|
+
type StatsSeriesPoint = __StatsSeriesPoint;
|
|
11529
|
+
type Token = __Token;
|
|
11530
|
+
type UpdateMemberRole = __UpdateMemberRole;
|
|
11531
|
+
type WorkspaceActionCatalog = __WorkspaceActionCatalog;
|
|
11532
|
+
type WorkspaceAuditLogEntry = __WorkspaceAuditLogEntry;
|
|
11533
|
+
type WorkspaceAvatarUrl = __WorkspaceAvatarUrl;
|
|
11534
|
+
type WorkspaceInviteListItem = __WorkspaceInviteListItem;
|
|
11535
|
+
type WorkspaceInvite = __WorkspaceInvite;
|
|
11536
|
+
type WorkspaceListItem = __WorkspaceListItem;
|
|
11537
|
+
type WorkspaceMember = __WorkspaceMember;
|
|
11538
|
+
type Workspace = __Workspace;
|
|
11539
|
+
type WorkspaceRole = __WorkspaceRole;
|
|
11540
|
+
type WorkspaceServiceState = __WorkspaceServiceState;
|
|
11541
|
+
type WorkspaceStats = __WorkspaceStats;
|
|
11542
|
+
type WorkspaceStatsInWindow = __WorkspaceStatsInWindow;
|
|
11543
|
+
type WorkspaceStatsSeries = __WorkspaceStatsSeries;
|
|
11544
|
+
type WorkspaceStatsTotals = __WorkspaceStatsTotals;
|
|
11545
|
+
type AuthLogoutParams = __AuthLogoutParams;
|
|
11546
|
+
type AuthPasswordRequestResetParams = __AuthPasswordRequestResetParams;
|
|
11547
|
+
type AuthPasswordResetParams = __AuthPasswordResetParams;
|
|
11548
|
+
type AuthRefreshParams = __AuthRefreshParams;
|
|
11549
|
+
type AuthSigninParams = __AuthSigninParams;
|
|
11550
|
+
type AuthSignupParams = __AuthSignupParams;
|
|
11551
|
+
type MeAvatarUploadParams = __MeAvatarUploadParams;
|
|
11552
|
+
type MeProfileUpdateParams = __MeProfileUpdateParams;
|
|
11553
|
+
type OauthConnectionListParams = __OauthConnectionListParams;
|
|
11554
|
+
type OauthWorkspaceConnectionListParams = __OauthWorkspaceConnectionListParams;
|
|
11555
|
+
type SessionListResponse = __SessionListResponse;
|
|
11556
|
+
type VerificationVerifyParams = __VerificationVerifyParams;
|
|
11557
|
+
type WorkspaceListParams = __WorkspaceListParams;
|
|
11558
|
+
type WorkspaceCreateParams = __WorkspaceCreateParams;
|
|
11559
|
+
type WorkspaceInviteAcceptParams = __WorkspaceInviteAcceptParams;
|
|
11560
|
+
type StatsRetrieveParams = __StatsRetrieveParams;
|
|
11561
|
+
type WorkspaceUpdateParams = __WorkspaceUpdateParams;
|
|
11562
|
+
type WorkspaceApiKeyListParams = __WorkspaceApiKeyListParams;
|
|
11563
|
+
type WorkspaceApiKeyCreateParams = __WorkspaceApiKeyCreateParams;
|
|
11564
|
+
type WorkspaceApiKeyPreviewParams = __WorkspaceApiKeyPreviewParams;
|
|
11565
|
+
type WorkspaceApiKeyUpdateParams = __WorkspaceApiKeyUpdateParams;
|
|
11566
|
+
type WorkspaceApiKeyDeleteParams = __WorkspaceApiKeyDeleteParams;
|
|
11567
|
+
type WorkspaceApiKeyUpdateBindingsParams = __WorkspaceApiKeyUpdateBindingsParams;
|
|
11568
|
+
type WorkspaceApiKeyRotateParams = __WorkspaceApiKeyRotateParams;
|
|
11569
|
+
type WorkspaceAuditFeedListParams = __WorkspaceAuditFeedListParams;
|
|
11570
|
+
type WorkspaceAuditLogListParams = __WorkspaceAuditLogListParams;
|
|
11571
|
+
type WorkspaceAuditLogExportParams = __WorkspaceAuditLogExportParams;
|
|
11572
|
+
type WorkspaceAvatarUploadParams = __WorkspaceAvatarUploadParams;
|
|
11573
|
+
type WorkspaceInviteListParams = __WorkspaceInviteListParams;
|
|
11574
|
+
type WorkspaceInviteCreateParams = __WorkspaceInviteCreateParams;
|
|
11575
|
+
type WorkspaceMemberListParams = __WorkspaceMemberListParams;
|
|
11576
|
+
type WorkspaceMemberUpdateRoleParams = __WorkspaceMemberUpdateRoleParams;
|
|
11577
|
+
type WorkspacePolicyListParams = __WorkspacePolicyListParams;
|
|
11578
|
+
type WorkspacePolicyCreateParams = __WorkspacePolicyCreateParams;
|
|
11579
|
+
type WorkspacePolicyUpdateParams = __WorkspacePolicyUpdateParams;
|
|
11580
|
+
type WorkspaceRoleListParams = __WorkspaceRoleListParams;
|
|
11581
|
+
type WorkspaceRoleCreateParams = __WorkspaceRoleCreateParams;
|
|
11582
|
+
type WorkspaceRoleUpdateParams = __WorkspaceRoleUpdateParams;
|
|
11583
|
+
type WorkspaceServiceEnableParams = __WorkspaceServiceEnableParams;
|
|
11584
|
+
type WorkspaceServiceUpdateSettingsParams = __WorkspaceServiceUpdateSettingsParams;
|
|
11585
|
+
type ErrorCode = __ErrorCode;
|
|
9632
11586
|
}
|
|
9633
11587
|
|
|
9634
|
-
export { PlatformAuth, type paths };
|
|
11588
|
+
export { PlatformAuth, PlatformAuthErrorCode, type components, PlatformAuth as default, type paths };
|