Skip to content

Commit

Permalink
Remove format from api-route page, use capitalized format only
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-balitskyi committed Aug 27, 2024
1 parent 441b4de commit 470613d
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 52 deletions.
54 changes: 18 additions & 36 deletions docs/api/acs/systems/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,116 +4,103 @@ Represents an [access control system](../../../capability-guides/access-systems.

### `acs_system_id`

Type: `string`\
Format: `id`
Format: `Id`

ID of the `acs_system`.

---

### `can_add_acs_users_to_acs_access_groups`

Type: `Boolean`\
Format: `boolean`
Format: `Boolean`

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`

Type: `Boolean`\
Format: `boolean`
Format: `Boolean`

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`

Type: `Boolean`\
Format: `boolean`
Format: `Boolean`

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`

Type: `Boolean`\
Format: `boolean`
Format: `Boolean`

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`

Type: `array`\
Format: `list`
Format: `List`

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

---

### `created_at`

Type: `string`\
Format: `datetime`
Format: `Datetime`

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

---

### `errors`

Type: `array`\
Format: `list`
Format: `List`

Errors associated with the `acs_system`.

---

### `external_type`

Type: `string`\
Format: `enum`
Format: `Enum`

Brand-specific terminology for the `acs_system` type.

---

### `external_type_display_name`

Type: `string`\
Format: `string`
Format: `String`

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

---

### `image_alt_text`

Type: `string`\
Format: `string`
Format: `String`

Alternative text for the `acs_system` image.

---

### `image_url`

Type: `string`\
Format: `string`
Format: `String`

URL for the image that represents the `acs_system`.

---

### `name`

Type: `string`\
Format: `string`
Format: `String`

Name of the `acs_system`.

Expand All @@ -125,8 +112,7 @@ Name of the `acs_system`.
**Deprecated**. Use `external_type`.
{% endhint %}

Type: `string`\
Format: `enum`
Format: `Enum`

---

Expand All @@ -136,31 +122,27 @@ Format: `enum`
**Deprecated**. Use `external_type_display_name`.
{% endhint %}

Type: `string`\
Format: `string`
Format: `String`

---

### `visionline_metadata`

Type: `object`\
Format: `record`
Format: `Record`

---

### `warnings`

Type: `array`\
Format: `list`
Format: `List`

Warnings associated with the `acs_system`.

---

### `workspace_id`

Type: `string`\
Format: `id`
Format: `Id`

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

Expand Down
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@metalsmith/layouts": "^2.7.0",
"@metalsmith/metadata": "^0.3.0",
"@seamapi/blueprint": "^0.14.2",
"change-case": "^5.4.4",
"jstransformer-handlebars": "^1.2.0",
"metalsmith": "^2.6.3"
},
Expand Down
1 change: 0 additions & 1 deletion src/layouts/api-route.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
{% endhint %}
{{/if}}

Type: `{{jsonType}}`\
Format: `{{format}}`
{{#if description}}

Expand Down
19 changes: 4 additions & 15 deletions src/lib/template-context.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Blueprint, Endpoint, Property, Route } from '@seamapi/blueprint'
import { pascalCase } from 'change-case'

export interface EndpointTemplateContext {
description: string
Expand Down Expand Up @@ -74,8 +75,8 @@ export function setEndpointTemplateContext(

type ContextResourceProperty = Pick<
Property,
'name' | 'description' | 'format' | 'isDeprecated' | 'deprecationMessage'
> & { jsonType: string }
'name' | 'description' | 'isDeprecated' | 'deprecationMessage'
> & { format: string }
interface ContextResource {
name: string
description: string
Expand Down Expand Up @@ -132,16 +133,14 @@ export function setApiRouteTemplateContext(
properties: resource.properties.map(
({
name,
jsonType,
description,
format,
isDeprecated,
deprecationMessage,
}) => ({
name,
jsonType: formatPropertyTypeForDocs(jsonType),
description,
format,
format: pascalCase(format),
isDeprecated,
deprecationMessage,
}),
Expand All @@ -150,13 +149,3 @@ export function setApiRouteTemplateContext(
}
}
}

type PropertyType = Property['jsonType']

const formatPropertyTypeForDocs = (type: PropertyType): string => {
const typeMap: Partial<Record<PropertyType, string>> = {
boolean: 'Boolean',
}

return typeMap[type] ?? type
}

0 comments on commit 470613d

Please sign in to comment.