@openmeter/sdk 1.0.0-beta-7b2d9ed372e3 → 1.0.0-beta-bbb2af6bf3b0

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 (90) hide show
  1. package/dist/cjs/{tsconfig.3bd7bdb7.tsbuildinfo → tsconfig.7b29505b.tsbuildinfo} +1 -1
  2. package/dist/cjs/{tsconfig.769a7751.tsbuildinfo → tsconfig.e592f80c.tsbuildinfo} +1 -1
  3. package/dist/tsconfig.tsbuildinfo +1 -1
  4. package/package.json +1 -1
  5. package/dist/cjs/src/apps.cjs +0 -176
  6. package/dist/cjs/src/apps.d.cts +0 -338
  7. package/dist/cjs/src/apps.js.map +0 -1
  8. package/dist/cjs/src/billing.cjs +0 -309
  9. package/dist/cjs/src/billing.d.cts +0 -645
  10. package/dist/cjs/src/billing.js.map +0 -1
  11. package/dist/cjs/src/customers.cjs +0 -185
  12. package/dist/cjs/src/customers.d.cts +0 -231
  13. package/dist/cjs/src/customers.js.map +0 -1
  14. package/dist/cjs/src/entitlements.cjs +0 -244
  15. package/dist/cjs/src/entitlements.d.cts +0 -505
  16. package/dist/cjs/src/entitlements.js.map +0 -1
  17. package/dist/cjs/src/events.cjs +0 -65
  18. package/dist/cjs/src/events.d.cts +0 -101
  19. package/dist/cjs/src/events.js.map +0 -1
  20. package/dist/cjs/src/features.cjs +0 -78
  21. package/dist/cjs/src/features.d.cts +0 -153
  22. package/dist/cjs/src/features.js.map +0 -1
  23. package/dist/cjs/src/meters.cjs +0 -93
  24. package/dist/cjs/src/meters.d.cts +0 -184
  25. package/dist/cjs/src/meters.js.map +0 -1
  26. package/dist/cjs/src/notifications.cjs +0 -249
  27. package/dist/cjs/src/notifications.d.cts +0 -314
  28. package/dist/cjs/src/notifications.js.map +0 -1
  29. package/dist/cjs/src/plans.cjs +0 -127
  30. package/dist/cjs/src/plans.d.cts +0 -192
  31. package/dist/cjs/src/plans.js.map +0 -1
  32. package/dist/cjs/src/subjects.cjs +0 -76
  33. package/dist/cjs/src/subjects.d.cts +0 -101
  34. package/dist/cjs/src/subjects.js.map +0 -1
  35. package/dist/cjs/src/subscriptions.cjs +0 -116
  36. package/dist/cjs/src/subscriptions.d.cts +0 -197
  37. package/dist/cjs/src/subscriptions.js.map +0 -1
  38. package/dist/cjs/src/utils.cjs +0 -93
  39. package/dist/cjs/src/utils.d.cts +0 -29
  40. package/dist/cjs/src/utils.js.map +0 -1
  41. package/dist/cjs/tsconfig.01ab6c6b.tsbuildinfo +0 -1
  42. package/dist/cjs/tsconfig.1e12acbb.tsbuildinfo +0 -1
  43. package/dist/cjs/tsconfig.38849cd1.tsbuildinfo +0 -1
  44. package/dist/cjs/tsconfig.3db00db7.tsbuildinfo +0 -1
  45. package/dist/cjs/tsconfig.5cd8af0a.tsbuildinfo +0 -1
  46. package/dist/cjs/tsconfig.64c40770.tsbuildinfo +0 -1
  47. package/dist/cjs/tsconfig.8fd1c6cd.tsbuildinfo +0 -1
  48. package/dist/cjs/tsconfig.c9e83bdd.tsbuildinfo +0 -1
  49. package/dist/cjs/tsconfig.d3cb3b9e.tsbuildinfo +0 -1
  50. package/dist/cjs/tsconfig.db7aa141.tsbuildinfo +0 -1
  51. package/dist/cjs/tsconfig.edd7b7ed.tsbuildinfo +0 -1
  52. package/dist/cjs/tsconfig.f343a141.tsbuildinfo +0 -1
  53. package/dist/cjs/tsconfig.f36f8639.tsbuildinfo +0 -1
  54. package/dist/cjs/tsconfig.fc8d5fa4.tsbuildinfo +0 -1
  55. package/dist/src/apps.d.ts +0 -338
  56. package/dist/src/apps.js +0 -170
  57. package/dist/src/apps.js.map +0 -1
  58. package/dist/src/billing.d.ts +0 -645
  59. package/dist/src/billing.js +0 -302
  60. package/dist/src/billing.js.map +0 -1
  61. package/dist/src/customers.d.ts +0 -231
  62. package/dist/src/customers.js +0 -179
  63. package/dist/src/customers.js.map +0 -1
  64. package/dist/src/entitlements.d.ts +0 -505
  65. package/dist/src/entitlements.js +0 -239
  66. package/dist/src/entitlements.js.map +0 -1
  67. package/dist/src/events.d.ts +0 -101
  68. package/dist/src/events.js +0 -58
  69. package/dist/src/events.js.map +0 -1
  70. package/dist/src/features.d.ts +0 -153
  71. package/dist/src/features.js +0 -74
  72. package/dist/src/features.js.map +0 -1
  73. package/dist/src/meters.d.ts +0 -184
  74. package/dist/src/meters.js +0 -89
  75. package/dist/src/meters.js.map +0 -1
  76. package/dist/src/notifications.d.ts +0 -314
  77. package/dist/src/notifications.js +0 -242
  78. package/dist/src/notifications.js.map +0 -1
  79. package/dist/src/plans.d.ts +0 -192
  80. package/dist/src/plans.js +0 -123
  81. package/dist/src/plans.js.map +0 -1
  82. package/dist/src/subjects.d.ts +0 -101
  83. package/dist/src/subjects.js +0 -72
  84. package/dist/src/subjects.js.map +0 -1
  85. package/dist/src/subscriptions.d.ts +0 -197
  86. package/dist/src/subscriptions.js +0 -112
  87. package/dist/src/subscriptions.js.map +0 -1
  88. package/dist/src/utils.d.ts +0 -29
  89. package/dist/src/utils.js +0 -85
  90. package/dist/src/utils.js.map +0 -1
