diff --git a/.changeset/clean-typedoc-links.md b/.changeset/clean-typedoc-links.md new file mode 100644 index 00000000000..5b2e751d66b --- /dev/null +++ b/.changeset/clean-typedoc-links.md @@ -0,0 +1,6 @@ +--- +'@clerk/backend': patch +'@clerk/shared': patch +--- + +Improve generated API reference links, expose `BillingSubscriptionItemStatus`, and clarify the `createUser()` identification status documentation. diff --git a/.typedoc/custom-plugin.mjs b/.typedoc/custom-plugin.mjs index 3b56bb739de..bd7570adda0 100644 --- a/.typedoc/custom-plugin.mjs +++ b/.typedoc/custom-plugin.mjs @@ -87,11 +87,19 @@ const LINK_REPLACEMENTS = [ ['enterprise-account', '/docs/reference/backend/types/backend-enterprise-account'], ['enterprise-account-connection', '/docs/reference/backend/types/backend-enterprise-account-connection'], ['enterprise-connection', '/docs/reference/backend/types/backend-enterprise-connection'], + [ + 'enterprise-connection-custom-attribute', + '/docs/reference/backend/types/backend-enterprise-connection-custom-attribute', + ], ['enterprise-connection-oauth-config', '/docs/reference/backend/types/backend-enterprise-connection-oauth-config'], [ 'enterprise-connection-saml-connection', '/docs/reference/backend/types/backend-enterprise-connection-saml-connection', ], + [ + 'enterprise-connection-saml-connection-login-hint', + '/docs/reference/backend/types/backend-enterprise-connection-saml-connection-login-hint', + ], ['external-account', '/docs/reference/backend/types/backend-external-account'], ['phone-number', '/docs/reference/backend/types/backend-phone-number'], ['protect-check-resource', '/docs/reference/types/protect-check-resource'], @@ -114,9 +122,11 @@ const LINK_REPLACEMENTS = [ ['billing-per-unit-total-tier', '/docs/reference/types/billing-per-unit-total-tier'], ['billing-subscription-item-resource', '/docs/reference/types/billing-subscription-item-resource'], ['billing-subscription-item-seats', '/docs/reference/types/billing-subscription-item-seats'], + ['billing-subscription-item-status', '/docs/reference/backend/types/billing-subscription-item-status'], ['feature-resource', '/docs/reference/types/feature-resource'], ['billing-statement-group', '/docs/reference/types/billing-statement-group'], ['billing-statement-resource', '/docs/reference/types/billing-statement-resource'], + ['billing-totals', '/docs/reference/types/billing-totals'], ['billing-subscription-resource', '/docs/reference/types/billing-subscription-resource'], ['clerk-api-response-error', '/docs/reference/types/clerk-api-response-error'], ['clerk-api-error', '/docs/reference/types/clerk-api-error'], diff --git a/packages/backend/src/api/endpoints/UserApi.ts b/packages/backend/src/api/endpoints/UserApi.ts index eddcc8414f7..a5c80ac291d 100644 --- a/packages/backend/src/api/endpoints/UserApi.ts +++ b/packages/backend/src/api/endpoints/UserApi.ts @@ -233,13 +233,13 @@ export type UserPasswordHashingParams = { export type CreateUserParams = { /** The ID of the user as used in your external systems or your previous authentication solution. Must be unique across your instance. */ externalId?: string; - /** The email address(es) to assign to the user. Must be unique across your instance. The first email address will be set as the users primary email address. Created verified by default; see `emailAddressIdentificationStatus` to create them reserved. */ + /** The email addresses to assign to the user. Each address must be unique across your instance. The first email address becomes the user's primary email address. Addresses are created as verified by default; use `emailAddressIdentificationStatus` to create reserved addresses. */ emailAddress?: string[]; - /** Controls the status each email address is created with. Runs parallel to `emailAddress`: when provided, it must contain exactly one item per email address, applied by position. When omitted or empty, every email address is created `'verified'`. Set an item to `'reserved'` to create the corresponding email address reserved instead (unverified but usable for sign-in and locked so no other user can claim it). */ + /** Sets the creation status of each email address. Entries correspond by index to `emailAddress`, and the array must contain exactly one entry per email address. If omitted, every email address is created as `'verified'`. Use `'reserved'` to create an unverified address that can still be used for sign-in and cannot be claimed by another user. */ emailAddressIdentificationStatus?: ('verified' | 'reserved')[]; - /** The phone number(s) to assign to the user. Must be unique across your instance. The first phone number will be set as the users primary phone number. Created verified by default; see `phoneNumberIdentificationStatus` to create them reserved. */ + /** The phone numbers to assign to the user. Each number must be unique across your instance. The first phone number becomes the user's primary phone number. Numbers are created as verified by default; use `phoneNumberIdentificationStatus` to create reserved numbers. */ phoneNumber?: string[]; - /** Controls the status each phone number is created with. Runs parallel to `phoneNumber`: when provided, it must contain exactly one item per phone number, applied by position. When omitted or empty, every phone number is created `'verified'`. Set an item to `'reserved'` to create the corresponding phone number reserved instead (unverified but usable for sign-in and locked so no other user can claim it). */ + /** Sets the creation status of each phone number. Entries correspond by index to `phoneNumber`, and the array must contain exactly one entry per phone number. If omitted, every phone number is created as `'verified'`. Use `'reserved'` to create an unverified number that can still be used for sign-in and cannot be claimed by another user. */ phoneNumberIdentificationStatus?: ('verified' | 'reserved')[]; /** The username to assign to the user. Must be unique across your instance. */ username?: string; @@ -457,7 +457,7 @@ export class UserAPI extends AbstractAPI { * * Your settings in the [Clerk Dashboard](https://dashboard.clerk.com) determine how you should setup your user model. Anything **Required** will need to be provided when creating a user. Trying to add a field that isn't enabled will result in an error. * - * By default, any email address and phone number created using this method is automatically verified. Use `emailAddressIdentificationStatus` and `phoneNumberIdentificationStatus` to instead create some or all of them as reserved (unverified but usable for sign-in and locked so no other user can claim them). + * By default, email addresses and phone numbers created using this method are verified automatically. Use `emailAddressIdentificationStatus` and `phoneNumberIdentificationStatus` to create any of them as reserved. Reserved identifiers are unverified, but they can still be used for sign-in and cannot be claimed by another user. * * > [!CAUTION] * > diff --git a/packages/backend/src/api/resources/JSON.ts b/packages/backend/src/api/resources/JSON.ts index af24a858437..e1ff98e2ee1 100644 --- a/packages/backend/src/api/resources/JSON.ts +++ b/packages/backend/src/api/resources/JSON.ts @@ -1029,14 +1029,27 @@ export interface BillingPlanJSON extends ClerkResourceJSON { avatar_url: string | null; } -type BillingSubscriptionItemStatus = +/** + * The possible lifecycle states of a Backend `BillingSubscriptionItem`. + * + * @experimental This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to [pin](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + */ +export type BillingSubscriptionItemStatus = + /** The Subscription Item is in the abandoned state. */ | 'abandoned' + /** The Subscription Item is active. */ | 'active' + /** The Subscription Item is canceled. */ | 'canceled' + /** The Subscription Item has ended. */ | 'ended' + /** The Subscription Item has expired. */ | 'expired' + /** The Subscription Item is incomplete. */ | 'incomplete' + /** The Subscription Item has a past-due payment. */ | 'past_due' + /** The Subscription Item is upcoming. */ | 'upcoming'; /** diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts index b1a8bbd3a58..c418fcc3a0a 100644 --- a/packages/backend/src/index.ts +++ b/packages/backend/src/index.ts @@ -113,6 +113,7 @@ export type { BillingPlanJSON, BillingSubscriptionJSON, BillingSubscriptionItemJSON, + BillingSubscriptionItemStatus, } from './api/resources/JSON'; /** diff --git a/packages/shared/src/types/clerk.ts b/packages/shared/src/types/clerk.ts index bda31c9a930..1a5a42de11b 100644 --- a/packages/shared/src/types/clerk.ts +++ b/packages/shared/src/types/clerk.ts @@ -1445,7 +1445,7 @@ export type ClerkOptions = ClerkOptionsNavigation & */ supportEmail?: string; /** - * By default, the [Clerk Frontend API `touch` endpoint](https://clerk.com/docs/reference/frontend-api/tag/Sessions#operation/touchSession){{ target: '_blank' }} is called during page focus to keep the last active session alive. This option allows you to disable this behavior. + * By default, the [Clerk Frontend API `touch` endpoint](https://clerk.com/docs/reference/frontend-api/tag/sessions/POST/v1/client/sessions/%7Bsession_id%7D/touch){{ target: '_blank' }} is called during page focus to keep the last active session alive. This option allows you to disable this behavior. */ touchSession?: boolean; /**