Skip to content

feat(ts-sdk): add workspace lookup and ensure helpers#98

Merged
willwashburn merged 5 commits into
mainfrom
noodle/ts-ensure-workspace-helpers
Mar 20, 2026
Merged

feat(ts-sdk): add workspace lookup and ensure helpers#98
willwashburn merged 5 commits into
mainfrom
noodle/ts-ensure-workspace-helpers

Conversation

@noodleonthecape
Copy link
Copy Markdown

@noodleonthecape noodleonthecape commented Mar 19, 2026

Summary

  • add TypeScript SDK RelayCast.lookupWorkspace() and RelayCast.ensureWorkspace() helpers
  • add the server workspace-by-name lookup route required by the SDK flow
  • expose the shared workspace lookup type/schema and document the SDK usage

cc @willwashburn


Open with Devin

@noodleonthecape
Copy link
Copy Markdown
Author

cc @willwashburn

@github-actions
Copy link
Copy Markdown

Preview deployed!

Environment URL
API https://pr98-api.relaycast.dev
Health https://pr98-api.relaycast.dev/health
Observer https://pr98-observer.relaycast.dev/observer

This preview shares the staging database and will be cleaned up when the PR is merged or closed.

Run E2E tests

npm run e2e -- https://pr98-api.relaycast.dev --ci

Open observer dashboard

https://pr98-observer.relaycast.dev/observer

Comment thread packages/sdk-typescript/src/relay.ts Outdated
}

const data = (parsed as { data: unknown }).data;
return camelizeKeys(WorkspaceLookupSchema.parse(data));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why can't we just use the schema.parse instead of all the manual shape checking use on lines 172-208? there has to be a more elegant way

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Swapped the manual envelope/data shape checks over to ApiResponseSchema(WorkspaceLookupSchema).safeParse(...) and used the parsed discriminated union to handle success vs error. I also applied the same cleanup to createWorkspace for consistency since it had the same open-coded response parsing pattern. Behavior stays the same, including returning null on 404 from lookupWorkspace.

devin-ai-integration[bot]

This comment was marked as resolved.

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@willwashburn willwashburn merged commit e3e14f3 into main Mar 20, 2026
4 checks passed
@willwashburn willwashburn deleted the noodle/ts-ensure-workspace-helpers branch March 20, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants