Skip to content

feat: Update @seamapi/http to v1.25.0 #231

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
merged 28 commits into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
8087ca0
Run npm update
razor-x Feb 27, 2024
f9b398d
1.4.2
seambot Feb 27, 2024
58fd6d9
Merge branch 'main' into public
razor-x Feb 27, 2024
c0c3255
Do not let semantic-release release version 1.0.0
razor-x Feb 27, 2024
6da1304
Fix semantic-release step references
razor-x Feb 27, 2024
0b48389
Update upload-artifact and download-artifact actions
razor-x Feb 27, 2024
6d912c3
1.4.3
seambot Feb 27, 2024
3461b4f
Merge branch 'main' into public
razor-x Feb 27, 2024
c18f2d7
Create new repo as private rather than internal (#10)
codetheweb Mar 7, 2024
7ad51a4
1.4.4
seambot Mar 7, 2024
9d794a3
Merge branch 'main' into public
razor-x Mar 18, 2024
b27d488
ci: Generate code
seambot Mar 18, 2024
7f50f89
Update landlubber to v2
razor-x Mar 18, 2024
7f33c9b
1.4.5
seambot Mar 18, 2024
d022383
Merge branch 'main' into public
razor-x Mar 18, 2024
384f5ab
Fix repo create
razor-x Mar 19, 2024
fc45b18
Update LICENSE year
razor-x Mar 29, 2024
be68be1
1.4.6
seambot Mar 29, 2024
ebfd915
Merge branch 'main' into public
razor-x Mar 29, 2024
d61090a
Run npm update
razor-x Jun 14, 2024
232b5a4
Update to c8 v10
razor-x Jun 14, 2024
1743987
Update workflow action versions
razor-x Jun 14, 2024
b90b5af
1.5.0
seambot Jun 14, 2024
d8f767b
Merge branch 'main' into public
razor-x Jun 14, 2024
d32f976
feat: Update @seamapi/http to v1.25.0
razor-x Feb 20, 2025
263fb7e
ci: Generate code
seambot Feb 20, 2025
c0e1961
Merge remote-tracking branch 'makenew/public' into update-feb20
razor-x Feb 20, 2025
2864f1c
Update LICENSE year
razor-x Feb 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Package
run: npm pack
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: build-${{ github.sha }}
if-no-files-found: error
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
with:
install_dependencies: 'false'
- name: Download artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ inputs.artifact_name }}
path: .
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,24 +78,24 @@ jobs:
with:
node-version: ${{ matrix.node }}
- name: Download artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ needs.build.outputs.artifact_name }}
path: .
- name: Find packages
uses: tj-actions/glob@v17
uses: tj-actions/glob@v21
id: packages
with:
files: '*.tgz'
- name: Create package.json
uses: DamianReeves/write-file-action@v1.2
uses: DamianReeves/write-file-action@v1.3
with:
write-mode: overwrite
path: package.json
contents: |
{"type":"module"}
- name: Create index.js
uses: DamianReeves/write-file-action@v1.2
uses: DamianReeves/write-file-action@v1.3
with:
write-mode: overwrite
path: index.js
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
with:
fetch-depth: 0
- name: Download artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ needs.build.outputs.artifact_name }}
path: .
Expand All @@ -33,10 +33,10 @@ jobs:
mkdir tmp
outfile=tmp/changelog.txt
echo "outfile=${outfile}" >> $GITHUB_OUTPUT
npx standard-changelog@^2.0.0 --release-count 2 --infile $outfile.tmp --outfile $outfile.tmp
npx standard-changelog@^5.0.0 --release-count 2 --infile $outfile.tmp --outfile $outfile.tmp
sed '1,3d' $outfile.tmp > $outfile
- name: Create GitHub release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GH_TOKEN }}
fail_on_unmatched_files: true
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2021-2023 Seam Labs, Inc.
Copyright (c) 2021-2025 Seam Labs, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
66 changes: 66 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ Instead, it re-exports from a core set of Seam modules:
- [Personal Access Token](#personal-access-token)
- [Console Session Token](#console-session-token)
- [Action Attempts](#action-attempts)
- [Pagination](#pagination)
- [Manually fetch pages with the nextPageCursor](#manually-fetch-pages-with-the-nextpagecursor)
- [Iterate over all pages](#iterate-over-all-pages)
- [Iterate over all resources](#iterate-over-all-resources)
- [Return all resources across all pages as an array](#return-all-resources-across-all-pages-as-an-array)
- [Interacting with Multiple Workspaces](#interacting-with-multiple-workspaces)
- [Personal Access Token](#personal-access-token-1)
- [Console Session Token](#console-session-token-1)
Expand Down Expand Up @@ -313,6 +318,67 @@ try {

[action attempt]: https://docs.seam.co/latest/core-concepts/action-attempts

### Pagination

Some Seam API endpoints that return lists of resources support pagination.
Use the `SeamPaginator` class to fetch and process resources across multiple pages.

#### Manually fetch pages with the nextPageCursor

```ts
const pages = seam.createPaginator(
seam.devices.list({
limit: 20,
}),
)

const [devices, { hasNextPage, nextPageCursor }] = await pages.firstPage()

if (hasNextPage) {
const [moreDevices] = await pages.nextPage(nextPageCursor)
}
```

#### Iterate over all pages

```ts
const pages = seam.createPaginator(
seam.devices.list({
limit: 20,
}),
)

for await (const devices of pages) {
console.log(`There are ${devices.length} devices on this page.`)
}
```

#### Iterate over all resources

```ts
const pages = seam.createPaginator(
seam.devices.list({
limit: 20,
}),
)

for await (const device of pages.flatten()) {
console.log(devices.name)
}
```

#### Return all resources across all pages as an array

```ts
const pages = seam.createPaginator(
seam.devices.list({
limit: 20,
}),
)

const devices = await pages.toArray()
```

### Interacting with Multiple Workspaces

Some Seam API endpoints interact with multiple workspaces.
Expand Down
Loading
Loading