Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
8808754
chore(internal): move stringifyQuery implementation to internal function
stainless-app[bot] Feb 27, 2026
a81a9a6
chore(internal): codegen related update
stainless-app[bot] Mar 3, 2026
862a3cc
chore(internal): codegen related update
stainless-app[bot] Mar 6, 2026
ccfeebb
chore(ci): skip uploading artifacts on stainless-internal branches
stainless-app[bot] Mar 7, 2026
399fbc7
chore: update placeholder string
stainless-app[bot] Mar 7, 2026
f774112
fix(client): preserve URL params already embedded in path
stainless-app[bot] Mar 7, 2026
32288f2
chore(internal): update dependencies to address dependabot vulnerabil…
stainless-app[bot] Mar 10, 2026
2a0aacc
chore(internal): tweak CI branches
stainless-app[bot] Mar 17, 2026
13c70b2
chore(internal): update gitignore
stainless-app[bot] Mar 24, 2026
85f6a50
chore(ci): skip lint on metadata-only changes
stainless-app[bot] Mar 25, 2026
cf1e298
chore(internal): codegen related update
stainless-app[bot] Mar 28, 2026
cdb0d9f
chore(internal): codegen related update
stainless-app[bot] Apr 9, 2026
963bd9d
docs: update examples
stainless-app[bot] Apr 11, 2026
de5d2e8
chore(internal): codegen related update
stainless-app[bot] Apr 13, 2026
759b9c9
chore(internal): more robust bootstrap script
stainless-app[bot] Apr 23, 2026
f17ba61
chore(internal): codegen related update
stainless-app[bot] Apr 28, 2026
f13bb8b
feat: support setting headers via env
stainless-app[bot] Apr 28, 2026
b38d95e
chore(format): run eslint and prettier separately
stainless-app[bot] Apr 29, 2026
79993ae
release: 1.6.0
stainless-app[bot] Apr 29, 2026
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
26 changes: 16 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
name: CI
on:
push:
branches-ignore:
- 'generated'
- 'codegen/**'
- 'integrated/**'
- 'stl-preview-head/**'
- 'stl-preview-base/**'
branches:
- '**'
- '!integrated/**'
- '!stl-preview-head/**'
- '!stl-preview-base/**'
- '!generated'
- '!codegen/**'
- 'codegen/stl/**'
pull_request:
branches-ignore:
- 'stl-preview-head/**'
Expand All @@ -17,7 +19,7 @@ jobs:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/spreadsheet-api-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
steps:
- uses: actions/checkout@v6

