@stigg/typescript 0.1.0-alpha.1 → 0.1.0-alpha.3

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 (97) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +31 -0
  3. package/core/pagination.d.mts +11 -5
  4. package/core/pagination.d.mts.map +1 -1
  5. package/core/pagination.d.ts +11 -5
  6. package/core/pagination.d.ts.map +1 -1
  7. package/core/pagination.js +9 -9
  8. package/core/pagination.js.map +1 -1
  9. package/core/pagination.mjs +9 -9
  10. package/core/pagination.mjs.map +1 -1
  11. package/package.json +1 -1
  12. package/resources/v1/coupons.d.mts +100 -86
  13. package/resources/v1/coupons.d.mts.map +1 -1
  14. package/resources/v1/coupons.d.ts +100 -86
  15. package/resources/v1/coupons.d.ts.map +1 -1
  16. package/resources/v1/coupons.js +8 -4
  17. package/resources/v1/coupons.js.map +1 -1
  18. package/resources/v1/coupons.mjs +8 -4
  19. package/resources/v1/coupons.mjs.map +1 -1
  20. package/resources/v1/customers/customers.d.mts +101 -96
  21. package/resources/v1/customers/customers.d.mts.map +1 -1
  22. package/resources/v1/customers/customers.d.ts +101 -96
  23. package/resources/v1/customers/customers.d.ts.map +1 -1
  24. package/resources/v1/customers/customers.js +11 -7
  25. package/resources/v1/customers/customers.js.map +1 -1
  26. package/resources/v1/customers/customers.mjs +11 -7
  27. package/resources/v1/customers/customers.mjs.map +1 -1
  28. package/resources/v1/customers/index.d.mts +2 -2
  29. package/resources/v1/customers/index.d.mts.map +1 -1
  30. package/resources/v1/customers/index.d.ts +2 -2
  31. package/resources/v1/customers/index.d.ts.map +1 -1
  32. package/resources/v1/customers/index.js.map +1 -1
  33. package/resources/v1/customers/index.mjs.map +1 -1
  34. package/resources/v1/customers/payment-method.d.mts +5 -2
  35. package/resources/v1/customers/payment-method.d.mts.map +1 -1
  36. package/resources/v1/customers/payment-method.d.ts +5 -2
  37. package/resources/v1/customers/payment-method.d.ts.map +1 -1
  38. package/resources/v1/customers/payment-method.js +2 -2
  39. package/resources/v1/customers/payment-method.mjs +2 -2
  40. package/resources/v1/customers/usage.d.mts +0 -94
  41. package/resources/v1/customers/usage.d.mts.map +1 -1
  42. package/resources/v1/customers/usage.d.ts +0 -94
  43. package/resources/v1/customers/usage.d.ts.map +1 -1
  44. package/resources/v1/customers/usage.js +0 -11
  45. package/resources/v1/customers/usage.js.map +1 -1
  46. package/resources/v1/customers/usage.mjs +0 -11
  47. package/resources/v1/customers/usage.mjs.map +1 -1
  48. package/resources/v1/index.d.mts +3 -3
  49. package/resources/v1/index.d.mts.map +1 -1
  50. package/resources/v1/index.d.ts +3 -3
  51. package/resources/v1/index.d.ts.map +1 -1
  52. package/resources/v1/index.js.map +1 -1
  53. package/resources/v1/index.mjs.map +1 -1
  54. package/resources/v1/subscriptions/future-update.d.mts +8 -2
  55. package/resources/v1/subscriptions/future-update.d.mts.map +1 -1
  56. package/resources/v1/subscriptions/future-update.d.ts +8 -2
  57. package/resources/v1/subscriptions/future-update.d.ts.map +1 -1
  58. package/resources/v1/subscriptions/future-update.js +2 -2
  59. package/resources/v1/subscriptions/future-update.mjs +2 -2
  60. package/resources/v1/subscriptions/index.d.mts +1 -1
  61. package/resources/v1/subscriptions/index.d.mts.map +1 -1
  62. package/resources/v1/subscriptions/index.d.ts +1 -1
  63. package/resources/v1/subscriptions/index.d.ts.map +1 -1
  64. package/resources/v1/subscriptions/index.js.map +1 -1
  65. package/resources/v1/subscriptions/index.mjs.map +1 -1
  66. package/resources/v1/subscriptions/subscriptions.d.mts +1092 -111
  67. package/resources/v1/subscriptions/subscriptions.d.mts.map +1 -1
  68. package/resources/v1/subscriptions/subscriptions.d.ts +1092 -111
  69. package/resources/v1/subscriptions/subscriptions.d.ts.map +1 -1
  70. package/resources/v1/subscriptions/subscriptions.js +12 -8
  71. package/resources/v1/subscriptions/subscriptions.js.map +1 -1
  72. package/resources/v1/subscriptions/subscriptions.mjs +12 -8
  73. package/resources/v1/subscriptions/subscriptions.mjs.map +1 -1
  74. package/resources/v1/v1.d.mts +32 -9
  75. package/resources/v1/v1.d.mts.map +1 -1
  76. package/resources/v1/v1.d.ts +32 -9
  77. package/resources/v1/v1.d.ts.map +1 -1
  78. package/resources/v1/v1.js +2 -2
  79. package/resources/v1/v1.js.map +1 -1
  80. package/resources/v1/v1.mjs +2 -2
  81. package/resources/v1/v1.mjs.map +1 -1
  82. package/src/core/pagination.ts +24 -18
  83. package/src/resources/v1/coupons.ts +223 -212
  84. package/src/resources/v1/customers/customers.ts +121 -120
  85. package/src/resources/v1/customers/index.ts +2 -1
  86. package/src/resources/v1/customers/payment-method.ts +5 -2
  87. package/src/resources/v1/customers/usage.ts +1 -128
  88. package/src/resources/v1/index.ts +3 -0
  89. package/src/resources/v1/subscriptions/future-update.ts +8 -2
  90. package/src/resources/v1/subscriptions/index.ts +1 -0
  91. package/src/resources/v1/subscriptions/subscriptions.ts +2201 -153
  92. package/src/resources/v1/v1.ts +32 -3
  93. package/src/version.ts +1 -1
  94. package/version.d.mts +1 -1
  95. package/version.d.ts +1 -1
  96. package/version.js +1 -1
  97. package/version.mjs +1 -1