@@ -1,302 +0,0 @@
1
- import { transformResponse } from './utils.js';
2
- /**
3
- * Billing
4
- */
5
- export class Billing {
6
- client;
7
- profiles;
8
- invoices;
9
- customers;
10
- constructor(client) {
11
- this.client = client;
12
- this.profiles = new BillingProfiles(this.client);
13
- this.invoices = new BillingInvoices(this.client);
14
- this.customers = new BillingCustomers(this.client);
15
- }
16
- }
17
- /**
18
- * Billing Profiles
19
- */
20
- export class BillingProfiles {
21
- client;
22
- constructor(client) {
23
- this.client = client;
24
- }
25
- /**
26
- * Create a billing profile
27
- * @param billingProfile - The billing profile to create
28
- * @param signal - An optional abort signal
29
- * @returns The created billing profile
30
- */
31
- async create(billingProfile, signal) {
32
- const resp = await this.client.POST('/api/v1/billing/profiles', {
33
- signal,
34
- body: billingProfile,
35
- });
36
- return transformResponse(resp);
37
- }
38
- /**
39
- * Get a billing profile by ID
40
- * @param id - The ID of the billing profile to get
41
- * @param signal - An optional abort signal
42
- * @returns The billing profile
43
- */
44
- async get(id, signal) {
45
- const resp = await this.client.GET('/api/v1/billing/profiles/{id}', {
46
- signal,
47
- params: {
48
- path: { id },
49
- },
50
- });
51
- return transformResponse(resp);
52
- }
53
- /**
54
- * List billing profiles
55
- * @param query - The query parameters
56
- * @param signal - An optional abort signal
57
- * @returns The billing profiles
58
- */
59
- async list(query, signal) {
60
- const resp = await this.client.GET('/api/v1/billing/profiles', {
61
- signal,
62
- params: {
63
- query,
64
- },
65
- });
66
- return transformResponse(resp);
67
- }
68
- /**
69
- * Update a billing profile
70
- * @param id - The ID of the billing profile to update
71
- * @param billingProfile - The billing profile to update
72
- * @param signal - An optional abort signal
73
- * @returns The updated billing profile
74
- */
75
- async update(id, billingProfile, signal) {
76
- const resp = await this.client.PUT('/api/v1/billing/profiles/{id}', {
77
- signal,
78
- params: {
79
- path: { id },
80
- },
81
- body: billingProfile,
82
- });
83
- return transformResponse(resp);
84
- }
85
- }
86
- /**
87
- * Billing Invoices
88
- */
89
- export class BillingInvoices {
90
- client;
91
- constructor(client) {
92
- this.client = client;
93
- }
94
- /**
95
- * List invoices
96
- * @param query - The query parameters
97
- * @param signal - An optional abort signal
98
- * @returns The invoices
99
- */
100
- async list(query, signal) {
101
- const resp = await this.client.GET('/api/v1/billing/invoices', {
102
- signal,
103
- params: {
104
- query,
105
- },
106
- });
107
- return transformResponse(resp);
108
- }
109
- /**
110
- * Get an invoice by ID
111
- * @param id - The ID of the invoice to get
112
- * @param signal - An optional abort signal
113
- * @returns The invoice
114
- */
115
- async get(id, signal) {
116
- const resp = await this.client.GET('/api/v1/billing/invoices/{invoiceId}', {
117
- signal,
118
- params: {
119
- path: { invoiceId: id },
120
- },
121
- });
122
- return transformResponse(resp);
123
- }
124
- /**
125
- * Update an invoice
126
- * @description Only invoices in draft or earlier status can be updated.
127
- * @param id - The ID of the invoice to update
128
- * @param invoice - The invoice to update
129
- * @param signal - An optional abort signal
130
- * @returns The updated invoice
131
- */
132
- async update(id, invoice, signal) {
133
- const resp = await this.client.PUT('/api/v1/billing/invoices/{invoiceId}', {
134
- signal,
135
- params: { path: { invoiceId: id } },
136
- body: invoice,
137
- });
138
- return transformResponse(resp);
139
- }
140
- /**
141
- * Advance the invoice to the next status
142
- * @description The call doesn't "approve the invoice", it only advances the invoice to the next status if the transition would be automatic. The action can be called when the invoice's statusDetails' actions field contain the "advance" action.
143
- * @param id - The ID of the invoice to advance
144
- * @param signal - An optional abort signal
145
- * @returns The advanced invoice
146
- */
147
- async advance(id, signal) {
148
- const resp = await this.client.POST('/api/v1/billing/invoices/{invoiceId}/advance', {
149
- signal,
150
- params: { path: { invoiceId: id } },
151
- });
152
- return transformResponse(resp);
153
- }
154
- /**
155
- * Approve an invoice
156
- * @description This call instantly sends the invoice to the customer using the configured billing profile app.
157
- * @param id - The ID of the invoice to approve
158
- * @param signal - An optional abort signal
159
- * @returns The approved invoice
160
- */
161
- async approve(id, signal) {
162
- const resp = await this.client.POST('/api/v1/billing/invoices/{invoiceId}/approve', {
163
- signal,
164
- params: { path: { invoiceId: id } },
165
- });
166
- return transformResponse(resp);
167
- }
168
- /**
169
- * Retry advancing the invoice after a failed attempt.
170
- * @param id - The ID of the invoice to retry
171
- * @param signal - An optional abort signal
172
- * @returns The retried invoice
173
- */
174
- async retry(id, signal) {
175
- const resp = await this.client.POST('/api/v1/billing/invoices/{invoiceId}/retry', {
176
- signal,
177
- params: { path: { invoiceId: id } },
178
- });
179
- return transformResponse(resp);
180
- }
181
- /**
182
- * Void an invoice
183
- * @description Void an invoice
184
- *
185
- * Only invoices that have been alread issued can be voided.
186
- * @param id - The ID of the invoice to void
187
- * @param signal - An optional abort signal
188
- * @returns The voided invoice
189
- */
190
- async void(id, body, signal) {
191
- const resp = await this.client.POST('/api/v1/billing/invoices/{invoiceId}/void', {
192
- signal,
193
- params: { path: { invoiceId: id } },
194
- body,
195
- });
196
- return transformResponse(resp);
197
- }
198
- /**
199
- * Recalculate an invoice's tax amounts
200
- * @param id - The ID of the invoice to recalculate
201
- * @param signal - An optional abort signal
202
- * @returns The recalculated invoice
203
- */
204
- async recalculateTax(id, signal) {
205
- const resp = await this.client.POST('/api/v1/billing/invoices/{invoiceId}/taxes/recalculate', {
206
- signal,
207
- params: { path: { invoiceId: id } },
208
- });
209
- return transformResponse(resp);
210
- }
211
- /**
212
- * Simulate an invoice for a customer
213
- * @param id - The ID of the customer to simulate the invoice for
214
- * @param signal - An optional abort signal
215
- * @returns The simulated invoice
216
- */
217
- async simulate(id, body, signal) {
218
- const resp = await this.client.POST('/api/v1/billing/customers/{customerId}/invoices/simulate', {
219
- signal,
220
- params: { path: { customerId: id } },
221
- body,
222
- });
223
- return transformResponse(resp);
224
- }
225
- /**
226
- * Create pending invoice line items
227
- * @param body - The pending invoice line items to create
228
- * @param signal - An optional abort signal
229
- * @returns The created pending invoice line items
230
- */
231
- async createLineItems(body, signal) {
232
- const resp = await this.client.POST('/api/v1/billing/invoices/lines', {
233
- signal,
234
- body,
235
- });
236
- return transformResponse(resp);
237
- }
238
- }
239
- /**
240
- * Billing Customer Invoices and Overrides
241
- */
242
- export class BillingCustomers {
243
- client;
244
- constructor(client) {
245
- this.client = client;
246
- }
247
- /**
248
- * Create or update a customer override
249
- * @param id - The ID of the customer to create the override for
250
- * @param body - The customer override to create
251
- * @param signal - An optional abort signal
252
- * @returns The created customer override
253
- */
254
- async createOverride(id, body, signal) {
255
- const resp = await this.client.POST('/api/v1/billing/customers/{customerId}', {
256
- signal,
257
- params: { path: { customerId: id } },
258
- body,
259
- });
260
- return transformResponse(resp);
261
- }
262
- /**
263
- * Get a customer override
264
- * @param id - The ID of the customer to get the override for
265
- * @param signal - An optional abort signal
266
- * @returns The customer override
267
- */
268
- async getOverride(id, signal) {
269
- const resp = await this.client.GET('/api/v1/billing/customers/{customerId}', {
270
- signal,
271
- params: { path: { customerId: id } },
272
- });
273
- return transformResponse(resp);
274
- }
275
- /**
276
- * List customer overrides
277
- * @param query - The query parameters
278
- * @param signal - An optional abort signal
279
- * @returns The customer overrides
280
- */
281
- async listOverrides(query, signal) {
282
- const resp = await this.client.GET('/api/v1/billing/customers', {
283
- signal,
284
- params: { query },
285
- });
286
- return transformResponse(resp);
287
- }
288
- /**
289
- * Delete a customer override
290
- * @param id - The ID of the customer to delete the override for
291
- * @param signal - An optional abort signal
292
- * @returns The deleted customer override
293
- */
294
- async deleteOverride(id, signal) {
295
- const resp = await this.client.DELETE('/api/v1/billing/customers/{customerId}', {
296
- signal,
297
- params: { path: { customerId: id } },
298
- });
299
- return transformResponse(resp);
300
- }
301
- }
302
- //# sourceMappingURL=billing.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"billing.js","sourceRoot":"","sources":["../../src/billing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAc9C;;GAEG;AACH,MAAM,OAAO,OAAO;IAKE;IAJb,QAAQ,CAAiB;IACzB,QAAQ,CAAiB;IACzB,SAAS,CAAkB;IAElC,YAAoB,MAA4C;QAA5C,WAAM,GAAN,MAAM,CAAsC;QAC9D,IAAI,CAAC,QAAQ,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAChD,IAAI,CAAC,QAAQ,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAChD,IAAI,CAAC,SAAS,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACpD,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,eAAe;IACN;IAApB,YAAoB,MAA4C;QAA5C,WAAM,GAAN,MAAM,CAAsC;IAAG,CAAC;IAEpE;;;;;OAKG;IACI,KAAK,CAAC,MAAM,CACjB,cAAoC,EACpC,MAAoB;QAEpB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,0BAA0B,EAAE;YAC9D,MAAM;YACN,IAAI,EAAE,cAAc;SAC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AAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,2BAA2B,EAAE;YAC9D,MAAM;YACN,MAAM,EAAE,EAAE,KAAK,EAAE;SAClB,CAAC,CAAA;QAEF,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAA;IAChC,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,cAAc,CACzB,EAA0F,EAC1F,MAAoB;QAEpB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CACnC,wCAAwC,EACxC;YACE,MAAM;YACN,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,EAAE;SACrC,CACF,CAAA;QAED,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAA;IAChC,CAAC;CACF"}
@@ -1,231 +0,0 @@
1
- import type { CustomerAppData, CustomerCreate, CustomerReplaceUpdate, operations, paths } from './schemas.js';
2
- import type { Client } from 'openapi-fetch';
3
- /**
4
- * Customers
5
- * Manage customer subscription lifecycles and plan assignments.
6
- */
7
- export declare class Customers {
8
- private client;
9
- apps: CustomerApps;
10
- entitlements: CustomerEntitlements;
11
- constructor(client: Client<paths, `${string}/${string}`>);
12
- /**
13
- * Create a customer
14
- * @param customer - The customer to create
15
- * @param signal - An optional abort signal
16
- * @returns The created customer
17
- */
18
- create(customer: CustomerCreate, signal?: AbortSignal): Promise<{
19
- data?: never;
20
- error: import("./utils.js").Problem;
21
- response: Response;
22
- } | {
23
- data: {
24
- readonly id: string;
25
- name: string;
26
- description?: string;
27
- metadata?: import("./schemas.js").components["schemas"]["Metadata"] | null;
28
- readonly createdAt: Date;
29
- readonly updatedAt: Date;
30
- readonly deletedAt?: Date;
31
- usageAttribution: import("./schemas.js").components["schemas"]["CustomerUsageAttribution"];
32
- primaryEmail?: string;
33
- currency?: import("./schemas.js").components["schemas"]["CurrencyCode"];
34
- billingAddress?: import("./schemas.js").components["schemas"]["Address"];
35
- readonly currentSubscriptionId?: string;
36
- };
37
- error?: never;
38
- response: Response;
39
- }>;
40
- /**
41
- * Get a customer by ID
42
- * @param id - The ID of the customer
43
- * @param signal - An optional abort signal
44
- * @returns The customer
45
- */
46
- get(id: operations['getCustomer']['parameters']['path']['id'], signal?: AbortSignal): Promise<{
47
- data?: never;
48
- error: import("./utils.js").Problem;
49
- response: Response;
50
- } | {
51
- data: {
52
- readonly id: string;
53
- name: string;
54
- description?: string;
55
- metadata?: import("./schemas.js").components["schemas"]["Metadata"] | null;
56
- readonly createdAt: Date;
57
- readonly updatedAt: Date;
58
- readonly deletedAt?: Date;
59
- usageAttribution: import("./schemas.js").components["schemas"]["CustomerUsageAttribution"];
60
- primaryEmail?: string;
61
- currency?: import("./schemas.js").components["schemas"]["CurrencyCode"];
62
- billingAddress?: import("./schemas.js").components["schemas"]["Address"];
63
- readonly currentSubscriptionId?: string;
64
- };
65
- error?: never;
66
- response: Response;
67
- }>;
68
- /**
69
- * Update a customer
70
- * @param id - The ID of the customer
71
- * @param customer - The customer to update
72
- * @param signal - An optional abort signal
73
- * @returns The updated customer
74
- */
75
- update(id: operations['updateCustomer']['parameters']['path']['id'], customer: CustomerReplaceUpdate, signal?: AbortSignal): Promise<{
76
- data?: never;
77
- error: import("./utils.js").Problem;
78
- response: Response;
79
- } | {
80
- data: {
81
- readonly id: string;
82
- name: string;
83
- description?: string;
84
- metadata?: import("./schemas.js").components["schemas"]["Metadata"] | null;
85
- readonly createdAt: Date;
86
- readonly updatedAt: Date;
87
- readonly deletedAt?: Date;
88
- usageAttribution: import("./schemas.js").components["schemas"]["CustomerUsageAttribution"];
89
- primaryEmail?: string;
90
- currency?: import("./schemas.js").components["schemas"]["CurrencyCode"];
91
- billingAddress?: import("./schemas.js").components["schemas"]["Address"];
92
- readonly currentSubscriptionId?: string;
93
- };
94
- error?: never;
95
- response: Response;
96
- }>;
97
- /**
98
- * Delete a customer
99
- * @param id - The ID of the customer
100
- * @param signal - An optional abort signal
101
- * @returns The deleted customer
102
- */
103
- delete(id: operations['deleteCustomer']['parameters']['path']['id'], signal?: AbortSignal): Promise<{
104
- data?: never;
105
- error: import("./utils.js").Problem;
106
- response: Response;
107
- } | {
108
- data: undefined;
109
- error?: never;
110
- response: Response;
111
- }>;
112
- /**
113
- * List customers
114
- * @param signal - An optional abort signal
115
- * @returns The list of customers
116
- */
117
- list(query?: operations['listCustomers']['parameters']['query'], signal?: AbortSignal): Promise<{
118
- data?: never;
119
- error: import("./utils.js").Problem;
120
- response: Response;
121
- } | {
122
- data: {
123
- totalCount: number;
124
- page: number;
125
- pageSize: number;
126
- items: import("./schemas.js").components["schemas"]["Customer"][];
127
- };
128
- error?: never;
129
- response: Response;
130
- }>;
131
- }
132
- /**
133
- * Customer Apps
134
- * Manage customer apps.
135
- */
136
- export declare class CustomerApps {
137
- private client;
138
- constructor(client: Client<paths, `${string}/${string}`>);
139
- /**
140
- * Upsert customer app data
141
- * @param customerId - The ID of the customer
142
- * @param appData - The app data to upsert
143
- * @param signal - An optional abort signal
144
- * @returns The upserted app data
145
- */
146
- upsert(customerId: operations['upsertCustomerAppData']['parameters']['path']['customerId'], appData: CustomerAppData[], signal?: AbortSignal): Promise<{
147
- data?: never;
148
- error: import("./utils.js").Problem;
149
- response: Response;
150
- } | {
151
- data: ({
152
- id?: string;
153
- type: "stripe";
154
- readonly app?: import("./schemas.js").components["schemas"]["StripeApp"];
155
- stripeCustomerId: string;
156
- stripeDefaultPaymentMethodId?: string;
157
- } | {
158
- readonly app?: import("./schemas.js").components["schemas"]["SandboxApp"];
159
- id?: string;
160
- type: "sandbox";
161
- })[];
162
- error?: never;
163
- response: Response;
164
- }>;
165
- /**
166
- * List customer app data
167
- * @param customerId - The ID of the customer
168
- * @param query - The query parameters
169
- * @param signal - An optional abort signal
170
- * @returns The list of customer app data
171
- */
172
- list(customerId: operations['listCustomerAppData']['parameters']['path']['customerId'], query?: operations['listCustomerAppData']['parameters']['query'], signal?: AbortSignal): Promise<{
173
- data?: never;
174
- error: import("./utils.js").Problem;
175
- response: Response;
176
- } | {
177
- data: {
178
- totalCount: number;
179
- page: number;
180
- pageSize: number;
181
- items: import("./schemas.js").components["schemas"]["CustomerAppData"][];
182
- };
183
- error?: never;
184
- response: Response;
185
- }>;
186
- /**
187
- * Delete customer app data
188
- * @param customerId - The ID of the customer
189
- * @param appId - The ID of the app
190
- * @param signal - An optional abort signal
191
- * @returns The deleted customer app data
192
- */
193
- delete(customerId: operations['deleteCustomerAppData']['parameters']['path']['customerId'], appId: operations['deleteCustomerAppData']['parameters']['path']['appId'], signal?: AbortSignal): Promise<{
194
- data?: never;
195
- error: import("./utils.js").Problem;
196
- response: Response;
197
- } | {
198
- data: undefined;
199
- error?: never;
200
- response: Response;
201
- }>;
202
- }
203
- /**
204
- * Customer Entitlements
205
- */
206
- export declare class CustomerEntitlements {
207
- private client;
208
- constructor(client: Client<paths, `${string}/${string}`>);
209
- /**
210
- * Get the value of an entitlement for a customer
211
- * @param customerId - The ID of the customer
212
- * @param featureKey - The key of the feature
213
- * @param signal - An optional abort signal
214
- * @returns The value of the entitlement
215
- */
216
- value(customerId: operations['getCustomerEntitlementValue']['parameters']['path']['customerId'], featureKey: operations['getCustomerEntitlementValue']['parameters']['path']['featureKey'], signal?: AbortSignal): Promise<{
217
- data?: never;
218
- error: import("./utils.js").Problem;
219
- response: Response;
220
- } | {
221
- data: {
222
- readonly hasAccess: boolean;
223
- readonly balance?: number;
224
- readonly usage?: number;
225
- readonly overage?: number;
226
- readonly config?: string;
227
- };
228
- error?: never;
229
- response: Response;
230
- }>;
231
- }