diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 5ded72d45..e529e58d9 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -1,6 +1,8 @@ name: Release Doctor on: pull_request: + branches: + - main workflow_dispatch: jobs: diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 7d9b009db..78e7f271d 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.10.0" + ".": "0.11.0" } diff --git a/.stats.yml b/.stats.yml index 8ff187d6a..aee68043a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 27 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/val-town%2Fval-town-1163fdd3bd8539ac941dba4e86357b43427c205cac02ff209e68e206f5e69e68.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/val-town%2Fval-town-d10bdbb2cd8214c21365353b6c7e1243438827a1ad7d41859b1f6dcd2a26e425.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 762dc8f6b..ee1fa6458 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,42 @@ # Changelog +## 0.11.0 (2024-07-23) + +Full Changelog: [v0.10.0...v0.11.0](https://github.com/val-town/sdk/compare/v0.10.0...v0.11.0) + +### Features + +* **api:** OpenAPI spec update via Stainless API ([#184](https://github.com/val-town/sdk/issues/184)) ([b1a0e0f](https://github.com/val-town/sdk/commit/b1a0e0fd8c736184ce6def29a9169789fe843718)) +* **api:** OpenAPI spec update via Stainless API ([#186](https://github.com/val-town/sdk/issues/186)) ([0283799](https://github.com/val-town/sdk/commit/02837997e352c90e32d612d59364f50130c7a575)) +* **api:** OpenAPI spec update via Stainless API ([#187](https://github.com/val-town/sdk/issues/187)) ([48a4c99](https://github.com/val-town/sdk/commit/48a4c992acd2eae0171a887bda9996d1969495c9)) +* **api:** OpenAPI spec update via Stainless API ([#188](https://github.com/val-town/sdk/issues/188)) ([9c3d888](https://github.com/val-town/sdk/commit/9c3d88811bec01e2e2c34339e09dd5199b43e074)) +* **api:** OpenAPI spec update via Stainless API ([#189](https://github.com/val-town/sdk/issues/189)) ([8b232e4](https://github.com/val-town/sdk/commit/8b232e4597096c25f33b026c1a663c7d10eda93e)) +* **api:** OpenAPI spec update via Stainless API ([#190](https://github.com/val-town/sdk/issues/190)) ([806480a](https://github.com/val-town/sdk/commit/806480a32f77b1af29421f041c0c9b502fd5b5aa)) +* **api:** OpenAPI spec update via Stainless API ([#191](https://github.com/val-town/sdk/issues/191)) ([01adecd](https://github.com/val-town/sdk/commit/01adecd4a2b9a54d26fd57381973051086e047a7)) +* **api:** OpenAPI spec update via Stainless API ([#192](https://github.com/val-town/sdk/issues/192)) ([07689f5](https://github.com/val-town/sdk/commit/07689f5f698e5a407b47a5d89ba171388e755058)) +* **api:** OpenAPI spec update via Stainless API ([#193](https://github.com/val-town/sdk/issues/193)) ([b412ad3](https://github.com/val-town/sdk/commit/b412ad35daa21775a7632df0217f7102bd23f090)) +* **api:** OpenAPI spec update via Stainless API ([#194](https://github.com/val-town/sdk/issues/194)) ([e98b979](https://github.com/val-town/sdk/commit/e98b979bde0e714ed21e4efe215f8fd3069d967a)) +* **api:** OpenAPI spec update via Stainless API ([#195](https://github.com/val-town/sdk/issues/195)) ([a54f962](https://github.com/val-town/sdk/commit/a54f9624b7c8314bc851e9891b3ac44638e53462)) +* **api:** OpenAPI spec update via Stainless API ([#196](https://github.com/val-town/sdk/issues/196)) ([f3501ba](https://github.com/val-town/sdk/commit/f3501ba424788cfaa7f1a41edfd6f2dfd1138b4a)) +* **api:** OpenAPI spec update via Stainless API ([#201](https://github.com/val-town/sdk/issues/201)) ([4626fb1](https://github.com/val-town/sdk/commit/4626fb17f7e83aa4e68ce994d7692b92e516af26)) +* **api:** OpenAPI spec update via Stainless API ([#202](https://github.com/val-town/sdk/issues/202)) ([2987b54](https://github.com/val-town/sdk/commit/2987b541504264c9fd5d2a48b9acd92ea91ef481)) +* **api:** OpenAPI spec update via Stainless API ([#203](https://github.com/val-town/sdk/issues/203)) ([ed1dc8e](https://github.com/val-town/sdk/commit/ed1dc8e35091c6e8e36049b8959f6654eb0508cf)) +* **api:** OpenAPI spec update via Stainless API ([#204](https://github.com/val-town/sdk/issues/204)) ([ca41878](https://github.com/val-town/sdk/commit/ca418788c0fdc42279ddff71ec3b5a2eb81966d6)) +* **api:** OpenAPI spec update via Stainless API ([#205](https://github.com/val-town/sdk/issues/205)) ([f46ab31](https://github.com/val-town/sdk/commit/f46ab310b2b90697b970f7472c2aac13468b1f81)) +* **api:** OpenAPI spec update via Stainless API ([#206](https://github.com/val-town/sdk/issues/206)) ([4fc0ac6](https://github.com/val-town/sdk/commit/4fc0ac6b3add5af9ea67055aaca779c9108558bd)) + + +### Bug Fixes + +* use relative paths ([#200](https://github.com/val-town/sdk/issues/200)) ([65738be](https://github.com/val-town/sdk/commit/65738be5cb92bb658f8ed2b282cfbcf34aa5e899)) + + +### Chores + +* **ci:** limit release doctor target branches ([#198](https://github.com/val-town/sdk/issues/198)) ([27f67a2](https://github.com/val-town/sdk/commit/27f67a2cc1435b200b0215d8a607710c3236ecec)) +* **docs:** use client instead of package name in Node examples ([#197](https://github.com/val-town/sdk/issues/197)) ([b69821e](https://github.com/val-town/sdk/commit/b69821e5cf77c7f679241d9a4fe21f9cf3a3bc77)) +* **tests:** update prism version ([#199](https://github.com/val-town/sdk/issues/199)) ([ef5556e](https://github.com/val-town/sdk/commit/ef5556e97fa6d87ffdc18b35121ab804d1cd1258)) + ## 0.10.0 (2024-07-16) Full Changelog: [v0.9.0...v0.10.0](https://github.com/val-town/sdk/compare/v0.9.0...v0.10.0) diff --git a/README.md b/README.md index f8fe16e2b..898775f7e 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ The full API of this library can be found in [api.md](api.md). ```js import ValTown from '@valtown/sdk'; -const valTown = new ValTown(); +const client = new ValTown(); async function main() { const emailSendResponse = await valTown.emails.send(); @@ -41,7 +41,7 @@ This library includes TypeScript definitions for all request params and response ```ts import ValTown from '@valtown/sdk'; -const valTown = new ValTown(); +const client = new ValTown(); async function main() { const emailSendResponse: ValTown.EmailSendResponse = await valTown.emails.send(); @@ -99,7 +99,7 @@ You can use the `maxRetries` option to configure or disable this: ```js // Configure the default for all requests: -const valTown = new ValTown({ +const client = new ValTown({ maxRetries: 0, // default is 2 }); @@ -116,7 +116,7 @@ Requests time out after 1 minute by default. You can configure this with a `time ```ts // Configure the default for all requests: -const valTown = new ValTown({ +const client = new ValTown({ timeout: 20 * 1000, // 20 seconds (default is 1 minute) }); @@ -140,7 +140,7 @@ You can also use the `.withResponse()` method to get the raw `Response` along wi ```ts -const valTown = new ValTown(); +const client = new ValTown(); const response = await valTown.emails.send().asResponse(); console.log(response.headers.get('X-My-Header')); @@ -247,7 +247,7 @@ import http from 'http'; import { HttpsProxyAgent } from 'https-proxy-agent'; // Configure the default for all requests: -const valTown = new ValTown({ +const client = new ValTown({ httpAgent: new HttpsProxyAgent(process.env.PROXY_URL), }); diff --git a/package.json b/package.json index ad96101ee..ce5b43b1b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@valtown/sdk", - "version": "0.10.0", + "version": "0.11.0", "description": "The official TypeScript library for the Val Town API", "author": "Val Town ", "types": "dist/index.d.ts", diff --git a/scripts/mock b/scripts/mock index fe89a1d08..f58615769 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=@stoplight/prism-cli@~5.8 -- prism mock "$URL" &> .prism.log & + npm exec --package=@stainless-api/prism-cli@5.8.4 -- 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=@stoplight/prism-cli@~5.8 -- prism mock "$URL" + npm exec --package=@stainless-api/prism-cli@5.8.4 -- prism mock "$URL" fi diff --git a/src/index.ts b/src/index.ts index b4d495f39..76f3b61fc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,9 +3,9 @@ import * as Errors from './error'; import * as Uploads from './uploads'; import { type Agent } from './_shims/index'; -import * as Core from '@valtown/sdk/core'; -import * as Pagination from '@valtown/sdk/pagination'; -import * as API from '@valtown/sdk/resources/index'; +import * as Core from './core'; +import * as Pagination from './pagination'; +import * as API from './resources/index'; export interface ClientOptions { /** diff --git a/src/resources/alias/alias.ts b/src/resources/alias/alias.ts index d424c584c..3c1e7661e 100644 --- a/src/resources/alias/alias.ts +++ b/src/resources/alias/alias.ts @@ -1,7 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from '@valtown/sdk/resource'; -import * as UsernameAPI from '@valtown/sdk/resources/alias/username/username'; +import { APIResource } from '../../resource'; +import * as UsernameAPI from './username/username'; /** * Methods to translate between human-readable names and IDs diff --git a/src/resources/alias/username/username.ts b/src/resources/alias/username/username.ts index 828ec9916..8691f8aca 100644 --- a/src/resources/alias/username/username.ts +++ b/src/resources/alias/username/username.ts @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from '@valtown/sdk/resource'; -import * as Core from '@valtown/sdk/core'; -import * as Shared from '@valtown/sdk/resources/shared'; -import * as ValNameAPI from '@valtown/sdk/resources/alias/username/val-name'; +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import * as Shared from '../../shared'; +import * as ValNameAPI from './val-name'; export class Username extends APIResource { valName: ValNameAPI.ValName = new ValNameAPI.ValName(this._client); diff --git a/src/resources/alias/username/val-name.ts b/src/resources/alias/username/val-name.ts index ad912caaa..452a35081 100644 --- a/src/resources/alias/username/val-name.ts +++ b/src/resources/alias/username/val-name.ts @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from '@valtown/sdk/resource'; -import * as Core from '@valtown/sdk/core'; -import * as ValNameAPI from '@valtown/sdk/resources/alias/username/val-name'; +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import * as ValNameAPI from './val-name'; export class ValName extends APIResource { /** @@ -72,7 +72,7 @@ export interface ValNameRetrieveResponse { * The type of a val. HTTP can receive web requests, Email can receive emails, Cron * runs periodically, and Script can be used for libraries or one-off calculations */ - type: 'interval' | 'http' | 'express' | 'email' | 'script' | 'rpc'; + type: 'interval' | 'http' | 'express' | 'email' | 'script' | 'rpc' | 'httpnext'; /** * The URL of this val on the Val Town website @@ -110,6 +110,11 @@ export namespace ValNameRetrieveResponse { * The endpoint to retrieve this val’s versions */ versions: string; + + /** + * This val’s web endpoint, where it serves a website or API + */ + endpoint?: string; } } diff --git a/src/resources/blobs.ts b/src/resources/blobs.ts index f2cdc798a..667c78364 100644 --- a/src/resources/blobs.ts +++ b/src/resources/blobs.ts @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from '@valtown/sdk/resource'; -import { isRequestOptions } from '@valtown/sdk/core'; -import * as Core from '@valtown/sdk/core'; -import * as BlobsAPI from '@valtown/sdk/resources/blobs'; -import { type Response } from '@valtown/sdk/_shims/index'; +import { APIResource } from '../resource'; +import { isRequestOptions } from '../core'; +import * as Core from '../core'; +import * as BlobsAPI from './blobs'; +import { type Response } from '../_shims/index'; /** * Blob storage lets you store larger objects, including binary data diff --git a/src/resources/emails.ts b/src/resources/emails.ts index b28cb862f..7d17607d8 100644 --- a/src/resources/emails.ts +++ b/src/resources/emails.ts @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from '@valtown/sdk/resource'; -import { isRequestOptions } from '@valtown/sdk/core'; -import * as Core from '@valtown/sdk/core'; -import * as EmailsAPI from '@valtown/sdk/resources/emails'; +import { APIResource } from '../resource'; +import { isRequestOptions } from '../core'; +import * as Core from '../core'; +import * as EmailsAPI from './emails'; /** * Val Town supports sending emails from vals diff --git a/src/resources/eval.ts b/src/resources/eval.ts index 665a0837a..72d5b1e82 100644 --- a/src/resources/eval.ts +++ b/src/resources/eval.ts @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from '@valtown/sdk/resource'; -import * as Core from '@valtown/sdk/core'; -import * as EvalAPI from '@valtown/sdk/resources/eval'; +import { APIResource } from '../resource'; +import * as Core from '../core'; +import * as EvalAPI from './eval'; export class Eval extends APIResource { /** diff --git a/src/resources/me/comments.ts b/src/resources/me/comments.ts index 87bcb74b4..d2495e9ea 100644 --- a/src/resources/me/comments.ts +++ b/src/resources/me/comments.ts @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from '@valtown/sdk/resource'; -import * as Core from '@valtown/sdk/core'; -import * as CommentsAPI from '@valtown/sdk/resources/me/comments'; -import { PageCursorURL, type PageCursorURLParams } from '@valtown/sdk/pagination'; +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import * as CommentsAPI from './comments'; +import { PageCursorURL, type PageCursorURLParams } from '../../pagination'; export class Comments extends APIResource { /** diff --git a/src/resources/me/likes.ts b/src/resources/me/likes.ts index b3d0c28a5..2a4d7e5bc 100644 --- a/src/resources/me/likes.ts +++ b/src/resources/me/likes.ts @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from '@valtown/sdk/resource'; -import * as Core from '@valtown/sdk/core'; -import * as LikesAPI from '@valtown/sdk/resources/me/likes'; -import * as Shared from '@valtown/sdk/resources/shared'; -import { BasicValsPageCursorURL } from '@valtown/sdk/resources/shared'; -import { type PageCursorURLParams } from '@valtown/sdk/pagination'; +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import * as LikesAPI from './likes'; +import * as Shared from '../shared'; +import { BasicValsPageCursorURL } from '../shared'; +import { type PageCursorURLParams } from '../../pagination'; export class Likes extends APIResource { /** diff --git a/src/resources/me/me.ts b/src/resources/me/me.ts index 64d07c33d..dd18b1480 100644 --- a/src/resources/me/me.ts +++ b/src/resources/me/me.ts @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from '@valtown/sdk/resource'; -import * as CommentsAPI from '@valtown/sdk/resources/me/comments'; -import * as LikesAPI from '@valtown/sdk/resources/me/likes'; -import * as ProfileAPI from '@valtown/sdk/resources/me/profile'; -import * as ReferencesAPI from '@valtown/sdk/resources/me/references'; +import { APIResource } from '../../resource'; +import * as CommentsAPI from './comments'; +import * as LikesAPI from './likes'; +import * as ProfileAPI from './profile'; +import * as ReferencesAPI from './references'; /** * Methods to get information about your own profile and resources diff --git a/src/resources/me/profile.ts b/src/resources/me/profile.ts index 21b8a42d7..e1645b2a2 100644 --- a/src/resources/me/profile.ts +++ b/src/resources/me/profile.ts @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from '@valtown/sdk/resource'; -import * as Core from '@valtown/sdk/core'; -import * as ProfileAPI from '@valtown/sdk/resources/me/profile'; +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import * as ProfileAPI from './profile'; export class Profile extends APIResource { /** diff --git a/src/resources/me/references.ts b/src/resources/me/references.ts index 3aae3fa4a..990701f62 100644 --- a/src/resources/me/references.ts +++ b/src/resources/me/references.ts @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from '@valtown/sdk/resource'; -import * as Core from '@valtown/sdk/core'; -import * as ReferencesAPI from '@valtown/sdk/resources/me/references'; -import { PageCursorURL, type PageCursorURLParams } from '@valtown/sdk/pagination'; +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import * as ReferencesAPI from './references'; +import { PageCursorURL, type PageCursorURLParams } from '../../pagination'; export class References extends APIResource { /** diff --git a/src/resources/search/search.ts b/src/resources/search/search.ts index 651c90b72..44e0a3e01 100644 --- a/src/resources/search/search.ts +++ b/src/resources/search/search.ts @@ -1,7 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from '@valtown/sdk/resource'; -import * as ValsAPI from '@valtown/sdk/resources/search/vals'; +import { APIResource } from '../../resource'; +import * as ValsAPI from './vals'; /** * Search endpoint for vals diff --git a/src/resources/search/vals.ts b/src/resources/search/vals.ts index 3f20c4fda..bfda43d3b 100644 --- a/src/resources/search/vals.ts +++ b/src/resources/search/vals.ts @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from '@valtown/sdk/resource'; -import * as Core from '@valtown/sdk/core'; -import * as ValsAPI from '@valtown/sdk/resources/search/vals'; -import * as Shared from '@valtown/sdk/resources/shared'; -import { BasicValsPageCursorURL } from '@valtown/sdk/resources/shared'; -import { type PageCursorURLParams } from '@valtown/sdk/pagination'; +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import * as ValsAPI from './vals'; +import * as Shared from '../shared'; +import { BasicValsPageCursorURL } from '../shared'; +import { type PageCursorURLParams } from '../../pagination'; export class Vals extends APIResource { /** diff --git a/src/resources/shared.ts b/src/resources/shared.ts index 8857377b3..769bac037 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { PageCursorURL } from '@valtown/sdk/pagination'; +import { PageCursorURL } from '../pagination'; /** * A Val @@ -45,7 +45,7 @@ export interface BasicVal { * The type of a val. HTTP can receive web requests, Email can receive emails, Cron * runs periodically, and Script can be used for libraries or one-off calculations */ - type: 'interval' | 'http' | 'express' | 'email' | 'script' | 'rpc'; + type: 'interval' | 'http' | 'express' | 'email' | 'script' | 'rpc' | 'httpnext'; /** * The URL of this val on the Val Town website @@ -83,6 +83,11 @@ export namespace BasicVal { * The endpoint to retrieve this val’s versions */ versions: string; + + /** + * This val’s web endpoint, where it serves a website or API + */ + endpoint?: string; } } @@ -141,7 +146,7 @@ export interface ExtendedVal { * The type of a val. HTTP can receive web requests, Email can receive emails, Cron * runs periodically, and Script can be used for libraries or one-off calculations */ - type: 'interval' | 'http' | 'express' | 'email' | 'script' | 'rpc'; + type: 'interval' | 'http' | 'express' | 'email' | 'script' | 'rpc' | 'httpnext'; /** * The URL of this val on the Val Town website @@ -179,6 +184,11 @@ export namespace ExtendedVal { * The endpoint to retrieve this val’s versions */ versions: string; + + /** + * This val’s web endpoint, where it serves a website or API + */ + endpoint?: string; } } diff --git a/src/resources/sqlite.ts b/src/resources/sqlite.ts index 410fc8e10..014eee701 100644 --- a/src/resources/sqlite.ts +++ b/src/resources/sqlite.ts @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from '@valtown/sdk/resource'; -import * as Core from '@valtown/sdk/core'; -import * as SqliteAPI from '@valtown/sdk/resources/sqlite'; -import * as Shared from '@valtown/sdk/resources/shared'; +import { APIResource } from '../resource'; +import * as Core from '../core'; +import * as SqliteAPI from './sqlite'; +import * as Shared from './shared'; /** * Vals access a shared SQLite database diff --git a/src/resources/users/users.ts b/src/resources/users/users.ts index c81792a79..0b920f143 100644 --- a/src/resources/users/users.ts +++ b/src/resources/users/users.ts @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from '@valtown/sdk/resource'; -import * as Core from '@valtown/sdk/core'; -import * as Shared from '@valtown/sdk/resources/shared'; -import * as ValsAPI from '@valtown/sdk/resources/users/vals'; +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import * as Shared from '../shared'; +import * as ValsAPI from './vals'; /** * Access public user information and list other people’s vals diff --git a/src/resources/users/vals.ts b/src/resources/users/vals.ts index 1c37593b4..3429c192d 100644 --- a/src/resources/users/vals.ts +++ b/src/resources/users/vals.ts @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from '@valtown/sdk/resource'; -import * as Core from '@valtown/sdk/core'; -import * as ValsAPI from '@valtown/sdk/resources/users/vals'; -import * as Shared from '@valtown/sdk/resources/shared'; -import { BasicValsPageCursorURL } from '@valtown/sdk/resources/shared'; -import { type PageCursorURLParams } from '@valtown/sdk/pagination'; +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import * as ValsAPI from './vals'; +import * as Shared from '../shared'; +import { BasicValsPageCursorURL } from '../shared'; +import { type PageCursorURLParams } from '../../pagination'; export class Vals extends APIResource { /** diff --git a/src/resources/vals/vals.ts b/src/resources/vals/vals.ts index 0dbcc15a7..38868824d 100644 --- a/src/resources/vals/vals.ts +++ b/src/resources/vals/vals.ts @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from '@valtown/sdk/resource'; -import { isRequestOptions } from '@valtown/sdk/core'; -import * as Core from '@valtown/sdk/core'; -import * as ValsAPI from '@valtown/sdk/resources/vals/vals'; -import * as Shared from '@valtown/sdk/resources/shared'; -import * as VersionsAPI from '@valtown/sdk/resources/vals/versions'; +import { APIResource } from '../../resource'; +import { isRequestOptions } from '../../core'; +import * as Core from '../../core'; +import * as ValsAPI from './vals'; +import * as Shared from '../shared'; +import * as VersionsAPI from './versions'; /** * Vals are runnable JavaScript, TypeScript, and JSX modules diff --git a/src/resources/vals/versions.ts b/src/resources/vals/versions.ts index f892dad7a..93e24d7e5 100644 --- a/src/resources/vals/versions.ts +++ b/src/resources/vals/versions.ts @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from '@valtown/sdk/resource'; -import * as Core from '@valtown/sdk/core'; -import * as VersionsAPI from '@valtown/sdk/resources/vals/versions'; -import * as Shared from '@valtown/sdk/resources/shared'; -import { PageCursorURL, type PageCursorURLParams } from '@valtown/sdk/pagination'; +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import * as VersionsAPI from './versions'; +import * as Shared from '../shared'; +import { PageCursorURL, type PageCursorURLParams } from '../../pagination'; export class Versions extends APIResource { /** diff --git a/src/version.ts b/src/version.ts index c2e5b9691..9085e9de6 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.10.0'; // x-release-please-version +export const VERSION = '0.11.0'; // x-release-please-version diff --git a/tests/api-resources/users/users.test.ts b/tests/api-resources/users/users.test.ts index eaba10bb2..679505d8c 100644 --- a/tests/api-resources/users/users.test.ts +++ b/tests/api-resources/users/users.test.ts @@ -10,7 +10,7 @@ const valTown = new ValTown({ describe('resource users', () => { test('retrieve', async () => { - const responsePromise = valTown.users.retrieve('user_id'); + const responsePromise = valTown.users.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -22,8 +22,8 @@ describe('resource users', () => { test('retrieve: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(valTown.users.retrieve('user_id', { path: '/_stainless_unknown_path' })).rejects.toThrow( - ValTown.NotFoundError, - ); + await expect( + valTown.users.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(ValTown.NotFoundError); }); }); diff --git a/tests/api-resources/users/vals.test.ts b/tests/api-resources/users/vals.test.ts index 7df23f927..8f189fd6e 100644 --- a/tests/api-resources/users/vals.test.ts +++ b/tests/api-resources/users/vals.test.ts @@ -10,7 +10,10 @@ const valTown = new ValTown({ describe('resource vals', () => { test('list: only required params', async () => { - const responsePromise = valTown.users.vals.list('user_id', { limit: 1, offset: 0 }); + const responsePromise = valTown.users.vals.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { + limit: 1, + offset: 0, + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -21,6 +24,9 @@ describe('resource vals', () => { }); test('list: required and optional params', async () => { - const response = await valTown.users.vals.list('user_id', { limit: 1, offset: 0 }); + const response = await valTown.users.vals.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { + limit: 1, + offset: 0, + }); }); });