From 6f2e172fe21ec41f1c7289165623937e80ce69d7 Mon Sep 17 00:00:00 2001 From: Sarah Soutoul Date: Tue, 29 Sep 2026 12:11:06 -0600 Subject: [PATCH 1/4] docs: document SSO bypass allowlist resource --- .changeset/document-sso-bypass-allowlist.md | 2 + .typedoc/custom-plugin.mjs | 1 + .typedoc/reference-objects.mjs | 4 ++ .../shared/src/types/ssoBypassAllowlist.ts | 39 +++++++++++++++---- 4 files changed, 39 insertions(+), 7 deletions(-) create mode 100644 .changeset/document-sso-bypass-allowlist.md diff --git a/.changeset/document-sso-bypass-allowlist.md b/.changeset/document-sso-bypass-allowlist.md new file mode 100644 index 00000000000..a845151cc84 --- /dev/null +++ b/.changeset/document-sso-bypass-allowlist.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/.typedoc/custom-plugin.mjs b/.typedoc/custom-plugin.mjs index 104be5a4a3b..74ea2fee966 100644 --- a/.typedoc/custom-plugin.mjs +++ b/.typedoc/custom-plugin.mjs @@ -72,6 +72,7 @@ const LINK_REPLACEMENTS = [ ['organization-membership-resource', '/docs/reference/types/organization-membership'], ['organization-suggestion-resource', '/docs/reference/types/organization-suggestion'], ['organization-resource', '/docs/reference/objects/organization'], + ['sso-bypass-allowlist-resource', '/docs/reference/types/sso-bypass-allowlist-resource'], ['organization-domain-resource', '/docs/reference/types/organization-domain-resource'], ['organization-invitation-resource', '/docs/reference/types/organization-invitation'], ['organization-membership-request-resource', '/docs/reference/types/organization-membership-request'], diff --git a/.typedoc/reference-objects.mjs b/.typedoc/reference-objects.mjs index d2e83e7e45d..6b14cc1056c 100644 --- a/.typedoc/reference-objects.mjs +++ b/.typedoc/reference-objects.mjs @@ -45,6 +45,10 @@ export const REFERENCE_OBJECT_CONFIG = { symbol: 'OrganizationResource', declarationHint: 'types/organization', }, + 'shared/sso-bypass-allowlist-resource/sso-bypass-allowlist-resource.mdx': { + symbol: 'SSOBypassAllowlistResource', + declarationHint: 'types/ssoBypassAllowlist', + }, 'shared/api-key-resource/api-key-resource.mdx': { symbol: 'APIKeyResource', declarationHint: 'types/apiKeys', diff --git a/packages/shared/src/types/ssoBypassAllowlist.ts b/packages/shared/src/types/ssoBypassAllowlist.ts index 26e908a6bec..2226a1638cc 100644 --- a/packages/shared/src/types/ssoBypassAllowlist.ts +++ b/packages/shared/src/types/ssoBypassAllowlist.ts @@ -22,10 +22,12 @@ export interface SSOBypassAllowlistUserResource { } export type AddSSOBypassAllowlistUserParams = { + /** The ID of the Organization member to add. */ userId: string; }; export type AddSSOBypassAllowlistUsersParams = { + /** The IDs of the Organization members to add. */ userIds: string[]; }; @@ -40,33 +42,56 @@ export interface SSOBypassAllowlistBulkCreateJSON { } export interface SSOBypassAllowlistBulkCreateError { + /** The ID of the member who could not be added. */ userId: string; + /** The error code explaining why the member could not be added. */ code: string; } export interface SSOBypassAllowlistBulkCreateResult { + /** The allowlist entries created successfully. */ data: SSOBypassAllowlistUserResource[]; + /** The members who could not be added, each with a user ID and error code. */ errors: SSOBypassAllowlistBulkCreateError[]; } +/** + * The `SSOBypassAllowlistResource` object manages which Organization members can sign in with an email code instead of + * using their enterprise single sign-on (SSO) connection. Access it through `organization.ssoBypassAllowlist` on the + * [`Organization` object](https://clerk.com/docs/reference/objects/organization#ssobypassallowlist). + * + * Managing the allowlist requires the `org:sys_entconns_sso_bypass:manage` [System Permission](https://clerk.com/docs/guides/organizations/control-access/roles-and-permissions#system-permissions). + * + * @interface + */ export interface SSOBypassAllowlistResource { /** - * Lists the members who may sign in with an email code when the organization's enterprise SSO is unavailable. - * Requires the `org:sys_entconns_sso_bypass:manage` permission. + * Lists the Organization members on the SSO bypass allowlist. + * + * @returns An array of `SSOBypassAllowlistUserResource` objects. */ getUsers: () => Promise; /** - * Adds a member to the allowlist. The member must hold a verified email address served by one of the - * organization's enterprise connections. + * Adds an Organization member to the allowlist. The member must have a verified email address on a domain served by + * one of the Organization's enterprise connections. + * + * @param params - An object with the `userId` of the Organization member to add. + * @returns The new `SSOBypassAllowlistUserResource` object. */ addUser: (params: AddSSOBypassAllowlistUserParams) => Promise; /** - * Adds several members to the allowlist, one request per 100 ids. Members who cannot be added are reported in - * `errors` with the same code `addUser` returns for them, and do not fail the batch. + * Adds Organization members to the allowlist in batches of 100. Members who cannot be added appear in `errors` with + * their `userId` and an error `code`; they do not prevent eligible members from being added to `data`. + * + * @param params - An object with the `userIds` of the Organization members to add. + * @returns An object with successfully added allowlist entries in `data` and rejected members in `errors`. */ addUsers: (params: AddSSOBypassAllowlistUsersParams) => Promise; /** - * Removes a member from the allowlist. + * Removes an Organization member from the allowlist. + * + * @param userId - The ID of the Organization member to remove. + * @returns A `DeletedObjectResource` object. */ removeUser: (userId: string) => Promise; } From 0c99d8562a4342d847b9bf54e27187152fed3b97 Mon Sep 17 00:00:00 2001 From: Sarah Soutoul Date: Tue, 29 Sep 2026 12:25:44 -0600 Subject: [PATCH 2/4] docs: generate SSO bypass resource as one type page --- .typedoc/reference-objects.mjs | 4 ---- packages/shared/src/types/ssoBypassAllowlist.ts | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.typedoc/reference-objects.mjs b/.typedoc/reference-objects.mjs index 6b14cc1056c..d2e83e7e45d 100644 --- a/.typedoc/reference-objects.mjs +++ b/.typedoc/reference-objects.mjs @@ -45,10 +45,6 @@ export const REFERENCE_OBJECT_CONFIG = { symbol: 'OrganizationResource', declarationHint: 'types/organization', }, - 'shared/sso-bypass-allowlist-resource/sso-bypass-allowlist-resource.mdx': { - symbol: 'SSOBypassAllowlistResource', - declarationHint: 'types/ssoBypassAllowlist', - }, 'shared/api-key-resource/api-key-resource.mdx': { symbol: 'APIKeyResource', declarationHint: 'types/apiKeys', diff --git a/packages/shared/src/types/ssoBypassAllowlist.ts b/packages/shared/src/types/ssoBypassAllowlist.ts index 2226a1638cc..441edc79c19 100644 --- a/packages/shared/src/types/ssoBypassAllowlist.ts +++ b/packages/shared/src/types/ssoBypassAllowlist.ts @@ -58,7 +58,7 @@ export interface SSOBypassAllowlistBulkCreateResult { /** * The `SSOBypassAllowlistResource` object manages which Organization members can sign in with an email code instead of * using their enterprise single sign-on (SSO) connection. Access it through `organization.ssoBypassAllowlist` on the - * [`Organization` object](https://clerk.com/docs/reference/objects/organization#ssobypassallowlist). + * [`Organization` object](https://clerk.com/docs/reference/objects/organization#properties). * * Managing the allowlist requires the `org:sys_entconns_sso_bypass:manage` [System Permission](https://clerk.com/docs/guides/organizations/control-access/roles-and-permissions#system-permissions). * From 6f850849e2f111dec90c1d0b7e950843ed3b33ed Mon Sep 17 00:00:00 2001 From: Sarah Soutoul Date: Tue, 29 Sep 2026 13:13:13 -0600 Subject: [PATCH 3/4] docs(typedoc): render SSO bypass allowlist methods inline --- .typedoc/__tests__/extract-methods.test.ts | 11 ++++++++ .typedoc/custom-router.mjs | 14 ++++++++--- .typedoc/extract-methods.mjs | 25 +++++++++++++------ .typedoc/reference-objects.mjs | 13 +++++++--- .../shared/src/types/ssoBypassAllowlist.ts | 2 +- 5 files changed, 50 insertions(+), 15 deletions(-) diff --git a/.typedoc/__tests__/extract-methods.test.ts b/.typedoc/__tests__/extract-methods.test.ts index 3d0b6fe0882..ed49002b401 100644 --- a/.typedoc/__tests__/extract-methods.test.ts +++ b/.typedoc/__tests__/extract-methods.test.ts @@ -83,6 +83,17 @@ describe('extract-methods snapshots', () => { await expect(content).toMatchFileSnapshot('./__snapshots__/user-api-methods-remove-password.mdx'); }); + it('SSO bypass methods render in one type page', async () => { + const content = await readGenerated('shared/sso-bypass-allowlist-resource.mdx'); + expect(content).toContain('[`Organization`](/docs/reference/objects/organization#properties) object'); + expect(content).toContain('## Methods'); + expect(content).not.toContain('## Properties'); + for (const method of ['addUser', 'addUsers', 'getUsers', 'removeUser']) { + expect(content).toContain(`### \`${method}()\``); + expect(content).toContain(`function ${method}(`); + } + }); + it('properties extracted + prettier-aligned: clerk', async () => { const content = await readGenerated('shared/clerk/properties.mdx'); await expect(content).toMatchFileSnapshot('./__snapshots__/clerk-properties.mdx'); diff --git a/.typedoc/custom-router.mjs b/.typedoc/custom-router.mjs index b56f1eb57e8..2c01f84221e 100644 --- a/.typedoc/custom-router.mjs +++ b/.typedoc/custom-router.mjs @@ -2,12 +2,17 @@ import { ReflectionKind } from 'typedoc'; import { MemberRouter } from 'typedoc-plugin-markdown'; -import { REFERENCE_OBJECT_PAGE_SYMBOLS } from './reference-objects.mjs'; +import { REFERENCE_OBJECT_CONFIG, REFERENCE_OBJECT_PAGE_SYMBOLS } from './reference-objects.mjs'; import { toUrlSlug } from './slug.mjs'; import { isInlineModifierWithoutStandalonePage } from './standalone-page-tag.mjs'; /** @type {Set} */ const REFERENCE_OBJECT_SYMBOL_NAMES = new Set(Object.values(REFERENCE_OBJECT_PAGE_SYMBOLS)); +const INLINE_METHOD_SYMBOL_NAMES = new Set( + Object.values(REFERENCE_OBJECT_CONFIG) + .filter(entry => 'inlineMethods' in entry && entry.inlineMethods) + .map(entry => entry.symbol), +); /** * From a filepath divided by `/` only keep the first and last part @@ -87,12 +92,13 @@ class ClerkRouter extends MemberRouter { filePath = flattenDirName(filePath); /** - * Put each reference object in its own folder alongside `properties.mdx` and `methods/` from `extract-methods.mjs`. - * E.g. `shared/clerk.mdx` -> `shared/clerk/clerk.mdx`, `shared/clerk/properties.mdx`, and `shared/clerk/methods/`. + * Put reference objects in folders alongside `properties.mdx` and `methods/` from `extract-methods.mjs`. + * Entries with `inlineMethods: true` keep the flat TypeDoc path and render methods in that file. */ if ( (reflection.kind === ReflectionKind.Interface || reflection.kind === ReflectionKind.Class) && - REFERENCE_OBJECT_SYMBOL_NAMES.has(reflection.name) + REFERENCE_OBJECT_SYMBOL_NAMES.has(reflection.name) && + !INLINE_METHOD_SYMBOL_NAMES.has(reflection.name) ) { const kebab = toUrlSlug(reflection.name); const m = filePath.match(/^([^/]+)\/([^/]+)$/); diff --git a/.typedoc/extract-methods.mjs b/.typedoc/extract-methods.mjs index d85f1e435ed..731c531c34d 100644 --- a/.typedoc/extract-methods.mjs +++ b/.typedoc/extract-methods.mjs @@ -1,10 +1,6 @@ // @ts-check /** - * TypeDoc plugin that runs during the markdown render pass. For each reference-object page listed in {@link REFERENCE_OBJECT_CONFIG} (e.g. `shared/clerk/clerk.mdx`), this listener: - * - * - copies the body of the page's `## Properties` section (table only, no heading) into a sibling `properties.mdx`, - * - mutates `output.contents` to drop the `## Properties` section from the main page, - * - writes one `methods/.mdx` per callable child on the reflection (and on any `extraMethodInterfaces`), alongside the main page in that resource folder. + * TypeDoc plugin that runs during the markdown render pass. For reference-object pages listed in {@link REFERENCE_OBJECT_CONFIG}, this listener normally moves the Properties table to `properties.mdx` and writes callable members to `methods/.mdx`. Entries with `inlineMethods: true` keep the methods under a `## Methods` heading in the main file. * * Must load **after** `custom-plugin.mjs` so its `MarkdownPageEvent.END` listener — which applies link replacements to `output.contents` — runs first. The Properties body we copy out is then already in its final, replaced form. * @@ -1407,6 +1403,7 @@ export function load(app) { return; } const entry = configEntryForPageUrl(pageUrl); + const inlineMethods = 'inlineMethods' in entry && entry.inlineMethods === true; const methodFormat = methodFormatForPageUrl(pageUrl); const decl = /** @type {import('typedoc').DeclarationReflection | undefined} */ (output.model); if (!decl?.children) { @@ -1448,9 +1445,23 @@ export function load(app) { fs.mkdirSync(objectDir, { recursive: true }); // `output.contents` is already prettier-formatted by typedoc-plugin-markdown's earlier - // pre-write job. Extract the Properties body from it (also formatted), write it out, - // then strip the section so the main page no longer ships it. + // pre-write job. Move the Properties body to a sibling file for reference objects, or + // keep it in the main file alongside methods for inline-method resources. const { propertiesBody, stripped } = splitPropertiesFromContents(output.contents ?? ''); + if (inlineMethods) { + const sections = [stripped.trimEnd()]; + const hasProperties = decl.children.some( + child => !shouldExtractCallableMember(child, ctx) && !hasExtractMethodsModifier(child), + ); + if (hasProperties && propertiesBody) { + sections.push(`## Properties\n\n${propertiesBody.trimEnd()}`); + } + if (methodFiles.length) { + sections.push('## Methods', ...methodFiles.map(({ content }) => content.trimEnd())); + } + output.contents = `${sections.filter(Boolean).join('\n\n')}\n`; + return; + } if (propertiesBody) { const propertiesPath = path.join(objectDir, 'properties.mdx'); fs.writeFileSync(propertiesPath, `${propertiesBody.trimEnd()}\n`, 'utf-8'); diff --git a/.typedoc/reference-objects.mjs b/.typedoc/reference-objects.mjs index d2e83e7e45d..6ef5a03fc0a 100644 --- a/.typedoc/reference-objects.mjs +++ b/.typedoc/reference-objects.mjs @@ -7,12 +7,14 @@ /** * Reference object page: MDX path → TypeDoc symbol + optional source hint. * - * Keys **must** match `custom-router.mjs` (`ClerkRouter`): for each symbol, `shared//.mdx` - * (e.g. `SessionResource` → `shared/session-resource/session-resource.mdx`). If the path drifts, TypeDoc writes one folder while `extract-methods.mjs` strips/writes under another. + * Keys **must** match `custom-router.mjs` (`ClerkRouter`): reference objects normally use + * `shared//.mdx` (e.g. `SessionResource` → + * `shared/session-resource/session-resource.mdx`). Entries with `inlineMethods: true` use a flat + * `shared/.mdx` file with their methods rendered in that file. * * `declarationHint` is a substring of `packages/shared/src/**` file paths (used by `findInterfaceOrClass()` in `extract-methods.mjs` when multiple reflections share the same interface/class name). * - * `extract-methods.mjs` reads each file, writes `properties.mdx` with the same Properties table as TypeDoc (no `## Properties` heading), strips Properties from `.mdx`, and writes methods under `methods/`. + * `extract-methods.mjs` writes `properties.mdx` and `methods/` snippets for foldered entries. For `inlineMethods` entries, it keeps properties and methods in the flat page. * * Optional **`extraMethodInterfaces`**: extra `interface` / `class` declarations whose callable members (and `@extractMethods` namespaces) are emitted into the same `methods/` folder. Use when the documented resource type and the API surface live on different types (e.g. `APIKeyResource` vs `APIKeysNamespace` on `Clerk.apiKeys`). */ @@ -45,6 +47,11 @@ export const REFERENCE_OBJECT_CONFIG = { symbol: 'OrganizationResource', declarationHint: 'types/organization', }, + 'shared/sso-bypass-allowlist-resource.mdx': { + symbol: 'SSOBypassAllowlistResource', + declarationHint: 'types/ssoBypassAllowlist', + inlineMethods: true, + }, 'shared/api-key-resource/api-key-resource.mdx': { symbol: 'APIKeyResource', declarationHint: 'types/apiKeys', diff --git a/packages/shared/src/types/ssoBypassAllowlist.ts b/packages/shared/src/types/ssoBypassAllowlist.ts index 441edc79c19..9caf5bbcb30 100644 --- a/packages/shared/src/types/ssoBypassAllowlist.ts +++ b/packages/shared/src/types/ssoBypassAllowlist.ts @@ -58,7 +58,7 @@ export interface SSOBypassAllowlistBulkCreateResult { /** * The `SSOBypassAllowlistResource` object manages which Organization members can sign in with an email code instead of * using their enterprise single sign-on (SSO) connection. Access it through `organization.ssoBypassAllowlist` on the - * [`Organization` object](https://clerk.com/docs/reference/objects/organization#properties). + * [`Organization`](https://clerk.com/docs/reference/objects/organization#properties) object. * * Managing the allowlist requires the `org:sys_entconns_sso_bypass:manage` [System Permission](https://clerk.com/docs/guides/organizations/control-access/roles-and-permissions#system-permissions). * From 7e05218ed7a3921c2cdce5747606a3ad2cc1f048 Mon Sep 17 00:00:00 2001 From: Sarah Soutoul Date: Tue, 29 Sep 2026 15:07:52 -0600 Subject: [PATCH 4/4] docs(typedoc): remove SSO bypass rendering override --- .typedoc/__tests__/extract-methods.test.ts | 11 ---------- .typedoc/custom-router.mjs | 14 ++++-------- .typedoc/extract-methods.mjs | 25 ++++++---------------- .typedoc/reference-objects.mjs | 13 +++-------- 4 files changed, 14 insertions(+), 49 deletions(-) diff --git a/.typedoc/__tests__/extract-methods.test.ts b/.typedoc/__tests__/extract-methods.test.ts index ed49002b401..3d0b6fe0882 100644 --- a/.typedoc/__tests__/extract-methods.test.ts +++ b/.typedoc/__tests__/extract-methods.test.ts @@ -83,17 +83,6 @@ describe('extract-methods snapshots', () => { await expect(content).toMatchFileSnapshot('./__snapshots__/user-api-methods-remove-password.mdx'); }); - it('SSO bypass methods render in one type page', async () => { - const content = await readGenerated('shared/sso-bypass-allowlist-resource.mdx'); - expect(content).toContain('[`Organization`](/docs/reference/objects/organization#properties) object'); - expect(content).toContain('## Methods'); - expect(content).not.toContain('## Properties'); - for (const method of ['addUser', 'addUsers', 'getUsers', 'removeUser']) { - expect(content).toContain(`### \`${method}()\``); - expect(content).toContain(`function ${method}(`); - } - }); - it('properties extracted + prettier-aligned: clerk', async () => { const content = await readGenerated('shared/clerk/properties.mdx'); await expect(content).toMatchFileSnapshot('./__snapshots__/clerk-properties.mdx'); diff --git a/.typedoc/custom-router.mjs b/.typedoc/custom-router.mjs index 2c01f84221e..b56f1eb57e8 100644 --- a/.typedoc/custom-router.mjs +++ b/.typedoc/custom-router.mjs @@ -2,17 +2,12 @@ import { ReflectionKind } from 'typedoc'; import { MemberRouter } from 'typedoc-plugin-markdown'; -import { REFERENCE_OBJECT_CONFIG, REFERENCE_OBJECT_PAGE_SYMBOLS } from './reference-objects.mjs'; +import { REFERENCE_OBJECT_PAGE_SYMBOLS } from './reference-objects.mjs'; import { toUrlSlug } from './slug.mjs'; import { isInlineModifierWithoutStandalonePage } from './standalone-page-tag.mjs'; /** @type {Set} */ const REFERENCE_OBJECT_SYMBOL_NAMES = new Set(Object.values(REFERENCE_OBJECT_PAGE_SYMBOLS)); -const INLINE_METHOD_SYMBOL_NAMES = new Set( - Object.values(REFERENCE_OBJECT_CONFIG) - .filter(entry => 'inlineMethods' in entry && entry.inlineMethods) - .map(entry => entry.symbol), -); /** * From a filepath divided by `/` only keep the first and last part @@ -92,13 +87,12 @@ class ClerkRouter extends MemberRouter { filePath = flattenDirName(filePath); /** - * Put reference objects in folders alongside `properties.mdx` and `methods/` from `extract-methods.mjs`. - * Entries with `inlineMethods: true` keep the flat TypeDoc path and render methods in that file. + * Put each reference object in its own folder alongside `properties.mdx` and `methods/` from `extract-methods.mjs`. + * E.g. `shared/clerk.mdx` -> `shared/clerk/clerk.mdx`, `shared/clerk/properties.mdx`, and `shared/clerk/methods/`. */ if ( (reflection.kind === ReflectionKind.Interface || reflection.kind === ReflectionKind.Class) && - REFERENCE_OBJECT_SYMBOL_NAMES.has(reflection.name) && - !INLINE_METHOD_SYMBOL_NAMES.has(reflection.name) + REFERENCE_OBJECT_SYMBOL_NAMES.has(reflection.name) ) { const kebab = toUrlSlug(reflection.name); const m = filePath.match(/^([^/]+)\/([^/]+)$/); diff --git a/.typedoc/extract-methods.mjs b/.typedoc/extract-methods.mjs index 731c531c34d..d85f1e435ed 100644 --- a/.typedoc/extract-methods.mjs +++ b/.typedoc/extract-methods.mjs @@ -1,6 +1,10 @@ // @ts-check /** - * TypeDoc plugin that runs during the markdown render pass. For reference-object pages listed in {@link REFERENCE_OBJECT_CONFIG}, this listener normally moves the Properties table to `properties.mdx` and writes callable members to `methods/.mdx`. Entries with `inlineMethods: true` keep the methods under a `## Methods` heading in the main file. + * TypeDoc plugin that runs during the markdown render pass. For each reference-object page listed in {@link REFERENCE_OBJECT_CONFIG} (e.g. `shared/clerk/clerk.mdx`), this listener: + * + * - copies the body of the page's `## Properties` section (table only, no heading) into a sibling `properties.mdx`, + * - mutates `output.contents` to drop the `## Properties` section from the main page, + * - writes one `methods/.mdx` per callable child on the reflection (and on any `extraMethodInterfaces`), alongside the main page in that resource folder. * * Must load **after** `custom-plugin.mjs` so its `MarkdownPageEvent.END` listener — which applies link replacements to `output.contents` — runs first. The Properties body we copy out is then already in its final, replaced form. * @@ -1403,7 +1407,6 @@ export function load(app) { return; } const entry = configEntryForPageUrl(pageUrl); - const inlineMethods = 'inlineMethods' in entry && entry.inlineMethods === true; const methodFormat = methodFormatForPageUrl(pageUrl); const decl = /** @type {import('typedoc').DeclarationReflection | undefined} */ (output.model); if (!decl?.children) { @@ -1445,23 +1448,9 @@ export function load(app) { fs.mkdirSync(objectDir, { recursive: true }); // `output.contents` is already prettier-formatted by typedoc-plugin-markdown's earlier - // pre-write job. Move the Properties body to a sibling file for reference objects, or - // keep it in the main file alongside methods for inline-method resources. + // pre-write job. Extract the Properties body from it (also formatted), write it out, + // then strip the section so the main page no longer ships it. const { propertiesBody, stripped } = splitPropertiesFromContents(output.contents ?? ''); - if (inlineMethods) { - const sections = [stripped.trimEnd()]; - const hasProperties = decl.children.some( - child => !shouldExtractCallableMember(child, ctx) && !hasExtractMethodsModifier(child), - ); - if (hasProperties && propertiesBody) { - sections.push(`## Properties\n\n${propertiesBody.trimEnd()}`); - } - if (methodFiles.length) { - sections.push('## Methods', ...methodFiles.map(({ content }) => content.trimEnd())); - } - output.contents = `${sections.filter(Boolean).join('\n\n')}\n`; - return; - } if (propertiesBody) { const propertiesPath = path.join(objectDir, 'properties.mdx'); fs.writeFileSync(propertiesPath, `${propertiesBody.trimEnd()}\n`, 'utf-8'); diff --git a/.typedoc/reference-objects.mjs b/.typedoc/reference-objects.mjs index 6ef5a03fc0a..d2e83e7e45d 100644 --- a/.typedoc/reference-objects.mjs +++ b/.typedoc/reference-objects.mjs @@ -7,14 +7,12 @@ /** * Reference object page: MDX path → TypeDoc symbol + optional source hint. * - * Keys **must** match `custom-router.mjs` (`ClerkRouter`): reference objects normally use - * `shared//.mdx` (e.g. `SessionResource` → - * `shared/session-resource/session-resource.mdx`). Entries with `inlineMethods: true` use a flat - * `shared/.mdx` file with their methods rendered in that file. + * Keys **must** match `custom-router.mjs` (`ClerkRouter`): for each symbol, `shared//.mdx` + * (e.g. `SessionResource` → `shared/session-resource/session-resource.mdx`). If the path drifts, TypeDoc writes one folder while `extract-methods.mjs` strips/writes under another. * * `declarationHint` is a substring of `packages/shared/src/**` file paths (used by `findInterfaceOrClass()` in `extract-methods.mjs` when multiple reflections share the same interface/class name). * - * `extract-methods.mjs` writes `properties.mdx` and `methods/` snippets for foldered entries. For `inlineMethods` entries, it keeps properties and methods in the flat page. + * `extract-methods.mjs` reads each file, writes `properties.mdx` with the same Properties table as TypeDoc (no `## Properties` heading), strips Properties from `.mdx`, and writes methods under `methods/`. * * Optional **`extraMethodInterfaces`**: extra `interface` / `class` declarations whose callable members (and `@extractMethods` namespaces) are emitted into the same `methods/` folder. Use when the documented resource type and the API surface live on different types (e.g. `APIKeyResource` vs `APIKeysNamespace` on `Clerk.apiKeys`). */ @@ -47,11 +45,6 @@ export const REFERENCE_OBJECT_CONFIG = { symbol: 'OrganizationResource', declarationHint: 'types/organization', }, - 'shared/sso-bypass-allowlist-resource.mdx': { - symbol: 'SSOBypassAllowlistResource', - declarationHint: 'types/ssoBypassAllowlist', - inlineMethods: true, - }, 'shared/api-key-resource/api-key-resource.mdx': { symbol: 'APIKeyResource', declarationHint: 'types/apiKeys',