Repository navigation
feat: add full typescript sdk #1
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
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e44f750
feat: add full typescript sdk
chroxify 71c2819
fix: channel env badges & add release ci
chroxify 18d326a
Merge remote-tracking branch 'origin/main' into ts-sdk
chroxify 1210ed4
fix: review feedback
chroxify 94ca138
fix: review comments
chroxify d5cb99f
fix: review comments
chroxify 206d2f4
fix: tests
chroxify 798464e
fix: ci workflow
chroxify 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 hidden or 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,21 @@ | ||
| { | ||
| "$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json", | ||
| "changelog": ["@changesets/changelog-github", { "repo": "buzzkit-dev/buzzkit" }], | ||
| "commit": false, | ||
| "access": "public", | ||
| "baseBranch": "main", | ||
| "updateInternalDependencies": "patch", | ||
| "ignore": [ | ||
| "@buzzkit/api", | ||
| "@buzzkit/web", | ||
| "@buzzkit/marketing", | ||
| "@buzzkit/docs", | ||
| "@buzzkit/schema", | ||
| "@buzzkit/database", | ||
| "@buzzkit/auth", | ||
| "@buzzkit/eden", | ||
| "@buzzkit/observability", | ||
| "@buzzkit/tinybird", | ||
| "@buzzkit/ui" | ||
| ] | ||
| } |
This file contains hidden or 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,5 @@ | ||
| --- | ||
| 'buzzkit': major | ||
| --- | ||
|
|
||
| The first public release. One package with seven entry points: the server client, the browser client and its React hooks, webhook signing and verification, and the segment, workflow and source grammars. Entity types are held to the API by type-level parity assertions, every list pages the same way, and retries cover connection failures, timeouts, 429 and 5xx with jitter and Retry-After. |
This file contains hidden or 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,68 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - 'packages/buzzkit/**' | ||
| - '.changeset/**' | ||
| - '.github/workflows/release.yml' | ||
|
|
||
| concurrency: | ||
| group: release | ||
| cancel-in-progress: false | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| id-token: write | ||
|
|
||
| jobs: | ||
| release: | ||
| runs-on: blacksmith-2vcpu-ubuntu-2404 | ||
| timeout-minutes: 20 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 | ||
| registry-url: https://registry.npmjs.org | ||
| - name: npm new enough to publish through the GitHub trusted publisher | ||
| run: npm install --global npm@latest | ||
|
chroxify marked this conversation as resolved.
Resolved
|
||
| - uses: oven-sh/setup-bun@v2 | ||
| - run: bun install --frozen-lockfile | ||
| - name: Build and test the SDK | ||
| run: | | ||
| bun run sdk:build | ||
| bun run --cwd packages/buzzkit test | ||
| bun run --cwd packages/buzzkit exec publint | ||
| - name: Prove the published package imports | ||
| run: | | ||
| cd packages/buzzkit | ||
| bun run scripts/publish-manifest.ts | ||
| bun pm pack --destination /tmp/pack | ||
| cd /tmp/pack | ||
| mkdir consumer && cd consumer | ||
| printf '{"name":"c","type":"module","private":true}' > package.json | ||
| npm install ../buzzkit-*.tgz | ||
| node --input-type=module -e " | ||
| import { BuzzKit, signIdentity } from 'buzzkit'; | ||
| import { BuzzKitClient } from 'buzzkit/client'; | ||
| import { verifyWebhook } from 'buzzkit/webhooks'; | ||
| if (typeof BuzzKit !== 'function') throw new Error('the root entry did not load'); | ||
| if (typeof BuzzKitClient !== 'function') throw new Error('the browser entry did not load'); | ||
| if (typeof signIdentity !== 'function' || typeof verifyWebhook !== 'function') { | ||
| throw new Error('a server helper did not load'); | ||
| } | ||
| " | ||
| cd "$GITHUB_WORKSPACE" && git checkout -- packages/buzzkit/package.json | ||
| - uses: changesets/action@v1 | ||
| with: | ||
| version: bunx changeset version | ||
| publish: bun run sdk:release | ||
| title: 'chore: release the SDK' | ||
| commit: 'chore: release the SDK' | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,9 @@ | ||
| import { literalUnion } from '@buzzkit/api/libs/schemas'; | ||
| import { PaginationQuerySchema } from '@buzzkit/api/utils/pagination'; | ||
| import { t } from 'elysia'; | ||
| import { DELIVERY_STATUSES } from './constants'; | ||
|
|
||
| export const ListMessageDeliveriesQuerySchema = t.Object({ | ||
| ...PaginationQuerySchema.properties, | ||
| status: t.Optional(literalUnion(DELIVERY_STATUSES)), | ||
| }); |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
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.
Uh oh!
There was an error while loading. Please reload this page.