Skip to content

Commit f91d0c6

Browse files
release: 1.0.0-rc.6 (#30)
* chore(internal): codegen related update (#31) * chore(internal): remove extra empty newlines (#32) * fix(internal): add mts file + crypto shim types (#33) * chore(internal): minor client file refactoring (#34) * chore(exports): cleaner resource index imports (#35) * chore(exports): stop using path fallbacks (#36) * feat(api): api update (#37) * codegen metadata * feat(api): update API URL to api.grid.is (#38) * codegen metadata * chore(client): move misc public files to new `core/` directory, deprecate old paths (#39) * release: 1.0.0-rc.6 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 3f67855 commit f91d0c6

38 files changed

Lines changed: 639 additions & 502 deletions

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,3 @@ jobs:
6363

6464
- name: Run tests
6565
run: ./scripts/test
66-

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.0.0-rc.5"
2+
".": "1.0.0-rc.6"
33
}

.stats.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
configured_endpoints: 5
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/grid%2Fspreadsheet-api-6e9b1263cf6d720224f647537949aef5bbf794efd14e08055bed7d31b523b0a8.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/grid%2Fspreadsheet-api-f9fd5fb43d56001ea7d7f49e92bd55134347b198b2664fd76321cc02a75817c9.yml
3+
openapi_spec_hash: 5130b5ebb7cbfe7a906716c5cf21764b
4+
config_hash: f5d6b47b28c650e373afc0eb0396899e

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,35 @@
11
# Changelog
22

3+
## 1.0.0-rc.6 (2025-03-27)
4+
5+
Full Changelog: [v1.0.0-rc.5...v1.0.0-rc.6](https://github.com/GRID-is/api-sdk-ts/compare/v1.0.0-rc.5...v1.0.0-rc.6)
6+
7+
### Features
8+
9+
* **api:** api update ([#37](https://github.com/GRID-is/api-sdk-ts/issues/37)) ([78d193d](https://github.com/GRID-is/api-sdk-ts/commit/78d193d3d4619f1266ebedccbd3bc73c96e7fcc9))
10+
* **api:** update API URL to api.grid.is ([#38](https://github.com/GRID-is/api-sdk-ts/issues/38)) ([bcc8f3c](https://github.com/GRID-is/api-sdk-ts/commit/bcc8f3c5c61e904e29dd0a7a3bf4de6b112e1729))
11+
12+
13+
### Bug Fixes
14+
15+
* **internal:** add mts file + crypto shim types ([#33](https://github.com/GRID-is/api-sdk-ts/issues/33)) ([7ab8e1d](https://github.com/GRID-is/api-sdk-ts/commit/7ab8e1d00af0416eaa467c42be42a1960abc514a))
16+
17+
18+
### Chores
19+
20+
* **client:** move misc public files to new `core/` directory, deprecate old paths ([#39](https://github.com/GRID-is/api-sdk-ts/issues/39)) ([80f0087](https://github.com/GRID-is/api-sdk-ts/commit/80f00879d13e20c34f51deebdc76f33ffff05634))
21+
* **docs:** Update GRID app URL ([78f283f](https://github.com/GRID-is/api-sdk-ts/commit/78f283fd34f299634cd7755b886811191096045b))
22+
* **exports:** cleaner resource index imports ([#35](https://github.com/GRID-is/api-sdk-ts/issues/35)) ([d8cbc61](https://github.com/GRID-is/api-sdk-ts/commit/d8cbc615cfa73a4d040ba0b3ef9a63312ba4f7f7))
23+
* **exports:** stop using path fallbacks ([#36](https://github.com/GRID-is/api-sdk-ts/issues/36)) ([3ec3190](https://github.com/GRID-is/api-sdk-ts/commit/3ec3190e6113e5ba0e3e3e9bd13ed77387059a17))
24+
* **internal:** codegen related update ([#31](https://github.com/GRID-is/api-sdk-ts/issues/31)) ([93391a0](https://github.com/GRID-is/api-sdk-ts/commit/93391a0a8513219fdf851d0913d16fe32114a318))
25+
* **internal:** minor client file refactoring ([#34](https://github.com/GRID-is/api-sdk-ts/issues/34)) ([f45db71](https://github.com/GRID-is/api-sdk-ts/commit/f45db71123d330d8fd065d50e3d4888d6ba422d1))
26+
* **internal:** remove extra empty newlines ([#32](https://github.com/GRID-is/api-sdk-ts/issues/32)) ([7128673](https://github.com/GRID-is/api-sdk-ts/commit/7128673f7fc7dac02c8884875b95da2c7ff67986))
27+
28+
29+
### Documentation
30+
31+
* Explain how to use the API key ([3f67855](https://github.com/GRID-is/api-sdk-ts/commit/3f67855e034df13f465372a83c66386375bf0fff))
32+
333
## 1.0.0-rc.5 (2025-03-07)
434

535
Full Changelog: [v1.0.0-rc.4...v1.0.0-rc.5](https://github.com/GRID-is/api-sdk-ts/compare/v1.0.0-rc.4...v1.0.0-rc.5)

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ You can use the `maxRetries` option to configure or disable this:
138138
// Configure the default for all requests:
139139
const client = new Grid({
140140
maxRetries: 0, // default is 2
141+
apiKey: 'My API Key',
141142
});
142143

143144
// Or, configure per-request:
@@ -155,6 +156,7 @@ Requests time out after one minute by default. You can configure this with a `ti
155156
// Configure the default for all requests:
156157
const client = new Grid({
157158
timeout: 20 * 1000, // 20 seconds (default is 1 minute)
159+
apiKey: 'My API Key',
158160
});
159161

160162
// Override per-request:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@grid-is/api",
3-
"version": "1.0.0-rc.5",
3+
"version": "1.0.0-rc.6",
44
"description": "The official TypeScript library for the Grid API",
55
"author": "Grid <info@grid.is>",
66
"types": "dist/index.d.ts",

scripts/bootstrap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -e
44

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

7-
if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then
7+
if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ]; then
88
brew bundle check >/dev/null 2>&1 || {
99
echo "==> Installing Homebrew dependencies…"
1010
brew bundle

scripts/build

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,15 @@ 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;
32-
# No way to get that from index.ts because it would cause compile errors
31+
# we need to patch index.js so that `new module.exports()` works for cjs backwards
32+
# compat. 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
35-
# with "moduleResolution": "nodenext", if ESM resolves to index.d.ts,
36-
# it'll have TS errors on the default import. But if it resolves to
37-
# index.d.mts the default import will work (even though both files have
38-
# the same export default statement)
39-
cp dist/index.d.ts dist/index.d.mts
4035
cp tsconfig.dist-src.json dist/src/tsconfig.json
4136
cp src/internal/shim-types.d.ts dist/internal/shim-types.d.ts
4237
cp src/internal/shim-types.d.ts dist/internal/shim-types.d.mts
4338
mkdir -p dist/internal/shims
44-
cp src/internal/shims/*.{mjs,js,d.ts} dist/internal/shims
39+
cp src/internal/shims/*.{mjs,js,d.ts,d.mts} dist/internal/shims
4540

4641
node scripts/utils/postprocess-files.cjs
4742

scripts/utils/postprocess-files.cjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ async function postprocess() {
5050
if (entry.isDirectory() && entry.name !== 'src' && entry.name !== 'internal' && entry.name !== 'bin') {
5151
const subpath = './' + entry.name;
5252
newExports[subpath + '/*.mjs'] = {
53-
default: [subpath + '/*.mjs', subpath + '/*/index.mjs'],
53+
default: subpath + '/*.mjs',
5454
};
5555
newExports[subpath + '/*.js'] = {
56-
default: [subpath + '/*.js', subpath + '/*/index.js'],
56+
default: subpath + '/*.js',
5757
};
5858
newExports[subpath + '/*'] = {
59-
import: [subpath + '/*.mjs', subpath + '/*/index.mjs'],
60-
require: [subpath + '/*.js', subpath + '/*/index.js'],
59+
import: subpath + '/*.mjs',
60+
require: subpath + '/*.js',
6161
};
6262
} else if (entry.isFile() && /\.[cm]?js$/.test(entry.name)) {
6363
const { name, ext } = path.parse(entry.name);

src/api-promise.ts

Lines changed: 2 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,2 @@
1-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2-
3-
import { type Grid } from './client';
4-
5-
import { type PromiseOrValue } from './internal/types';
6-
import { APIResponseProps, defaultParseResponse } from './internal/parse';
7-
8-
/**
9-
* A subclass of `Promise` providing additional helper methods
10-
* for interacting with the SDK.
11-
*/
12-
export class APIPromise<T> extends Promise<T> {
13-
private parsedPromise: Promise<T> | undefined;
14-
#client: Grid;
15-
16-
constructor(
17-
client: Grid,
18-
private responsePromise: Promise<APIResponseProps>,
19-
private parseResponse: (
20-
client: Grid,
21-
props: APIResponseProps,
22-
) => PromiseOrValue<T> = defaultParseResponse,
23-
) {
24-
super((resolve) => {
25-
// this is maybe a bit weird but this has to be a no-op to not implicitly
26-
// parse the response body; instead .then, .catch, .finally are overridden
27-
// to parse the response
28-
resolve(null as any);
29-
});
30-
this.#client = client;
31-
}
32-
33-
_thenUnwrap<U>(transform: (data: T, props: APIResponseProps) => U): APIPromise<U> {
34-
return new APIPromise(this.#client, this.responsePromise, async (client, props) =>
35-
transform(await this.parseResponse(client, props), props),
36-
);
37-
}
38-
39-
/**
40-
* Gets the raw `Response` instance instead of parsing the response
41-
* data.
42-
*
43-
* If you want to parse the response body but still get the `Response`
44-
* instance, you can use {@link withResponse()}.
45-
*
46-
* 👋 Getting the wrong TypeScript type for `Response`?
47-
* Try setting `"moduleResolution": "NodeNext"` or add `"lib": ["DOM"]`
48-
* to your `tsconfig.json`.
49-
*/
50-
asResponse(): Promise<Response> {
51-
return this.responsePromise.then((p) => p.response);
52-
}
53-
54-
/**
55-
* Gets the parsed response data and the raw `Response` instance.
56-
*
57-
* If you just want to get the raw `Response` instance without parsing it,
58-
* you can use {@link asResponse()}.
59-
*
60-
* 👋 Getting the wrong TypeScript type for `Response`?
61-
* Try setting `"moduleResolution": "NodeNext"` or add `"lib": ["DOM"]`
62-
* to your `tsconfig.json`.
63-
*/
64-
async withResponse(): Promise<{ data: T; response: Response }> {
65-
const [data, response] = await Promise.all([this.parse(), this.asResponse()]);
66-
return { data, response };
67-
}
68-
69-
private parse(): Promise<T> {
70-
if (!this.parsedPromise) {
71-
this.parsedPromise = this.responsePromise.then((data) => this.parseResponse(this.#client, data));
72-
}
73-
return this.parsedPromise;
74-
}
75-
76-
override then<TResult1 = T, TResult2 = never>(
77-
onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null,
78-
onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null,
79-
): Promise<TResult1 | TResult2> {
80-
return this.parse().then(onfulfilled, onrejected);
81-
}
82-
83-
override catch<TResult = never>(
84-
onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null,
85-
): Promise<T | TResult> {
86-
return this.parse().catch(onrejected);
87-
}
88-
89-
override finally(onfinally?: (() => void) | undefined | null): Promise<T> {
90-
return this.parse().finally(onfinally);
91-
}
92-
}
1+
/** @deprecated Import from ./core/api-promise instead */
2+
export * from './core/api-promise';

0 commit comments

Comments
 (0)