@@ -7,6 +7,7 @@ import {
7
7
  CouponCreateResponse,
8
8
  CouponListParams,
9
9
  CouponListResponse,
10
+ CouponListResponsesMyCursorIDPage,
10
11
  CouponRetrieveResponse,
11
12
  Coupons,
12
13
  } from './coupons';
@@ -15,6 +16,7 @@ import {
15
16
  CustomerCreateParams,
16
17
  CustomerListParams,
17
18
  CustomerListResponse,
19
+ CustomerListResponsesMyCursorIDPage,
18
20
  CustomerResponse,
19
21
  CustomerUpdateParams,
20
22
  Customers,
@@ -27,6 +29,7 @@ import {
27
29
  SubscriptionDelegateResponse,
28
30
  SubscriptionListParams,
29
31
  SubscriptionListResponse,
32
+ SubscriptionListResponsesMyCursorIDPage,
30
33
  SubscriptionMigrateParams,
31
34
  SubscriptionMigrateResponse,
32
35
  SubscriptionPreviewParams,
@@ -45,29 +48,46 @@ export class V1 extends APIResource {
45
48
  coupons: CouponsAPI.Coupons = new CouponsAPI.Coupons(this._client);
46
49
 
47
50
  /**
48
- * Create events
51
+ * Report usage events
49
52
  */
50
53
  createEvent(body: V1CreateEventParams, options?: RequestOptions): APIPromise<V1CreateEventResponse> {
51
54
  return this._client.post('/api/v1/events', { body, ...options });
52
55
  }
53
56
 
54
57
  /**
55
- * Create a new Usage
58
+ * Report usage measurements
56
59
  */
57
60
  createUsage(body: V1CreateUsageParams, options?: RequestOptions): APIPromise<V1CreateUsageResponse> {
58
61
  return this._client.post('/api/v1/usage', { body, ...options });
59
62
  }
60
63
  }
61
64
 
65
+ /**
66
+ * Response object
67
+ */
62
68
  export interface V1CreateEventResponse {
69
+ /**
70
+ * Empty success response confirming that events were successfully ingested and
71
+ * queued for processing by Stigg's metering system.
72
+ */
63
73
  data: unknown;
64
74
  }
65
75
 
76
+ /**
77
+ * Response containing reported usage measurements with current usage values,
78
+ * period information, and reset dates for each measurement.
79
+ */
66
80
  export interface V1CreateUsageResponse {
81
+ /**
82
+ * Array of usage measurements with current values and period info
83
+ */
67
84
  data: Array<V1CreateUsageResponse.Data>;
68
85
  }
69
86
 
70
87
  export namespace V1CreateUsageResponse {
88
+ /**
89
+ * Recorded usage with period info
90
+ */
71
91
  export interface Data {
72
92
  /**
73
93
  * Unique identifier for the entity
@@ -136,6 +156,9 @@ export interface V1CreateEventParams {
136
156
  }
137
157
 
138
158
  export namespace V1CreateEventParams {
159
+ /**
160
+ * Raw usage event
161
+ */
139
162
  export interface Event {
140
163
  /**
141
164
  * Customer id
@@ -177,6 +200,9 @@ export interface V1CreateUsageParams {
177
200
  }
178
201
 
179
202
  export namespace V1CreateUsageParams {
203
+ /**
204
+ * Single usage measurement
205
+ */
180
206
  export interface Usage {
181
207
  /**
182
208
  * Customer id
@@ -201,7 +227,7 @@ export namespace V1CreateUsageParams {
201
227
  /**
202
228
  * Additional dimensions for the usage report
203
229
  */
204
- dimensions?: { [key: string]: string };
230
+ dimensions?: { [key: string]: string | number | boolean };
205
231
 
206
232
  /**
207
233
  * Resource id
@@ -231,6 +257,7 @@ export declare namespace V1 {
231
257
  Customers as Customers,
232
258
  type CustomerResponse as CustomerResponse,
233
259
  type CustomerListResponse as CustomerListResponse,
260
+ type CustomerListResponsesMyCursorIDPage as CustomerListResponsesMyCursorIDPage,
234
261
  type CustomerCreateParams as CustomerCreateParams,
235
262
  type CustomerUpdateParams as CustomerUpdateParams,
236
263
  type CustomerListParams as CustomerListParams,
@@ -245,6 +272,7 @@ export declare namespace V1 {
245
272
  type SubscriptionMigrateResponse as SubscriptionMigrateResponse,
246
273
  type SubscriptionPreviewResponse as SubscriptionPreviewResponse,
247
274
  type SubscriptionTransferResponse as SubscriptionTransferResponse,
275
+ type SubscriptionListResponsesMyCursorIDPage as SubscriptionListResponsesMyCursorIDPage,
248
276
  type SubscriptionCreateParams as SubscriptionCreateParams,
249
277
  type SubscriptionListParams as SubscriptionListParams,
250
278
  type SubscriptionDelegateParams as SubscriptionDelegateParams,
@@ -258,6 +286,7 @@ export declare namespace V1 {
258
286
  type CouponCreateResponse as CouponCreateResponse,
259
287
  type CouponRetrieveResponse as CouponRetrieveResponse,
260
288
  type CouponListResponse as CouponListResponse,
289
+ type CouponListResponsesMyCursorIDPage as CouponListResponsesMyCursorIDPage,
261
290
  type CouponCreateParams as CouponCreateParams,
262
291
  type CouponListParams as CouponListParams,
263
292
  };
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.1.0-alpha.1'; // x-release-please-version
1
+ export const VERSION = '0.1.0-alpha.3'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.1.0-alpha.1";
1
+ export declare const VERSION = "0.1.0-alpha.3";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.1.0-alpha.1";
1
+ export declare const VERSION = "0.1.0-alpha.3";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.1.0-alpha.1'; // x-release-please-version
4
+ exports.VERSION = '0.1.0-alpha.3'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.1.0-alpha.1'; // x-release-please-version
1
+ export const VERSION = '0.1.0-alpha.3'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map