@productcraft/auth 1.0.0 → 1.1.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 +33 -2
- package/api.md +547 -230
- package/dist/index.cjs +868 -231
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +37246 -0
- package/dist/index.d.ts +1058 -263
- package/dist/index.js +868 -231
- package/dist/index.js.map +1 -1
- package/dist/testing.d.cts +32 -0
- package/manifest.json +210 -210
- package/package.json +25 -8
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { LastResponse, WebhookPayload, WebhookHeaders, APIClient, RequestOptions, APIPromise, PagePromise, ClientOptions, PollOptions, APIError } from '@productcraft/core';
|
|
1
|
+
import { LastResponse, WebhookPayload, WebhookHeaders, APIClient, RequestOptions, APIPromise, PagePromise, SignedWebhook, ClientOptions, PollOptions, APIError } from '@productcraft/core';
|
|
2
2
|
export { APIConnectionError, APIError, APITimeoutError, APIUserAbortError, AuthenticationError, BadRequestError, ConfigurationError, ConflictError, IdempotencyKeyReuseError, InternalServerError, NotFoundError, PCAuth, PCClientConfig, PermissionDeniedError, ProductCraftError, RateLimitError, UnprocessableEntityError, WebhookVerificationError } from '@productcraft/core';
|
|
3
3
|
import { Client } from 'openapi-fetch';
|
|
4
|
-
import { JWTHeaderParameters, FlattenedJWSInput, CryptoKey, JWTPayload } from 'jose';
|
|
5
4
|
|
|
6
5
|
/** Error codes this API documents. Open: codes added later still type-check. See https://productcraft.co/docs/errors. */
|
|
7
6
|
type AuthErrorCode = "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_EXISTS" | "ACCOUNT_NOT_FOUND" | "ACCOUNT_SUSPENDED" | "APEX_NOT_SUPPORTED" | "APP_ARCHIVED" | "APP_HAS_NO_WORKSPACE" | "APP_NOT_FOUND" | "APP_SUSPENDED" | "AUTH_SETTINGS_IN_METADATA" | "AVATAR_INVALID_TYPE" | "AVATAR_MAGIC_MISMATCH" | "AVATAR_NOT_FOUND" | "AVATAR_TOO_LARGE" | "BOT_PROTECTION_FAILED" | "BOT_PROTECTION_REQUIRED" | "BOT_PROTECTION_UNAVAILABLE" | "CUSTOM_DOMAIN_EXISTS" | "CUSTOM_DOMAIN_NOT_ACTIVE" | "CUSTOM_DOMAIN_NOT_FOUND" | "CUSTOM_DOMAIN_OAUTH_ONLY" | "DNS_CONFLICTS" | "ENVOI_APP_NOT_BOUND_TO_WORKSPACE" | "ENVOI_NOT_ENABLED" | "ENVOI_NOT_WIRED" | "ENVOI_SENDER_NOT_CONFIGURED" | "ENVOI_TEMPLATE_NOT_CONFIGURED" | "FEATURE_NOT_ENABLED" | "HOSTNAME_RESERVED" | "HOSTNAME_TAKEN" | "INSUFFICIENT_PERMISSIONS" | "INVALID_FORMAT" | "INVALID_HOSTNAME" | "INVALID_IDENTIFIER" | "INVALID_PROVIDER" | "INVALID_ZONE" | "MAIL_UNREACHABLE" | "PAK_WORKSPACE_MISMATCH" | "PASSWORD_BREACHED" | "PASSWORD_TOO_COMMON" | "PROVIDER_ERROR" | "PROVIDER_PERMISSION_DENIED" | "PROVIDER_TOKEN_REJECTED" | "PROVIDER_UNAVAILABLE" | "PROVIDER_ZONE_NOT_FOUND" | "ROLE_IN_USE" | "SENDER_ADDRESS_REQUIRED" | "SESSION_EXPIRED" | "SIGN_IN_TEST_INVALID" | "SLUG_TAKEN" | "SLUG_UUID_SHAPED" | "TENANT_API_KEYS_APP_PROXY_ONLY" | "TENANT_API_KEYS_FORBIDDEN" | "TENANT_API_KEYS_NOT_ENABLED" | "TENANT_API_KEYS_NO_SCOPES" | "TENANT_API_KEYS_SCOPE_INVALID" | "TENANT_API_KEYS_SUSPENDED" | "TENANT_API_KEYS_SUSPENDED_NOT_WRITABLE" | "TENANT_API_KEYS_UNKNOWN_ROLE" | "TENANT_API_KEY_EXPIRY_INVALID" | "TENANT_API_KEY_LIMIT" | "TENANT_API_KEY_NOT_ACTIVE" | "TENANT_API_KEY_NOT_FOUND" | "TENANT_API_KEY_SCOPE_ABOVE_CEILING" | "TENANT_API_KEY_SCOPE_NOT_GRANTABLE" | "TENANT_CONTEXT_REQUIRED" | "TENANT_MEMBERSHIP_REQUIRED" | "TENANT_NOT_ACTIVE" | "TOKEN_EXPIRED" | "TOKEN_INVALID" | "TOKEN_REVOKED" | "USERNAME_TAKEN" | "account_exists_with_different_provider" | "idempotency_secret_not_replayable" | "link_required" | "step_up_required" | (string & {});
|
|
@@ -24,6 +23,8 @@ type paths = {
|
|
|
24
23
|
/**
|
|
25
24
|
* Create a new app owned by the caller
|
|
26
25
|
* @description The new app starts with emails to its users turned on: they go out from the workspace default sender chosen in Mail, and the default verification, welcome, password-reset, invite and sign-in code templates are created in the workspace's Mail templates (an existing template with the same name is reused). Change or turn this off with `PATCH /v1/apps/{appId}/notification-settings`.
|
|
26
|
+
*
|
|
27
|
+
* **Sign-up starts off.** A new app has `signup_enabled: false`, so `POST /{app_slug}/v1/auth/signup` answers 403 `FORBIDDEN` ("Signup is disabled for this app") until you turn it on with `PATCH /v1/apps/{app_id}/auth-config` and `{ "signup_enabled": true }`. Sign-in, invites and admin-created users work either way.
|
|
27
28
|
*/
|
|
28
29
|
post: operations["AppController_createApp"];
|
|
29
30
|
delete?: never;
|
|
@@ -3393,7 +3394,10 @@ type components = {
|
|
|
3393
3394
|
* @enum {string}
|
|
3394
3395
|
*/
|
|
3395
3396
|
type: "email" | "phone";
|
|
3396
|
-
/**
|
|
3397
|
+
/**
|
|
3398
|
+
* @description Email or phone value (E.164 recommended for phone)
|
|
3399
|
+
* @example ada@example.com
|
|
3400
|
+
*/
|
|
3397
3401
|
value: string;
|
|
3398
3402
|
};
|
|
3399
3403
|
AddMemberDto: {
|
|
@@ -3424,7 +3428,10 @@ type components = {
|
|
|
3424
3428
|
AdminCreateUserDto: {
|
|
3425
3429
|
/** @description Human-readable display name. */
|
|
3426
3430
|
display_name?: string;
|
|
3427
|
-
/**
|
|
3431
|
+
/**
|
|
3432
|
+
* @description Primary email — becomes the account's primary email contact (unverified).
|
|
3433
|
+
* @example ada@example.com
|
|
3434
|
+
*/
|
|
3428
3435
|
email: string;
|
|
3429
3436
|
/** @description Optional initial password. When omitted, the account has no credential — the customer triggers the password-reset flow to onboard the user. When supplied it must satisfy the SAME rules as `/auth/signup`: the app-configured length and character classes, the common-password deny-list (400 `PASSWORD_TOO_COMMON`) and, unless the app sets `password_breach_check` to `off` or `warn`, the breach corpus (400 `PASSWORD_BREACHED`). */
|
|
3430
3437
|
password?: string;
|
|
@@ -3444,7 +3451,10 @@ type components = {
|
|
|
3444
3451
|
recovery_codes: string[];
|
|
3445
3452
|
};
|
|
3446
3453
|
AdminUpdateRoleDto: {
|
|
3447
|
-
/**
|
|
3454
|
+
/**
|
|
3455
|
+
* @description Target role name (must already exist in this app).
|
|
3456
|
+
* @example member
|
|
3457
|
+
*/
|
|
3448
3458
|
role_name: string;
|
|
3449
3459
|
};
|
|
3450
3460
|
AdminUpdateStatusDto: {
|
|
@@ -3455,7 +3465,10 @@ type components = {
|
|
|
3455
3465
|
status: "active" | "suspended" | "deactivated";
|
|
3456
3466
|
};
|
|
3457
3467
|
AdminUpdateUserDto: {
|
|
3458
|
-
/**
|
|
3468
|
+
/**
|
|
3469
|
+
* @description New display name. Empty string clears.
|
|
3470
|
+
* @example Ada Lovelace
|
|
3471
|
+
*/
|
|
3459
3472
|
display_name?: string;
|
|
3460
3473
|
/** @description New primary email address. Replaces the current primary email contact (still unverified after the change). */
|
|
3461
3474
|
email?: string;
|
|
@@ -3993,7 +4006,10 @@ type components = {
|
|
|
3993
4006
|
/** @enum {string} */
|
|
3994
4007
|
ApplyPlanResult: "created" | "unchanged" | "failed";
|
|
3995
4008
|
AssignRoleDto: {
|
|
3996
|
-
/**
|
|
4009
|
+
/**
|
|
4010
|
+
* @description Account ID of the user
|
|
4011
|
+
* @example 3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
|
|
4012
|
+
*/
|
|
3997
4013
|
account_id: string;
|
|
3998
4014
|
/**
|
|
3999
4015
|
* @description Role name to assign
|
|
@@ -4387,7 +4403,10 @@ type components = {
|
|
|
4387
4403
|
missing_permissions: string[];
|
|
4388
4404
|
};
|
|
4389
4405
|
AuthorizeBody: {
|
|
4390
|
-
/**
|
|
4406
|
+
/**
|
|
4407
|
+
* @description Single permission to check, e.g. 'user.read'. Use this OR `permissions`.
|
|
4408
|
+
* @example invoice.read
|
|
4409
|
+
*/
|
|
4391
4410
|
permission?: string;
|
|
4392
4411
|
/** @description Multiple permissions; the token must hold ALL of them. */
|
|
4393
4412
|
permissions?: string[];
|
|
@@ -4478,7 +4497,10 @@ type components = {
|
|
|
4478
4497
|
status?: "active" | "suspended" | "deactivated";
|
|
4479
4498
|
};
|
|
4480
4499
|
BulkUpdateRoleDto: {
|
|
4481
|
-
/**
|
|
4500
|
+
/**
|
|
4501
|
+
* @description Role name to assign to all selected users
|
|
4502
|
+
* @example member
|
|
4503
|
+
*/
|
|
4482
4504
|
role_name: string;
|
|
4483
4505
|
selection: components["schemas"]["BulkSelectionDto"];
|
|
4484
4506
|
};
|
|
@@ -4493,9 +4515,15 @@ type components = {
|
|
|
4493
4515
|
};
|
|
4494
4516
|
CallbackBodyDto: Record<string, unknown>;
|
|
4495
4517
|
ChangePasswordDto: {
|
|
4496
|
-
/**
|
|
4518
|
+
/**
|
|
4519
|
+
* @description The current password — required even when changing.
|
|
4520
|
+
* @example correct horse battery staple
|
|
4521
|
+
*/
|
|
4497
4522
|
current_password: string;
|
|
4498
|
-
/**
|
|
4523
|
+
/**
|
|
4524
|
+
* @description The new password. Must be at least 8 chars; the app may enforce a stricter policy.
|
|
4525
|
+
* @example a new long passphrase 42
|
|
4526
|
+
*/
|
|
4499
4527
|
new_password: string;
|
|
4500
4528
|
};
|
|
4501
4529
|
ClientCredentialsDto: {
|
|
@@ -4504,7 +4532,10 @@ type components = {
|
|
|
4504
4532
|
* @example m2m_a1b2c3d4e5f6...
|
|
4505
4533
|
*/
|
|
4506
4534
|
client_id: string;
|
|
4507
|
-
/**
|
|
4535
|
+
/**
|
|
4536
|
+
* @description M2M client secret (issued at client creation, never returned again).
|
|
4537
|
+
* @example the-secret-returned-by-credentials-create
|
|
4538
|
+
*/
|
|
4508
4539
|
client_secret: string;
|
|
4509
4540
|
/**
|
|
4510
4541
|
* @description OAuth grant type. Only 'client_credentials' is supported.
|
|
@@ -4779,7 +4810,10 @@ type components = {
|
|
|
4779
4810
|
expires_at: string;
|
|
4780
4811
|
};
|
|
4781
4812
|
ConsumerLogoutDto: {
|
|
4782
|
-
/**
|
|
4813
|
+
/**
|
|
4814
|
+
* @description Refresh token to revoke. The matching session is destroyed; the access token continues to verify until its TTL expires.
|
|
4815
|
+
* @example eyJhbGciOiJSUzI1NiIsImtpZCI6ImsxIn0.eyJ0eXAiOiJyZWZyZXNoIn0.c2lnbmF0dXJl
|
|
4816
|
+
*/
|
|
4783
4817
|
refresh_token: string;
|
|
4784
4818
|
};
|
|
4785
4819
|
ConsumerMfaChallengeFactorDto: {
|
|
@@ -4824,7 +4858,10 @@ type components = {
|
|
|
4824
4858
|
contact_id?: string;
|
|
4825
4859
|
/** @description Optional human-readable label for the factor (e.g. "iPhone 15"). */
|
|
4826
4860
|
label?: string;
|
|
4827
|
-
/**
|
|
4861
|
+
/**
|
|
4862
|
+
* @description The `mfa_token` from an `mfa_enrollment_required: true` signin response. UUID.
|
|
4863
|
+
* @example 3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
|
|
4864
|
+
*/
|
|
4828
4865
|
mfa_token: string;
|
|
4829
4866
|
/**
|
|
4830
4867
|
* @description Factor type to enrol — `totp` (authenticator app) or `email` (single-use code to a verified email contact).
|
|
@@ -4852,7 +4889,10 @@ type components = {
|
|
|
4852
4889
|
* @description Id of the pending factor returned by `/auth/mfa/enroll`.
|
|
4853
4890
|
*/
|
|
4854
4891
|
factor_id: string;
|
|
4855
|
-
/**
|
|
4892
|
+
/**
|
|
4893
|
+
* @description The same `mfa_token` used to start the enrolment. UUID.
|
|
4894
|
+
* @example 3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
|
|
4895
|
+
*/
|
|
4856
4896
|
mfa_token: string;
|
|
4857
4897
|
};
|
|
4858
4898
|
ConsumerMfaEnrollVerifyResponseDto: {
|
|
@@ -4925,7 +4965,10 @@ type components = {
|
|
|
4925
4965
|
result: "mfa_enrollment_required";
|
|
4926
4966
|
};
|
|
4927
4967
|
ConsumerMfaRecoverDto: {
|
|
4928
|
-
/**
|
|
4968
|
+
/**
|
|
4969
|
+
* @description The `mfa_token` returned by `/auth/signin`. UUID.
|
|
4970
|
+
* @example 3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
|
|
4971
|
+
*/
|
|
4929
4972
|
mfa_token: string;
|
|
4930
4973
|
/**
|
|
4931
4974
|
* @description A single-use recovery code (16 hex chars, hyphens optional). Consumes the code on success — the user should regenerate the set afterwards via `/me/mfa/recovery-codes/regenerate`.
|
|
@@ -4939,7 +4982,10 @@ type components = {
|
|
|
4939
4982
|
* @description Id of the email factor (from the challenge `factors` list) to deliver the code through.
|
|
4940
4983
|
*/
|
|
4941
4984
|
factor_id: string;
|
|
4942
|
-
/**
|
|
4985
|
+
/**
|
|
4986
|
+
* @description The `mfa_token` returned by `/auth/signin`. UUID.
|
|
4987
|
+
* @example 3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
|
|
4988
|
+
*/
|
|
4943
4989
|
mfa_token: string;
|
|
4944
4990
|
};
|
|
4945
4991
|
ConsumerMfaSendCodeResponseDto: {
|
|
@@ -4964,11 +5010,17 @@ type components = {
|
|
|
4964
5010
|
credential?: {
|
|
4965
5011
|
[key: string]: unknown;
|
|
4966
5012
|
};
|
|
4967
|
-
/**
|
|
5013
|
+
/**
|
|
5014
|
+
* @description The `mfa_token` returned by `/auth/signin`. UUID.
|
|
5015
|
+
* @example 3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
|
|
5016
|
+
*/
|
|
4968
5017
|
mfa_token: string;
|
|
4969
5018
|
};
|
|
4970
5019
|
ConsumerMfaWebauthnOptionsDto: {
|
|
4971
|
-
/**
|
|
5020
|
+
/**
|
|
5021
|
+
* @description The `mfa_token` returned by `/auth/signin`. UUID.
|
|
5022
|
+
* @example 3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
|
|
5023
|
+
*/
|
|
4972
5024
|
mfa_token: string;
|
|
4973
5025
|
};
|
|
4974
5026
|
ConsumerPasskeyOptionsDto: {
|
|
@@ -4985,7 +5037,10 @@ type components = {
|
|
|
4985
5037
|
};
|
|
4986
5038
|
};
|
|
4987
5039
|
ConsumerRefreshDto: {
|
|
4988
|
-
/**
|
|
5040
|
+
/**
|
|
5041
|
+
* @description Refresh token returned from signin/signup/previous refresh. Each refresh rotates the token; the previous one is revoked.
|
|
5042
|
+
* @example eyJhbGciOiJSUzI1NiIsImtpZCI6ImsxIn0.eyJ0eXAiOiJyZWZyZXNoIn0.c2lnbmF0dXJl
|
|
5043
|
+
*/
|
|
4989
5044
|
refresh_token: string;
|
|
4990
5045
|
};
|
|
4991
5046
|
ConsumerRequestPasswordResetDto: {
|
|
@@ -5018,7 +5073,10 @@ type components = {
|
|
|
5018
5073
|
* @example 123456
|
|
5019
5074
|
*/
|
|
5020
5075
|
code: string;
|
|
5021
|
-
/**
|
|
5076
|
+
/**
|
|
5077
|
+
* @description New password. Must satisfy the app-configured policy.
|
|
5078
|
+
* @example a new long passphrase 42
|
|
5079
|
+
*/
|
|
5022
5080
|
new_password: string;
|
|
5023
5081
|
};
|
|
5024
5082
|
ConsumerRoleListResponseDto: {
|
|
@@ -5108,7 +5166,10 @@ type components = {
|
|
|
5108
5166
|
* @example jane_doe
|
|
5109
5167
|
*/
|
|
5110
5168
|
identifier: string;
|
|
5111
|
-
/**
|
|
5169
|
+
/**
|
|
5170
|
+
* @description EndUser password.
|
|
5171
|
+
* @example correct horse battery staple
|
|
5172
|
+
*/
|
|
5112
5173
|
password: string;
|
|
5113
5174
|
/** @description Optional tenant UUID. When set, the issued JWT carries `tid` + `trole` claims and the user must already be a member of that tenant — non-membership returns 403. */
|
|
5114
5175
|
tenant_id?: string;
|
|
@@ -5141,7 +5202,10 @@ type components = {
|
|
|
5141
5202
|
username: string;
|
|
5142
5203
|
};
|
|
5143
5204
|
ConsumerSwitchTenantDto: {
|
|
5144
|
-
/**
|
|
5205
|
+
/**
|
|
5206
|
+
* @description Tenant UUID to switch the EndUser's session into. Caller must already hold a tenant_membership row for this tenant in the app, else 403.
|
|
5207
|
+
* @example 3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
|
|
5208
|
+
*/
|
|
5145
5209
|
tenant_id: string;
|
|
5146
5210
|
};
|
|
5147
5211
|
ConsumerTenantListResponseDto: {
|
|
@@ -6238,7 +6302,10 @@ type components = {
|
|
|
6238
6302
|
status_code: number;
|
|
6239
6303
|
};
|
|
6240
6304
|
ExchangeRequestDto: {
|
|
6241
|
-
/**
|
|
6305
|
+
/**
|
|
6306
|
+
* @description The opaque `heimdall_code` the customer received on the OAuth callback `return_to`. Single-use; expires after 60 seconds.
|
|
6307
|
+
* @example hc_8f14e45fceea167a5a36dedd4bea2543
|
|
6308
|
+
*/
|
|
6242
6309
|
code: string;
|
|
6243
6310
|
};
|
|
6244
6311
|
ExchangeResponseDto: {
|
|
@@ -6295,9 +6362,15 @@ type components = {
|
|
|
6295
6362
|
result: "mfa_enrollment_required";
|
|
6296
6363
|
};
|
|
6297
6364
|
IdpNativeSigninDto: {
|
|
6298
|
-
/**
|
|
6365
|
+
/**
|
|
6366
|
+
* @description Provider-issued ID token (JWT). For Apple, the value returned by `ASAuthorizationAppleIDCredential.identityToken` after UTF-8 decoding the data.
|
|
6367
|
+
* @example eyJhbGciOiJSUzI1NiIsImtpZCI6ImsxIn0.eyJzdWIiOiJ1c3JfMSJ9.c2lnbmF0dXJl
|
|
6368
|
+
*/
|
|
6299
6369
|
id_token: string;
|
|
6300
|
-
/**
|
|
6370
|
+
/**
|
|
6371
|
+
* @description Raw nonce the client generated and SHA-256-hashed into the authorize request. Backend recomputes the hash and compares to the token's `nonce` claim. Must be at least 32 bytes of entropy (base64url-encoded ~43 chars).
|
|
6372
|
+
* @example n-0S6_WzA2Mj
|
|
6373
|
+
*/
|
|
6301
6374
|
nonce: string;
|
|
6302
6375
|
/** @description Apple-specific first-signin payload: { name, email }. Persist for display only — the verified JWT is the source of truth. */
|
|
6303
6376
|
user?: components["schemas"]["IdpNativeUserHintDto"];
|
|
@@ -6471,7 +6544,10 @@ type components = {
|
|
|
6471
6544
|
requested: number;
|
|
6472
6545
|
};
|
|
6473
6546
|
IntrospectDto: {
|
|
6474
|
-
/**
|
|
6547
|
+
/**
|
|
6548
|
+
* @description The access token to introspect. Optional — when omitted the endpoint introspects the `Authorization: Bearer` token. When present, it must match the bearer (we refuse cross-token introspection so a stolen token cannot be probed against a different active credential).
|
|
6549
|
+
* @example eyJhbGciOiJSUzI1NiIsImtpZCI6ImsxIn0.eyJzdWIiOiJ1c3JfMSJ9.c2lnbmF0dXJl
|
|
6550
|
+
*/
|
|
6475
6551
|
token?: string;
|
|
6476
6552
|
/**
|
|
6477
6553
|
* @description Optional `token_type_hint` per RFC 7662. We only issue access tokens at this endpoint so the only meaningful value is `access_token`; the field is accepted for client-library compatibility.
|
|
@@ -9171,7 +9247,10 @@ type components = {
|
|
|
9171
9247
|
site_key?: string;
|
|
9172
9248
|
};
|
|
9173
9249
|
UpdateEndUserDto: {
|
|
9174
|
-
/**
|
|
9250
|
+
/**
|
|
9251
|
+
* @description New display name
|
|
9252
|
+
* @example Ada Lovelace
|
|
9253
|
+
*/
|
|
9175
9254
|
display_name?: string;
|
|
9176
9255
|
/** @description New primary email */
|
|
9177
9256
|
email?: string;
|
|
@@ -9231,7 +9310,10 @@ type components = {
|
|
|
9231
9310
|
description?: string;
|
|
9232
9311
|
};
|
|
9233
9312
|
UpdateTenantDto: {
|
|
9234
|
-
/**
|
|
9313
|
+
/**
|
|
9314
|
+
* @description Human-readable name of the tenant.
|
|
9315
|
+
* @example Acme Inc
|
|
9316
|
+
*/
|
|
9235
9317
|
display_name?: string;
|
|
9236
9318
|
/** @description Free-form JSON object you attach to the tenant; returned as stored. */
|
|
9237
9319
|
metadata?: {
|
|
@@ -10131,7 +10213,10 @@ type components = {
|
|
|
10131
10213
|
type: "user.suspended";
|
|
10132
10214
|
};
|
|
10133
10215
|
VerifyBody: {
|
|
10134
|
-
/**
|
|
10216
|
+
/**
|
|
10217
|
+
* @description EndUser or M2M JWT to verify against the app JWKS. Optional — if omitted, the token is read from the `Authorization: Bearer <jwt>` header instead.
|
|
10218
|
+
* @example eyJhbGciOiJSUzI1NiIsImtpZCI6ImsxIn0.eyJzdWIiOiJ1c3JfMSJ9.c2lnbmF0dXJl
|
|
10219
|
+
*/
|
|
10135
10220
|
token?: string;
|
|
10136
10221
|
};
|
|
10137
10222
|
VerifyPrincipalDto: {
|
|
@@ -24931,7 +25016,7 @@ interface operations {
|
|
|
24931
25016
|
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
24932
25017
|
};
|
|
24933
25018
|
};
|
|
24934
|
-
/** @description `BOT_PROTECTION_FAILED`: the bot-protection provider rejected the `bot_protection_token` (bad, expired or already used), or the hostname it reported is not one of the app's `bot_protection.expected_hostnames`; render a fresh widget and retry. Otherwise: signup is disabled for this app, the email domain is not on the app's allow-list, the presented PAK belongs to a different workspace, or its policy denies `auth.signup.create` on this app. Also returned when the app itself is suspended (`APP_SUSPENDED`) or archived (`APP_ARCHIVED`). */
|
|
25019
|
+
/** @description `BOT_PROTECTION_FAILED`: the bot-protection provider rejected the `bot_protection_token` (bad, expired or already used), or the hostname it reported is not one of the app's `bot_protection.expected_hostnames`; render a fresh widget and retry. Otherwise: signup is disabled for this app (new apps start with `signup_enabled: false`; turn it on with `PATCH /v1/apps/{app_id}/auth-config`), the email domain is not on the app's allow-list, the presented PAK belongs to a different workspace, or its policy denies `auth.signup.create` on this app. Also returned when the app itself is suspended (`APP_SUSPENDED`) or archived (`APP_ARCHIVED`). */
|
|
24935
25020
|
403: {
|
|
24936
25021
|
headers: {
|
|
24937
25022
|
"X-Request-Id": components["headers"]["RequestId"];
|
|
@@ -29157,8 +29242,8 @@ interface operations {
|
|
|
29157
29242
|
|
|
29158
29243
|
type IsUnion<T, U = T> = T extends unknown ? ([U] extends [T] ? false : true) : never;
|
|
29159
29244
|
type OpenString<T extends string> = string extends T ? T : true extends IsUnion<T> ? T | (string & {}) : T;
|
|
29160
|
-
type OpenValue<T> = [T] extends [string] ? OpenString<T> : T extends readonly (infer I)[] ?
|
|
29161
|
-
[K in keyof T]:
|
|
29245
|
+
type OpenValue<T> = [T] extends [string] ? OpenString<T> : T extends readonly (infer I)[] ? (OpenValue<Exclude<I, null | undefined>> | Extract<I, null | undefined>)[] : T extends object ? {
|
|
29246
|
+
[K in keyof T]: OpenValue<Exclude<T[K], null | undefined>> | Extract<T[K], null | undefined>;
|
|
29162
29247
|
} : T;
|
|
29163
29248
|
/** A response type: string-literal unions also accept values added after this SDK was built. */
|
|
29164
29249
|
type Open<T> = OpenValue<Exclude<T, null | undefined>> | Extract<T, null | undefined>;
|
|
@@ -30117,6 +30202,17 @@ interface WebhookUnwrapParams {
|
|
|
30117
30202
|
/** Accepted clock skew in seconds. Default 300. */
|
|
30118
30203
|
toleranceSeconds?: number;
|
|
30119
30204
|
}
|
|
30205
|
+
/** `webhooks.sign()`: what to sign. Tests only; ProductCraft signs real deliveries. */
|
|
30206
|
+
interface WebhookSignParams {
|
|
30207
|
+
/** The event: an `UnwrapWebhookEvent`-shaped object (JSON-encoded) or the exact body string. */
|
|
30208
|
+
payload: WebhookPayload | Record<string, unknown>;
|
|
30209
|
+
/** Signing secret. Default: the client's `webhookSecret` (the first, when several), then `PRODUCTCRAFT_AUTH_WEBHOOK_SECRET`. */
|
|
30210
|
+
secret?: string;
|
|
30211
|
+
/** `webhook-id`. Default: a random `msg_…` id. */
|
|
30212
|
+
id?: string;
|
|
30213
|
+
/** Unix seconds for `webhook-timestamp`. Default: now. */
|
|
30214
|
+
timestamp?: number;
|
|
30215
|
+
}
|
|
30120
30216
|
|
|
30121
30217
|
type Bound = Readonly<Record<string, string | undefined>>;
|
|
30122
30218
|
declare class APIResource {
|
|
@@ -30132,6 +30228,11 @@ declare class AppsResource extends APIResource {
|
|
|
30132
30228
|
*
|
|
30133
30229
|
* The new app starts with emails to its users turned on: they go out from the workspace default sender chosen in Mail, and the default verification, welcome, password-reset, invite and sign-in code templates are created in the workspace's Mail templates (an existing template with the same name is reused). Change or turn this off with `PATCH /v1/apps/{appId}/notification-settings`.
|
|
30134
30230
|
*
|
|
30231
|
+
* **Sign-up starts off.** A new app has `signup_enabled: false`, so `POST /{app_slug}/v1/auth/signup` answers 403 `FORBIDDEN` ("Signup is disabled for this app") until you turn it on with `PATCH /v1/apps/{app_id}/auth-config` and `{ "signup_enabled": true }`. Sign-in, invites and admin-created users work either way.
|
|
30232
|
+
*
|
|
30233
|
+
* Credential: `workspace_key`.
|
|
30234
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
30235
|
+
*
|
|
30135
30236
|
* @param params - `Auth.AppCreateParams`.
|
|
30136
30237
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
30137
30238
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failure (slug, display name, or workspaceId).
|
|
@@ -30154,6 +30255,9 @@ declare class AppsResource extends APIResource {
|
|
|
30154
30255
|
/**
|
|
30155
30256
|
* Delete an app permanently
|
|
30156
30257
|
*
|
|
30258
|
+
* Credential: `workspace_key`.
|
|
30259
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
30260
|
+
*
|
|
30157
30261
|
* @param appId - Id of the app.
|
|
30158
30262
|
* @param options - Per-request options.
|
|
30159
30263
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
@@ -30164,13 +30268,16 @@ declare class AppsResource extends APIResource {
|
|
|
30164
30268
|
* @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id
|
|
30165
30269
|
* @example
|
|
30166
30270
|
* ```ts
|
|
30167
|
-
* await auth.apps.delete("
|
|
30271
|
+
* await auth.apps.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
30168
30272
|
* ```
|
|
30169
30273
|
*/
|
|
30170
30274
|
delete(appId: string, options?: RequestOptions): APIPromise<void>;
|
|
30171
30275
|
/**
|
|
30172
30276
|
* List apps in workspaces the caller is a member of. Pass `workspace_id` to scope the result to a single workspace — required from the per-workspace console page so cross-tenant memberships do not leak.
|
|
30173
30277
|
*
|
|
30278
|
+
* Credential: `workspace_key`.
|
|
30279
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
30280
|
+
*
|
|
30174
30281
|
* @param params - `Auth.AppListParams`.
|
|
30175
30282
|
* @param options - Per-request options.
|
|
30176
30283
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid pagination cursor.
|
|
@@ -30190,6 +30297,9 @@ declare class AppsResource extends APIResource {
|
|
|
30190
30297
|
/**
|
|
30191
30298
|
* Get app details
|
|
30192
30299
|
*
|
|
30300
|
+
* Credential: `workspace_key`.
|
|
30301
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
30302
|
+
*
|
|
30193
30303
|
* @param appId - Id of the app.
|
|
30194
30304
|
* @param options - Per-request options.
|
|
30195
30305
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
|
|
@@ -30200,13 +30310,16 @@ declare class AppsResource extends APIResource {
|
|
|
30200
30310
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id
|
|
30201
30311
|
* @example
|
|
30202
30312
|
* ```ts
|
|
30203
|
-
* const app = await auth.apps.retrieve("
|
|
30313
|
+
* const app = await auth.apps.retrieve("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
30204
30314
|
* ```
|
|
30205
30315
|
*/
|
|
30206
30316
|
retrieve(appId: string, options?: RequestOptions): APIPromise<WithLastResponse<App>>;
|
|
30207
30317
|
/**
|
|
30208
30318
|
* Update app display name, slug, metadata, and retention settings
|
|
30209
30319
|
*
|
|
30320
|
+
* Credential: `workspace_key`.
|
|
30321
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
30322
|
+
*
|
|
30210
30323
|
* @param appId - Id of the app.
|
|
30211
30324
|
* @param params - `Auth.AppUpdateParams`.
|
|
30212
30325
|
* @param options - Per-request options.
|
|
@@ -30217,7 +30330,7 @@ declare class AppsResource extends APIResource {
|
|
|
30217
30330
|
* @see https://productcraft.co/docs/auth/api-reference#patch-v1-apps-app-id
|
|
30218
30331
|
* @example
|
|
30219
30332
|
* ```ts
|
|
30220
|
-
* const app = await auth.apps.update("
|
|
30333
|
+
* const app = await auth.apps.update("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { audit_retention_days: 365 });
|
|
30221
30334
|
* ```
|
|
30222
30335
|
*/
|
|
30223
30336
|
update(appId: string, params?: AppUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<App>>;
|
|
@@ -30229,6 +30342,9 @@ declare class StatsResource extends APIResource {
|
|
|
30229
30342
|
*
|
|
30230
30343
|
* Returns total Auth apps owned by workspaces the caller is a member of, end-users across those apps, and active API keys across those apps. Pass `workspace_id` to scope the counts to a single workspace — required from the dashboard so cross-tenant data does not bleed into the totals.
|
|
30231
30344
|
*
|
|
30345
|
+
* Credential: `workspace_key`.
|
|
30346
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
30347
|
+
*
|
|
30232
30348
|
* @param params - `Auth.StatsMeParams`.
|
|
30233
30349
|
* @param options - Per-request options.
|
|
30234
30350
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
|
|
@@ -30250,6 +30366,9 @@ declare class StatsResource extends APIResource {
|
|
|
30250
30366
|
*
|
|
30251
30367
|
* Days are UTC. Counts only: no end-user identifiers. Cached for up to 60 seconds (`generated_at`).
|
|
30252
30368
|
*
|
|
30369
|
+
* Credential: `workspace_key`.
|
|
30370
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
30371
|
+
*
|
|
30253
30372
|
* @param params - `Auth.StatsRetrieveParams`.
|
|
30254
30373
|
* @param options - Per-request options.
|
|
30255
30374
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `workspaceId` is not a UUID or `window` is not one of 1d, 7d, 30d.
|
|
@@ -30282,6 +30401,14 @@ declare class WebhooksResource extends APIResource {
|
|
|
30282
30401
|
* @throws {ConfigurationError} No secret was passed or configured.
|
|
30283
30402
|
*/
|
|
30284
30403
|
unwrap(params: WebhookUnwrapParams): Promise<UnwrapWebhookEvent>;
|
|
30404
|
+
/**
|
|
30405
|
+
* Sign a test event the way ProductCraft signs deliveries (Standard Webhooks), so a handler
|
|
30406
|
+
* test can call `unwrap` without a live delivery. Returns the exact body and the headers.
|
|
30407
|
+
*
|
|
30408
|
+
* @param params - The event (an object is JSON-encoded), and optionally the secret, `id` and `timestamp`.
|
|
30409
|
+
* @throws {ConfigurationError} No secret was passed or configured.
|
|
30410
|
+
*/
|
|
30411
|
+
sign(params: WebhookSignParams): Promise<SignedWebhook>;
|
|
30285
30412
|
}
|
|
30286
30413
|
/** `auth` */
|
|
30287
30414
|
declare class AuthResources extends APIResource {
|
|
@@ -30295,6 +30422,9 @@ declare class AppApiKeysResource extends APIResource {
|
|
|
30295
30422
|
/**
|
|
30296
30423
|
* Mint a new hdk_live_* API key with an explicit permission scope. The raw key is returned ONCE.
|
|
30297
30424
|
*
|
|
30425
|
+
* Credential: `workspace_key`.
|
|
30426
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
30427
|
+
*
|
|
30298
30428
|
* @param params - `Auth.ApiKeyCreateParams`.
|
|
30299
30429
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
30300
30430
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failure (name, empty `permissions`, a permission not matching `resource.action`, unsupported `expiresInDays`), or a malformed `Idempotency-Key`.
|
|
@@ -30307,13 +30437,16 @@ declare class AppApiKeysResource extends APIResource {
|
|
|
30307
30437
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-api-keys
|
|
30308
30438
|
* @example
|
|
30309
30439
|
* ```ts
|
|
30310
|
-
* const createApiKey = await auth.admin.app("
|
|
30440
|
+
* const createApiKey = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").apiKeys.create({ name: "CI deploy bot", permissions: ["user.read", "user.list"] });
|
|
30311
30441
|
* ```
|
|
30312
30442
|
*/
|
|
30313
30443
|
create(params: ApiKeyCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<CreateApiKey>>;
|
|
30314
30444
|
/**
|
|
30315
30445
|
* Revoke an API key. The key stops authenticating immediately; the row is kept (soft delete) so the list and the audit trail can still answer who revoked it and when.
|
|
30316
30446
|
*
|
|
30447
|
+
* Credential: `workspace_key`.
|
|
30448
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
30449
|
+
*
|
|
30317
30450
|
* @param keyId - Id of the key.
|
|
30318
30451
|
* @param options - Per-request options.
|
|
30319
30452
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
@@ -30323,13 +30456,16 @@ declare class AppApiKeysResource extends APIResource {
|
|
|
30323
30456
|
* @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id-api-keys-key-id
|
|
30324
30457
|
* @example
|
|
30325
30458
|
* ```ts
|
|
30326
|
-
* await auth.admin.app("
|
|
30459
|
+
* await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").apiKeys.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
30327
30460
|
* ```
|
|
30328
30461
|
*/
|
|
30329
30462
|
delete(keyId: string, options?: RequestOptions): APIPromise<void>;
|
|
30330
30463
|
/**
|
|
30331
30464
|
* List API keys for an app (no raw secret), newest first. Cursor-paginated: 20/page by default, 100 max.
|
|
30332
30465
|
*
|
|
30466
|
+
* Credential: `workspace_key`.
|
|
30467
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
30468
|
+
*
|
|
30333
30469
|
* @param params - `Auth.ApiKeyListParams`.
|
|
30334
30470
|
* @param options - Per-request options.
|
|
30335
30471
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`.
|
|
@@ -30339,16 +30475,19 @@ declare class AppApiKeysResource extends APIResource {
|
|
|
30339
30475
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-api-keys
|
|
30340
30476
|
* @example
|
|
30341
30477
|
* ```ts
|
|
30342
|
-
* for await (const apiKey of auth.admin.app("
|
|
30478
|
+
* for await (const apiKey of auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").apiKeys.list()) {
|
|
30343
30479
|
* console.log(apiKey);
|
|
30344
30480
|
* }
|
|
30345
|
-
* const page = await auth.admin.app("
|
|
30481
|
+
* const page = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").apiKeys.list({}, { timeout: 5_000 });
|
|
30346
30482
|
* ```
|
|
30347
30483
|
*/
|
|
30348
30484
|
list(params?: ApiKeyListParams, options?: RequestOptions): PagePromise<ApiKeySummary>;
|
|
30349
30485
|
/**
|
|
30350
30486
|
* Mint a replacement for an existing key, carrying its name and permissions over. The outgoing key keeps working for `grace_hours` (24 by default) so a fleet can roll over without downtime. The raw key is returned ONCE.
|
|
30351
30487
|
*
|
|
30488
|
+
* Credential: `workspace_key`.
|
|
30489
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
30490
|
+
*
|
|
30352
30491
|
* @param keyId - Id of the key.
|
|
30353
30492
|
* @param params - `Auth.ApiKeyRotateParams`.
|
|
30354
30493
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
@@ -30360,7 +30499,7 @@ declare class AppApiKeysResource extends APIResource {
|
|
|
30360
30499
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-api-keys-key-id-rotate
|
|
30361
30500
|
* @example
|
|
30362
30501
|
* ```ts
|
|
30363
|
-
* const rotateApiKey = await auth.admin.app("
|
|
30502
|
+
* const rotateApiKey = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").apiKeys.rotate("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { grace_hours: 24 });
|
|
30364
30503
|
* ```
|
|
30365
30504
|
*/
|
|
30366
30505
|
rotate(keyId: string, params?: ApiKeyRotateParams, options?: RequestOptions): APIPromise<WithLastResponse<RotateApiKey>>;
|
|
@@ -30372,6 +30511,9 @@ declare class AppAuditLogsResource extends APIResource {
|
|
|
30372
30511
|
*
|
|
30373
30512
|
* The response is streamed: rows are walked in keyset batches and written as they are read, so neither the service nor the client has to hold the whole result set. Works on both lanes — a platform bearer token and a `pcft_live_*` Platform API Key with `auth.audit.read` hit the same route. 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.
|
|
30374
30513
|
*
|
|
30514
|
+
* Credential: `workspace_key`.
|
|
30515
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
30516
|
+
*
|
|
30375
30517
|
* @param params - `Auth.AuditLogExportParams`.
|
|
30376
30518
|
* @param options - Per-request options.
|
|
30377
30519
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Unknown `format`, or malformed `since` / `until`.
|
|
@@ -30384,7 +30526,7 @@ declare class AppAuditLogsResource extends APIResource {
|
|
|
30384
30526
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-audit-logs-export
|
|
30385
30527
|
* @example
|
|
30386
30528
|
* ```ts
|
|
30387
|
-
* const response = await auth.admin.app("
|
|
30529
|
+
* const response = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").auditLogs.export();
|
|
30388
30530
|
* const text = await response.text();
|
|
30389
30531
|
* ```
|
|
30390
30532
|
*/
|
|
@@ -30392,6 +30534,9 @@ declare class AppAuditLogsResource extends APIResource {
|
|
|
30392
30534
|
/**
|
|
30393
30535
|
* Append-only audit log for this app, newest first. Filter by `?action=`, `?actor_id=`, and/or the `?since=` / `?until=` date range. 20/page (max 100), cursor-paginated.
|
|
30394
30536
|
*
|
|
30537
|
+
* Credential: `workspace_key`.
|
|
30538
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
30539
|
+
*
|
|
30395
30540
|
* @param params - `Auth.AuditLogListParams`.
|
|
30396
30541
|
* @param options - Per-request options.
|
|
30397
30542
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`, `since`, or `until`.
|
|
@@ -30403,10 +30548,10 @@ declare class AppAuditLogsResource extends APIResource {
|
|
|
30403
30548
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-audit-logs
|
|
30404
30549
|
* @example
|
|
30405
30550
|
* ```ts
|
|
30406
|
-
* for await (const auditLog of auth.admin.app("
|
|
30551
|
+
* for await (const auditLog of auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").auditLogs.list()) {
|
|
30407
30552
|
* console.log(auditLog);
|
|
30408
30553
|
* }
|
|
30409
|
-
* const page = await auth.admin.app("
|
|
30554
|
+
* const page = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").auditLogs.list({}, { timeout: 5_000 });
|
|
30410
30555
|
* ```
|
|
30411
30556
|
*/
|
|
30412
30557
|
list(params?: AuditLogListParams, options?: RequestOptions): PagePromise<AuditLogEntry>;
|
|
@@ -30416,6 +30561,9 @@ declare class AppAuditSinkResource extends APIResource {
|
|
|
30416
30561
|
/**
|
|
30417
30562
|
* Remove the audit sink. Shipping stops immediately; the audit log itself is untouched.
|
|
30418
30563
|
*
|
|
30564
|
+
* Credential: `workspace_key`.
|
|
30565
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
30566
|
+
*
|
|
30419
30567
|
* @param options - Per-request options.
|
|
30420
30568
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
30421
30569
|
* @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.update`.
|
|
@@ -30425,7 +30573,7 @@ declare class AppAuditSinkResource extends APIResource {
|
|
|
30425
30573
|
* @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id-audit-sink
|
|
30426
30574
|
* @example
|
|
30427
30575
|
* ```ts
|
|
30428
|
-
* await auth.admin.app("
|
|
30576
|
+
* await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").auditSink.disconnect();
|
|
30429
30577
|
* ```
|
|
30430
30578
|
*/
|
|
30431
30579
|
disconnect(options?: RequestOptions): APIPromise<void>;
|
|
@@ -30434,6 +30582,9 @@ declare class AppAuditSinkResource extends APIResource {
|
|
|
30434
30582
|
*
|
|
30435
30583
|
* Audit rows are POSTed in batches of up to 100, signed with the same `X-Auth-Signature: t=<unix>,v1=<hex>` HMAC header as the outbound webhooks. Delivery is at-least-once: the cursor advances only after a 2xx, so a batch that times out after the receiver processed it is re-sent. Every record carries its immutable `audit_log` id, so dedupe on that. A new sink starts from the moment it is created — configuring one does not replay the existing history into your SIEM. Replacing an existing sink clears the auto-disabled state (the same "I fixed my receiver" signal a webhook PUT carries) but does NOT rewind the cursor.
|
|
30436
30584
|
*
|
|
30585
|
+
* Credential: `workspace_key`.
|
|
30586
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
30587
|
+
*
|
|
30437
30588
|
* @param params - `Auth.AuditSinkReplaceParams`.
|
|
30438
30589
|
* @param options - Per-request options.
|
|
30439
30590
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: URL is not HTTPS, or the SSRF guard refused it (private address, unresolvable host, non-public TLD).
|
|
@@ -30445,13 +30596,16 @@ declare class AppAuditSinkResource extends APIResource {
|
|
|
30445
30596
|
* @see https://productcraft.co/docs/auth/api-reference#put-v1-apps-app-id-audit-sink
|
|
30446
30597
|
* @example
|
|
30447
30598
|
* ```ts
|
|
30448
|
-
* const auditSinkWithSecret = await auth.admin.app("
|
|
30599
|
+
* const auditSinkWithSecret = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").auditSink.replace({ url: "https://siem.customer.example.com/ingest/productcraft-auth" });
|
|
30449
30600
|
* ```
|
|
30450
30601
|
*/
|
|
30451
30602
|
replace(params: AuditSinkReplaceParams, options?: RequestOptions): APIPromise<WithLastResponse<AuditSinkWithSecret>>;
|
|
30452
30603
|
/**
|
|
30453
30604
|
* Current audit sink for this app, or 404 when none is configured. Never returns the signing secret — only its last-4 hint.
|
|
30454
30605
|
*
|
|
30606
|
+
* Credential: `workspace_key`.
|
|
30607
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
30608
|
+
*
|
|
30455
30609
|
* @param options - Per-request options.
|
|
30456
30610
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
30457
30611
|
* @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.read`.
|
|
@@ -30461,7 +30615,7 @@ declare class AppAuditSinkResource extends APIResource {
|
|
|
30461
30615
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-audit-sink
|
|
30462
30616
|
* @example
|
|
30463
30617
|
* ```ts
|
|
30464
|
-
* const auditSink = await auth.admin.app("
|
|
30618
|
+
* const auditSink = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").auditSink.retrieve();
|
|
30465
30619
|
* ```
|
|
30466
30620
|
*/
|
|
30467
30621
|
retrieve(options?: RequestOptions): APIPromise<WithLastResponse<AuditSink>>;
|
|
@@ -30470,6 +30624,9 @@ declare class AppAuditSinkResource extends APIResource {
|
|
|
30470
30624
|
*
|
|
30471
30625
|
* The new secret signs every batch from now on; the old one stops at once. Update your receiver right away: batches it rejects in between are retried every minute (the position only moves after a 2xx), so nothing is lost, but export stops after 20 failures in a row. Clears the receiver-test proof.
|
|
30472
30626
|
*
|
|
30627
|
+
* Credential: `workspace_key`.
|
|
30628
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
30629
|
+
*
|
|
30473
30630
|
* @param options - Per-request options.
|
|
30474
30631
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
30475
30632
|
* @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.update`.
|
|
@@ -30479,7 +30636,7 @@ declare class AppAuditSinkResource extends APIResource {
|
|
|
30479
30636
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-audit-sink-rotate-secret
|
|
30480
30637
|
* @example
|
|
30481
30638
|
* ```ts
|
|
30482
|
-
* const auditSinkWithSecret = await auth.admin.app("
|
|
30639
|
+
* const auditSinkWithSecret = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").auditSink.rotateSecret();
|
|
30483
30640
|
* ```
|
|
30484
30641
|
*/
|
|
30485
30642
|
rotateSecret(options?: RequestOptions): APIPromise<WithLastResponse<AuditSinkWithSecret>>;
|
|
@@ -30488,6 +30645,9 @@ declare class AppAuditSinkResource extends APIResource {
|
|
|
30488
30645
|
*
|
|
30489
30646
|
* Rows, in order: `destination` (not_set until a sink exists), `test_batch` (pass once the receiver accepted a test batch with the current address and secret; blocked when the last test was refused; carries `test.action: audit_sink.test`, run with `POST /v1/apps/{appId}/audit-sink/test`), and `delivery` (blocked when export stopped after repeated failures, attention while paused or while recent batches fail). Computed from the stored sink on every request; answers 200 whether or not a sink exists.
|
|
30490
30647
|
*
|
|
30648
|
+
* Credential: `workspace_key`.
|
|
30649
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
30650
|
+
*
|
|
30491
30651
|
* @param options - Per-request options.
|
|
30492
30652
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
30493
30653
|
* @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.read`, or the app is suspended or archived.
|
|
@@ -30497,7 +30657,7 @@ declare class AppAuditSinkResource extends APIResource {
|
|
|
30497
30657
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-audit-sink-setup-status
|
|
30498
30658
|
* @example
|
|
30499
30659
|
* ```ts
|
|
30500
|
-
* const setupStatus = await auth.admin.app("
|
|
30660
|
+
* const setupStatus = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").auditSink.setupStatus();
|
|
30501
30661
|
* ```
|
|
30502
30662
|
*/
|
|
30503
30663
|
setupStatus(options?: RequestOptions): APIPromise<WithLastResponse<SetupStatus>>;
|
|
@@ -30506,6 +30666,9 @@ declare class AppAuditSinkResource extends APIResource {
|
|
|
30506
30666
|
*
|
|
30507
30667
|
* POSTs one signed batch, shaped exactly like a real one (`type: audit.batch`, same headers and signature), with `test: true` and a single synthetic record whose `id` starts with `test_`. Works while export is paused or stopped, so a fix can be proven before export is turned back on. The outcome is recorded on the sink (`last_attempt_*`, `last_test_succeeded_at`) but never moves the position in the audit log or counts toward the automatic stop. A refused test is still a 200 with `delivered: false`. At most 20 tests per app per hour.
|
|
30508
30668
|
*
|
|
30669
|
+
* Credential: `workspace_key`.
|
|
30670
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
30671
|
+
*
|
|
30509
30672
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
30510
30673
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
30511
30674
|
* @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.update`.
|
|
@@ -30516,7 +30679,7 @@ declare class AppAuditSinkResource extends APIResource {
|
|
|
30516
30679
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-audit-sink-test
|
|
30517
30680
|
* @example
|
|
30518
30681
|
* ```ts
|
|
30519
|
-
* const auditSinkTestResult = await auth.admin.app("
|
|
30682
|
+
* const auditSinkTestResult = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").auditSink.test();
|
|
30520
30683
|
* ```
|
|
30521
30684
|
*/
|
|
30522
30685
|
test(options?: RequestOptions): APIPromise<WithLastResponse<AuditSinkTestResult>>;
|
|
@@ -30525,6 +30688,9 @@ declare class AppAuditSinkResource extends APIResource {
|
|
|
30525
30688
|
*
|
|
30526
30689
|
* Send `url`, `enabled` or both. `enabled: false` pauses export; `enabled: true` resumes it and clears a stop after repeated failures and the failure count. The position in the audit log is never moved: nothing is skipped and nothing is replayed twice on purpose. A new `url` is checked by the same address guard as `PUT`.
|
|
30527
30690
|
*
|
|
30691
|
+
* Credential: `workspace_key`.
|
|
30692
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
30693
|
+
*
|
|
30528
30694
|
* @param params - `Auth.AuditSinkUpdateParams`.
|
|
30529
30695
|
* @param options - Per-request options.
|
|
30530
30696
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: URL is not HTTPS, or the address guard refused it (private address, unresolvable host).
|
|
@@ -30536,7 +30702,7 @@ declare class AppAuditSinkResource extends APIResource {
|
|
|
30536
30702
|
* @see https://productcraft.co/docs/auth/api-reference#patch-v1-apps-app-id-audit-sink
|
|
30537
30703
|
* @example
|
|
30538
30704
|
* ```ts
|
|
30539
|
-
* const auditSink = await auth.admin.app("
|
|
30705
|
+
* const auditSink = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").auditSink.update({ enabled: true });
|
|
30540
30706
|
* ```
|
|
30541
30707
|
*/
|
|
30542
30708
|
update(params?: AuditSinkUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<AuditSink>>;
|
|
@@ -30548,6 +30714,9 @@ declare class AppAuthConfigProvidersResource extends APIResource {
|
|
|
30548
30714
|
*
|
|
30549
30715
|
* Calls the provider's token endpoint with a dummy sign-in code. If the provider refuses the client (`invalid_client`, GitHub `incorrect_client_credentials` or `unknown_client`), the result is `credentials_rejected` and the provider shows as `blocked` with reason `credentials_rejected` until the credentials are fixed. If it only refuses the code (`invalid_grant`, `bad_verification_code`), the credentials are valid. Nobody is signed in. The result is saved on the provider (`last_check_*`). The same check runs automatically whenever the credentials are saved. Works for a provider that is saved but not switched on yet.
|
|
30550
30716
|
*
|
|
30717
|
+
* Credential: `workspace_key`.
|
|
30718
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
30719
|
+
*
|
|
30551
30720
|
* @param provider - The sign-in provider: `google`, `github` or `apple`.
|
|
30552
30721
|
* @param options - Per-request options.
|
|
30553
30722
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Unknown provider id, or the saved config can no longer be read.
|
|
@@ -30559,13 +30728,16 @@ declare class AppAuthConfigProvidersResource extends APIResource {
|
|
|
30559
30728
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-auth-config-providers-provider-check
|
|
30560
30729
|
* @example
|
|
30561
30730
|
* ```ts
|
|
30562
|
-
* const providerCheck = await auth.admin.app("
|
|
30731
|
+
* const providerCheck = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").authConfig.providers.check("google");
|
|
30563
30732
|
* ```
|
|
30564
30733
|
*/
|
|
30565
30734
|
check(provider: string, options?: RequestOptions): APIPromise<WithLastResponse<ProviderCheck>>;
|
|
30566
30735
|
/**
|
|
30567
30736
|
* Remove the config for an (app, provider). Existing identity rows (people who already signed in with this provider) stay; they just lose the ability to sign in again until config is re-uploaded.
|
|
30568
30737
|
*
|
|
30738
|
+
* Credential: `workspace_key`.
|
|
30739
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
30740
|
+
*
|
|
30569
30741
|
* @param provider - The sign-in provider: `google`, `github` or `apple`.
|
|
30570
30742
|
* @param options - Per-request options.
|
|
30571
30743
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Unknown provider id.
|
|
@@ -30575,7 +30747,7 @@ declare class AppAuthConfigProvidersResource extends APIResource {
|
|
|
30575
30747
|
* @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id-auth-config-providers-provider
|
|
30576
30748
|
* @example
|
|
30577
30749
|
* ```ts
|
|
30578
|
-
* await auth.admin.app("
|
|
30750
|
+
* await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").authConfig.providers.delete("google");
|
|
30579
30751
|
* ```
|
|
30580
30752
|
*/
|
|
30581
30753
|
delete(provider: string, options?: RequestOptions): APIPromise<void>;
|
|
@@ -30584,6 +30756,9 @@ declare class AppAuthConfigProvidersResource extends APIResource {
|
|
|
30584
30756
|
*
|
|
30585
30757
|
* Each entry carries `status` (`ready` | `blocked` | `disabled` | `not_configured`) and `blocked_reasons`, computed on the server with the same rule the web sign-in flow enforces, so a provider shown as `ready` is one people can actually sign in with.
|
|
30586
30758
|
*
|
|
30759
|
+
* Credential: `workspace_key`.
|
|
30760
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
30761
|
+
*
|
|
30587
30762
|
* @param options - Per-request options.
|
|
30588
30763
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
|
|
30589
30764
|
* @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.read` on this app, or the app is suspended or archived.
|
|
@@ -30593,13 +30768,16 @@ declare class AppAuthConfigProvidersResource extends APIResource {
|
|
|
30593
30768
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-auth-config-providers
|
|
30594
30769
|
* @example
|
|
30595
30770
|
* ```ts
|
|
30596
|
-
* const result = await auth.admin.app("
|
|
30771
|
+
* const result = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").authConfig.providers.list();
|
|
30597
30772
|
* ```
|
|
30598
30773
|
*/
|
|
30599
30774
|
list(options?: RequestOptions): APIPromise<WithLastResponse<AuthConfigProviderListResponse>>;
|
|
30600
30775
|
/**
|
|
30601
30776
|
* Write or replace the config for an (app, provider). Validates the body via the provider impl's `parseConfig` before encrypting; malformed config 400s. Default `enabled=false`.
|
|
30602
30777
|
*
|
|
30778
|
+
* Credential: `workspace_key`.
|
|
30779
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
30780
|
+
*
|
|
30603
30781
|
* @param provider - The sign-in provider: `google`, `github` or `apple`.
|
|
30604
30782
|
* @param params - `Auth.AuthConfigProviderReplaceParams`.
|
|
30605
30783
|
* @param options - Per-request options.
|
|
@@ -30610,13 +30788,16 @@ declare class AppAuthConfigProvidersResource extends APIResource {
|
|
|
30610
30788
|
* @see https://productcraft.co/docs/auth/api-reference#put-v1-apps-app-id-auth-config-providers-provider
|
|
30611
30789
|
* @example
|
|
30612
30790
|
* ```ts
|
|
30613
|
-
* const providerDetail = await auth.admin.app("
|
|
30791
|
+
* const providerDetail = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").authConfig.providers.replace("google", { config: {} });
|
|
30614
30792
|
* ```
|
|
30615
30793
|
*/
|
|
30616
30794
|
replace(provider: string, params: AuthConfigProviderReplaceParams, options?: RequestOptions): APIPromise<WithLastResponse<ProviderDetail>>;
|
|
30617
30795
|
/**
|
|
30618
30796
|
* Get the config for one (app, provider). Secrets are redacted — `private_key_present: true` is the only acknowledgement that a private key is on file.
|
|
30619
30797
|
*
|
|
30798
|
+
* Credential: `workspace_key`.
|
|
30799
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
30800
|
+
*
|
|
30620
30801
|
* @param provider - The sign-in provider: `google`, `github` or `apple`.
|
|
30621
30802
|
* @param options - Per-request options.
|
|
30622
30803
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Unknown provider id.
|
|
@@ -30627,13 +30808,16 @@ declare class AppAuthConfigProvidersResource extends APIResource {
|
|
|
30627
30808
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-auth-config-providers-provider
|
|
30628
30809
|
* @example
|
|
30629
30810
|
* ```ts
|
|
30630
|
-
* const providerDetail = await auth.admin.app("
|
|
30811
|
+
* const providerDetail = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").authConfig.providers.retrieve("google");
|
|
30631
30812
|
* ```
|
|
30632
30813
|
*/
|
|
30633
30814
|
retrieve(provider: string, options?: RequestOptions): APIPromise<WithLastResponse<ProviderDetail>>;
|
|
30634
30815
|
/**
|
|
30635
30816
|
* Partially update the config for an (app, provider). Only top-level keys present in `config` are changed; omitted keys — secrets included — keep their stored values. The merged config is validated by the provider impl's `parseConfig`; 404 if the provider is not configured yet (create it with PUT).
|
|
30636
30817
|
*
|
|
30818
|
+
* Credential: `workspace_key`.
|
|
30819
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
30820
|
+
*
|
|
30637
30821
|
* @param provider - The sign-in provider: `google`, `github` or `apple`.
|
|
30638
30822
|
* @param params - `Auth.AuthConfigProviderUpdateParams`.
|
|
30639
30823
|
* @param options - Per-request options.
|
|
@@ -30645,7 +30829,7 @@ declare class AppAuthConfigProvidersResource extends APIResource {
|
|
|
30645
30829
|
* @see https://productcraft.co/docs/auth/api-reference#patch-v1-apps-app-id-auth-config-providers-provider
|
|
30646
30830
|
* @example
|
|
30647
30831
|
* ```ts
|
|
30648
|
-
* const providerDetail = await auth.admin.app("
|
|
30832
|
+
* const providerDetail = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").authConfig.providers.update("google", { config: {} });
|
|
30649
30833
|
* ```
|
|
30650
30834
|
*/
|
|
30651
30835
|
update(provider: string, params?: AuthConfigProviderUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<ProviderDetail>>;
|
|
@@ -30657,6 +30841,9 @@ declare class AppAuthConfigResource extends APIResource {
|
|
|
30657
30841
|
/**
|
|
30658
30842
|
* Get the per-app auth config (signup, signin, password policy, sessions).
|
|
30659
30843
|
*
|
|
30844
|
+
* Credential: `workspace_key`.
|
|
30845
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
30846
|
+
*
|
|
30660
30847
|
* @param options - Per-request options.
|
|
30661
30848
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
|
|
30662
30849
|
* @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.read` on this app, or the app is suspended or archived.
|
|
@@ -30666,13 +30853,16 @@ declare class AppAuthConfigResource extends APIResource {
|
|
|
30666
30853
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-auth-config
|
|
30667
30854
|
* @example
|
|
30668
30855
|
* ```ts
|
|
30669
|
-
* const authConfig = await auth.admin.app("
|
|
30856
|
+
* const authConfig = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").authConfig.retrieve();
|
|
30670
30857
|
* ```
|
|
30671
30858
|
*/
|
|
30672
30859
|
retrieve(options?: RequestOptions): APIPromise<WithLastResponse<AuthConfig>>;
|
|
30673
30860
|
/**
|
|
30674
30861
|
* Update the per-app auth config. Only fields you pass are changed.
|
|
30675
30862
|
*
|
|
30863
|
+
* Credential: `workspace_key`.
|
|
30864
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
30865
|
+
*
|
|
30676
30866
|
* @param params - `Auth.AuthConfigUpdateParams`.
|
|
30677
30867
|
* @param options - Per-request options.
|
|
30678
30868
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failure — a value out of range (password length, token/session lifetimes, lockout threshold, max sessions, MFA grace days, unverified-account window), an unknown enum value, a `signup_default_role` that does not exist in this app, or a `bot_protection` change that cannot stand: no provider or site key on first setup, a hostname that is not a hostname, or `enabled: true` with no secret stored or sent.
|
|
@@ -30685,7 +30875,7 @@ declare class AppAuthConfigResource extends APIResource {
|
|
|
30685
30875
|
* @see https://productcraft.co/docs/auth/api-reference#patch-v1-apps-app-id-auth-config
|
|
30686
30876
|
* @example
|
|
30687
30877
|
* ```ts
|
|
30688
|
-
* const authConfig = await auth.admin.app("
|
|
30878
|
+
* const authConfig = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").authConfig.update({ access_token_minutes: 60 });
|
|
30689
30879
|
* ```
|
|
30690
30880
|
*/
|
|
30691
30881
|
update(params?: AuthConfigUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<AuthConfig>>;
|
|
@@ -30701,6 +30891,9 @@ declare class AppCredentialsResource extends APIResource {
|
|
|
30701
30891
|
/**
|
|
30702
30892
|
* Create a new M2M client
|
|
30703
30893
|
*
|
|
30894
|
+
* Credential: `workspace_key`.
|
|
30895
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
30896
|
+
*
|
|
30704
30897
|
* @param params - `Auth.CredentialCreateParams`.
|
|
30705
30898
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
30706
30899
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failure (missing or invalid name).
|
|
@@ -30713,13 +30906,16 @@ declare class AppCredentialsResource extends APIResource {
|
|
|
30713
30906
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-credentials
|
|
30714
30907
|
* @example
|
|
30715
30908
|
* ```ts
|
|
30716
|
-
* const m2mClientCreate = await auth.admin.app("
|
|
30909
|
+
* const m2mClientCreate = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").credentials.create({ name: "CI Pipeline" });
|
|
30717
30910
|
* ```
|
|
30718
30911
|
*/
|
|
30719
30912
|
create(params: CredentialCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<M2mClientCreate>>;
|
|
30720
30913
|
/**
|
|
30721
30914
|
* Delete an M2M client
|
|
30722
30915
|
*
|
|
30916
|
+
* Credential: `workspace_key`.
|
|
30917
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
30918
|
+
*
|
|
30723
30919
|
* @param clientId - Id of the client.
|
|
30724
30920
|
* @param options - Per-request options.
|
|
30725
30921
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
@@ -30730,13 +30926,16 @@ declare class AppCredentialsResource extends APIResource {
|
|
|
30730
30926
|
* @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id-credentials-client-id
|
|
30731
30927
|
* @example
|
|
30732
30928
|
* ```ts
|
|
30733
|
-
* await auth.admin.app("
|
|
30929
|
+
* await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").credentials.delete("m2m_a1b2c3d4e5f6");
|
|
30734
30930
|
* ```
|
|
30735
30931
|
*/
|
|
30736
30932
|
delete(clientId: string, options?: RequestOptions): APIPromise<void>;
|
|
30737
30933
|
/**
|
|
30738
30934
|
* List M2M clients
|
|
30739
30935
|
*
|
|
30936
|
+
* Credential: `workspace_key`.
|
|
30937
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
30938
|
+
*
|
|
30740
30939
|
* @param params - `Auth.CredentialListParams`.
|
|
30741
30940
|
* @param options - Per-request options.
|
|
30742
30941
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
|
|
@@ -30747,16 +30946,19 @@ declare class AppCredentialsResource extends APIResource {
|
|
|
30747
30946
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-credentials
|
|
30748
30947
|
* @example
|
|
30749
30948
|
* ```ts
|
|
30750
|
-
* for await (const credential of auth.admin.app("
|
|
30949
|
+
* for await (const credential of auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").credentials.list()) {
|
|
30751
30950
|
* console.log(credential);
|
|
30752
30951
|
* }
|
|
30753
|
-
* const page = await auth.admin.app("
|
|
30952
|
+
* const page = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").credentials.list({}, { timeout: 5_000 });
|
|
30754
30953
|
* ```
|
|
30755
30954
|
*/
|
|
30756
30955
|
list(params?: CredentialListParams, options?: RequestOptions): PagePromise<M2mClientSummary>;
|
|
30757
30956
|
/**
|
|
30758
30957
|
* Get M2M client details
|
|
30759
30958
|
*
|
|
30959
|
+
* Credential: `workspace_key`.
|
|
30960
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
30961
|
+
*
|
|
30760
30962
|
* @param clientId - Id of the client.
|
|
30761
30963
|
* @param options - Per-request options.
|
|
30762
30964
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
|
|
@@ -30767,13 +30969,16 @@ declare class AppCredentialsResource extends APIResource {
|
|
|
30767
30969
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-credentials-client-id
|
|
30768
30970
|
* @example
|
|
30769
30971
|
* ```ts
|
|
30770
|
-
* const m2mClientDetail = await auth.admin.app("
|
|
30972
|
+
* const m2mClientDetail = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").credentials.retrieve("m2m_a1b2c3d4e5f6");
|
|
30771
30973
|
* ```
|
|
30772
30974
|
*/
|
|
30773
30975
|
retrieve(clientId: string, options?: RequestOptions): APIPromise<WithLastResponse<M2mClientDetail>>;
|
|
30774
30976
|
/**
|
|
30775
30977
|
* Rotate M2M client secret
|
|
30776
30978
|
*
|
|
30979
|
+
* Credential: `workspace_key`.
|
|
30980
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
30981
|
+
*
|
|
30777
30982
|
* @param clientId - Id of the client.
|
|
30778
30983
|
* @param options - Per-request options.
|
|
30779
30984
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
@@ -30784,13 +30989,16 @@ declare class AppCredentialsResource extends APIResource {
|
|
|
30784
30989
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-credentials-client-id-rotate
|
|
30785
30990
|
* @example
|
|
30786
30991
|
* ```ts
|
|
30787
|
-
* const m2mRotateSecret = await auth.admin.app("
|
|
30992
|
+
* const m2mRotateSecret = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").credentials.rotate("m2m_a1b2c3d4e5f6");
|
|
30788
30993
|
* ```
|
|
30789
30994
|
*/
|
|
30790
30995
|
rotate(clientId: string, options?: RequestOptions): APIPromise<WithLastResponse<M2mRotateSecret>>;
|
|
30791
30996
|
/**
|
|
30792
30997
|
* Update M2M client status
|
|
30793
30998
|
*
|
|
30999
|
+
* Credential: `workspace_key`.
|
|
31000
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31001
|
+
*
|
|
30794
31002
|
* @param clientId - Id of the client.
|
|
30795
31003
|
* @param params - `Auth.CredentialUpdateParams`.
|
|
30796
31004
|
* @param options - Per-request options.
|
|
@@ -30803,13 +31011,16 @@ declare class AppCredentialsResource extends APIResource {
|
|
|
30803
31011
|
* @see https://productcraft.co/docs/auth/api-reference#patch-v1-apps-app-id-credentials-client-id
|
|
30804
31012
|
* @example
|
|
30805
31013
|
* ```ts
|
|
30806
|
-
* const m2mClientDetail = await auth.admin.app("
|
|
31014
|
+
* const m2mClientDetail = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").credentials.update("m2m_a1b2c3d4e5f6", { is_active: true });
|
|
30807
31015
|
* ```
|
|
30808
31016
|
*/
|
|
30809
31017
|
update(clientId: string, params?: CredentialUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<M2mClientDetail>>;
|
|
30810
31018
|
/**
|
|
30811
31019
|
* Set scopes for an M2M client
|
|
30812
31020
|
*
|
|
31021
|
+
* Credential: `workspace_key`.
|
|
31022
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31023
|
+
*
|
|
30813
31024
|
* @param clientId - Id of the client.
|
|
30814
31025
|
* @param params - `Auth.CredentialUpdateScopesParams`.
|
|
30815
31026
|
* @param options - Per-request options.
|
|
@@ -30822,7 +31033,7 @@ declare class AppCredentialsResource extends APIResource {
|
|
|
30822
31033
|
* @see https://productcraft.co/docs/auth/api-reference#put-v1-apps-app-id-credentials-client-id-scopes
|
|
30823
31034
|
* @example
|
|
30824
31035
|
* ```ts
|
|
30825
|
-
* const result = await auth.admin.app("
|
|
31036
|
+
* const result = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").credentials.updateScopes("m2m_a1b2c3d4e5f6", { permissions: ["user.read", "app.read"] });
|
|
30826
31037
|
* ```
|
|
30827
31038
|
*/
|
|
30828
31039
|
updateScopes(clientId: string, params: CredentialUpdateScopesParams, options?: RequestOptions): APIPromise<WithLastResponse<CredentialUpdateScopesResponse>>;
|
|
@@ -30852,6 +31063,9 @@ declare class AppCustomDomainsResource extends APIResource {
|
|
|
30852
31063
|
*
|
|
30853
31064
|
* Reads the zone through the provider's API and plans both records: `create`, or `skip` when already there. Nothing is ever changed or deleted, and only names at or under the custom host are written (Cloudflare records are DNS-only, not proxied). Anything in the way (another CNAME at the host, A/MX/TXT records where the CNAME must go) refuses the whole apply with 409 and the plan, before anything is written. `dry_run: true` returns the plan and changes nothing; `dry_run: false` writes exactly that plan and runs a check straight away (the records are usually `propagating` for a few minutes). The token is used for this request only: never stored, logged, queued or returned; revoke it afterwards (`warnings` says so when it could see more than this zone).
|
|
30854
31065
|
*
|
|
31066
|
+
* Credential: `workspace_key`.
|
|
31067
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31068
|
+
*
|
|
30855
31069
|
* @param domainId - Id of the domain.
|
|
30856
31070
|
* @param params - `Auth.CustomDomainApplyParams`.
|
|
30857
31071
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
@@ -30866,7 +31080,7 @@ declare class AppCustomDomainsResource extends APIResource {
|
|
|
30866
31080
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-custom-domains-domain-id-apply
|
|
30867
31081
|
* @example
|
|
30868
31082
|
* ```ts
|
|
30869
|
-
* const customDomainApplyResult = await auth.admin.app("
|
|
31083
|
+
* const customDomainApplyResult = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").customDomains.apply("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { dry_run: true, provider: "cloudflare", token: "cf-token-from-your-dashboard" });
|
|
30870
31084
|
* ```
|
|
30871
31085
|
*/
|
|
30872
31086
|
apply(domainId: string, params: CustomDomainApplyParams, options?: RequestOptions): APIPromise<WithLastResponse<CustomDomainApplyResult>>;
|
|
@@ -30875,6 +31089,9 @@ declare class AppCustomDomainsResource extends APIResource {
|
|
|
30875
31089
|
*
|
|
30876
31090
|
* Asks the zone's own nameservers and a public resolver for both records, stores each record's state and conflicts, and moves the status: `active` once both are verified; an active domain turns `failing` only when a record is definitely gone or blocked (a DNS outage never takes a working domain down). Safe to repeat.
|
|
30877
31091
|
*
|
|
31092
|
+
* Credential: `workspace_key`.
|
|
31093
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31094
|
+
*
|
|
30878
31095
|
* @param domainId - Id of the domain.
|
|
30879
31096
|
* @param options - Per-request options.
|
|
30880
31097
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `domainId` is not a UUID.
|
|
@@ -30886,7 +31103,7 @@ declare class AppCustomDomainsResource extends APIResource {
|
|
|
30886
31103
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-custom-domains-domain-id-check
|
|
30887
31104
|
* @example
|
|
30888
31105
|
* ```ts
|
|
30889
|
-
* const customDomain = await auth.admin.app("
|
|
31106
|
+
* const customDomain = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").customDomains.check("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
30890
31107
|
* ```
|
|
30891
31108
|
*/
|
|
30892
31109
|
check(domainId: string, options?: RequestOptions): APIPromise<WithLastResponse<CustomDomain>>;
|
|
@@ -30895,6 +31112,9 @@ declare class AppCustomDomainsResource extends APIResource {
|
|
|
30895
31112
|
*
|
|
30896
31113
|
* Returns the two records to publish: a CNAME from the host to `edge_target`, and a TXT token at `_productcraft-auth.<host>` that proves the domain is yours. The zone and its DNS provider are detected, and the first check runs straight away, so `records[].state` and `conflicts` already say what is missing or in the way. Publish the records by hand, import `…/export`, or let `…/apply` write them with a short-lived provider token. The domain turns `active` once both records are seen. Sign-in tokens keep the canonical issuer (`https://api.auth.productcraft.co/{slug}`), so nothing changes for code that verifies them. One custom domain per app. While the feature is in early access it is switched on per workspace.
|
|
30897
31114
|
*
|
|
31115
|
+
* Credential: `workspace_key`.
|
|
31116
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31117
|
+
*
|
|
30898
31118
|
* @param params - `Auth.CustomDomainCreateParams`.
|
|
30899
31119
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
30900
31120
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, INVALID_HOSTNAME, HOSTNAME_RESERVED, APEX_NOT_SUPPORTED: Not a usable host name (`INVALID_HOSTNAME`), one of ours (`HOSTNAME_RESERVED`), or the root of a DNS zone, which cannot hold a CNAME (`APEX_NOT_SUPPORTED`).
|
|
@@ -30907,7 +31127,7 @@ declare class AppCustomDomainsResource extends APIResource {
|
|
|
30907
31127
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-custom-domains
|
|
30908
31128
|
* @example
|
|
30909
31129
|
* ```ts
|
|
30910
|
-
* const customDomain = await auth.admin.app("
|
|
31130
|
+
* const customDomain = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").customDomains.create({ hostname: "auth.acme.com" });
|
|
30911
31131
|
* ```
|
|
30912
31132
|
*/
|
|
30913
31133
|
create(params: CustomDomainCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<CustomDomain>>;
|
|
@@ -30916,6 +31136,9 @@ declare class AppCustomDomainsResource extends APIResource {
|
|
|
30916
31136
|
*
|
|
30917
31137
|
* The host stops serving this app at once and its certificate is no longer renewed. Your DNS records are not touched: delete the CNAME and the `_productcraft-auth` TXT record at your DNS provider. Sign-ins on the canonical host are unaffected.
|
|
30918
31138
|
*
|
|
31139
|
+
* Credential: `workspace_key`.
|
|
31140
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31141
|
+
*
|
|
30919
31142
|
* @param domainId - Id of the domain.
|
|
30920
31143
|
* @param options - Per-request options.
|
|
30921
31144
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `domainId` is not a UUID.
|
|
@@ -30927,7 +31150,7 @@ declare class AppCustomDomainsResource extends APIResource {
|
|
|
30927
31150
|
* @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id-custom-domains-domain-id
|
|
30928
31151
|
* @example
|
|
30929
31152
|
* ```ts
|
|
30930
|
-
* await auth.admin.app("
|
|
31153
|
+
* await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").customDomains.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
30931
31154
|
* ```
|
|
30932
31155
|
*/
|
|
30933
31156
|
delete(domainId: string, options?: RequestOptions): APIPromise<void>;
|
|
@@ -30936,6 +31159,9 @@ declare class AppCustomDomainsResource extends APIResource {
|
|
|
30936
31159
|
*
|
|
30937
31160
|
* `format=bind`: a zone-file fragment (`$ORIGIN <zone>.`, `$TTL 3600`, names relative to the zone, a comment per record with its purpose and any conflict) that Cloudflare and Route 53 import directly. `format=csv`: `type,name,value,priority,ttl,purpose,required`, fully qualified names. By default only records not verified yet; `all=true` for both. Served as an attachment.
|
|
30938
31161
|
*
|
|
31162
|
+
* Credential: `workspace_key`.
|
|
31163
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31164
|
+
*
|
|
30939
31165
|
* @param domainId - Id of the domain.
|
|
30940
31166
|
* @param params - `Auth.CustomDomainExportParams`.
|
|
30941
31167
|
* @param options - Per-request options.
|
|
@@ -30948,7 +31174,7 @@ declare class AppCustomDomainsResource extends APIResource {
|
|
|
30948
31174
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-custom-domains-domain-id-export
|
|
30949
31175
|
* @example
|
|
30950
31176
|
* ```ts
|
|
30951
|
-
* const response = await auth.admin.app("
|
|
31177
|
+
* const response = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").customDomains.export("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { format: "bind" });
|
|
30952
31178
|
* const text = await response.text();
|
|
30953
31179
|
* ```
|
|
30954
31180
|
*/
|
|
@@ -30958,6 +31184,9 @@ declare class AppCustomDomainsResource extends APIResource {
|
|
|
30958
31184
|
*
|
|
30959
31185
|
* Each with its status and the last check of its records, plus `available`: whether custom domains are switched on for the workspace. Always a single page.
|
|
30960
31186
|
*
|
|
31187
|
+
* Credential: `workspace_key`.
|
|
31188
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31189
|
+
*
|
|
30961
31190
|
* @param options - Per-request options.
|
|
30962
31191
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
|
|
30963
31192
|
* @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.read` on this app, or the app is suspended or archived.
|
|
@@ -30967,7 +31196,7 @@ declare class AppCustomDomainsResource extends APIResource {
|
|
|
30967
31196
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-custom-domains
|
|
30968
31197
|
* @example
|
|
30969
31198
|
* ```ts
|
|
30970
|
-
* for await (const customDomain of auth.admin.app("
|
|
31199
|
+
* for await (const customDomain of auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").customDomains.list()) {
|
|
30971
31200
|
* console.log(customDomain);
|
|
30972
31201
|
* }
|
|
30973
31202
|
* ```
|
|
@@ -30978,6 +31207,9 @@ declare class AppCustomDomainsResource extends APIResource {
|
|
|
30978
31207
|
*
|
|
30979
31208
|
* Reads stored state only; `POST …/check` runs a new DNS check.
|
|
30980
31209
|
*
|
|
31210
|
+
* Credential: `workspace_key`.
|
|
31211
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31212
|
+
*
|
|
30981
31213
|
* @param domainId - Id of the domain.
|
|
30982
31214
|
* @param options - Per-request options.
|
|
30983
31215
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `domainId` is not a UUID.
|
|
@@ -30989,7 +31221,7 @@ declare class AppCustomDomainsResource extends APIResource {
|
|
|
30989
31221
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-custom-domains-domain-id
|
|
30990
31222
|
* @example
|
|
30991
31223
|
* ```ts
|
|
30992
|
-
* const customDomain = await auth.admin.app("
|
|
31224
|
+
* const customDomain = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").customDomains.retrieve("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
30993
31225
|
* ```
|
|
30994
31226
|
*/
|
|
30995
31227
|
retrieve(domainId: string, options?: RequestOptions): APIPromise<WithLastResponse<CustomDomain>>;
|
|
@@ -30999,6 +31231,9 @@ declare class AppEndUserInsightsUsersResource extends APIResource {
|
|
|
30999
31231
|
/**
|
|
31000
31232
|
* One end-user's recorded activity: their audit trail, their sessions with device/IP, and their enrolled factors. `noActivityRecorded` distinguishes "nothing happened" from "no data".
|
|
31001
31233
|
*
|
|
31234
|
+
* Credential: `workspace_key`.
|
|
31235
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31236
|
+
*
|
|
31002
31237
|
* @param userId - Id of the user.
|
|
31003
31238
|
* @param options - Per-request options.
|
|
31004
31239
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `appId` or `userId` is not a UUID.
|
|
@@ -31010,7 +31245,7 @@ declare class AppEndUserInsightsUsersResource extends APIResource {
|
|
|
31010
31245
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-end-user-insights-users-user-id
|
|
31011
31246
|
* @example
|
|
31012
31247
|
* ```ts
|
|
31013
|
-
* const endUserDetailInsights = await auth.admin.app("
|
|
31248
|
+
* const endUserDetailInsights = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUserInsights.users.retrieve("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
31014
31249
|
* ```
|
|
31015
31250
|
*/
|
|
31016
31251
|
retrieve(userId: string, options?: RequestOptions): APIPromise<WithLastResponse<EndUserDetailInsights>>;
|
|
@@ -31022,6 +31257,9 @@ declare class AppEndUserInsightsResource extends APIResource {
|
|
|
31022
31257
|
/**
|
|
31023
31258
|
* Auth health for this app over the last 30 days: verification completion, sign-in failure rate, MFA adoption, password-reset follow-through, and session counts. Rates are null when there is nothing to divide by.
|
|
31024
31259
|
*
|
|
31260
|
+
* Credential: `workspace_key`.
|
|
31261
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31262
|
+
*
|
|
31025
31263
|
* @param options - Per-request options.
|
|
31026
31264
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `appId` is not a UUID.
|
|
31027
31265
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
@@ -31031,7 +31269,7 @@ declare class AppEndUserInsightsResource extends APIResource {
|
|
|
31031
31269
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-end-user-insights
|
|
31032
31270
|
* @example
|
|
31033
31271
|
* ```ts
|
|
31034
|
-
* const endUserInsights = await auth.admin.app("
|
|
31272
|
+
* const endUserInsights = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUserInsights.retrieve();
|
|
31035
31273
|
* ```
|
|
31036
31274
|
*/
|
|
31037
31275
|
retrieve(options?: RequestOptions): APIPromise<WithLastResponse<EndUserInsights>>;
|
|
@@ -31041,6 +31279,9 @@ declare class AppEndUsersContactsResource extends APIResource {
|
|
|
31041
31279
|
/**
|
|
31042
31280
|
* Add a contact for an end-user (unverified).
|
|
31043
31281
|
*
|
|
31282
|
+
* Credential: `workspace_key`.
|
|
31283
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31284
|
+
*
|
|
31044
31285
|
* @param userId - Id of the user.
|
|
31045
31286
|
* @param params - `Auth.EndUserContactCreateParams`.
|
|
31046
31287
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
@@ -31054,13 +31295,16 @@ declare class AppEndUsersContactsResource extends APIResource {
|
|
|
31054
31295
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-end-users-user-id-contacts
|
|
31055
31296
|
* @example
|
|
31056
31297
|
* ```ts
|
|
31057
|
-
* const accountContact = await auth.admin.app("
|
|
31298
|
+
* const accountContact = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.contacts.create("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { type: "email", value: "ada@example.com" });
|
|
31058
31299
|
* ```
|
|
31059
31300
|
*/
|
|
31060
31301
|
create(userId: string, params: EndUserContactCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<AccountContact>>;
|
|
31061
31302
|
/**
|
|
31062
31303
|
* Delete a contact from an end-user.
|
|
31063
31304
|
*
|
|
31305
|
+
* Credential: `workspace_key`.
|
|
31306
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31307
|
+
*
|
|
31064
31308
|
* @param userId - Id of the user.
|
|
31065
31309
|
* @param contactId - Id of the contact.
|
|
31066
31310
|
* @param options - Per-request options.
|
|
@@ -31073,13 +31317,16 @@ declare class AppEndUsersContactsResource extends APIResource {
|
|
|
31073
31317
|
* @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id-end-users-user-id-contacts-contact-id
|
|
31074
31318
|
* @example
|
|
31075
31319
|
* ```ts
|
|
31076
|
-
* await auth.admin.app("
|
|
31320
|
+
* await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.contacts.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
31077
31321
|
* ```
|
|
31078
31322
|
*/
|
|
31079
31323
|
delete(userId: string, contactId: string, options?: RequestOptions): APIPromise<void>;
|
|
31080
31324
|
/**
|
|
31081
31325
|
* List an end-user's contacts.
|
|
31082
31326
|
*
|
|
31327
|
+
* Credential: `workspace_key`.
|
|
31328
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31329
|
+
*
|
|
31083
31330
|
* @param userId - Id of the user.
|
|
31084
31331
|
* @param options - Per-request options.
|
|
31085
31332
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
|
|
@@ -31090,13 +31337,16 @@ declare class AppEndUsersContactsResource extends APIResource {
|
|
|
31090
31337
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-end-users-user-id-contacts
|
|
31091
31338
|
* @example
|
|
31092
31339
|
* ```ts
|
|
31093
|
-
* const accountContactList = await auth.admin.app("
|
|
31340
|
+
* const accountContactList = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.contacts.list("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
31094
31341
|
* ```
|
|
31095
31342
|
*/
|
|
31096
31343
|
list(userId: string, options?: RequestOptions): APIPromise<WithLastResponse<AccountContactList>>;
|
|
31097
31344
|
/**
|
|
31098
31345
|
* Promote a verified contact to primary.
|
|
31099
31346
|
*
|
|
31347
|
+
* Credential: `workspace_key`.
|
|
31348
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31349
|
+
*
|
|
31100
31350
|
* @param userId - Id of the user.
|
|
31101
31351
|
* @param contactId - Id of the contact.
|
|
31102
31352
|
* @param options - Per-request options.
|
|
@@ -31109,13 +31359,16 @@ declare class AppEndUsersContactsResource extends APIResource {
|
|
|
31109
31359
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-end-users-user-id-contacts-contact-id-promote
|
|
31110
31360
|
* @example
|
|
31111
31361
|
* ```ts
|
|
31112
|
-
* await auth.admin.app("
|
|
31362
|
+
* await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.contacts.promote("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
31113
31363
|
* ```
|
|
31114
31364
|
*/
|
|
31115
31365
|
promote(userId: string, contactId: string, options?: RequestOptions): APIPromise<void>;
|
|
31116
31366
|
/**
|
|
31117
31367
|
* Reissue a verification code for a contact.
|
|
31118
31368
|
*
|
|
31369
|
+
* Credential: `workspace_key`.
|
|
31370
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31371
|
+
*
|
|
31119
31372
|
* @param userId - Id of the user.
|
|
31120
31373
|
* @param contactId - Id of the contact.
|
|
31121
31374
|
* @param options - Per-request options.
|
|
@@ -31128,7 +31381,7 @@ declare class AppEndUsersContactsResource extends APIResource {
|
|
|
31128
31381
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-end-users-user-id-contacts-contact-id-resend-verification
|
|
31129
31382
|
* @example
|
|
31130
31383
|
* ```ts
|
|
31131
|
-
* const issuedVerificationCode = await auth.admin.app("
|
|
31384
|
+
* const issuedVerificationCode = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.contacts.resendVerification("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
31132
31385
|
* ```
|
|
31133
31386
|
*/
|
|
31134
31387
|
resendVerification(userId: string, contactId: string, options?: RequestOptions): APIPromise<WithLastResponse<IssuedVerificationCode>>;
|
|
@@ -31140,6 +31393,9 @@ declare class AppEndUsersImportsResource extends APIResource {
|
|
|
31140
31393
|
*
|
|
31141
31394
|
* Row fields: `email` (required), `username`, `display_name`, `role`, `tenant_slugs` (array), `external_id`, `metadata`, `email_verified`, and `password_hash` + `password_hash_algorithm`. `password_hash_algorithm` is `argon2id` or `bcrypt`. **argon2id** hashes are accepted at any parameters. **bcrypt** hashes (`$2a$`, `$2b$`, `$2y$` — Auth0, PHP `password_hash`, Spring, node `bcrypt`, Devise / Rails, Laravel, Django) are accepted at any valid cost (4-31), verified on the user's first signin and replaced by an argon2id hash of the same password in that request, so the user keeps their password and never notices. Signin pads a bcrypt verify up to the argon2id floor, so at cost 10 and below an imported account cannot be told apart by timing; at cost 11 and above the verify is slower than the floor and answers when it finishes — a small timing difference on migrated accounts only, gone after each one's first signin. A re-run is idempotent: rows match on `external_id` first, then the primary email, and update rather than duplicate. An existing password, an already-verified address and an existing member's role are never overwritten — see the module docs for why each one.
|
|
31142
31395
|
*
|
|
31396
|
+
* Credential: `workspace_key`.
|
|
31397
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31398
|
+
*
|
|
31143
31399
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
31144
31400
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Body is empty or contains no NDJSON rows.
|
|
31145
31401
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
@@ -31151,7 +31407,7 @@ declare class AppEndUsersImportsResource extends APIResource {
|
|
|
31151
31407
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-end-users-import
|
|
31152
31408
|
* @example
|
|
31153
31409
|
* ```ts
|
|
31154
|
-
* const importJob = await auth.admin.app("
|
|
31410
|
+
* const importJob = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.imports.create();
|
|
31155
31411
|
* ```
|
|
31156
31412
|
*/
|
|
31157
31413
|
create(options?: RequestOptions): APIPromise<WithLastResponse<ImportJob>>;
|
|
@@ -31160,6 +31416,9 @@ declare class AppEndUsersImportsResource extends APIResource {
|
|
|
31160
31416
|
*
|
|
31161
31417
|
* `status: succeeded` means the job RAN TO COMPLETION, not that every row landed — read `failed_count` and `errors` for that. `errors` is capped at the first 500 entries; the counts stay exact.
|
|
31162
31418
|
*
|
|
31419
|
+
* Credential: `workspace_key`.
|
|
31420
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31421
|
+
*
|
|
31163
31422
|
* @param jobId - Id of the job.
|
|
31164
31423
|
* @param options - Per-request options.
|
|
31165
31424
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
@@ -31170,7 +31429,7 @@ declare class AppEndUsersImportsResource extends APIResource {
|
|
|
31170
31429
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-end-users-import-job-id
|
|
31171
31430
|
* @example
|
|
31172
31431
|
* ```ts
|
|
31173
|
-
* const importJob = await auth.admin.app("
|
|
31432
|
+
* const importJob = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.imports.retrieve("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
31174
31433
|
* ```
|
|
31175
31434
|
*/
|
|
31176
31435
|
retrieve(jobId: string, options?: RequestOptions): APIPromise<WithLastResponse<ImportJob>>;
|
|
@@ -31180,6 +31439,9 @@ declare class AppEndUsersInvitesResource extends APIResource {
|
|
|
31180
31439
|
/**
|
|
31181
31440
|
* Pre-allocate an EndUser invite. Dispatches an invitation email via the workspace's Mail sender.
|
|
31182
31441
|
*
|
|
31442
|
+
* Credential: `workspace_key`.
|
|
31443
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31444
|
+
*
|
|
31183
31445
|
* @param params - `Auth.EndUserInviteCreateParams`.
|
|
31184
31446
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
31185
31447
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Unknown role, or maxUses / expiresInHours out of range.
|
|
@@ -31190,13 +31452,16 @@ declare class AppEndUsersInvitesResource extends APIResource {
|
|
|
31190
31452
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-end-users-invites
|
|
31191
31453
|
* @example
|
|
31192
31454
|
* ```ts
|
|
31193
|
-
* const endUserInvite = await auth.admin.app("
|
|
31455
|
+
* const endUserInvite = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.invites.create({ email: "alice@example.com" });
|
|
31194
31456
|
* ```
|
|
31195
31457
|
*/
|
|
31196
31458
|
create(params: EndUserInviteCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<EndUserInvite>>;
|
|
31197
31459
|
/**
|
|
31198
31460
|
* Revoke an EndUser invite (soft-delete).
|
|
31199
31461
|
*
|
|
31462
|
+
* Credential: `workspace_key`.
|
|
31463
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31464
|
+
*
|
|
31200
31465
|
* @param inviteId - Id of the invite.
|
|
31201
31466
|
* @param options - Per-request options.
|
|
31202
31467
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
|
|
@@ -31207,13 +31472,16 @@ declare class AppEndUsersInvitesResource extends APIResource {
|
|
|
31207
31472
|
* @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id-end-users-invites-invite-id
|
|
31208
31473
|
* @example
|
|
31209
31474
|
* ```ts
|
|
31210
|
-
* await auth.admin.app("
|
|
31475
|
+
* await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.invites.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
31211
31476
|
* ```
|
|
31212
31477
|
*/
|
|
31213
31478
|
delete(inviteId: string, options?: RequestOptions): APIPromise<void>;
|
|
31214
31479
|
/**
|
|
31215
31480
|
* List EndUser invites for this app, newest first. Filter by `?status=`.
|
|
31216
31481
|
*
|
|
31482
|
+
* Credential: `workspace_key`.
|
|
31483
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31484
|
+
*
|
|
31217
31485
|
* @param params - `Auth.EndUserInviteListParams`.
|
|
31218
31486
|
* @param options - Per-request options.
|
|
31219
31487
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Unknown `status` value.
|
|
@@ -31223,10 +31491,10 @@ declare class AppEndUsersInvitesResource extends APIResource {
|
|
|
31223
31491
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-end-users-invites
|
|
31224
31492
|
* @example
|
|
31225
31493
|
* ```ts
|
|
31226
|
-
* for await (const invite of auth.admin.app("
|
|
31494
|
+
* for await (const invite of auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.invites.list()) {
|
|
31227
31495
|
* console.log(invite);
|
|
31228
31496
|
* }
|
|
31229
|
-
* const page = await auth.admin.app("
|
|
31497
|
+
* const page = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.invites.list({}, { timeout: 5_000 });
|
|
31230
31498
|
* ```
|
|
31231
31499
|
*/
|
|
31232
31500
|
list(params?: EndUserInviteListParams, options?: RequestOptions): PagePromise<EndUserInvite>;
|
|
@@ -31238,6 +31506,9 @@ declare class AppEndUsersMfaResource extends APIResource {
|
|
|
31238
31506
|
*
|
|
31239
31507
|
* Disables every enabled factor on the account, destroys its recovery codes, and revokes every live session. The next sign-in on an app running `auth_config.mfa: "required"` returns `mfa_enrollment_required` and the user must enrol a new factor before a session is minted. On an app running `mfa: "optional"` the user simply ends up with no MFA, which is the pre-existing meaning of deleting their factors. All three steps matter: leaving the recovery codes alive would let whoever holds the old printout complete `/auth/mfa/recover` and skip enrolment entirely. Audited, and emits `user.mfa.factor_disabled` per factor plus one `user.mfa.reenrollment_required`. Idempotent.
|
|
31240
31508
|
*
|
|
31509
|
+
* Credential: `workspace_key`.
|
|
31510
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31511
|
+
*
|
|
31241
31512
|
* @param userId - Id of the user.
|
|
31242
31513
|
* @param options - Per-request options.
|
|
31243
31514
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
@@ -31248,7 +31519,7 @@ declare class AppEndUsersMfaResource extends APIResource {
|
|
|
31248
31519
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-end-users-user-id-mfa-require-reenrollment
|
|
31249
31520
|
* @example
|
|
31250
31521
|
* ```ts
|
|
31251
|
-
* const requireMfaReenrollment = await auth.admin.app("
|
|
31522
|
+
* const requireMfaReenrollment = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.mfa.requireReenrollment("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
31252
31523
|
* ```
|
|
31253
31524
|
*/
|
|
31254
31525
|
requireReenrollment(userId: string, options?: RequestOptions): APIPromise<WithLastResponse<RequireMfaReenrollment>>;
|
|
@@ -31258,6 +31529,9 @@ declare class AppEndUsersSessionsResource extends APIResource {
|
|
|
31258
31529
|
/**
|
|
31259
31530
|
* Revoke every active session for an end-user.
|
|
31260
31531
|
*
|
|
31532
|
+
* Credential: `workspace_key`.
|
|
31533
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31534
|
+
*
|
|
31261
31535
|
* @param userId - Id of the user.
|
|
31262
31536
|
* @param options - Per-request options.
|
|
31263
31537
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
|
|
@@ -31268,7 +31542,7 @@ declare class AppEndUsersSessionsResource extends APIResource {
|
|
|
31268
31542
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-end-users-user-id-sessions-revoke-all
|
|
31269
31543
|
* @example
|
|
31270
31544
|
* ```ts
|
|
31271
|
-
* await auth.admin.app("
|
|
31545
|
+
* await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.sessions.revokeAll("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
31272
31546
|
* ```
|
|
31273
31547
|
*/
|
|
31274
31548
|
revokeAll(userId: string, options?: RequestOptions): APIPromise<void>;
|
|
@@ -31286,6 +31560,9 @@ declare class AppEndUsersResource extends APIResource {
|
|
|
31286
31560
|
*
|
|
31287
31561
|
* Deletes every matched account in one transaction. Each deleted account gets an `auth.account.deleted` audit row (`via: platform_bulk`) whose metadata carries the `selection` (`{ mode: "ids" }`, or `{ mode: "filter", filter }`), so a filter sweep reads as one. The workspace audit log gets one `auth.end_users.deleted` row with the count. `user.deleted` (`via: "platform_bulk"`) fires per account only when 100 or fewer were deleted.
|
|
31288
31562
|
*
|
|
31563
|
+
* Credential: `workspace_key`.
|
|
31564
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31565
|
+
*
|
|
31289
31566
|
* @param params - `Auth.EndUserBulkDeleteParams`.
|
|
31290
31567
|
* @param options - Per-request options.
|
|
31291
31568
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid `selection` body, or an unfiltered selection without `confirm_all_in_app: true` (including more than 5,000 ids).
|
|
@@ -31297,13 +31574,16 @@ declare class AppEndUsersResource extends APIResource {
|
|
|
31297
31574
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-end-users-bulk-delete
|
|
31298
31575
|
* @example
|
|
31299
31576
|
* ```ts
|
|
31300
|
-
* const bulkAffectedUsers = await auth.admin.app("
|
|
31577
|
+
* const bulkAffectedUsers = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.bulkDelete({ selection: { mode: "ids" } });
|
|
31301
31578
|
* ```
|
|
31302
31579
|
*/
|
|
31303
31580
|
bulkDelete(params: EndUserBulkDeleteParams, options?: RequestOptions): APIPromise<WithLastResponse<BulkAffectedUsers>>;
|
|
31304
31581
|
/**
|
|
31305
31582
|
* Bulk-revoke sessions across a selection.
|
|
31306
31583
|
*
|
|
31584
|
+
* Credential: `workspace_key`.
|
|
31585
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31586
|
+
*
|
|
31307
31587
|
* @param params - `Auth.EndUserBulkRevokeSessionsParams`.
|
|
31308
31588
|
* @param options - Per-request options.
|
|
31309
31589
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid `selection` body (including more than 5,000 ids).
|
|
@@ -31315,13 +31595,16 @@ declare class AppEndUsersResource extends APIResource {
|
|
|
31315
31595
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-end-users-bulk-revoke-sessions
|
|
31316
31596
|
* @example
|
|
31317
31597
|
* ```ts
|
|
31318
|
-
* const bulkAffectedUsers = await auth.admin.app("
|
|
31598
|
+
* const bulkAffectedUsers = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.bulkRevokeSessions({ selection: { mode: "ids" } });
|
|
31319
31599
|
* ```
|
|
31320
31600
|
*/
|
|
31321
31601
|
bulkRevokeSessions(params: EndUserBulkRevokeSessionsParams, options?: RequestOptions): APIPromise<WithLastResponse<BulkAffectedUsers>>;
|
|
31322
31602
|
/**
|
|
31323
31603
|
* Bulk-assign a role across a selection.
|
|
31324
31604
|
*
|
|
31605
|
+
* Credential: `workspace_key`.
|
|
31606
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31607
|
+
*
|
|
31325
31608
|
* @param params - `Auth.EndUserBulkUpdateRoleParams`.
|
|
31326
31609
|
* @param options - Per-request options.
|
|
31327
31610
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid `selection` body or empty `roleName`.
|
|
@@ -31333,13 +31616,16 @@ declare class AppEndUsersResource extends APIResource {
|
|
|
31333
31616
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-end-users-bulk-update-role
|
|
31334
31617
|
* @example
|
|
31335
31618
|
* ```ts
|
|
31336
|
-
* const bulkAffectedUsers = await auth.admin.app("
|
|
31619
|
+
* const bulkAffectedUsers = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.bulkUpdateRole({ role_name: "member", selection: { mode: "ids" } });
|
|
31337
31620
|
* ```
|
|
31338
31621
|
*/
|
|
31339
31622
|
bulkUpdateRole(params: EndUserBulkUpdateRoleParams, options?: RequestOptions): APIPromise<WithLastResponse<BulkAffectedUsers>>;
|
|
31340
31623
|
/**
|
|
31341
31624
|
* Bulk-update status across a selection.
|
|
31342
31625
|
*
|
|
31626
|
+
* Credential: `workspace_key`.
|
|
31627
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31628
|
+
*
|
|
31343
31629
|
* @param params - `Auth.EndUserBulkUpdateStatusParams`.
|
|
31344
31630
|
* @param options - Per-request options.
|
|
31345
31631
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid `selection` body, or `status` is not one of active, suspended, deactivated.
|
|
@@ -31351,7 +31637,7 @@ declare class AppEndUsersResource extends APIResource {
|
|
|
31351
31637
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-end-users-bulk-update-status
|
|
31352
31638
|
* @example
|
|
31353
31639
|
* ```ts
|
|
31354
|
-
* const bulkAffectedUsers = await auth.admin.app("
|
|
31640
|
+
* const bulkAffectedUsers = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.bulkUpdateStatus({ selection: { mode: "ids" }, status: "suspended" });
|
|
31355
31641
|
* ```
|
|
31356
31642
|
*/
|
|
31357
31643
|
bulkUpdateStatus(params: EndUserBulkUpdateStatusParams, options?: RequestOptions): APIPromise<WithLastResponse<BulkAffectedUsers>>;
|
|
@@ -31360,6 +31646,9 @@ declare class AppEndUsersResource extends APIResource {
|
|
|
31360
31646
|
*
|
|
31361
31647
|
* Removes the account with its contacts, sessions and tenant memberships. Writes one `auth.account.deleted` audit row (`via: platform`) in the same transaction, mirrors the deletion into the workspace audit log as `auth.end_users.deleted`, and fires `user.deleted` with `via: "platform"`.
|
|
31362
31648
|
*
|
|
31649
|
+
* Credential: `workspace_key`.
|
|
31650
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31651
|
+
*
|
|
31363
31652
|
* @param userId - Id of the user.
|
|
31364
31653
|
* @param options - Per-request options.
|
|
31365
31654
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
|
|
@@ -31370,7 +31659,7 @@ declare class AppEndUsersResource extends APIResource {
|
|
|
31370
31659
|
* @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id-end-users-user-id
|
|
31371
31660
|
* @example
|
|
31372
31661
|
* ```ts
|
|
31373
|
-
* await auth.admin.app("
|
|
31662
|
+
* await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
31374
31663
|
* ```
|
|
31375
31664
|
*/
|
|
31376
31665
|
delete(userId: string, options?: RequestOptions): APIPromise<void>;
|
|
@@ -31379,6 +31668,9 @@ declare class AppEndUsersResource extends APIResource {
|
|
|
31379
31668
|
*
|
|
31380
31669
|
* Streamed in keyset batches — neither the service nor the client holds the whole directory. Ordered oldest-first by `(created_at, id)` so a re-run is stable. Gated on `auth.user.export`, which is escalation class: this hands over every address in the directory in one call, where `auth.list` pages it. Hard cap of 1,000,000 rows; a wider request is refused with 413 before any body is written.
|
|
31381
31670
|
*
|
|
31671
|
+
* Credential: `workspace_key`.
|
|
31672
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31673
|
+
*
|
|
31382
31674
|
* @param params - `Auth.EndUserExportParams`.
|
|
31383
31675
|
* @param options - Per-request options.
|
|
31384
31676
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Unknown `format`.
|
|
@@ -31391,7 +31683,7 @@ declare class AppEndUsersResource extends APIResource {
|
|
|
31391
31683
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-end-users-export
|
|
31392
31684
|
* @example
|
|
31393
31685
|
* ```ts
|
|
31394
|
-
* const response = await auth.admin.app("
|
|
31686
|
+
* const response = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.export();
|
|
31395
31687
|
* const text = await response.text();
|
|
31396
31688
|
* ```
|
|
31397
31689
|
*/
|
|
@@ -31399,6 +31691,9 @@ declare class AppEndUsersResource extends APIResource {
|
|
|
31399
31691
|
/**
|
|
31400
31692
|
* List end-users in this app (cursor-paginated).
|
|
31401
31693
|
*
|
|
31694
|
+
* Credential: `workspace_key`.
|
|
31695
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31696
|
+
*
|
|
31402
31697
|
* @param params - `Auth.EndUserListParams`.
|
|
31403
31698
|
* @param options - Per-request options.
|
|
31404
31699
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Unknown `signal` / `sort` / `order`, or a `cursor` minted under a different ordering than the one requested.
|
|
@@ -31408,16 +31703,19 @@ declare class AppEndUsersResource extends APIResource {
|
|
|
31408
31703
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-end-users
|
|
31409
31704
|
* @example
|
|
31410
31705
|
* ```ts
|
|
31411
|
-
* for await (const endUser of auth.admin.app("
|
|
31706
|
+
* for await (const endUser of auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.list()) {
|
|
31412
31707
|
* console.log(endUser);
|
|
31413
31708
|
* }
|
|
31414
|
-
* const page = await auth.admin.app("
|
|
31709
|
+
* const page = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.list({}, { timeout: 5_000 });
|
|
31415
31710
|
* ```
|
|
31416
31711
|
*/
|
|
31417
31712
|
list(params?: EndUserListParams, options?: RequestOptions): PagePromise<EndUserSummary>;
|
|
31418
31713
|
/**
|
|
31419
31714
|
* Resend verification to the primary email contact.
|
|
31420
31715
|
*
|
|
31716
|
+
* Credential: `workspace_key`.
|
|
31717
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31718
|
+
*
|
|
31421
31719
|
* @param userId - Id of the user.
|
|
31422
31720
|
* @param options - Per-request options.
|
|
31423
31721
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
|
|
@@ -31429,13 +31727,16 @@ declare class AppEndUsersResource extends APIResource {
|
|
|
31429
31727
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-end-users-user-id-resend-verification
|
|
31430
31728
|
* @example
|
|
31431
31729
|
* ```ts
|
|
31432
|
-
* const issuedVerificationCode = await auth.admin.app("
|
|
31730
|
+
* const issuedVerificationCode = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.resendVerification("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
31433
31731
|
* ```
|
|
31434
31732
|
*/
|
|
31435
31733
|
resendVerification(userId: string, options?: RequestOptions): APIPromise<WithLastResponse<IssuedVerificationCode>>;
|
|
31436
31734
|
/**
|
|
31437
31735
|
* Get one end-user.
|
|
31438
31736
|
*
|
|
31737
|
+
* Credential: `workspace_key`.
|
|
31738
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31739
|
+
*
|
|
31439
31740
|
* @param userId - Id of the user.
|
|
31440
31741
|
* @param options - Per-request options.
|
|
31441
31742
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
|
|
@@ -31446,13 +31747,16 @@ declare class AppEndUsersResource extends APIResource {
|
|
|
31446
31747
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-end-users-user-id
|
|
31447
31748
|
* @example
|
|
31448
31749
|
* ```ts
|
|
31449
|
-
* const endUserSummary = await auth.admin.app("
|
|
31750
|
+
* const endUserSummary = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.retrieve("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
31450
31751
|
* ```
|
|
31451
31752
|
*/
|
|
31452
31753
|
retrieve(userId: string, options?: RequestOptions): APIPromise<WithLastResponse<EndUserSummary>>;
|
|
31453
31754
|
/**
|
|
31454
31755
|
* Update end-user display name, primary email, or metadata keys (merged).
|
|
31455
31756
|
*
|
|
31757
|
+
* Credential: `workspace_key`.
|
|
31758
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31759
|
+
*
|
|
31456
31760
|
* @param userId - Id of the user.
|
|
31457
31761
|
* @param params - `Auth.EndUserUpdateParams`.
|
|
31458
31762
|
* @param options - Per-request options.
|
|
@@ -31465,13 +31769,16 @@ declare class AppEndUsersResource extends APIResource {
|
|
|
31465
31769
|
* @see https://productcraft.co/docs/auth/api-reference#patch-v1-apps-app-id-end-users-user-id
|
|
31466
31770
|
* @example
|
|
31467
31771
|
* ```ts
|
|
31468
|
-
* const endUserSummary = await auth.admin.app("
|
|
31772
|
+
* const endUserSummary = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.update("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { display_name: "Ada Lovelace" });
|
|
31469
31773
|
* ```
|
|
31470
31774
|
*/
|
|
31471
31775
|
update(userId: string, params?: EndUserUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<EndUserSummary>>;
|
|
31472
31776
|
/**
|
|
31473
31777
|
* Assign an end-user a role.
|
|
31474
31778
|
*
|
|
31779
|
+
* Credential: `workspace_key`.
|
|
31780
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31781
|
+
*
|
|
31475
31782
|
* @param userId - Id of the user.
|
|
31476
31783
|
* @param params - `Auth.EndUserUpdateRoleParams`.
|
|
31477
31784
|
* @param options - Per-request options.
|
|
@@ -31484,13 +31791,16 @@ declare class AppEndUsersResource extends APIResource {
|
|
|
31484
31791
|
* @see https://productcraft.co/docs/auth/api-reference#patch-v1-apps-app-id-end-users-user-id-role
|
|
31485
31792
|
* @example
|
|
31486
31793
|
* ```ts
|
|
31487
|
-
* const endUserRoleAssignment = await auth.admin.app("
|
|
31794
|
+
* const endUserRoleAssignment = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.updateRole("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { role_name: "admin" });
|
|
31488
31795
|
* ```
|
|
31489
31796
|
*/
|
|
31490
31797
|
updateRole(userId: string, params: EndUserUpdateRoleParams, options?: RequestOptions): APIPromise<WithLastResponse<EndUserRoleAssignment>>;
|
|
31491
31798
|
/**
|
|
31492
31799
|
* Change end-user status (active / suspended / deactivated).
|
|
31493
31800
|
*
|
|
31801
|
+
* Credential: `workspace_key`.
|
|
31802
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31803
|
+
*
|
|
31494
31804
|
* @param userId - Id of the user.
|
|
31495
31805
|
* @param params - `Auth.EndUserUpdateStatusParams`.
|
|
31496
31806
|
* @param options - Per-request options.
|
|
@@ -31503,7 +31813,7 @@ declare class AppEndUsersResource extends APIResource {
|
|
|
31503
31813
|
* @see https://productcraft.co/docs/auth/api-reference#patch-v1-apps-app-id-end-users-user-id-status
|
|
31504
31814
|
* @example
|
|
31505
31815
|
* ```ts
|
|
31506
|
-
* const endUserSummary = await auth.admin.app("
|
|
31816
|
+
* const endUserSummary = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.updateStatus("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { status: "suspended" });
|
|
31507
31817
|
* ```
|
|
31508
31818
|
*/
|
|
31509
31819
|
updateStatus(userId: string, params: EndUserUpdateStatusParams, options?: RequestOptions): APIPromise<WithLastResponse<EndUserSummary>>;
|
|
@@ -31546,6 +31856,9 @@ declare class AppMembersResource extends APIResource {
|
|
|
31546
31856
|
/**
|
|
31547
31857
|
* Remove a member from the app
|
|
31548
31858
|
*
|
|
31859
|
+
* Credential: `workspace_key`.
|
|
31860
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31861
|
+
*
|
|
31549
31862
|
* @param accountId - Id of the account.
|
|
31550
31863
|
* @param options - Per-request options.
|
|
31551
31864
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
|
|
@@ -31556,13 +31869,16 @@ declare class AppMembersResource extends APIResource {
|
|
|
31556
31869
|
* @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id-members-account-id
|
|
31557
31870
|
* @example
|
|
31558
31871
|
* ```ts
|
|
31559
|
-
* await auth.admin.app("
|
|
31872
|
+
* await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").members.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
31560
31873
|
* ```
|
|
31561
31874
|
*/
|
|
31562
31875
|
delete(accountId: string, options?: RequestOptions): APIPromise<void>;
|
|
31563
31876
|
/**
|
|
31564
31877
|
* List app members (PlatformUser view of EndUser memberships)
|
|
31565
31878
|
*
|
|
31879
|
+
* Credential: `workspace_key`.
|
|
31880
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31881
|
+
*
|
|
31566
31882
|
* @param params - `Auth.MemberListParams`.
|
|
31567
31883
|
* @param options - Per-request options.
|
|
31568
31884
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid pagination cursor.
|
|
@@ -31574,10 +31890,10 @@ declare class AppMembersResource extends APIResource {
|
|
|
31574
31890
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-members
|
|
31575
31891
|
* @example
|
|
31576
31892
|
* ```ts
|
|
31577
|
-
* for await (const member of auth.admin.app("
|
|
31893
|
+
* for await (const member of auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").members.list()) {
|
|
31578
31894
|
* console.log(member);
|
|
31579
31895
|
* }
|
|
31580
|
-
* const page = await auth.admin.app("
|
|
31896
|
+
* const page = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").members.list({}, { timeout: 5_000 });
|
|
31581
31897
|
* ```
|
|
31582
31898
|
*/
|
|
31583
31899
|
list(params?: MemberListParams, options?: RequestOptions): PagePromise<AppMemberSummary>;
|
|
@@ -31595,6 +31911,9 @@ declare class AppNotificationSettingsResource extends APIResource {
|
|
|
31595
31911
|
*
|
|
31596
31912
|
* `effective_sender` is the sender emails actually go out from, checked live in Mail with your own access (the workspace default sender, or the app's custom address).
|
|
31597
31913
|
*
|
|
31914
|
+
* Credential: `workspace_key`.
|
|
31915
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31916
|
+
*
|
|
31598
31917
|
* @param options - Per-request options.
|
|
31599
31918
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
|
|
31600
31919
|
* @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.read` on this app, or the app is suspended or archived.
|
|
@@ -31604,7 +31923,7 @@ declare class AppNotificationSettingsResource extends APIResource {
|
|
|
31604
31923
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-notification-settings
|
|
31605
31924
|
* @example
|
|
31606
31925
|
* ```ts
|
|
31607
|
-
* const appNotificationSettings = await auth.admin.app("
|
|
31926
|
+
* const appNotificationSettings = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").notificationSettings.retrieve();
|
|
31608
31927
|
* ```
|
|
31609
31928
|
*/
|
|
31610
31929
|
retrieve(options?: RequestOptions): APIPromise<WithLastResponse<AppNotificationSettings>>;
|
|
@@ -31613,6 +31932,9 @@ declare class AppNotificationSettingsResource extends APIResource {
|
|
|
31613
31932
|
*
|
|
31614
31933
|
* Turning `notifications_via_envoi` on (from off) creates the default template of every empty slot in the workspace's Mail templates (`auth-verification`, `auth-welcome`, `auth-password-reset`, `auth-invite`, `auth-mfa-code`), reusing a template that already has that name, and fills the slot. Templates are created with your own Mail access; a slot that could not be created stays empty. A slot you clear later is not refilled until emails are switched off and on again.
|
|
31615
31934
|
*
|
|
31935
|
+
* Credential: `workspace_key`.
|
|
31936
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31937
|
+
*
|
|
31616
31938
|
* @param params - `Auth.NotificationSettingUpdateParams`.
|
|
31617
31939
|
* @param options - Per-request options.
|
|
31618
31940
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid payload.
|
|
@@ -31625,7 +31947,7 @@ declare class AppNotificationSettingsResource extends APIResource {
|
|
|
31625
31947
|
* @see https://productcraft.co/docs/auth/api-reference#patch-v1-apps-app-id-notification-settings
|
|
31626
31948
|
* @example
|
|
31627
31949
|
* ```ts
|
|
31628
|
-
* const appNotificationSettings = await auth.admin.app("
|
|
31950
|
+
* const appNotificationSettings = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").notificationSettings.update({ default_sender_address: "ada@example.com" });
|
|
31629
31951
|
* ```
|
|
31630
31952
|
*/
|
|
31631
31953
|
update(params?: NotificationSettingUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<AppNotificationSettings>>;
|
|
@@ -31637,6 +31959,9 @@ declare class AppNotificationsResource extends APIResource {
|
|
|
31637
31959
|
*
|
|
31638
31960
|
* Sends the slot's real Mail template, with this app's real sender (the workspace default or the custom address) and example values for every variable, to your own verified account address. It cannot be sent anywhere else. It uses your own Mail access, goes through the same send path as real emails, and shows up in Mail > Emails. At most 10 tests per person per hour. Not available to API keys (a key has no inbox).
|
|
31639
31961
|
*
|
|
31962
|
+
* Credential: `workspace_key`.
|
|
31963
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31964
|
+
*
|
|
31640
31965
|
* @param slot - The email to test.
|
|
31641
31966
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
31642
31967
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Unknown `slot`.
|
|
@@ -31652,7 +31977,7 @@ declare class AppNotificationsResource extends APIResource {
|
|
|
31652
31977
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-notifications-slot-test
|
|
31653
31978
|
* @example
|
|
31654
31979
|
* ```ts
|
|
31655
|
-
* const notificationTest = await auth.admin.app("
|
|
31980
|
+
* const notificationTest = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").notifications.test("verification");
|
|
31656
31981
|
* ```
|
|
31657
31982
|
*/
|
|
31658
31983
|
test(slot: string, options?: RequestOptions): APIPromise<WithLastResponse<NotificationTest>>;
|
|
@@ -31664,6 +31989,9 @@ declare class AppPermissionsEnforcementResource extends APIResource {
|
|
|
31664
31989
|
*
|
|
31665
31990
|
* Returns the deduplicated set of permission strings that any handler in this users-api build gates via `@RequireAppPermission`. Drives the console "Enforced" badge — a customer who binds `user.delete` to a role can see whether any route in this deploy actually checks for it. App-agnostic in shape; the path parameter is included for URN symmetry with the rest of the per-app surface, not to narrow the response.
|
|
31666
31991
|
*
|
|
31992
|
+
* Credential: `workspace_key`.
|
|
31993
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
31994
|
+
*
|
|
31667
31995
|
* @param options - Per-request options.
|
|
31668
31996
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
|
|
31669
31997
|
* @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.read` on this app, or the app is suspended or archived.
|
|
@@ -31673,7 +32001,7 @@ declare class AppPermissionsEnforcementResource extends APIResource {
|
|
|
31673
32001
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-permissions-enforcement
|
|
31674
32002
|
* @example
|
|
31675
32003
|
* ```ts
|
|
31676
|
-
* const enforcedPermissions = await auth.admin.app("
|
|
32004
|
+
* const enforcedPermissions = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").permissions.enforcement.list();
|
|
31677
32005
|
* ```
|
|
31678
32006
|
*/
|
|
31679
32007
|
list(options?: RequestOptions): APIPromise<WithLastResponse<EnforcedPermissions>>;
|
|
@@ -31685,6 +32013,9 @@ declare class AppPermissionsResource extends APIResource {
|
|
|
31685
32013
|
/**
|
|
31686
32014
|
* Create a custom permission
|
|
31687
32015
|
*
|
|
32016
|
+
* Credential: `workspace_key`.
|
|
32017
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32018
|
+
*
|
|
31688
32019
|
* @param params - `Auth.AppScopedPermissionCreateParams`.
|
|
31689
32020
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
31690
32021
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failure (`resource` / `action` segment format, or `description` over 256 chars).
|
|
@@ -31697,13 +32028,16 @@ declare class AppPermissionsResource extends APIResource {
|
|
|
31697
32028
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-permissions
|
|
31698
32029
|
* @example
|
|
31699
32030
|
* ```ts
|
|
31700
|
-
* const permission = await auth.admin.app("
|
|
32031
|
+
* const permission = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").permissions.create({ action: "read", resource: "project" });
|
|
31701
32032
|
* ```
|
|
31702
32033
|
*/
|
|
31703
32034
|
create(params: AppScopedPermissionCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<Permission>>;
|
|
31704
32035
|
/**
|
|
31705
32036
|
* Delete a custom permission
|
|
31706
32037
|
*
|
|
32038
|
+
* Credential: `workspace_key`.
|
|
32039
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32040
|
+
*
|
|
31707
32041
|
* @param permissionKey - Permission key, `resource.action` (e.g. `invoice.read`).
|
|
31708
32042
|
* @param options - Per-request options.
|
|
31709
32043
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `permissionKey` is not in `resource.action` format.
|
|
@@ -31715,13 +32049,16 @@ declare class AppPermissionsResource extends APIResource {
|
|
|
31715
32049
|
* @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id-permissions-permission-key
|
|
31716
32050
|
* @example
|
|
31717
32051
|
* ```ts
|
|
31718
|
-
* await auth.admin.app("
|
|
32052
|
+
* await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").permissions.delete("invoice.read");
|
|
31719
32053
|
* ```
|
|
31720
32054
|
*/
|
|
31721
32055
|
delete(permissionKey: string, options?: RequestOptions): APIPromise<void>;
|
|
31722
32056
|
/**
|
|
31723
32057
|
* List all permissions (system + custom)
|
|
31724
32058
|
*
|
|
32059
|
+
* Credential: `workspace_key`.
|
|
32060
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32061
|
+
*
|
|
31725
32062
|
* @param options - Per-request options.
|
|
31726
32063
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
|
|
31727
32064
|
* @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.read` on this app, or the app is suspended or archived.
|
|
@@ -31731,7 +32068,7 @@ declare class AppPermissionsResource extends APIResource {
|
|
|
31731
32068
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-permissions
|
|
31732
32069
|
* @example
|
|
31733
32070
|
* ```ts
|
|
31734
|
-
* const result = await auth.admin.app("
|
|
32071
|
+
* const result = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").permissions.list();
|
|
31735
32072
|
* ```
|
|
31736
32073
|
*/
|
|
31737
32074
|
list(options?: RequestOptions): APIPromise<WithLastResponse<AppScopedPermissionListResponse>>;
|
|
@@ -31741,6 +32078,9 @@ declare class AppRolesPermissionsResource extends APIResource {
|
|
|
31741
32078
|
/**
|
|
31742
32079
|
* List all available permissions
|
|
31743
32080
|
*
|
|
32081
|
+
* Credential: `workspace_key`.
|
|
32082
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32083
|
+
*
|
|
31744
32084
|
* @param options - Per-request options.
|
|
31745
32085
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
|
|
31746
32086
|
* @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.read` on this app, or the app is suspended or archived.
|
|
@@ -31750,7 +32090,7 @@ declare class AppRolesPermissionsResource extends APIResource {
|
|
|
31750
32090
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-roles-permissions
|
|
31751
32091
|
* @example
|
|
31752
32092
|
* ```ts
|
|
31753
|
-
* const result = await auth.admin.app("
|
|
32093
|
+
* const result = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").roles.permissions.list();
|
|
31754
32094
|
* ```
|
|
31755
32095
|
*/
|
|
31756
32096
|
list(options?: RequestOptions): APIPromise<WithLastResponse<RolePermissionListResponse>>;
|
|
@@ -31762,6 +32102,9 @@ declare class AppRolesResource extends APIResource {
|
|
|
31762
32102
|
/**
|
|
31763
32103
|
* Assign a role to a user
|
|
31764
32104
|
*
|
|
32105
|
+
* Credential: `workspace_key`.
|
|
32106
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32107
|
+
*
|
|
31765
32108
|
* @param params - `Auth.RoleAssignParams`.
|
|
31766
32109
|
* @param options - Per-request options.
|
|
31767
32110
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failure (`accountId` not a UUID, or `role` empty / over 64 chars).
|
|
@@ -31773,13 +32116,16 @@ declare class AppRolesResource extends APIResource {
|
|
|
31773
32116
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-roles-assign
|
|
31774
32117
|
* @example
|
|
31775
32118
|
* ```ts
|
|
31776
|
-
* const appMembership = await auth.admin.app("
|
|
32119
|
+
* const appMembership = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").roles.assign({ account_id: "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", role: "admin" });
|
|
31777
32120
|
* ```
|
|
31778
32121
|
*/
|
|
31779
32122
|
assign(params: RoleAssignParams, options?: RequestOptions): APIPromise<WithLastResponse<AppMembership>>;
|
|
31780
32123
|
/**
|
|
31781
32124
|
* Create a new role (no permissions yet — set them via PUT /:roleName/permissions)
|
|
31782
32125
|
*
|
|
32126
|
+
* Credential: `workspace_key`.
|
|
32127
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32128
|
+
*
|
|
31783
32129
|
* @param params - `Auth.AppScopedRoleCreateParams`.
|
|
31784
32130
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
31785
32131
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failure (`name` 1-64 chars, `description` up to 256).
|
|
@@ -31792,13 +32138,16 @@ declare class AppRolesResource extends APIResource {
|
|
|
31792
32138
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-roles
|
|
31793
32139
|
* @example
|
|
31794
32140
|
* ```ts
|
|
31795
|
-
* const role = await auth.admin.app("
|
|
32141
|
+
* const role = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").roles.create({ name: "editor" });
|
|
31796
32142
|
* ```
|
|
31797
32143
|
*/
|
|
31798
32144
|
create(params: AppScopedRoleCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<Role>>;
|
|
31799
32145
|
/**
|
|
31800
32146
|
* Delete a custom role
|
|
31801
32147
|
*
|
|
32148
|
+
* Credential: `workspace_key`.
|
|
32149
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32150
|
+
*
|
|
31802
32151
|
* @param roleName - Name of the role (e.g. `admin`).
|
|
31803
32152
|
* @param options - Per-request options.
|
|
31804
32153
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
|
|
@@ -31810,13 +32159,16 @@ declare class AppRolesResource extends APIResource {
|
|
|
31810
32159
|
* @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id-roles-role-name
|
|
31811
32160
|
* @example
|
|
31812
32161
|
* ```ts
|
|
31813
|
-
* await auth.admin.app("
|
|
32162
|
+
* await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").roles.delete("admin");
|
|
31814
32163
|
* ```
|
|
31815
32164
|
*/
|
|
31816
32165
|
delete(roleName: string, options?: RequestOptions): APIPromise<void>;
|
|
31817
32166
|
/**
|
|
31818
32167
|
* List all roles in an app. Filter by `?search=` on the role name.
|
|
31819
32168
|
*
|
|
32169
|
+
* Credential: `workspace_key`.
|
|
32170
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32171
|
+
*
|
|
31820
32172
|
* @param params - `Auth.AppScopedRoleListParams`.
|
|
31821
32173
|
* @param options - Per-request options.
|
|
31822
32174
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`.
|
|
@@ -31828,16 +32180,19 @@ declare class AppRolesResource extends APIResource {
|
|
|
31828
32180
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-roles
|
|
31829
32181
|
* @example
|
|
31830
32182
|
* ```ts
|
|
31831
|
-
* for await (const role of auth.admin.app("
|
|
32183
|
+
* for await (const role of auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").roles.list()) {
|
|
31832
32184
|
* console.log(role);
|
|
31833
32185
|
* }
|
|
31834
|
-
* const page = await auth.admin.app("
|
|
32186
|
+
* const page = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").roles.list({}, { timeout: 5_000 });
|
|
31835
32187
|
* ```
|
|
31836
32188
|
*/
|
|
31837
32189
|
list(params?: AppScopedRoleListParams, options?: RequestOptions): PagePromise<Role>;
|
|
31838
32190
|
/**
|
|
31839
32191
|
* Get role details with permissions
|
|
31840
32192
|
*
|
|
32193
|
+
* Credential: `workspace_key`.
|
|
32194
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32195
|
+
*
|
|
31841
32196
|
* @param roleName - Name of the role (e.g. `admin`).
|
|
31842
32197
|
* @param options - Per-request options.
|
|
31843
32198
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
|
|
@@ -31848,13 +32203,16 @@ declare class AppRolesResource extends APIResource {
|
|
|
31848
32203
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-roles-role-name
|
|
31849
32204
|
* @example
|
|
31850
32205
|
* ```ts
|
|
31851
|
-
* const roleWithPermissions = await auth.admin.app("
|
|
32206
|
+
* const roleWithPermissions = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").roles.retrieve("admin");
|
|
31852
32207
|
* ```
|
|
31853
32208
|
*/
|
|
31854
32209
|
retrieve(roleName: string, options?: RequestOptions): APIPromise<WithLastResponse<RoleWithPermissions>>;
|
|
31855
32210
|
/**
|
|
31856
32211
|
* Update role name or description
|
|
31857
32212
|
*
|
|
32213
|
+
* Credential: `workspace_key`.
|
|
32214
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32215
|
+
*
|
|
31858
32216
|
* @param roleName - Name of the role (e.g. `admin`).
|
|
31859
32217
|
* @param params - `Auth.AppScopedRoleUpdateParams`.
|
|
31860
32218
|
* @param options - Per-request options.
|
|
@@ -31867,13 +32225,16 @@ declare class AppRolesResource extends APIResource {
|
|
|
31867
32225
|
* @see https://productcraft.co/docs/auth/api-reference#patch-v1-apps-app-id-roles-role-name
|
|
31868
32226
|
* @example
|
|
31869
32227
|
* ```ts
|
|
31870
|
-
* const role = await auth.admin.app("
|
|
32228
|
+
* const role = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").roles.update("admin", { description: "Updated description" });
|
|
31871
32229
|
* ```
|
|
31872
32230
|
*/
|
|
31873
32231
|
update(roleName: string, params?: AppScopedRoleUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<Role>>;
|
|
31874
32232
|
/**
|
|
31875
32233
|
* Set permissions for a role (caller-narrowed: caller must hold every requested permission)
|
|
31876
32234
|
*
|
|
32235
|
+
* Credential: `workspace_key`.
|
|
32236
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32237
|
+
*
|
|
31877
32238
|
* @param roleName - Name of the role (e.g. `admin`).
|
|
31878
32239
|
* @param params - `Auth.AppScopedRoleUpdatePermissionsParams`.
|
|
31879
32240
|
* @param options - Per-request options.
|
|
@@ -31886,7 +32247,7 @@ declare class AppRolesResource extends APIResource {
|
|
|
31886
32247
|
* @see https://productcraft.co/docs/auth/api-reference#put-v1-apps-app-id-roles-role-name-permissions
|
|
31887
32248
|
* @example
|
|
31888
32249
|
* ```ts
|
|
31889
|
-
* const result = await auth.admin.app("
|
|
32250
|
+
* const result = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").roles.updatePermissions("admin", { permissions: ["user.read", "role.create"] });
|
|
31890
32251
|
* ```
|
|
31891
32252
|
*/
|
|
31892
32253
|
updatePermissions(roleName: string, params: AppScopedRoleUpdatePermissionsParams, options?: RequestOptions): APIPromise<WithLastResponse<AppScopedRoleUpdatePermissionsResponse>>;
|
|
@@ -31916,6 +32277,9 @@ declare class AppSetupStatusResource extends APIResource {
|
|
|
31916
32277
|
*
|
|
31917
32278
|
* Rows, in order: `signups` (attention while sign-ups are off), `redirect_origins` (blocked until at least one site may start sign-in), one `provider_<id>` row per switched-on sign-in provider (blocked while its status is blocked), `email` (sender chosen and a template for every email; attention while emails are off), `api_key` (attention until an active app key exists), `webhook` (attention until an endpoint has accepted a delivery), and `passkeys` (only while passkeys are on; blocked when no allowed redirect origin is on the passkey site). `complete` is true once no row is `not_set` or `blocked`. Each `fix.href` is a console path to the exact setting. Computed on every request from stored settings, plus the workspace default sender read from Mail with your own access when emails use it: nothing here calls DNS or a sign-in provider (a provider whose last credential check was rejected shows as blocked). A ready provider row carries `test.action: sign_in.try`: run it with `POST /v1/apps/{appId}/sign-in-tests` `{ method: "oauth", provider }`.
|
|
31918
32279
|
*
|
|
32280
|
+
* Credential: `workspace_key`.
|
|
32281
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32282
|
+
*
|
|
31919
32283
|
* @param options - Per-request options.
|
|
31920
32284
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
|
|
31921
32285
|
* @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.read` on this app, or the app is suspended or archived.
|
|
@@ -31925,7 +32289,7 @@ declare class AppSetupStatusResource extends APIResource {
|
|
|
31925
32289
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-setup-status
|
|
31926
32290
|
* @example
|
|
31927
32291
|
* ```ts
|
|
31928
|
-
* const setupStatus = await auth.admin.app("
|
|
32292
|
+
* const setupStatus = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").setupStatus.retrieve();
|
|
31929
32293
|
* ```
|
|
31930
32294
|
*/
|
|
31931
32295
|
retrieve(options?: RequestOptions): APIPromise<WithLastResponse<SetupStatus>>;
|
|
@@ -31937,6 +32301,9 @@ declare class AppSignInTestsResource extends APIResource {
|
|
|
31937
32301
|
*
|
|
31938
32302
|
* For `oauth`, the server first checks what it can on its own (an allowed redirect origin, saved credentials, and the provider credential check). If one fails, the test comes back `failed` at once with the fix. Otherwise open `start_url` in a popup: the person signs in at the provider, the provider returns to Auth, Auth resolves who it is exactly as a real sign-in would, records `would_sign_in_existing` or `would_create` (or the provider error mapped to its fix), creates no account and issues no token, then sends the popup to the console result page. Poll `GET …/sign-in-tests/{id}` until `state` is not `pending`. Works with a provider that is saved but not switched on yet. For `password` / `otp`, the test runs now: it checks the sign-up or sign-in rules for your own email and sends the real email to your own verified address. At most 20 tests per app per hour; tests are deleted after 24 hours.
|
|
31939
32303
|
*
|
|
32304
|
+
* Credential: `workspace_key`.
|
|
32305
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32306
|
+
*
|
|
31940
32307
|
* @param params - `Auth.SignInTestCreateParams`.
|
|
31941
32308
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
31942
32309
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, CUSTOM_DOMAIN_OAUTH_ONLY: Unknown `method` or provider, `provider` missing for `oauth`, or `custom_domain` on a `password` / `otp` test (`CUSTOM_DOMAIN_OAUTH_ONLY`).
|
|
@@ -31949,7 +32316,7 @@ declare class AppSignInTestsResource extends APIResource {
|
|
|
31949
32316
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-sign-in-tests
|
|
31950
32317
|
* @example
|
|
31951
32318
|
* ```ts
|
|
31952
|
-
* const signInTest = await auth.admin.app("
|
|
32319
|
+
* const signInTest = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").signInTests.create({ method: "oauth" });
|
|
31953
32320
|
* ```
|
|
31954
32321
|
*/
|
|
31955
32322
|
create(params: SignInTestCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<SignInTest>>;
|
|
@@ -31958,6 +32325,9 @@ declare class AppSignInTestsResource extends APIResource {
|
|
|
31958
32325
|
*
|
|
31959
32326
|
* Poll this after opening `start_url`. `state` turns `succeeded` (with `outcome` and `identity`) or `failed` (with `error.fix`). A test that is never finished turns `failed` with code `expired` 15 minutes after it was created.
|
|
31960
32327
|
*
|
|
32328
|
+
* Credential: `workspace_key`.
|
|
32329
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32330
|
+
*
|
|
31961
32331
|
* @param testId - Id of the test.
|
|
31962
32332
|
* @param options - Per-request options.
|
|
31963
32333
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `testId` is not a UUID.
|
|
@@ -31969,7 +32339,7 @@ declare class AppSignInTestsResource extends APIResource {
|
|
|
31969
32339
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-sign-in-tests-test-id
|
|
31970
32340
|
* @example
|
|
31971
32341
|
* ```ts
|
|
31972
|
-
* const signInTest = await auth.admin.app("
|
|
32342
|
+
* const signInTest = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").signInTests.retrieve("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
31973
32343
|
* ```
|
|
31974
32344
|
*/
|
|
31975
32345
|
retrieve(testId: string, options?: RequestOptions): APIPromise<WithLastResponse<SignInTest>>;
|
|
@@ -31981,6 +32351,9 @@ declare class AppTenantApiKeysConfigResource extends APIResource {
|
|
|
31981
32351
|
*
|
|
31982
32352
|
* Includes the platform kill switch `suspended`. Requires `auth.read` on the app.
|
|
31983
32353
|
*
|
|
32354
|
+
* Credential: `workspace_key`.
|
|
32355
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32356
|
+
*
|
|
31984
32357
|
* @param options - Per-request options.
|
|
31985
32358
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
|
|
31986
32359
|
* @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.read` on this app.
|
|
@@ -31990,7 +32363,7 @@ declare class AppTenantApiKeysConfigResource extends APIResource {
|
|
|
31990
32363
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-tenant-api-keys-config
|
|
31991
32364
|
* @example
|
|
31992
32365
|
* ```ts
|
|
31993
|
-
* const tenantApiKeysConfig = await auth.admin.app("
|
|
32366
|
+
* const tenantApiKeysConfig = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenantApiKeys.config.retrieve();
|
|
31994
32367
|
* ```
|
|
31995
32368
|
*/
|
|
31996
32369
|
retrieve(options?: RequestOptions): APIPromise<WithLastResponse<TenantApiKeysConfig>>;
|
|
@@ -31999,6 +32372,9 @@ declare class AppTenantApiKeysConfigResource extends APIResource {
|
|
|
31999
32372
|
*
|
|
32000
32373
|
* Fields you leave out keep their stored value. `suspended: true` is the kill switch: introspection answers `{"active": false}` for every key of the app at once, and key management is refused, until you set it back to `false`. The app's own config push (`PUT /:appSlug/v1/tenant-api-keys/config`) can never change it. Requires `auth.update` on the app.
|
|
32001
32374
|
*
|
|
32375
|
+
* Credential: `workspace_key`.
|
|
32376
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32377
|
+
*
|
|
32002
32378
|
* @param params - `Auth.AppScopedTenantApiKeyConfigUpdateParams`.
|
|
32003
32379
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
32004
32380
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, TENANT_API_KEYS_SCOPE_INVALID, TENANT_API_KEYS_UNKNOWN_ROLE, TENANT_API_KEY_EXPIRY_INVALID, TENANT_API_KEYS_NO_SCOPES: `VALIDATION_ERROR`, `TENANT_API_KEYS_SCOPE_INVALID`, `TENANT_API_KEYS_UNKNOWN_ROLE`, `TENANT_API_KEY_EXPIRY_INVALID`, `TENANT_API_KEYS_NO_SCOPES`, or a malformed `Idempotency-Key`.
|
|
@@ -32011,7 +32387,7 @@ declare class AppTenantApiKeysConfigResource extends APIResource {
|
|
|
32011
32387
|
* @see https://productcraft.co/docs/auth/api-reference#put-v1-apps-app-id-tenant-api-keys-config
|
|
32012
32388
|
* @example
|
|
32013
32389
|
* ```ts
|
|
32014
|
-
* const tenantApiKeysConfig = await auth.admin.app("
|
|
32390
|
+
* const tenantApiKeysConfig = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenantApiKeys.config.update({ default_expiry_days: 7 });
|
|
32015
32391
|
* ```
|
|
32016
32392
|
*/
|
|
32017
32393
|
update(params?: AppScopedTenantApiKeyConfigUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<TenantApiKeysConfig>>;
|
|
@@ -32025,6 +32401,9 @@ declare class AppTenantApiKeysResource extends APIResource {
|
|
|
32025
32401
|
*
|
|
32026
32402
|
* Immediate and final; recorded as revoked by you (`revoked_by_type: platform_user`) in the key and in the audit log. Idempotent: revoking a revoked key is a 204 that changes nothing. Requires `auth.revoke` on the app.
|
|
32027
32403
|
*
|
|
32404
|
+
* Credential: `workspace_key`.
|
|
32405
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32406
|
+
*
|
|
32028
32407
|
* @param keyId - Key id (UUID) or display id (`tak_…`).
|
|
32029
32408
|
* @param options - Per-request options.
|
|
32030
32409
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
|
|
@@ -32035,7 +32414,7 @@ declare class AppTenantApiKeysResource extends APIResource {
|
|
|
32035
32414
|
* @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id-tenant-api-keys-key-id
|
|
32036
32415
|
* @example
|
|
32037
32416
|
* ```ts
|
|
32038
|
-
* await auth.admin.app("
|
|
32417
|
+
* await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenantApiKeys.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
32039
32418
|
* ```
|
|
32040
32419
|
*/
|
|
32041
32420
|
delete(keyId: string, options?: RequestOptions): APIPromise<void>;
|
|
@@ -32044,6 +32423,9 @@ declare class AppTenantApiKeysResource extends APIResource {
|
|
|
32044
32423
|
*
|
|
32045
32424
|
* Every tenant of the app, newest first, cursor-paginated (20 per page, max 100). Secrets are never returned. Each key names its creator (`created_by`), and its `status` is `orphaned` when it is neither revoked nor expired but its creator left the tenant or the tenant is not active (introspection refuses it). Requires `auth.read` on the app.
|
|
32046
32425
|
*
|
|
32426
|
+
* Credential: `workspace_key`.
|
|
32427
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32428
|
+
*
|
|
32047
32429
|
* @param params - `Auth.AppScopedTenantApiKeyListParams`.
|
|
32048
32430
|
* @param options - Per-request options.
|
|
32049
32431
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Unknown `status` or malformed `cursor`.
|
|
@@ -32055,10 +32437,10 @@ declare class AppTenantApiKeysResource extends APIResource {
|
|
|
32055
32437
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-tenant-api-keys
|
|
32056
32438
|
* @example
|
|
32057
32439
|
* ```ts
|
|
32058
|
-
* for await (const tenantApiKey of auth.admin.app("
|
|
32440
|
+
* for await (const tenantApiKey of auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenantApiKeys.list()) {
|
|
32059
32441
|
* console.log(tenantApiKey);
|
|
32060
32442
|
* }
|
|
32061
|
-
* const page = await auth.admin.app("
|
|
32443
|
+
* const page = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenantApiKeys.list({}, { timeout: 5_000 });
|
|
32062
32444
|
* ```
|
|
32063
32445
|
*/
|
|
32064
32446
|
list(params?: AppScopedTenantApiKeyListParams, options?: RequestOptions): PagePromise<PlatformTenantApiKey>;
|
|
@@ -32068,6 +32450,9 @@ declare class AppTenantsInvitesResource extends APIResource {
|
|
|
32068
32450
|
/**
|
|
32069
32451
|
* Invite an email address into a tenant. Returns the plaintext code once; only its SHA-256 digest is stored.
|
|
32070
32452
|
*
|
|
32453
|
+
* Credential: `workspace_key`.
|
|
32454
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32455
|
+
*
|
|
32071
32456
|
* @param tenantId - Id of the tenant.
|
|
32072
32457
|
* @param params - `Auth.AppScopedTenantInviteCreateParams`.
|
|
32073
32458
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
@@ -32080,13 +32465,16 @@ declare class AppTenantsInvitesResource extends APIResource {
|
|
|
32080
32465
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-tenants-tenant-id-invites
|
|
32081
32466
|
* @example
|
|
32082
32467
|
* ```ts
|
|
32083
|
-
* const createTenantInvite = await auth.admin.app("
|
|
32468
|
+
* const createTenantInvite = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenants.invites.create("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { email: "alice@example.com", role_name: "member" });
|
|
32084
32469
|
* ```
|
|
32085
32470
|
*/
|
|
32086
32471
|
create(tenantId: string, params: AppScopedTenantInviteCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<CreateTenantInvite>>;
|
|
32087
32472
|
/**
|
|
32088
32473
|
* Revoke a pending invite. Idempotent — a second revoke is a 204 no-op and fires no second webhook.
|
|
32089
32474
|
*
|
|
32475
|
+
* Credential: `workspace_key`.
|
|
32476
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32477
|
+
*
|
|
32090
32478
|
* @param tenantId - Id of the tenant.
|
|
32091
32479
|
* @param inviteId - Id of the invite.
|
|
32092
32480
|
* @param options - Per-request options.
|
|
@@ -32097,13 +32485,16 @@ declare class AppTenantsInvitesResource extends APIResource {
|
|
|
32097
32485
|
* @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id-tenants-tenant-id-invites-invite-id
|
|
32098
32486
|
* @example
|
|
32099
32487
|
* ```ts
|
|
32100
|
-
* await auth.admin.app("
|
|
32488
|
+
* await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenants.invites.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
32101
32489
|
* ```
|
|
32102
32490
|
*/
|
|
32103
32491
|
delete(tenantId: string, inviteId: string, options?: RequestOptions): APIPromise<void>;
|
|
32104
32492
|
/**
|
|
32105
32493
|
* List a tenant's invites, newest first. Optional `?status=pending|revoked|expired|used`. Codes are never returned.
|
|
32106
32494
|
*
|
|
32495
|
+
* Credential: `workspace_key`.
|
|
32496
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32497
|
+
*
|
|
32107
32498
|
* @param tenantId - Id of the tenant.
|
|
32108
32499
|
* @param params - `Auth.AppScopedTenantInviteListParams`.
|
|
32109
32500
|
* @param options - Per-request options.
|
|
@@ -32115,10 +32506,10 @@ declare class AppTenantsInvitesResource extends APIResource {
|
|
|
32115
32506
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-tenants-tenant-id-invites
|
|
32116
32507
|
* @example
|
|
32117
32508
|
* ```ts
|
|
32118
|
-
* for await (const invite of auth.admin.app("
|
|
32509
|
+
* for await (const invite of auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenants.invites.list("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f")) {
|
|
32119
32510
|
* console.log(invite);
|
|
32120
32511
|
* }
|
|
32121
|
-
* const page = await auth.admin.app("
|
|
32512
|
+
* const page = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenants.invites.list("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", {}, { timeout: 5_000 });
|
|
32122
32513
|
* ```
|
|
32123
32514
|
*/
|
|
32124
32515
|
list(tenantId: string, params?: AppScopedTenantInviteListParams, options?: RequestOptions): PagePromise<TenantInvite>;
|
|
@@ -32128,6 +32519,9 @@ declare class AppTenantsMembersResource extends APIResource {
|
|
|
32128
32519
|
/**
|
|
32129
32520
|
* Add a member to a tenant.
|
|
32130
32521
|
*
|
|
32522
|
+
* Credential: `workspace_key`.
|
|
32523
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32524
|
+
*
|
|
32131
32525
|
* @param tenantId - Id of the tenant.
|
|
32132
32526
|
* @param params - `Auth.AppScopedTenantMemberCreateParams`.
|
|
32133
32527
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
@@ -32141,13 +32535,16 @@ declare class AppTenantsMembersResource extends APIResource {
|
|
|
32141
32535
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-tenants-tenant-id-members
|
|
32142
32536
|
* @example
|
|
32143
32537
|
* ```ts
|
|
32144
|
-
* const addMember = await auth.admin.app("
|
|
32538
|
+
* const addMember = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenants.members.create("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { role_name: "member" });
|
|
32145
32539
|
* ```
|
|
32146
32540
|
*/
|
|
32147
32541
|
create(tenantId: string, params: AppScopedTenantMemberCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<AddMember>>;
|
|
32148
32542
|
/**
|
|
32149
32543
|
* Remove a member from a tenant.
|
|
32150
32544
|
*
|
|
32545
|
+
* Credential: `workspace_key`.
|
|
32546
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32547
|
+
*
|
|
32151
32548
|
* @param tenantId - Id of the tenant.
|
|
32152
32549
|
* @param accountId - Id of the account.
|
|
32153
32550
|
* @param options - Per-request options.
|
|
@@ -32159,13 +32556,16 @@ declare class AppTenantsMembersResource extends APIResource {
|
|
|
32159
32556
|
* @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id-tenants-tenant-id-members-account-id
|
|
32160
32557
|
* @example
|
|
32161
32558
|
* ```ts
|
|
32162
|
-
* await auth.admin.app("
|
|
32559
|
+
* await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenants.members.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
32163
32560
|
* ```
|
|
32164
32561
|
*/
|
|
32165
32562
|
delete(tenantId: string, accountId: string, options?: RequestOptions): APIPromise<void>;
|
|
32166
32563
|
/**
|
|
32167
32564
|
* List members of a tenant, newest membership first. Filter by `?search=` and/or `?role=`.
|
|
32168
32565
|
*
|
|
32566
|
+
* Credential: `workspace_key`.
|
|
32567
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32568
|
+
*
|
|
32169
32569
|
* @param tenantId - Id of the tenant.
|
|
32170
32570
|
* @param params - `Auth.AppScopedTenantMemberListParams`.
|
|
32171
32571
|
* @param options - Per-request options.
|
|
@@ -32178,16 +32578,19 @@ declare class AppTenantsMembersResource extends APIResource {
|
|
|
32178
32578
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-tenants-tenant-id-members
|
|
32179
32579
|
* @example
|
|
32180
32580
|
* ```ts
|
|
32181
|
-
* for await (const member of auth.admin.app("
|
|
32581
|
+
* for await (const member of auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenants.members.list("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f")) {
|
|
32182
32582
|
* console.log(member);
|
|
32183
32583
|
* }
|
|
32184
|
-
* const page = await auth.admin.app("
|
|
32584
|
+
* const page = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenants.members.list("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", {}, { timeout: 5_000 });
|
|
32185
32585
|
* ```
|
|
32186
32586
|
*/
|
|
32187
32587
|
list(tenantId: string, params?: AppScopedTenantMemberListParams, options?: RequestOptions): PagePromise<TenantMembership>;
|
|
32188
32588
|
/**
|
|
32189
32589
|
* Change a member's role inside a tenant.
|
|
32190
32590
|
*
|
|
32591
|
+
* Credential: `workspace_key`.
|
|
32592
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32593
|
+
*
|
|
32191
32594
|
* @param tenantId - Id of the tenant.
|
|
32192
32595
|
* @param accountId - Id of the account.
|
|
32193
32596
|
* @param params - `Auth.AppScopedTenantMemberUpdateParams`.
|
|
@@ -32201,7 +32604,7 @@ declare class AppTenantsMembersResource extends APIResource {
|
|
|
32201
32604
|
* @see https://productcraft.co/docs/auth/api-reference#patch-v1-apps-app-id-tenants-tenant-id-members-account-id
|
|
32202
32605
|
* @example
|
|
32203
32606
|
* ```ts
|
|
32204
|
-
* const tenantMembership = await auth.admin.app("
|
|
32607
|
+
* const tenantMembership = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenants.members.update("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { role_name: "admin" });
|
|
32205
32608
|
* ```
|
|
32206
32609
|
*/
|
|
32207
32610
|
update(tenantId: string, accountId: string, params: AppScopedTenantMemberUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<TenantMembership>>;
|
|
@@ -32214,6 +32617,9 @@ declare class AppTenantsResource extends APIResource {
|
|
|
32214
32617
|
/**
|
|
32215
32618
|
* Create a tenant in this app. Auth-admin lane; requires auth.tenant.create on the app URN.
|
|
32216
32619
|
*
|
|
32620
|
+
* Credential: `workspace_key`.
|
|
32621
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32622
|
+
*
|
|
32217
32623
|
* @param params - `Auth.AppScopedTenantCreateParams`.
|
|
32218
32624
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
32219
32625
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid body, empty `displayName`, or `slug` not 1-64 chars of [a-z0-9-].
|
|
@@ -32226,13 +32632,16 @@ declare class AppTenantsResource extends APIResource {
|
|
|
32226
32632
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-tenants
|
|
32227
32633
|
* @example
|
|
32228
32634
|
* ```ts
|
|
32229
|
-
* const tenant = await auth.admin.app("
|
|
32635
|
+
* const tenant = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenants.create({ display_name: "Acme Co" });
|
|
32230
32636
|
* ```
|
|
32231
32637
|
*/
|
|
32232
32638
|
create(params: AppScopedTenantCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<Tenant>>;
|
|
32233
32639
|
/**
|
|
32234
32640
|
* Delete a tenant.
|
|
32235
32641
|
*
|
|
32642
|
+
* Credential: `workspace_key`.
|
|
32643
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32644
|
+
*
|
|
32236
32645
|
* @param tenantId - Id of the tenant.
|
|
32237
32646
|
* @param options - Per-request options.
|
|
32238
32647
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
|
|
@@ -32243,13 +32652,16 @@ declare class AppTenantsResource extends APIResource {
|
|
|
32243
32652
|
* @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id-tenants-tenant-id
|
|
32244
32653
|
* @example
|
|
32245
32654
|
* ```ts
|
|
32246
|
-
* await auth.admin.app("
|
|
32655
|
+
* await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenants.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
32247
32656
|
* ```
|
|
32248
32657
|
*/
|
|
32249
32658
|
delete(tenantId: string, options?: RequestOptions): APIPromise<void>;
|
|
32250
32659
|
/**
|
|
32251
32660
|
* List tenants in this app, paginated by created_at desc.
|
|
32252
32661
|
*
|
|
32662
|
+
* Credential: `workspace_key`.
|
|
32663
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32664
|
+
*
|
|
32253
32665
|
* @param params - `Auth.AppScopedTenantListParams`.
|
|
32254
32666
|
* @param options - Per-request options.
|
|
32255
32667
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Unknown `status` value.
|
|
@@ -32261,16 +32673,19 @@ declare class AppTenantsResource extends APIResource {
|
|
|
32261
32673
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-tenants
|
|
32262
32674
|
* @example
|
|
32263
32675
|
* ```ts
|
|
32264
|
-
* for await (const tenant of auth.admin.app("
|
|
32676
|
+
* for await (const tenant of auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenants.list()) {
|
|
32265
32677
|
* console.log(tenant);
|
|
32266
32678
|
* }
|
|
32267
|
-
* const page = await auth.admin.app("
|
|
32679
|
+
* const page = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenants.list({}, { timeout: 5_000 });
|
|
32268
32680
|
* ```
|
|
32269
32681
|
*/
|
|
32270
32682
|
list(params?: AppScopedTenantListParams, options?: RequestOptions): PagePromise<Tenant>;
|
|
32271
32683
|
/**
|
|
32272
32684
|
* Get a single tenant by id or display id.
|
|
32273
32685
|
*
|
|
32686
|
+
* Credential: `workspace_key`.
|
|
32687
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32688
|
+
*
|
|
32274
32689
|
* @param tenantId - Id of the tenant.
|
|
32275
32690
|
* @param options - Per-request options.
|
|
32276
32691
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
|
|
@@ -32281,13 +32696,16 @@ declare class AppTenantsResource extends APIResource {
|
|
|
32281
32696
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-tenants-tenant-id
|
|
32282
32697
|
* @example
|
|
32283
32698
|
* ```ts
|
|
32284
|
-
* const tenant = await auth.admin.app("
|
|
32699
|
+
* const tenant = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenants.retrieve("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
32285
32700
|
* ```
|
|
32286
32701
|
*/
|
|
32287
32702
|
retrieve(tenantId: string, options?: RequestOptions): APIPromise<WithLastResponse<Tenant>>;
|
|
32288
32703
|
/**
|
|
32289
32704
|
* Update a tenant (display_name, slug, status, metadata).
|
|
32290
32705
|
*
|
|
32706
|
+
* Credential: `workspace_key`.
|
|
32707
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32708
|
+
*
|
|
32291
32709
|
* @param tenantId - Id of the tenant.
|
|
32292
32710
|
* @param params - `Auth.AppScopedTenantUpdateParams`.
|
|
32293
32711
|
* @param options - Per-request options.
|
|
@@ -32301,7 +32719,7 @@ declare class AppTenantsResource extends APIResource {
|
|
|
32301
32719
|
* @see https://productcraft.co/docs/auth/api-reference#patch-v1-apps-app-id-tenants-tenant-id
|
|
32302
32720
|
* @example
|
|
32303
32721
|
* ```ts
|
|
32304
|
-
* const tenant = await auth.admin.app("
|
|
32722
|
+
* const tenant = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenants.update("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { display_name: "Acme Inc" });
|
|
32305
32723
|
* ```
|
|
32306
32724
|
*/
|
|
32307
32725
|
update(tenantId: string, params?: AppScopedTenantUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<Tenant>>;
|
|
@@ -32311,6 +32729,9 @@ declare class AppUnverifiedAccountExpiryResource extends APIResource {
|
|
|
32311
32729
|
/**
|
|
32312
32730
|
* Get the unverified-account expiry setting and how many accounts it deleted in the last 30 days.
|
|
32313
32731
|
*
|
|
32732
|
+
* Credential: `workspace_key`.
|
|
32733
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32734
|
+
*
|
|
32314
32735
|
* @param options - Per-request options.
|
|
32315
32736
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
|
|
32316
32737
|
* @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.read` on this app, or the app is suspended or archived.
|
|
@@ -32320,7 +32741,7 @@ declare class AppUnverifiedAccountExpiryResource extends APIResource {
|
|
|
32320
32741
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-unverified-account-expiry
|
|
32321
32742
|
* @example
|
|
32322
32743
|
* ```ts
|
|
32323
|
-
* const unverifiedAccountExpiryStatus = await auth.admin.app("
|
|
32744
|
+
* const unverifiedAccountExpiryStatus = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").unverifiedAccountExpiry.retrieve();
|
|
32324
32745
|
* ```
|
|
32325
32746
|
*/
|
|
32326
32747
|
retrieve(options?: RequestOptions): APIPromise<WithLastResponse<UnverifiedAccountExpiryStatus>>;
|
|
@@ -32329,6 +32750,9 @@ declare class AppUnverifiedAccountExpiryResource extends APIResource {
|
|
|
32329
32750
|
*
|
|
32330
32751
|
* Permanently deletes every account that qualifies under the app's `unverified_account_ttl_days`, exactly as the nightly job does: each deletion is audited as `auth.account.expired_unverified` and fires `user.deleted` with `reason: "unverified_expired"`. Use `dry_run: true` to preview.
|
|
32331
32752
|
*
|
|
32753
|
+
* Credential: `workspace_key`.
|
|
32754
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32755
|
+
*
|
|
32332
32756
|
* @param params - `Auth.UnverifiedAccountExpiryRunParams`.
|
|
32333
32757
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
32334
32758
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failure (`min_age_minutes` out of range).
|
|
@@ -32342,7 +32766,7 @@ declare class AppUnverifiedAccountExpiryResource extends APIResource {
|
|
|
32342
32766
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-unverified-account-expiry-run
|
|
32343
32767
|
* @example
|
|
32344
32768
|
* ```ts
|
|
32345
|
-
* const unverifiedAccountExpiryRun = await auth.admin.app("
|
|
32769
|
+
* const unverifiedAccountExpiryRun = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").unverifiedAccountExpiry.run({ dry_run: false });
|
|
32346
32770
|
* ```
|
|
32347
32771
|
*/
|
|
32348
32772
|
run(params?: UnverifiedAccountExpiryRunParams, options?: RequestOptions): APIPromise<WithLastResponse<UnverifiedAccountExpiryRun>>;
|
|
@@ -32354,6 +32778,9 @@ declare class AppWebauthnConfigResource extends APIResource {
|
|
|
32354
32778
|
*
|
|
32355
32779
|
* Returns defaults with `enabled: false` and a null `rp_id` when passkeys have never been configured for the app.
|
|
32356
32780
|
*
|
|
32781
|
+
* Credential: `workspace_key`.
|
|
32782
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32783
|
+
*
|
|
32357
32784
|
* @param options - Per-request options.
|
|
32358
32785
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
|
|
32359
32786
|
* @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.read` on this app, or the app is suspended or archived.
|
|
@@ -32363,13 +32790,16 @@ declare class AppWebauthnConfigResource extends APIResource {
|
|
|
32363
32790
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-webauthn-config
|
|
32364
32791
|
* @example
|
|
32365
32792
|
* ```ts
|
|
32366
|
-
* const webauthnConfig = await auth.admin.app("
|
|
32793
|
+
* const webauthnConfig = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").webauthnConfig.retrieve();
|
|
32367
32794
|
* ```
|
|
32368
32795
|
*/
|
|
32369
32796
|
retrieve(options?: RequestOptions): APIPromise<WithLastResponse<WebauthnConfig>>;
|
|
32370
32797
|
/**
|
|
32371
32798
|
* Set the per-app passkey (WebAuthn) relying-party settings.
|
|
32372
32799
|
*
|
|
32800
|
+
* Credential: `workspace_key`.
|
|
32801
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32802
|
+
*
|
|
32373
32803
|
* @param params - `Auth.WebauthnConfigUpdateParams`.
|
|
32374
32804
|
* @param options - Per-request options.
|
|
32375
32805
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `rp_id` is malformed, or is not a registrable suffix of any origin in `allowed_redirect_origins`.
|
|
@@ -32381,7 +32811,7 @@ declare class AppWebauthnConfigResource extends APIResource {
|
|
|
32381
32811
|
* @see https://productcraft.co/docs/auth/api-reference#put-v1-apps-app-id-webauthn-config
|
|
32382
32812
|
* @example
|
|
32383
32813
|
* ```ts
|
|
32384
|
-
* const webauthnConfig = await auth.admin.app("
|
|
32814
|
+
* const webauthnConfig = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").webauthnConfig.update({ enabled: true, rp_id: "example.com" });
|
|
32385
32815
|
* ```
|
|
32386
32816
|
*/
|
|
32387
32817
|
update(params: WebauthnConfigUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<WebauthnConfig>>;
|
|
@@ -32393,6 +32823,9 @@ declare class AppWebhooksEndpointsResource extends APIResource {
|
|
|
32393
32823
|
*
|
|
32394
32824
|
* Deliveries are signed with the Standard Webhooks headers `webhook-id`, `webhook-timestamp` and `webhook-signature` (`v1,<base64 HMAC-SHA256 of "<id>.<timestamp>.<body>">`); the returned `whsec_…` secret works unchanged with any Standard Webhooks library. Failed deliveries are retried after 1 min, 5 min, 30 min, 2 h, 6 h and 24 h.
|
|
32395
32825
|
*
|
|
32826
|
+
* Credential: `workspace_key`.
|
|
32827
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32828
|
+
*
|
|
32396
32829
|
* @param params - `Auth.WebhookEndpointCreateParams`.
|
|
32397
32830
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
32398
32831
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, WEBHOOK_EVENT_TYPE_UNKNOWN: Validation failure: URL not https with a public host, or an unknown event type (`WEBHOOK_EVENT_TYPE_UNKNOWN`).
|
|
@@ -32406,7 +32839,7 @@ declare class AppWebhooksEndpointsResource extends APIResource {
|
|
|
32406
32839
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-webhooks-endpoints
|
|
32407
32840
|
* @example
|
|
32408
32841
|
* ```ts
|
|
32409
|
-
* const webhookEndpointWithSecret = await auth.admin.app("
|
|
32842
|
+
* const webhookEndpointWithSecret = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").webhooks.endpoints.create({ url: "https://api.acme.com/webhooks" });
|
|
32410
32843
|
* ```
|
|
32411
32844
|
*/
|
|
32412
32845
|
create(params: WebhookEndpointCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<WebhookEndpointWithSecret>>;
|
|
@@ -32415,6 +32848,9 @@ declare class AppWebhooksEndpointsResource extends APIResource {
|
|
|
32415
32848
|
*
|
|
32416
32849
|
* Queued retries are dropped. Its past attempts stay in the event log until the events expire.
|
|
32417
32850
|
*
|
|
32851
|
+
* Credential: `workspace_key`.
|
|
32852
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32853
|
+
*
|
|
32418
32854
|
* @param endpointId - Id of the endpoint.
|
|
32419
32855
|
* @param options - Per-request options.
|
|
32420
32856
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `endpoint_id` is not a UUID.
|
|
@@ -32426,7 +32862,7 @@ declare class AppWebhooksEndpointsResource extends APIResource {
|
|
|
32426
32862
|
* @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id-webhooks-endpoints-endpoint-id
|
|
32427
32863
|
* @example
|
|
32428
32864
|
* ```ts
|
|
32429
|
-
* await auth.admin.app("
|
|
32865
|
+
* await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").webhooks.endpoints.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
32430
32866
|
* ```
|
|
32431
32867
|
*/
|
|
32432
32868
|
delete(endpointId: string, options?: RequestOptions): APIPromise<void>;
|
|
@@ -32435,6 +32871,9 @@ declare class AppWebhooksEndpointsResource extends APIResource {
|
|
|
32435
32871
|
*
|
|
32436
32872
|
* At most 10, so this is always one page. Signing secrets are never returned here, only their last 4 characters.
|
|
32437
32873
|
*
|
|
32874
|
+
* Credential: `workspace_key`.
|
|
32875
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32876
|
+
*
|
|
32438
32877
|
* @param options - Per-request options.
|
|
32439
32878
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: The scope id in the path is malformed.
|
|
32440
32879
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
|
|
@@ -32445,7 +32884,7 @@ declare class AppWebhooksEndpointsResource extends APIResource {
|
|
|
32445
32884
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-webhooks-endpoints
|
|
32446
32885
|
* @example
|
|
32447
32886
|
* ```ts
|
|
32448
|
-
* for await (const endpoint of auth.admin.app("
|
|
32887
|
+
* for await (const endpoint of auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").webhooks.endpoints.list()) {
|
|
32449
32888
|
* console.log(endpoint);
|
|
32450
32889
|
* }
|
|
32451
32890
|
* ```
|
|
@@ -32456,6 +32895,9 @@ declare class AppWebhooksEndpointsResource extends APIResource {
|
|
|
32456
32895
|
*
|
|
32457
32896
|
* The endpoint's URL, subscription, on/off state, failure streak and the last 4 characters of its signing secret. The full secret is only returned when the endpoint is created or its secret is rotated.
|
|
32458
32897
|
*
|
|
32898
|
+
* Credential: `workspace_key`.
|
|
32899
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32900
|
+
*
|
|
32459
32901
|
* @param endpointId - Id of the endpoint.
|
|
32460
32902
|
* @param options - Per-request options.
|
|
32461
32903
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `endpoint_id` is not a UUID.
|
|
@@ -32467,7 +32909,7 @@ declare class AppWebhooksEndpointsResource extends APIResource {
|
|
|
32467
32909
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-webhooks-endpoints-endpoint-id
|
|
32468
32910
|
* @example
|
|
32469
32911
|
* ```ts
|
|
32470
|
-
* const webhookEndpoint = await auth.admin.app("
|
|
32912
|
+
* const webhookEndpoint = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").webhooks.endpoints.retrieve("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
32471
32913
|
* ```
|
|
32472
32914
|
*/
|
|
32473
32915
|
retrieve(endpointId: string, options?: RequestOptions): APIPromise<WithLastResponse<WebhookEndpoint>>;
|
|
@@ -32476,6 +32918,9 @@ declare class AppWebhooksEndpointsResource extends APIResource {
|
|
|
32476
32918
|
*
|
|
32477
32919
|
* For `grace_hours` (default 24) the previous secret keeps signing too: `webhook-signature` then lists one `v1,` signature per secret, so receivers can switch over without dropping a delivery.
|
|
32478
32920
|
*
|
|
32921
|
+
* Credential: `workspace_key`.
|
|
32922
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32923
|
+
*
|
|
32479
32924
|
* @param endpointId - Id of the endpoint.
|
|
32480
32925
|
* @param params - `Auth.WebhookEndpointRotateSecretParams`.
|
|
32481
32926
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
@@ -32489,7 +32934,7 @@ declare class AppWebhooksEndpointsResource extends APIResource {
|
|
|
32489
32934
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-webhooks-endpoints-endpoint-id-rotate-secret
|
|
32490
32935
|
* @example
|
|
32491
32936
|
* ```ts
|
|
32492
|
-
* const webhookEndpointWithSecret = await auth.admin.app("
|
|
32937
|
+
* const webhookEndpointWithSecret = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").webhooks.endpoints.rotateSecret("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { grace_hours: 24 });
|
|
32493
32938
|
* ```
|
|
32494
32939
|
*/
|
|
32495
32940
|
rotateSecret(endpointId: string, params?: WebhookEndpointRotateSecretParams, options?: RequestOptions): APIPromise<WithLastResponse<WebhookEndpointWithSecret>>;
|
|
@@ -32498,6 +32943,9 @@ declare class AppWebhooksEndpointsResource extends APIResource {
|
|
|
32498
32943
|
*
|
|
32499
32944
|
* Delivers the catalogue example of `event_type`, signed like any delivery, with `"test": true` in the body. Works while the endpoint is switched off or not subscribed to that type, is logged in the event log, and is never retried or counted toward an automatic disable. Waits up to 15 s for your receiver.
|
|
32500
32945
|
*
|
|
32946
|
+
* Credential: `workspace_key`.
|
|
32947
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32948
|
+
*
|
|
32501
32949
|
* @param endpointId - Id of the endpoint.
|
|
32502
32950
|
* @param params - `Auth.WebhookEndpointTestParams`.
|
|
32503
32951
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
@@ -32511,7 +32959,7 @@ declare class AppWebhooksEndpointsResource extends APIResource {
|
|
|
32511
32959
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-webhooks-endpoints-endpoint-id-test
|
|
32512
32960
|
* @example
|
|
32513
32961
|
* ```ts
|
|
32514
|
-
* const webhookDeliveryAttempt = await auth.admin.app("
|
|
32962
|
+
* const webhookDeliveryAttempt = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").webhooks.endpoints.test("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { event_type: "user.signup" });
|
|
32515
32963
|
* ```
|
|
32516
32964
|
*/
|
|
32517
32965
|
test(endpointId: string, params: WebhookEndpointTestParams, options?: RequestOptions): APIPromise<WithLastResponse<WebhookDeliveryAttempt>>;
|
|
@@ -32520,6 +32968,9 @@ declare class AppWebhooksEndpointsResource extends APIResource {
|
|
|
32520
32968
|
*
|
|
32521
32969
|
* Only the fields sent change. `enabled: true` (or a new URL) also clears an automatic disable. Switching off cancels queued retries. The secret is unchanged; rotate it with `POST …/rotate-secret`.
|
|
32522
32970
|
*
|
|
32971
|
+
* Credential: `workspace_key`.
|
|
32972
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
32973
|
+
*
|
|
32523
32974
|
* @param endpointId - Id of the endpoint.
|
|
32524
32975
|
* @param params - `Auth.WebhookEndpointUpdateParams`.
|
|
32525
32976
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
@@ -32534,7 +32985,7 @@ declare class AppWebhooksEndpointsResource extends APIResource {
|
|
|
32534
32985
|
* @see https://productcraft.co/docs/auth/api-reference#patch-v1-apps-app-id-webhooks-endpoints-endpoint-id
|
|
32535
32986
|
* @example
|
|
32536
32987
|
* ```ts
|
|
32537
|
-
* const webhookEndpoint = await auth.admin.app("
|
|
32988
|
+
* const webhookEndpoint = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").webhooks.endpoints.update("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { description: "Production receiver" });
|
|
32538
32989
|
* ```
|
|
32539
32990
|
*/
|
|
32540
32991
|
update(endpointId: string, params?: WebhookEndpointUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<WebhookEndpoint>>;
|
|
@@ -32546,6 +32997,9 @@ declare class AppWebhooksEventTypesResource extends APIResource {
|
|
|
32546
32997
|
*
|
|
32547
32998
|
* Each type with a plain description, its group and an example `data` object (what "Send test" delivers).
|
|
32548
32999
|
*
|
|
33000
|
+
* Credential: `workspace_key`.
|
|
33001
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
33002
|
+
*
|
|
32549
33003
|
* @param options - Per-request options.
|
|
32550
33004
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
|
|
32551
33005
|
* @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.read` (reads) or `auth.update` (changes, Send test, replay), or the app is suspended or archived.
|
|
@@ -32555,7 +33009,7 @@ declare class AppWebhooksEventTypesResource extends APIResource {
|
|
|
32555
33009
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-webhooks-event-types
|
|
32556
33010
|
* @example
|
|
32557
33011
|
* ```ts
|
|
32558
|
-
* const listWebhookEventTypes = await auth.admin.app("
|
|
33012
|
+
* const listWebhookEventTypes = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").webhooks.eventTypes.list();
|
|
32559
33013
|
* ```
|
|
32560
33014
|
*/
|
|
32561
33015
|
list(options?: RequestOptions): APIPromise<WithLastResponse<ListWebhookEventTypes>>;
|
|
@@ -32567,6 +33021,9 @@ declare class AppWebhooksEventsResource extends APIResource {
|
|
|
32567
33021
|
*
|
|
32568
33022
|
* Every event logged while at least one endpoint existed, with the latest state per endpoint and when the next retry is due.
|
|
32569
33023
|
*
|
|
33024
|
+
* Credential: `workspace_key`.
|
|
33025
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
33026
|
+
*
|
|
32570
33027
|
* @param params - `Auth.WebhookEventListParams`.
|
|
32571
33028
|
* @param options - Per-request options.
|
|
32572
33029
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid filter value or cursor.
|
|
@@ -32578,10 +33035,10 @@ declare class AppWebhooksEventsResource extends APIResource {
|
|
|
32578
33035
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-webhooks-events
|
|
32579
33036
|
* @example
|
|
32580
33037
|
* ```ts
|
|
32581
|
-
* for await (const event of auth.admin.app("
|
|
33038
|
+
* for await (const event of auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").webhooks.events.list()) {
|
|
32582
33039
|
* console.log(event);
|
|
32583
33040
|
* }
|
|
32584
|
-
* const page = await auth.admin.app("
|
|
33041
|
+
* const page = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").webhooks.events.list({}, { timeout: 5_000 });
|
|
32585
33042
|
* ```
|
|
32586
33043
|
*/
|
|
32587
33044
|
list(params?: WebhookEventListParams, options?: RequestOptions): PagePromise<WebhookEvent>;
|
|
@@ -32590,6 +33047,9 @@ declare class AppWebhooksEventsResource extends APIResource {
|
|
|
32590
33047
|
*
|
|
32591
33048
|
* Same body and `webhook-id`, freshly signed, to every switched-on endpoint that receives this event type now, or only to `endpoint_id`. Waits for the receivers (up to 15 s each) and returns the attempts. A success cancels a retry still queued for that endpoint.
|
|
32592
33049
|
*
|
|
33050
|
+
* Credential: `workspace_key`.
|
|
33051
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
33052
|
+
*
|
|
32593
33053
|
* @param eventId - The event id, `evt_<uuid>`.
|
|
32594
33054
|
* @param params - `Auth.WebhookEventReplayParams`.
|
|
32595
33055
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
@@ -32603,7 +33063,7 @@ declare class AppWebhooksEventsResource extends APIResource {
|
|
|
32603
33063
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-webhooks-events-event-id-replay
|
|
32604
33064
|
* @example
|
|
32605
33065
|
* ```ts
|
|
32606
|
-
* const replayWebhookEvent = await auth.admin.app("
|
|
33066
|
+
* const replayWebhookEvent = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").webhooks.events.replay("evt_3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
32607
33067
|
* ```
|
|
32608
33068
|
*/
|
|
32609
33069
|
replay(eventId: string, params?: WebhookEventReplayParams, options?: RequestOptions): APIPromise<WithLastResponse<ReplayWebhookEvent>>;
|
|
@@ -32612,6 +33072,9 @@ declare class AppWebhooksEventsResource extends APIResource {
|
|
|
32612
33072
|
*
|
|
32613
33073
|
* The event as it was sent (`type`, `data`) and every delivery attempt to every endpoint, with its trigger, HTTP status, error and the start of the response body. Use it to debug a receiver, then `replay` to send it again.
|
|
32614
33074
|
*
|
|
33075
|
+
* Credential: `workspace_key`.
|
|
33076
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
33077
|
+
*
|
|
32615
33078
|
* @param eventId - The event id, `evt_<uuid>`.
|
|
32616
33079
|
* @param options - Per-request options.
|
|
32617
33080
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `event_id` is not `evt_<uuid>`.
|
|
@@ -32623,7 +33086,7 @@ declare class AppWebhooksEventsResource extends APIResource {
|
|
|
32623
33086
|
* @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-webhooks-events-event-id
|
|
32624
33087
|
* @example
|
|
32625
33088
|
* ```ts
|
|
32626
|
-
* const webhookEventDetail = await auth.admin.app("
|
|
33089
|
+
* const webhookEventDetail = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").webhooks.events.retrieve("evt_3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
32627
33090
|
* ```
|
|
32628
33091
|
*/
|
|
32629
33092
|
retrieve(eventId: string, options?: RequestOptions): APIPromise<WithLastResponse<WebhookEventDetail>>;
|
|
@@ -32665,6 +33128,9 @@ declare class AuthApp extends APIResource {
|
|
|
32665
33128
|
/**
|
|
32666
33129
|
* Create a second app in the same workspace whose configuration matches this one — the "staging app" flow. Copies the auth config, roles, permissions, notification settings and the webhook target (with a NEW signing secret), and optionally tenants. Never copies credentials, end-users, sessions, signing keys, federated provider configs or audit history.
|
|
32667
33130
|
*
|
|
33131
|
+
* Credential: `workspace_key`.
|
|
33132
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
33133
|
+
*
|
|
32668
33134
|
* @param params - `Auth.CloneParams`.
|
|
32669
33135
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
32670
33136
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failure, or the slug matches the source.
|
|
@@ -32677,13 +33143,16 @@ declare class AuthApp extends APIResource {
|
|
|
32677
33143
|
* @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-clone
|
|
32678
33144
|
* @example
|
|
32679
33145
|
* ```ts
|
|
32680
|
-
* const cloneApp = await auth.admin.app("
|
|
33146
|
+
* const cloneApp = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").clone({ environment: "staging", slug: "acme-app-staging" });
|
|
32681
33147
|
* ```
|
|
32682
33148
|
*/
|
|
32683
33149
|
clone(params: CloneParams, options?: RequestOptions): APIPromise<WithLastResponse<CloneApp>>;
|
|
32684
33150
|
/**
|
|
32685
33151
|
* Update app status (active, suspended, archived)
|
|
32686
33152
|
*
|
|
33153
|
+
* Credential: `workspace_key`.
|
|
33154
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
33155
|
+
*
|
|
32687
33156
|
* @param params - `Auth.UpdateStatusParams`.
|
|
32688
33157
|
* @param options - Per-request options.
|
|
32689
33158
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid status transition (e.g. archived → active).
|
|
@@ -32695,7 +33164,7 @@ declare class AuthApp extends APIResource {
|
|
|
32695
33164
|
* @see https://productcraft.co/docs/auth/api-reference#patch-v1-apps-app-id-status
|
|
32696
33165
|
* @example
|
|
32697
33166
|
* ```ts
|
|
32698
|
-
* const app = await auth.admin.app("
|
|
33167
|
+
* const app = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").updateStatus({ status: "suspended" });
|
|
32699
33168
|
* ```
|
|
32700
33169
|
*/
|
|
32701
33170
|
updateStatus(params: UpdateStatusParams, options?: RequestOptions): APIPromise<WithLastResponse<App>>;
|
|
@@ -32802,6 +33271,9 @@ declare class ConsumerMeActivityResource extends APIResource {
|
|
|
32802
33271
|
*
|
|
32803
33272
|
* Login events, password changes, and other security-relevant records, scoped to this EndUser.
|
|
32804
33273
|
*
|
|
33274
|
+
* Credential: `end_user_token`.
|
|
33275
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
33276
|
+
*
|
|
32805
33277
|
* @param options - Per-request options.
|
|
32806
33278
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token, unknown or inactive app, or the account/session is no longer active.
|
|
32807
33279
|
* @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.
|
|
@@ -32809,7 +33281,7 @@ declare class ConsumerMeActivityResource extends APIResource {
|
|
|
32809
33281
|
* @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-me-activity
|
|
32810
33282
|
* @example
|
|
32811
33283
|
* ```ts
|
|
32812
|
-
* for await (const activity of auth.consumer("app").me.activity.list()) {
|
|
33284
|
+
* for await (const activity of auth.consumer("my-app").me.activity.list()) {
|
|
32813
33285
|
* console.log(activity);
|
|
32814
33286
|
* }
|
|
32815
33287
|
* ```
|
|
@@ -32823,6 +33295,9 @@ declare class ConsumerMeContactsResource extends APIResource {
|
|
|
32823
33295
|
*
|
|
32824
33296
|
* Adds an email or phone contact to the EndUser. The contact starts unverified and non-primary. Verification is a separate flow — call /auth/request-verification with the contact value and the customer's PAK to mint a code, then submit via /auth/verify.
|
|
32825
33297
|
*
|
|
33298
|
+
* Credential: `end_user_token`.
|
|
33299
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
33300
|
+
*
|
|
32826
33301
|
* @param params - `Auth.MeContactCreateParams`.
|
|
32827
33302
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
32828
33303
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Request validation failed: unsupported `type`, invalid email, or empty/over-long `value`.
|
|
@@ -32833,13 +33308,16 @@ declare class ConsumerMeContactsResource extends APIResource {
|
|
|
32833
33308
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-me-contacts
|
|
32834
33309
|
* @example
|
|
32835
33310
|
* ```ts
|
|
32836
|
-
* const meContact = await auth.consumer("app").me.contacts.create({ type: "email", value: "
|
|
33311
|
+
* const meContact = await auth.consumer("my-app").me.contacts.create({ type: "email", value: "ada@example.com" });
|
|
32837
33312
|
* ```
|
|
32838
33313
|
*/
|
|
32839
33314
|
create(params: MeContactCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<MeContact>>;
|
|
32840
33315
|
/**
|
|
32841
33316
|
* Delete a contact
|
|
32842
33317
|
*
|
|
33318
|
+
* Credential: `end_user_token`.
|
|
33319
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
33320
|
+
*
|
|
32843
33321
|
* @param id - Id of the contact.
|
|
32844
33322
|
* @param options - Per-request options.
|
|
32845
33323
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token, unknown or inactive app, or the account/session is no longer active.
|
|
@@ -32850,13 +33328,16 @@ declare class ConsumerMeContactsResource extends APIResource {
|
|
|
32850
33328
|
* @see https://productcraft.co/docs/auth/api-reference#delete-app-slug-v1-me-contacts-id
|
|
32851
33329
|
* @example
|
|
32852
33330
|
* ```ts
|
|
32853
|
-
* await auth.consumer("app").me.contacts.delete("
|
|
33331
|
+
* await auth.consumer("my-app").me.contacts.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
32854
33332
|
* ```
|
|
32855
33333
|
*/
|
|
32856
33334
|
delete(id: string, options?: RequestOptions): APIPromise<void>;
|
|
32857
33335
|
/**
|
|
32858
33336
|
* List the EndUser's contacts
|
|
32859
33337
|
*
|
|
33338
|
+
* Credential: `end_user_token`.
|
|
33339
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
33340
|
+
*
|
|
32860
33341
|
* @param options - Per-request options.
|
|
32861
33342
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token, unknown or inactive app, or the account/session is no longer active.
|
|
32862
33343
|
* @throws {RateLimitError} 429 RATE_LIMITED: Per-IP rate limit (`RATE_LIMITED`): the general bucket, 60 requests per minute per IP. Adding, verifying or removing a contact is in the strict `auth` bucket (10 per minute).
|
|
@@ -32864,7 +33345,7 @@ declare class ConsumerMeContactsResource extends APIResource {
|
|
|
32864
33345
|
* @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-me-contacts
|
|
32865
33346
|
* @example
|
|
32866
33347
|
* ```ts
|
|
32867
|
-
* const meContacts = await auth.consumer("app").me.contacts.list();
|
|
33348
|
+
* const meContacts = await auth.consumer("my-app").me.contacts.list();
|
|
32868
33349
|
* ```
|
|
32869
33350
|
*/
|
|
32870
33351
|
list(options?: RequestOptions): APIPromise<WithLastResponse<MeContacts>>;
|
|
@@ -32873,6 +33354,9 @@ declare class ConsumerMeContactsResource extends APIResource {
|
|
|
32873
33354
|
*
|
|
32874
33355
|
* Demotes the previous primary of the same type. Refused (409) when the target contact is unverified — promoting an unverified contact would let an attacker who registered the contact bypass verification by routing reset codes through it.
|
|
32875
33356
|
*
|
|
33357
|
+
* Credential: `end_user_token`.
|
|
33358
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
33359
|
+
*
|
|
32876
33360
|
* @param id - Id of the contact.
|
|
32877
33361
|
* @param options - Per-request options.
|
|
32878
33362
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token, unknown or inactive app, or the account/session is no longer active.
|
|
@@ -32883,7 +33367,7 @@ declare class ConsumerMeContactsResource extends APIResource {
|
|
|
32883
33367
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-me-contacts-id-promote
|
|
32884
33368
|
* @example
|
|
32885
33369
|
* ```ts
|
|
32886
|
-
* await auth.consumer("app").me.contacts.promote("
|
|
33370
|
+
* await auth.consumer("my-app").me.contacts.promote("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
32887
33371
|
* ```
|
|
32888
33372
|
*/
|
|
32889
33373
|
promote(id: string, options?: RequestOptions): APIPromise<void>;
|
|
@@ -32895,6 +33379,9 @@ declare class ConsumerMeMfaFactorsResource extends APIResource {
|
|
|
32895
33379
|
*
|
|
32896
33380
|
* Creates a pending factor and returns the type-specific enrollment payload. TOTP: the otpauth URI, QR data URL, and shared secret; confirm with two consecutive codes. Email: a 6-digit code is sent to the bound verified email contact (primary by default, `contact_id` to override); confirm with that single code. The factor stays disabled until `/factors/:id/verify` succeeds.
|
|
32897
33381
|
*
|
|
33382
|
+
* Credential: `end_user_token`.
|
|
33383
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
33384
|
+
*
|
|
32898
33385
|
* @param params - `Auth.MeMfaFactorCreateParams`.
|
|
32899
33386
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
32900
33387
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Request validation failed: unsupported `type`, over-long `label`, or `contact_id` is not a UUID.
|
|
@@ -32907,7 +33394,7 @@ declare class ConsumerMeMfaFactorsResource extends APIResource {
|
|
|
32907
33394
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-me-mfa-factors
|
|
32908
33395
|
* @example
|
|
32909
33396
|
* ```ts
|
|
32910
|
-
* const startEnrollment = await auth.consumer("app").me.mfa.factors.create({ type: "totp" });
|
|
33397
|
+
* const startEnrollment = await auth.consumer("my-app").me.mfa.factors.create({ type: "totp" });
|
|
32911
33398
|
* ```
|
|
32912
33399
|
*/
|
|
32913
33400
|
create(params: MeMfaFactorCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<StartEnrollment>>;
|
|
@@ -32916,6 +33403,9 @@ declare class ConsumerMeMfaFactorsResource extends APIResource {
|
|
|
32916
33403
|
*
|
|
32917
33404
|
* Soft-disable. The row is preserved (with `disabled_at` set) for audit. Has no effect on existing sessions — their `amr` claim still reflects whatever satisfied sign-in at the time. Disabling the only enabled factor removes the MFA requirement on future sign-ins.
|
|
32918
33405
|
*
|
|
33406
|
+
* Credential: `end_user_token`.
|
|
33407
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
33408
|
+
*
|
|
32919
33409
|
* @param id - Id of the factor.
|
|
32920
33410
|
* @param options - Per-request options.
|
|
32921
33411
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token, unknown or inactive app, or the account/session is no longer active.
|
|
@@ -32925,7 +33415,7 @@ declare class ConsumerMeMfaFactorsResource extends APIResource {
|
|
|
32925
33415
|
* @see https://productcraft.co/docs/auth/api-reference#delete-app-slug-v1-me-mfa-factors-id
|
|
32926
33416
|
* @example
|
|
32927
33417
|
* ```ts
|
|
32928
|
-
* await auth.consumer("app").me.mfa.factors.delete("
|
|
33418
|
+
* await auth.consumer("my-app").me.mfa.factors.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
32929
33419
|
* ```
|
|
32930
33420
|
*/
|
|
32931
33421
|
delete(id: string, options?: RequestOptions): APIPromise<void>;
|
|
@@ -32934,6 +33424,9 @@ declare class ConsumerMeMfaFactorsResource extends APIResource {
|
|
|
32934
33424
|
*
|
|
32935
33425
|
* Includes factors in any state (pending enrollment + enabled). Disabled factors are not listed.
|
|
32936
33426
|
*
|
|
33427
|
+
* Credential: `end_user_token`.
|
|
33428
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
33429
|
+
*
|
|
32937
33430
|
* @param options - Per-request options.
|
|
32938
33431
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token, unknown or inactive app, or the account/session is no longer active.
|
|
32939
33432
|
* @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.
|
|
@@ -32941,7 +33434,7 @@ declare class ConsumerMeMfaFactorsResource extends APIResource {
|
|
|
32941
33434
|
* @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-me-mfa-factors
|
|
32942
33435
|
* @example
|
|
32943
33436
|
* ```ts
|
|
32944
|
-
* const factorList = await auth.consumer("app").me.mfa.factors.list();
|
|
33437
|
+
* const factorList = await auth.consumer("my-app").me.mfa.factors.list();
|
|
32945
33438
|
* ```
|
|
32946
33439
|
*/
|
|
32947
33440
|
list(options?: RequestOptions): APIPromise<WithLastResponse<FactorList>>;
|
|
@@ -32950,6 +33443,9 @@ declare class ConsumerMeMfaFactorsResource extends APIResource {
|
|
|
32950
33443
|
*
|
|
32951
33444
|
* TOTP: submit two `codes` from consecutive 30-second windows. Email: submit the emailed 6-digit `code`. On success the factor flips to enabled, recovery codes are minted (returned once), and prior recovery codes for the account are invalidated. Subsequent calls with the same `:id` fail with 400.
|
|
32952
33445
|
*
|
|
33446
|
+
* Credential: `end_user_token`.
|
|
33447
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
33448
|
+
*
|
|
32953
33449
|
* @param id - Id of the factor.
|
|
32954
33450
|
* @param params - `Auth.MeMfaFactorVerifyParams`.
|
|
32955
33451
|
* @param options - Per-request options.
|
|
@@ -32960,7 +33456,7 @@ declare class ConsumerMeMfaFactorsResource extends APIResource {
|
|
|
32960
33456
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-me-mfa-factors-id-verify
|
|
32961
33457
|
* @example
|
|
32962
33458
|
* ```ts
|
|
32963
|
-
* const confirmEnrollment = await auth.consumer("app").me.mfa.factors.verify("
|
|
33459
|
+
* const confirmEnrollment = await auth.consumer("my-app").me.mfa.factors.verify("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { code: "123456" });
|
|
32964
33460
|
* ```
|
|
32965
33461
|
*/
|
|
32966
33462
|
verify(id: string, params?: MeMfaFactorVerifyParams, options?: RequestOptions): APIPromise<WithLastResponse<ConfirmEnrollment>>;
|
|
@@ -32972,6 +33468,9 @@ declare class ConsumerMeMfaRecoveryCodesResource extends APIResource {
|
|
|
32972
33468
|
*
|
|
32973
33469
|
* Mints a fresh set of single-use recovery codes and invalidates every prior code for the account. The new codes are returned once — store them now.
|
|
32974
33470
|
*
|
|
33471
|
+
* Credential: `end_user_token`.
|
|
33472
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
33473
|
+
*
|
|
32975
33474
|
* @param options - Per-request options.
|
|
32976
33475
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token, unknown or inactive app, or the account/session is no longer active.
|
|
32977
33476
|
* @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.
|
|
@@ -32979,7 +33478,7 @@ declare class ConsumerMeMfaRecoveryCodesResource extends APIResource {
|
|
|
32979
33478
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-me-mfa-recovery-codes-regenerate
|
|
32980
33479
|
* @example
|
|
32981
33480
|
* ```ts
|
|
32982
|
-
* const recoveryCodes = await auth.consumer("app").me.mfa.recoveryCodes.regenerate();
|
|
33481
|
+
* const recoveryCodes = await auth.consumer("my-app").me.mfa.recoveryCodes.regenerate();
|
|
32983
33482
|
* ```
|
|
32984
33483
|
*/
|
|
32985
33484
|
regenerate(options?: RequestOptions): APIPromise<WithLastResponse<RecoveryCodes>>;
|
|
@@ -32991,6 +33490,9 @@ declare class ConsumerMeMfaStepUpWebauthnResource extends APIResource {
|
|
|
32991
33490
|
*
|
|
32992
33491
|
* Mints a single-use WebAuthn challenge for the enabled passkeys on this account and returns the `publicKey` member for `navigator.credentials.get()`. Submit the result to `/step-up` as `credential`. Refused while step-up is locked on this session — a locked session must not be able to keep minting challenges.
|
|
32993
33492
|
*
|
|
33493
|
+
* Credential: `end_user_token`.
|
|
33494
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
33495
|
+
*
|
|
32994
33496
|
* @param options - Per-request options.
|
|
32995
33497
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: No passkey is enrolled on this account.
|
|
32996
33498
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
@@ -33000,7 +33502,7 @@ declare class ConsumerMeMfaStepUpWebauthnResource extends APIResource {
|
|
|
33000
33502
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-me-mfa-step-up-webauthn-options
|
|
33001
33503
|
* @example
|
|
33002
33504
|
* ```ts
|
|
33003
|
-
* const webauthnOptions = await auth.consumer("app").me.mfa.stepUp.webauthn.options();
|
|
33505
|
+
* const webauthnOptions = await auth.consumer("my-app").me.mfa.stepUp.webauthn.options();
|
|
33004
33506
|
* ```
|
|
33005
33507
|
*/
|
|
33006
33508
|
options(options?: RequestOptions): APIPromise<WithLastResponse<WebauthnOptions>>;
|
|
@@ -33014,6 +33516,9 @@ declare class ConsumerMeMfaStepUpResource extends APIResource {
|
|
|
33014
33516
|
*
|
|
33015
33517
|
* Mints a single-use 6-digit code against one of the account's enabled email factors and delivers it to the bound address. Follow with `/step-up` submitting the code. Codes expire after 5 minutes; sends are throttled per contact (30s between sends, shared with the sign-in path). Refused while step-up is locked on this session.
|
|
33016
33518
|
*
|
|
33519
|
+
* Credential: `end_user_token`.
|
|
33520
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
33521
|
+
*
|
|
33017
33522
|
* @param params - `Auth.MeMfaStepUpSendCodeParams`.
|
|
33018
33523
|
* @param options - Per-request options.
|
|
33019
33524
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Account has no enabled email factor (or the named factor is not an email factor).
|
|
@@ -33025,7 +33530,7 @@ declare class ConsumerMeMfaStepUpResource extends APIResource {
|
|
|
33025
33530
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-me-mfa-step-up-send-code
|
|
33026
33531
|
* @example
|
|
33027
33532
|
* ```ts
|
|
33028
|
-
* const stepUpSendCode = await auth.consumer("app").me.mfa.stepUp.sendCode({ factor_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b" });
|
|
33533
|
+
* const stepUpSendCode = await auth.consumer("my-app").me.mfa.stepUp.sendCode({ factor_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b" });
|
|
33029
33534
|
* ```
|
|
33030
33535
|
*/
|
|
33031
33536
|
sendCode(params?: MeMfaStepUpSendCodeParams, options?: RequestOptions): APIPromise<WithLastResponse<StepUpSendCode>>;
|
|
@@ -33034,6 +33539,9 @@ declare class ConsumerMeMfaStepUpResource extends APIResource {
|
|
|
33034
33539
|
*
|
|
33035
33540
|
* Verify a fresh code (TOTP, emailed via `/step-up/send-code`, or recovery) against any enabled factor on the account, and update the session's `auth_methods` + `mfa_at`. Call `/auth/refresh` after this to mint a token whose claims reflect the new state. Customers reading `mfa_at` from access tokens to gate sensitive actions should require a `/step-up` + refresh cycle when the timestamp is older than their policy window. 5 consecutive wrong codes lock step-up on this session for 15 minutes.
|
|
33036
33541
|
*
|
|
33542
|
+
* Credential: `end_user_token`.
|
|
33543
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
33544
|
+
*
|
|
33037
33545
|
* @param params - `Auth.MeMfaStepUpVerifyParams`.
|
|
33038
33546
|
* @param options - Per-request options.
|
|
33039
33547
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Code did not match any enabled factor or recovery code.
|
|
@@ -33043,7 +33551,7 @@ declare class ConsumerMeMfaStepUpResource extends APIResource {
|
|
|
33043
33551
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-me-mfa-step-up
|
|
33044
33552
|
* @example
|
|
33045
33553
|
* ```ts
|
|
33046
|
-
* const stepUp = await auth.consumer("app").me.mfa.stepUp.verify({ code: "123456" });
|
|
33554
|
+
* const stepUp = await auth.consumer("my-app").me.mfa.stepUp.verify({ code: "123456" });
|
|
33047
33555
|
* ```
|
|
33048
33556
|
*/
|
|
33049
33557
|
verify(params?: MeMfaStepUpVerifyParams, options?: RequestOptions): APIPromise<WithLastResponse<StepUp>>;
|
|
@@ -33062,6 +33570,9 @@ declare class ConsumerMeSessionsResource extends APIResource {
|
|
|
33062
33570
|
*
|
|
33063
33571
|
* Sign the EndUser out of one device. The session's refresh token is destroyed; its access token expires on its TTL. Requires the `session.revoke` permission when the app's `enforce_app_permissions` flag is on; otherwise (the default) any valid token can call this. Self-revoke (revoking your own session as a member with no perms) is something to enforce separately if needed; this guard does not exempt the principal from the role check.
|
|
33064
33572
|
*
|
|
33573
|
+
* Credential: `end_user_token`.
|
|
33574
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
33575
|
+
*
|
|
33065
33576
|
* @param id - Id of the session.
|
|
33066
33577
|
* @param options - Per-request options.
|
|
33067
33578
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token, unknown or inactive app, or the account/session is no longer active.
|
|
@@ -33071,7 +33582,7 @@ declare class ConsumerMeSessionsResource extends APIResource {
|
|
|
33071
33582
|
* @see https://productcraft.co/docs/auth/api-reference#delete-app-slug-v1-me-sessions-id
|
|
33072
33583
|
* @example
|
|
33073
33584
|
* ```ts
|
|
33074
|
-
* await auth.consumer("app").me.sessions.delete("
|
|
33585
|
+
* await auth.consumer("my-app").me.sessions.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
33075
33586
|
* ```
|
|
33076
33587
|
*/
|
|
33077
33588
|
delete(id: string, options?: RequestOptions): APIPromise<void>;
|
|
@@ -33080,6 +33591,9 @@ declare class ConsumerMeSessionsResource extends APIResource {
|
|
|
33080
33591
|
*
|
|
33081
33592
|
* Each session includes a `current` flag identifying the one belonging to the bearer token used for this request.
|
|
33082
33593
|
*
|
|
33594
|
+
* Credential: `end_user_token`.
|
|
33595
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
33596
|
+
*
|
|
33083
33597
|
* @param options - Per-request options.
|
|
33084
33598
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token, unknown or inactive app, or the account/session is no longer active.
|
|
33085
33599
|
* @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.
|
|
@@ -33087,7 +33601,7 @@ declare class ConsumerMeSessionsResource extends APIResource {
|
|
|
33087
33601
|
* @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-me-sessions
|
|
33088
33602
|
* @example
|
|
33089
33603
|
* ```ts
|
|
33090
|
-
* for await (const session of auth.consumer("app").me.sessions.list()) {
|
|
33604
|
+
* for await (const session of auth.consumer("my-app").me.sessions.list()) {
|
|
33091
33605
|
* console.log(session);
|
|
33092
33606
|
* }
|
|
33093
33607
|
* ```
|
|
@@ -33101,6 +33615,9 @@ declare class ConsumerMeTenantInvitesResource extends APIResource {
|
|
|
33101
33615
|
*
|
|
33102
33616
|
* Adds the caller to the invited tenant with the role the invite names, and consumes the invite. Requires the invited address to be one of the caller's own VERIFIED email contacts in this app — holding the code is not sufficient, because whoever minted the invite also holds it, and an unverified contact is not proof of owning the address. A refused accept leaves the invite redeemable.
|
|
33103
33617
|
*
|
|
33618
|
+
* Credential: `end_user_token`.
|
|
33619
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
33620
|
+
*
|
|
33104
33621
|
* @param params - `Auth.MeTenantInviteAcceptParams`.
|
|
33105
33622
|
* @param options - Per-request options.
|
|
33106
33623
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
@@ -33113,7 +33630,7 @@ declare class ConsumerMeTenantInvitesResource extends APIResource {
|
|
|
33113
33630
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-me-tenant-invites-accept
|
|
33114
33631
|
* @example
|
|
33115
33632
|
* ```ts
|
|
33116
|
-
* const acceptedTenantInvite = await auth.consumer("app").me.tenantInvites.accept({ code: "tinv_9dK2mQ7pR4vXbN1sT6yZ0hLcJeW3fAgU" });
|
|
33633
|
+
* const acceptedTenantInvite = await auth.consumer("my-app").me.tenantInvites.accept({ code: "tinv_9dK2mQ7pR4vXbN1sT6yZ0hLcJeW3fAgU" });
|
|
33117
33634
|
* ```
|
|
33118
33635
|
*/
|
|
33119
33636
|
accept(params: MeTenantInviteAcceptParams, options?: RequestOptions): APIPromise<WithLastResponse<AcceptedTenantInvite>>;
|
|
@@ -33125,6 +33642,9 @@ declare class ConsumerMeTenantsResource extends APIResource {
|
|
|
33125
33642
|
*
|
|
33126
33643
|
* Returns each tenant the caller is a member of, including the tenant slug + display name and the member's role. Powers a tenant-switcher UI on the customer's product.
|
|
33127
33644
|
*
|
|
33645
|
+
* Credential: `end_user_token`.
|
|
33646
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
33647
|
+
*
|
|
33128
33648
|
* @param options - Per-request options.
|
|
33129
33649
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing / invalid bearer, or the session behind the token is revoked, expired or no longer exists.
|
|
33130
33650
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, APP_SUSPENDED, APP_ARCHIVED: The app exists but is suspended (`APP_SUSPENDED`) or archived (`APP_ARCHIVED`). Decided by `AppStatusGuard` before the handler runs.
|
|
@@ -33134,7 +33654,7 @@ declare class ConsumerMeTenantsResource extends APIResource {
|
|
|
33134
33654
|
* @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-auth-me-tenants
|
|
33135
33655
|
* @example
|
|
33136
33656
|
* ```ts
|
|
33137
|
-
* const myTenants = await auth.consumer("app").me.tenants.list();
|
|
33657
|
+
* const myTenants = await auth.consumer("my-app").me.tenants.list();
|
|
33138
33658
|
* ```
|
|
33139
33659
|
*/
|
|
33140
33660
|
list(options?: RequestOptions): APIPromise<WithLastResponse<MyTenants>>;
|
|
@@ -33153,6 +33673,9 @@ declare class ConsumerMeResource extends APIResource {
|
|
|
33153
33673
|
*
|
|
33154
33674
|
* Verifies `current_password`, sets the new hash, and revokes every OTHER active session for the account (the calling session is preserved). 401 if the current password is wrong or the account has no password credential — admin-provisioned accounts without an initial password should use the reset flow instead. The new password is held to exactly the same policy as signup: the app's length + character-class rules, the common-password deny-list, and the breach corpus.
|
|
33155
33675
|
*
|
|
33676
|
+
* Credential: `end_user_token`.
|
|
33677
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
33678
|
+
*
|
|
33156
33679
|
* @param params - `Auth.MeChangePasswordParams`.
|
|
33157
33680
|
* @param options - Per-request options.
|
|
33158
33681
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, PASSWORD_TOO_COMMON, PASSWORD_BREACHED: The new password fails the app-configured policy, is on the common-password deny-list (`PASSWORD_TOO_COMMON`), appears in a public breach corpus (`PASSWORD_BREACHED`), or is identical to the current one.
|
|
@@ -33163,7 +33686,10 @@ declare class ConsumerMeResource extends APIResource {
|
|
|
33163
33686
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-me-change-password
|
|
33164
33687
|
* @example
|
|
33165
33688
|
* ```ts
|
|
33166
|
-
* await auth.consumer("app").me.changePassword({
|
|
33689
|
+
* await auth.consumer("my-app").me.changePassword({
|
|
33690
|
+
* current_password: "correct horse battery staple",
|
|
33691
|
+
* new_password: "a new long passphrase 42",
|
|
33692
|
+
* });
|
|
33167
33693
|
* ```
|
|
33168
33694
|
*/
|
|
33169
33695
|
changePassword(params: MeChangePasswordParams, options?: RequestOptions): APIPromise<void>;
|
|
@@ -33172,6 +33698,9 @@ declare class ConsumerMeResource extends APIResource {
|
|
|
33172
33698
|
*
|
|
33173
33699
|
* Removes the EndUser, all sessions, and all related records inside this app. Cannot be undone. The app audit log keeps one `auth.account.deleted` row (`via: self`; username and email domain only, never the address), and `user.deleted` fires with `via: "self"`.
|
|
33174
33700
|
*
|
|
33701
|
+
* Credential: `end_user_token`.
|
|
33702
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
33703
|
+
*
|
|
33175
33704
|
* @param options - Per-request options.
|
|
33176
33705
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token, unknown or inactive app, or the account/session is no longer active.
|
|
33177
33706
|
* @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.
|
|
@@ -33179,7 +33708,7 @@ declare class ConsumerMeResource extends APIResource {
|
|
|
33179
33708
|
* @see https://productcraft.co/docs/auth/api-reference#delete-app-slug-v1-me
|
|
33180
33709
|
* @example
|
|
33181
33710
|
* ```ts
|
|
33182
|
-
* await auth.consumer("app").me.deleteAccount();
|
|
33711
|
+
* await auth.consumer("my-app").me.deleteAccount();
|
|
33183
33712
|
* ```
|
|
33184
33713
|
*/
|
|
33185
33714
|
deleteAccount(options?: RequestOptions): APIPromise<void>;
|
|
@@ -33188,6 +33717,9 @@ declare class ConsumerMeResource extends APIResource {
|
|
|
33188
33717
|
*
|
|
33189
33718
|
* Clears both the uploaded avatar and any provider-captured picture, and deletes the stored object. A later Google/GitHub sign-in re-populates the provider picture — that is "sync from provider" behavior, by design.
|
|
33190
33719
|
*
|
|
33720
|
+
* Credential: `end_user_token`.
|
|
33721
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
33722
|
+
*
|
|
33191
33723
|
* @param options - Per-request options.
|
|
33192
33724
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token, unknown or inactive app, or the account/session is no longer active.
|
|
33193
33725
|
* @throws {NotFoundError} 404 NOT_FOUND, ACCOUNT_NOT_FOUND: Account not found in this app (`ACCOUNT_NOT_FOUND`).
|
|
@@ -33196,7 +33728,7 @@ declare class ConsumerMeResource extends APIResource {
|
|
|
33196
33728
|
* @see https://productcraft.co/docs/auth/api-reference#delete-app-slug-v1-me-avatar
|
|
33197
33729
|
* @example
|
|
33198
33730
|
* ```ts
|
|
33199
|
-
* await auth.consumer("app").me.deleteAvatar();
|
|
33731
|
+
* await auth.consumer("my-app").me.deleteAvatar();
|
|
33200
33732
|
* ```
|
|
33201
33733
|
*/
|
|
33202
33734
|
deleteAvatar(options?: RequestOptions): APIPromise<void>;
|
|
@@ -33205,6 +33737,9 @@ declare class ConsumerMeResource extends APIResource {
|
|
|
33205
33737
|
*
|
|
33206
33738
|
* Returns the union of the app-level role permissions and the tenant-level role permissions (when the token carries an `org_id`). Resolved per-request through a 60-second LRU — role-permission edits propagate within ~1 minute. Use this instead of decoding a `permissions[]` claim from the JWT, which is no longer included. M2M tokens cannot call this — use `POST /:appSlug/v1/oauth/introspect` to inspect M2M scopes.
|
|
33207
33739
|
*
|
|
33740
|
+
* Credential: `end_user_token`.
|
|
33741
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
33742
|
+
*
|
|
33208
33743
|
* @param options - Per-request options.
|
|
33209
33744
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token, unknown or inactive app, or the account/session is no longer active.
|
|
33210
33745
|
* @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.
|
|
@@ -33212,7 +33747,7 @@ declare class ConsumerMeResource extends APIResource {
|
|
|
33212
33747
|
* @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-me-permissions
|
|
33213
33748
|
* @example
|
|
33214
33749
|
* ```ts
|
|
33215
|
-
* const mePermissions = await auth.consumer("app").me.permissions();
|
|
33750
|
+
* const mePermissions = await auth.consumer("my-app").me.permissions();
|
|
33216
33751
|
* ```
|
|
33217
33752
|
*/
|
|
33218
33753
|
permissions(options?: RequestOptions): APIPromise<WithLastResponse<MePermissions>>;
|
|
@@ -33221,6 +33756,9 @@ declare class ConsumerMeResource extends APIResource {
|
|
|
33221
33756
|
*
|
|
33222
33757
|
* Returns the EndUser identity, app membership, and role name. The flat `permissions[]` array is intentionally NOT included — permissions resolve from the role on demand. Call `GET /me/permissions` for the flat list when the client needs it for UI gating.
|
|
33223
33758
|
*
|
|
33759
|
+
* Credential: `end_user_token`.
|
|
33760
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
33761
|
+
*
|
|
33224
33762
|
* @param options - Per-request options.
|
|
33225
33763
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
33226
33764
|
* @throws {NotFoundError} 404 NOT_FOUND: Account not found.
|
|
@@ -33229,7 +33767,7 @@ declare class ConsumerMeResource extends APIResource {
|
|
|
33229
33767
|
* @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-me
|
|
33230
33768
|
* @example
|
|
33231
33769
|
* ```ts
|
|
33232
|
-
* const meProfile = await auth.consumer("app").me.retrieve();
|
|
33770
|
+
* const meProfile = await auth.consumer("my-app").me.retrieve();
|
|
33233
33771
|
* ```
|
|
33234
33772
|
*/
|
|
33235
33773
|
retrieve(options?: RequestOptions): APIPromise<WithLastResponse<MeProfile>>;
|
|
@@ -33238,6 +33776,9 @@ declare class ConsumerMeResource extends APIResource {
|
|
|
33238
33776
|
*
|
|
33239
33777
|
* Editable fields: `display_name` and `username`. The username is unique per app (case-insensitive, same rule as signup); sending the current username is a no-op. Usernames cannot be cleared.
|
|
33240
33778
|
*
|
|
33779
|
+
* Credential: `end_user_token`.
|
|
33780
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
33781
|
+
*
|
|
33241
33782
|
* @param params - `Auth.MeUpdateParams`.
|
|
33242
33783
|
* @param options - Per-request options.
|
|
33243
33784
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
@@ -33247,7 +33788,7 @@ declare class ConsumerMeResource extends APIResource {
|
|
|
33247
33788
|
* @see https://productcraft.co/docs/auth/api-reference#patch-app-slug-v1-me
|
|
33248
33789
|
* @example
|
|
33249
33790
|
* ```ts
|
|
33250
|
-
* const meUpdatedAccount = await auth.consumer("app").me.update({ display_name: "Ada Lovelace" });
|
|
33791
|
+
* const meUpdatedAccount = await auth.consumer("my-app").me.update({ display_name: "Ada Lovelace" });
|
|
33251
33792
|
* ```
|
|
33252
33793
|
*/
|
|
33253
33794
|
update(params?: MeUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<MeUpdatedAccount>>;
|
|
@@ -33256,6 +33797,9 @@ declare class ConsumerMeResource extends APIResource {
|
|
|
33256
33797
|
*
|
|
33257
33798
|
* PNG/JPEG/WEBP only — SVG is rejected (stored-XSS vector). ≤2 MB. Magic bytes are sniffed; a mislabeled file is rejected. The image is re-encoded server-side (orientation baked in, all metadata incl. EXIF/GPS stripped, bounded to 512×512, webp). An uploaded avatar takes precedence over a provider-captured picture.
|
|
33258
33799
|
*
|
|
33800
|
+
* Credential: `end_user_token`.
|
|
33801
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
33802
|
+
*
|
|
33259
33803
|
* @param params - `Auth.MeUploadAvatarParams`.
|
|
33260
33804
|
* @param options - Per-request options.
|
|
33261
33805
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
@@ -33266,7 +33810,7 @@ declare class ConsumerMeResource extends APIResource {
|
|
|
33266
33810
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-me-avatar
|
|
33267
33811
|
* @example
|
|
33268
33812
|
* ```ts
|
|
33269
|
-
* const avatarUrl = await auth.consumer("app").me.uploadAvatar({ file: new File(["…"], "image.png", { type: "image/png" }) });
|
|
33813
|
+
* const avatarUrl = await auth.consumer("my-app").me.uploadAvatar({ file: new File(["…"], "image.png", { type: "image/png" }) });
|
|
33270
33814
|
* ```
|
|
33271
33815
|
*/
|
|
33272
33816
|
uploadAvatar(params: MeUploadAvatarParams, options?: RequestOptions): APIPromise<WithLastResponse<AvatarUrl>>;
|
|
@@ -33321,7 +33865,7 @@ declare class ConsumerMfaWebauthnResource extends APIResource {
|
|
|
33321
33865
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-mfa-webauthn-options
|
|
33322
33866
|
* @example
|
|
33323
33867
|
* ```ts
|
|
33324
|
-
* const consumerWebauthnOptions = await auth.consumer("app").mfa.webauthn.options({ mfa_token: "
|
|
33868
|
+
* const consumerWebauthnOptions = await auth.consumer("my-app").mfa.webauthn.options({ mfa_token: "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f" });
|
|
33325
33869
|
* ```
|
|
33326
33870
|
*/
|
|
33327
33871
|
options(params: MfaWebauthnOptionsParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerWebauthnOptions>>;
|
|
@@ -33348,7 +33892,7 @@ declare class ConsumerMfaResource extends APIResource {
|
|
|
33348
33892
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-mfa-enroll
|
|
33349
33893
|
* @example
|
|
33350
33894
|
* ```ts
|
|
33351
|
-
* const startEnrollment = await auth.consumer("app").mfa.enroll({ mfa_token: "
|
|
33895
|
+
* const startEnrollment = await auth.consumer("my-app").mfa.enroll({ mfa_token: "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", type: "totp" });
|
|
33352
33896
|
* ```
|
|
33353
33897
|
*/
|
|
33354
33898
|
enroll(params: MfaEnrollParams, options?: RequestOptions): APIPromise<WithLastResponse<StartEnrollment>>;
|
|
@@ -33370,7 +33914,10 @@ declare class ConsumerMfaResource extends APIResource {
|
|
|
33370
33914
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-mfa-recover
|
|
33371
33915
|
* @example
|
|
33372
33916
|
* ```ts
|
|
33373
|
-
* const consumerToken = await auth.consumer("app").mfa.recover({
|
|
33917
|
+
* const consumerToken = await auth.consumer("my-app").mfa.recover({
|
|
33918
|
+
* mfa_token: "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f",
|
|
33919
|
+
* recovery_code: "1a2b-3c4d-5e6f-7890",
|
|
33920
|
+
* });
|
|
33374
33921
|
* ```
|
|
33375
33922
|
*/
|
|
33376
33923
|
recover(params: MfaRecoverParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerToken>>;
|
|
@@ -33393,7 +33940,10 @@ declare class ConsumerMfaResource extends APIResource {
|
|
|
33393
33940
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-mfa-send-code
|
|
33394
33941
|
* @example
|
|
33395
33942
|
* ```ts
|
|
33396
|
-
* const consumerMfaSendCode = await auth.consumer("app").mfa.sendCode({
|
|
33943
|
+
* const consumerMfaSendCode = await auth.consumer("my-app").mfa.sendCode({
|
|
33944
|
+
* factor_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
33945
|
+
* mfa_token: "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f",
|
|
33946
|
+
* });
|
|
33397
33947
|
* ```
|
|
33398
33948
|
*/
|
|
33399
33949
|
sendCode(params: MfaSendCodeParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerMfaSendCode>>;
|
|
@@ -33414,7 +33964,7 @@ declare class ConsumerMfaResource extends APIResource {
|
|
|
33414
33964
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-mfa-verify
|
|
33415
33965
|
* @example
|
|
33416
33966
|
* ```ts
|
|
33417
|
-
* const consumerToken = await auth.consumer("app").mfa.verify({ mfa_token: "
|
|
33967
|
+
* const consumerToken = await auth.consumer("my-app").mfa.verify({ mfa_token: "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f" });
|
|
33418
33968
|
* ```
|
|
33419
33969
|
*/
|
|
33420
33970
|
verify(params: MfaVerifyParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerToken>>;
|
|
@@ -33435,7 +33985,10 @@ declare class ConsumerMfaResource extends APIResource {
|
|
|
33435
33985
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-mfa-enroll-verify
|
|
33436
33986
|
* @example
|
|
33437
33987
|
* ```ts
|
|
33438
|
-
* const consumerMfaEnrollVerify = await auth.consumer("app").mfa.verifyEnrollment({
|
|
33988
|
+
* const consumerMfaEnrollVerify = await auth.consumer("my-app").mfa.verifyEnrollment({
|
|
33989
|
+
* factor_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
|
|
33990
|
+
* mfa_token: "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f",
|
|
33991
|
+
* });
|
|
33439
33992
|
* ```
|
|
33440
33993
|
*/
|
|
33441
33994
|
verifyEnrollment(params: MfaVerifyEnrollmentParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerMfaEnrollVerify>>;
|
|
@@ -33447,6 +34000,10 @@ declare class ConsumerOauthResource extends APIResource {
|
|
|
33447
34000
|
*
|
|
33448
34001
|
* OAuth 2.0 token introspection. Send the access token via `Authorization: Bearer <token>` and receive either `{ active: false }` (invalid / expired / wrong app, or a session that is revoked, past its `expires_at`, or gone because the end user was deleted) or the active claim set including `scopes` (M2M) or `role` (EndUser), `exp`, `iat`, `iss`, `aid`. The body `token` field is optional and, if present, must match the bearer — RFC 7662 allows a separate `token` body field but we deliberately refuse cross-token introspection so a stolen token can't be probed against another active credential. The endpoint accepts both M2M and EndUser tokens — use it as the canonical way for a service to know what its own token can do, instead of decoding the JWT by hand. Returns 401 when the bearer is missing.
|
|
33449
34002
|
*
|
|
34003
|
+
* Credential: one of `m2m_token`, `end_user_token`.
|
|
34004
|
+
* - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
|
|
34005
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
34006
|
+
*
|
|
33450
34007
|
* @param params - `Auth.OauthIntrospectParams`.
|
|
33451
34008
|
* @param options - Per-request options.
|
|
33452
34009
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Request validation failed in the global `ValidationPipe`.
|
|
@@ -33459,7 +34016,7 @@ declare class ConsumerOauthResource extends APIResource {
|
|
|
33459
34016
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-oauth-introspect
|
|
33460
34017
|
* @example
|
|
33461
34018
|
* ```ts
|
|
33462
|
-
* const introspect = await auth.consumer("app").oauth.introspect({ token: "
|
|
34019
|
+
* const introspect = await auth.consumer("my-app").oauth.introspect({ token: "eyJhbGciOiJSUzI1NiIsImtpZCI6ImsxIn0.eyJzdWIiOiJ1c3JfMSJ9.c2lnbmF0dXJl" });
|
|
33463
34020
|
* ```
|
|
33464
34021
|
*/
|
|
33465
34022
|
introspect(params?: OauthIntrospectParams, options?: RequestOptions): APIPromise<WithLastResponse<Introspect>>;
|
|
@@ -33480,9 +34037,9 @@ declare class ConsumerOauthResource extends APIResource {
|
|
|
33480
34037
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-oauth-token
|
|
33481
34038
|
* @example
|
|
33482
34039
|
* ```ts
|
|
33483
|
-
* const oAuthToken = await auth.consumer("app").oauth.token({
|
|
34040
|
+
* const oAuthToken = await auth.consumer("my-app").oauth.token({
|
|
33484
34041
|
* client_id: "m2m_a1b2c3d4e5f6...",
|
|
33485
|
-
* client_secret: "
|
|
34042
|
+
* client_secret: "the-secret-returned-by-credentials-create",
|
|
33486
34043
|
* grant_type: "client_credentials",
|
|
33487
34044
|
* });
|
|
33488
34045
|
* ```
|
|
@@ -33514,7 +34071,7 @@ declare class ConsumerPasskeyResource extends APIResource {
|
|
|
33514
34071
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-passkey-options
|
|
33515
34072
|
* @example
|
|
33516
34073
|
* ```ts
|
|
33517
|
-
* const consumerWebauthnOptions = await auth.consumer("app").passkey.options({ tenant_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b" });
|
|
34074
|
+
* const consumerWebauthnOptions = await auth.consumer("my-app").passkey.options({ tenant_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b" });
|
|
33518
34075
|
* ```
|
|
33519
34076
|
*/
|
|
33520
34077
|
options(params?: PasskeyOptionsParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerWebauthnOptions>>;
|
|
@@ -33535,7 +34092,7 @@ declare class ConsumerPasskeyResource extends APIResource {
|
|
|
33535
34092
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-passkey-verify
|
|
33536
34093
|
* @example
|
|
33537
34094
|
* ```ts
|
|
33538
|
-
* const consumerToken = await auth.consumer("app").passkey.verify({ credential: {} });
|
|
34095
|
+
* const consumerToken = await auth.consumer("my-app").passkey.verify({ credential: {} });
|
|
33539
34096
|
* ```
|
|
33540
34097
|
*/
|
|
33541
34098
|
verify(params: PasskeyVerifyParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerToken>>;
|
|
@@ -33547,6 +34104,11 @@ declare class ConsumerPermissionsResource extends APIResource {
|
|
|
33547
34104
|
*
|
|
33548
34105
|
* Inserts a `<resource>.<action>` row in the per-app permission catalogue. The resource and action segments must each match `^[a-z][a-z0-9_-]{1,47}$`. Conflicts with a system permission name return 409. Customers usually then bind the new permission to a role via `PUT /admin/roles/:roleName/permissions`.
|
|
33549
34106
|
*
|
|
34107
|
+
* Credential: one of `app_api_key`, `m2m_token`, `end_user_token`.
|
|
34108
|
+
* - `app_api_key`: An app API key (`hdk_live_…` or `hdk_test_…`) minted for this app (`POST /v1/apps/{app_id}/api-keys`). Its permissions are always enforced. A workspace key is refused.
|
|
34109
|
+
* - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
|
|
34110
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
34111
|
+
*
|
|
33550
34112
|
* @param params - `Auth.ConsumerScopedPermissionCreateParams`.
|
|
33551
34113
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
33552
34114
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
@@ -33556,7 +34118,7 @@ declare class ConsumerPermissionsResource extends APIResource {
|
|
|
33556
34118
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-admin-permissions
|
|
33557
34119
|
* @example
|
|
33558
34120
|
* ```ts
|
|
33559
|
-
* const consumerAdminPermission = await auth.consumer("app").permissions.create({ action: "read", resource: "project" });
|
|
34121
|
+
* const consumerAdminPermission = await auth.consumer("my-app").permissions.create({ action: "read", resource: "project" });
|
|
33560
34122
|
* ```
|
|
33561
34123
|
*/
|
|
33562
34124
|
create(params: ConsumerScopedPermissionCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerAdminPermission>>;
|
|
@@ -33565,6 +34127,11 @@ declare class ConsumerPermissionsResource extends APIResource {
|
|
|
33565
34127
|
*
|
|
33566
34128
|
* The `permissionKey` path parameter is the literal `<resource>.<action>` string. System permissions cannot be deleted — attempts return 403. Removing a permission also removes every `role_permission` row that bound it (cascade); role lookups dropped of that perm on the next request.
|
|
33567
34129
|
*
|
|
34130
|
+
* Credential: one of `app_api_key`, `m2m_token`, `end_user_token`.
|
|
34131
|
+
* - `app_api_key`: An app API key (`hdk_live_…` or `hdk_test_…`) minted for this app (`POST /v1/apps/{app_id}/api-keys`). Its permissions are always enforced. A workspace key is refused.
|
|
34132
|
+
* - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
|
|
34133
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
34134
|
+
*
|
|
33568
34135
|
* @param permissionKey - Permission key, `resource.action` (e.g. `invoice.read`).
|
|
33569
34136
|
* @param options - Per-request options.
|
|
33570
34137
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: permissionKey must be in `resource.action` format.
|
|
@@ -33576,7 +34143,7 @@ declare class ConsumerPermissionsResource extends APIResource {
|
|
|
33576
34143
|
* @see https://productcraft.co/docs/auth/api-reference#delete-app-slug-v1-admin-permissions-permission-key
|
|
33577
34144
|
* @example
|
|
33578
34145
|
* ```ts
|
|
33579
|
-
* await auth.consumer("app").permissions.delete("
|
|
34146
|
+
* await auth.consumer("my-app").permissions.delete("invoice.read");
|
|
33580
34147
|
* ```
|
|
33581
34148
|
*/
|
|
33582
34149
|
delete(permissionKey: string, options?: RequestOptions): APIPromise<void>;
|
|
@@ -33585,6 +34152,11 @@ declare class ConsumerPermissionsResource extends APIResource {
|
|
|
33585
34152
|
*
|
|
33586
34153
|
* Returns the union of system permissions (shared across every app — `is_system: true` in the response) and any custom entries this app has defined (`is_system: false`). Useful for driving a role-editor UI that picks from the full catalogue.
|
|
33587
34154
|
*
|
|
34155
|
+
* Credential: one of `app_api_key`, `m2m_token`, `end_user_token`.
|
|
34156
|
+
* - `app_api_key`: An app API key (`hdk_live_…` or `hdk_test_…`) minted for this app (`POST /v1/apps/{app_id}/api-keys`). Its permissions are always enforced. A workspace key is refused.
|
|
34157
|
+
* - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
|
|
34158
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
34159
|
+
*
|
|
33588
34160
|
* @param options - Per-request options.
|
|
33589
34161
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired Consumer-API bearer: an EndUser or M2M token, or an app API key (`hdk_live_*` / `hdk_test_*`); or the account, session, M2M client or key is no longer active, or the key belongs to another app.
|
|
33590
34162
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, APP_SUSPENDED, APP_ARCHIVED: The app is suspended or archived (`APP_SUSPENDED` / `APP_ARCHIVED`), or the caller lacks `permission.read`: an app API key always needs it in its permissions; a role or M2M scopes need it once the app enforces permissions.
|
|
@@ -33594,7 +34166,7 @@ declare class ConsumerPermissionsResource extends APIResource {
|
|
|
33594
34166
|
* @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-admin-permissions
|
|
33595
34167
|
* @example
|
|
33596
34168
|
* ```ts
|
|
33597
|
-
* const result = await auth.consumer("app").permissions.list();
|
|
34169
|
+
* const result = await auth.consumer("my-app").permissions.list();
|
|
33598
34170
|
* ```
|
|
33599
34171
|
*/
|
|
33600
34172
|
list(options?: RequestOptions): APIPromise<WithLastResponse<ConsumerScopedPermissionListResponse>>;
|
|
@@ -33606,6 +34178,11 @@ declare class ConsumerRolesResource extends APIResource {
|
|
|
33606
34178
|
*
|
|
33607
34179
|
* Creates a role with no permissions bound yet. Use `PUT /:roleName/permissions` to attach a permission set after creation — that route also runs caller-narrowing so an EndUser admin can't grant verbs they don't themselves hold.
|
|
33608
34180
|
*
|
|
34181
|
+
* Credential: one of `app_api_key`, `m2m_token`, `end_user_token`.
|
|
34182
|
+
* - `app_api_key`: An app API key (`hdk_live_…` or `hdk_test_…`) minted for this app (`POST /v1/apps/{app_id}/api-keys`). Its permissions are always enforced. A workspace key is refused.
|
|
34183
|
+
* - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
|
|
34184
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
34185
|
+
*
|
|
33609
34186
|
* @param params - `Auth.ConsumerScopedRoleCreateParams`.
|
|
33610
34187
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
33611
34188
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
@@ -33615,7 +34192,7 @@ declare class ConsumerRolesResource extends APIResource {
|
|
|
33615
34192
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-admin-roles
|
|
33616
34193
|
* @example
|
|
33617
34194
|
* ```ts
|
|
33618
|
-
* const consumerRole = await auth.consumer("app").roles.create({ name: "editor" });
|
|
34195
|
+
* const consumerRole = await auth.consumer("my-app").roles.create({ name: "editor" });
|
|
33619
34196
|
* ```
|
|
33620
34197
|
*/
|
|
33621
34198
|
create(params: ConsumerScopedRoleCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerRole>>;
|
|
@@ -33624,6 +34201,11 @@ declare class ConsumerRolesResource extends APIResource {
|
|
|
33624
34201
|
*
|
|
33625
34202
|
* System roles (`owner`, `admin`, `member`) cannot be deleted — attempts return 403. Roles currently assigned to any member return 409 `ROLE_IN_USE`; reassign the affected members first.
|
|
33626
34203
|
*
|
|
34204
|
+
* Credential: one of `app_api_key`, `m2m_token`, `end_user_token`.
|
|
34205
|
+
* - `app_api_key`: An app API key (`hdk_live_…` or `hdk_test_…`) minted for this app (`POST /v1/apps/{app_id}/api-keys`). Its permissions are always enforced. A workspace key is refused.
|
|
34206
|
+
* - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
|
|
34207
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
34208
|
+
*
|
|
33627
34209
|
* @param roleName - Name of the role (e.g. `admin`).
|
|
33628
34210
|
* @param options - Per-request options.
|
|
33629
34211
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
@@ -33634,7 +34216,7 @@ declare class ConsumerRolesResource extends APIResource {
|
|
|
33634
34216
|
* @see https://productcraft.co/docs/auth/api-reference#delete-app-slug-v1-admin-roles-role-name
|
|
33635
34217
|
* @example
|
|
33636
34218
|
* ```ts
|
|
33637
|
-
* await auth.consumer("app").roles.delete("
|
|
34219
|
+
* await auth.consumer("my-app").roles.delete("admin");
|
|
33638
34220
|
* ```
|
|
33639
34221
|
*/
|
|
33640
34222
|
delete(roleName: string, options?: RequestOptions): APIPromise<void>;
|
|
@@ -33643,6 +34225,11 @@ declare class ConsumerRolesResource extends APIResource {
|
|
|
33643
34225
|
*
|
|
33644
34226
|
* Cursor-paginated by `created_at`. Use the returned `next_cursor` in subsequent calls — offset pagination is not exposed.
|
|
33645
34227
|
*
|
|
34228
|
+
* Credential: one of `app_api_key`, `m2m_token`, `end_user_token`.
|
|
34229
|
+
* - `app_api_key`: An app API key (`hdk_live_…` or `hdk_test_…`) minted for this app (`POST /v1/apps/{app_id}/api-keys`). Its permissions are always enforced. A workspace key is refused.
|
|
34230
|
+
* - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
|
|
34231
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
34232
|
+
*
|
|
33646
34233
|
* @param params - `Auth.ConsumerScopedRoleListParams`.
|
|
33647
34234
|
* @param options - Per-request options.
|
|
33648
34235
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`.
|
|
@@ -33654,10 +34241,10 @@ declare class ConsumerRolesResource extends APIResource {
|
|
|
33654
34241
|
* @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-admin-roles
|
|
33655
34242
|
* @example
|
|
33656
34243
|
* ```ts
|
|
33657
|
-
* for await (const role of auth.consumer("app").roles.list()) {
|
|
34244
|
+
* for await (const role of auth.consumer("my-app").roles.list()) {
|
|
33658
34245
|
* console.log(role);
|
|
33659
34246
|
* }
|
|
33660
|
-
* const page = await auth.consumer("app").roles.list({}, { timeout: 5_000 });
|
|
34247
|
+
* const page = await auth.consumer("my-app").roles.list({}, { timeout: 5_000 });
|
|
33661
34248
|
* ```
|
|
33662
34249
|
*/
|
|
33663
34250
|
list(params?: ConsumerScopedRoleListParams, options?: RequestOptions): PagePromise<ConsumerRole>;
|
|
@@ -33666,6 +34253,11 @@ declare class ConsumerRolesResource extends APIResource {
|
|
|
33666
34253
|
*
|
|
33667
34254
|
* Returns the role plus the flat `permissions[]` array currently bound. Use this to drive a "configure role" UI in the customer product without having to call `/permissions` separately.
|
|
33668
34255
|
*
|
|
34256
|
+
* Credential: one of `app_api_key`, `m2m_token`, `end_user_token`.
|
|
34257
|
+
* - `app_api_key`: An app API key (`hdk_live_…` or `hdk_test_…`) minted for this app (`POST /v1/apps/{app_id}/api-keys`). Its permissions are always enforced. A workspace key is refused.
|
|
34258
|
+
* - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
|
|
34259
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
34260
|
+
*
|
|
33669
34261
|
* @param roleName - Name of the role (e.g. `admin`).
|
|
33670
34262
|
* @param options - Per-request options.
|
|
33671
34263
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
@@ -33675,7 +34267,7 @@ declare class ConsumerRolesResource extends APIResource {
|
|
|
33675
34267
|
* @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-admin-roles-role-name
|
|
33676
34268
|
* @example
|
|
33677
34269
|
* ```ts
|
|
33678
|
-
* const consumerRoleWithPermissions = await auth.consumer("app").roles.retrieve("
|
|
34270
|
+
* const consumerRoleWithPermissions = await auth.consumer("my-app").roles.retrieve("admin");
|
|
33679
34271
|
* ```
|
|
33680
34272
|
*/
|
|
33681
34273
|
retrieve(roleName: string, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerRoleWithPermissions>>;
|
|
@@ -33684,6 +34276,11 @@ declare class ConsumerRolesResource extends APIResource {
|
|
|
33684
34276
|
*
|
|
33685
34277
|
* Renames are intentionally NOT supported — the role name is part of every issued EndUser JWT, so changing it would silently break live sessions. Create a new role and migrate users instead.
|
|
33686
34278
|
*
|
|
34279
|
+
* Credential: one of `app_api_key`, `m2m_token`, `end_user_token`.
|
|
34280
|
+
* - `app_api_key`: An app API key (`hdk_live_…` or `hdk_test_…`) minted for this app (`POST /v1/apps/{app_id}/api-keys`). Its permissions are always enforced. A workspace key is refused.
|
|
34281
|
+
* - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
|
|
34282
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
34283
|
+
*
|
|
33687
34284
|
* @param roleName - Name of the role (e.g. `admin`).
|
|
33688
34285
|
* @param params - `Auth.ConsumerScopedRoleUpdateParams`.
|
|
33689
34286
|
* @param options - Per-request options.
|
|
@@ -33694,7 +34291,7 @@ declare class ConsumerRolesResource extends APIResource {
|
|
|
33694
34291
|
* @see https://productcraft.co/docs/auth/api-reference#patch-app-slug-v1-admin-roles-role-name
|
|
33695
34292
|
* @example
|
|
33696
34293
|
* ```ts
|
|
33697
|
-
* const consumerRole = await auth.consumer("app").roles.update("
|
|
34294
|
+
* const consumerRole = await auth.consumer("my-app").roles.update("admin", { description: "Updated description" });
|
|
33698
34295
|
* ```
|
|
33699
34296
|
*/
|
|
33700
34297
|
update(roleName: string, params?: ConsumerScopedRoleUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerRole>>;
|
|
@@ -33703,6 +34300,11 @@ declare class ConsumerRolesResource extends APIResource {
|
|
|
33703
34300
|
*
|
|
33704
34301
|
* Destructive — the role's permission set is replaced wholesale with the supplied array. Caller-narrowed: the caller must hold every permission in the request, otherwise 403 `Cannot grant actions you don't have: ...`. For EndUser callers the caller-held set is their app-membership role's effective permissions. For M2M callers the held set is the token's `scopes[]` claim — the M2M cannot grant a role any verb that wasn't configured on the M2M credential. Unknown permission strings return 400.
|
|
33705
34302
|
*
|
|
34303
|
+
* Credential: one of `app_api_key`, `m2m_token`, `end_user_token`.
|
|
34304
|
+
* - `app_api_key`: An app API key (`hdk_live_…` or `hdk_test_…`) minted for this app (`POST /v1/apps/{app_id}/api-keys`). Its permissions are always enforced. A workspace key is refused.
|
|
34305
|
+
* - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
|
|
34306
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
34307
|
+
*
|
|
33706
34308
|
* @param roleName - Name of the role (e.g. `admin`).
|
|
33707
34309
|
* @param params - `Auth.ConsumerScopedRoleUpdatePermissionsParams`.
|
|
33708
34310
|
* @param options - Per-request options.
|
|
@@ -33715,7 +34317,7 @@ declare class ConsumerRolesResource extends APIResource {
|
|
|
33715
34317
|
* @see https://productcraft.co/docs/auth/api-reference#put-app-slug-v1-admin-roles-role-name-permissions
|
|
33716
34318
|
* @example
|
|
33717
34319
|
* ```ts
|
|
33718
|
-
* const result = await auth.consumer("app").roles.updatePermissions("
|
|
34320
|
+
* const result = await auth.consumer("my-app").roles.updatePermissions("admin", { permissions: ["user.read", "role.create"] });
|
|
33719
34321
|
* ```
|
|
33720
34322
|
*/
|
|
33721
34323
|
updatePermissions(roleName: string, params: ConsumerScopedRoleUpdatePermissionsParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerScopedRoleUpdatePermissionsResponse>>;
|
|
@@ -33727,6 +34329,9 @@ declare class ConsumerTenantApiKeysConfigResource extends APIResource {
|
|
|
33727
34329
|
*
|
|
33728
34330
|
* Requires `auth.tenant.api_keys.configure` on the app.
|
|
33729
34331
|
*
|
|
34332
|
+
* Credential: `workspace_key`.
|
|
34333
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
34334
|
+
*
|
|
33730
34335
|
* @param options - Per-request options.
|
|
33731
34336
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, malformed or revoked Platform API Key (`Authorization: Bearer pcft_live_…`).
|
|
33732
34337
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, PAK_WORKSPACE_MISMATCH: `PAK_WORKSPACE_MISMATCH` (the PAK belongs to another workspace than the app), or the PAK's policy does not allow `auth.tenant.api_keys.configure` on `pcft:heimdall:app/<appId>`.
|
|
@@ -33737,7 +34342,7 @@ declare class ConsumerTenantApiKeysConfigResource extends APIResource {
|
|
|
33737
34342
|
* @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-tenant-api-keys-config
|
|
33738
34343
|
* @example
|
|
33739
34344
|
* ```ts
|
|
33740
|
-
* const tenantApiKeysConfig = await auth.consumer("app").tenantApiKeys.config.retrieve();
|
|
34345
|
+
* const tenantApiKeysConfig = await auth.consumer("my-app").tenantApiKeys.config.retrieve();
|
|
33741
34346
|
* ```
|
|
33742
34347
|
*/
|
|
33743
34348
|
retrieve(options?: RequestOptions): APIPromise<WithLastResponse<TenantApiKeysConfig>>;
|
|
@@ -33746,6 +34351,9 @@ declare class ConsumerTenantApiKeysConfigResource extends APIResource {
|
|
|
33746
34351
|
*
|
|
33747
34352
|
* Call it on boot: your code is the source of truth for the scopes a key can carry. Fields you leave out keep their stored value. `suspended` is the platform's kill switch: this route never changes it, and a body that carries it is refused. Requires `auth.tenant.api_keys.configure` on the app.
|
|
33748
34353
|
*
|
|
34354
|
+
* Credential: `workspace_key`.
|
|
34355
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
34356
|
+
*
|
|
33749
34357
|
* @param params - `Auth.ConsumerScopedTenantApiKeyConfigUpdateParams`.
|
|
33750
34358
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
33751
34359
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, TENANT_API_KEYS_SCOPE_INVALID, TENANT_API_KEYS_UNKNOWN_ROLE, TENANT_API_KEY_EXPIRY_INVALID, TENANT_API_KEYS_NO_SCOPES, TENANT_API_KEYS_SUSPENDED_NOT_WRITABLE: `VALIDATION_ERROR`, `TENANT_API_KEYS_SCOPE_INVALID` (`details.scopes`), `TENANT_API_KEYS_UNKNOWN_ROLE` (`details.roles`: `manage_roles` names a role this app does not have), `TENANT_API_KEY_EXPIRY_INVALID`, `TENANT_API_KEYS_NO_SCOPES` (enabling with no scope), `TENANT_API_KEYS_SUSPENDED_NOT_WRITABLE` (the body carries `suspended`), or a malformed `Idempotency-Key`.
|
|
@@ -33758,7 +34366,7 @@ declare class ConsumerTenantApiKeysConfigResource extends APIResource {
|
|
|
33758
34366
|
* @see https://productcraft.co/docs/auth/api-reference#put-app-slug-v1-tenant-api-keys-config
|
|
33759
34367
|
* @example
|
|
33760
34368
|
* ```ts
|
|
33761
|
-
* const tenantApiKeysConfig = await auth.consumer("app").tenantApiKeys.config.update({ default_expiry_days: 7 });
|
|
34369
|
+
* const tenantApiKeysConfig = await auth.consumer("my-app").tenantApiKeys.config.update({ default_expiry_days: 7 });
|
|
33762
34370
|
* ```
|
|
33763
34371
|
*/
|
|
33764
34372
|
update(params?: ConsumerScopedTenantApiKeyConfigUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<TenantApiKeysConfig>>;
|
|
@@ -33772,6 +34380,9 @@ declare class ConsumerTenantApiKeysResource extends APIResource {
|
|
|
33772
34380
|
*
|
|
33773
34381
|
* Returns the secret ONCE (`key`). Scopes must be grantable by the app and held by your own tenant role. At most 25 active keys per tenant. If the app requires recent MFA, verify a factor first (403 `step_up_required`). Responses carry `Cache-Control: no-store`.
|
|
33774
34382
|
*
|
|
34383
|
+
* Credential: `end_user_token`.
|
|
34384
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
34385
|
+
*
|
|
33775
34386
|
* @param params - `Auth.TenantApiKeyCreateParams`.
|
|
33776
34387
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
33777
34388
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, TENANT_API_KEY_SCOPE_NOT_GRANTABLE, TENANT_API_KEY_EXPIRY_INVALID: `VALIDATION_ERROR`, `TENANT_API_KEY_SCOPE_NOT_GRANTABLE` (`details.scopes`), `TENANT_API_KEY_EXPIRY_INVALID` (`details.allowed`), or a malformed `Idempotency-Key`.
|
|
@@ -33784,7 +34395,7 @@ declare class ConsumerTenantApiKeysResource extends APIResource {
|
|
|
33784
34395
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-tenant-api-keys
|
|
33785
34396
|
* @example
|
|
33786
34397
|
* ```ts
|
|
33787
|
-
* const tenantApiKeyWithSecret = await auth.consumer("app").tenantApiKeys.create({ name: "CI e2e", scopes: ["disputes.read", "audit.read"] });
|
|
34398
|
+
* const tenantApiKeyWithSecret = await auth.consumer("my-app").tenantApiKeys.create({ name: "CI e2e", scopes: ["disputes.read", "audit.read"] });
|
|
33788
34399
|
* ```
|
|
33789
34400
|
*/
|
|
33790
34401
|
create(params: TenantApiKeyCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<TenantApiKeyWithSecret>>;
|
|
@@ -33793,6 +34404,9 @@ declare class ConsumerTenantApiKeysResource extends APIResource {
|
|
|
33793
34404
|
*
|
|
33794
34405
|
* Immediate and final. Idempotent: revoking a revoked key is a 204 that changes nothing.
|
|
33795
34406
|
*
|
|
34407
|
+
* Credential: `end_user_token`.
|
|
34408
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
34409
|
+
*
|
|
33796
34410
|
* @param keyId - Key id (UUID) or display id (`tak_…`).
|
|
33797
34411
|
* @param options - Per-request options.
|
|
33798
34412
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid end-user bearer token (M2M tokens, PAKs and API keys are refused).
|
|
@@ -33803,7 +34417,7 @@ declare class ConsumerTenantApiKeysResource extends APIResource {
|
|
|
33803
34417
|
* @see https://productcraft.co/docs/auth/api-reference#delete-app-slug-v1-tenant-api-keys-key-id
|
|
33804
34418
|
* @example
|
|
33805
34419
|
* ```ts
|
|
33806
|
-
* await auth.consumer("app").tenantApiKeys.delete("
|
|
34420
|
+
* await auth.consumer("my-app").tenantApiKeys.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
33807
34421
|
* ```
|
|
33808
34422
|
*/
|
|
33809
34423
|
delete(keyId: string, options?: RequestOptions): APIPromise<void>;
|
|
@@ -33812,6 +34426,9 @@ declare class ConsumerTenantApiKeysResource extends APIResource {
|
|
|
33812
34426
|
*
|
|
33813
34427
|
* For your backend: is this `pctk_` key, presented to YOUR API, usable right now, for which tenant and with which scopes? A key of another app is `{"active": false}`. Cache answers by the key's SHA-256: positives up to 30 s (never past `expires_at`), negatives up to 60 s. Intersect `scopes` with the permissions of `created_by.tenant_role` in your app. Requires `auth.tenant.api_keys.introspect` on the app. Not audited per call; `last_used_at` records use (5-minute granularity). This route has its own per-app rate bucket (1200 calls a minute by default), separate from your PAK's other calls; over it the answer is 429 with `Retry-After`, never a false `active: false`, so keep serving keys you hold a fresh positive for.
|
|
33814
34428
|
*
|
|
34429
|
+
* Credential: `workspace_key`.
|
|
34430
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
34431
|
+
*
|
|
33815
34432
|
* @param params - `Auth.TenantApiKeyIntrospectParams`.
|
|
33816
34433
|
* @param options - Per-request options.
|
|
33817
34434
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `key` missing or not a string.
|
|
@@ -33824,7 +34441,7 @@ declare class ConsumerTenantApiKeysResource extends APIResource {
|
|
|
33824
34441
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-tenant-api-keys-introspect
|
|
33825
34442
|
* @example
|
|
33826
34443
|
* ```ts
|
|
33827
|
-
* const tenantApiKeyIntrospection = await auth.consumer("app").tenantApiKeys.introspect({ key: "pctk_live_4fQ2aZ0000000000000000000000000000000000000_1a2B3c" });
|
|
34444
|
+
* const tenantApiKeyIntrospection = await auth.consumer("my-app").tenantApiKeys.introspect({ key: "pctk_live_4fQ2aZ0000000000000000000000000000000000000_1a2B3c" });
|
|
33828
34445
|
* ```
|
|
33829
34446
|
*/
|
|
33830
34447
|
introspect(params: TenantApiKeyIntrospectParams, options?: RequestOptions): APIPromise<WithLastResponse<TenantApiKeyIntrospection>>;
|
|
@@ -33833,6 +34450,9 @@ declare class ConsumerTenantApiKeysResource extends APIResource {
|
|
|
33833
34450
|
*
|
|
33834
34451
|
* Newest first, cursor-paginated (20 per page, max 100). Secrets are never returned; `key_prefix` and `last4` identify a key.
|
|
33835
34452
|
*
|
|
34453
|
+
* Credential: `end_user_token`.
|
|
34454
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
34455
|
+
*
|
|
33836
34456
|
* @param params - `Auth.ConsumerScopedTenantApiKeyListParams`.
|
|
33837
34457
|
* @param options - Per-request options.
|
|
33838
34458
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Unknown `status` or malformed `cursor`.
|
|
@@ -33844,10 +34464,10 @@ declare class ConsumerTenantApiKeysResource extends APIResource {
|
|
|
33844
34464
|
* @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-tenant-api-keys
|
|
33845
34465
|
* @example
|
|
33846
34466
|
* ```ts
|
|
33847
|
-
* for await (const tenantApiKey of auth.consumer("app").tenantApiKeys.list()) {
|
|
34467
|
+
* for await (const tenantApiKey of auth.consumer("my-app").tenantApiKeys.list()) {
|
|
33848
34468
|
* console.log(tenantApiKey);
|
|
33849
34469
|
* }
|
|
33850
|
-
* const page = await auth.consumer("app").tenantApiKeys.list({}, { timeout: 5_000 });
|
|
34470
|
+
* const page = await auth.consumer("my-app").tenantApiKeys.list({}, { timeout: 5_000 });
|
|
33851
34471
|
* ```
|
|
33852
34472
|
*/
|
|
33853
34473
|
list(params?: ConsumerScopedTenantApiKeyListParams, options?: RequestOptions): PagePromise<TenantApiKey>;
|
|
@@ -33856,6 +34476,9 @@ declare class ConsumerTenantApiKeysResource extends APIResource {
|
|
|
33856
34476
|
*
|
|
33857
34477
|
* Mints a replacement with the same name and scopes and returns its secret ONCE. You become the replacement's creator, so its scopes must be within your own tenant role. The outgoing key is revoked now (`grace_hours: 0`, the default) or keeps working for up to 24 hours. To kill a leaked key, revoke it. Responses carry `Cache-Control: no-store`.
|
|
33858
34478
|
*
|
|
34479
|
+
* Credential: `end_user_token`.
|
|
34480
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
34481
|
+
*
|
|
33859
34482
|
* @param keyId - Key id (UUID) or display id (`tak_…`).
|
|
33860
34483
|
* @param params - `Auth.TenantApiKeyRotateParams`.
|
|
33861
34484
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
@@ -33869,7 +34492,7 @@ declare class ConsumerTenantApiKeysResource extends APIResource {
|
|
|
33869
34492
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-tenant-api-keys-key-id-rotate
|
|
33870
34493
|
* @example
|
|
33871
34494
|
* ```ts
|
|
33872
|
-
* const tenantApiKeyWithSecret = await auth.consumer("app").tenantApiKeys.rotate("
|
|
34495
|
+
* const tenantApiKeyWithSecret = await auth.consumer("my-app").tenantApiKeys.rotate("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { expires_in_days: 7 });
|
|
33873
34496
|
* ```
|
|
33874
34497
|
*/
|
|
33875
34498
|
rotate(keyId: string, params?: TenantApiKeyRotateParams, options?: RequestOptions): APIPromise<WithLastResponse<TenantApiKeyWithSecret>>;
|
|
@@ -33878,6 +34501,9 @@ declare class ConsumerTenantApiKeysResource extends APIResource {
|
|
|
33878
34501
|
*
|
|
33879
34502
|
* For your own audit trail: record why a key you saw go inactive died (revoked in the console, creator left the tenant, expired, keys suspended). Only keys of this app; another app's key is 404. Requires `auth.tenant.api_keys.introspect` on the app.
|
|
33880
34503
|
*
|
|
34504
|
+
* Credential: `workspace_key`.
|
|
34505
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
34506
|
+
*
|
|
33881
34507
|
* @param keyId - Key id (UUID) or display id (`tak_…`), as `introspect` returned it.
|
|
33882
34508
|
* @param options - Per-request options.
|
|
33883
34509
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, malformed or revoked Platform API Key (`Authorization: Bearer pcft_live_…`).
|
|
@@ -33889,7 +34515,7 @@ declare class ConsumerTenantApiKeysResource extends APIResource {
|
|
|
33889
34515
|
* @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-tenant-api-keys-key-id-status
|
|
33890
34516
|
* @example
|
|
33891
34517
|
* ```ts
|
|
33892
|
-
* const tenantApiKeyStatus = await auth.consumer("app").tenantApiKeys.status("
|
|
34518
|
+
* const tenantApiKeyStatus = await auth.consumer("my-app").tenantApiKeys.status("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
33893
34519
|
* ```
|
|
33894
34520
|
*/
|
|
33895
34521
|
status(keyId: string, options?: RequestOptions): APIPromise<WithLastResponse<TenantApiKeyStatus>>;
|
|
@@ -33901,6 +34527,9 @@ declare class ConsumerTenantsInvitesResource extends APIResource {
|
|
|
33901
34527
|
*
|
|
33902
34528
|
* Unlike `POST /members`, nothing is granted until the invitee accepts at `POST /:appSlug/v1/auth/accept-tenant-invite`. Only a SHA-256 digest of the code is stored, so the `code` in this response is unrecoverable afterwards.
|
|
33903
34529
|
*
|
|
34530
|
+
* Credential: `workspace_key`.
|
|
34531
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
34532
|
+
*
|
|
33904
34533
|
* @param tenantId - Id of the tenant.
|
|
33905
34534
|
* @param params - `Auth.ConsumerScopedTenantInviteCreateParams`.
|
|
33906
34535
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
@@ -33914,13 +34543,16 @@ declare class ConsumerTenantsInvitesResource extends APIResource {
|
|
|
33914
34543
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-tenants-tenant-id-invites
|
|
33915
34544
|
* @example
|
|
33916
34545
|
* ```ts
|
|
33917
|
-
* const createTenantInvite = await auth.consumer("app").tenants.invites.create("
|
|
34546
|
+
* const createTenantInvite = await auth.consumer("my-app").tenants.invites.create("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { email: "alice@example.com", role_name: "member" });
|
|
33918
34547
|
* ```
|
|
33919
34548
|
*/
|
|
33920
34549
|
create(tenantId: string, params: ConsumerScopedTenantInviteCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<CreateTenantInvite>>;
|
|
33921
34550
|
/**
|
|
33922
34551
|
* Revoke a pending invite. Idempotent — revoking an already-revoked invite is a 204 no-op and fires no second webhook. PAK must hold auth.tenant.members.remove.
|
|
33923
34552
|
*
|
|
34553
|
+
* Credential: `workspace_key`.
|
|
34554
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
34555
|
+
*
|
|
33924
34556
|
* @param tenantId - Id of the tenant.
|
|
33925
34557
|
* @param inviteId - Id of the invite.
|
|
33926
34558
|
* @param options - Per-request options.
|
|
@@ -33931,7 +34563,7 @@ declare class ConsumerTenantsInvitesResource extends APIResource {
|
|
|
33931
34563
|
* @see https://productcraft.co/docs/auth/api-reference#delete-app-slug-v1-tenants-tenant-id-invites-invite-id
|
|
33932
34564
|
* @example
|
|
33933
34565
|
* ```ts
|
|
33934
|
-
* await auth.consumer("app").tenants.invites.delete("
|
|
34566
|
+
* await auth.consumer("my-app").tenants.invites.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
33935
34567
|
* ```
|
|
33936
34568
|
*/
|
|
33937
34569
|
delete(tenantId: string, inviteId: string, options?: RequestOptions): APIPromise<void>;
|
|
@@ -33940,6 +34572,9 @@ declare class ConsumerTenantsInvitesResource extends APIResource {
|
|
|
33940
34572
|
*
|
|
33941
34573
|
* Codes are never returned here — only the digest is stored. Use `status=pending` to show outstanding invitations.
|
|
33942
34574
|
*
|
|
34575
|
+
* Credential: `workspace_key`.
|
|
34576
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
34577
|
+
*
|
|
33943
34578
|
* @param tenantId - Id of the tenant.
|
|
33944
34579
|
* @param params - `Auth.ConsumerScopedTenantInviteListParams`.
|
|
33945
34580
|
* @param options - Per-request options.
|
|
@@ -33951,10 +34586,10 @@ declare class ConsumerTenantsInvitesResource extends APIResource {
|
|
|
33951
34586
|
* @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-tenants-tenant-id-invites
|
|
33952
34587
|
* @example
|
|
33953
34588
|
* ```ts
|
|
33954
|
-
* for await (const invite of auth.consumer("app").tenants.invites.list("
|
|
34589
|
+
* for await (const invite of auth.consumer("my-app").tenants.invites.list("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f")) {
|
|
33955
34590
|
* console.log(invite);
|
|
33956
34591
|
* }
|
|
33957
|
-
* const page = await auth.consumer("app").tenants.invites.list("
|
|
34592
|
+
* const page = await auth.consumer("my-app").tenants.invites.list("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", {}, { timeout: 5_000 });
|
|
33958
34593
|
* ```
|
|
33959
34594
|
*/
|
|
33960
34595
|
list(tenantId: string, params?: ConsumerScopedTenantInviteListParams, options?: RequestOptions): PagePromise<TenantInvite>;
|
|
@@ -33964,6 +34599,9 @@ declare class ConsumerTenantsMembersResource extends APIResource {
|
|
|
33964
34599
|
/**
|
|
33965
34600
|
* Add a member to a tenant. Pass `accountId` for an existing user, or `email` (+ optional `display_name`/`username`) to auto-create the account inline. PAK must hold auth.tenant.members.add.
|
|
33966
34601
|
*
|
|
34602
|
+
* Credential: `workspace_key`.
|
|
34603
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
34604
|
+
*
|
|
33967
34605
|
* @param tenantId - Id of the tenant.
|
|
33968
34606
|
* @param params - `Auth.ConsumerScopedTenantMemberCreateParams`.
|
|
33969
34607
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
@@ -33976,13 +34614,16 @@ declare class ConsumerTenantsMembersResource extends APIResource {
|
|
|
33976
34614
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-tenants-tenant-id-members
|
|
33977
34615
|
* @example
|
|
33978
34616
|
* ```ts
|
|
33979
|
-
* const consumerAddMember = await auth.consumer("app").tenants.members.create("
|
|
34617
|
+
* const consumerAddMember = await auth.consumer("my-app").tenants.members.create("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { role_name: "member" });
|
|
33980
34618
|
* ```
|
|
33981
34619
|
*/
|
|
33982
34620
|
create(tenantId: string, params: ConsumerScopedTenantMemberCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerAddMember>>;
|
|
33983
34621
|
/**
|
|
33984
34622
|
* Remove a member from a tenant. The underlying account row stays in the app — only the tenant_membership row is deleted. PAK must hold auth.tenant.members.remove.
|
|
33985
34623
|
*
|
|
34624
|
+
* Credential: `workspace_key`.
|
|
34625
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
34626
|
+
*
|
|
33986
34627
|
* @param tenantId - Id of the tenant.
|
|
33987
34628
|
* @param accountId - Id of the account.
|
|
33988
34629
|
* @param options - Per-request options.
|
|
@@ -33993,13 +34634,16 @@ declare class ConsumerTenantsMembersResource extends APIResource {
|
|
|
33993
34634
|
* @see https://productcraft.co/docs/auth/api-reference#delete-app-slug-v1-tenants-tenant-id-members-account-id
|
|
33994
34635
|
* @example
|
|
33995
34636
|
* ```ts
|
|
33996
|
-
* await auth.consumer("app").tenants.members.delete("
|
|
34637
|
+
* await auth.consumer("my-app").tenants.members.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
33997
34638
|
* ```
|
|
33998
34639
|
*/
|
|
33999
34640
|
delete(tenantId: string, accountId: string, options?: RequestOptions): APIPromise<void>;
|
|
34000
34641
|
/**
|
|
34001
34642
|
* List members of a tenant. Cursor-paginated by joined_at desc. Filter by `?search=` and/or `?role=`. PAK must hold auth.tenant.read.
|
|
34002
34643
|
*
|
|
34644
|
+
* Credential: `workspace_key`.
|
|
34645
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
34646
|
+
*
|
|
34003
34647
|
* @param tenantId - Id of the tenant.
|
|
34004
34648
|
* @param params - `Auth.ConsumerScopedTenantMemberListParams`.
|
|
34005
34649
|
* @param options - Per-request options.
|
|
@@ -34013,16 +34657,19 @@ declare class ConsumerTenantsMembersResource extends APIResource {
|
|
|
34013
34657
|
* @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-tenants-tenant-id-members
|
|
34014
34658
|
* @example
|
|
34015
34659
|
* ```ts
|
|
34016
|
-
* for await (const member of auth.consumer("app").tenants.members.list("
|
|
34660
|
+
* for await (const member of auth.consumer("my-app").tenants.members.list("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f")) {
|
|
34017
34661
|
* console.log(member);
|
|
34018
34662
|
* }
|
|
34019
|
-
* const page = await auth.consumer("app").tenants.members.list("
|
|
34663
|
+
* const page = await auth.consumer("my-app").tenants.members.list("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", {}, { timeout: 5_000 });
|
|
34020
34664
|
* ```
|
|
34021
34665
|
*/
|
|
34022
34666
|
list(tenantId: string, params?: ConsumerScopedTenantMemberListParams, options?: RequestOptions): PagePromise<ConsumerTenantMembership>;
|
|
34023
34667
|
/**
|
|
34024
34668
|
* Change a member's role. PAK must hold auth.tenant.members.update-role.
|
|
34025
34669
|
*
|
|
34670
|
+
* Credential: `workspace_key`.
|
|
34671
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
34672
|
+
*
|
|
34026
34673
|
* @param tenantId - Id of the tenant.
|
|
34027
34674
|
* @param accountId - Id of the account.
|
|
34028
34675
|
* @param params - `Auth.ConsumerScopedTenantMemberUpdateParams`.
|
|
@@ -34035,7 +34682,7 @@ declare class ConsumerTenantsMembersResource extends APIResource {
|
|
|
34035
34682
|
* @see https://productcraft.co/docs/auth/api-reference#patch-app-slug-v1-tenants-tenant-id-members-account-id
|
|
34036
34683
|
* @example
|
|
34037
34684
|
* ```ts
|
|
34038
|
-
* const consumerTenantMembership = await auth.consumer("app").tenants.members.update("
|
|
34685
|
+
* const consumerTenantMembership = await auth.consumer("my-app").tenants.members.update("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { role_name: "admin" });
|
|
34039
34686
|
* ```
|
|
34040
34687
|
*/
|
|
34041
34688
|
update(tenantId: string, accountId: string, params: ConsumerScopedTenantMemberUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerTenantMembership>>;
|
|
@@ -34048,6 +34695,9 @@ declare class ConsumerTenantsResource extends APIResource {
|
|
|
34048
34695
|
/**
|
|
34049
34696
|
* Create a tenant inside this app. Returns the new tenant with a `display_id` (`tnt_<12hex>`). PAK must hold auth.tenant.create.
|
|
34050
34697
|
*
|
|
34698
|
+
* Credential: `workspace_key`.
|
|
34699
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
34700
|
+
*
|
|
34051
34701
|
* @param params - `Auth.ConsumerScopedTenantCreateParams`.
|
|
34052
34702
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
34053
34703
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid display_name or slug.
|
|
@@ -34060,13 +34710,16 @@ declare class ConsumerTenantsResource extends APIResource {
|
|
|
34060
34710
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-tenants
|
|
34061
34711
|
* @example
|
|
34062
34712
|
* ```ts
|
|
34063
|
-
* const consumerTenant = await auth.consumer("app").tenants.create({ display_name: "Acme Co" });
|
|
34713
|
+
* const consumerTenant = await auth.consumer("my-app").tenants.create({ display_name: "Acme Co" });
|
|
34064
34714
|
* ```
|
|
34065
34715
|
*/
|
|
34066
34716
|
create(params: ConsumerScopedTenantCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerTenant>>;
|
|
34067
34717
|
/**
|
|
34068
34718
|
* Delete a tenant. Cascades to tenant_membership rows; account rows are unaffected. PAK must hold auth.tenant.delete.
|
|
34069
34719
|
*
|
|
34720
|
+
* Credential: `workspace_key`.
|
|
34721
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
34722
|
+
*
|
|
34070
34723
|
* @param tenantId - Id of the tenant.
|
|
34071
34724
|
* @param options - Per-request options.
|
|
34072
34725
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
@@ -34076,13 +34729,16 @@ declare class ConsumerTenantsResource extends APIResource {
|
|
|
34076
34729
|
* @see https://productcraft.co/docs/auth/api-reference#delete-app-slug-v1-tenants-tenant-id
|
|
34077
34730
|
* @example
|
|
34078
34731
|
* ```ts
|
|
34079
|
-
* await auth.consumer("app").tenants.delete("
|
|
34732
|
+
* await auth.consumer("my-app").tenants.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
34080
34733
|
* ```
|
|
34081
34734
|
*/
|
|
34082
34735
|
delete(tenantId: string, options?: RequestOptions): APIPromise<void>;
|
|
34083
34736
|
/**
|
|
34084
34737
|
* List tenants in this app, paginated by created_at desc. PAK must hold auth.tenant.read.
|
|
34085
34738
|
*
|
|
34739
|
+
* Credential: `workspace_key`.
|
|
34740
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
34741
|
+
*
|
|
34086
34742
|
* @param params - `Auth.ConsumerScopedTenantListParams`.
|
|
34087
34743
|
* @param options - Per-request options.
|
|
34088
34744
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid `status` filter or malformed `cursor`.
|
|
@@ -34095,16 +34751,19 @@ declare class ConsumerTenantsResource extends APIResource {
|
|
|
34095
34751
|
* @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-tenants
|
|
34096
34752
|
* @example
|
|
34097
34753
|
* ```ts
|
|
34098
|
-
* for await (const tenant of auth.consumer("app").tenants.list()) {
|
|
34754
|
+
* for await (const tenant of auth.consumer("my-app").tenants.list()) {
|
|
34099
34755
|
* console.log(tenant);
|
|
34100
34756
|
* }
|
|
34101
|
-
* const page = await auth.consumer("app").tenants.list({}, { timeout: 5_000 });
|
|
34757
|
+
* const page = await auth.consumer("my-app").tenants.list({}, { timeout: 5_000 });
|
|
34102
34758
|
* ```
|
|
34103
34759
|
*/
|
|
34104
34760
|
list(params?: ConsumerScopedTenantListParams, options?: RequestOptions): PagePromise<ConsumerTenant>;
|
|
34105
34761
|
/**
|
|
34106
34762
|
* Fetch a single tenant by its UUID or `tnt_<12hex>` display id. PAK must hold auth.tenant.read.
|
|
34107
34763
|
*
|
|
34764
|
+
* Credential: `workspace_key`.
|
|
34765
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
34766
|
+
*
|
|
34108
34767
|
* @param tenantId - Id of the tenant.
|
|
34109
34768
|
* @param options - Per-request options.
|
|
34110
34769
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
@@ -34114,13 +34773,16 @@ declare class ConsumerTenantsResource extends APIResource {
|
|
|
34114
34773
|
* @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-tenants-tenant-id
|
|
34115
34774
|
* @example
|
|
34116
34775
|
* ```ts
|
|
34117
|
-
* const consumerTenant = await auth.consumer("app").tenants.retrieve("
|
|
34776
|
+
* const consumerTenant = await auth.consumer("my-app").tenants.retrieve("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
34118
34777
|
* ```
|
|
34119
34778
|
*/
|
|
34120
34779
|
retrieve(tenantId: string, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerTenant>>;
|
|
34121
34780
|
/**
|
|
34122
34781
|
* Patch a tenant. Any subset of {display_name, slug, status, metadata}. PAK must hold auth.tenant.update.
|
|
34123
34782
|
*
|
|
34783
|
+
* Credential: `workspace_key`.
|
|
34784
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
34785
|
+
*
|
|
34124
34786
|
* @param tenantId - Id of the tenant.
|
|
34125
34787
|
* @param params - `Auth.ConsumerScopedTenantUpdateParams`.
|
|
34126
34788
|
* @param options - Per-request options.
|
|
@@ -34133,7 +34795,7 @@ declare class ConsumerTenantsResource extends APIResource {
|
|
|
34133
34795
|
* @see https://productcraft.co/docs/auth/api-reference#patch-app-slug-v1-tenants-tenant-id
|
|
34134
34796
|
* @example
|
|
34135
34797
|
* ```ts
|
|
34136
|
-
* const consumerTenant = await auth.consumer("app").tenants.update("
|
|
34798
|
+
* const consumerTenant = await auth.consumer("my-app").tenants.update("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { display_name: "Acme Inc" });
|
|
34137
34799
|
* ```
|
|
34138
34800
|
*/
|
|
34139
34801
|
update(tenantId: string, params?: ConsumerScopedTenantUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerTenant>>;
|
|
@@ -34145,6 +34807,9 @@ declare class ConsumerUsersFactorsResource extends APIResource {
|
|
|
34145
34807
|
*
|
|
34146
34808
|
* Creates the factor in the enabled state. TOTP: returns the cleartext secret + otpauth URI + recovery codes in the response — intended for synthetic-account-style flows where the caller bundles credentials and ships them out once. Email: binds the user's verified email contact (primary by default, `contact_id` to override; 412 when unverified) and returns the masked address + recovery codes — sign-in codes are then delivered on demand via `/auth/mfa/send-code`.
|
|
34147
34809
|
*
|
|
34810
|
+
* Credential: `workspace_key`.
|
|
34811
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
34812
|
+
*
|
|
34148
34813
|
* @param userId - Id of the user.
|
|
34149
34814
|
* @param params - `Auth.UserFactorCreateParams`.
|
|
34150
34815
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
@@ -34159,13 +34824,16 @@ declare class ConsumerUsersFactorsResource extends APIResource {
|
|
|
34159
34824
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-users-user-id-factors
|
|
34160
34825
|
* @example
|
|
34161
34826
|
* ```ts
|
|
34162
|
-
* const adminProvisionFactor = await auth.consumer("app").users.factors.create("
|
|
34827
|
+
* const adminProvisionFactor = await auth.consumer("my-app").users.factors.create("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { type: "totp" });
|
|
34163
34828
|
* ```
|
|
34164
34829
|
*/
|
|
34165
34830
|
create(userId: string, params: UserFactorCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<AdminProvisionFactor>>;
|
|
34166
34831
|
/**
|
|
34167
34832
|
* Disable a user's MFA factor
|
|
34168
34833
|
*
|
|
34834
|
+
* Credential: `workspace_key`.
|
|
34835
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
34836
|
+
*
|
|
34169
34837
|
* @param userId - Id of the user.
|
|
34170
34838
|
* @param factorId - Id of the factor.
|
|
34171
34839
|
* @param options - Per-request options.
|
|
@@ -34178,13 +34846,16 @@ declare class ConsumerUsersFactorsResource extends APIResource {
|
|
|
34178
34846
|
* @see https://productcraft.co/docs/auth/api-reference#delete-app-slug-v1-users-user-id-factors-factor-id
|
|
34179
34847
|
* @example
|
|
34180
34848
|
* ```ts
|
|
34181
|
-
* await auth.consumer("app").users.factors.delete("
|
|
34849
|
+
* await auth.consumer("my-app").users.factors.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
34182
34850
|
* ```
|
|
34183
34851
|
*/
|
|
34184
34852
|
delete(userId: string, factorId: string, options?: RequestOptions): APIPromise<void>;
|
|
34185
34853
|
/**
|
|
34186
34854
|
* List a user's MFA factors
|
|
34187
34855
|
*
|
|
34856
|
+
* Credential: `workspace_key`.
|
|
34857
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
34858
|
+
*
|
|
34188
34859
|
* @param userId - Id of the user.
|
|
34189
34860
|
* @param options - Per-request options.
|
|
34190
34861
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing bearer token, or the Platform API Key is malformed, unknown or revoked.
|
|
@@ -34196,7 +34867,7 @@ declare class ConsumerUsersFactorsResource extends APIResource {
|
|
|
34196
34867
|
* @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-users-user-id-factors
|
|
34197
34868
|
* @example
|
|
34198
34869
|
* ```ts
|
|
34199
|
-
* const factorList = await auth.consumer("app").users.factors.list("
|
|
34870
|
+
* const factorList = await auth.consumer("my-app").users.factors.list("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
34200
34871
|
* ```
|
|
34201
34872
|
*/
|
|
34202
34873
|
list(userId: string, options?: RequestOptions): APIPromise<WithLastResponse<FactorList>>;
|
|
@@ -34212,6 +34883,11 @@ declare class ConsumerUsersResource extends APIResource {
|
|
|
34212
34883
|
*
|
|
34213
34884
|
* What is NOT distinct: the password policy. A supplied `password` goes through the same app-configured rules, the same common-password deny-list and the same breach check as `/auth/signup`.
|
|
34214
34885
|
*
|
|
34886
|
+
* Credential: one of `app_api_key`, `m2m_token`, `end_user_token`.
|
|
34887
|
+
* - `app_api_key`: An app API key (`hdk_live_…` or `hdk_test_…`) minted for this app (`POST /v1/apps/{app_id}/api-keys`). Its permissions are always enforced. A workspace key is refused.
|
|
34888
|
+
* - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
|
|
34889
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
34890
|
+
*
|
|
34215
34891
|
* @param params - `Auth.UserCreateParams`.
|
|
34216
34892
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
34217
34893
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, PASSWORD_TOO_COMMON, PASSWORD_BREACHED: Invalid email, unknown role, or a password that fails the app policy — `PASSWORD_TOO_COMMON` / `PASSWORD_BREACHED`.
|
|
@@ -34223,7 +34899,7 @@ declare class ConsumerUsersResource extends APIResource {
|
|
|
34223
34899
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-admin-users
|
|
34224
34900
|
* @example
|
|
34225
34901
|
* ```ts
|
|
34226
|
-
* const consumerAdminCreatedUser = await auth.consumer("app").users.create({ email: "
|
|
34902
|
+
* const consumerAdminCreatedUser = await auth.consumer("my-app").users.create({ email: "ada@example.com" });
|
|
34227
34903
|
* ```
|
|
34228
34904
|
*/
|
|
34229
34905
|
create(params: UserCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerAdminCreatedUser>>;
|
|
@@ -34232,6 +34908,11 @@ declare class ConsumerUsersResource extends APIResource {
|
|
|
34232
34908
|
*
|
|
34233
34909
|
* Removes the account, its sessions, contacts, and tenant memberships. Audit rows are preserved, and the deletion itself is audited as `auth.account.deleted` with `via: consumer_admin` and the caller as actor. Fires `user.deleted` with `via: "consumer_admin"`.
|
|
34234
34910
|
*
|
|
34911
|
+
* Credential: one of `app_api_key`, `m2m_token`, `end_user_token`.
|
|
34912
|
+
* - `app_api_key`: An app API key (`hdk_live_…` or `hdk_test_…`) minted for this app (`POST /v1/apps/{app_id}/api-keys`). Its permissions are always enforced. A workspace key is refused.
|
|
34913
|
+
* - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
|
|
34914
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
34915
|
+
*
|
|
34235
34916
|
* @param userId - Id of the user.
|
|
34236
34917
|
* @param options - Per-request options.
|
|
34237
34918
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired Consumer-API bearer: an EndUser or M2M token, or an app API key (`hdk_live_*` / `hdk_test_*`); or the account, session, M2M client or key is no longer active, or the key belongs to another app.
|
|
@@ -34242,7 +34923,7 @@ declare class ConsumerUsersResource extends APIResource {
|
|
|
34242
34923
|
* @see https://productcraft.co/docs/auth/api-reference#delete-app-slug-v1-admin-users-user-id
|
|
34243
34924
|
* @example
|
|
34244
34925
|
* ```ts
|
|
34245
|
-
* await auth.consumer("app").users.delete("
|
|
34926
|
+
* await auth.consumer("my-app").users.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
34246
34927
|
* ```
|
|
34247
34928
|
*/
|
|
34248
34929
|
delete(userId: string, options?: RequestOptions): APIPromise<void>;
|
|
@@ -34251,6 +34932,11 @@ declare class ConsumerUsersResource extends APIResource {
|
|
|
34251
34932
|
*
|
|
34252
34933
|
* Cursor-paginated. Supports the same `status` and `search` filters as the auth-admin equivalent. Use the cursor in subsequent calls — Auth does not expose offset pagination.
|
|
34253
34934
|
*
|
|
34935
|
+
* Credential: one of `app_api_key`, `m2m_token`, `end_user_token`.
|
|
34936
|
+
* - `app_api_key`: An app API key (`hdk_live_…` or `hdk_test_…`) minted for this app (`POST /v1/apps/{app_id}/api-keys`). Its permissions are always enforced. A workspace key is refused.
|
|
34937
|
+
* - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
|
|
34938
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
34939
|
+
*
|
|
34254
34940
|
* @param params - `Auth.UserListParams`.
|
|
34255
34941
|
* @param options - Per-request options.
|
|
34256
34942
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`, or a cursor issued for a different sort order.
|
|
@@ -34262,16 +34948,21 @@ declare class ConsumerUsersResource extends APIResource {
|
|
|
34262
34948
|
* @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-admin-users
|
|
34263
34949
|
* @example
|
|
34264
34950
|
* ```ts
|
|
34265
|
-
* for await (const user of auth.consumer("app").users.list()) {
|
|
34951
|
+
* for await (const user of auth.consumer("my-app").users.list()) {
|
|
34266
34952
|
* console.log(user);
|
|
34267
34953
|
* }
|
|
34268
|
-
* const page = await auth.consumer("app").users.list({}, { timeout: 5_000 });
|
|
34954
|
+
* const page = await auth.consumer("my-app").users.list({}, { timeout: 5_000 });
|
|
34269
34955
|
* ```
|
|
34270
34956
|
*/
|
|
34271
34957
|
list(params?: UserListParams, options?: RequestOptions): PagePromise<ConsumerAdminEndUser>;
|
|
34272
34958
|
/**
|
|
34273
34959
|
* Read one end-user
|
|
34274
34960
|
*
|
|
34961
|
+
* Credential: one of `app_api_key`, `m2m_token`, `end_user_token`.
|
|
34962
|
+
* - `app_api_key`: An app API key (`hdk_live_…` or `hdk_test_…`) minted for this app (`POST /v1/apps/{app_id}/api-keys`). Its permissions are always enforced. A workspace key is refused.
|
|
34963
|
+
* - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
|
|
34964
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
34965
|
+
*
|
|
34275
34966
|
* @param userId - Id of the user.
|
|
34276
34967
|
* @param options - Per-request options.
|
|
34277
34968
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
|
|
@@ -34281,7 +34972,7 @@ declare class ConsumerUsersResource extends APIResource {
|
|
|
34281
34972
|
* @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-admin-users-user-id
|
|
34282
34973
|
* @example
|
|
34283
34974
|
* ```ts
|
|
34284
|
-
* const consumerAdminEndUser = await auth.consumer("app").users.retrieve("
|
|
34975
|
+
* const consumerAdminEndUser = await auth.consumer("my-app").users.retrieve("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
34285
34976
|
* ```
|
|
34286
34977
|
*/
|
|
34287
34978
|
retrieve(userId: string, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerAdminEndUser>>;
|
|
@@ -34290,6 +34981,11 @@ declare class ConsumerUsersResource extends APIResource {
|
|
|
34290
34981
|
*
|
|
34291
34982
|
* Email update promotes an existing contact to primary (not for creating new contacts — that goes through the per-contact flow).
|
|
34292
34983
|
*
|
|
34984
|
+
* Credential: one of `app_api_key`, `m2m_token`, `end_user_token`.
|
|
34985
|
+
* - `app_api_key`: An app API key (`hdk_live_…` or `hdk_test_…`) minted for this app (`POST /v1/apps/{app_id}/api-keys`). Its permissions are always enforced. A workspace key is refused.
|
|
34986
|
+
* - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
|
|
34987
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
34988
|
+
*
|
|
34293
34989
|
* @param userId - Id of the user.
|
|
34294
34990
|
* @param params - `Auth.UserUpdateParams`.
|
|
34295
34991
|
* @param options - Per-request options.
|
|
@@ -34302,7 +34998,7 @@ declare class ConsumerUsersResource extends APIResource {
|
|
|
34302
34998
|
* @see https://productcraft.co/docs/auth/api-reference#patch-app-slug-v1-admin-users-user-id
|
|
34303
34999
|
* @example
|
|
34304
35000
|
* ```ts
|
|
34305
|
-
* const consumerAdminEndUser = await auth.consumer("app").users.update("
|
|
35001
|
+
* const consumerAdminEndUser = await auth.consumer("my-app").users.update("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { display_name: "Ada Lovelace" });
|
|
34306
35002
|
* ```
|
|
34307
35003
|
*/
|
|
34308
35004
|
update(userId: string, params?: UserUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerAdminEndUser>>;
|
|
@@ -34311,6 +35007,11 @@ declare class ConsumerUsersResource extends APIResource {
|
|
|
34311
35007
|
*
|
|
34312
35008
|
* Sets `app_membership.role_id` for the target user. For M2M callers the assignable role is bounded by the token's scopes (the guard already enforced `role.assign`); the role's own permission set is NOT additionally narrowed against the M2M scopes because M2M scopes are typically broader than per-user role perms by design (a backend cron with `user.list` + `role.assign` SHOULD be able to promote a user into a role carrying any per-app perm). EndUser admins are bounded by their own role's perms transitively — they couldn't authenticate as an admin without holding the perm.
|
|
34313
35009
|
*
|
|
35010
|
+
* Credential: one of `app_api_key`, `m2m_token`, `end_user_token`.
|
|
35011
|
+
* - `app_api_key`: An app API key (`hdk_live_…` or `hdk_test_…`) minted for this app (`POST /v1/apps/{app_id}/api-keys`). Its permissions are always enforced. A workspace key is refused.
|
|
35012
|
+
* - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
|
|
35013
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
35014
|
+
*
|
|
34314
35015
|
* @param userId - Id of the user.
|
|
34315
35016
|
* @param params - `Auth.UserUpdateRoleParams`.
|
|
34316
35017
|
* @param options - Per-request options.
|
|
@@ -34323,7 +35024,7 @@ declare class ConsumerUsersResource extends APIResource {
|
|
|
34323
35024
|
* @see https://productcraft.co/docs/auth/api-reference#patch-app-slug-v1-admin-users-user-id-role
|
|
34324
35025
|
* @example
|
|
34325
35026
|
* ```ts
|
|
34326
|
-
* const consumerAdminRoleAssignment = await auth.consumer("app").users.updateRole("
|
|
35027
|
+
* const consumerAdminRoleAssignment = await auth.consumer("my-app").users.updateRole("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { role_name: "member" });
|
|
34327
35028
|
* ```
|
|
34328
35029
|
*/
|
|
34329
35030
|
updateRole(userId: string, params: UserUpdateRoleParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerAdminRoleAssignment>>;
|
|
@@ -34332,6 +35033,11 @@ declare class ConsumerUsersResource extends APIResource {
|
|
|
34332
35033
|
*
|
|
34333
35034
|
* Setting status to `suspended` or `deactivated` also revokes all active sessions for the user (same behaviour as the auth-admin equivalent).
|
|
34334
35035
|
*
|
|
35036
|
+
* Credential: one of `app_api_key`, `m2m_token`, `end_user_token`.
|
|
35037
|
+
* - `app_api_key`: An app API key (`hdk_live_…` or `hdk_test_…`) minted for this app (`POST /v1/apps/{app_id}/api-keys`). Its permissions are always enforced. A workspace key is refused.
|
|
35038
|
+
* - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
|
|
35039
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
35040
|
+
*
|
|
34335
35041
|
* @param userId - Id of the user.
|
|
34336
35042
|
* @param params - `Auth.UserUpdateStatusParams`.
|
|
34337
35043
|
* @param options - Per-request options.
|
|
@@ -34344,7 +35050,7 @@ declare class ConsumerUsersResource extends APIResource {
|
|
|
34344
35050
|
* @see https://productcraft.co/docs/auth/api-reference#patch-app-slug-v1-admin-users-user-id-status
|
|
34345
35051
|
* @example
|
|
34346
35052
|
* ```ts
|
|
34347
|
-
* const consumerAdminEndUser = await auth.consumer("app").users.updateStatus("
|
|
35053
|
+
* const consumerAdminEndUser = await auth.consumer("my-app").users.updateStatus("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { status: "active" });
|
|
34348
35054
|
* ```
|
|
34349
35055
|
*/
|
|
34350
35056
|
updateStatus(userId: string, params: UserUpdateStatusParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerAdminEndUser>>;
|
|
@@ -34367,7 +35073,7 @@ declare class ConsumerVerifyResource extends APIResource {
|
|
|
34367
35073
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-authorize
|
|
34368
35074
|
* @example
|
|
34369
35075
|
* ```ts
|
|
34370
|
-
* const authorize = await auth.consumer("app").verify.authorize({ permission: "
|
|
35076
|
+
* const authorize = await auth.consumer("my-app").verify.authorize({ permission: "invoice.read" });
|
|
34371
35077
|
* ```
|
|
34372
35078
|
*/
|
|
34373
35079
|
authorize(params?: VerifyAuthorizeParams, options?: RequestOptions): APIPromise<WithLastResponse<Authorize>>;
|
|
@@ -34387,7 +35093,7 @@ declare class ConsumerVerifyResource extends APIResource {
|
|
|
34387
35093
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-authorize-batch
|
|
34388
35094
|
* @example
|
|
34389
35095
|
* ```ts
|
|
34390
|
-
* const authorizeBatch = await auth.consumer("app").verify.authorizeBatch({ checks: [{}] });
|
|
35096
|
+
* const authorizeBatch = await auth.consumer("my-app").verify.authorizeBatch({ checks: [{}] });
|
|
34391
35097
|
* ```
|
|
34392
35098
|
*/
|
|
34393
35099
|
authorizeBatch(params: VerifyAuthorizeBatchParams, options?: RequestOptions): APIPromise<WithLastResponse<AuthorizeBatch>>;
|
|
@@ -34407,7 +35113,7 @@ declare class ConsumerVerifyResource extends APIResource {
|
|
|
34407
35113
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-verify
|
|
34408
35114
|
* @example
|
|
34409
35115
|
* ```ts
|
|
34410
|
-
* const verify = await auth.consumer("app").verify.token({ token: "
|
|
35116
|
+
* const verify = await auth.consumer("my-app").verify.token({ token: "eyJhbGciOiJSUzI1NiIsImtpZCI6ImsxIn0.eyJzdWIiOiJ1c3JfMSJ9.c2lnbmF0dXJl" });
|
|
34411
35117
|
* ```
|
|
34412
35118
|
*/
|
|
34413
35119
|
token(params?: VerifyTokenParams, options?: RequestOptions): APIPromise<WithLastResponse<Verify>>;
|
|
@@ -34432,7 +35138,7 @@ declare class ConsumerWellKnownResource extends APIResource {
|
|
|
34432
35138
|
* @see https://productcraft.co/docs/auth/api-reference#get-app-slug-well-known-jwks-json
|
|
34433
35139
|
* @example
|
|
34434
35140
|
* ```ts
|
|
34435
|
-
* const jwks = await auth.consumer("app").wellKnown.jwks();
|
|
35141
|
+
* const jwks = await auth.consumer("my-app").wellKnown.jwks();
|
|
34436
35142
|
* ```
|
|
34437
35143
|
*/
|
|
34438
35144
|
jwks(options?: RequestOptions): APIPromise<WithLastResponse<Jwks>>;
|
|
@@ -34448,7 +35154,7 @@ declare class ConsumerWellKnownResource extends APIResource {
|
|
|
34448
35154
|
* @see https://productcraft.co/docs/auth/api-reference#get-app-slug-well-known-openid-configuration
|
|
34449
35155
|
* @example
|
|
34450
35156
|
* ```ts
|
|
34451
|
-
* const openIdConfiguration = await auth.consumer("app").wellKnown.openidConfiguration();
|
|
35157
|
+
* const openIdConfiguration = await auth.consumer("my-app").wellKnown.openidConfiguration();
|
|
34452
35158
|
* ```
|
|
34453
35159
|
*/
|
|
34454
35160
|
openidConfiguration(options?: RequestOptions): APIPromise<WithLastResponse<OpenIdConfiguration>>;
|
|
@@ -34488,7 +35194,7 @@ declare class AuthConsumer extends APIResource {
|
|
|
34488
35194
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-accept-invite
|
|
34489
35195
|
* @example
|
|
34490
35196
|
* ```ts
|
|
34491
|
-
* const result = await auth.consumer("app").acceptInvite({ code: "inv_x7H2k3jLqXr", password: "CorrectHorseBatteryStaple" });
|
|
35197
|
+
* const result = await auth.consumer("my-app").acceptInvite({ code: "inv_x7H2k3jLqXr", password: "CorrectHorseBatteryStaple" });
|
|
34492
35198
|
* ```
|
|
34493
35199
|
*/
|
|
34494
35200
|
acceptInvite(params: AcceptInviteParams, options?: RequestOptions): APIPromise<WithLastResponse<AcceptInviteResponse>>;
|
|
@@ -34511,7 +35217,7 @@ declare class AuthConsumer extends APIResource {
|
|
|
34511
35217
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-accept-tenant-invite
|
|
34512
35218
|
* @example
|
|
34513
35219
|
* ```ts
|
|
34514
|
-
* const consumerToken = await auth.consumer("app").acceptTenantInvite({ code: "tinv_9dK2mQ7pR4vXbN1sT6yZ0hLcJeW3fAgU", password: "CorrectHorseBatteryStaple" });
|
|
35220
|
+
* const consumerToken = await auth.consumer("my-app").acceptTenantInvite({ code: "tinv_9dK2mQ7pR4vXbN1sT6yZ0hLcJeW3fAgU", password: "CorrectHorseBatteryStaple" });
|
|
34515
35221
|
* ```
|
|
34516
35222
|
*/
|
|
34517
35223
|
acceptTenantInvite(params: AcceptTenantInviteParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerToken>>;
|
|
@@ -34527,7 +35233,7 @@ declare class AuthConsumer extends APIResource {
|
|
|
34527
35233
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-oauth-exchange
|
|
34528
35234
|
* @example
|
|
34529
35235
|
* ```ts
|
|
34530
|
-
* const exchange = await auth.consumer("app").exchangeProviderCode({ code: "
|
|
35236
|
+
* const exchange = await auth.consumer("my-app").exchangeProviderCode({ code: "hc_8f14e45fceea167a5a36dedd4bea2543" });
|
|
34531
35237
|
* ```
|
|
34532
35238
|
*/
|
|
34533
35239
|
exchangeProviderCode(params: ExchangeProviderCodeParams, options?: RequestOptions): APIPromise<WithLastResponse<Exchange>>;
|
|
@@ -34548,7 +35254,9 @@ declare class AuthConsumer extends APIResource {
|
|
|
34548
35254
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-logout
|
|
34549
35255
|
* @example
|
|
34550
35256
|
* ```ts
|
|
34551
|
-
* await auth.consumer("app").logout({
|
|
35257
|
+
* await auth.consumer("my-app").logout({
|
|
35258
|
+
* refresh_token: "eyJhbGciOiJSUzI1NiIsImtpZCI6ImsxIn0.eyJ0eXAiOiJyZWZyZXNoIn0.c2lnbmF0dXJl",
|
|
35259
|
+
* });
|
|
34552
35260
|
* ```
|
|
34553
35261
|
*/
|
|
34554
35262
|
logout(params: LogoutParams, options?: RequestOptions): APIPromise<void>;
|
|
@@ -34569,7 +35277,9 @@ declare class AuthConsumer extends APIResource {
|
|
|
34569
35277
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-refresh
|
|
34570
35278
|
* @example
|
|
34571
35279
|
* ```ts
|
|
34572
|
-
* const consumerToken = await auth.consumer("app").refresh({
|
|
35280
|
+
* const consumerToken = await auth.consumer("my-app").refresh({
|
|
35281
|
+
* refresh_token: "eyJhbGciOiJSUzI1NiIsImtpZCI6ImsxIn0.eyJ0eXAiOiJyZWZyZXNoIn0.c2lnbmF0dXJl",
|
|
35282
|
+
* });
|
|
34573
35283
|
* ```
|
|
34574
35284
|
*/
|
|
34575
35285
|
refresh(params: RefreshParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerToken>>;
|
|
@@ -34582,6 +35292,9 @@ declare class AuthConsumer extends APIResource {
|
|
|
34582
35292
|
*
|
|
34583
35293
|
* Renamed from /auth/request-reset.
|
|
34584
35294
|
*
|
|
35295
|
+
* Credential: `workspace_key`.
|
|
35296
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
35297
|
+
*
|
|
34585
35298
|
* @param params - `Auth.RequestPasswordResetParams`.
|
|
34586
35299
|
* @param options - Per-request options.
|
|
34587
35300
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Provide exactly one of `email` or `phone`, or request validation failed in the global `ValidationPipe`.
|
|
@@ -34594,7 +35307,7 @@ declare class AuthConsumer extends APIResource {
|
|
|
34594
35307
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-request-password-reset
|
|
34595
35308
|
* @example
|
|
34596
35309
|
* ```ts
|
|
34597
|
-
* const consumerCodeIssue = await auth.consumer("app").requestPasswordReset({ email: "jane@example.com" });
|
|
35310
|
+
* const consumerCodeIssue = await auth.consumer("my-app").requestPasswordReset({ email: "jane@example.com" });
|
|
34598
35311
|
* ```
|
|
34599
35312
|
*/
|
|
34600
35313
|
requestPasswordReset(params?: RequestPasswordResetParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerCodeIssue>>;
|
|
@@ -34607,6 +35320,9 @@ declare class AuthConsumer extends APIResource {
|
|
|
34607
35320
|
*
|
|
34608
35321
|
* Issuing a code invalidates any previously issued, unconsumed code for the same contact — including the one auto-emailed at signup. Only the most recently minted code is accepted.
|
|
34609
35322
|
*
|
|
35323
|
+
* Credential: `workspace_key`.
|
|
35324
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
35325
|
+
*
|
|
34610
35326
|
* @param params - `Auth.RequestVerificationParams`.
|
|
34611
35327
|
* @param options - Per-request options.
|
|
34612
35328
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Provide exactly one of `email` or `phone`, or request validation failed in the global `ValidationPipe`.
|
|
@@ -34619,7 +35335,7 @@ declare class AuthConsumer extends APIResource {
|
|
|
34619
35335
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-request-verification
|
|
34620
35336
|
* @example
|
|
34621
35337
|
* ```ts
|
|
34622
|
-
* const consumerCodeIssue = await auth.consumer("app").requestVerification({ email: "jane@example.com" });
|
|
35338
|
+
* const consumerCodeIssue = await auth.consumer("my-app").requestVerification({ email: "jane@example.com" });
|
|
34623
35339
|
* ```
|
|
34624
35340
|
*/
|
|
34625
35341
|
requestVerification(params?: RequestVerificationParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerCodeIssue>>;
|
|
@@ -34641,7 +35357,7 @@ declare class AuthConsumer extends APIResource {
|
|
|
34641
35357
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-reset-password
|
|
34642
35358
|
* @example
|
|
34643
35359
|
* ```ts
|
|
34644
|
-
* await auth.consumer("app").resetPassword({ code: "123456", new_password: "
|
|
35360
|
+
* await auth.consumer("my-app").resetPassword({ code: "123456", new_password: "a new long passphrase 42" });
|
|
34645
35361
|
* ```
|
|
34646
35362
|
*/
|
|
34647
35363
|
resetPassword(params: ResetPasswordParams, options?: RequestOptions): APIPromise<void>;
|
|
@@ -34650,6 +35366,9 @@ declare class AuthConsumer extends APIResource {
|
|
|
34650
35366
|
*
|
|
34651
35367
|
* Same shape as `send-verification-email` but for the reset slot. PAK perm: `auth.user.password-reset.send-email`. Same loud precondition errors. Email-only.
|
|
34652
35368
|
*
|
|
35369
|
+
* Credential: `workspace_key`.
|
|
35370
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
35371
|
+
*
|
|
34653
35372
|
* @param params - `Auth.SendPasswordResetEmailParams`.
|
|
34654
35373
|
* @param options - Per-request options.
|
|
34655
35374
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Request validation failed: a required body field is missing, has the wrong type, or fails its format constraint. Produced by the global `ValidationPipe` before the handler runs; the response body lists the offending fields.
|
|
@@ -34664,7 +35383,7 @@ declare class AuthConsumer extends APIResource {
|
|
|
34664
35383
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-send-password-reset-email
|
|
34665
35384
|
* @example
|
|
34666
35385
|
* ```ts
|
|
34667
|
-
* const consumerCodeDispatch = await auth.consumer("app").sendPasswordResetEmail({ email: "jane@example.com" });
|
|
35386
|
+
* const consumerCodeDispatch = await auth.consumer("my-app").sendPasswordResetEmail({ email: "jane@example.com" });
|
|
34668
35387
|
* ```
|
|
34669
35388
|
*/
|
|
34670
35389
|
sendPasswordResetEmail(params: SendPasswordResetEmailParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerCodeDispatch>>;
|
|
@@ -34686,6 +35405,9 @@ declare class AuthConsumer extends APIResource {
|
|
|
34686
35405
|
*
|
|
34687
35406
|
* Issuing a code invalidates any previously issued, unconsumed code for the same contact — including the one auto-emailed at signup. Only the most recently minted code is accepted.
|
|
34688
35407
|
*
|
|
35408
|
+
* Credential: `workspace_key`.
|
|
35409
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
35410
|
+
*
|
|
34689
35411
|
* @param params - `Auth.SendVerificationEmailParams`.
|
|
34690
35412
|
* @param options - Per-request options.
|
|
34691
35413
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Request validation failed: a required body field is missing, has the wrong type, or fails its format constraint. Produced by the global `ValidationPipe` before the handler runs; the response body lists the offending fields.
|
|
@@ -34700,7 +35422,7 @@ declare class AuthConsumer extends APIResource {
|
|
|
34700
35422
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-send-verification-email
|
|
34701
35423
|
* @example
|
|
34702
35424
|
* ```ts
|
|
34703
|
-
* const consumerCodeDispatch = await auth.consumer("app").sendVerificationEmail({ email: "jane@example.com" });
|
|
35425
|
+
* const consumerCodeDispatch = await auth.consumer("my-app").sendVerificationEmail({ email: "jane@example.com" });
|
|
34704
35426
|
* ```
|
|
34705
35427
|
*/
|
|
34706
35428
|
sendVerificationEmail(params: SendVerificationEmailParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerCodeDispatch>>;
|
|
@@ -34722,7 +35444,7 @@ declare class AuthConsumer extends APIResource {
|
|
|
34722
35444
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-signin
|
|
34723
35445
|
* @example
|
|
34724
35446
|
* ```ts
|
|
34725
|
-
* const result = await auth.consumer("app").signin({ identifier: "jane_doe", password: "
|
|
35447
|
+
* const result = await auth.consumer("my-app").signin({ identifier: "jane_doe", password: "correct horse battery staple" });
|
|
34726
35448
|
* ```
|
|
34727
35449
|
*/
|
|
34728
35450
|
signin(params: SigninParams, options?: RequestOptions): APIPromise<WithLastResponse<SigninResponse>>;
|
|
@@ -34741,7 +35463,10 @@ declare class AuthConsumer extends APIResource {
|
|
|
34741
35463
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-oauth-provider
|
|
34742
35464
|
* @example
|
|
34743
35465
|
* ```ts
|
|
34744
|
-
* const result = await auth.consumer("app").signinWithProvider("
|
|
35466
|
+
* const result = await auth.consumer("my-app").signinWithProvider("google", {
|
|
35467
|
+
* id_token: "eyJhbGciOiJSUzI1NiIsImtpZCI6ImsxIn0.eyJzdWIiOiJ1c3JfMSJ9.c2lnbmF0dXJl",
|
|
35468
|
+
* nonce: "n-0S6_WzA2Mj",
|
|
35469
|
+
* });
|
|
34745
35470
|
* ```
|
|
34746
35471
|
*/
|
|
34747
35472
|
signinWithProvider(provider: string, params: SigninWithProviderParams, options?: RequestOptions): APIPromise<WithLastResponse<SigninWithProviderResponse>>;
|
|
@@ -34754,11 +35479,14 @@ declare class AuthConsumer extends APIResource {
|
|
|
34754
35479
|
*
|
|
34755
35480
|
* When the app has bot protection on (`auth_config.bot_protection`, Cloudflare Turnstile or hCaptcha), send the widget response as `bot_protection_token`. Auth verifies it with the provider before it looks at the email, username or password, and refuses the sign-up when the token is missing (400 `BOT_PROTECTION_REQUIRED`), rejected (403 `BOT_PROTECTION_FAILED`) or cannot be checked (503 `BOT_PROTECTION_UNAVAILABLE`; no account is created). This applies to PAK-authenticated calls too: a backend forwards the token its browser received.
|
|
34756
35481
|
*
|
|
35482
|
+
* Credential (optional): `workspace_key`.
|
|
35483
|
+
* - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
|
|
35484
|
+
*
|
|
34757
35485
|
* @param params - `Auth.SignupParams`.
|
|
34758
35486
|
* @param options - Per-request options.
|
|
34759
35487
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, BOT_PROTECTION_REQUIRED: `BOT_PROTECTION_REQUIRED`: the app has bot protection on and the request carried no `bot_protection_token`. Also: Request validation failed: a required body field is missing, has the wrong type, or fails its format constraint. Produced by the global `ValidationPipe` before the handler runs; the response body lists the offending fields.
|
|
34760
35488
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: The app sets `signup_requires_pak` and no Platform API Key was presented on `Authorization: Bearer`.
|
|
34761
|
-
* @throws {PermissionDeniedError} 403 FORBIDDEN, BOT_PROTECTION_FAILED, APP_SUSPENDED, APP_ARCHIVED: `BOT_PROTECTION_FAILED`: the bot-protection provider rejected the `bot_protection_token` (bad, expired or already used), or the hostname it reported is not one of the app's `bot_protection.expected_hostnames`; render a fresh widget and retry. Otherwise: signup is disabled for this app, the email domain is not on the app's allow-list, the presented PAK belongs to a different workspace, or its policy denies `auth.signup.create` on this app. Also returned when the app itself is suspended (`APP_SUSPENDED`) or archived (`APP_ARCHIVED`).
|
|
35489
|
+
* @throws {PermissionDeniedError} 403 FORBIDDEN, BOT_PROTECTION_FAILED, APP_SUSPENDED, APP_ARCHIVED: `BOT_PROTECTION_FAILED`: the bot-protection provider rejected the `bot_protection_token` (bad, expired or already used), or the hostname it reported is not one of the app's `bot_protection.expected_hostnames`; render a fresh widget and retry. Otherwise: signup is disabled for this app (new apps start with `signup_enabled: false`; turn it on with `PATCH /v1/apps/{app_id}/auth-config`), the email domain is not on the app's allow-list, the presented PAK belongs to a different workspace, or its policy denies `auth.signup.create` on this app. Also returned when the app itself is suspended (`APP_SUSPENDED`) or archived (`APP_ARCHIVED`).
|
|
34762
35490
|
* @throws {NotFoundError} 404 NOT_FOUND: The `:appSlug` in the path matches no app (or no live rename alias for one). This is about the **app**, not the account — it is decided before any identifier, code or credential in the body is looked at, so it is never a signal about whether an account or a contact exists.
|
|
34763
35491
|
* @throws {ConflictError} 409 CONFLICT: Email or username already in use in this app, or the app has no workspace binding and therefore cannot accept a PAK signup.
|
|
34764
35492
|
* @throws {APIError} 415 UNSUPPORTED_MEDIA_TYPE: The request body was sent as `application/x-www-form-urlencoded` (`UNSUPPORTED_MEDIA_TYPE`). This API is JSON-only: a form body is a CORS-simple request that skips preflight, so accepting one would widen the CSRF surface. Send `application/json`. Rejected in `main.ts` before routing, on every non-GET request.
|
|
@@ -34768,7 +35496,7 @@ declare class AuthConsumer extends APIResource {
|
|
|
34768
35496
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-signup
|
|
34769
35497
|
* @example
|
|
34770
35498
|
* ```ts
|
|
34771
|
-
* const result = await auth.consumer("app").signup({ email: "jane@example.com", password: "CorrectHorseBatteryStaple", username: "john_doe" });
|
|
35499
|
+
* const result = await auth.consumer("my-app").signup({ email: "jane@example.com", password: "CorrectHorseBatteryStaple", username: "john_doe" });
|
|
34772
35500
|
* ```
|
|
34773
35501
|
*/
|
|
34774
35502
|
signup(params: SignupParams, options?: RequestOptions): APIPromise<WithLastResponse<SignupResponse>>;
|
|
@@ -34777,6 +35505,9 @@ declare class AuthConsumer extends APIResource {
|
|
|
34777
35505
|
*
|
|
34778
35506
|
* Re-issues the EndUser's access + refresh tokens with the new `org_id` + `org_role` claims, after verifying the caller holds a tenant_membership for the target tenant. The session row is updated to the new tenant so subsequent refreshes preserve the context. The new access token keeps the session's `amr` and `mfa_at` (as `/auth/refresh` does), so a sign-in that completed MFA still proves it after a switch. Refresh-token rotation runs as usual; the previous refresh token enters the standard 60-second grace window.
|
|
34779
35507
|
*
|
|
35508
|
+
* Credential: `end_user_token`.
|
|
35509
|
+
* - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
|
|
35510
|
+
*
|
|
34780
35511
|
* @param params - `Auth.SwitchTenantParams`.
|
|
34781
35512
|
* @param options - Per-request options.
|
|
34782
35513
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Request validation failed: a required body field is missing, has the wrong type, or fails its format constraint. Produced by the global `ValidationPipe` before the handler runs; the response body lists the offending fields.
|
|
@@ -34789,7 +35520,7 @@ declare class AuthConsumer extends APIResource {
|
|
|
34789
35520
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-switch-tenant
|
|
34790
35521
|
* @example
|
|
34791
35522
|
* ```ts
|
|
34792
|
-
* const consumerToken = await auth.consumer("app").switchTenant({ tenant_id: "
|
|
35523
|
+
* const consumerToken = await auth.consumer("my-app").switchTenant({ tenant_id: "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f" });
|
|
34793
35524
|
* ```
|
|
34794
35525
|
*/
|
|
34795
35526
|
switchTenant(params: SwitchTenantParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerToken>>;
|
|
@@ -34812,12 +35543,74 @@ declare class AuthConsumer extends APIResource {
|
|
|
34812
35543
|
* @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-verify
|
|
34813
35544
|
* @example
|
|
34814
35545
|
* ```ts
|
|
34815
|
-
* const consumerVerify = await auth.consumer("app").verifyEmail({ code: "123456" });
|
|
35546
|
+
* const consumerVerify = await auth.consumer("my-app").verifyEmail({ code: "123456" });
|
|
34816
35547
|
* ```
|
|
34817
35548
|
*/
|
|
34818
35549
|
verifyEmail(params: VerifyEmailParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerVerify>>;
|
|
34819
35550
|
}
|
|
34820
35551
|
|
|
35552
|
+
/**
|
|
35553
|
+
* Structural copies of the jose types that appear in this package's public
|
|
35554
|
+
* declarations (`AuthGetKeyFn`, `AuthClaims`).
|
|
35555
|
+
*
|
|
35556
|
+
* jose 6 ships ESM-only declarations. If our .d.cts imported them, a
|
|
35557
|
+
* CommonJS consumer on moduleResolution node16/nodenext would get TS1479,
|
|
35558
|
+
* and tsup cannot inline a dependency's types. These copies keep the public
|
|
35559
|
+
* types self-contained; tests/jose-compat.ts proves they stay assignable to
|
|
35560
|
+
* and from jose's own (so `jose.jwtVerify(token, scope.jwks.getKey)` works).
|
|
35561
|
+
*/
|
|
35562
|
+
/** A WebCrypto key, as jose 6 defines it. */
|
|
35563
|
+
type CryptoKey = Extract<Awaited<ReturnType<typeof crypto.subtle.generateKey>>, {
|
|
35564
|
+
type: string;
|
|
35565
|
+
}>;
|
|
35566
|
+
/** JOSE header parameters of a JWS (jose's `JWSHeaderParameters`). */
|
|
35567
|
+
interface JWSHeaderParameters {
|
|
35568
|
+
kid?: string;
|
|
35569
|
+
x5t?: string;
|
|
35570
|
+
x5c?: string[];
|
|
35571
|
+
x5u?: string;
|
|
35572
|
+
jku?: string;
|
|
35573
|
+
jwk?: {
|
|
35574
|
+
kty?: string;
|
|
35575
|
+
crv?: string;
|
|
35576
|
+
x?: string;
|
|
35577
|
+
y?: string;
|
|
35578
|
+
e?: string;
|
|
35579
|
+
n?: string;
|
|
35580
|
+
alg?: string;
|
|
35581
|
+
pub?: string;
|
|
35582
|
+
};
|
|
35583
|
+
typ?: string;
|
|
35584
|
+
cty?: string;
|
|
35585
|
+
alg?: string;
|
|
35586
|
+
b64?: boolean;
|
|
35587
|
+
crit?: string[];
|
|
35588
|
+
[propName: string]: unknown;
|
|
35589
|
+
}
|
|
35590
|
+
/** A JWT's protected header (jose's `JWTHeaderParameters`). */
|
|
35591
|
+
interface JWTHeaderParameters extends JWSHeaderParameters {
|
|
35592
|
+
alg: string;
|
|
35593
|
+
b64?: true;
|
|
35594
|
+
}
|
|
35595
|
+
/** A flattened JWS (jose's `FlattenedJWSInput`). */
|
|
35596
|
+
interface FlattenedJWSInput {
|
|
35597
|
+
header?: JWSHeaderParameters;
|
|
35598
|
+
payload: string | Uint8Array;
|
|
35599
|
+
protected?: string;
|
|
35600
|
+
signature: string;
|
|
35601
|
+
}
|
|
35602
|
+
/** Registered JWT claims, open to any others (jose's `JWTPayload`). */
|
|
35603
|
+
interface JWTPayload {
|
|
35604
|
+
iss?: string;
|
|
35605
|
+
sub?: string;
|
|
35606
|
+
aud?: string | string[];
|
|
35607
|
+
jti?: string;
|
|
35608
|
+
nbf?: number;
|
|
35609
|
+
exp?: number;
|
|
35610
|
+
iat?: number;
|
|
35611
|
+
[propName: string]: unknown;
|
|
35612
|
+
}
|
|
35613
|
+
|
|
34821
35614
|
/**
|
|
34822
35615
|
* In-process JWKS cache for a single app's `/.well-known/jwks.json`.
|
|
34823
35616
|
*
|
|
@@ -35732,6 +36525,7 @@ type __UserSignupEvent = UserSignupEvent;
|
|
|
35732
36525
|
type __UserSuspendedEvent = UserSuspendedEvent;
|
|
35733
36526
|
type __UnknownWebhookEvent = UnknownWebhookEvent;
|
|
35734
36527
|
type __UnwrapWebhookEvent = UnwrapWebhookEvent;
|
|
36528
|
+
type __WebhookSignParams = WebhookSignParams;
|
|
35735
36529
|
type __WebhookUnwrapParams = WebhookUnwrapParams;
|
|
35736
36530
|
/**
|
|
35737
36531
|
* ProductCraft Auth API client (apps, end users, roles, sign-in flows, sessions, MFA and tenants). Every method is generated from the API's OpenAPI document.
|
|
@@ -36357,6 +37151,7 @@ declare namespace Auth {
|
|
|
36357
37151
|
type UserSuspendedEvent = __UserSuspendedEvent;
|
|
36358
37152
|
type UnknownWebhookEvent = __UnknownWebhookEvent;
|
|
36359
37153
|
type UnwrapWebhookEvent = __UnwrapWebhookEvent;
|
|
37154
|
+
type WebhookSignParams = __WebhookSignParams;
|
|
36360
37155
|
type WebhookUnwrapParams = __WebhookUnwrapParams;
|
|
36361
37156
|
}
|
|
36362
37157
|
|