diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 90365fe..800f691 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,12 +7,17 @@ on: - 'integrated/**' - 'stl-preview-head/**' - 'stl-preview-base/**' + pull_request: + branches-ignore: + - 'stl-preview-head/**' + - 'stl-preview-base/**' jobs: lint: timeout-minutes: 10 name: lint runs-on: ${{ github.repository == 'stainless-sdks/gitpod-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@v4 @@ -31,6 +36,7 @@ jobs: timeout-minutes: 5 name: build runs-on: ${{ github.repository == 'stainless-sdks/gitpod-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork permissions: contents: read id-token: write @@ -66,6 +72,7 @@ jobs: timeout-minutes: 10 name: test runs-on: ${{ github.repository == 'stainless-sdks/gitpod-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index f875bac..742b303 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -19,3 +19,4 @@ jobs: bash ./bin/check-release-environment env: NPM_TOKEN: ${{ secrets.GITPOD_NPM_TOKEN || secrets.NPM_TOKEN }} + diff --git a/.gitignore b/.gitignore index d98d51a..2412bb7 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ dist dist-deno /*.tgz .idea/ +.eslintcache diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 5d02000..e7ca613 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.6.1" + ".": "0.7.0" } diff --git a/.stats.yml b/.stats.yml index d375176..9333247 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 119 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-ca9a49ac7fbb63f55611fd7cd48a22a3ff8b38a797125c8513e891d9b7345550.yml openapi_spec_hash: fd6ffbdfaefcc555e61ca1c565e05214 -config_hash: bb9d0a0bdadbee0985dd7c1e4f0e9e8a +config_hash: 7fb76543ceafd4a116473f647f8d63b1 diff --git a/CHANGELOG.md b/CHANGELOG.md index affcdeb..5f37e8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,63 @@ # Changelog +## 0.7.0 (2025-12-06) + +Full Changelog: [v0.6.1...v0.7.0](https://github.com/gitpod-io/gitpod-sdk-typescript/compare/v0.6.1...v0.7.0) + +### Features + +* **api:** gitpod -> ona ([7dd2c73](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/7dd2c736dca78fd6e3ae53f7e0f4c38c1d3e8d51)) +* **client:** add support for endpoint-specific base URLs ([58af560](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/58af5608bf0d0d76c9dd265a490d783d030c8a1b)) + + +### Bug Fixes + +* **ci:** release-doctor — report correct token name ([79e4102](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/79e410295dc2458cd03350be63599471fc824b9d)) +* **client:** explicitly copy fetch in withOptions ([a1b72c1](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/a1b72c1c69aa05aa06e044a90a44d7916b680561)) +* **client:** get fetchOptions type more reliably ([ba531a3](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/ba531a3e666c9d4537b81ec68de4075d12f13d01)) +* coerce nullable values to undefined ([ffdccb0](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/ffdccb0e49830a82590c56a6d7f3a6bacbd8fa3f)) +* **mcp:** correct code tool API endpoint ([3241e0a](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/3241e0a1f56ba7df24cb526bd98351bf176c9b88)) +* **mcp:** return correct lines on typescript errors ([4b60eca](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/4b60eca50967c00d9f338a11d692dc6ebffd6b01)) + + +### Performance Improvements + +* faster formatting ([0bcf5a5](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/0bcf5a56589d7394d44fd36616b3849f7d775404)) + + +### Chores + +* add docs to RequestOptions type ([8c480ed](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/8c480ede43e6e1a6cc37ab844e4934831478a5e0)) +* ci build action ([f6572f1](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/f6572f1fc89db0e5e02d271e49cff571cf6b3c60)) +* **ci:** enable for pull requests ([eac032a](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/eac032a15b4c7a929096cea573bf3c8290021f84)) +* **ci:** only run for pushes and fork pull requests ([94a8575](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/94a857551f39d1e2828c253e250b0fb95effa5bb)) +* **client:** fix logger property type ([71b844a](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/71b844a4b2b13df332b3e2ce9ddc6c825abeb22e)) +* **client:** improve path param validation ([79ac088](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/79ac088c67fd2c9d476f0ce0f279985d6df25f4e)) +* **client:** refactor imports ([44c7836](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/44c7836e0e2cd7f4ec4ae8ac9d34342c5c66a4bd)) +* do not install brew dependencies in ./scripts/bootstrap by default ([d12db33](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/d12db33eb3a4911c3bb45233590005b21efb7e1c)) +* **internal:** codegen related update ([3f4e8d1](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/3f4e8d16cb0818903865e6d40605f6982110a20f)) +* **internal:** codegen related update ([57886a7](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/57886a747a3af50684003d2e40184ffc0de3c65e)) +* **internal:** codegen related update ([e888600](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/e88860061aee55c5e978ace2556a36fd97ef0258)) +* **internal:** fix incremental formatting in some cases ([0a51f9f](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/0a51f9f3dba744cf5282eba4b188047b03b391f5)) +* **internal:** ignore .eslintcache ([cf1696e](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/cf1696e737f8896647f8dd9fad70a78988958672)) +* **internal:** move publish config ([f8c49d7](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/f8c49d7ed61411de581e4dba05eba8456eb72f6c)) +* **internal:** remove deprecated `compilerOptions.baseUrl` from tsconfig.json ([602b768](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/602b7681eaa94ea1672ebd58852478dab56f883c)) +* **internal:** remove redundant imports config ([de89cb7](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/de89cb791929375079082c1bd13cc13620ed8aae)) +* **internal:** update comment in script ([adcc1e0](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/adcc1e04378865df15272dcc788b96f2d8781a8a)) +* **internal:** upgrade eslint ([878386a](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/878386aebf1c8c9287f8362e0a3f697e16cd857a)) +* **internal:** use npm pack for build uploads ([0febcc8](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/0febcc870974caef358d1b67c992a4fb408e692d)) +* **jsdoc:** fix [@link](https://github.com/link) annotations to refer only to parts of the package‘s public interface ([8ed65d8](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/8ed65d8b6ea2757ce26cdcc509be12c6a18fa37a)) +* make some internal functions async ([ac410b3](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/ac410b310603548f18d46976224a69fb9eabf5a3)) +* **readme:** update badges ([5a69575](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/5a695752d9af858bb04f9e774ddf76f8a22544bb)) +* **readme:** use better example snippet for undocumented params ([75e8a63](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/75e8a63ec1307838671b24cda3bb3cbeb4ea9dbf)) +* **ts:** reorder package.json imports ([a896a22](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/a896a228b3ab8950f9a7c016bc445bfe43a88240)) +* update @stainless-api/prism-cli to v5.15.0 ([fe746f4](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/fe746f463f825425f80e70dca69edd18032872db)) + + +### Refactors + +* **types:** replace Record with mapped types ([2b43824](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/2b43824896e47429c4eeb102bae2fb0ca820528f)) + ## 0.6.1 (2025-06-14) Full Changelog: [v0.6.0...v0.6.1](https://github.com/gitpod-io/gitpod-sdk-typescript/compare/v0.6.0...v0.6.1) diff --git a/README.md b/README.md index 31de3bb..74f5d18 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # Gitpod TypeScript API Library -[![NPM version](https://img.shields.io/npm/v/@gitpod/sdk.svg)](https://npmjs.org/package/@gitpod/sdk) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/@gitpod/sdk) +[![NPM version]()](https://npmjs.org/package/@gitpod/sdk) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/@gitpod/sdk) This library provides convenient access to the Gitpod REST API from server-side TypeScript or JavaScript. -The REST API documentation can be found on [docs.gitpod.io](https://docs.gitpod.io). The full API of this library can be found in [api.md](api.md). +The REST API documentation can be found on [docs.ona.com](https://docs.ona.com). The full API of this library can be found in [api.md](api.md). It is generated with [Stainless](https://www.stainless.com/). @@ -254,9 +254,8 @@ parameter. This library doesn't validate at runtime that the request matches the send will be sent as-is. ```ts -client.foo.create({ - foo: 'my_param', - bar: 12, +client.identity.getAuthenticatedIdentity({ + // ... // @ts-expect-error baz is not yet public baz: 'undocumented option', }); diff --git a/SECURITY.md b/SECURITY.md index efd9088..8975e82 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -20,7 +20,7 @@ or products provided by Gitpod, please follow the respective company's security ### Gitpod Terms and Policies -Please contact dev-feedback@gitpod.com for any questions or concerns regarding the security of our services. +Please contact dev-feedback@ona.com for any questions or concerns regarding the security of our services. --- diff --git a/bin/check-release-environment b/bin/check-release-environment index 0d4280c..e4b6d58 100644 --- a/bin/check-release-environment +++ b/bin/check-release-environment @@ -3,7 +3,7 @@ errors=() if [ -z "${NPM_TOKEN}" ]; then - errors+=("The GITPOD_NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets") + errors+=("The NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets") fi lenErrors=${#errors[@]} diff --git a/bin/publish-npm b/bin/publish-npm index fa2243d..45e8aa8 100644 --- a/bin/publish-npm +++ b/bin/publish-npm @@ -58,4 +58,4 @@ else fi # Publish with the appropriate tag -yarn publish --access public --tag "$TAG" +yarn publish --tag "$TAG" diff --git a/package.json b/package.json index 35f22df..74106f7 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "@gitpod/sdk", - "version": "0.6.1", + "version": "0.7.0", "description": "The official TypeScript library for the Gitpod API", - "author": "Gitpod ", + "author": "Gitpod ", "types": "dist/index.d.ts", "main": "dist/index.js", "type": "commonjs", @@ -13,6 +13,9 @@ "**/*" ], "private": false, + "publishConfig": { + "access": "public" + }, "scripts": { "test": "./scripts/test", "build": "./scripts/build", @@ -34,7 +37,7 @@ "@types/sshpk": "^1.17.4", "@typescript-eslint/eslint-plugin": "8.31.1", "@typescript-eslint/parser": "8.31.1", - "eslint": "^9.20.1", + "eslint": "^9.39.1", "eslint-plugin-prettier": "^5.4.1", "eslint-plugin-unused-imports": "^4.1.4", "iconv-lite": "^0.6.3", @@ -45,15 +48,12 @@ "sshpk": "^1.18.0", "ts-jest": "^29.1.0", "ts-node": "^10.5.0", - "tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.7/tsc-multi.tgz", + "tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.9/tsc-multi.tgz", "tsconfig-paths": "^4.0.0", + "tslib": "^2.8.1", "typescript": "5.8.3", "typescript-eslint": "8.31.1" }, - "imports": { - "@gitpod/sdk": ".", - "@gitpod/sdk/*": "./src/*" - }, "exports": { ".": { "import": "./dist/index.mjs", diff --git a/scripts/bootstrap b/scripts/bootstrap index 0af58e2..a8b69ff 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -4,10 +4,18 @@ set -e cd "$(dirname "$0")/.." -if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ]; then +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then brew bundle check >/dev/null 2>&1 || { - echo "==> Installing Homebrew dependencies…" - brew bundle + echo -n "==> Install Homebrew dependencies? (y/N): " + read -r response + case "$response" in + [yY][eE][sS]|[yY]) + brew bundle + ;; + *) + ;; + esac + echo } fi @@ -15,4 +23,4 @@ echo "==> Installing Node dependencies…" PACKAGE_MANAGER=$(command -v yarn >/dev/null 2>&1 && echo "yarn" || echo "npm") -$PACKAGE_MANAGER install +$PACKAGE_MANAGER install "$@" diff --git a/scripts/fast-format b/scripts/fast-format new file mode 100755 index 0000000..53721ac --- /dev/null +++ b/scripts/fast-format @@ -0,0 +1,40 @@ +#!/usr/bin/env bash + +set -euo pipefail + +echo "Script started with $# arguments" +echo "Arguments: $*" +echo "Script location: $(dirname "$0")" + +cd "$(dirname "$0")/.." +echo "Changed to directory: $(pwd)" + +if [ $# -eq 0 ]; then + echo "Usage: $0 [additional-formatter-args...]" + echo "The file should contain one file path per line" + exit 1 +fi + +FILE_LIST="$1" + +echo "Looking for file: $FILE_LIST" + +if [ ! -f "$FILE_LIST" ]; then + echo "Error: File '$FILE_LIST' not found" + exit 1 +fi + +echo "==> Running eslint --fix" +ESLINT_FILES="$(grep '\.ts$' "$FILE_LIST" || true)" +if ! [ -z "$ESLINT_FILES" ]; then + echo "$ESLINT_FILES" | xargs ./node_modules/.bin/eslint --cache --fix +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' +fi diff --git a/scripts/mock b/scripts/mock index d2814ae..0b28f6e 100755 --- a/scripts/mock +++ b/scripts/mock @@ -21,7 +21,7 @@ echo "==> Starting mock server with URL ${URL}" # Run prism mock on the given spec if [ "$1" == "--daemon" ]; then - npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" &> .prism.log & + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & # Wait for server to come online echo -n "Waiting for server" @@ -37,5 +37,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" fi diff --git a/scripts/test b/scripts/test index 2049e31..7bce051 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! prism_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the prism command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stoplight/prism-cli@~5.3.2 -- prism mock path/to/your.openapi.yml${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}" echo exit 1 diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh index 864a4c8..62182fb 100755 --- a/scripts/utils/upload-artifact.sh +++ b/scripts/utils/upload-artifact.sh @@ -12,9 +12,11 @@ if [[ "$SIGNED_URL" == "null" ]]; then exit 1 fi -UPLOAD_RESPONSE=$(tar -cz dist | curl -v -X PUT \ +TARBALL=$(cd dist && npm pack --silent) + +UPLOAD_RESPONSE=$(curl -v -X PUT \ -H "Content-Type: application/gzip" \ - --data-binary @- "$SIGNED_URL" 2>&1) + --data-binary "@dist/$TARBALL" "$SIGNED_URL" 2>&1) if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then echo -e "\033[32mUploaded build to Stainless storage.\033[0m" diff --git a/src/client.ts b/src/client.ts index ac677ba..1727bcc 100644 --- a/src/client.ts +++ b/src/client.ts @@ -5,7 +5,13 @@ import type { HTTPMethod, PromiseOrValue, MergedRequestInit, FinalizedRequestIni import { uuid4 } from './internal/utils/uuid'; import { validatePositiveInteger, isAbsoluteURL, safeJSON } from './internal/utils/values'; import { sleep } from './internal/utils/sleep'; -import { type Logger, type LogLevel as LogLevelClient, parseLogLevel } from './internal/utils/log'; +import { + type Logger, + type LogLevel as LogLevelClient, + parseLogLevel, + loggerFor, + formatRequestDetails, +} from './internal/utils/log'; export type { Logger, LogLevel as LogLevelClient } from './internal/utils/log'; import { castToError, isAbortError } from './internal/errors'; import type { APIResponseProps } from './internal/parse'; @@ -63,9 +69,6 @@ import { import * as Uploads from './core/uploads'; import * as API from './resources/index'; import { APIPromise } from './core/api-promise'; -import { type Fetch } from './internal/builtin-types'; -import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers'; -import { FinalRequestOptions, RequestOptions } from './internal/request-options'; import { Account, AccountDeleteParams, @@ -136,9 +139,6 @@ import { Usage, UsageListEnvironmentRuntimeRecordsParams, } from './resources/usage'; -import { readEnv } from './internal/utils/env'; -import { formatRequestDetails, loggerFor } from './internal/utils/log'; -import { isEmptyObj } from './internal/utils/values'; import { AdmissionLevel, Environment, @@ -254,6 +254,11 @@ import { UserSetSuspendedResponse, Users, } from './resources/users/users'; +import { type Fetch } from './internal/builtin-types'; +import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers'; +import { FinalRequestOptions, RequestOptions } from './internal/request-options'; +import { readEnv } from './internal/utils/env'; +import { isEmptyObj } from './internal/utils/values'; export interface ClientOptions { /** @@ -274,6 +279,8 @@ export interface ClientOptions { * * Note that request timeouts are retried by default, so in a worst-case scenario you may wait * much longer than this timeout before the promise succeeds or fails. + * + * @unit milliseconds */ timeout?: number | undefined; /** @@ -337,8 +344,8 @@ export class Gitpod { baseURL: string; maxRetries: number; timeout: number; - logger: Logger | undefined; logLevel: LogLevelClient | undefined; + logger: Logger; fetchOptions: MergedRequestInit | undefined; private fetch: Fetch; @@ -399,17 +406,26 @@ export class Gitpod { * Create a new client instance re-using the same options given to the current client with optional overriding. */ withOptions(options: Partial): this { - return new (this.constructor as any as new (props: ClientOptions) => typeof this)({ + const client = new (this.constructor as any as new (props: ClientOptions) => typeof this)({ ...this._options, baseURL: this.baseURL, maxRetries: this.maxRetries, timeout: this.timeout, logger: this.logger, logLevel: this.logLevel, + fetch: this.fetch, fetchOptions: this.fetchOptions, bearerToken: this.bearerToken, ...options, }); + return client; + } + + /** + * Check whether the base URL is set to its default. + */ + #baseURLOverridden(): boolean { + return this.baseURL !== 'https://app.gitpod.io/api'; } protected defaultQuery(): Record | undefined { @@ -420,7 +436,7 @@ export class Gitpod { return; } - protected authHeaders(opts: FinalRequestOptions): NullableHeaders | undefined { + protected async authHeaders(opts: FinalRequestOptions): Promise { return buildHeaders([{ Authorization: `Bearer ${this.bearerToken}` }]); } @@ -461,11 +477,16 @@ export class Gitpod { return Errors.APIError.generate(status, error, message, headers); } - buildURL(path: string, query: Record | null | undefined): string { + buildURL( + path: string, + query: Record | null | undefined, + defaultBaseURL?: string | undefined, + ): string { + const baseURL = (!this.#baseURLOverridden() && defaultBaseURL) || this.baseURL; const url = isAbsoluteURL(path) ? new URL(path) - : new URL(this.baseURL + (this.baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path)); + : new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path)); const defaultQuery = this.defaultQuery(); if (!isEmptyObj(defaultQuery)) { @@ -547,7 +568,9 @@ export class Gitpod { await this.prepareOptions(options); - const { req, url, timeout } = this.buildRequest(options, { retryCount: maxRetries - retriesRemaining }); + const { req, url, timeout } = await this.buildRequest(options, { + retryCount: maxRetries - retriesRemaining, + }); await this.prepareRequest(req, { url, options }); @@ -575,7 +598,7 @@ export class Gitpod { const response = await this.fetchWithTimeout(url, req, timeout, controller).catch(castToError); const headersTime = Date.now(); - if (response instanceof Error) { + if (response instanceof globalThis.Error) { const retryMessage = `retrying, ${retriesRemaining} attempts remaining`; if (options.signal?.aborted) { throw new Errors.APIUserAbortError(); @@ -625,7 +648,7 @@ export class Gitpod { } with status ${response.status} in ${headersTime - startTime}ms`; if (!response.ok) { - const shouldRetry = this.shouldRetry(response); + const shouldRetry = await this.shouldRetry(response); if (retriesRemaining && shouldRetry) { const retryMessage = `retrying, ${retriesRemaining} attempts remaining`; @@ -743,7 +766,7 @@ export class Gitpod { } } - private shouldRetry(response: Response): boolean { + private async shouldRetry(response: Response): Promise { // Note this is not a standard header. const shouldRetryHeader = response.headers.get('x-should-retry'); @@ -820,18 +843,18 @@ export class Gitpod { return sleepSeconds * jitter * 1000; } - buildRequest( + async buildRequest( inputOptions: FinalRequestOptions, { retryCount = 0 }: { retryCount?: number } = {}, - ): { req: FinalizedRequestInit; url: string; timeout: number } { + ): Promise<{ req: FinalizedRequestInit; url: string; timeout: number }> { const options = { ...inputOptions }; - const { method, path, query } = options; + const { method, path, query, defaultBaseURL } = options; - const url = this.buildURL(path!, query as Record); + const url = this.buildURL(path!, query as Record, defaultBaseURL); if ('timeout' in options) validatePositiveInteger('timeout', options.timeout); options.timeout = options.timeout ?? this.timeout; const { bodyHeaders, body } = this.buildBody({ options }); - const reqHeaders = this.buildHeaders({ options: inputOptions, method, bodyHeaders, retryCount }); + const reqHeaders = await this.buildHeaders({ options: inputOptions, method, bodyHeaders, retryCount }); const req: FinalizedRequestInit = { method, @@ -847,7 +870,7 @@ export class Gitpod { return { req, url, timeout: options.timeout }; } - private buildHeaders({ + private async buildHeaders({ options, method, bodyHeaders, @@ -857,7 +880,7 @@ export class Gitpod { method: HTTPMethod; bodyHeaders: HeadersLike; retryCount: number; - }): Headers { + }): Promise { let idempotencyHeaders: HeadersLike = {}; if (this.idempotencyHeader && method !== 'get') { if (!options.idempotencyKey) options.idempotencyKey = this.defaultIdempotencyKey(); @@ -873,7 +896,7 @@ export class Gitpod { ...(options.timeout ? { 'X-Stainless-Timeout': String(Math.trunc(options.timeout / 1000)) } : {}), ...getPlatformHeaders(), }, - this.authHeaders(options), + await this.authHeaders(options), this._options.defaultHeaders, bodyHeaders, options.headers, @@ -901,7 +924,7 @@ export class Gitpod { // Preserve legacy string encoding behavior for now headers.values.has('content-type')) || // `Blob` is superset of `File` - body instanceof Blob || + ((globalThis as any).Blob && body instanceof (globalThis as any).Blob) || // `FormData` -> `multipart/form-data` body instanceof FormData || // `URLSearchParams` -> `application/x-www-form-urlencoded` @@ -954,6 +977,7 @@ export class Gitpod { usage: API.Usage = new API.Usage(this); users: API.Users = new API.Users(this); } + Gitpod.Accounts = Accounts; Gitpod.Editors = Editors; Gitpod.Environments = Environments; @@ -967,6 +991,7 @@ Gitpod.Runners = Runners; Gitpod.Secrets = Secrets; Gitpod.Usage = Usage; Gitpod.Users = Users; + export declare namespace Gitpod { export type RequestOptions = Opts.RequestOptions; diff --git a/src/internal/request-options.ts b/src/internal/request-options.ts index d2ade9e..2aabf9a 100644 --- a/src/internal/request-options.ts +++ b/src/internal/request-options.ts @@ -9,18 +9,72 @@ import { type HeadersLike } from './headers'; export type FinalRequestOptions = RequestOptions & { method: HTTPMethod; path: string }; export type RequestOptions = { + /** + * The HTTP method for the request (e.g., 'get', 'post', 'put', 'delete'). + */ method?: HTTPMethod; + + /** + * The URL path for the request. + * + * @example "/v1/foo" + */ path?: string; + + /** + * Query parameters to include in the request URL. + */ query?: object | undefined | null; + + /** + * The request body. Can be a string, JSON object, FormData, or other supported types. + */ body?: unknown; + + /** + * HTTP headers to include with the request. Can be a Headers object, plain object, or array of tuples. + */ headers?: HeadersLike; + + /** + * The maximum number of times that the client will retry a request in case of a + * temporary failure, like a network error or a 5XX error from the server. + * + * @default 2 + */ maxRetries?: number; + stream?: boolean | undefined; + + /** + * The maximum amount of time (in milliseconds) that the client should wait for a response + * from the server before timing out a single request. + * + * @unit milliseconds + */ timeout?: number; + + /** + * Additional `RequestInit` options to be passed to the underlying `fetch` call. + * These options will be merged with the client's default fetch options. + */ fetchOptions?: MergedRequestInit; + + /** + * An AbortSignal that can be used to cancel the request. + */ signal?: AbortSignal | undefined | null; + + /** + * A unique key for this request to enable idempotency. + */ idempotencyKey?: string; + /** + * Override the default base URL for this specific request. + */ + defaultBaseURL?: string | undefined; + __binaryResponse?: boolean | undefined; }; diff --git a/src/internal/to-file.ts b/src/internal/to-file.ts index 245e849..30eada3 100644 --- a/src/internal/to-file.ts +++ b/src/internal/to-file.ts @@ -73,7 +73,7 @@ export type ToFileInput = /** * Helper for creating a {@link File} to pass to an SDK upload method from a variety of different data formats - * @param value the raw content of the file. Can be an {@link Uploadable}, {@link BlobLikePart}, or {@link AsyncIterable} of {@link BlobLikePart}s + * @param value the raw content of the file. Can be an {@link Uploadable}, BlobLikePart, or AsyncIterable of BlobLikeParts * @param {string=} name the name of the file. If omitted, toFile will try to determine a file name from bits if possible * @param {Object=} options additional properties * @param {string=} options.type the MIME type of the content diff --git a/src/internal/types.ts b/src/internal/types.ts index d7928cd..b668dfc 100644 --- a/src/internal/types.ts +++ b/src/internal/types.ts @@ -7,7 +7,7 @@ export type KeysEnum = { [P in keyof Required]: true }; export type FinalizedRequestInit = RequestInit & { headers: Headers }; -type NotAny = [unknown] extends [T] ? never : T; +type NotAny = [0] extends [1 & T] ? never : T; /** * Some environments overload the global fetch function, and Parameters only gets the last signature. @@ -64,13 +64,15 @@ type OverloadedParameters = * [1]: https://www.typescriptlang.org/tsconfig/#typeAcquisition */ /** @ts-ignore For users with \@types/node */ -type UndiciTypesRequestInit = NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny; +type UndiciTypesRequestInit = NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny; /** @ts-ignore For users with undici */ -type UndiciRequestInit = NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny; +type UndiciRequestInit = NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny; /** @ts-ignore For users with \@types/bun */ type BunRequestInit = globalThis.FetchRequestInit; -/** @ts-ignore For users with node-fetch */ -type NodeFetchRequestInit = NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny; +/** @ts-ignore For users with node-fetch@2 */ +type NodeFetch2RequestInit = NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny; +/** @ts-ignore For users with node-fetch@3, doesn't need file extension because types are at ./@types/index.d.ts */ +type NodeFetch3RequestInit = NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny; /** @ts-ignore For users who use Deno */ type FetchRequestInit = NonNullable[1]>; /* eslint-enable */ @@ -79,7 +81,8 @@ type RequestInits = | NotAny | NotAny | NotAny - | NotAny + | NotAny + | NotAny | NotAny | NotAny; diff --git a/src/internal/uploads.ts b/src/internal/uploads.ts index b9a6090..85b9d20 100644 --- a/src/internal/uploads.ts +++ b/src/internal/uploads.ts @@ -90,7 +90,7 @@ export const multipartFormRequestOptions = async ( return { ...opts, body: await createForm(opts.body, fetch) }; }; -const supportsFormDataMap = /** @__PURE__ */ new WeakMap>(); +const supportsFormDataMap = /* @__PURE__ */ new WeakMap>(); /** * node-fetch doesn't support the global FormData object in recent node versions. Instead of sending diff --git a/src/internal/utils/log.ts b/src/internal/utils/log.ts index dcbf51c..ce9d052 100644 --- a/src/internal/utils/log.ts +++ b/src/internal/utils/log.ts @@ -58,7 +58,7 @@ const noopLogger = { debug: noop, }; -let cachedLoggers = /** @__PURE__ */ new WeakMap(); +let cachedLoggers = /* @__PURE__ */ new WeakMap(); export function loggerFor(client: Gitpod): Logger { const logger = client.logger; diff --git a/src/internal/utils/path.ts b/src/internal/utils/path.ts index 5800607..49baec7 100644 --- a/src/internal/utils/path.ts +++ b/src/internal/utils/path.ts @@ -12,25 +12,43 @@ export function encodeURIPath(str: string) { return str.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent); } +const EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null)); + export const createPathTagFunction = (pathEncoder = encodeURIPath) => function path(statics: readonly string[], ...params: readonly unknown[]): string { // If there are no params, no processing is needed. if (statics.length === 1) return statics[0]!; let postPath = false; + const invalidSegments = []; const path = statics.reduce((previousValue, currentValue, index) => { if (/[?#]/.test(currentValue)) { postPath = true; } - return ( - previousValue + - currentValue + - (index === params.length ? '' : (postPath ? encodeURIComponent : pathEncoder)(String(params[index]))) - ); + const value = params[index]; + let encoded = (postPath ? encodeURIComponent : pathEncoder)('' + value); + if ( + index !== params.length && + (value == null || + (typeof value === 'object' && + // handle values from other realms + value.toString === + Object.getPrototypeOf(Object.getPrototypeOf((value as any).hasOwnProperty ?? EMPTY) ?? EMPTY) + ?.toString)) + ) { + encoded = value + ''; + invalidSegments.push({ + start: previousValue.length + currentValue.length, + length: encoded.length, + error: `Value of type ${Object.prototype.toString + .call(value) + .slice(8, -1)} is not a valid path parameter`, + }); + } + return previousValue + currentValue + (index === params.length ? '' : encoded); }, ''); const pathOnly = path.split(/[?#]/, 1)[0]!; - const invalidSegments = []; const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi; let match; @@ -39,9 +57,12 @@ export const createPathTagFunction = (pathEncoder = encodeURIPath) => invalidSegments.push({ start: match.index, length: match[0].length, + error: `Value "${match[0]}" can\'t be safely passed as a path parameter`, }); } + invalidSegments.sort((a, b) => a.start - b.start); + if (invalidSegments.length > 0) { let lastEnd = 0; const underline = invalidSegments.reduce((acc, segment) => { @@ -51,7 +72,11 @@ export const createPathTagFunction = (pathEncoder = encodeURIPath) => return acc + spaces + arrows; }, ''); - throw new GitpodError(`Path parameters result in path with invalid segments:\n${path}\n${underline}`); + throw new GitpodError( + `Path parameters result in path with invalid segments:\n${invalidSegments + .map((e) => e.error) + .join('\n')}\n${path}\n${underline}`, + ); } return path; diff --git a/src/internal/utils/values.ts b/src/internal/utils/values.ts index af2e5ed..3384670 100644 --- a/src/internal/utils/values.ts +++ b/src/internal/utils/values.ts @@ -76,21 +76,21 @@ export const coerceBoolean = (value: unknown): boolean => { }; export const maybeCoerceInteger = (value: unknown): number | undefined => { - if (value === undefined) { + if (value == null) { return undefined; } return coerceInteger(value); }; export const maybeCoerceFloat = (value: unknown): number | undefined => { - if (value === undefined) { + if (value == null) { return undefined; } return coerceFloat(value); }; export const maybeCoerceBoolean = (value: unknown): boolean | undefined => { - if (value === undefined) { + if (value == null) { return undefined; } return coerceBoolean(value); diff --git a/src/resources/environments/automations/automations.ts b/src/resources/environments/automations/automations.ts index 1f8efc2..0ef7335 100644 --- a/src/resources/environments/automations/automations.ts +++ b/src/resources/environments/automations/automations.ts @@ -127,9 +127,9 @@ export class Automations extends APIResource { * field as "reserved" in the proto file, this will also break reading the yaml. */ export interface AutomationsFile { - services?: Record; + services?: { [key: string]: AutomationsFile.Services }; - tasks?: Record; + tasks?: { [key: string]: AutomationsFile.Tasks }; } export namespace AutomationsFile { diff --git a/src/resources/environments/automations/services.ts b/src/resources/environments/automations/services.ts index f86390e..1abda28 100644 --- a/src/resources/environments/automations/services.ts +++ b/src/resources/environments/automations/services.ts @@ -476,7 +476,7 @@ export interface ServiceStatus { * output contains the output of the service. setting an output field to empty * string will unset it. */ - output?: Record; + output?: { [key: string]: string }; /** * phase is the current phase of the service. @@ -595,7 +595,7 @@ export namespace ServiceUpdateParams { /** * setting an output field to empty string will unset it. */ - output?: Record; + output?: { [key: string]: string }; phase?: ServicesAPI.ServicePhase | null; diff --git a/src/resources/environments/environments.ts b/src/resources/environments/environments.ts index 77e8304..1e85d49 100644 --- a/src/resources/environments/environments.ts +++ b/src/resources/environments/environments.ts @@ -621,7 +621,7 @@ export interface EnvironmentMetadata { * annotations are key/value pairs that gets attached to the environment. * +internal - not yet implemented */ - annotations?: Record; + annotations?: { [key: string]: string }; /** * Time when the Environment was archived. If not set, the environment is not diff --git a/src/resources/organizations/sso-configurations.ts b/src/resources/organizations/sso-configurations.ts index 5bc4655..88875e7 100644 --- a/src/resources/organizations/sso-configurations.ts +++ b/src/resources/organizations/sso-configurations.ts @@ -265,7 +265,7 @@ export interface SSOConfiguration { /** * claims are key/value pairs that defines a mapping of claims issued by the IdP. */ - claims?: Record; + claims?: { [key: string]: string }; /** * client_id is the client ID of the OIDC application set on the IdP @@ -338,7 +338,7 @@ export interface SSOConfigurationUpdateParams { /** * claims are key/value pairs that defines a mapping of claims issued by the IdP. */ - claims?: Record; + claims?: { [key: string]: string }; /** * client_id is the client ID of the SSO provider diff --git a/src/resources/shared.ts b/src/resources/shared.ts index b3ed4ee..a779cf3 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -306,7 +306,7 @@ export namespace TaskExecutionStatus { * output contains the output of the task execution. setting an output field to * empty string will unset it. */ - output?: Record; + output?: { [key: string]: string }; /** * phase is the current phase of the execution step diff --git a/src/version.ts b/src/version.ts index 3998d8e..d9da9f7 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.6.1'; // x-release-please-version +export const VERSION = '0.7.0'; // x-release-please-version diff --git a/tests/api-resources/accounts.test.ts b/tests/api-resources/accounts.test.ts index cb00eba..0b5df9a 100644 --- a/tests/api-resources/accounts.test.ts +++ b/tests/api-resources/accounts.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource accounts', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('retrieve', async () => { const responsePromise = client.accounts.retrieve({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource accounts', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('delete: only required params', async () => { const responsePromise = client.accounts.delete({ accountId: 'f53d2330-3795-4c5d-a1f3-453121af9c60' }); const rawResponse = await responsePromise.asResponse(); @@ -32,12 +32,12 @@ describe('resource accounts', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('delete: required and optional params', async () => { const response = await client.accounts.delete({ accountId: 'f53d2330-3795-4c5d-a1f3-453121af9c60' }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('getSSOLoginURL: only required params', async () => { const responsePromise = client.accounts.getSSOLoginURL({ email: 'user@company.com' }); const rawResponse = await responsePromise.asResponse(); @@ -49,7 +49,7 @@ describe('resource accounts', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('getSSOLoginURL: required and optional params', async () => { const response = await client.accounts.getSSOLoginURL({ email: 'user@company.com', @@ -57,7 +57,7 @@ describe('resource accounts', () => { }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('listJoinableOrganizations', async () => { const responsePromise = client.accounts.listJoinableOrganizations({}); const rawResponse = await responsePromise.asResponse(); @@ -69,7 +69,7 @@ describe('resource accounts', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('listLoginProviders', async () => { const responsePromise = client.accounts.listLoginProviders({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/editors.test.ts b/tests/api-resources/editors.test.ts index e3e3a7c..911417b 100644 --- a/tests/api-resources/editors.test.ts +++ b/tests/api-resources/editors.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource editors', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('retrieve: only required params', async () => { const responsePromise = client.editors.retrieve({ id: 'd2c94c27-3b76-4a42-b88c-95a85e392c68' }); const rawResponse = await responsePromise.asResponse(); @@ -20,12 +20,12 @@ describe('resource editors', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('retrieve: required and optional params', async () => { const response = await client.editors.retrieve({ id: 'd2c94c27-3b76-4a42-b88c-95a85e392c68' }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('list', async () => { const responsePromise = client.editors.list({}); const rawResponse = await responsePromise.asResponse(); @@ -37,7 +37,7 @@ describe('resource editors', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('resolveURL: only required params', async () => { const responsePromise = client.editors.resolveURL({ editorId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', @@ -53,7 +53,7 @@ describe('resource editors', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('resolveURL: required and optional params', async () => { const response = await client.editors.resolveURL({ editorId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', diff --git a/tests/api-resources/environments/automations/automations.test.ts b/tests/api-resources/environments/automations/automations.test.ts index 45b054d..ed99712 100644 --- a/tests/api-resources/environments/automations/automations.test.ts +++ b/tests/api-resources/environments/automations/automations.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource automations', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('upsert', async () => { const responsePromise = client.environments.automations.upsert({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/environments/automations/services.test.ts b/tests/api-resources/environments/automations/services.test.ts index 9f01bea..2333514 100644 --- a/tests/api-resources/environments/automations/services.test.ts +++ b/tests/api-resources/environments/automations/services.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource services', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('create', async () => { const responsePromise = client.environments.automations.services.create({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource services', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('retrieve', async () => { const responsePromise = client.environments.automations.services.retrieve({}); const rawResponse = await responsePromise.asResponse(); @@ -32,7 +32,7 @@ describe('resource services', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('update', async () => { const responsePromise = client.environments.automations.services.update({}); const rawResponse = await responsePromise.asResponse(); @@ -44,7 +44,7 @@ describe('resource services', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('list', async () => { const responsePromise = client.environments.automations.services.list({}); const rawResponse = await responsePromise.asResponse(); @@ -56,7 +56,7 @@ describe('resource services', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('delete', async () => { const responsePromise = client.environments.automations.services.delete({}); const rawResponse = await responsePromise.asResponse(); @@ -68,7 +68,7 @@ describe('resource services', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('start', async () => { const responsePromise = client.environments.automations.services.start({}); const rawResponse = await responsePromise.asResponse(); @@ -80,7 +80,7 @@ describe('resource services', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('stop', async () => { const responsePromise = client.environments.automations.services.stop({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/environments/automations/tasks/executions.test.ts b/tests/api-resources/environments/automations/tasks/executions.test.ts index 7c8f4e4..2c2bc87 100644 --- a/tests/api-resources/environments/automations/tasks/executions.test.ts +++ b/tests/api-resources/environments/automations/tasks/executions.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource executions', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('retrieve', async () => { const responsePromise = client.environments.automations.tasks.executions.retrieve({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource executions', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('list', async () => { const responsePromise = client.environments.automations.tasks.executions.list({}); const rawResponse = await responsePromise.asResponse(); @@ -32,7 +32,7 @@ describe('resource executions', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('stop', async () => { const responsePromise = client.environments.automations.tasks.executions.stop({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/environments/automations/tasks/tasks.test.ts b/tests/api-resources/environments/automations/tasks/tasks.test.ts index a928d7f..d19f035 100644 --- a/tests/api-resources/environments/automations/tasks/tasks.test.ts +++ b/tests/api-resources/environments/automations/tasks/tasks.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource tasks', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('create', async () => { const responsePromise = client.environments.automations.tasks.create({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource tasks', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('retrieve', async () => { const responsePromise = client.environments.automations.tasks.retrieve({}); const rawResponse = await responsePromise.asResponse(); @@ -32,7 +32,7 @@ describe('resource tasks', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('update', async () => { const responsePromise = client.environments.automations.tasks.update({}); const rawResponse = await responsePromise.asResponse(); @@ -44,7 +44,7 @@ describe('resource tasks', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('list', async () => { const responsePromise = client.environments.automations.tasks.list({}); const rawResponse = await responsePromise.asResponse(); @@ -56,7 +56,7 @@ describe('resource tasks', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('delete', async () => { const responsePromise = client.environments.automations.tasks.delete({}); const rawResponse = await responsePromise.asResponse(); @@ -68,7 +68,7 @@ describe('resource tasks', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('start', async () => { const responsePromise = client.environments.automations.tasks.start({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/environments/classes.test.ts b/tests/api-resources/environments/classes.test.ts index da2c482..91d2fa4 100644 --- a/tests/api-resources/environments/classes.test.ts +++ b/tests/api-resources/environments/classes.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource classes', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('list', async () => { const responsePromise = client.environments.classes.list({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/environments/environments.test.ts b/tests/api-resources/environments/environments.test.ts index 52c663b..6a29513 100644 --- a/tests/api-resources/environments/environments.test.ts +++ b/tests/api-resources/environments/environments.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource environments', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('create', async () => { const responsePromise = client.environments.create({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource environments', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('retrieve: only required params', async () => { const responsePromise = client.environments.retrieve({ environmentId: '07e03a28-65a5-4d98-b532-8ea67b188048', @@ -34,14 +34,14 @@ describe('resource environments', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('retrieve: required and optional params', async () => { const response = await client.environments.retrieve({ environmentId: '07e03a28-65a5-4d98-b532-8ea67b188048', }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('update', async () => { const responsePromise = client.environments.update({}); const rawResponse = await responsePromise.asResponse(); @@ -53,7 +53,7 @@ describe('resource environments', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('list', async () => { const responsePromise = client.environments.list({}); const rawResponse = await responsePromise.asResponse(); @@ -65,7 +65,7 @@ describe('resource environments', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('delete', async () => { const responsePromise = client.environments.delete({}); const rawResponse = await responsePromise.asResponse(); @@ -77,7 +77,7 @@ describe('resource environments', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('createEnvironmentToken: only required params', async () => { const responsePromise = client.environments.createEnvironmentToken({ environmentId: '07e03a28-65a5-4d98-b532-8ea67b188048', @@ -91,14 +91,14 @@ describe('resource environments', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('createEnvironmentToken: required and optional params', async () => { const response = await client.environments.createEnvironmentToken({ environmentId: '07e03a28-65a5-4d98-b532-8ea67b188048', }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('createFromProject', async () => { const responsePromise = client.environments.createFromProject({}); const rawResponse = await responsePromise.asResponse(); @@ -110,7 +110,7 @@ describe('resource environments', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('createLogsToken', async () => { const responsePromise = client.environments.createLogsToken({}); const rawResponse = await responsePromise.asResponse(); @@ -122,7 +122,7 @@ describe('resource environments', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('markActive', async () => { const responsePromise = client.environments.markActive({}); const rawResponse = await responsePromise.asResponse(); @@ -134,7 +134,7 @@ describe('resource environments', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('start', async () => { const responsePromise = client.environments.start({}); const rawResponse = await responsePromise.asResponse(); @@ -146,7 +146,7 @@ describe('resource environments', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('stop', async () => { const responsePromise = client.environments.stop({}); const rawResponse = await responsePromise.asResponse(); @@ -158,7 +158,7 @@ describe('resource environments', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('unarchive', async () => { const responsePromise = client.environments.unarchive({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/events.test.ts b/tests/api-resources/events.test.ts index d556b72..55d5cc4 100644 --- a/tests/api-resources/events.test.ts +++ b/tests/api-resources/events.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource events', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('list', async () => { const responsePromise = client.events.list({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource events', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // Prism doesn't support JSONL responses yet + // Prism doesn't support application/jsonl responses test.skip('watch', async () => { const responsePromise = client.events.watch({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/gateways.test.ts b/tests/api-resources/gateways.test.ts index 94c06d6..fe35f0f 100644 --- a/tests/api-resources/gateways.test.ts +++ b/tests/api-resources/gateways.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource gateways', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('list', async () => { const responsePromise = client.gateways.list({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/groups.test.ts b/tests/api-resources/groups.test.ts index dcc3e5b..f87d93e 100644 --- a/tests/api-resources/groups.test.ts +++ b/tests/api-resources/groups.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource groups', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('list', async () => { const responsePromise = client.groups.list({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/identity.test.ts b/tests/api-resources/identity.test.ts index 985ccfb..64730a6 100644 --- a/tests/api-resources/identity.test.ts +++ b/tests/api-resources/identity.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource identity', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('exchangeToken', async () => { const responsePromise = client.identity.exchangeToken({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource identity', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('getAuthenticatedIdentity', async () => { const responsePromise = client.identity.getAuthenticatedIdentity({}); const rawResponse = await responsePromise.asResponse(); @@ -32,7 +32,7 @@ describe('resource identity', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('getIDToken', async () => { const responsePromise = client.identity.getIDToken({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/organizations/domain-verifications.test.ts b/tests/api-resources/organizations/domain-verifications.test.ts index aa5b7e4..6b753ed 100644 --- a/tests/api-resources/organizations/domain-verifications.test.ts +++ b/tests/api-resources/organizations/domain-verifications.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource domainVerifications', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('create: only required params', async () => { const responsePromise = client.organizations.domainVerifications.create({ domain: 'acme-corp.com', @@ -23,7 +23,7 @@ describe('resource domainVerifications', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('create: required and optional params', async () => { const response = await client.organizations.domainVerifications.create({ domain: 'acme-corp.com', @@ -31,7 +31,7 @@ describe('resource domainVerifications', () => { }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('retrieve: only required params', async () => { const responsePromise = client.organizations.domainVerifications.retrieve({ domainVerificationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', @@ -45,14 +45,14 @@ describe('resource domainVerifications', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('retrieve: required and optional params', async () => { const response = await client.organizations.domainVerifications.retrieve({ domainVerificationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('list: only required params', async () => { const responsePromise = client.organizations.domainVerifications.list({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -66,7 +66,7 @@ describe('resource domainVerifications', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('list: required and optional params', async () => { const response = await client.organizations.domainVerifications.list({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -76,7 +76,7 @@ describe('resource domainVerifications', () => { }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('delete: only required params', async () => { const responsePromise = client.organizations.domainVerifications.delete({ domainVerificationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', @@ -90,14 +90,14 @@ describe('resource domainVerifications', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('delete: required and optional params', async () => { const response = await client.organizations.domainVerifications.delete({ domainVerificationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('verify: only required params', async () => { const responsePromise = client.organizations.domainVerifications.verify({ domainVerificationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', @@ -111,7 +111,7 @@ describe('resource domainVerifications', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('verify: required and optional params', async () => { const response = await client.organizations.domainVerifications.verify({ domainVerificationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', diff --git a/tests/api-resources/organizations/invites.test.ts b/tests/api-resources/organizations/invites.test.ts index 8d2dbb3..5c5c0db 100644 --- a/tests/api-resources/organizations/invites.test.ts +++ b/tests/api-resources/organizations/invites.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource invites', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('create: only required params', async () => { const responsePromise = client.organizations.invites.create({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -22,14 +22,14 @@ describe('resource invites', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('create: required and optional params', async () => { const response = await client.organizations.invites.create({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('retrieve: only required params', async () => { const responsePromise = client.organizations.invites.retrieve({ organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', @@ -43,14 +43,14 @@ describe('resource invites', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('retrieve: required and optional params', async () => { const response = await client.organizations.invites.retrieve({ organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('getSummary: only required params', async () => { const responsePromise = client.organizations.invites.getSummary({ inviteId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', @@ -64,7 +64,7 @@ describe('resource invites', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('getSummary: required and optional params', async () => { const response = await client.organizations.invites.getSummary({ inviteId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', diff --git a/tests/api-resources/organizations/organizations.test.ts b/tests/api-resources/organizations/organizations.test.ts index 09fc8b7..8ec21c3 100644 --- a/tests/api-resources/organizations/organizations.test.ts +++ b/tests/api-resources/organizations/organizations.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource organizations', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('create: only required params', async () => { const responsePromise = client.organizations.create({ name: 'Acme Corp Engineering' }); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource organizations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('create: required and optional params', async () => { const response = await client.organizations.create({ name: 'Acme Corp Engineering', @@ -29,7 +29,7 @@ describe('resource organizations', () => { }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('retrieve: only required params', async () => { const responsePromise = client.organizations.retrieve({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -43,14 +43,14 @@ describe('resource organizations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('retrieve: required and optional params', async () => { const response = await client.organizations.retrieve({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('update: only required params', async () => { const responsePromise = client.organizations.update({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -64,7 +64,7 @@ describe('resource organizations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('update: required and optional params', async () => { const response = await client.organizations.update({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -73,7 +73,7 @@ describe('resource organizations', () => { }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('delete: only required params', async () => { const responsePromise = client.organizations.delete({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -87,14 +87,14 @@ describe('resource organizations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('delete: required and optional params', async () => { const response = await client.organizations.delete({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('join', async () => { const responsePromise = client.organizations.join({}); const rawResponse = await responsePromise.asResponse(); @@ -106,7 +106,7 @@ describe('resource organizations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('leave: only required params', async () => { const responsePromise = client.organizations.leave({ userId: 'f53d2330-3795-4c5d-a1f3-453121af9c60' }); const rawResponse = await responsePromise.asResponse(); @@ -118,12 +118,12 @@ describe('resource organizations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('leave: required and optional params', async () => { const response = await client.organizations.leave({ userId: 'f53d2330-3795-4c5d-a1f3-453121af9c60' }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('listMembers: only required params', async () => { const responsePromise = client.organizations.listMembers({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -137,7 +137,7 @@ describe('resource organizations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('listMembers: required and optional params', async () => { const response = await client.organizations.listMembers({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -147,7 +147,7 @@ describe('resource organizations', () => { }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('setRole: only required params', async () => { const responsePromise = client.organizations.setRole({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -162,7 +162,7 @@ describe('resource organizations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('setRole: required and optional params', async () => { const response = await client.organizations.setRole({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', diff --git a/tests/api-resources/organizations/policies.test.ts b/tests/api-resources/organizations/policies.test.ts index 289b2ad..c648f9d 100644 --- a/tests/api-resources/organizations/policies.test.ts +++ b/tests/api-resources/organizations/policies.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource policies', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('retrieve: only required params', async () => { const responsePromise = client.organizations.policies.retrieve({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -22,14 +22,14 @@ describe('resource policies', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('retrieve: required and optional params', async () => { const response = await client.organizations.policies.retrieve({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('update: only required params', async () => { const responsePromise = client.organizations.policies.update({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -43,7 +43,7 @@ describe('resource policies', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('update: required and optional params', async () => { const response = await client.organizations.policies.update({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', diff --git a/tests/api-resources/organizations/sso-configurations.test.ts b/tests/api-resources/organizations/sso-configurations.test.ts index 06c24ee..1f90621 100644 --- a/tests/api-resources/organizations/sso-configurations.test.ts +++ b/tests/api-resources/organizations/sso-configurations.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource ssoConfigurations', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('create: only required params', async () => { const responsePromise = client.organizations.ssoConfigurations.create({ clientId: '012345678-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com', @@ -26,7 +26,7 @@ describe('resource ssoConfigurations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('create: required and optional params', async () => { const response = await client.organizations.ssoConfigurations.create({ clientId: '012345678-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com', @@ -37,7 +37,7 @@ describe('resource ssoConfigurations', () => { }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('retrieve: only required params', async () => { const responsePromise = client.organizations.ssoConfigurations.retrieve({ ssoConfigurationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', @@ -51,14 +51,14 @@ describe('resource ssoConfigurations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('retrieve: required and optional params', async () => { const response = await client.organizations.ssoConfigurations.retrieve({ ssoConfigurationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('update: only required params', async () => { const responsePromise = client.organizations.ssoConfigurations.update({ ssoConfigurationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', @@ -72,7 +72,7 @@ describe('resource ssoConfigurations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('update: required and optional params', async () => { const response = await client.organizations.ssoConfigurations.update({ ssoConfigurationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', @@ -85,7 +85,7 @@ describe('resource ssoConfigurations', () => { }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('list: only required params', async () => { const responsePromise = client.organizations.ssoConfigurations.list({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -99,7 +99,7 @@ describe('resource ssoConfigurations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('list: required and optional params', async () => { const response = await client.organizations.ssoConfigurations.list({ organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', @@ -109,7 +109,7 @@ describe('resource ssoConfigurations', () => { }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('delete: only required params', async () => { const responsePromise = client.organizations.ssoConfigurations.delete({ ssoConfigurationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', @@ -123,7 +123,7 @@ describe('resource ssoConfigurations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('delete: required and optional params', async () => { const response = await client.organizations.ssoConfigurations.delete({ ssoConfigurationId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', diff --git a/tests/api-resources/projects/policies.test.ts b/tests/api-resources/projects/policies.test.ts index 2b99235..cc633a7 100644 --- a/tests/api-resources/projects/policies.test.ts +++ b/tests/api-resources/projects/policies.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource policies', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('create', async () => { const responsePromise = client.projects.policies.create({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource policies', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('update', async () => { const responsePromise = client.projects.policies.update({}); const rawResponse = await responsePromise.asResponse(); @@ -32,7 +32,7 @@ describe('resource policies', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('list', async () => { const responsePromise = client.projects.policies.list({}); const rawResponse = await responsePromise.asResponse(); @@ -44,7 +44,7 @@ describe('resource policies', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('delete', async () => { const responsePromise = client.projects.policies.delete({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/projects/projects.test.ts b/tests/api-resources/projects/projects.test.ts index b30ee89..16245bf 100644 --- a/tests/api-resources/projects/projects.test.ts +++ b/tests/api-resources/projects/projects.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource projects', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('create: only required params', async () => { const responsePromise = client.projects.create({ environmentClass: {}, initializer: {} }); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource projects', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('create: required and optional params', async () => { const response = await client.projects.create({ environmentClass: { environmentClassId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', localRunner: true }, @@ -45,7 +45,7 @@ describe('resource projects', () => { }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('retrieve', async () => { const responsePromise = client.projects.retrieve({}); const rawResponse = await responsePromise.asResponse(); @@ -57,7 +57,7 @@ describe('resource projects', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('update', async () => { const responsePromise = client.projects.update({}); const rawResponse = await responsePromise.asResponse(); @@ -69,7 +69,7 @@ describe('resource projects', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('list', async () => { const responsePromise = client.projects.list({}); const rawResponse = await responsePromise.asResponse(); @@ -81,7 +81,7 @@ describe('resource projects', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('delete', async () => { const responsePromise = client.projects.delete({}); const rawResponse = await responsePromise.asResponse(); @@ -93,7 +93,7 @@ describe('resource projects', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('createFromEnvironment', async () => { const responsePromise = client.projects.createFromEnvironment({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/runners/configurations/configurations.test.ts b/tests/api-resources/runners/configurations/configurations.test.ts index c23963f..c9d288c 100644 --- a/tests/api-resources/runners/configurations/configurations.test.ts +++ b/tests/api-resources/runners/configurations/configurations.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource configurations', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('validate', async () => { const responsePromise = client.runners.configurations.validate({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/runners/configurations/environment-classes.test.ts b/tests/api-resources/runners/configurations/environment-classes.test.ts index f7b49dd..00956b2 100644 --- a/tests/api-resources/runners/configurations/environment-classes.test.ts +++ b/tests/api-resources/runners/configurations/environment-classes.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource environmentClasses', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('create', async () => { const responsePromise = client.runners.configurations.environmentClasses.create({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource environmentClasses', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('retrieve', async () => { const responsePromise = client.runners.configurations.environmentClasses.retrieve({}); const rawResponse = await responsePromise.asResponse(); @@ -32,7 +32,7 @@ describe('resource environmentClasses', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('update', async () => { const responsePromise = client.runners.configurations.environmentClasses.update({}); const rawResponse = await responsePromise.asResponse(); @@ -44,7 +44,7 @@ describe('resource environmentClasses', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('list', async () => { const responsePromise = client.runners.configurations.environmentClasses.list({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/runners/configurations/host-authentication-tokens.test.ts b/tests/api-resources/runners/configurations/host-authentication-tokens.test.ts index a5c4a50..c2fa2c6 100644 --- a/tests/api-resources/runners/configurations/host-authentication-tokens.test.ts +++ b/tests/api-resources/runners/configurations/host-authentication-tokens.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource hostAuthenticationTokens', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('create', async () => { const responsePromise = client.runners.configurations.hostAuthenticationTokens.create({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource hostAuthenticationTokens', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('retrieve', async () => { const responsePromise = client.runners.configurations.hostAuthenticationTokens.retrieve({}); const rawResponse = await responsePromise.asResponse(); @@ -32,7 +32,7 @@ describe('resource hostAuthenticationTokens', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('update', async () => { const responsePromise = client.runners.configurations.hostAuthenticationTokens.update({}); const rawResponse = await responsePromise.asResponse(); @@ -44,7 +44,7 @@ describe('resource hostAuthenticationTokens', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('list', async () => { const responsePromise = client.runners.configurations.hostAuthenticationTokens.list({}); const rawResponse = await responsePromise.asResponse(); @@ -56,7 +56,7 @@ describe('resource hostAuthenticationTokens', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('delete', async () => { const responsePromise = client.runners.configurations.hostAuthenticationTokens.delete({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/runners/configurations/schema.test.ts b/tests/api-resources/runners/configurations/schema.test.ts index 5315e4a..69e5038 100644 --- a/tests/api-resources/runners/configurations/schema.test.ts +++ b/tests/api-resources/runners/configurations/schema.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource schema', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('retrieve', async () => { const responsePromise = client.runners.configurations.schema.retrieve({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/runners/configurations/scm-integrations.test.ts b/tests/api-resources/runners/configurations/scm-integrations.test.ts index 6b59259..76405f7 100644 --- a/tests/api-resources/runners/configurations/scm-integrations.test.ts +++ b/tests/api-resources/runners/configurations/scm-integrations.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource scmIntegrations', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('create', async () => { const responsePromise = client.runners.configurations.scmIntegrations.create({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource scmIntegrations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('retrieve', async () => { const responsePromise = client.runners.configurations.scmIntegrations.retrieve({}); const rawResponse = await responsePromise.asResponse(); @@ -32,7 +32,7 @@ describe('resource scmIntegrations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('update', async () => { const responsePromise = client.runners.configurations.scmIntegrations.update({}); const rawResponse = await responsePromise.asResponse(); @@ -44,7 +44,7 @@ describe('resource scmIntegrations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('list', async () => { const responsePromise = client.runners.configurations.scmIntegrations.list({}); const rawResponse = await responsePromise.asResponse(); @@ -56,7 +56,7 @@ describe('resource scmIntegrations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('delete', async () => { const responsePromise = client.runners.configurations.scmIntegrations.delete({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/runners/policies.test.ts b/tests/api-resources/runners/policies.test.ts index 533b1d8..b0cfcda 100644 --- a/tests/api-resources/runners/policies.test.ts +++ b/tests/api-resources/runners/policies.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource policies', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('create', async () => { const responsePromise = client.runners.policies.create({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource policies', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('update', async () => { const responsePromise = client.runners.policies.update({}); const rawResponse = await responsePromise.asResponse(); @@ -32,7 +32,7 @@ describe('resource policies', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('list', async () => { const responsePromise = client.runners.policies.list({}); const rawResponse = await responsePromise.asResponse(); @@ -44,7 +44,7 @@ describe('resource policies', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('delete', async () => { const responsePromise = client.runners.policies.delete({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/runners/runners.test.ts b/tests/api-resources/runners/runners.test.ts index 8a6573a..cd005be 100644 --- a/tests/api-resources/runners/runners.test.ts +++ b/tests/api-resources/runners/runners.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource runners', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('create', async () => { const responsePromise = client.runners.create({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource runners', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('retrieve', async () => { const responsePromise = client.runners.retrieve({}); const rawResponse = await responsePromise.asResponse(); @@ -32,7 +32,7 @@ describe('resource runners', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('update', async () => { const responsePromise = client.runners.update({}); const rawResponse = await responsePromise.asResponse(); @@ -44,7 +44,7 @@ describe('resource runners', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('list', async () => { const responsePromise = client.runners.list({}); const rawResponse = await responsePromise.asResponse(); @@ -56,7 +56,7 @@ describe('resource runners', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('delete', async () => { const responsePromise = client.runners.delete({}); const rawResponse = await responsePromise.asResponse(); @@ -68,7 +68,7 @@ describe('resource runners', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('checkAuthenticationForHost', async () => { const responsePromise = client.runners.checkAuthenticationForHost({}); const rawResponse = await responsePromise.asResponse(); @@ -80,7 +80,7 @@ describe('resource runners', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('createRunnerToken', async () => { const responsePromise = client.runners.createRunnerToken({}); const rawResponse = await responsePromise.asResponse(); @@ -92,7 +92,7 @@ describe('resource runners', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('parseContextURL', async () => { const responsePromise = client.runners.parseContextURL({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/secrets.test.ts b/tests/api-resources/secrets.test.ts index fc3c4c7..45ae503 100644 --- a/tests/api-resources/secrets.test.ts +++ b/tests/api-resources/secrets.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource secrets', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('create', async () => { const responsePromise = client.secrets.create({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource secrets', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('list', async () => { const responsePromise = client.secrets.list({}); const rawResponse = await responsePromise.asResponse(); @@ -32,7 +32,7 @@ describe('resource secrets', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('delete', async () => { const responsePromise = client.secrets.delete({}); const rawResponse = await responsePromise.asResponse(); @@ -44,7 +44,7 @@ describe('resource secrets', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('getValue', async () => { const responsePromise = client.secrets.getValue({}); const rawResponse = await responsePromise.asResponse(); @@ -56,7 +56,7 @@ describe('resource secrets', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('updateValue', async () => { const responsePromise = client.secrets.updateValue({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/usage.test.ts b/tests/api-resources/usage.test.ts index 6ec2547..36bec98 100644 --- a/tests/api-resources/usage.test.ts +++ b/tests/api-resources/usage.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource usage', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('listEnvironmentRuntimeRecords', async () => { const responsePromise = client.usage.listEnvironmentRuntimeRecords({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/users/dotfiles.test.ts b/tests/api-resources/users/dotfiles.test.ts index 5694cb1..e46faac 100644 --- a/tests/api-resources/users/dotfiles.test.ts +++ b/tests/api-resources/users/dotfiles.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource dotfiles', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('get', async () => { const responsePromise = client.users.dotfiles.get({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource dotfiles', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('set', async () => { const responsePromise = client.users.dotfiles.set({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/users/pats.test.ts b/tests/api-resources/users/pats.test.ts index cb8544c..819b516 100644 --- a/tests/api-resources/users/pats.test.ts +++ b/tests/api-resources/users/pats.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource pats', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('list', async () => { const responsePromise = client.users.pats.list({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource pats', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('delete', async () => { const responsePromise = client.users.pats.delete({}); const rawResponse = await responsePromise.asResponse(); @@ -32,7 +32,7 @@ describe('resource pats', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('get', async () => { const responsePromise = client.users.pats.get({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/users/users.test.ts b/tests/api-resources/users/users.test.ts index 4131035..e58134e 100644 --- a/tests/api-resources/users/users.test.ts +++ b/tests/api-resources/users/users.test.ts @@ -8,7 +8,7 @@ const client = new Gitpod({ }); describe('resource users', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('getAuthenticatedUser', async () => { const responsePromise = client.users.getAuthenticatedUser({}); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource users', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('setSuspended', async () => { const responsePromise = client.users.setSuspended({}); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/index.test.ts b/tests/index.test.ts index e90aa8b..b0c11e4 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -26,13 +26,13 @@ describe('instantiate client', () => { bearerToken: 'My Bearer Token', }); - test('they are used in the request', () => { - const { req } = client.buildRequest({ path: '/foo', method: 'post' }); + test('they are used in the request', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post' }); expect(req.headers.get('x-my-default-header')).toEqual('2'); }); - test('can ignore `undefined` and leave the default', () => { - const { req } = client.buildRequest({ + test('can ignore `undefined` and leave the default', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post', headers: { 'X-My-Default-Header': undefined }, @@ -40,8 +40,8 @@ describe('instantiate client', () => { expect(req.headers.get('x-my-default-header')).toEqual('2'); }); - test('can be removed with `null`', () => { - const { req } = client.buildRequest({ + test('can be removed with `null`', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post', headers: { 'X-My-Default-Header': null }, @@ -320,6 +320,28 @@ describe('instantiate client', () => { const client = new Gitpod({ bearerToken: 'My Bearer Token' }); expect(client.baseURL).toEqual('https://app.gitpod.io/api'); }); + + test('in request options', () => { + const client = new Gitpod({ bearerToken: 'My Bearer Token' }); + expect(client.buildURL('/foo', null, 'http://localhost:5000/option')).toEqual( + 'http://localhost:5000/option/foo', + ); + }); + + test('in request options overridden by client options', () => { + const client = new Gitpod({ bearerToken: 'My Bearer Token', baseURL: 'http://localhost:5000/client' }); + expect(client.buildURL('/foo', null, 'http://localhost:5000/option')).toEqual( + 'http://localhost:5000/client/foo', + ); + }); + + test('in request options overridden by env variable', () => { + process.env['GITPOD_BASE_URL'] = 'http://localhost:5000/env'; + const client = new Gitpod({ bearerToken: 'My Bearer Token' }); + expect(client.buildURL('/foo', null, 'http://localhost:5000/option')).toEqual( + 'http://localhost:5000/env/foo', + ); + }); }); test('maxRetries option is correctly set', () => { @@ -332,7 +354,7 @@ describe('instantiate client', () => { }); describe('withOptions', () => { - test('creates a new client with overridden options', () => { + test('creates a new client with overridden options', async () => { const client = new Gitpod({ baseURL: 'http://localhost:5000/', maxRetries: 3, @@ -357,7 +379,7 @@ describe('instantiate client', () => { expect(newClient.constructor).toBe(client.constructor); }); - test('inherits options from the parent client', () => { + test('inherits options from the parent client', async () => { const client = new Gitpod({ baseURL: 'http://localhost:5000/', defaultHeaders: { 'X-Test-Header': 'test-value' }, @@ -372,7 +394,7 @@ describe('instantiate client', () => { // Test inherited options remain the same expect(newClient.buildURL('/foo', null)).toEqual('http://localhost:5001/foo?test-param=test-value'); - const { req } = newClient.buildRequest({ path: '/foo', method: 'get' }); + const { req } = await newClient.buildRequest({ path: '/foo', method: 'get' }); expect(req.headers.get('x-test-header')).toEqual('test-value'); }); @@ -426,8 +448,8 @@ describe('request building', () => { const client = new Gitpod({ bearerToken: 'My Bearer Token' }); describe('custom headers', () => { - test('handles undefined', () => { - const { req } = client.buildRequest({ + test('handles undefined', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post', body: { value: 'hello' }, @@ -462,8 +484,8 @@ describe('default encoder', () => { } } for (const jsonValue of [{}, [], { __proto__: null }, new Serializable(), new Collection(['item'])]) { - test(`serializes ${util.inspect(jsonValue)} as json`, () => { - const { req } = client.buildRequest({ + test(`serializes ${util.inspect(jsonValue)} as json`, async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post', body: jsonValue, @@ -486,7 +508,7 @@ describe('default encoder', () => { asyncIterable, ]) { test(`converts ${util.inspect(streamValue)} to ReadableStream`, async () => { - const { req } = client.buildRequest({ + const { req } = await client.buildRequest({ path: '/foo', method: 'post', body: streamValue, @@ -499,7 +521,7 @@ describe('default encoder', () => { } test(`can set content-type for ReadableStream`, async () => { - const { req } = client.buildRequest({ + const { req } = await client.buildRequest({ path: '/foo', method: 'post', body: new Response('a\nb\nc\n').body, diff --git a/tests/path.test.ts b/tests/path.test.ts index 3c95a0b..3c6b046 100644 --- a/tests/path.test.ts +++ b/tests/path.test.ts @@ -1,5 +1,6 @@ import { createPathTagFunction, encodeURIPath } from '@gitpod/sdk/internal/utils/path'; import { inspect } from 'node:util'; +import { runInNewContext } from 'node:vm'; describe('path template tag function', () => { test('validates input', () => { @@ -32,9 +33,114 @@ describe('path template tag function', () => { return testParams.flatMap((e) => rest.map((r) => [e, ...r])); } - // we need to test how %2E is handled so we use a custom encoder that does no escaping + // We need to test how %2E is handled, so we use a custom encoder that does no escaping. const rawPath = createPathTagFunction((s) => s); + const emptyObject = {}; + const mathObject = Math; + const numberObject = new Number(); + const stringObject = new String(); + const basicClass = new (class {})(); + const classWithToString = new (class { + toString() { + return 'ok'; + } + })(); + + // Invalid values + expect(() => rawPath`/a/${null}/b`).toThrow( + 'Path parameters result in path with invalid segments:\n' + + 'Value of type Null is not a valid path parameter\n' + + '/a/null/b\n' + + ' ^^^^', + ); + expect(() => rawPath`/a/${undefined}/b`).toThrow( + 'Path parameters result in path with invalid segments:\n' + + 'Value of type Undefined is not a valid path parameter\n' + + '/a/undefined/b\n' + + ' ^^^^^^^^^', + ); + expect(() => rawPath`/a/${emptyObject}/b`).toThrow( + 'Path parameters result in path with invalid segments:\n' + + 'Value of type Object is not a valid path parameter\n' + + '/a/[object Object]/b\n' + + ' ^^^^^^^^^^^^^^^', + ); + expect(() => rawPath`?${mathObject}`).toThrow( + 'Path parameters result in path with invalid segments:\n' + + 'Value of type Math is not a valid path parameter\n' + + '?[object Math]\n' + + ' ^^^^^^^^^^^^^', + ); + expect(() => rawPath`/${basicClass}`).toThrow( + 'Path parameters result in path with invalid segments:\n' + + 'Value of type Object is not a valid path parameter\n' + + '/[object Object]\n' + + ' ^^^^^^^^^^^^^^', + ); + expect(() => rawPath`/../${''}`).toThrow( + 'Path parameters result in path with invalid segments:\n' + + 'Value ".." can\'t be safely passed as a path parameter\n' + + '/../\n' + + ' ^^', + ); + expect(() => rawPath`/../${{}}`).toThrow( + 'Path parameters result in path with invalid segments:\n' + + 'Value ".." can\'t be safely passed as a path parameter\n' + + 'Value of type Object is not a valid path parameter\n' + + '/../[object Object]\n' + + ' ^^ ^^^^^^^^^^^^^^', + ); + + // Valid values + expect(rawPath`/${0}`).toBe('/0'); + expect(rawPath`/${''}`).toBe('/'); + expect(rawPath`/${numberObject}`).toBe('/0'); + expect(rawPath`${stringObject}/`).toBe('/'); + expect(rawPath`/${classWithToString}`).toBe('/ok'); + + // We need to check what happens with cross-realm values, which we might get from + // Jest or other frames in a browser. + + const newRealm = runInNewContext('globalThis'); + expect(newRealm.Object).not.toBe(Object); + + const crossRealmObject = newRealm.Object(); + const crossRealmMathObject = newRealm.Math; + const crossRealmNumber = new newRealm.Number(); + const crossRealmString = new newRealm.String(); + const crossRealmClass = new (class extends newRealm.Object {})(); + const crossRealmClassWithToString = new (class extends newRealm.Object { + toString() { + return 'ok'; + } + })(); + + // Invalid cross-realm values + expect(() => rawPath`/a/${crossRealmObject}/b`).toThrow( + 'Path parameters result in path with invalid segments:\n' + + 'Value of type Object is not a valid path parameter\n' + + '/a/[object Object]/b\n' + + ' ^^^^^^^^^^^^^^^', + ); + expect(() => rawPath`?${crossRealmMathObject}`).toThrow( + 'Path parameters result in path with invalid segments:\n' + + 'Value of type Math is not a valid path parameter\n' + + '?[object Math]\n' + + ' ^^^^^^^^^^^^^', + ); + expect(() => rawPath`/${crossRealmClass}`).toThrow( + 'Path parameters result in path with invalid segments:\n' + + 'Value of type Object is not a valid path parameter\n' + + '/[object Object]\n' + + ' ^^^^^^^^^^^^^^^', + ); + + // Valid cross-realm values + expect(rawPath`/${crossRealmNumber}`).toBe('/0'); + expect(rawPath`${crossRealmString}/`).toBe('/'); + expect(rawPath`/${crossRealmClassWithToString}`).toBe('/ok'); + const results: { [pathParts: string]: { [params: string]: { valid: boolean; result?: string; error?: string }; @@ -85,6 +191,7 @@ describe('path template tag function', () => { valid: false, error: 'Error: Path parameters result in path with invalid segments:\n' + + 'Value "%2E%2e" can\'t be safely passed as a path parameter\n' + '/path_params/%2E%2e/a\n' + ' ^^^^^^', }, @@ -92,6 +199,7 @@ describe('path template tag function', () => { valid: false, error: 'Error: Path parameters result in path with invalid segments:\n' + + 'Value "%2E" can\'t be safely passed as a path parameter\n' + '/path_params/%2E/a\n' + ' ^^^', }, @@ -103,6 +211,7 @@ describe('path template tag function', () => { valid: false, error: 'Error: Path parameters result in path with invalid segments:\n' + + 'Value "%2e%2E" can\'t be safely passed as a path parameter\n' + '/path_params/%2e%2E/\n' + ' ^^^^^^', }, @@ -110,6 +219,7 @@ describe('path template tag function', () => { valid: false, error: 'Error: Path parameters result in path with invalid segments:\n' + + 'Value "%2e" can\'t be safely passed as a path parameter\n' + '/path_params/%2e/\n' + ' ^^^', }, @@ -121,6 +231,7 @@ describe('path template tag function', () => { valid: false, error: 'Error: Path parameters result in path with invalid segments:\n' + + 'Value "%2E" can\'t be safely passed as a path parameter\n' + '/path_params/%2E\n' + ' ^^^', }, @@ -128,6 +239,7 @@ describe('path template tag function', () => { valid: false, error: 'Error: Path parameters result in path with invalid segments:\n' + + 'Value "%2E%2e" can\'t be safely passed as a path parameter\n' + '/path_params/%2E%2e\n' + ' ^^^^^^', }, @@ -137,11 +249,17 @@ describe('path template tag function', () => { '["x"]': { valid: true, result: 'x/a' }, '["%2E"]': { valid: false, - error: 'Error: Path parameters result in path with invalid segments:\n%2E/a\n^^^', + error: + 'Error: Path parameters result in path with invalid segments:\n' + + 'Value "%2E" can\'t be safely passed as a path parameter\n%2E/a\n^^^', }, '["%2e%2E"]': { valid: false, - error: 'Error: Path parameters result in path with invalid segments:\n' + '%2e%2E/a\n' + '^^^^^^', + error: + 'Error: Path parameters result in path with invalid segments:\n' + + 'Value "%2e%2E" can\'t be safely passed as a path parameter\n' + + '%2e%2E/a\n' + + '^^^^^^', }, }, '["","/"]': { @@ -149,11 +267,18 @@ describe('path template tag function', () => { '[""]': { valid: true, result: '/' }, '["%2E%2e"]': { valid: false, - error: 'Error: Path parameters result in path with invalid segments:\n' + '%2E%2e/\n' + '^^^^^^', + error: + 'Error: Path parameters result in path with invalid segments:\n' + + 'Value "%2E%2e" can\'t be safely passed as a path parameter\n' + + '%2E%2e/\n' + + '^^^^^^', }, '["."]': { valid: false, - error: 'Error: Path parameters result in path with invalid segments:\n./\n^', + error: + 'Error: Path parameters result in path with invalid segments:\n' + + 'Value "." can\'t be safely passed as a path parameter\n' + + './\n^', }, }, '["",""]': { @@ -161,11 +286,17 @@ describe('path template tag function', () => { '["x"]': { valid: true, result: 'x' }, '[".."]': { valid: false, - error: 'Error: Path parameters result in path with invalid segments:\n..\n^^', + error: + 'Error: Path parameters result in path with invalid segments:\n' + + 'Value ".." can\'t be safely passed as a path parameter\n' + + '..\n^^', }, '["."]': { valid: false, - error: 'Error: Path parameters result in path with invalid segments:\n.\n^', + error: + 'Error: Path parameters result in path with invalid segments:\n' + + 'Value "." can\'t be safely passed as a path parameter\n' + + '.\n^', }, }, '["a"]': {}, @@ -185,6 +316,7 @@ describe('path template tag function', () => { valid: false, error: 'Error: Path parameters result in path with invalid segments:\n' + + 'Value "%2E%2E" can\'t be safely passed as a path parameter\n' + '/path_params/%2E%2E?beta=true\n' + ' ^^^^^^', }, @@ -192,6 +324,7 @@ describe('path template tag function', () => { valid: false, error: 'Error: Path parameters result in path with invalid segments:\n' + + 'Value "%2e%2E" can\'t be safely passed as a path parameter\n' + '/path_params/%2e%2E?beta=true\n' + ' ^^^^^^', }, @@ -203,6 +336,7 @@ describe('path template tag function', () => { valid: false, error: 'Error: Path parameters result in path with invalid segments:\n' + + 'Value "." can\'t be safely passed as a path parameter\n' + '/path_params/.?beta=true\n' + ' ^', }, @@ -210,6 +344,7 @@ describe('path template tag function', () => { valid: false, error: 'Error: Path parameters result in path with invalid segments:\n' + + 'Value "%2e." can\'t be safely passed as a path parameter\n' + '/path_params/%2e.?beta=true\n' + ' ^^^^', }, @@ -221,6 +356,8 @@ describe('path template tag function', () => { valid: false, error: 'Error: Path parameters result in path with invalid segments:\n' + + 'Value "." can\'t be safely passed as a path parameter\n' + + 'Value "%2e" can\'t be safely passed as a path parameter\n' + '/path_params/./%2e/download\n' + ' ^ ^^^', }, @@ -228,6 +365,8 @@ describe('path template tag function', () => { valid: false, error: 'Error: Path parameters result in path with invalid segments:\n' + + 'Value "%2E%2e" can\'t be safely passed as a path parameter\n' + + 'Value "%2e" can\'t be safely passed as a path parameter\n' + '/path_params/%2E%2e/%2e/download\n' + ' ^^^^^^ ^^^', }, @@ -243,6 +382,7 @@ describe('path template tag function', () => { valid: false, error: 'Error: Path parameters result in path with invalid segments:\n' + + 'Value "%2E" can\'t be safely passed as a path parameter\n' + '/path_params/%2E/download\n' + ' ^^^', }, @@ -250,6 +390,7 @@ describe('path template tag function', () => { valid: false, error: 'Error: Path parameters result in path with invalid segments:\n' + + 'Value "%2E." can\'t be safely passed as a path parameter\n' + '/path_params/%2E./download\n' + ' ^^^^', }, @@ -261,6 +402,7 @@ describe('path template tag function', () => { valid: false, error: 'Error: Path parameters result in path with invalid segments:\n' + + 'Value "." can\'t be safely passed as a path parameter\n' + '/path_params/./download\n' + ' ^', }, @@ -268,6 +410,7 @@ describe('path template tag function', () => { valid: false, error: 'Error: Path parameters result in path with invalid segments:\n' + + 'Value ".." can\'t be safely passed as a path parameter\n' + '/path_params/../download\n' + ' ^^', }, @@ -279,6 +422,7 @@ describe('path template tag function', () => { valid: false, error: 'Error: Path parameters result in path with invalid segments:\n' + + 'Value ".." can\'t be safely passed as a path parameter\n' + '/path_params/../download\n' + ' ^^', }, diff --git a/tsconfig.build.json b/tsconfig.build.json index 0460cd2..442fd50 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -5,8 +5,8 @@ "compilerOptions": { "rootDir": "./dist/src", "paths": { - "@gitpod/sdk/*": ["dist/src/*"], - "@gitpod/sdk": ["dist/src/index.ts"] + "@gitpod/sdk/*": ["./dist/src/*"], + "@gitpod/sdk": ["./dist/src/index.ts"] }, "noEmit": false, "declaration": true, diff --git a/tsconfig.json b/tsconfig.json index db8ba0b..1009eff 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,10 +7,9 @@ "module": "commonjs", "moduleResolution": "node", "esModuleInterop": true, - "baseUrl": "./", "paths": { - "@gitpod/sdk/*": ["src/*"], - "@gitpod/sdk": ["src/index.ts"] + "@gitpod/sdk/*": ["./src/*"], + "@gitpod/sdk": ["./src/index.ts"] }, "noEmit": true, diff --git a/yarn.lock b/yarn.lock index b28a9b6..87d92c1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -350,45 +350,52 @@ dependencies: "@cspotcode/source-map-consumer" "0.8.0" -"@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0": +"@eslint-community/eslint-utils@^4.4.0": version "4.4.0" resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA== dependencies: eslint-visitor-keys "^3.3.0" +"@eslint-community/eslint-utils@^4.8.0": + version "4.9.0" + resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz#7308df158e064f0dd8b8fdb58aa14fa2a7f913b3" + integrity sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g== + dependencies: + eslint-visitor-keys "^3.4.3" + "@eslint-community/regexpp@^4.10.0", "@eslint-community/regexpp@^4.12.1": version "4.12.1" resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.12.1.tgz#cfc6cffe39df390a3841cde2abccf92eaa7ae0e0" integrity sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ== -"@eslint/config-array@^0.19.0": - version "0.19.2" - resolved "https://registry.yarnpkg.com/@eslint/config-array/-/config-array-0.19.2.tgz#3060b809e111abfc97adb0bb1172778b90cb46aa" - integrity sha512-GNKqxfHG2ySmJOBSHg7LxeUx4xpuCoFjacmlCoYWEbaPXLwvfIjixRI12xCQZeULksQb23uiA8F40w5TojpV7w== +"@eslint/config-array@^0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@eslint/config-array/-/config-array-0.21.1.tgz#7d1b0060fea407f8301e932492ba8c18aff29713" + integrity sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA== dependencies: - "@eslint/object-schema" "^2.1.6" + "@eslint/object-schema" "^2.1.7" debug "^4.3.1" minimatch "^3.1.2" -"@eslint/core@^0.10.0": - version "0.10.0" - resolved "https://registry.yarnpkg.com/@eslint/core/-/core-0.10.0.tgz#23727063c21b335f752dbb3a16450f6f9cbc9091" - integrity sha512-gFHJ+xBOo4G3WRlR1e/3G8A6/KZAH6zcE/hkLRCZTi/B9avAG365QhFA8uOGzTMqgTghpn7/fSnscW++dpMSAw== +"@eslint/config-helpers@^0.4.2": + version "0.4.2" + resolved "https://registry.yarnpkg.com/@eslint/config-helpers/-/config-helpers-0.4.2.tgz#1bd006ceeb7e2e55b2b773ab318d300e1a66aeda" + integrity sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw== dependencies: - "@types/json-schema" "^7.0.15" + "@eslint/core" "^0.17.0" -"@eslint/core@^0.11.0": - version "0.11.0" - resolved "https://registry.yarnpkg.com/@eslint/core/-/core-0.11.0.tgz#7a9226e850922e42cbd2ba71361eacbe74352a12" - integrity sha512-DWUB2pksgNEb6Bz2fggIy1wh6fGgZP4Xyy/Mt0QZPiloKKXerbqq9D3SBQTlCRYOrcRPu4vuz+CGjwdfqxnoWA== +"@eslint/core@^0.17.0": + version "0.17.0" + resolved "https://registry.yarnpkg.com/@eslint/core/-/core-0.17.0.tgz#77225820413d9617509da9342190a2019e78761c" + integrity sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ== dependencies: "@types/json-schema" "^7.0.15" -"@eslint/eslintrc@^3.2.0": - version "3.2.0" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-3.2.0.tgz#57470ac4e2e283a6bf76044d63281196e370542c" - integrity sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w== +"@eslint/eslintrc@^3.3.1": + version "3.3.3" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-3.3.3.tgz#26393a0806501b5e2b6a43aa588a4d8df67880ac" + integrity sha512-Kr+LPIUVKz2qkx1HAMH8q1q6azbqBAsXJUxBl/ODDuVPX45Z9DfwB8tPjTi6nNZ8BuM3nbJxC5zCAg5elnBUTQ== dependencies: ajv "^6.12.4" debug "^4.3.2" @@ -396,26 +403,26 @@ globals "^14.0.0" ignore "^5.2.0" import-fresh "^3.2.1" - js-yaml "^4.1.0" + js-yaml "^4.1.1" minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@9.20.0": - version "9.20.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.20.0.tgz#7421bcbe74889fcd65d1be59f00130c289856eb4" - integrity sha512-iZA07H9io9Wn836aVTytRaNqh00Sad+EamwOVJT12GTLw1VGMFV/4JaME+JjLtr9fiGaoWgYnS54wrfWsSs4oQ== +"@eslint/js@9.39.1": + version "9.39.1" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.39.1.tgz#0dd59c3a9f40e3f1882975c321470969243e0164" + integrity sha512-S26Stp4zCy88tH94QbBv3XCuzRQiZ9yXofEILmglYTh/Ug/a9/umqvgFtYBAo3Lp0nsI/5/qH1CCrbdK3AP1Tw== -"@eslint/object-schema@^2.1.6": - version "2.1.6" - resolved "https://registry.yarnpkg.com/@eslint/object-schema/-/object-schema-2.1.6.tgz#58369ab5b5b3ca117880c0f6c0b0f32f6950f24f" - integrity sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA== +"@eslint/object-schema@^2.1.7": + version "2.1.7" + resolved "https://registry.yarnpkg.com/@eslint/object-schema/-/object-schema-2.1.7.tgz#6e2126a1347e86a4dedf8706ec67ff8e107ebbad" + integrity sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA== -"@eslint/plugin-kit@^0.2.5": - version "0.2.5" - resolved "https://registry.yarnpkg.com/@eslint/plugin-kit/-/plugin-kit-0.2.5.tgz#ee07372035539e7847ef834e3f5e7b79f09e3a81" - integrity sha512-lB05FkqEdUg2AA0xEbUz0SnkXT1LcCTa438W4IWTUh4hdOnVbQyOJ81OrDXsJk/LSiJHubgGEFoR5EHq1NsH1A== +"@eslint/plugin-kit@^0.4.1": + version "0.4.1" + resolved "https://registry.yarnpkg.com/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz#9779e3fd9b7ee33571a57435cf4335a1794a6cb2" + integrity sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA== dependencies: - "@eslint/core" "^0.10.0" + "@eslint/core" "^0.17.0" levn "^0.4.1" "@humanfs/core@^0.19.1": @@ -441,10 +448,10 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.3.1.tgz#c72a5c76a9fbaf3488e231b13dc52c0da7bab42a" integrity sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA== -"@humanwhocodes/retry@^0.4.1": - version "0.4.1" - resolved "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.4.1.tgz#9a96ce501bc62df46c4031fbd970e3cc6b10f07b" - integrity sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA== +"@humanwhocodes/retry@^0.4.2": + version "0.4.3" + resolved "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.4.3.tgz#c2b9d2e374ee62c586d3adbea87199b1d7a7a6ba" + integrity sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ== "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" @@ -952,11 +959,11 @@ undici-types "~5.26.4" "@types/node@^20.17.6": - version "20.17.6" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.17.6.tgz#6e4073230c180d3579e8c60141f99efdf5df0081" - integrity sha512-VEI7OdvK2wP7XHnsuXbAJnEpEkF6NjSN45QJlL4VGqZSXsnicpesdTWsg9RISeSdYd3yeRj/y3k5KGjUXYnFwQ== + version "20.19.11" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.19.11.tgz#728cab53092bd5f143beed7fbba7ba99de3c16c4" + integrity sha512-uug3FEEGv0r+jrecvUUpbY8lLisvIjg6AAic6a2bSP5OEOLeJsDSnvhCDov7ipFFMXS3orMpzlmi0ZcuGkBbow== dependencies: - undici-types "~6.19.2" + undici-types "~6.21.0" "@types/ssh2@^1.15.4": version "1.15.4" @@ -1086,6 +1093,11 @@ acorn@^8.14.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0" integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== +acorn@^8.15.0: + version "8.15.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.15.0.tgz#a360898bc415edaac46c8241f6383975b930b816" + integrity sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg== + acorn@^8.4.1: version "8.7.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.0.tgz#90951fde0f8f09df93549481e5fc141445b791cf" @@ -1636,15 +1648,15 @@ eslint-plugin-unused-imports@^4.1.4: resolved "https://registry.yarnpkg.com/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-4.1.4.tgz#62ddc7446ccbf9aa7b6f1f0b00a980423cda2738" integrity sha512-YptD6IzQjDardkl0POxnnRBhU1OEePMV0nd6siHaRBbd+lyh6NAhFEobiznKU7kTsSsDeSD62Pe7kAM1b7dAZQ== -eslint-scope@^8.2.0: - version "8.2.0" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-8.2.0.tgz#377aa6f1cb5dc7592cfd0b7f892fd0cf352ce442" - integrity sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A== +eslint-scope@^8.4.0: + version "8.4.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-8.4.0.tgz#88e646a207fad61436ffa39eb505147200655c82" + integrity sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg== dependencies: esrecurse "^4.3.0" estraverse "^5.2.0" -eslint-visitor-keys@^3.3.0: +eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.3: version "3.4.3" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== @@ -1654,31 +1666,36 @@ eslint-visitor-keys@^4.2.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz#687bacb2af884fcdda8a6e7d65c606f46a14cd45" integrity sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw== -eslint@^9.20.1: - version "9.20.1" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.20.1.tgz#923924c078f5226832449bac86662dd7e53c91d6" - integrity sha512-m1mM33o6dBUjxl2qb6wv6nGNwCAsns1eKtaQ4l/NPHeTvhiUPbtdfMyktxN4B3fgHIgsYh1VT3V9txblpQHq+g== +eslint-visitor-keys@^4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz#4cfea60fe7dd0ad8e816e1ed026c1d5251b512c1" + integrity sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ== + +eslint@^9.39.1: + version "9.39.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.39.1.tgz#be8bf7c6de77dcc4252b5a8dcb31c2efff74a6e5" + integrity sha512-BhHmn2yNOFA9H9JmmIVKJmd288g9hrVRDkdoIgRCRuSySRUHH7r/DI6aAXW9T1WwUuY3DFgrcaqB+deURBLR5g== dependencies: - "@eslint-community/eslint-utils" "^4.2.0" + "@eslint-community/eslint-utils" "^4.8.0" "@eslint-community/regexpp" "^4.12.1" - "@eslint/config-array" "^0.19.0" - "@eslint/core" "^0.11.0" - "@eslint/eslintrc" "^3.2.0" - "@eslint/js" "9.20.0" - "@eslint/plugin-kit" "^0.2.5" + "@eslint/config-array" "^0.21.1" + "@eslint/config-helpers" "^0.4.2" + "@eslint/core" "^0.17.0" + "@eslint/eslintrc" "^3.3.1" + "@eslint/js" "9.39.1" + "@eslint/plugin-kit" "^0.4.1" "@humanfs/node" "^0.16.6" "@humanwhocodes/module-importer" "^1.0.1" - "@humanwhocodes/retry" "^0.4.1" + "@humanwhocodes/retry" "^0.4.2" "@types/estree" "^1.0.6" - "@types/json-schema" "^7.0.15" ajv "^6.12.4" chalk "^4.0.0" cross-spawn "^7.0.6" debug "^4.3.2" escape-string-regexp "^4.0.0" - eslint-scope "^8.2.0" - eslint-visitor-keys "^4.2.0" - espree "^10.3.0" + eslint-scope "^8.4.0" + eslint-visitor-keys "^4.2.1" + espree "^10.4.0" esquery "^1.5.0" esutils "^2.0.2" fast-deep-equal "^3.1.3" @@ -1694,7 +1711,7 @@ eslint@^9.20.1: natural-compare "^1.4.0" optionator "^0.9.3" -espree@^10.0.1, espree@^10.3.0: +espree@^10.0.1: version "10.3.0" resolved "https://registry.yarnpkg.com/espree/-/espree-10.3.0.tgz#29267cf5b0cb98735b65e64ba07e0ed49d1eed8a" integrity sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg== @@ -1703,6 +1720,15 @@ espree@^10.0.1, espree@^10.3.0: acorn-jsx "^5.3.2" eslint-visitor-keys "^4.2.0" +espree@^10.4.0: + version "10.4.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-10.4.0.tgz#d54f4949d4629005a1fa168d937c3ff1f7e2a837" + integrity sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ== + dependencies: + acorn "^8.15.0" + acorn-jsx "^5.3.2" + eslint-visitor-keys "^4.2.1" + esprima@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" @@ -2523,10 +2549,10 @@ js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" -js-yaml@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" - integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== +js-yaml@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.1.tgz#854c292467705b699476e1a2decc0c8a3458806b" + integrity sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA== dependencies: argparse "^2.0.1" @@ -3402,9 +3428,9 @@ ts-node@^10.5.0: v8-compile-cache-lib "^3.0.0" yn "3.1.1" -"tsc-multi@https://github.com/stainless-api/tsc-multi/releases/download/v1.1.7/tsc-multi.tgz": - version "1.1.7" - resolved "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.7/tsc-multi.tgz#52f40adf8b808bd0b633346d11cc4a8aeea465cd" +"tsc-multi@https://github.com/stainless-api/tsc-multi/releases/download/v1.1.9/tsc-multi.tgz": + version "1.1.9" + resolved "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.9/tsc-multi.tgz#777f6f5d9e26bf0e94e5170990dd3a841d6707cd" dependencies: debug "^4.3.7" fast-glob "^3.3.2" @@ -3477,10 +3503,10 @@ undici-types@~5.26.4: resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== -undici-types@~6.19.2: - version "6.19.8" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02" - integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw== +undici-types@~6.21.0: + version "6.21.0" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.21.0.tgz#691d00af3909be93a7faa13be61b3a5b50ef12cb" + integrity sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ== unicode-emoji-modifier-base@^1.0.0: version "1.0.0"