-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate namespace pages #439
Merged
Merged
Changes from 18 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
eaa053f
Add api-namespace layout
andrii-balitskyi 0e4639a
Add handlebars helpers
andrii-balitskyi 8d1294d
Introduce setNamespaceLayoutContext
andrii-balitskyi f910c04
Remove not helper
andrii-balitskyi 3ab2b0c
ci: Generate docs
seambot 158cc2d
Compute namespace resources
andrii-balitskyi 270a06d
Update template, remove toNoCase helper
andrii-balitskyi 4036c16
ci: Generate docs
seambot b318b39
Make setNamespaceLayoutContext to be responsible only for setting con…
andrii-balitskyi 578e853
Report untitled namespaces
andrii-balitskyi 1fc4f59
Update src/layouts/api-namespace.hbs
andrii-balitskyi bff636f
Update src/layouts/api-namespace.hbs
andrii-balitskyi f8140d4
ci: Generate docs
seambot 8cc189b
Update paths.yaml
razor-x 9fadb1e
ci: Generate docs
seambot 02d4b27
Merge branch 'main' of github.com:seamapi/docs into api-namespace-page
andrii-balitskyi 76aece0
ci: Generate docs
seambot f5921a5
Replace api-clients/acs links with api/acs
andrii-balitskyi def5b59
Revert .gitbook.yaml
andrii-balitskyi c3dbdf0
Add resource link
andrii-balitskyi 88c3c5f
ci: Generate docs
seambot 8a1ade2
Improve readability of src/lib/layout/api-namespace.ts
andrii-balitskyi bc0ce73
Update src/lib/reference.ts
andrii-balitskyi ed4ae44
ci: Format code
seambot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,25 @@ | ||||||
--- | ||||||
andrii-balitskyi marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
description: Systems for managing and monitoring access to physical spaces | ||||||
--- | ||||||
|
||||||
# Access Control Systems | ||||||
|
||||||
## Resources | ||||||
|
||||||
### `acs_system` | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to add the links, I think this would be correct.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let me know if I correctly compute the link using |
||||||
Represents an [access control system](https://docs.seam.co/latest/capability-guides/access-systems). | ||||||
|
||||||
### `acs_user` | ||||||
|
||||||
|
||||||
### `acs_entrance` | ||||||
Represents an [entrance](../../capability-guides/access-systems/retrieving-entrance-details.md) within an [access control system](https://docs.seam.co/latest/capability-guides/access-systems). | ||||||
|
||||||
### `acs_access_group` | ||||||
Group that defines the entrances to which a set of users has access and, in some cases, the access schedule for these entrances and users. | ||||||
The `acs_access_group` object represents an [access group](https://docs.seam.co/latest/capability-guides/access-systems/assigning-users-to-access-groups) within an [access control system](https://docs.seam.co/latest/capability-guides/access-systems). | ||||||
|
||||||
### `acs_credential` | ||||||
Means by which a user gains access at an entrance. | ||||||
The `acs_credential` object represents a credential that provides an ACS user access within an access control system. For each acs_credential object, you define the access method. You can also specify additional properties, such as a code. | ||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Users | ||
# ACS Users | ||
|
||
## `acs_user` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
description: {{description}} | ||
--- | ||
|
||
# {{title}} | ||
|
||
## Resources | ||
|
||
{{#each resources}} | ||
### `{{name}}` | ||
{{description}} | ||
|
||
{{/each}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import type { Blueprint } from '@seamapi/blueprint' | ||
|
||
import type { PathMetadata } from 'lib/path-metadata.js' | ||
|
||
export interface ApiNamespaceLayoutContext { | ||
title: string | ||
description: string | ||
resources: Array<{ name: string; description: string }> | ||
} | ||
|
||
export function setNamespaceLayoutContext( | ||
file: ApiNamespaceLayoutContext, | ||
namespace: string, | ||
resources: Blueprint['resources'], | ||
pathMetadata: PathMetadata, | ||
): void { | ||
const namespaceMetadata = pathMetadata[namespace] | ||
if (namespaceMetadata == null) { | ||
throw new Error(`Namespace metadata for ${namespace} not found`) | ||
} | ||
|
||
file.title = namespaceMetadata.title | ||
file.description = namespaceMetadata.description ?? '' | ||
|
||
const namespaceResources = Object.entries(pathMetadata) | ||
.filter(([p]) => p.startsWith(namespace)) | ||
.flatMap(([_, metadata]) => metadata.resources) | ||
file.resources = namespaceResources.map((resourceName) => { | ||
const resource = resources[resourceName] | ||
|
||
if (resource == null) { | ||
throw new Error(`Resource ${resourceName} not found in blueprint`) | ||
} | ||
|
||
return { | ||
name: resourceName, | ||
description: resource.description, | ||
} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './api-endpoint.js' | ||
export * from './api-namespace.js' | ||
export * from './api-route.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andrii-balitskyi This file must remain unchanged or it will break all of the redirects from the old URLs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted the file in def5b59