Skip to content

Commit

Permalink
feat(api): manual updates (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Feb 16, 2025
1 parent 27035f2 commit 4b2d7c8
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 30
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/terminal%2Fterminal-628874ec2e5b758af40534d51d43f95fed9f211b93e27ce9a0a48b48fad01035.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/terminal%2Fterminal-d05a14360ad19c97c022f9f0fbc0e129c234aa471d5e4446f38ff07b97cef937.yml
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import Terminal from '@terminaldotshop/sdk';

const client = new Terminal({
bearerToken: process.env['TERMINAL_BEARER_TOKEN'], // This is the default and can be omitted
environment: 'sandbox', // defaults to 'production'
environment: 'dev', // defaults to 'production'
});

async function main() {
Expand All @@ -46,7 +46,7 @@ import Terminal from '@terminaldotshop/sdk';

const client = new Terminal({
bearerToken: process.env['TERMINAL_BEARER_TOKEN'], // This is the default and can be omitted
environment: 'sandbox', // defaults to 'production'
environment: 'dev', // defaults to 'production'
});

async function main() {
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ import { View, ViewInitResponse } from './resources/view';

const environments = {
production: 'https://api.terminal.shop/',
sandbox: 'https://sandbox.terminal.shop/',
dev: 'https://api.dev.terminal.shop/',
};
type Environment = keyof typeof environments;

Expand All @@ -88,7 +88,7 @@ export interface ClientOptions {
*
* Each environment maps to a different base URL:
* - `production` corresponds to `https://api.terminal.shop/`
* - `sandbox` corresponds to `https://sandbox.terminal.shop/`
* - `dev` corresponds to `https://api.dev.terminal.shop/`
*/
environment?: Environment | undefined;

Expand Down
34 changes: 34 additions & 0 deletions src/resources/subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,23 @@ export interface Subscription {
* Next shipment and billing date for the subscription.
*/
next?: string;

/**
* Schedule of the subscription.
*/
schedule?: Subscription.Type | Subscription.UnionMember1;
}

export namespace Subscription {
export interface Type {
type: 'fixed';
}

export interface UnionMember1 {
interval: number;

type: 'weekly';
}
}

export interface SubscriptionCreateResponse {
Expand Down Expand Up @@ -119,6 +136,23 @@ export interface SubscriptionCreateParams {
* Next shipment and billing date for the subscription.
*/
next?: string;

/**
* Schedule of the subscription.
*/
schedule?: SubscriptionCreateParams.Type | SubscriptionCreateParams.UnionMember1;
}

export namespace SubscriptionCreateParams {
export interface Type {
type: 'fixed';
}

export interface UnionMember1 {
interval: number;

type: 'weekly';
}
}

export declare namespace SubscriptionResource {
Expand Down
1 change: 1 addition & 0 deletions tests/api-resources/subscription.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ describe('resource subscription', () => {
productVariantID: 'var_XXXXXXXXXXXXXXXXXXXXXXXXX',
quantity: 1,
next: '2025-02-01T19:36:19.000Z',
schedule: { interval: 3, type: 'weekly' },
});
});

Expand Down

0 comments on commit 4b2d7c8

Please sign in to comment.