@openmeter/sdk 1.0.0-beta.99 → 1.0.0-beta-9958c9245841

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 (203) hide show
  1. package/Makefile +43 -0
  2. package/README.md +232 -137
  3. package/biome.json +67 -0
  4. package/dist/cjs/index.cjs +15 -21
  5. package/dist/cjs/index.d.cts +1 -15
  6. package/dist/cjs/index.js.map +1 -1
  7. package/dist/cjs/src/client/addons.cjs +105 -0
  8. package/dist/cjs/src/client/addons.d.cts +152 -0
  9. package/dist/cjs/src/client/addons.js.map +1 -0
  10. package/dist/cjs/src/client/apps.cjs +247 -0
  11. package/dist/cjs/src/client/apps.d.cts +327 -0
  12. package/dist/cjs/src/client/apps.js.map +1 -0
  13. package/dist/cjs/src/client/billing.cjs +375 -0
  14. package/dist/cjs/src/client/billing.d.cts +563 -0
  15. package/dist/cjs/src/client/billing.js.map +1 -0
  16. package/dist/cjs/src/client/common.cjs +47 -0
  17. package/dist/cjs/src/client/common.d.cts +30 -0
  18. package/dist/cjs/src/client/common.js.map +1 -0
  19. package/dist/cjs/src/client/customers.cjs +469 -0
  20. package/dist/cjs/src/client/customers.d.cts +617 -0
  21. package/dist/cjs/src/client/customers.js.map +1 -0
  22. package/dist/cjs/src/client/debug.cjs +27 -0
  23. package/dist/cjs/src/client/debug.d.cts +17 -0
  24. package/dist/cjs/src/client/debug.js.map +1 -0
  25. package/dist/cjs/src/client/entitlements.cjs +372 -0
  26. package/dist/cjs/src/client/entitlements.d.cts +670 -0
  27. package/dist/cjs/src/client/entitlements.js.map +1 -0
  28. package/dist/cjs/src/client/events.cjs +113 -0
  29. package/dist/cjs/src/client/events.d.cts +48 -0
  30. package/dist/cjs/src/client/events.js.map +1 -0
  31. package/dist/cjs/src/client/features.cjs +78 -0
  32. package/dist/cjs/src/client/features.d.cts +87 -0
  33. package/dist/cjs/src/client/features.js.map +1 -0
  34. package/dist/cjs/src/client/index.cjs +122 -0
  35. package/dist/cjs/src/client/index.d.cts +54 -0
  36. package/dist/cjs/src/client/index.js.map +1 -0
  37. package/dist/cjs/src/client/info.cjs +42 -0
  38. package/dist/cjs/src/client/info.d.cts +34 -0
  39. package/dist/cjs/src/client/info.js.map +1 -0
  40. package/dist/cjs/src/client/meters.cjs +160 -0
  41. package/dist/cjs/src/client/meters.d.cts +151 -0
  42. package/dist/cjs/src/client/meters.js.map +1 -0
  43. package/dist/cjs/src/client/notifications.cjs +269 -0
  44. package/dist/cjs/src/client/notifications.d.cts +412 -0
  45. package/dist/cjs/src/client/notifications.js.map +1 -0
  46. package/dist/cjs/src/client/plans.cjs +204 -0
  47. package/dist/cjs/src/client/plans.d.cts +247 -0
  48. package/dist/cjs/src/client/plans.js.map +1 -0
  49. package/dist/cjs/src/client/portal.cjs +55 -0
  50. package/dist/cjs/src/client/portal.d.cts +48 -0
  51. package/dist/cjs/src/client/portal.js.map +1 -0
  52. package/dist/cjs/src/client/schemas.cjs +3 -0
  53. package/dist/cjs/src/client/schemas.d.cts +27081 -0
  54. package/dist/cjs/src/client/schemas.js.map +1 -0
  55. package/dist/cjs/src/client/subjects.cjs +76 -0
  56. package/dist/cjs/src/client/subjects.d.cts +79 -0
  57. package/dist/cjs/src/client/subjects.js.map +1 -0
  58. package/dist/cjs/src/client/subscription-addons.cjs +70 -0
  59. package/dist/cjs/src/client/subscription-addons.d.cts +123 -0
  60. package/dist/cjs/src/client/subscription-addons.js.map +1 -0
  61. package/dist/cjs/src/client/subscriptions.cjs +132 -0
  62. package/dist/cjs/src/client/subscriptions.d.cts +175 -0
  63. package/dist/cjs/src/client/subscriptions.js.map +1 -0
  64. package/dist/cjs/src/client/utils.cjs +67 -0
  65. package/dist/cjs/src/client/utils.d.cts +12 -0
  66. package/dist/cjs/src/client/utils.js.map +1 -0
  67. package/dist/cjs/src/portal/index.cjs +89 -0
  68. package/dist/cjs/src/portal/index.d.cts +43 -0
  69. package/dist/cjs/src/portal/index.js.map +1 -0
  70. package/dist/cjs/src/react/context.cjs +35 -0
  71. package/dist/cjs/src/react/context.d.cts +9 -0
  72. package/dist/cjs/src/react/context.js.map +1 -0
  73. package/dist/cjs/src/zod/index.cjs +13102 -0
  74. package/dist/cjs/src/zod/index.d.cts +20044 -0
  75. package/dist/cjs/src/zod/index.js.map +1 -0
  76. package/dist/cjs/tsconfig.0781fa96.tsbuildinfo +1 -0
  77. package/dist/cjs/tsconfig.6c95ff08.tsbuildinfo +1 -0
  78. package/dist/index.d.ts +1 -15
  79. package/dist/index.js +1 -17
  80. package/dist/index.js.map +1 -1
  81. package/dist/src/client/addons.d.ts +152 -0
  82. package/dist/src/client/addons.js +101 -0
  83. package/dist/src/client/addons.js.map +1 -0
  84. package/dist/src/client/apps.d.ts +327 -0
  85. package/dist/src/client/apps.js +240 -0
  86. package/dist/src/client/apps.js.map +1 -0
  87. package/dist/src/client/billing.d.ts +563 -0
  88. package/dist/src/client/billing.js +368 -0
  89. package/dist/src/client/billing.js.map +1 -0
  90. package/dist/src/client/common.d.ts +30 -0
  91. package/dist/src/client/common.js +42 -0
  92. package/dist/src/client/common.js.map +1 -0
  93. package/dist/src/client/customers.d.ts +617 -0
  94. package/dist/src/client/customers.js +461 -0
  95. package/dist/src/client/customers.js.map +1 -0
  96. package/dist/src/client/debug.d.ts +17 -0
  97. package/dist/src/client/debug.js +23 -0
  98. package/dist/src/client/debug.js.map +1 -0
  99. package/dist/src/client/entitlements.d.ts +670 -0
  100. package/dist/src/client/entitlements.js +365 -0
  101. package/dist/src/client/entitlements.js.map +1 -0
  102. package/dist/src/client/events.d.ts +48 -0
  103. package/dist/src/client/events.js +108 -0
  104. package/dist/src/client/events.js.map +1 -0
  105. package/dist/src/client/features.d.ts +87 -0
  106. package/dist/src/client/features.js +74 -0
  107. package/dist/src/client/features.js.map +1 -0
  108. package/dist/src/client/index.d.ts +54 -0
  109. package/dist/src/client/index.js +82 -0
  110. package/dist/src/client/index.js.map +1 -0
  111. package/dist/src/client/info.d.ts +34 -0
  112. package/dist/src/client/info.js +38 -0
  113. package/dist/src/client/info.js.map +1 -0
  114. package/dist/src/client/meters.d.ts +151 -0
  115. package/dist/src/client/meters.js +156 -0
  116. package/dist/src/client/meters.js.map +1 -0
  117. package/dist/src/client/notifications.d.ts +412 -0
  118. package/dist/src/client/notifications.js +262 -0
  119. package/dist/src/client/notifications.js.map +1 -0
  120. package/dist/src/client/plans.d.ts +247 -0
  121. package/dist/src/client/plans.js +199 -0
  122. package/dist/src/client/plans.js.map +1 -0
  123. package/dist/src/client/portal.d.ts +48 -0
  124. package/dist/src/client/portal.js +51 -0
  125. package/dist/src/client/portal.js.map +1 -0
  126. package/dist/src/client/schemas.d.ts +27081 -0
  127. package/dist/src/client/schemas.js +2 -0
  128. package/dist/src/client/schemas.js.map +1 -0
  129. package/dist/src/client/subjects.d.ts +79 -0
  130. package/dist/src/client/subjects.js +72 -0
  131. package/dist/src/client/subjects.js.map +1 -0
  132. package/dist/src/client/subscription-addons.d.ts +123 -0
  133. package/dist/src/client/subscription-addons.js +66 -0
  134. package/dist/src/client/subscription-addons.js.map +1 -0
  135. package/dist/src/client/subscriptions.d.ts +175 -0
  136. package/dist/src/client/subscriptions.js +128 -0
  137. package/dist/src/client/subscriptions.js.map +1 -0
  138. package/dist/src/client/utils.d.ts +12 -0
  139. package/dist/src/client/utils.js +61 -0
  140. package/dist/src/client/utils.js.map +1 -0
  141. package/dist/src/portal/index.d.ts +43 -0
  142. package/dist/src/portal/index.js +52 -0
  143. package/dist/src/portal/index.js.map +1 -0
  144. package/dist/src/react/context.d.ts +9 -0
  145. package/dist/src/react/context.js +16 -0
  146. package/dist/src/react/context.js.map +1 -0
  147. package/dist/src/zod/index.d.ts +20044 -0
  148. package/dist/src/zod/index.js +13071 -0
  149. package/dist/src/zod/index.js.map +1 -0
  150. package/dist/tsconfig.tsbuildinfo +1 -1
  151. package/orval.config.ts +38 -0
  152. package/package.json +62 -32
  153. package/patches/openapi-typescript.patch +6194 -0
  154. package/dist/cjs/clients/client.cjs +0 -117
  155. package/dist/cjs/clients/client.d.cts +0 -40
  156. package/dist/cjs/clients/client.js.map +0 -1
  157. package/dist/cjs/clients/event.cjs +0 -71
  158. package/dist/cjs/clients/event.d.cts +0 -79
  159. package/dist/cjs/clients/event.js.map +0 -1
  160. package/dist/cjs/clients/meter.cjs +0 -69
  161. package/dist/cjs/clients/meter.d.cts +0 -75
  162. package/dist/cjs/clients/meter.js.map +0 -1
  163. package/dist/cjs/clients/portal.cjs +0 -41
  164. package/dist/cjs/clients/portal.d.cts +0 -22
  165. package/dist/cjs/clients/portal.js.map +0 -1
  166. package/dist/cjs/clients/subject.cjs +0 -60
  167. package/dist/cjs/clients/subject.d.cts +0 -27
  168. package/dist/cjs/clients/subject.js.map +0 -1
  169. package/dist/cjs/schemas/openapi.cjs +0 -7
  170. package/dist/cjs/schemas/openapi.d.cts +0 -2078
  171. package/dist/cjs/schemas/openapi.js.map +0 -1
  172. package/dist/cjs/test/agent.cjs +0 -266
  173. package/dist/cjs/test/agent.d.cts +0 -2
  174. package/dist/cjs/test/agent.js.map +0 -1
  175. package/dist/cjs/test/mocks.cjs +0 -44
  176. package/dist/cjs/test/mocks.d.cts +0 -14
  177. package/dist/cjs/test/mocks.js.map +0 -1
  178. package/dist/cjs/tsconfig.8be50ffd.tsbuildinfo +0 -1
  179. package/dist/cjs/tsconfig.9c9b19d3.tsbuildinfo +0 -1
  180. package/dist/clients/client.d.ts +0 -40
  181. package/dist/clients/client.js +0 -112
  182. package/dist/clients/client.js.map +0 -1
  183. package/dist/clients/event.d.ts +0 -79
  184. package/dist/clients/event.js +0 -64
  185. package/dist/clients/event.js.map +0 -1
  186. package/dist/clients/meter.d.ts +0 -75
  187. package/dist/clients/meter.js +0 -65
  188. package/dist/clients/meter.js.map +0 -1
  189. package/dist/clients/portal.d.ts +0 -22
  190. package/dist/clients/portal.js +0 -37
  191. package/dist/clients/portal.js.map +0 -1
  192. package/dist/clients/subject.d.ts +0 -27
  193. package/dist/clients/subject.js +0 -56
  194. package/dist/clients/subject.js.map +0 -1
  195. package/dist/schemas/openapi.d.ts +0 -2078
  196. package/dist/schemas/openapi.js +0 -6
  197. package/dist/schemas/openapi.js.map +0 -1
  198. package/dist/test/agent.d.ts +0 -2
  199. package/dist/test/agent.js +0 -263
  200. package/dist/test/agent.js.map +0 -1
  201. package/dist/test/mocks.d.ts +0 -14
  202. package/dist/test/mocks.js +0 -41
  203. package/dist/test/mocks.js.map +0 -1
