Skip to content

Commit

Permalink
Document Seam workspace scope
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-balitskyi committed Jan 14, 2025
1 parent a3d2a7d commit a52ca08
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/layouts/api-endpoint.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@

{{#each authMethods}}
- {{this}}
{{#if (eq this 'Personal access token')}}
- {{#if (eq ../workspaceScope 'required')}}Must also include the `seam-workspace` header in the request{{/if}}{{#if (eq ../workspaceScope 'optional')}}Can also include the `seam-workspace` header in the request{{/if}}{{#if (eq ../workspaceScope 'none')}}Must omit the `seam-workspace` header from the request{{/if}}
{{/if}}
{{/each}}

{{/if}}
Expand Down
3 changes: 3 additions & 0 deletions src/lib/layout/api-endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type {
CodeSampleSdk,
Endpoint,
SeamAuthMethod,
SeamWorkspaceScope,
} from '@seamapi/blueprint'

const supportedSdks: CodeSampleSdk[] = [
Expand All @@ -18,6 +19,7 @@ export interface ApiEndpointLayoutContext {
title: string
path: string
authMethods: AuthMethodDisplayName[]
workspaceScope: SeamWorkspaceScope
request: {
preferredMethod: string
parameters: Array<{
Expand Down Expand Up @@ -73,6 +75,7 @@ export function setEndpointLayoutContext(
file.description = endpoint.description
file.title = endpoint.title
file.path = endpoint.path
file.workspaceScope = endpoint.workspaceScope

file.authMethods = endpoint.authMethods
.filter(
Expand Down

0 comments on commit a52ca08

Please sign in to comment.