Expand All @@ -36,7 +38,7 @@ jobs:
timeout-minutes: 5
name: build
runs-on: ${{ github.repository == 'stainless-sdks/spreadsheet-api-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
permissions:
contents: read
id-token: write
Expand All @@ -55,14 +57,18 @@ jobs:
run: ./scripts/build

- name: Get GitHub OIDC Token
if: github.repository == 'stainless-sdks/spreadsheet-api-typescript'
if: |-
github.repository == 'stainless-sdks/spreadsheet-api-typescript' &&
!startsWith(github.ref, 'refs/heads/stl/')
id: github-oidc
uses: actions/github-script@v8
with:
script: core.setOutput('github_token', await core.getIDToken());

- name: Upload tarball
if: github.repository == 'stainless-sdks/spreadsheet-api-typescript'
if: |-
github.repository == 'stainless-sdks/spreadsheet-api-typescript' &&
!startsWith(github.ref, 'refs/heads/stl/')
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ jobs:
bash ./bin/check-release-environment
env:
NPM_TOKEN: ${{ secrets.GRID_NPM_TOKEN || secrets.NPM_TOKEN }}

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.prism.log
.stdy.log
node_modules
yarn-error.log
codegen.log
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.5.4"
".": "1.6.0"
}
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
# Changelog

## 1.6.0 (2026-04-29)

Full Changelog: [v1.5.4...v1.6.0](https://github.com/GRID-is/api-sdk-ts/compare/v1.5.4...v1.6.0)

### Features

* support setting headers via env ([f13bb8b](https://github.com/GRID-is/api-sdk-ts/commit/f13bb8babbe12f265957417330b8d6470f951c97))


### Bug Fixes

* **client:** preserve URL params already embedded in path ([f774112](https://github.com/GRID-is/api-sdk-ts/commit/f774112e955928024384688ffc43ab24af317517))


### Chores

* **ci:** skip lint on metadata-only changes ([85f6a50](https://github.com/GRID-is/api-sdk-ts/commit/85f6a50e55e9ea0e50ef6b10c796eec4b638861a))
* **ci:** skip uploading artifacts on stainless-internal branches ([ccfeebb](https://github.com/GRID-is/api-sdk-ts/commit/ccfeebb085a7c9ca5a0d24ba5ee175700981d653))
* **format:** run eslint and prettier separately ([b38d95e](https://github.com/GRID-is/api-sdk-ts/commit/b38d95e03840b8204978ea8f29e94e0bf7a0ba12))
* **internal:** codegen related update ([f17ba61](https://github.com/GRID-is/api-sdk-ts/commit/f17ba61fa0eecce6a8d675b45a1d02e9e0b26a01))
* **internal:** codegen related update ([de5d2e8](https://github.com/GRID-is/api-sdk-ts/commit/de5d2e8f039630d1b172b1a84c53d7bcaa0b8e4b))
* **internal:** codegen related update ([cdb0d9f](https://github.com/GRID-is/api-sdk-ts/commit/cdb0d9fe5e112d35bb393fd1253e5140efa79242))
* **internal:** codegen related update ([cf1e298](https://github.com/GRID-is/api-sdk-ts/commit/cf1e2984941f530ac0f3250b1e11fef64c828037))
* **internal:** codegen related update ([862a3cc](https://github.com/GRID-is/api-sdk-ts/commit/862a3cc96242474206647d4bca2181001b1bbd72))
* **internal:** codegen related update ([a81a9a6](https://github.com/GRID-is/api-sdk-ts/commit/a81a9a6fdc993c81346b7743b19fbaed6680ae4d))
* **internal:** more robust bootstrap script ([759b9c9](https://github.com/GRID-is/api-sdk-ts/commit/759b9c90714c74d804172951063d337cc6f1020b))
* **internal:** move stringifyQuery implementation to internal function ([8808754](https://github.com/GRID-is/api-sdk-ts/commit/8808754e3e69ac2da2ce730c67b125f8dd15982b))
* **internal:** tweak CI branches ([2a0aacc](https://github.com/GRID-is/api-sdk-ts/commit/2a0aacc8f4687f478091f5df519bea008cc6e75b))
* **internal:** update dependencies to address dependabot vulnerabilities ([32288f2](https://github.com/GRID-is/api-sdk-ts/commit/32288f2f780637c8c26af93b43ab41886645db14))
* **internal:** update gitignore ([13c70b2](https://github.com/GRID-is/api-sdk-ts/commit/13c70b26a33b80c5ae74b105c2d8385c83cafae5))
* update placeholder string ([399fbc7](https://github.com/GRID-is/api-sdk-ts/commit/399fbc71da55d63d6790d41951d4913e4d9ab803))


### Documentation

* update examples ([963bd9d](https://github.com/GRID-is/api-sdk-ts/commit/963bd9dd114f47f8525638ea9492cad77916be3c))

## 1.5.4 (2026-02-24)

Full Changelog: [v1.5.3...v1.5.4](https://github.com/GRID-is/api-sdk-ts/compare/v1.5.3...v1.5.4)
Expand Down
20 changes: 8 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ const client = new Grid({
apiKey: process.env['GRID_API_TOKEN'], // This is the default and can be omitted
});

const response = await client.workbooks.query('YOUR_WORKBOOK_ID', {
read: ['A1', 'Sheet2!B3', '=SUM(A1:A4)'],
});
const response = await client.workbooks.query('YOUR_WORKBOOK_ID', { read: ['A1:A4'] });

console.log(response.read);
```
Expand All @@ -45,7 +43,7 @@ const client = new Grid({
apiKey: process.env['GRID_API_TOKEN'], // This is the default and can be omitted
});

const params: Grid.WorkbookQueryParams = { read: ['A1', 'Sheet2!B3', '=SUM(A1:A4)'] };
const params: Grid.WorkbookQueryParams = { read: ['A1:A4'] };
const response: Grid.WorkbookQueryResponse = await client.workbooks.query(
'YOUR_WORKBOOK_ID',
params,
Expand Down Expand Up @@ -92,7 +90,7 @@ a subclass of `APIError` will be thrown:
<!-- prettier-ignore -->
```ts
const response = await client.workbooks
.query('YOUR_WORKBOOK_ID', { read: ['A1', 'Sheet2!B3', '=SUM(A1:A4)'] })
.query('YOUR_WORKBOOK_ID', { read: ['A1:A4'] })
.catch(async (err) => {
if (err instanceof Grid.APIError) {
console.log(err.status); // 400
Expand Down Expand Up @@ -133,7 +131,7 @@ const client = new Grid({
});

// Or, configure per-request:
await client.workbooks.query('YOUR_WORKBOOK_ID', { read: ['A1', 'Sheet2!B3', '=SUM(A1:A4)'] }, {
await client.workbooks.query('YOUR_WORKBOOK_ID', { read: ['A1:A4'] }, {
maxRetries: 5,
});
```
Expand All @@ -150,7 +148,7 @@ const client = new Grid({
});

// Override per-request:
await client.workbooks.query('YOUR_WORKBOOK_ID', { read: ['A1', 'Sheet2!B3', '=SUM(A1:A4)'] }, {
await client.workbooks.query('YOUR_WORKBOOK_ID', { read: ['A1:A4'] }, {
timeout: 5 * 1000,
});
```
Expand Down Expand Up @@ -203,7 +201,7 @@ const client = new Grid();

const response = await client.workbooks.query(
'YOUR_WORKBOOK_ID',
{ read: ['A1', 'Sheet2!B3', '=SUM(A1:A4)'] },
{ read: ['A1:A4'] },
{ headers: { 'X-Client-Name': 'My-Custom-Value' } },
);
```
Expand All @@ -222,14 +220,12 @@ Unlike `.asResponse()` this method consumes the body, returning once it is parse
```ts
const client = new Grid();

const response = await client.workbooks
.query('YOUR_WORKBOOK_ID', { read: ['A1', 'Sheet2!B3', '=SUM(A1:A4)'] })
.asResponse();
const response = await client.workbooks.query('YOUR_WORKBOOK_ID', { read: ['A1:A4'] }).asResponse();
console.log(response.headers.get('X-My-Header'));
console.log(response.statusText); // access the underlying Response object

const { data: response, response: raw } = await client.workbooks
.query('YOUR_WORKBOOK_ID', { read: ['A1', 'Sheet2!B3', '=SUM(A1:A4)'] })
.query('YOUR_WORKBOOK_ID', { read: ['A1:A4'] })
.withResponse();
console.log(raw.headers.get('X-My-Header'));
console.log(response.read);
Expand Down
3 changes: 0 additions & 3 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// @ts-check
import tseslint from 'typescript-eslint';
import unusedImports from 'eslint-plugin-unused-imports';
import prettier from 'eslint-plugin-prettier';

export default tseslint.config(
{
Expand All @@ -14,11 +13,9 @@ export default tseslint.config(
plugins: {
'@typescript-eslint': tseslint.plugin,
'unused-imports': unusedImports,
prettier,
},
rules: {
'no-unused-vars': 'off',
'prettier/prettier': 'error',
'unused-imports/no-unused-imports': 'error',
'no-restricted-imports': [
'error',
Expand Down
14 changes: 12 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@grid-is/api",
"version": "1.5.4",
"version": "1.6.0",
"description": "The official TypeScript library for the Grid API",
"author": "Grid <info@grid.is>",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -36,7 +36,6 @@
"@typescript-eslint/eslint-plugin": "8.31.1",
"@typescript-eslint/parser": "8.31.1",
"eslint": "^9.39.1",
"eslint-plugin-prettier": "^5.4.1",
"eslint-plugin-unused-imports": "^4.1.4",
"iconv-lite": "^0.6.3",
"jest": "^29.4.0",
Expand All @@ -50,6 +49,17 @@
"typescript": "5.8.3",
"typescript-eslint": "8.31.1"
},
"overrides": {
"minimatch": "^9.0.5"
},
"pnpm": {
"overrides": {
"minimatch": "^9.0.5"
}
},
"resolutions": {
"minimatch": "^9.0.5"
},
"exports": {
".": {
"import": "./dist/index.mjs",
Expand Down
2 changes: 1 addition & 1 deletion scripts/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

cd "$(dirname "$0")/.."

if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then
if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "${SKIP_BREW:-}" != "1" ] && [ -t 0 ]; then
brew bundle check >/dev/null 2>&1 || {
echo -n "==> Install Homebrew dependencies? (y/N): "
read -r response
Expand Down
9 changes: 3 additions & 6 deletions scripts/fast-format
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ if ! [ -z "$ESLINT_FILES" ]; then
fi

echo "==> Running prettier --write"
# format things eslint didn't
PRETTIER_FILES="$(grep '\.\(js\|json\)$' "$FILE_LIST" || true)"
if ! [ -z "$PRETTIER_FILES" ]; then
echo "$PRETTIER_FILES" | xargs ./node_modules/.bin/prettier \
--write --cache --cache-strategy metadata --no-error-on-unmatched-pattern \
'!**/dist' '!**/*.ts' '!**/*.mts' '!**/*.cts' '!**/*.js' '!**/*.mjs' '!**/*.cjs'
if ! [ -z "$FILE_LIST" ]; then
cat "$FILE_LIST" | xargs ./node_modules/.bin/prettier \
--write --cache --cache-strategy metadata --no-error-on-unmatched-pattern --ignore-unknown
fi
3 changes: 1 addition & 2 deletions scripts/format
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ echo "==> Running eslint --fix"
./node_modules/.bin/eslint --fix .

echo "==> Running prettier --write"
# format things eslint didn't
./node_modules/.bin/prettier --write --cache --cache-strategy metadata . '!**/dist' '!**/*.ts' '!**/*.mts' '!**/*.cts' '!**/*.js' '!**/*.mjs' '!**/*.cjs'
./node_modules/.bin/prettier --write --cache --cache-strategy metadata .
3 changes: 3 additions & 0 deletions scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ set -e

cd "$(dirname "$0")/.."

echo "==> Running prettier --check"
./node_modules/.bin/prettier --check .

echo "==> Running eslint"
./node_modules/.bin/eslint .

Expand Down
9 changes: 8 additions & 1 deletion scripts/utils/postprocess-files.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,19 @@ async function postprocess() {

// strip out lib="dom", types="node", and types="react" references; these
// are needed at build time, but would pollute the user's TS environment
const transformed = code.replace(
let transformed = code.replace(
/^ *\/\/\/ *<reference +(lib="dom"|types="(node|react)").*?\n/gm,
// replace with same number of characters to avoid breaking source maps
(match) => ' '.repeat(match.length - 1) + '\n',
);

// TypeScript's declaration emitter collapses /** @ts-ignore */ onto the same
// line as the type declaration, which doesn't work. So we convert to // @ts-ignore
// on its own line to properly suppresses errors.
if (file.endsWith('.d.ts') || file.endsWith('.d.mts') || file.endsWith('.d.cts')) {
transformed = transformed.replace(/\/\*\* @ts-ignore\b[^*]*\*\/ /gm, '// @ts-ignore\n');
}

if (transformed !== code) {
console.error(`wrote ${path.relative(process.cwd(), file)}`);
await fs.promises.writeFile(file, transformed, 'utf8');
Expand Down
Loading
Loading