@stackup-fi/sdk 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { type Client, type Options as Options2, type TDataShape } from "./client/index.js";
2
- import type { CheckoutCreateErrors, CheckoutCreateResponses, CustomerCreateErrors, CustomerCreateResponses, CustomerDeleteErrors, CustomerDeleteResponses, CustomerGetErrors, CustomerGetResponses, CustomerListResponses, CustomerUpdateErrors, CustomerUpdateResponses } from "./types.gen.js";
2
+ import type { CheckoutSessionCreateErrors, CheckoutSessionCreateResponses, CustomerCreateErrors, CustomerCreateResponses, CustomerDeleteErrors, CustomerDeleteResponses, CustomerGetErrors, CustomerGetResponses, CustomerListResponses, CustomerUpdateErrors, CustomerUpdateResponses } from "./types.gen.js";
3
3
  export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
4
4
  /**
5
5
  * You can provide a client instance returned by `createClient()` instead of
@@ -66,15 +66,19 @@ export declare class Customer extends HeyApiClient {
66
66
  walletAddress?: unknown;
67
67
  }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<CustomerUpdateResponses, CustomerUpdateErrors, ThrowOnError, "fields">;
68
68
  }
69
- export declare class Checkout extends HeyApiClient {
69
+ export declare class Session extends HeyApiClient {
70
70
  /**
71
- * Get checkout details
71
+ * Create checkout session
72
72
  *
73
- * Retrieve product, token, and chain information for checkout by product ID
73
+ * Generate a checkout session URL for a product by product ID
74
74
  */
75
75
  create<ThrowOnError extends boolean = false>(parameters: {
76
76
  id: string;
77
- }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<CheckoutCreateResponses, CheckoutCreateErrors, ThrowOnError, "fields">;
77
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<CheckoutSessionCreateResponses, CheckoutSessionCreateErrors, ThrowOnError, "fields">;
78
+ }
79
+ export declare class Checkout extends HeyApiClient {
80
+ private _session?;
81
+ get session(): Session;
78
82
  }
79
83
  export declare class StackupClient extends HeyApiClient {
80
84
  static readonly __registry: HeyApiRegistry<StackupClient>;
@@ -100,21 +100,27 @@ export class Customer extends HeyApiClient {
100
100
  });
101
101
  }
102
102
  }
103
- export class Checkout extends HeyApiClient {
103
+ export class Session extends HeyApiClient {
104
104
  /**
105
- * Get checkout details
105
+ * Create checkout session
106
106
  *
107
- * Retrieve product, token, and chain information for checkout by product ID
107
+ * Generate a checkout session URL for a product by product ID
108
108
  */
109
109
  create(parameters, options) {
110
110
  const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "id" }] }]);
111
111
  return (options?.client ?? this.client).post({
112
- url: "/checkout/{id}",
112
+ url: "/checkout/session/{id}",
113
113
  ...options,
114
114
  ...params,
115
115
  });
116
116
  }
117
117
  }
118
+ export class Checkout extends HeyApiClient {
119
+ _session;
120
+ get session() {
121
+ return (this._session ??= new Session({ client: this.client }));
122
+ }
123
+ }
118
124
  export class StackupClient extends HeyApiClient {
119
125
  static __registry = new HeyApiRegistry();
120
126
  constructor(args) {
@@ -58,6 +58,10 @@ export type CustomerCreateResponses = {
58
58
  * Customer's EVM-compatible wallet address
59
59
  */
60
60
  walletAddress: unknown;
61
+ /**
62
+ * Customer's email address
63
+ */
64
+ email: string | null;
61
65
  };
62
66
  };
63
67
  export type CustomerCreateResponse = CustomerCreateResponses[keyof CustomerCreateResponses];
@@ -96,6 +100,10 @@ export type CustomerListResponses = {
96
100
  * Customer's EVM-compatible wallet address
97
101
  */
98
102
  walletAddress: unknown;
103
+ /**
104
+ * Customer's email address
105
+ */
106
+ email: string | null;
99
107
  }>;
100
108
  };
101
109
  export type CustomerListResponse = CustomerListResponses[keyof CustomerListResponses];
@@ -179,6 +187,10 @@ export type CustomerGetResponses = {
179
187
  * Customer's EVM-compatible wallet address
180
188
  */
181
189
  walletAddress: unknown;
190
+ /**
191
+ * Customer's email address
192
+ */
193
+ email: string | null;
182
194
  };
183
195
  };
184
196
  export type CustomerGetResponse = CustomerGetResponses[keyof CustomerGetResponses];
@@ -238,18 +250,22 @@ export type CustomerUpdateResponses = {
238
250
  * Customer's EVM-compatible wallet address
239
251
  */
240
252
  walletAddress: unknown;
253
+ /**
254
+ * Customer's email address
255
+ */
256
+ email: string | null;
241
257
  };
242
258
  };
243
259
  export type CustomerUpdateResponse = CustomerUpdateResponses[keyof CustomerUpdateResponses];
244
- export type CheckoutCreateData = {
260
+ export type CheckoutSessionCreateData = {
245
261
  body?: never;
246
262
  path: {
247
263
  id: string;
248
264
  };
249
265
  query?: never;
250
- url: "/checkout/{id}";
266
+ url: "/checkout/session/{id}";
251
267
  };
252
- export type CheckoutCreateErrors = {
268
+ export type CheckoutSessionCreateErrors = {
253
269
  /**
254
270
  * Bad request
255
271
  */
@@ -259,32 +275,13 @@ export type CheckoutCreateErrors = {
259
275
  */
260
276
  404: NotFoundError;
261
277
  };
262
- export type CheckoutCreateError = CheckoutCreateErrors[keyof CheckoutCreateErrors];
263
- export type CheckoutCreateResponses = {
278
+ export type CheckoutSessionCreateError = CheckoutSessionCreateErrors[keyof CheckoutSessionCreateErrors];
279
+ export type CheckoutSessionCreateResponses = {
264
280
  /**
265
- * Checkout details retrieved successfully
281
+ * Checkout session created successfully
266
282
  */
267
283
  200: {
268
- product: {
269
- id: string;
270
- name: string;
271
- description: string;
272
- price: string;
273
- priceRaw: string;
274
- payoutAddress: unknown;
275
- };
276
- token: {
277
- address: unknown;
278
- symbol: string;
279
- name: string;
280
- decimals: number;
281
- logoURI: string;
282
- };
283
- chain: {
284
- id: 1 | 8453;
285
- name: string;
286
- logoURI: string;
287
- };
284
+ url: string;
288
285
  };
289
286
  };
290
- export type CheckoutCreateResponse = CheckoutCreateResponses[keyof CheckoutCreateResponses];
287
+ export type CheckoutSessionCreateResponse = CheckoutSessionCreateResponses[keyof CheckoutSessionCreateResponses];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackup-fi/sdk",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "exports": {