@dazl/internal-api-client 1.0.0

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.
Files changed (82) hide show
  1. package/README.md +77 -0
  2. package/dist/client/client.gen.d.ts +3 -0
  3. package/dist/client/client.gen.d.ts.map +1 -0
  4. package/dist/client/client.gen.js +229 -0
  5. package/dist/client/client.gen.js.map +1 -0
  6. package/dist/client/index.d.ts +9 -0
  7. package/dist/client/index.d.ts.map +1 -0
  8. package/dist/client/index.js +7 -0
  9. package/dist/client/index.js.map +1 -0
  10. package/dist/client/types.gen.d.ts +118 -0
  11. package/dist/client/types.gen.d.ts.map +1 -0
  12. package/dist/client/types.gen.js +3 -0
  13. package/dist/client/types.gen.js.map +1 -0
  14. package/dist/client/utils.gen.d.ts +34 -0
  15. package/dist/client/utils.gen.d.ts.map +1 -0
  16. package/dist/client/utils.gen.js +232 -0
  17. package/dist/client/utils.gen.js.map +1 -0
  18. package/dist/client.gen.d.ts +13 -0
  19. package/dist/client.gen.d.ts.map +1 -0
  20. package/dist/client.gen.js +4 -0
  21. package/dist/client.gen.js.map +1 -0
  22. package/dist/core/auth.gen.d.ts +19 -0
  23. package/dist/core/auth.gen.d.ts.map +1 -0
  24. package/dist/core/auth.gen.js +15 -0
  25. package/dist/core/auth.gen.js.map +1 -0
  26. package/dist/core/bodySerializer.gen.d.ts +26 -0
  27. package/dist/core/bodySerializer.gen.d.ts.map +1 -0
  28. package/dist/core/bodySerializer.gen.js +58 -0
  29. package/dist/core/bodySerializer.gen.js.map +1 -0
  30. package/dist/core/params.gen.d.ts +44 -0
  31. package/dist/core/params.gen.d.ts.map +1 -0
  32. package/dist/core/params.gen.js +101 -0
  33. package/dist/core/params.gen.js.map +1 -0
  34. package/dist/core/pathSerializer.gen.d.ts +34 -0
  35. package/dist/core/pathSerializer.gen.d.ts.map +1 -0
  36. package/dist/core/pathSerializer.gen.js +115 -0
  37. package/dist/core/pathSerializer.gen.js.map +1 -0
  38. package/dist/core/queryKeySerializer.gen.d.ts +19 -0
  39. package/dist/core/queryKeySerializer.gen.d.ts.map +1 -0
  40. package/dist/core/queryKeySerializer.gen.js +100 -0
  41. package/dist/core/queryKeySerializer.gen.js.map +1 -0
  42. package/dist/core/serverSentEvents.gen.d.ts +72 -0
  43. package/dist/core/serverSentEvents.gen.d.ts.map +1 -0
  44. package/dist/core/serverSentEvents.gen.js +136 -0
  45. package/dist/core/serverSentEvents.gen.js.map +1 -0
  46. package/dist/core/types.gen.d.ts +79 -0
  47. package/dist/core/types.gen.d.ts.map +1 -0
  48. package/dist/core/types.gen.js +3 -0
  49. package/dist/core/types.gen.js.map +1 -0
  50. package/dist/core/utils.gen.d.ts +20 -0
  51. package/dist/core/utils.gen.d.ts.map +1 -0
  52. package/dist/core/utils.gen.js +88 -0
  53. package/dist/core/utils.gen.js.map +1 -0
  54. package/dist/index.d.ts +4 -0
  55. package/dist/index.d.ts.map +1 -0
  56. package/dist/index.js +4 -0
  57. package/dist/index.js.map +1 -0
  58. package/dist/sdk.gen.d.ts +28 -0
  59. package/dist/sdk.gen.d.ts.map +1 -0
  60. package/dist/sdk.gen.js +77 -0
  61. package/dist/sdk.gen.js.map +1 -0
  62. package/dist/types.gen.d.ts +458 -0
  63. package/dist/types.gen.d.ts.map +1 -0
  64. package/dist/types.gen.js +3 -0
  65. package/dist/types.gen.js.map +1 -0
  66. package/package.json +36 -0
  67. package/src/client/client.gen.ts +301 -0
  68. package/src/client/index.ts +25 -0
  69. package/src/client/types.gen.ts +241 -0
  70. package/src/client/utils.gen.ts +332 -0
  71. package/src/client.gen.ts +16 -0
  72. package/src/core/auth.gen.ts +42 -0
  73. package/src/core/bodySerializer.gen.ts +100 -0
  74. package/src/core/params.gen.ts +176 -0
  75. package/src/core/pathSerializer.gen.ts +181 -0
  76. package/src/core/queryKeySerializer.gen.ts +136 -0
  77. package/src/core/serverSentEvents.gen.ts +264 -0
  78. package/src/core/types.gen.ts +118 -0
  79. package/src/core/utils.gen.ts +143 -0
  80. package/src/index.ts +5 -0
  81. package/src/sdk.gen.ts +103 -0
  82. package/src/types.gen.ts +510 -0
