Skip to content

Commit ed2532d

Browse files
feat(api): update via SDK Studio
1 parent 825bb76 commit ed2532d

20 files changed

Lines changed: 111 additions & 111 deletions

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2025 GRID
189+
Copyright 2025 Grid
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![NPM version](https://img.shields.io/npm/v/@grid-is/api.svg)](https://npmjs.org/package/@grid-is/api) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/@grid-is/api)
44

5-
This library provides convenient access to the GRID REST API from server-side TypeScript or JavaScript.
5+
This library provides convenient access to the Grid REST API from server-side TypeScript or JavaScript.
66

77
The REST API documentation can be found on [alpha.grid.is](https://alpha.grid.is/). The full API of this library can be found in [api.md](api.md).
88

@@ -23,9 +23,9 @@ The full API of this library can be found in [api.md](api.md).
2323

2424
<!-- prettier-ignore -->
2525
```js
26-
import GRID from '@grid-is/api';
26+
import Grid from '@grid-is/api';
2727

28-
const client = new GRID();
28+
const client = new Grid();
2929

3030
async function main() {
3131
const response = await client.workbooks.query('REPLACE_ME', { read: ['A1', 'Sheet2!B3', '=SUM(A1:A4)'] });
@@ -42,13 +42,13 @@ This library includes TypeScript definitions for all request params and response
4242

4343
<!-- prettier-ignore -->
4444
```ts
45-
import GRID from '@grid-is/api';
45+
import Grid from '@grid-is/api';
4646

47-
const client = new GRID();
47+
const client = new Grid();
4848

4949
async function main() {
50-
const params: GRID.WorkbookQueryParams = { read: ['A1', 'Sheet2!B3', '=SUM(A1:A4)'] };
51-
const response: GRID.WorkbookQueryResponse = await client.workbooks.query('REPLACE_ME', params);
50+
const params: Grid.WorkbookQueryParams = { read: ['A1', 'Sheet2!B3', '=SUM(A1:A4)'] };
51+
const response: Grid.WorkbookQueryResponse = await client.workbooks.query('REPLACE_ME', params);
5252
}
5353

5454
main();
@@ -68,7 +68,7 @@ async function main() {
6868
const response = await client.workbooks
6969
.query('REPLACE_ME', { read: ['A1', 'Sheet2!B3', '=SUM(A1:A4)'] })
7070
.catch(async (err) => {
71-
if (err instanceof GRID.APIError) {
71+
if (err instanceof Grid.APIError) {
7272
console.log(err.status); // 400
7373
console.log(err.name); // BadRequestError
7474
console.log(err.headers); // {server: 'nginx', ...}
@@ -105,7 +105,7 @@ You can use the `maxRetries` option to configure or disable this:
105105
<!-- prettier-ignore -->
106106
```js
107107
// Configure the default for all requests:
108-
const client = new GRID({
108+
const client = new Grid({
109109
maxRetries: 0, // default is 2
110110
});
111111

@@ -122,7 +122,7 @@ Requests time out after 1 minute by default. You can configure this with a `time
122122
<!-- prettier-ignore -->
123123
```ts
124124
// Configure the default for all requests:
125-
const client = new GRID({
125+
const client = new Grid({
126126
timeout: 20 * 1000, // 20 seconds (default is 1 minute)
127127
});
128128

@@ -143,9 +143,9 @@ We automatically send the `X-Client-Name` header set to `spreadsheet-api-node`.
143143
If you need to, you can override it by setting default headers on a per-request basis.
144144

145145
```ts
146-
import GRID from '@grid-is/api';
146+
import Grid from '@grid-is/api';
147147

148-
const client = new GRID();
148+
const client = new Grid();
149149

150150
const response = await client.workbooks.query(
151151
'REPLACE_ME',
@@ -164,7 +164,7 @@ You can also use the `.withResponse()` method to get the raw `Response` along wi
164164

165165
<!-- prettier-ignore -->
166166
```ts
167-
const client = new GRID();
167+
const client = new Grid();
168168

169169
const response = await client.workbooks
170170
.query('REPLACE_ME', { read: ['A1', 'Sheet2!B3', '=SUM(A1:A4)'] })
@@ -240,7 +240,7 @@ Or pass it to the client:
240240
```ts
241241
import fetch from 'my-fetch';
242242

243-
const client = new GRID({ fetch });
243+
const client = new Grid({ fetch });
244244
```
245245

246246
### Logging and middleware
@@ -250,9 +250,9 @@ which can be used to inspect or alter the `Request` or `Response` before/after e
250250

251251
```ts
252252
import { fetch } from 'undici'; // as one example
253-
import GRID from '@grid-is/api';
253+
import Grid from '@grid-is/api';
254254

255-
const client = new GRID({
255+
const client = new Grid({
256256
fetch: async (url: RequestInfo, init?: RequestInit): Promise<Response> => {
257257
console.log('About to make a request', url, init);
258258
const response = await fetch(url, init);
@@ -270,9 +270,9 @@ This is intended for debugging purposes only and may change in the future withou
270270
If you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)
271271

272272
```ts
273-
import GRID from '@grid-is/api';
273+
import Grid from '@grid-is/api';
274274

275-
const client = new GRID({
275+
const client = new Grid({
276276
fetchOptions: {
277277
// `RequestInit` options
278278
},
@@ -287,11 +287,11 @@ options to requests:
287287
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg" align="top" width="18" height="21"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>
288288

289289
```ts
290-
import GRID from '@grid-is/api';
290+
import Grid from '@grid-is/api';
291291
import * as undici from 'undici';
292292

293293
const proxyAgent = new undici.ProxyAgent('http://localhost:8888');
294-
const client = new GRID({
294+
const client = new Grid({
295295
fetchOptions: {
296296
dispatcher: proxyAgent,
297297
},
@@ -301,9 +301,9 @@ const client = new GRID({
301301
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg" align="top" width="18" height="21"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>
302302

303303
```ts
304-
import GRID from '@grid-is/api';
304+
import Grid from '@grid-is/api';
305305

306-
const client = new GRID({
306+
const client = new Grid({
307307
fetchOptions: {
308308
proxy: 'http://localhost:8888',
309309
},
@@ -313,10 +313,10 @@ const client = new GRID({
313313
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg" align="top" width="18" height="21"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>
314314

315315
```ts
316-
import GRID from 'npm:@grid-is/api';
316+
import Grid from 'npm:@grid-is/api';
317317

318318
const httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });
319-
const client = new GRID({
319+
const client = new Grid({
320320
fetchOptions: {
321321
client: httpClient,
322322
},

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ before making any information public.
1616
## Reporting Non-SDK Related Security Issues
1717

1818
If you encounter security issues that are not directly related to SDKs but pertain to the services
19-
or products provided by GRID please follow the respective company's security reporting guidelines.
19+
or products provided by Grid please follow the respective company's security reporting guidelines.
2020

21-
### GRID Terms and Policies
21+
### Grid Terms and Policies
2222

2323
Please contact info@grid.is for any questions or concerns regarding security of our services.
2424

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "@grid-is/api",
33
"version": "0.0.1-alpha.0",
4-
"description": "The official TypeScript library for the GRID API",
5-
"author": "GRID <info@grid.is>",
4+
"description": "The official TypeScript library for the Grid API",
5+
"author": "Grid <info@grid.is>",
66
"types": "dist/index.d.ts",
77
"main": "dist/index.js",
88
"type": "commonjs",

scripts/build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ node scripts/utils/make-dist-package-json.cjs > dist/package.json
2828

2929
# build to .js/.mjs/.d.ts files
3030
npm exec tsc-multi
31-
# we need to add exports = module.exports = GRID to index.js;
31+
# we need to add exports = module.exports = Grid to index.js;
3232
# No way to get that from index.ts because it would cause compile errors
3333
# when building .mjs
3434
node scripts/utils/fix-index-exports.cjs

src/api-promise.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
import { type GRID } from './client';
3+
import { type Grid } from './client';
44

55
import { type PromiseOrValue } from './internal/types';
66
import { APIResponseProps, defaultParseResponse } from './internal/parse';
@@ -11,13 +11,13 @@ import { APIResponseProps, defaultParseResponse } from './internal/parse';
1111
*/
1212
export class APIPromise<T> extends Promise<T> {
1313
private parsedPromise: Promise<T> | undefined;
14-
#client: GRID;
14+
#client: Grid;
1515

1616
constructor(
17-
client: GRID,
17+
client: Grid,
1818
private responsePromise: Promise<APIResponseProps>,
1919
private parseResponse: (
20-
client: GRID,
20+
client: Grid,
2121
props: APIResponseProps,
2222
) => PromiseOrValue<T> = defaultParseResponse,
2323
) {

src/client.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ export interface ClientOptions {
132132
type FinalizedRequestInit = RequestInit & { headers: Headers };
133133

134134
/**
135-
* API Client for interfacing with the GRID API.
135+
* API Client for interfacing with the Grid API.
136136
*/
137-
export class GRID {
137+
export class Grid {
138138
bearerToken: string;
139139

140140
baseURL: string;
@@ -150,7 +150,7 @@ export class GRID {
150150
private _options: ClientOptions;
151151

152152
/**
153-
* API Client for interfacing with the GRID API.
153+
* API Client for interfacing with the Grid API.
154154
*
155155
* @param {string | undefined} [opts.bearerToken=process.env['GRID_API_TOKEN'] ?? undefined]
156156
* @param {string} [opts.baseURL=process.env['GRID_BASE_URL'] ?? https://api-alpha.grid.is] - Override the default base URL for the API.
@@ -167,8 +167,8 @@ export class GRID {
167167
...opts
168168
}: ClientOptions = {}) {
169169
if (bearerToken === undefined) {
170-
throw new Errors.GRIDError(
171-
"The GRID_API_TOKEN environment variable is missing or empty; either provide it, or instantiate the GRID client with an bearerToken option, like new GRID({ bearerToken: 'My Bearer Token' }).",
170+
throw new Errors.GridError(
171+
"The GRID_API_TOKEN environment variable is missing or empty; either provide it, or instantiate the Grid client with an bearerToken option, like new Grid({ bearerToken: 'My Bearer Token' }).",
172172
);
173173
}
174174

@@ -179,7 +179,7 @@ export class GRID {
179179
};
180180

181181
this.baseURL = options.baseURL!;
182-
this.timeout = options.timeout ?? GRID.DEFAULT_TIMEOUT /* 1 minute */;
182+
this.timeout = options.timeout ?? Grid.DEFAULT_TIMEOUT /* 1 minute */;
183183
this.logger = options.logger ?? console;
184184
if (options.logLevel != null) {
185185
this.logLevel = options.logLevel;
@@ -224,7 +224,7 @@ export class GRID {
224224
if (value === null) {
225225
return `${encodeURIComponent(key)}=`;
226226
}
227-
throw new Errors.GRIDError(
227+
throw new Errors.GridError(
228228
`Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`,
229229
);
230230
})
@@ -604,10 +604,10 @@ export class GRID {
604604
}
605605
}
606606

607-
static GRID = this;
607+
static Grid = this;
608608
static DEFAULT_TIMEOUT = 60000; // 1 minute
609609

610-
static GRIDError = Errors.GRIDError;
610+
static GridError = Errors.GridError;
611611
static APIError = Errors.APIError;
612612
static APIConnectionError = Errors.APIConnectionError;
613613
static APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
@@ -625,8 +625,8 @@ export class GRID {
625625

626626
workbooks: API.Workbooks = new API.Workbooks(this);
627627
}
628-
GRID.Workbooks = Workbooks;
629-
export declare namespace GRID {
628+
Grid.Workbooks = Workbooks;
629+
export declare namespace Grid {
630630
export type RequestOptions = Opts.RequestOptions;
631631

632632
export {

src/error.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
import { castToError } from './internal/errors';
44

5-
export class GRIDError extends Error {}
5+
export class GridError extends Error {}
66

77
export class APIError<
88
TStatus extends number | undefined = number | undefined,
99
THeaders extends Headers | undefined = Headers | undefined,
1010
TError extends Object | undefined = Object | undefined,
11-
> extends GRIDError {
11+
> extends GridError {
1212
/** HTTP status for the response that caused the error */
1313
readonly status: TStatus;
1414
/** HTTP headers for the response that caused the error */

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
export { GRID as default } from './client';
3+
export { Grid as default } from './client';
44

55
export { type Uploadable, toFile } from './uploads';
66
export { APIPromise } from './api-promise';
7-
export { GRID, type ClientOptions } from './client';
7+
export { Grid, type ClientOptions } from './client';
88
export {
9-
GRIDError,
9+
GridError,
1010
APIError,
1111
APIConnectionError,
1212
APIConnectionTimeoutError,

src/internal/parse.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
import type { FinalRequestOptions } from './request-options';
4-
import { type GRID } from '../client';
4+
import { type Grid } from '../client';
55
import { logger } from './utils/log';
66

77
export type APIResponseProps = {
@@ -10,7 +10,7 @@ export type APIResponseProps = {
1010
controller: AbortController;
1111
};
1212

13-
export async function defaultParseResponse<T>(client: GRID, props: APIResponseProps): Promise<T> {
13+
export async function defaultParseResponse<T>(client: Grid, props: APIResponseProps): Promise<T> {
1414
const { response } = props;
1515

1616
// fetch refuses to read the body when the status code is 204.

0 commit comments

Comments
 (0)