@@ -0,0 +1,617 @@
1
+ import type { Client } from 'openapi-fetch';
2
+ import type { RequestOptions } from './common.cjs';
3
+ import type { CreateStripeCustomerPortalSessionParams, CustomerAppData, CustomerCreate, CustomerReplaceUpdate, operations, paths, StripeCustomerAppDataBase } from './schemas.cjs';
4
+ /**
5
+ * Customers
6
+ * Manage customer subscription lifecycles and plan assignments.
7
+ */
8
+ export declare class Customers {
9
+ private client;
10
+ apps: CustomerApps;
11
+ entitlementsV1: CustomerEntitlements;
12
+ entitlements: CustomerEntitlementsV2;
13
+ stripe: CustomerStripe;
14
+ constructor(client: Client<paths, `${string}/${string}`>);
15
+ /**
16
+ * Create a customer
17
+ * @param customer - The customer to create
18
+ * @param signal - An optional abort signal
19
+ * @returns The created customer
20
+ */
21
+ create(customer: CustomerCreate, options?: RequestOptions): Promise<{
22
+ readonly id: string;
23
+ name: string;
24
+ description?: string;
25
+ metadata?: import("./schemas.cjs").components["schemas"]["Metadata"] | null;
26
+ readonly createdAt: Date;
27
+ readonly updatedAt: Date;
28
+ readonly deletedAt?: Date;
29
+ key?: string;
30
+ usageAttribution?: import("./schemas.cjs").components["schemas"]["CustomerUsageAttribution"];
31
+ primaryEmail?: string;
32
+ currency?: import("./schemas.cjs").components["schemas"]["CurrencyCode"];
33
+ billingAddress?: import("./schemas.cjs").components["schemas"]["Address"];
34
+ readonly currentSubscriptionId?: string;
35
+ readonly subscriptions?: import("./schemas.cjs").components["schemas"]["Subscription"][];
36
+ readonly annotations?: import("./schemas.cjs").components["schemas"]["Annotations"];
37
+ } | undefined>;
38
+ /**
39
+ * Get a customer by ID
40
+ * @param customerIdOrKey - The ID or Key of the customer
41
+ * @param signal - An optional abort signal
42
+ * @returns The customer
43
+ */
44
+ get(customerIdOrKey: operations['getCustomer']['parameters']['path']['customerIdOrKey'], options?: RequestOptions): Promise<{
45
+ readonly id: string;
46
+ name: string;
47
+ description?: string;
48
+ metadata?: import("./schemas.cjs").components["schemas"]["Metadata"] | null;
49
+ readonly createdAt: Date;
50
+ readonly updatedAt: Date;
51
+ readonly deletedAt?: Date;
52
+ key?: string;
53
+ usageAttribution?: import("./schemas.cjs").components["schemas"]["CustomerUsageAttribution"];
54
+ primaryEmail?: string;
55
+ currency?: import("./schemas.cjs").components["schemas"]["CurrencyCode"];
56
+ billingAddress?: import("./schemas.cjs").components["schemas"]["Address"];
57
+ readonly currentSubscriptionId?: string;
58
+ readonly subscriptions?: import("./schemas.cjs").components["schemas"]["Subscription"][];
59
+ readonly annotations?: import("./schemas.cjs").components["schemas"]["Annotations"];
60
+ } | undefined>;
61
+ /**
62
+ * Update a customer
63
+ * @param customerIdOrKey - The ID or Key of the customer
64
+ * @param customer - The customer to update
65
+ * @param signal - An optional abort signal
66
+ * @returns The updated customer
67
+ */
68
+ update(customerIdOrKey: operations['updateCustomer']['parameters']['path']['customerIdOrKey'], customer: CustomerReplaceUpdate, options?: RequestOptions): Promise<{
69
+ readonly id: string;
70
+ name: string;
71
+ description?: string;
72
+ metadata?: import("./schemas.cjs").components["schemas"]["Metadata"] | null;
73
+ readonly createdAt: Date;
74
+ readonly updatedAt: Date;
75
+ readonly deletedAt?: Date;
76
+ key?: string;
77
+ usageAttribution?: import("./schemas.cjs").components["schemas"]["CustomerUsageAttribution"];
78
+ primaryEmail?: string;
79
+ currency?: import("./schemas.cjs").components["schemas"]["CurrencyCode"];
80
+ billingAddress?: import("./schemas.cjs").components["schemas"]["Address"];
81
+ readonly currentSubscriptionId?: string;
82
+ readonly subscriptions?: import("./schemas.cjs").components["schemas"]["Subscription"][];
83
+ readonly annotations?: import("./schemas.cjs").components["schemas"]["Annotations"];
84
+ } | undefined>;
85
+ /**
86
+ * Delete a customer
87
+ * @param customerIdOrKey - The ID or Key of the customer
88
+ * @param signal - An optional abort signal
89
+ * @returns The deleted customer
90
+ */
91
+ delete(customerIdOrKey: operations['deleteCustomer']['parameters']['path']['customerIdOrKey'], options?: RequestOptions): Promise<undefined>;
92
+ /**
93
+ * List customers
94
+ * @param signal - An optional abort signal
95
+ * @returns The list of customers
96
+ */
97
+ list(query?: operations['listCustomers']['parameters']['query'], options?: RequestOptions): Promise<{
98
+ totalCount: number;
99
+ page: number;
100
+ pageSize: number;
101
+ items: import("./schemas.cjs").components["schemas"]["Customer"][];
102
+ } | undefined>;
103
+ /**
104
+ * Get customer access
105
+ * @param customerIdOrKey - The ID or Key of the customer
106
+ * @param options - Optional request options
107
+ * @returns The customer access information
108
+ */
109
+ getAccess(customerIdOrKey: operations['getCustomerAccess']['parameters']['path']['customerIdOrKey'], options?: RequestOptions): Promise<{
110
+ readonly entitlements: {
111
+ [key: string]: import("./schemas.cjs").components["schemas"]["EntitlementValue"];
112
+ };
113
+ } | undefined>;
114
+ /**
115
+ * List customer subscriptions
116
+ * @param customerIdOrKey - The ID or key of the customer
117
+ * @param query - The query parameters
118
+ * @param signal - An optional abort signal
119
+ * @returns The list of customer subscriptions
120
+ */
121
+ listSubscriptions(customerIdOrKey: operations['listCustomerSubscriptions']['parameters']['path']['customerIdOrKey'], query?: operations['listCustomerSubscriptions']['parameters']['query'], options?: RequestOptions): Promise<{
122
+ totalCount: number;
123
+ page: number;
124
+ pageSize: number;
125
+ items: import("./schemas.cjs").components["schemas"]["Subscription"][];
126
+ } | undefined>;
127
+ }
128
+ /**
129
+ * Customer Apps
130
+ * Manage customer apps.
131
+ */
132
+ export declare class CustomerApps {
133
+ private client;
134
+ constructor(client: Client<paths, `${string}/${string}`>);
135
+ /**
136
+ * Upsert customer app data
137
+ * @param customerIdOrKey - The ID or Key of the customer
138
+ * @param appData - The app data to upsert
139
+ * @param signal - An optional abort signal
140
+ * @returns The upserted app data
141
+ */
142
+ upsert(customerIdOrKey: operations['upsertCustomerAppData']['parameters']['path']['customerIdOrKey'], appData: CustomerAppData[], options?: RequestOptions): Promise<({
143
+ readonly app?: import("./schemas.cjs").components["schemas"]["CustomInvoicingApp"];
144
+ id?: string;
145
+ type: "custom_invoicing";
146
+ metadata?: import("./schemas.cjs").components["schemas"]["Metadata"];
147
+ } | {
148
+ id?: string;
149
+ type: "stripe";
150
+ stripeCustomerId: string;
151
+ stripeDefaultPaymentMethodId?: string;
152
+ readonly app?: import("./schemas.cjs").components["schemas"]["StripeApp"];
153
+ } | {
154
+ readonly app?: import("./schemas.cjs").components["schemas"]["SandboxApp"];
155
+ id?: string;
156
+ type: "sandbox";
157
+ })[] | undefined>;
158
+ /**
159
+ * List customer app data
160
+ * @param customerIdOrKey - The ID or key of the customer
161
+ * @param query - The query parameters
162
+ * @param signal - An optional abort signal
163
+ * @returns The list of customer app data
164
+ */
165
+ list(customerIdOrKey: operations['listCustomerAppData']['parameters']['path']['customerIdOrKey'], query?: operations['listCustomerAppData']['parameters']['query'], options?: RequestOptions): Promise<{
166
+ totalCount: number;
167
+ page: number;
168
+ pageSize: number;
169
+ items: import("./schemas.cjs").components["schemas"]["CustomerAppData"][];
170
+ } | undefined>;
171
+ /**
172
+ * Delete customer app data
173
+ * @param customerIdOrKey - The ID or key of the customer
174
+ * @param appId - The ID of the app
175
+ * @param signal - An optional abort signal
176
+ * @returns The deleted customer app data
177
+ */
178
+ delete(customerIdOrKey: operations['deleteCustomerAppData']['parameters']['path']['customerIdOrKey'], appId: operations['deleteCustomerAppData']['parameters']['path']['appId'], options?: RequestOptions): Promise<undefined>;
179
+ }
180
+ /**
181
+ * Customer Stripe
182
+ * Manage customer Stripe data.
183
+ */
184
+ export declare class CustomerStripe {
185
+ private client;
186
+ constructor(client: Client<paths, `${string}/${string}`>);
187
+ /**
188
+ * Upsert customer stripe app data
189
+ * @param customerIdOrKey - The ID or Key of the customer
190
+ * @param appData - The app data to upsert
191
+ * @param signal - An optional abort signal
192
+ * @returns The upserted customer stripe app data
193
+ */
194
+ upsert(customerIdOrKey: operations['upsertCustomerStripeAppData']['parameters']['path']['customerIdOrKey'], stripeAppData: StripeCustomerAppDataBase, options?: RequestOptions): Promise<{
195
+ id?: string;
196
+ type: "stripe";
197
+ stripeCustomerId: string;
198
+ stripeDefaultPaymentMethodId?: string;
199
+ readonly app?: import("./schemas.cjs").components["schemas"]["StripeApp"];
200
+ } | undefined>;
201
+ /**
202
+ * Get customer stripe app data
203
+ * @param customerIdOrKey - The ID or key of the customer
204
+ * @param query - The query parameters
205
+ * @param signal - An optional abort signal
206
+ * @returns The customer stripe app data
207
+ */
208
+ get(customerIdOrKey: operations['getCustomerStripeAppData']['parameters']['path']['customerIdOrKey'], options?: RequestOptions): Promise<{
209
+ id?: string;
210
+ type: "stripe";
211
+ stripeCustomerId: string;
212
+ stripeDefaultPaymentMethodId?: string;
213
+ readonly app?: import("./schemas.cjs").components["schemas"]["StripeApp"];
214
+ } | undefined>;
215
+ /**
216
+ * Create a Stripe customer portal session
217
+ * @param customerIdOrKey - The ID or Key of the customer
218
+ * @param params - The parameters for creating a Stripe customer portal session
219
+ * @param signal - An optional abort signal
220
+ * @returns The Stripe customer portal session
221
+ */
222
+ createPortalSession(customerIdOrKey: operations['createCustomerStripePortalSession']['parameters']['path']['customerIdOrKey'], params: CreateStripeCustomerPortalSessionParams, options?: RequestOptions): Promise<{
223
+ id: string;
224
+ stripeCustomerId: string;
225
+ configurationId: string;
226
+ livemode: boolean;
227
+ createdAt: Date;
228
+ returnUrl: string;
229
+ locale: string;
230
+ url: string;
231
+ } | undefined>;
232
+ }
233
+ /**
234
+ * Customer Entitlements
235
+ */
236
+ export declare class CustomerEntitlements {
237
+ private client;
238
+ constructor(client: Client<paths, `${string}/${string}`>);
239
+ /**
240
+ * Get the value of an entitlement for a customer
241
+ * @param customerIdOrKey - The ID or Key of the customer
242
+ * @param featureKey - The key of the feature
243
+ * @param signal - An optional abort signal
244
+ * @returns The value of the entitlement
245
+ */
246
+ value(customerIdOrKey: operations['getCustomerEntitlementValue']['parameters']['path']['customerIdOrKey'], featureKey: operations['getCustomerEntitlementValue']['parameters']['path']['featureKey'], options?: RequestOptions): Promise<{
247
+ readonly hasAccess: boolean;
248
+ readonly balance?: number;
249
+ readonly usage?: number;
250
+ readonly overage?: number;
251
+ readonly totalAvailableGrantAmount?: number;
252
+ readonly config?: string;
253
+ } | undefined>;
254
+ }
255
+ /**
256
+ * Customer Entitlements V2
257
+ */
258
+ export declare class CustomerEntitlementsV2 {
259
+ private client;
260
+ constructor(client: Client<paths, `${string}/${string}`>);
261
+ /**
262
+ * List all entitlements for a customer
263
+ * @param customerIdOrKey - The ID or Key of the customer
264
+ * @param options - Request options including query parameters
265
+ * @returns List of customer entitlements
266
+ */
267
+ list(customerIdOrKey: operations['listCustomerEntitlementsV2']['parameters']['path']['customerIdOrKey'], options?: RequestOptions & {
268
+ query?: operations['listCustomerEntitlementsV2']['parameters']['query'];
269
+ }): Promise<{
270
+ totalCount: number;
271
+ page: number;
272
+ pageSize: number;
273
+ items: import("./schemas.cjs").components["schemas"]["EntitlementV2"][];
274
+ } | undefined>;
275
+ /**
276
+ * Create a customer entitlement
277
+ * @param customerIdOrKey - The ID or Key of the customer
278
+ * @param entitlement - The entitlement data to create
279
+ * @param options - Request options
280
+ * @returns The created entitlement
281
+ */
282
+ create(customerIdOrKey: operations['createCustomerEntitlementV2']['parameters']['path']['customerIdOrKey'], entitlement: operations['createCustomerEntitlementV2']['requestBody']['content']['application/json'], options?: RequestOptions): Promise<import("openapi-typescript-helpers").SuccessResponse<{
283
+ 201: {
284
+ headers: {
285
+ [name: string]: unknown;
286
+ };
287
+ content: {
288
+ "application/json": import("./schemas.cjs").components["schemas"]["EntitlementV2"];
289
+ };
290
+ };
291
+ 400: {
292
+ headers: {
293
+ [name: string]: unknown;
294
+ };
295
+ content: {
296
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["BadRequestProblemResponse"];
297
+ };
298
+ };
299
+ 401: {
300
+ headers: {
301
+ [name: string]: unknown;
302
+ };
303
+ content: {
304
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["UnauthorizedProblemResponse"];
305
+ };
306
+ };
307
+ 403: {
308
+ headers: {
309
+ [name: string]: unknown;
310
+ };
311
+ content: {
312
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["ForbiddenProblemResponse"];
313
+ };
314
+ };
315
+ 409: {
316
+ headers: {
317
+ [name: string]: unknown;
318
+ };
319
+ content: {
320
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["ConflictProblemResponse"];
321
+ };
322
+ };
323
+ 412: {
324
+ headers: {
325
+ [name: string]: unknown;
326
+ };
327
+ content: {
328
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["PreconditionFailedProblemResponse"];
329
+ };
330
+ };
331
+ 500: {
332
+ headers: {
333
+ [name: string]: unknown;
334
+ };
335
+ content: {
336
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["InternalServerErrorProblemResponse"];
337
+ };
338
+ };
339
+ 503: {
340
+ headers: {
341
+ [name: string]: unknown;
342
+ };
343
+ content: {
344
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["ServiceUnavailableProblemResponse"];
345
+ };
346
+ };
347
+ default: {
348
+ headers: {
349
+ [name: string]: unknown;
350
+ };
351
+ content: {
352
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["UnexpectedProblemResponse"];
353
+ };
354
+ };
355
+ }, `${string}/${string}`> | undefined>;
356
+ /**
357
+ * Get a specific customer entitlement
358
+ * @param customerIdOrKey - The ID or Key of the customer
359
+ * @param entitlementIdOrFeatureKey - The ID or feature key of the entitlement
360
+ * @param options - Request options
361
+ * @returns The entitlement
362
+ */
363
+ get(customerIdOrKey: operations['getCustomerEntitlementV2']['parameters']['path']['customerIdOrKey'], entitlementIdOrFeatureKey: operations['getCustomerEntitlementV2']['parameters']['path']['entitlementIdOrFeatureKey'], options?: RequestOptions): Promise<import("openapi-typescript-helpers").SuccessResponse<{
364
+ 200: {
365
+ headers: {
366
+ [name: string]: unknown;
367
+ };
368
+ content: {
369
+ "application/json": import("./schemas.cjs").components["schemas"]["EntitlementV2"];
370
+ };
371
+ };
372
+ 400: {
373
+ headers: {
374
+ [name: string]: unknown;
375
+ };
376
+ content: {
377
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["BadRequestProblemResponse"];
378
+ };
379
+ };
380
+ 401: {
381
+ headers: {
382
+ [name: string]: unknown;
383
+ };
384
+ content: {
385
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["UnauthorizedProblemResponse"];
386
+ };
387
+ };
388
+ 403: {
389
+ headers: {
390
+ [name: string]: unknown;
391
+ };
392
+ content: {
393
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["ForbiddenProblemResponse"];
394
+ };
395
+ };
396
+ 404: {
397
+ headers: {
398
+ [name: string]: unknown;
399
+ };
400
+ content: {
401
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["NotFoundProblemResponse"];
402
+ };
403
+ };
404
+ 412: {
405
+ headers: {
406
+ [name: string]: unknown;
407
+ };
408
+ content: {
409
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["PreconditionFailedProblemResponse"];
410
+ };
411
+ };
412
+ 500: {
413
+ headers: {
414
+ [name: string]: unknown;
415
+ };
416
+ content: {
417
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["InternalServerErrorProblemResponse"];
418
+ };
419
+ };
420
+ 503: {
421
+ headers: {
422
+ [name: string]: unknown;
423
+ };
424
+ content: {
425
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["ServiceUnavailableProblemResponse"];
426
+ };
427
+ };
428
+ default: {
429
+ headers: {
430
+ [name: string]: unknown;
431
+ };
432
+ content: {
433
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["UnexpectedProblemResponse"];
434
+ };
435
+ };
436
+ }, `${string}/${string}`> | undefined>;
437
+ /**
438
+ * Delete a customer entitlement
439
+ * @param customerIdOrKey - The ID or Key of the customer
440
+ * @param entitlementIdOrFeatureKey - The ID or feature key of the entitlement
441
+ * @param options - Request options
442
+ * @returns The deletion response
443
+ */
444
+ delete(customerIdOrKey: operations['deleteCustomerEntitlementV2']['parameters']['path']['customerIdOrKey'], entitlementIdOrFeatureKey: operations['deleteCustomerEntitlementV2']['parameters']['path']['entitlementIdOrFeatureKey'], options?: RequestOptions): Promise<undefined>;
445
+ /**
446
+ * Override a customer entitlement
447
+ * @param customerIdOrKey - The ID or Key of the customer
448
+ * @param entitlementIdOrFeatureKey - The ID or feature key of the entitlement
449
+ * @param entitlement - The new entitlement data
450
+ * @param options - Request options
451
+ * @returns The overridden entitlement
452
+ */
453
+ override(customerIdOrKey: operations['overrideCustomerEntitlementV2']['parameters']['path']['customerIdOrKey'], entitlementIdOrFeatureKey: operations['overrideCustomerEntitlementV2']['parameters']['path']['entitlementIdOrFeatureKey'], entitlement: operations['overrideCustomerEntitlementV2']['requestBody']['content']['application/json'], options?: RequestOptions): Promise<import("openapi-typescript-helpers").SuccessResponse<{
454
+ 201: {
455
+ headers: {
456
+ [name: string]: unknown;
457
+ };
458
+ content: {
459
+ "application/json": import("./schemas.cjs").components["schemas"]["EntitlementV2"];
460
+ };
461
+ };
462
+ 400: {
463
+ headers: {
464
+ [name: string]: unknown;
465
+ };
466
+ content: {
467
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["BadRequestProblemResponse"];
468
+ };
469
+ };
470
+ 401: {
471
+ headers: {
472
+ [name: string]: unknown;
473
+ };
474
+ content: {
475
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["UnauthorizedProblemResponse"];
476
+ };
477
+ };
478
+ 403: {
479
+ headers: {
480
+ [name: string]: unknown;
481
+ };
482
+ content: {
483
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["ForbiddenProblemResponse"];
484
+ };
485
+ };
486
+ 404: {
487
+ headers: {
488
+ [name: string]: unknown;
489
+ };
490
+ content: {
491
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["NotFoundProblemResponse"];
492
+ };
493
+ };
494
+ 409: {
495
+ headers: {
496
+ [name: string]: unknown;
497
+ };
498
+ content: {
499
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["ConflictProblemResponse"];
500
+ };
501
+ };
502
+ 412: {
503
+ headers: {
504
+ [name: string]: unknown;
505
+ };
506
+ content: {
507
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["PreconditionFailedProblemResponse"];
508
+ };
509
+ };
510
+ 500: {
511
+ headers: {
512
+ [name: string]: unknown;
513
+ };
514
+ content: {
515
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["InternalServerErrorProblemResponse"];
516
+ };
517
+ };
518
+ 503: {
519
+ headers: {
520
+ [name: string]: unknown;
521
+ };
522
+ content: {
523
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["ServiceUnavailableProblemResponse"];
524
+ };
525
+ };
526
+ default: {
527
+ headers: {
528
+ [name: string]: unknown;
529
+ };
530
+ content: {
531
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["UnexpectedProblemResponse"];
532
+ };
533
+ };
534
+ }, `${string}/${string}`> | undefined>;
535
+ /**
536
+ * List grants for a customer entitlement
537
+ * @param customerIdOrKey - The ID or Key of the customer
538
+ * @param entitlementIdOrFeatureKey - The ID or feature key of the entitlement
539
+ * @param options - Request options including query parameters
540
+ * @returns List of entitlement grants
541
+ */
542
+ listGrants(customerIdOrKey: operations['listCustomerEntitlementGrantsV2']['parameters']['path']['customerIdOrKey'], entitlementIdOrFeatureKey: operations['listCustomerEntitlementGrantsV2']['parameters']['path']['entitlementIdOrFeatureKey'], options?: RequestOptions & {
543
+ query?: operations['listCustomerEntitlementGrantsV2']['parameters']['query'];
544
+ }): Promise<{
545
+ totalCount: number;
546
+ page: number;
547
+ pageSize: number;
548
+ items: import("./schemas.cjs").components["schemas"]["EntitlementGrantV2"][];
549
+ } | undefined>;
550
+ /**
551
+ * Create a grant for a customer entitlement
552
+ * @param customerIdOrKey - The ID or Key of the customer
553
+ * @param entitlementIdOrFeatureKey - The ID or feature key of the entitlement
554
+ * @param grant - The grant data to create
555
+ * @param options - Request options
556
+ * @returns The created grant
557
+ */
558
+ createGrant(customerIdOrKey: operations['createCustomerEntitlementGrantV2']['parameters']['path']['customerIdOrKey'], entitlementIdOrFeatureKey: operations['createCustomerEntitlementGrantV2']['parameters']['path']['entitlementIdOrFeatureKey'], grant: operations['createCustomerEntitlementGrantV2']['requestBody']['content']['application/json'], options?: RequestOptions): Promise<{
559
+ readonly createdAt: Date;
560
+ readonly updatedAt: Date;
561
+ readonly deletedAt?: Date;
562
+ amount: number;
563
+ priority?: number;
564
+ effectiveAt: Date;
565
+ minRolloverAmount?: number;
566
+ metadata?: import("./schemas.cjs").components["schemas"]["Metadata"];
567
+ maxRolloverAmount?: number;
568
+ expiration?: import("./schemas.cjs").components["schemas"]["ExpirationPeriod"];
569
+ annotations?: import("./schemas.cjs").components["schemas"]["Annotations"];
570
+ readonly id: string;
571
+ readonly entitlementId: string;
572
+ nextRecurrence?: Date;
573
+ readonly expiresAt?: Date;
574
+ voidedAt?: Date;
575
+ recurrence?: import("./schemas.cjs").components["schemas"]["RecurringPeriod"];
576
+ } | undefined>;
577
+ /**
578
+ * Get the value of a customer entitlement
579
+ * @param customerIdOrKey - The ID or Key of the customer
580
+ * @param entitlementIdOrFeatureKey - The ID or feature key of the entitlement
581
+ * @param options - Request options including query parameters
582
+ * @returns The entitlement value
583
+ */
584
+ value(customerIdOrKey: operations['getCustomerEntitlementValueV2']['parameters']['path']['customerIdOrKey'], entitlementIdOrFeatureKey: operations['getCustomerEntitlementValueV2']['parameters']['path']['entitlementIdOrFeatureKey'], options?: RequestOptions & {
585
+ query?: operations['getCustomerEntitlementValueV2']['parameters']['query'];
586
+ }): Promise<{
587
+ readonly hasAccess: boolean;
588
+ readonly balance?: number;
589
+ readonly usage?: number;
590
+ readonly overage?: number;
591
+ readonly totalAvailableGrantAmount?: number;
592
+ readonly config?: string;
593
+ } | undefined>;
594
+ /**
595
+ * Get the history of a customer entitlement
596
+ * @param customerIdOrKey - The ID or Key of the customer
597
+ * @param entitlementIdOrFeatureKey - The ID or feature key of the entitlement
598
+ * @param windowSize - The window size for the history
599
+ * @param options - Request options including query parameters
600
+ * @returns The entitlement history
601
+ */
602
+ history(customerIdOrKey: operations['getCustomerEntitlementHistoryV2']['parameters']['path']['customerIdOrKey'], entitlementIdOrFeatureKey: operations['getCustomerEntitlementHistoryV2']['parameters']['path']['entitlementIdOrFeatureKey'], windowSize: operations['getCustomerEntitlementHistoryV2']['parameters']['query']['windowSize'], options?: RequestOptions & {
603
+ query?: Omit<operations['getCustomerEntitlementHistoryV2']['parameters']['query'], 'windowSize'>;
604
+ }): Promise<{
605
+ windowedHistory: import("./schemas.cjs").components["schemas"]["BalanceHistoryWindow"][];
606
+ burndownHistory: import("./schemas.cjs").components["schemas"]["GrantBurnDownHistorySegment"][];
607
+ } | undefined>;
608
+ /**
609
+ * Reset the usage of a customer entitlement
610
+ * @param customerIdOrKey - The ID or Key of the customer
611
+ * @param entitlementIdOrFeatureKey - The ID or feature key of the entitlement
612
+ * @param reset - The reset data
613
+ * @param options - Request options
614
+ * @returns The reset response
615
+ */
616
+ resetUsage(customerIdOrKey: operations['resetCustomerEntitlementUsageV2']['parameters']['path']['customerIdOrKey'], entitlementIdOrFeatureKey: operations['resetCustomerEntitlementUsageV2']['parameters']['path']['entitlementIdOrFeatureKey'], reset: operations['resetCustomerEntitlementUsageV2']['requestBody']['content']['application/json'], options?: RequestOptions): Promise<undefined>;
617
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customers.js","sourceRoot":"","sources":["../../../../src/client/customers.ts"],"names":[],"mappings":";;;AAWA,yCAA8C;AAE9C;;;GAGG;AACH,MAAa,SAAS;IAMA;IALb,IAAI,CAAc;IAClB,cAAc,CAAsB;IACpC,YAAY,CAAwB;IACpC,MAAM,CAAgB;IAE7B,YAAo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,IAAI,EAAE,KAAK;YACX,MAAM,EAAE;gBACN,IAAI,EAAE,EAAE,eAAe,EAAE,yBAAyB,EAAE;aACrD;YACD,GAAG,OAAO;SACX,CACF,CAAA;QAED,OAAO,IAAA,4BAAiB,EAAC,IAAI,CAAC,CAAA;IAChC,CAAC;CACF;AAxRD,wDAwRC"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Debug = void 0;
4
+ const utils_js_1 = require("./utils.cjs");
5
+ /**
6
+ * Debug utilities for OpenMeter
7
+ */
8
+ class Debug {
9
+ client;
10
+ constructor(client) {
11
+ this.client = client;
12
+ }
13
+ /**
14
+ * Get event metrics
15
+ * @description Returns debug metrics (in OpenMetrics format) like the number of ingested events since mindnight UTC.
16
+ * @param options - The request options
17
+ * @returns The debug metrics
18
+ */
19
+ async getMetrics(options) {
20
+ const resp = await this.client.GET('/api/v1/debug/metrics', {
21
+ ...options,
22
+ });
23
+ return (0, utils_js_1.transformResponse)(resp);
24
+ }
25
+ }
26
+ exports.Debug = Debug;
27
+ //# sourceMappingURL=debug.js.map