Skip to content

release: 1.6.0 #153

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
4 changes: 1 addition & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
"postCreateCommand": "yarn install",
"customizations": {
"vscode": {
"extensions": [
"esbenp.prettier-vscode"
]
"extensions": ["esbenp.prettier-vscode"]
}
}
}
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
- next
branches-ignore:
- 'generated'
- 'codegen/**'
- 'integrated/**'
- 'stl-preview-head/**'
- 'stl-preview-base/**'

jobs:
lint:
timeout-minutes: 10
name: lint
runs-on: ubuntu-latest
runs-on: ${{ github.repository == 'stainless-sdks/openint-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v4

Expand All @@ -30,7 +30,7 @@ jobs:
build:
timeout-minutes: 5
name: build
runs-on: ubuntu-latest
runs-on: ${{ github.repository == 'stainless-sdks/openint-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
permissions:
contents: read
id-token: write
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
test:
timeout-minutes: 10
name: test
runs-on: ubuntu-latest
runs-on: ${{ github.repository == 'stainless-sdks/openint-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v4

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.OPENINT_NPM_TOKEN || secrets.NPM_TOKEN }}

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.0"
".": "1.6.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 10
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openint%2Fopenint-d866f2602e57f0c336aa8a4e065278521b6607ad4136c15971e3d2778576266f.yml
openapi_spec_hash: 145b6d77b0841af35bb06456f28b4f14
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openint%2Fopenint-67a61cc981caf2a7992bcb19816e09474399f50cfa9a2a6cf2c79b8299a53d16.yml
openapi_spec_hash: 32eae2c2f8547ef3ea3e395bf2f413e2
config_hash: a6e549521fa293498319c532d9cfa93f
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Changelog

## 1.6.0 (2025-05-03)

Full Changelog: [v1.5.0...v1.6.0](https://github.com/openintegrations/ts-sdk/compare/v1.5.0...v1.6.0)

### Features

* **docs:** updating documented docs for stainless ([faa83db](https://github.com/openintegrations/ts-sdk/commit/faa83db141006a9f7337ac75652ecc0a1c2f4cad))
* **docs:** updating documented docs for stainless ([8c53526](https://github.com/openintegrations/ts-sdk/commit/8c535260ccd141a967be63f6a9a5ebd02971e3f6))
* **docs:** updating documented docs for stainless ([43667b3](https://github.com/openintegrations/ts-sdk/commit/43667b3dca008a8e36c71765799bda7cf0d38b30))


### Chores

* **ci:** only use depot for staging repos ([f618f64](https://github.com/openintegrations/ts-sdk/commit/f618f64f705b8ac31a2b4289b31bc50f9bdba949))
* **internal:** codegen related update ([b25bfa6](https://github.com/openintegrations/ts-sdk/commit/b25bfa6e05ad445d5a001f48593b2be8a5285d2f))
* **internal:** codegen related update ([ef19aea](https://github.com/openintegrations/ts-sdk/commit/ef19aea8d5a1c09131c73d397dee93906f4caaac))
* **internal:** refactor utils ([bccab80](https://github.com/openintegrations/ts-sdk/commit/bccab80cfcdc997e88860dd2330f7dbd378f97e9))
* **internal:** share typescript helpers ([62a47ce](https://github.com/openintegrations/ts-sdk/commit/62a47ce64118bc8f57e767102c55be72ab57c9e6))


### Documentation

* **readme:** fix typo ([8a57cc3](https://github.com/openintegrations/ts-sdk/commit/8a57cc30d4a9012ce05d0dfaf8a7f6bb86e92749))

## 1.5.0 (2025-04-23)

Full Changelog: [v1.4.2...v1.5.0](https://github.com/openintegrations/ts-sdk/compare/v1.4.2...v1.5.0)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ async function main() {
main();
```

Error codes are as followed:
Error codes are as follows:

| Status Code | Error Type |
| ----------- | -------------------------- |
Expand Down
2 changes: 1 addition & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ Methods:
- <code title="get /viewer">client.<a href="./src/index.ts">getCurrentUser</a>() -> GetCurrentUserResponse</code>
- <code title="get /connector-config">client.<a href="./src/index.ts">listConnectionConfigs</a>({ ...params }) -> ListConnectionConfigsResponsesOffsetPagination</code>
- <code title="get /connection">client.<a href="./src/index.ts">listConnections</a>({ ...params }) -> ListConnectionsResponsesOffsetPagination</code>
- <code title="get /connector">client.<a href="./src/index.ts">listConnectors</a>({ ...params }) -> ListConnectorsResponse</code>
- <code title="get /connector">client.<a href="./src/index.ts">listConnectors</a>({ ...params }) -> ListConnectorsResponsesOffsetPagination</code>
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openint/sdk",
"version": "1.5.0",
"version": "1.6.0",
"description": "The official TypeScript library for the Openint API",
"author": "Openint <[email protected]>",
"types": "dist/index.d.ts",
Expand All @@ -17,7 +17,7 @@
"test": "./scripts/test",
"build": "./scripts/build",
"prepublishOnly": "echo 'to publish, run yarn build && (cd dist; yarn publish)' && exit 1",
"format": "prettier --write --cache --cache-strategy metadata . !dist",
"format": "./scripts/format",
"prepare": "if ./scripts/utils/check-is-in-git-install.sh; then ./scripts/build && ./scripts/utils/git-swap.sh; fi",
"tsn": "ts-node -r tsconfig-paths/register",
"lint": "./scripts/lint",
Expand All @@ -30,9 +30,9 @@
"@swc/jest": "^0.2.29",
"@types/jest": "^29.4.0",
"@types/node": "^20.17.6",
"typescript-eslint": "^8.24.0",
"@typescript-eslint/eslint-plugin": "^8.24.0",
"@typescript-eslint/parser": "^8.24.0",
"typescript-eslint": "8.31.1",
"@typescript-eslint/eslint-plugin": "8.31.1",
"@typescript-eslint/parser": "8.31.1",
"eslint": "^9.20.1",
"eslint-plugin-prettier": "^5.2.3",
"eslint-plugin-unused-imports": "^4.1.4",
Expand All @@ -42,9 +42,9 @@
"publint": "^0.2.12",
"ts-jest": "^29.1.0",
"ts-node": "^10.5.0",
"tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.3/tsc-multi.tgz",
"tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.4/tsc-multi-1.1.4.tgz",
"tsconfig-paths": "^4.0.0",
"typescript": "^4.8.2"
"typescript": "5.8.3"
},
"resolutions": {
"synckit": "0.8.8"
Expand Down
5 changes: 1 addition & 4 deletions release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,5 @@
}
],
"release-type": "node",
"extra-files": [
"src/version.ts",
"README.md"
]
"extra-files": ["src/version.ts", "README.md"]
}
6 changes: 5 additions & 1 deletion scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@ for file in LICENSE CHANGELOG.md; do
if [ -e "${file}" ]; then cp "${file}" dist; fi
done
if [ -e "bin/cli" ]; then
mkdir dist/bin
mkdir -p dist/bin
cp -p "bin/cli" dist/bin/;
fi
if [ -e "bin/migration-config.json" ]; then
mkdir -p dist/bin
cp -p "bin/migration-config.json" dist/bin/;
fi
# this converts the export map paths for the dist directory
# and does a few other minor things
node scripts/utils/make-dist-package-json.cjs > dist/package.json
Expand Down
4 changes: 4 additions & 0 deletions scripts/format
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ cd "$(dirname "$0")/.."

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'
19 changes: 12 additions & 7 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import {
ListConnectionsResponsesOffsetPagination,
ListConnectorsParams,
ListConnectorsResponse,
ListConnectorsResponsesOffsetPagination,
} from './resources/top-level';
import { APIPromise } from './core/api-promise';
import { type Fetch } from './internal/builtin-types';
Expand Down Expand Up @@ -294,8 +295,11 @@ export class Openint {
listConnectors(
query: TopLevelAPI.ListConnectorsParams | null | undefined = {},
options?: RequestOptions,
): APIPromise<TopLevelAPI.ListConnectorsResponse> {
return this.get('/connector', { query, ...options });
): Pagination.PagePromise<ListConnectorsResponsesOffsetPagination, TopLevelAPI.ListConnectorsResponse> {
return this.getAPIList('/connector', Pagination.OffsetPagination<TopLevelAPI.ListConnectorsResponse>, {
query,
...options,
});
}

protected defaultQuery(): Record<string, string | undefined> | undefined {
Expand Down Expand Up @@ -635,12 +639,12 @@ export class Openint {
fetchOptions.method = method.toUpperCase();
}

return (
try {
// use undefined this binding; fetch errors if bound to something else in browser/cloudflare
this.fetch.call(undefined, url, fetchOptions).finally(() => {
clearTimeout(timeout);
})
);
return await this.fetch.call(undefined, url, fetchOptions);
} finally {
clearTimeout(timeout);
}
}

private shouldRetry(response: Response): boolean {
Expand Down Expand Up @@ -862,6 +866,7 @@ export declare namespace Openint {
type ListConnectorsResponse as ListConnectorsResponse,
type ListConnectionConfigsResponsesOffsetPagination as ListConnectionConfigsResponsesOffsetPagination,
type ListConnectionsResponsesOffsetPagination as ListConnectionsResponsesOffsetPagination,
type ListConnectorsResponsesOffsetPagination as ListConnectorsResponsesOffsetPagination,
type CreateConnectionParams as CreateConnectionParams,
type CreateMagicLinkParams as CreateMagicLinkParams,
type CreateTokenParams as CreateTokenParams,
Expand Down
5 changes: 3 additions & 2 deletions src/internal/headers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
type HeaderValue = string | undefined | null;
export type HeadersLike =
| Headers
| readonly [string, HeaderValue][]
| readonly HeaderValue[][]
| Record<string, HeaderValue | readonly HeaderValue[]>
| undefined
| null
Expand Down Expand Up @@ -40,7 +40,7 @@ function* iterateHeaders(headers: HeadersLike): IterableIterator<readonly [strin
}

let shouldClear = false;
let iter: Iterable<readonly [string, HeaderValue | readonly HeaderValue[]]>;
let iter: Iterable<readonly (HeaderValue | readonly HeaderValue[])[]>;
if (headers instanceof Headers) {
iter = headers.entries();
} else if (isArray(headers)) {
Expand All @@ -51,6 +51,7 @@ function* iterateHeaders(headers: HeadersLike): IterableIterator<readonly [strin
}
for (let row of iter) {
const name = row[0];
if (typeof name !== 'string') throw new TypeError('expected header name to be a string');
const values = isArray(row[1]) ? row[1] : [row[1]];
let didClear = false;
for (const value of values) {
Expand Down
9 changes: 5 additions & 4 deletions src/internal/utils/base64.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import { OpenintError } from '../../core/error';
import { encodeUTF8 } from './bytes';

export const toBase64 = (data: string | Uint8Array | null | undefined): string => {
if (!data) return '';

if (typeof data === 'string') {
data = new (globalThis as any).TextEncoder().encode(data);
}

if (typeof (globalThis as any).Buffer !== 'undefined') {
return (globalThis as any).Buffer.from(data).toString('base64');
}

if (typeof data === 'string') {
data = encodeUTF8(data);
}

if (typeof btoa !== 'undefined') {
return btoa(String.fromCharCode.apply(null, data as any));
}
Expand Down
32 changes: 32 additions & 0 deletions src/internal/utils/bytes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
export function concatBytes(buffers: Uint8Array[]): Uint8Array {
let length = 0;
for (const buffer of buffers) {
length += buffer.length;
}
const output = new Uint8Array(length);
let index = 0;
for (const buffer of buffers) {
output.set(buffer, index);
index += buffer.length;
}

return output;
}

let encodeUTF8_: (str: string) => Uint8Array;
export function encodeUTF8(str: string) {
let encoder;
return (
encodeUTF8_ ??
((encoder = new (globalThis as any).TextEncoder()), (encodeUTF8_ = encoder.encode.bind(encoder)))
)(str);
}

let decodeUTF8_: (bytes: Uint8Array) => string;
export function decodeUTF8(bytes: Uint8Array) {
let decoder;
return (
decodeUTF8_ ??
((decoder = new (globalThis as any).TextDecoder()), (decodeUTF8_ = decoder.decode.bind(decoder)))
)(bytes);
}
1 change: 1 addition & 0 deletions src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ export {
type ListConnectorsParams,
type ListConnectionConfigsResponsesOffsetPagination,
type ListConnectionsResponsesOffsetPagination,
type ListConnectorsResponsesOffsetPagination,
} from './top-level';
Loading