@stackup-fi/sdk 1.0.3 → 1.0.5

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 { CheckoutSessionCreateErrors, CheckoutSessionCreateResponses, 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, ProductCreateErrors, ProductCreateResponses, ProductDeleteErrors, ProductDeleteResponses, ProductGetErrors, ProductGetResponses, ProductListResponses, ProductUpdateErrors, ProductUpdateResponses } 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,6 +66,52 @@ 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 Product extends HeyApiClient {
70
+ /**
71
+ * Create product
72
+ *
73
+ * Create a new product
74
+ */
75
+ create<ThrowOnError extends boolean = false>(parameters?: {
76
+ walletID?: string;
77
+ payoutWalletID?: string;
78
+ chainID?: 1 | 8453;
79
+ token?: unknown;
80
+ price?: string;
81
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<ProductCreateResponses, ProductCreateErrors, ThrowOnError, "fields">;
82
+ /**
83
+ * List products
84
+ *
85
+ * List all products for the current workspace
86
+ */
87
+ list<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<ProductListResponses, unknown, ThrowOnError, "fields">;
88
+ /**
89
+ * Delete product
90
+ *
91
+ * Delete a product (soft delete)
92
+ */
93
+ delete<ThrowOnError extends boolean = false>(parameters: {
94
+ id: string;
95
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<ProductDeleteResponses, ProductDeleteErrors, ThrowOnError, "fields">;
96
+ /**
97
+ * Get product
98
+ *
99
+ * Get a specific product by ID
100
+ */
101
+ get<ThrowOnError extends boolean = false>(parameters: {
102
+ id: string;
103
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<ProductGetResponses, ProductGetErrors, ThrowOnError, "fields">;
104
+ /**
105
+ * Update product
106
+ *
107
+ * Update a product's price or paused status
108
+ */
109
+ update<ThrowOnError extends boolean = false>(parameters: {
110
+ id: string;
111
+ price?: string;
112
+ paused?: boolean;
113
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<ProductUpdateResponses, ProductUpdateErrors, ThrowOnError, "fields">;
114
+ }
69
115
  export declare class Session extends HeyApiClient {
70
116
  /**
71
117
  * Create checkout session
@@ -88,6 +134,8 @@ export declare class StackupClient extends HeyApiClient {
88
134
  });
89
135
  private _customer?;
90
136
  get customer(): Customer;
137
+ private _product?;
138
+ get product(): Product;
91
139
  private _checkout?;
92
140
  get checkout(): Checkout;
93
141
  }
@@ -100,6 +100,96 @@ export class Customer extends HeyApiClient {
100
100
  });
101
101
  }
102
102
  }
103
+ export class Product extends HeyApiClient {
104
+ /**
105
+ * Create product
106
+ *
107
+ * Create a new product
108
+ */
109
+ create(parameters, options) {
110
+ const params = buildClientParams([parameters], [
111
+ {
112
+ args: [
113
+ { in: "body", key: "walletID" },
114
+ { in: "body", key: "payoutWalletID" },
115
+ { in: "body", key: "chainID" },
116
+ { in: "body", key: "token" },
117
+ { in: "body", key: "price" },
118
+ ],
119
+ },
120
+ ]);
121
+ return (options?.client ?? this.client).post({
122
+ url: "/product/create",
123
+ ...options,
124
+ ...params,
125
+ headers: {
126
+ "Content-Type": "application/json",
127
+ ...options?.headers,
128
+ ...params.headers,
129
+ },
130
+ });
131
+ }
132
+ /**
133
+ * List products
134
+ *
135
+ * List all products for the current workspace
136
+ */
137
+ list(options) {
138
+ return (options?.client ?? this.client).get({ url: "/product", ...options });
139
+ }
140
+ /**
141
+ * Delete product
142
+ *
143
+ * Delete a product (soft delete)
144
+ */
145
+ delete(parameters, options) {
146
+ const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "id" }] }]);
147
+ return (options?.client ?? this.client).delete({
148
+ url: "/product/{id}",
149
+ ...options,
150
+ ...params,
151
+ });
152
+ }
153
+ /**
154
+ * Get product
155
+ *
156
+ * Get a specific product by ID
157
+ */
158
+ get(parameters, options) {
159
+ const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "id" }] }]);
160
+ return (options?.client ?? this.client).get({
161
+ url: "/product/{id}",
162
+ ...options,
163
+ ...params,
164
+ });
165
+ }
166
+ /**
167
+ * Update product
168
+ *
169
+ * Update a product's price or paused status
170
+ */
171
+ update(parameters, options) {
172
+ const params = buildClientParams([parameters], [
173
+ {
174
+ args: [
175
+ { in: "path", key: "id" },
176
+ { in: "body", key: "price" },
177
+ { in: "body", key: "paused" },
178
+ ],
179
+ },
180
+ ]);
181
+ return (options?.client ?? this.client).patch({
182
+ url: "/product/{id}",
183
+ ...options,
184
+ ...params,
185
+ headers: {
186
+ "Content-Type": "application/json",
187
+ ...options?.headers,
188
+ ...params.headers,
189
+ },
190
+ });
191
+ }
192
+ }
103
193
  export class Session extends HeyApiClient {
104
194
  /**
105
195
  * Create checkout session
@@ -131,6 +221,10 @@ export class StackupClient extends HeyApiClient {
131
221
  get customer() {
132
222
  return (this._customer ??= new Customer({ client: this.client }));
133
223
  }
224
+ _product;
225
+ get product() {
226
+ return (this._product ??= new Product({ client: this.client }));
227
+ }
134
228
  _checkout;
135
229
  get checkout() {
136
230
  return (this._checkout ??= new Checkout({ client: this.client }));
@@ -257,6 +257,182 @@ export type CustomerUpdateResponses = {
257
257
  };
258
258
  };
259
259
  export type CustomerUpdateResponse = CustomerUpdateResponses[keyof CustomerUpdateResponses];
260
+ export type ProductCreateData = {
261
+ body?: {
262
+ walletID: string;
263
+ payoutWalletID: string;
264
+ chainID: 1 | 8453;
265
+ token: unknown;
266
+ price: string;
267
+ };
268
+ path?: never;
269
+ query?: never;
270
+ url: "/product/create";
271
+ };
272
+ export type ProductCreateErrors = {
273
+ /**
274
+ * Bad request
275
+ */
276
+ 400: BadRequestError;
277
+ };
278
+ export type ProductCreateError = ProductCreateErrors[keyof ProductCreateErrors];
279
+ export type ProductCreateResponses = {
280
+ /**
281
+ * Product created successfully
282
+ */
283
+ 201: {
284
+ id: string;
285
+ workspaceID: string;
286
+ timeCreated: unknown;
287
+ timeUpdated: unknown;
288
+ timeDeleted: unknown | null;
289
+ walletID: string;
290
+ payoutWalletID: string;
291
+ chainID: 1 | 8453;
292
+ token: unknown;
293
+ price: string;
294
+ paused: boolean;
295
+ name: string;
296
+ description: string | null;
297
+ };
298
+ };
299
+ export type ProductCreateResponse = ProductCreateResponses[keyof ProductCreateResponses];
300
+ export type ProductListData = {
301
+ body?: never;
302
+ path?: never;
303
+ query?: never;
304
+ url: "/product";
305
+ };
306
+ export type ProductListResponses = {
307
+ /**
308
+ * List of products
309
+ */
310
+ 200: Array<{
311
+ id: string;
312
+ workspaceID: string;
313
+ timeCreated: unknown;
314
+ timeUpdated: unknown;
315
+ timeDeleted: unknown | null;
316
+ walletID: string;
317
+ payoutWalletID: string;
318
+ chainID: 1 | 8453;
319
+ token: unknown;
320
+ price: string;
321
+ paused: boolean;
322
+ name: string;
323
+ description: string | null;
324
+ }>;
325
+ };
326
+ export type ProductListResponse = ProductListResponses[keyof ProductListResponses];
327
+ export type ProductDeleteData = {
328
+ body?: never;
329
+ path: {
330
+ id: string;
331
+ };
332
+ query?: never;
333
+ url: "/product/{id}";
334
+ };
335
+ export type ProductDeleteErrors = {
336
+ /**
337
+ * Bad request
338
+ */
339
+ 400: BadRequestError;
340
+ /**
341
+ * Not found
342
+ */
343
+ 404: NotFoundError;
344
+ };
345
+ export type ProductDeleteError = ProductDeleteErrors[keyof ProductDeleteErrors];
346
+ export type ProductDeleteResponses = {
347
+ /**
348
+ * Product deleted successfully
349
+ */
350
+ 204: void;
351
+ };
352
+ export type ProductDeleteResponse = ProductDeleteResponses[keyof ProductDeleteResponses];
353
+ export type ProductGetData = {
354
+ body?: never;
355
+ path: {
356
+ id: string;
357
+ };
358
+ query?: never;
359
+ url: "/product/{id}";
360
+ };
361
+ export type ProductGetErrors = {
362
+ /**
363
+ * Bad request
364
+ */
365
+ 400: BadRequestError;
366
+ /**
367
+ * Not found
368
+ */
369
+ 404: NotFoundError;
370
+ };
371
+ export type ProductGetError = ProductGetErrors[keyof ProductGetErrors];
372
+ export type ProductGetResponses = {
373
+ /**
374
+ * Product details
375
+ */
376
+ 200: {
377
+ id: string;
378
+ workspaceID: string;
379
+ timeCreated: unknown;
380
+ timeUpdated: unknown;
381
+ timeDeleted: unknown | null;
382
+ walletID: string;
383
+ payoutWalletID: string;
384
+ chainID: 1 | 8453;
385
+ token: unknown;
386
+ price: string;
387
+ paused: boolean;
388
+ name: string;
389
+ description: string | null;
390
+ };
391
+ };
392
+ export type ProductGetResponse = ProductGetResponses[keyof ProductGetResponses];
393
+ export type ProductUpdateData = {
394
+ body?: {
395
+ price?: string;
396
+ paused?: boolean;
397
+ };
398
+ path: {
399
+ id: string;
400
+ };
401
+ query?: never;
402
+ url: "/product/{id}";
403
+ };
404
+ export type ProductUpdateErrors = {
405
+ /**
406
+ * Bad request
407
+ */
408
+ 400: BadRequestError;
409
+ /**
410
+ * Not found
411
+ */
412
+ 404: NotFoundError;
413
+ };
414
+ export type ProductUpdateError = ProductUpdateErrors[keyof ProductUpdateErrors];
415
+ export type ProductUpdateResponses = {
416
+ /**
417
+ * Product updated successfully
418
+ */
419
+ 200: {
420
+ id: string;
421
+ workspaceID: string;
422
+ timeCreated: unknown;
423
+ timeUpdated: unknown;
424
+ timeDeleted: unknown | null;
425
+ walletID: string;
426
+ payoutWalletID: string;
427
+ chainID: 1 | 8453;
428
+ token: unknown;
429
+ price: string;
430
+ paused: boolean;
431
+ name: string;
432
+ description: string | null;
433
+ };
434
+ };
435
+ export type ProductUpdateResponse = ProductUpdateResponses[keyof ProductUpdateResponses];
260
436
  export type CheckoutSessionCreateData = {
261
437
  body?: never;
262
438
  path: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackup-fi/sdk",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "exports": {