@@ -0,0 +1,510 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+
3
+ export type ClientOptions = {
4
+ baseUrl: `${string}://${string}` | (string & {});
5
+ };
6
+
7
+ export type BillingPrice = {
8
+ credits: number;
9
+ priceCents: number;
10
+ priceId: string;
11
+ productId: string;
12
+ lookup_key: string | null;
13
+ isDefaultFree: boolean;
14
+ };
15
+
16
+ export type StripeProduct = {
17
+ id: string;
18
+ name: string;
19
+ description: string | null;
20
+ active: boolean;
21
+ created: number;
22
+ updated: number;
23
+ images: Array<string>;
24
+ livemode: boolean;
25
+ default_price?: string | null;
26
+ marketing_features: Array<{
27
+ name?: string;
28
+ }>;
29
+ metadata: {
30
+ [key: string]: string;
31
+ };
32
+ object: 'product';
33
+ package_dimensions: null;
34
+ shippable: null;
35
+ tax_code: null;
36
+ type: 'service';
37
+ url: string | null;
38
+ };
39
+
40
+ export type ScheduledUpdate = {
41
+ type: 'downgrade';
42
+ scheduleId: string;
43
+ targetPriceId: string;
44
+ updateTime: number;
45
+ } | {
46
+ type: 'cancel';
47
+ updateTime: number;
48
+ };
49
+
50
+ export type GetBalanceByDazlIdData = {
51
+ body?: never;
52
+ path: {
53
+ dazlId: string;
54
+ };
55
+ query?: never;
56
+ url: '/billing/balance/{dazlId}';
57
+ };
58
+
59
+ export type GetBalanceByDazlIdErrors = {
60
+ /**
61
+ * Bad request - Invalid parameters or malformed JSON
62
+ */
63
+ 400: {
64
+ message: string;
65
+ issues: string;
66
+ };
67
+ /**
68
+ * Unauthorized
69
+ */
70
+ 401: {
71
+ message: string;
72
+ };
73
+ /**
74
+ * Internal server error
75
+ */
76
+ 500: {
77
+ message: string;
78
+ };
79
+ };
80
+
81
+ export type GetBalanceByDazlIdError = GetBalanceByDazlIdErrors[keyof GetBalanceByDazlIdErrors];
82
+
83
+ export type GetBalanceByDazlIdResponses = {
84
+ /**
85
+ * Returns user credit balance
86
+ */
87
+ 200: {
88
+ balance: number;
89
+ productId?: string;
90
+ priceId?: string;
91
+ isSubscriptionFree?: boolean;
92
+ };
93
+ };
94
+
95
+ export type GetBalanceByDazlIdResponse = GetBalanceByDazlIdResponses[keyof GetBalanceByDazlIdResponses];
96
+
97
+ export type GetHasSufficientCreditsByDazlIdData = {
98
+ body?: never;
99
+ path: {
100
+ dazlId: string;
101
+ };
102
+ query?: never;
103
+ url: '/billing/has-sufficient-credits/{dazlId}';
104
+ };
105
+
106
+ export type GetHasSufficientCreditsByDazlIdErrors = {
107
+ /**
108
+ * Bad request - Invalid parameters or malformed JSON
109
+ */
110
+ 400: {
111
+ message: string;
112
+ issues: string;
113
+ };
114
+ /**
115
+ * Unauthorized
116
+ */
117
+ 401: {
118
+ message: string;
119
+ };
120
+ /**
121
+ * Internal server error
122
+ */
123
+ 500: {
124
+ message: string;
125
+ };
126
+ };
127
+
128
+ export type GetHasSufficientCreditsByDazlIdError = GetHasSufficientCreditsByDazlIdErrors[keyof GetHasSufficientCreditsByDazlIdErrors];
129
+
130
+ export type GetHasSufficientCreditsByDazlIdResponses = {
131
+ /**
132
+ * Returns whether user has sufficient credits
133
+ */
134
+ 200: {
135
+ hasSufficientCredits: boolean;
136
+ };
137
+ };
138
+
139
+ export type GetHasSufficientCreditsByDazlIdResponse = GetHasSufficientCreditsByDazlIdResponses[keyof GetHasSufficientCreditsByDazlIdResponses];
140
+
141
+ export type GetAllProductsData = {
142
+ body?: never;
143
+ path?: never;
144
+ query?: never;
145
+ url: '/billing/prices';
146
+ };
147
+
148
+ export type GetAllProductsErrors = {
149
+ /**
150
+ * Bad request - Invalid parameters or malformed JSON
151
+ */
152
+ 400: {
153
+ message: string;
154
+ issues: string;
155
+ };
156
+ /**
157
+ * Unauthorized
158
+ */
159
+ 401: {
160
+ message: string;
161
+ };
162
+ /**
163
+ * Internal server error
164
+ */
165
+ 500: {
166
+ message: string;
167
+ };
168
+ };
169
+
170
+ export type GetAllProductsError = GetAllProductsErrors[keyof GetAllProductsErrors];
171
+
172
+ export type GetAllProductsResponses = {
173
+ /**
174
+ * Returns all available products and prices
175
+ */
176
+ 200: {
177
+ [key: string]: {
178
+ prices: Array<BillingPrice>;
179
+ product: StripeProduct;
180
+ isDefaultFree?: boolean;
181
+ };
182
+ };
183
+ };
184
+
185
+ export type GetAllProductsResponse = GetAllProductsResponses[keyof GetAllProductsResponses];
186
+
187
+ export type GetPriceByPriceIdData = {
188
+ body?: never;
189
+ path: {
190
+ priceId: string;
191
+ };
192
+ query?: never;
193
+ url: '/billing/price/{priceId}';
194
+ };
195
+
196
+ export type GetPriceByPriceIdErrors = {
197
+ /**
198
+ * Bad request - Invalid parameters or malformed JSON
199
+ */
200
+ 400: {
201
+ message: string;
202
+ issues: string;
203
+ };
204
+ /**
205
+ * Unauthorized
206
+ */
207
+ 401: {
208
+ message: string;
209
+ };
210
+ /**
211
+ * Internal server error
212
+ */
213
+ 500: {
214
+ message: string;
215
+ };
216
+ };
217
+
218
+ export type GetPriceByPriceIdError = GetPriceByPriceIdErrors[keyof GetPriceByPriceIdErrors];
219
+
220
+ export type GetPriceByPriceIdResponses = {
221
+ /**
222
+ * Returns price details
223
+ */
224
+ 200: {
225
+ credits: number;
226
+ priceCents: number;
227
+ priceId: string;
228
+ productId: string;
229
+ lookup_key: string | null;
230
+ isDefaultFree: boolean;
231
+ };
232
+ };
233
+
234
+ export type GetPriceByPriceIdResponse = GetPriceByPriceIdResponses[keyof GetPriceByPriceIdResponses];
235
+
236
+ export type GetMaxCreditsForDefaultFreeData = {
237
+ body?: never;
238
+ path?: never;
239
+ query?: never;
240
+ url: '/billing/max-credits-for-default-free';
241
+ };
242
+
243
+ export type GetMaxCreditsForDefaultFreeResponses = {
244
+ /**
245
+ * Returns maximum credits for free tier
246
+ */
247
+ 200: {
248
+ maxCreditsForDefaultFree: number;
249
+ };
250
+ };
251
+
252
+ export type GetMaxCreditsForDefaultFreeResponse = GetMaxCreditsForDefaultFreeResponses[keyof GetMaxCreditsForDefaultFreeResponses];
253
+
254
+ export type GetCustomerInfoByDazlIdData = {
255
+ body?: never;
256
+ path: {
257
+ dazlId: string;
258
+ };
259
+ query?: never;
260
+ url: '/billing/customer-info/{dazlId}';
261
+ };
262
+
263
+ export type GetCustomerInfoByDazlIdErrors = {
264
+ /**
265
+ * Bad request - Invalid parameters or malformed JSON
266
+ */
267
+ 400: {
268
+ message: string;
269
+ issues: string;
270
+ };
271
+ /**
272
+ * Unauthorized
273
+ */
274
+ 401: {
275
+ message: string;
276
+ };
277
+ /**
278
+ * Internal server error
279
+ */
280
+ 500: {
281
+ message: string;
282
+ };
283
+ };
284
+
285
+ export type GetCustomerInfoByDazlIdError = GetCustomerInfoByDazlIdErrors[keyof GetCustomerInfoByDazlIdErrors];
286
+
287
+ export type GetCustomerInfoByDazlIdResponses = {
288
+ /**
289
+ * Returns customer subscription information
290
+ */
291
+ 200: {
292
+ productId: string;
293
+ credits: number;
294
+ isDefaultFree: boolean;
295
+ priceId: string;
296
+ subscriptionItemId: string;
297
+ subscriptionId: string;
298
+ currentCycle: {
299
+ start: number;
300
+ end: number;
301
+ };
302
+ scheduledUpdate?: ScheduledUpdate;
303
+ defaultFreePriceId?: string;
304
+ customerId: string;
305
+ hasEarlyAccessCoupon: boolean;
306
+ };
307
+ };
308
+
309
+ export type GetCustomerInfoByDazlIdResponse = GetCustomerInfoByDazlIdResponses[keyof GetCustomerInfoByDazlIdResponses];
310
+
311
+ export type UpdateUserSubscriptionData = {
312
+ body: {
313
+ dazlId: string;
314
+ targetPriceId: string;
315
+ successUrl: string;
316
+ cancelUrl: string;
317
+ };
318
+ path?: never;
319
+ query?: never;
320
+ url: '/billing/update-subscription';
321
+ };
322
+
323
+ export type UpdateUserSubscriptionErrors = {
324
+ /**
325
+ * Bad request - Invalid parameters or malformed JSON
326
+ */
327
+ 400: {
328
+ message: string;
329
+ issues: string;
330
+ };
331
+ /**
332
+ * Unauthorized
333
+ */
334
+ 401: {
335
+ message: string;
336
+ };
337
+ /**
338
+ * Internal server error
339
+ */
340
+ 500: {
341
+ message: string;
342
+ };
343
+ };
344
+
345
+ export type UpdateUserSubscriptionError = UpdateUserSubscriptionErrors[keyof UpdateUserSubscriptionErrors];
346
+
347
+ export type UpdateUserSubscriptionResponses = {
348
+ /**
349
+ * Returns updated subscription details
350
+ */
351
+ 200: {
352
+ type: 'checkout';
353
+ session: string;
354
+ } | {
355
+ type: 'update';
356
+ newPrice: {
357
+ credits: number;
358
+ priceCents: number;
359
+ priceId: string;
360
+ productId: string;
361
+ lookup_key: string | null;
362
+ isDefaultFree: boolean;
363
+ };
364
+ } | {
365
+ type: 'cancel';
366
+ };
367
+ };
368
+
369
+ export type UpdateUserSubscriptionResponse = UpdateUserSubscriptionResponses[keyof UpdateUserSubscriptionResponses];
370
+
371
+ export type CancelScheduledUpdateByDazlIdData = {
372
+ body?: never;
373
+ path: {
374
+ dazlId: string;
375
+ };
376
+ query?: never;
377
+ url: '/billing/cancel-scheduled-update/{dazlId}';
378
+ };
379
+
380
+ export type CancelScheduledUpdateByDazlIdErrors = {
381
+ /**
382
+ * Bad request - Invalid parameters or malformed JSON
383
+ */
384
+ 400: {
385
+ message: string;
386
+ issues: string;
387
+ };
388
+ /**
389
+ * Unauthorized
390
+ */
391
+ 401: {
392
+ message: string;
393
+ };
394
+ /**
395
+ * Internal server error
396
+ */
397
+ 500: {
398
+ message: string;
399
+ };
400
+ };
401
+
402
+ export type CancelScheduledUpdateByDazlIdError = CancelScheduledUpdateByDazlIdErrors[keyof CancelScheduledUpdateByDazlIdErrors];
403
+
404
+ export type CancelScheduledUpdateByDazlIdResponses = {
405
+ /**
406
+ * Returns cancellation status
407
+ */
408
+ 200: {
409
+ success: boolean;
410
+ };
411
+ };
412
+
413
+ export type CancelScheduledUpdateByDazlIdResponse = CancelScheduledUpdateByDazlIdResponses[keyof CancelScheduledUpdateByDazlIdResponses];
414
+
415
+ export type CreateCustomerPortalSessionData = {
416
+ body: {
417
+ dazlId: string;
418
+ returnUrl?: string;
419
+ };
420
+ path?: never;
421
+ query?: never;
422
+ url: '/billing/create-portal-session';
423
+ };
424
+
425
+ export type CreateCustomerPortalSessionErrors = {
426
+ /**
427
+ * Bad request - Invalid parameters or malformed JSON
428
+ */
429
+ 400: {
430
+ message: string;
431
+ issues: string;
432
+ };
433
+ /**
434
+ * Unauthorized
435
+ */
436
+ 401: {
437
+ message: string;
438
+ };
439
+ /**
440
+ * Internal server error
441
+ */
442
+ 500: {
443
+ message: string;
444
+ };
445
+ };
446
+
447
+ export type CreateCustomerPortalSessionError = CreateCustomerPortalSessionErrors[keyof CreateCustomerPortalSessionErrors];
448
+
449
+ export type CreateCustomerPortalSessionResponses = {
450
+ /**
451
+ * Returns billing portal session URL
452
+ */
453
+ 200: {
454
+ url: string;
455
+ };
456
+ };
457
+
458
+ export type CreateCustomerPortalSessionResponse = CreateCustomerPortalSessionResponses[keyof CreateCustomerPortalSessionResponses];
459
+
460
+ export type CreateCustomerWithDefaultSubscriptionData = {
461
+ body: {
462
+ email: string;
463
+ name?: string;
464
+ customerOptions?: {
465
+ idempotencyKey: string;
466
+ };
467
+ subscriptionOptions?: {
468
+ idempotencyKey: string;
469
+ };
470
+ };
471
+ path?: never;
472
+ query?: never;
473
+ url: '/billing/create-customer-with-default-subscription';
474
+ };
475
+
476
+ export type CreateCustomerWithDefaultSubscriptionErrors = {
477
+ /**
478
+ * Bad request - Invalid parameters or malformed JSON
479
+ */
480
+ 400: {
481
+ message: string;
482
+ issues: string;
483
+ };
484
+ /**
485
+ * Unauthorized
486
+ */
487
+ 401: {
488
+ message: string;
489
+ };
490
+ /**
491
+ * Internal server error
492
+ */
493
+ 500: {
494
+ message: string;
495
+ };
496
+ };
497
+
498
+ export type CreateCustomerWithDefaultSubscriptionError = CreateCustomerWithDefaultSubscriptionErrors[keyof CreateCustomerWithDefaultSubscriptionErrors];
499
+
500
+ export type CreateCustomerWithDefaultSubscriptionResponses = {
501
+ /**
502
+ * Returns created customer ID
503
+ */
504
+ 200: {
505
+ customerId: string;
506
+ noStripe: boolean;
507
+ };
508
+ };
509
+
510
+ export type CreateCustomerWithDefaultSubscriptionResponse = CreateCustomerWithDefaultSubscriptionResponses[keyof CreateCustomerWithDefaultSubscriptionResponses];