diff --git a/docs/api/acs/systems/README.md b/docs/api/acs/systems/README.md new file mode 100644 index 00000000..1d02aed4 --- /dev/null +++ b/docs/api/acs/systems/README.md @@ -0,0 +1,224 @@ +
+

acs_system

+
+ +
+ +
+

acs_system_id

+
+
+

ID of the `acs_system`.

+
+ Format: + string +
+
+ +
+
+

can_add_acs_users_to_acs_access_groups

+
+
+

Indicates whether the `acs_system` supports [adding users to access groups](../../../capability-guides/access-systems/assigning-users-to-access-groups#add-an-acs-user-to-an-access-group.md). See also [Access Group-based Access Control Systems](../../../capability-guides/access-systems/understanding-access-control-system-differences#access-group-based-access-control-systems.md).

+
+ Format: + boolean +
+
+ +
+
+

can_automate_enrollment

+
+
+

Indicates whether it is possible to [launch enrollment automations](../../../capability-guides/mobile-access-in-development/issuing-mobile-credentials-from-an-access-control-system#prepare-the-phones-for-a-user-identity-to-start-receiving-mobile-credentials-using-an-enrollment-aut.md) for the `acs_system`.

+
+ Format: + boolean +
+
+ +
+
+

can_create_acs_access_groups

+
+
+

Indicates whether the `acs_system` supports creating [access groups](../../../capability-guides/access-systems/assigning-users-to-access-groups.md). See also [Access Group-based Access Control Systems](../../../capability-guides/access-systems/understanding-access-control-system-differences#access-group-based-access-control-systems.md).

+
+ Format: + boolean +
+
+ +
+
+

can_remove_acs_users_from_acs_access_groups

+
+
+

Indicates whether the `acs_system` supports [removing users from access groups](../../../capability-guides/access-systems/assigning-users-to-access-groups#remove-an-acs-user-from-an-access-group.md). See also [Access Group-based Access Control Systems](../../../capability-guides/access-systems/understanding-access-control-system-differences#access-group-based-access-control-systems.md).

+
+ Format: + boolean +
+
+ +
+
+

connected_account_ids

+
+
+

IDs of the [connected accounts](../../../core-concepts/connected-accounts.md) associated with the `acs_system`.

+
+ Format: + list +
+
+ +
+
+

created_at

+
+
+

Date and time at which the `acs_system` was created.

+
+ Format: + string +
+
+ +
+
+

errors

+
+
+

Errors associated with the `acs_system`.

+
+ Format: + list +
+
+ +
+
+

external_type

+
+
+

Brand-specific terminology for the `acs_system` type.

+
+ Format: + enum +
+
+ +
+
+

external_type_display_name

+
+
+

Display name that corresponds to the brand-specific terminology for the `acs_system` type.

+
+ Format: + string +
+
+ +
+
+

image_alt_text

+
+
+

Alternative text for the `acs_system` image.

+
+ Format: + string +
+
+ +
+
+

image_url

+
+
+

URL for the image that represents the `acs_system`.

+
+ Format: + string +
+
+ +
+
+

name

+
+
+

Name of the `acs_system`.

+
+ Format: + string +
+
+ +
+
+

system_type

+
+
+

+
+ Format: + enum +
+

This property is deprecated.

+
+ +
+
+

system_type_display_name

+
+
+

+
+ Format: + string +
+

This property is deprecated.

+
+ +
+
+

visionline_metadata

+
+
+

+
+ Format: + record +
+
+ +
+
+

warnings

+
+
+

+
+ Format: + list +
+
+ +
+
+

workspace_id

+
+
+

ID of the [workspace](../../../core-concepts/workspaces.md) that contains the `acs_system`.

+
+ Format: + string +
+
+ +
diff --git a/docs/api/acs/systems/get.md b/docs/api/acs/systems/get.md new file mode 100644 index 00000000..bb008ca3 --- /dev/null +++ b/docs/api/acs/systems/get.md @@ -0,0 +1,25 @@ +# + + + + +### Request Parameters + +**acs_system_id** +*Type:* `` +*Required:* Yes + + + +### Response Properties + + +## Samples + +{% tabs %} + {% tab title="No samples available" %} + ``` + No sample requests available. + ``` + {% endtab %} +{% endtabs %} diff --git a/docs/api/acs/systems/list.md b/docs/api/acs/systems/list.md index cd291245..7424701b 100644 --- a/docs/api/acs/systems/list.md +++ b/docs/api/acs/systems/list.md @@ -9,50 +9,14 @@ response includes all access control systems connected to your workspace. ### Request Parameters -**connected_account_id** -*Type:* `` -*Required:* No +**connected_account_id** +*Type:* `` +*Required:* No -ID of the connected account by which to filter the list of returned access control systems. +ID of the connected account by which to filter the list of returned access control systems. ### Response Properties -**acs_system_id** -ID of the `acs_system`. -**can_add_acs_users_to_acs_access_groups** -Indicates whether the `acs_system` supports [adding users to access groups](../../../capability-guides/access-systems/assigning-users-to-access-groups#add-an-acs-user-to-an-access-group.md). See also [Access Group-based Access Control Systems](../../../capability-guides/access-systems/understanding-access-control-system-differences#access-group-based-access-control-systems.md). -**can_automate_enrollment** -Indicates whether it is possible to [launch enrollment automations](../../../capability-guides/mobile-access-in-development/issuing-mobile-credentials-from-an-access-control-system#prepare-the-phones-for-a-user-identity-to-start-receiving-mobile-credentials-using-an-enrollment-aut.md) for the `acs_system`. -**can_create_acs_access_groups** -Indicates whether the `acs_system` supports creating [access groups](../../../capability-guides/access-systems/assigning-users-to-access-groups.md). See also [Access Group-based Access Control Systems](../../../capability-guides/access-systems/understanding-access-control-system-differences#access-group-based-access-control-systems.md). -**can_remove_acs_users_from_acs_access_groups** -Indicates whether the `acs_system` supports [removing users from access groups](../../../capability-guides/access-systems/assigning-users-to-access-groups#remove-an-acs-user-from-an-access-group.md). See also [Access Group-based Access Control Systems](../../../capability-guides/access-systems/understanding-access-control-system-differences#access-group-based-access-control-systems.md). -**connected_account_ids** -IDs of the [connected accounts](../../../core-concepts/connected-accounts.md) associated with the `acs_system`. -**created_at** -Date and time at which the `acs_system` was created. -**errors** -Errors associated with the `acs_system`. -**external_type** -Brand-specific terminology for the `acs_system` type. -**external_type_display_name** -Display name that corresponds to the brand-specific terminology for the `acs_system` type. -**image_alt_text** -Alternative text for the `acs_system` image. -**image_url** -URL for the image that represents the `acs_system`. -**name** -Name of the `acs_system`. -**system_type** - -**system_type_display_name** - -**visionline_metadata** - -**warnings** - -**workspace_id** -ID of the [workspace](../../../core-concepts/workspaces.md) that contains the `acs_system`. ## Samples @@ -76,7 +40,19 @@ ID of the [workspace](../../../core-concepts/workspaces.md) that contains the `a ### Response ```python - AcsSystems(0={"acs_system_id":"8d7e0b3a-b889-49a7-9164-4b71a0506a33"}) + [AcsSystem(acs_system_id="8d7e0b3a-b889-49a7-9164-4b71a0506a33")] + ``` + {% endtab %} + {% tab title="Ruby" %} + ### Request + ```ruby + seam.acs.systems.list(connected_account_id: "8d7e0b3a-b889-49a7-9164-4b71a0506a33") + ``` + + ### Response + ```ruby + [] ``` {% endtab %} {% tab title="PHP" %} diff --git a/docs/api/acs/systems/list_compatible_credential_manager_acs_systems.md b/docs/api/acs/systems/list_compatible_credential_manager_acs_systems.md new file mode 100644 index 00000000..bb008ca3 --- /dev/null +++ b/docs/api/acs/systems/list_compatible_credential_manager_acs_systems.md @@ -0,0 +1,25 @@ +# + + + + +### Request Parameters + +**acs_system_id** +*Type:* `` +*Required:* Yes + + + +### Response Properties + + +## Samples + +{% tabs %} + {% tab title="No samples available" %} + ``` + No sample requests available. + ``` + {% endtab %} +{% endtabs %} diff --git a/docs/sdk/javascript/acs/systems/get.md b/docs/sdk/javascript/acs/systems/get.md new file mode 100644 index 00000000..2c2a87cb --- /dev/null +++ b/docs/sdk/javascript/acs/systems/get.md @@ -0,0 +1,3 @@ +# + + diff --git a/docs/sdk/javascript/acs/systems/list_compatible_credential_manager_acs_systems.md b/docs/sdk/javascript/acs/systems/list_compatible_credential_manager_acs_systems.md new file mode 100644 index 00000000..2c2a87cb --- /dev/null +++ b/docs/sdk/javascript/acs/systems/list_compatible_credential_manager_acs_systems.md @@ -0,0 +1,3 @@ +# + + diff --git a/package-lock.json b/package-lock.json index 30fcf38c..f0e31c5e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@metalsmith/layouts": "^2.7.0", "@metalsmith/metadata": "^0.3.0", - "@seamapi/blueprint": "^0.8.3", + "@seamapi/blueprint": "^0.11.3", "jstransformer-handlebars": "^1.2.0", "metalsmith": "^2.6.3" }, @@ -611,9 +611,10 @@ } }, "node_modules/@seamapi/blueprint": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/@seamapi/blueprint/-/blueprint-0.8.3.tgz", - "integrity": "sha512-QJwZACtvStdXKUoeSk/MpLtDlxBuoXxuMA2SFlMcdFhm0P1mQMMJbv1JnY+xZLEUZOcH5k3oXBdxKvHGSP+fQQ==", + "version": "0.11.3", + "resolved": "https://registry.npmjs.org/@seamapi/blueprint/-/blueprint-0.11.3.tgz", + "integrity": "sha512-4iPyuy1GQ5wT0CokP3hnAHqGmSPaEPmsCgZX2ksslwW7wGmZMGjTz44L9uKbMFvmTuGw28v6qOXfksFQbarARw==", + "license": "MIT", "dependencies": { "change-case": "^5.4.4", "zod": "^3.23.8" diff --git a/package.json b/package.json index e2c5d4c6..c5072faa 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "dependencies": { "@metalsmith/layouts": "^2.7.0", "@metalsmith/metadata": "^0.3.0", - "@seamapi/blueprint": "^0.8.3", + "@seamapi/blueprint": "^0.11.3", "jstransformer-handlebars": "^1.2.0", "metalsmith": "^2.6.3" }, diff --git a/src/layouts/api-reference.hbs b/src/layouts/api-reference.hbs index 3622d989..13c9bd72 100644 --- a/src/layouts/api-reference.hbs +++ b/src/layouts/api-reference.hbs @@ -6,18 +6,18 @@ ### Request Parameters {{#each request.parameters}} -**{{this.name}}** -*Type:* `{{this.type}}` -*Required:* {{#if this.required}}Yes{{else}}No{{/if}} +**{{this.name}}** +*Type:* `{{this.type}}` +*Required:* {{#if this.required}}Yes{{else}}No{{/if}} -{{this.description}} +{{this.description}} {{/each}} ### Response Properties {{#each response.properties}} -**{{this.name}}** -{{this.description}} +**{{this.name}}** +{{this.description}} {{/each}} ## Samples diff --git a/src/layouts/api-resource.hbs b/src/layouts/api-resource.hbs new file mode 100644 index 00000000..c0f7174c --- /dev/null +++ b/src/layouts/api-resource.hbs @@ -0,0 +1,27 @@ +{{#each resources}} +
+

{{name}}

+
+ +
+ +{{#each properties}} +
+

{{name}}

+
+
+

{{description}}

+ {{#if format}} +
+ Format: + {{format}} +
+ {{/if}} + {{#if isDeprecated}} +

This property is deprecated.

+ {{/if}} +
+ +
+{{/each}} +{{/each}} diff --git a/src/lib/reference.ts b/src/lib/reference.ts index 7985bbc6..1b083e45 100644 --- a/src/lib/reference.ts +++ b/src/lib/reference.ts @@ -3,6 +3,8 @@ import type Metalsmith from 'metalsmith' import { type EndpointTemplateContext, + type ResourceTemplateContext, + setApiResourceTemplateContext, setEndpointTemplateContext, } from './template-context.js' @@ -12,7 +14,8 @@ const baseUrl = 'https://docs.seam.co/latest/' type Metadata = Partial> -type File = EndpointTemplateContext & { layout: string } +type File = EndpointTemplateContext & + ResourceTemplateContext & { layout: string } export const reference = ( files: Metalsmith.Files, @@ -26,6 +29,14 @@ export const reference = ( } for (const route of metadata.routes ?? []) { + const k = `api${route.path}/README.md` + files[k] = { + contents: Buffer.from('\n'), + } + const file = files[k] as unknown as File + file.layout = 'api-resource.hbs' + setApiResourceTemplateContext(file, route, metadata) + for (const endpoint of route.endpoints) { const k = `api${endpoint.path}.md` files[k] = { @@ -33,7 +44,7 @@ export const reference = ( } const file = files[k] as unknown as File file.layout = 'api-reference.hbs' - setEndpointTemplateContext(file, endpoint, metadata) + setEndpointTemplateContext(file, endpoint) for (const sdk of sdks) { const k = `sdk/${sdk}${endpoint.path}.md` @@ -42,7 +53,7 @@ export const reference = ( } const file = files[k] as unknown as File file.layout = 'sdk-reference.hbs' - setEndpointTemplateContext(file, endpoint, metadata) + setEndpointTemplateContext(file, endpoint) } } } diff --git a/src/lib/template-context.ts b/src/lib/template-context.ts index 9b01a786..46f630eb 100644 --- a/src/lib/template-context.ts +++ b/src/lib/template-context.ts @@ -1,9 +1,38 @@ -import type { Blueprint, Endpoint } from '@seamapi/blueprint' +import type { Blueprint, Endpoint, Route } from '@seamapi/blueprint' + +export interface EndpointTemplateContext { + description: string + title: string + path: string + request: { + preferredMethod: string + parameters: Array<{ + name: string + required: boolean + description: string + }> + } + response: { + description: string + resourceType: string | null + } + codeSamples: Array<{ + title: string + description: string + code: Record< + string, + { + title: string + request: string + response: string + } + > + }> +} export function setEndpointTemplateContext( file: Partial, endpoint: Endpoint, - blueprint: Blueprint, ): void { file.description = endpoint.description file.title = endpoint.title @@ -20,19 +49,12 @@ export function setEndpointTemplateContext( file.response = { description: endpoint.response.description, - properties: null, resourceType: null, } if (endpoint.response.responseType !== 'void') { const { resourceType } = endpoint.response file.response.resourceType = resourceType - const resource = blueprint.resources[resourceType] - file.response.properties = - resource?.properties.map((property) => ({ - name: property.name, - description: property.description, - })) ?? null } file.codeSamples = endpoint.codeSamples.map((sample) => ({ @@ -42,36 +64,60 @@ export function setEndpointTemplateContext( })) } -export interface EndpointTemplateContext { - description: string - title: string - path: string - request: { - preferredMethod: string - parameters: Array<{ - name: string - required: boolean - description: string - }> - } - response: { - description: string - resourceType: string | null - properties: null | Array<{ - name: string - description: string - }> - } - codeSamples: Array<{ - title: string +interface Resource { + name: string + properties: Array<{ + name: string + type: string description: string - code: Record< - string, - { - title: string - request: string - response: string - } - > + format: string + isDeprecated: boolean }> } +export interface ResourceTemplateContext { + resources: Resource[] +} + +export function setApiResourceTemplateContext( + file: Partial, + route: Route, + blueprint: Blueprint, +): void { + file.resources = [] + + const endpointsWithResourceType = route.endpoints.filter( + (e) => + e.response.responseType === 'resource' || + e.response.responseType === 'resource_list', + ) + + for (const endpoint of endpointsWithResourceType) { + if (!('resourceType' in endpoint.response)) { + // eslint-disable-next-line no-console + console.warn(`No resourceType in ${endpoint.path} endpoint response`) + return + } + + const resourceName = endpoint.response.resourceType + const resource = blueprint.resources[resourceName] + + if (resource == null) { + // eslint-disable-next-line no-console + console.warn(`No resource ${resourceName} in blueprint`) + return + } + + file.resources.push({ + name: resourceName, + properties: resource.properties.map( + ({ name, jsonType, description, format, isDeprecated }) => ({ + name, + type: jsonType, + description, + format, + isDeprecated, + }), + ), + }) + } +}