@openmeter/sdk 1.0.0-beta.213 → 1.0.0-beta.215

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 (69) hide show
  1. package/dist/cjs/src/client/addons.cjs +105 -0
  2. package/dist/cjs/src/client/addons.d.cts +152 -0
  3. package/dist/cjs/src/client/addons.js.map +1 -0
  4. package/dist/cjs/src/client/billing.cjs +11 -3
  5. package/dist/cjs/src/client/billing.d.cts +32 -59
  6. package/dist/cjs/src/client/billing.js.map +1 -1
  7. package/dist/cjs/src/client/customers.cjs +17 -0
  8. package/dist/cjs/src/client/customers.d.cts +11 -0
  9. package/dist/cjs/src/client/customers.js.map +1 -1
  10. package/dist/cjs/src/client/events.cjs +19 -7
  11. package/dist/cjs/src/client/events.d.cts +15 -4
  12. package/dist/cjs/src/client/events.js.map +1 -1
  13. package/dist/cjs/src/client/index.cjs +6 -0
  14. package/dist/cjs/src/client/index.d.cts +4 -0
  15. package/dist/cjs/src/client/index.js.map +1 -1
  16. package/dist/cjs/src/client/notifications.d.cts +214 -36
  17. package/dist/cjs/src/client/plans.cjs +127 -50
  18. package/dist/cjs/src/client/plans.d.cts +129 -24
  19. package/dist/cjs/src/client/plans.js.map +1 -1
  20. package/dist/cjs/src/client/schemas.d.cts +1704 -1051
  21. package/dist/cjs/src/client/subscription-addons.cjs +70 -0
  22. package/dist/cjs/src/client/subscription-addons.d.cts +123 -0
  23. package/dist/cjs/src/client/subscription-addons.js.map +1 -0
  24. package/dist/cjs/src/client/subscriptions.cjs +16 -0
  25. package/dist/cjs/src/client/subscriptions.d.cts +23 -0
  26. package/dist/cjs/src/client/subscriptions.js.map +1 -1
  27. package/dist/cjs/src/portal/index.cjs +35 -6
  28. package/dist/cjs/src/portal/index.js.map +1 -1
  29. package/dist/cjs/src/zod/index.cjs +2929 -2975
  30. package/dist/cjs/src/zod/index.d.cts +2193 -3789
  31. package/dist/cjs/src/zod/index.js.map +1 -1
  32. package/dist/cjs/tsconfig.8e260acb.tsbuildinfo +1 -0
  33. package/dist/cjs/tsconfig.a3b81684.tsbuildinfo +1 -0
  34. package/dist/src/client/addons.d.ts +152 -0
  35. package/dist/src/client/addons.js +101 -0
  36. package/dist/src/client/addons.js.map +1 -0
  37. package/dist/src/client/billing.d.ts +32 -59
  38. package/dist/src/client/billing.js +11 -3
  39. package/dist/src/client/billing.js.map +1 -1
  40. package/dist/src/client/customers.d.ts +11 -0
  41. package/dist/src/client/customers.js +17 -0
  42. package/dist/src/client/customers.js.map +1 -1
  43. package/dist/src/client/events.d.ts +15 -4
  44. package/dist/src/client/events.js +19 -7
  45. package/dist/src/client/events.js.map +1 -1
  46. package/dist/src/client/index.d.ts +4 -0
  47. package/dist/src/client/index.js +6 -0
  48. package/dist/src/client/index.js.map +1 -1
  49. package/dist/src/client/notifications.d.ts +214 -36
  50. package/dist/src/client/plans.d.ts +129 -24
  51. package/dist/src/client/plans.js +124 -48
  52. package/dist/src/client/plans.js.map +1 -1
  53. package/dist/src/client/schemas.d.ts +1704 -1051
  54. package/dist/src/client/subscription-addons.d.ts +123 -0
  55. package/dist/src/client/subscription-addons.js +66 -0
  56. package/dist/src/client/subscription-addons.js.map +1 -0
  57. package/dist/src/client/subscriptions.d.ts +23 -0
  58. package/dist/src/client/subscriptions.js +16 -0
  59. package/dist/src/client/subscriptions.js.map +1 -1
  60. package/dist/src/portal/index.js +1 -2
  61. package/dist/src/portal/index.js.map +1 -1
  62. package/dist/src/zod/index.d.ts +2193 -3789
  63. package/dist/src/zod/index.js +2908 -2954
  64. package/dist/src/zod/index.js.map +1 -1
  65. package/dist/tsconfig.tsbuildinfo +1 -1
  66. package/orval.config.ts +11 -4
  67. package/package.json +17 -17
  68. package/dist/cjs/tsconfig.2452f99b.tsbuildinfo +0 -1
  69. package/dist/cjs/tsconfig.4cad059c.tsbuildinfo +0 -1
@@ -38,6 +38,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.OpenMeter = void 0;
40
40
  const openapi_fetch_1 = __importStar(require("openapi-fetch"));
41
+ const addons_js_1 = require("./addons.cjs");
41
42
  const apps_js_1 = require("./apps.cjs");
42
43
  const billing_js_1 = require("./billing.cjs");
43
44
  const customers_js_1 = require("./customers.cjs");
@@ -51,6 +52,7 @@ const notifications_js_1 = require("./notifications.cjs");
51
52
  const plans_js_1 = require("./plans.cjs");
52
53
  const portal_js_1 = require("./portal.cjs");
53
54
  const subjects_js_1 = require("./subjects.cjs");
55
+ const subscription_addons_js_1 = require("./subscription-addons.cjs");
54
56
  const subscriptions_js_1 = require("./subscriptions.cjs");
55
57
  const utils_js_1 = require("./utils.cjs");
56
58
  __exportStar(require("./schemas.cjs"), exports);
@@ -61,6 +63,7 @@ __exportStar(require("./common.cjs"), exports);
61
63
  class OpenMeter {
62
64
  config;
63
65
  client;
66
+ addons;
64
67
  apps;
65
68
  billing;
66
69
  customers;
@@ -74,6 +77,7 @@ class OpenMeter {
74
77
  plans;
75
78
  portal;
76
79
  subjects;
80
+ subscriptionAddons;
77
81
  subscriptions;
78
82
  constructor(config) {
79
83
  this.config = config;
@@ -94,6 +98,7 @@ class OpenMeter {
94
98
  },
95
99
  })((0, utils_js_1.encodeDates)(q)),
96
100
  });
101
+ this.addons = new addons_js_1.Addons(this.client);
97
102
  this.apps = new apps_js_1.Apps(this.client);
98
103
  this.billing = new billing_js_1.Billing(this.client);
99
104
  this.customers = new customers_js_1.Customers(this.client);
@@ -107,6 +112,7 @@ class OpenMeter {
107
112
  this.plans = new plans_js_1.Plans(this.client);
108
113
  this.portal = new portal_js_1.Portal(this.client);
109
114
  this.subjects = new subjects_js_1.Subjects(this.client);
115
+ this.subscriptionAddons = new subscription_addons_js_1.SubscriptionAddons(this.client);
110
116
  this.subscriptions = new subscriptions_js_1.Subscriptions(this.client);
111
117
  }
112
118
  }
@@ -1,4 +1,5 @@
1
1
  import { type Client, type ClientOptions } from 'openapi-fetch';
2
+ import { Addons } from './addons.cjs';
2
3
  import { Apps } from './apps.cjs';
3
4
  import { Billing } from './billing.cjs';
4
5
  import { Customers } from './customers.cjs';
@@ -12,6 +13,7 @@ import { Notifications } from './notifications.cjs';
12
13
  import { Plans } from './plans.cjs';
13
14
  import { Portal } from './portal.cjs';
14
15
  import { Subjects } from './subjects.cjs';
16
+ import { SubscriptionAddons } from './subscription-addons.cjs';
15
17
  import { Subscriptions } from './subscriptions.cjs';
16
18
  import type { paths } from './schemas.cjs';
17
19
  export * from './schemas.cjs';
@@ -31,6 +33,7 @@ export type Config = Pick<ClientOptions, 'baseUrl' | 'headers' | 'fetch' | 'Requ
31
33
  export declare class OpenMeter {
32
34
  config: Config;
33
35
  client: Client<paths, `${string}/${string}`>;
36
+ addons: Addons;
34
37
  apps: Apps;
35
38
  billing: Billing;
36
39
  customers: Customers;
@@ -44,6 +47,7 @@ export declare class OpenMeter {
44
47
  plans: Plans;
45
48
  portal: Portal;
46
49
  subjects: Subjects;
50
+ subscriptionAddons: SubscriptionAddons;
47
51
  subscriptions: Subscriptions;
48
52
  constructor(config: Config);
49
53
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/client/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+DAIsB;AACtB,uCAAgC;AAChC,6CAAsC;AACtC,iDAA0C;AAC1C,yCAAkC;AAClC,uDAAgD;AAChD,2CAAoC;AACpC,+CAAwC;AACxC,uCAAgC;AAChC,2CAAoC;AACpC,yDAAkD;AAClD,yCAAkC;AAClC,2CAAoC;AACpC,+CAAwC;AACxC,yDAAkD;AAClD,yCAAwC;AAGxC,+CAA4B;AAC5B,8CAA2B;AAmB3B;;GAEG;AACH,MAAa,SAAS;IAkBD;IAjBZ,MAAM,CAAsC;IAE5C,IAAI,CAAM;IACV,OAAO,CAAS;IAChB,SAAS,CAAW;IACpB,KAAK,CAAO;IACZ,YAAY,CAAc;I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ACjD,IAAI,CAAC,MAAM,GAAG,IAAI,kBAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACrC,IAAI,CAAC,QAAQ,GAAG,IAAI,sBAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACzC,IAAI,CAAC,IAAI,GAAG,IAAI,cAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACjC,IAAI,CAAC,MAAM,GAAG,IAAI,kBAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACrC,IAAI,CAAC,aAAa,GAAG,IAAI,gCAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACnD,IAAI,CAAC,KAAK,GAAG,IAAI,gBAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACnC,IAAI,CAAC,MAAM,GAAG,IAAI,kBAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACrC,IAAI,CAAC,QAAQ,GAAG,IAAI,sBAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACzC,IAAI,CAAC,kBAAkB,GAAG,IAAI,2CAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAC7D,IAAI,CAAC,aAAa,GAAG,IAAI,gCAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACrD,CAAC;CACF;AAzDD,8BAyDC"}
@@ -113,36 +113,152 @@ export declare class NotificationRules {
113
113
  * @param signal - An optional abort signal
114
114
  * @returns The created rule
115
115
  */
116
- create(rule: NotificationRuleCreateRequest, options?: RequestOptions): Promise<{
117
- readonly createdAt: Date;
118
- readonly updatedAt: Date;
119
- readonly deletedAt?: Date;
120
- readonly id: string;
121
- type: "entitlements.balance.threshold";
122
- name: string;
123
- disabled?: boolean;
124
- channels: import("./schemas.cjs").components["schemas"]["NotificationChannelMeta"][];
125
- thresholds: import("./schemas.cjs").components["schemas"]["NotificationRuleBalanceThresholdValue"][];
126
- features?: import("./schemas.cjs").components["schemas"]["FeatureMeta"][];
127
- }>;
116
+ create(rule: NotificationRuleCreateRequest, options?: RequestOptions): Promise<import("openapi-typescript-helpers").SuccessResponse<{
117
+ 201: {
118
+ headers: {
119
+ [name: string]: unknown;
120
+ };
121
+ content: {
122
+ "application/json": import("./schemas.cjs").components["schemas"]["NotificationRule"];
123
+ };
124
+ };
125
+ 400: {
126
+ headers: {
127
+ [name: string]: unknown;
128
+ };
129
+ content: {
130
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["BadRequestProblemResponse"];
131
+ };
132
+ };
133
+ 401: {
134
+ headers: {
135
+ [name: string]: unknown;
136
+ };
137
+ content: {
138
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["UnauthorizedProblemResponse"];
139
+ };
140
+ };
141
+ 403: {
142
+ headers: {
143
+ [name: string]: unknown;
144
+ };
145
+ content: {
146
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["ForbiddenProblemResponse"];
147
+ };
148
+ };
149
+ 412: {
150
+ headers: {
151
+ [name: string]: unknown;
152
+ };
153
+ content: {
154
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["PreconditionFailedProblemResponse"];
155
+ };
156
+ };
157
+ 500: {
158
+ headers: {
159
+ [name: string]: unknown;
160
+ };
161
+ content: {
162
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["InternalServerErrorProblemResponse"];
163
+ };
164
+ };
165
+ 503: {
166
+ headers: {
167
+ [name: string]: unknown;
168
+ };
169
+ content: {
170
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["ServiceUnavailableProblemResponse"];
171
+ };
172
+ };
173
+ default: {
174
+ headers: {
175
+ [name: string]: unknown;
176
+ };
177
+ content: {
178
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["UnexpectedProblemResponse"];
179
+ };
180
+ };
181
+ }, `${string}/${string}`>>;
128
182
  /**
129
183
  * Get a notification rule by ID
130
184
  * @param id - The ID of the notification rule
131
185
  * @param signal - An optional abort signal
132
186
  * @returns The notification rule
133
187
  */
134
- get(id: operations['getNotificationRule']['parameters']['path']['ruleId'], options?: RequestOptions): Promise<{
135
- readonly createdAt: Date;
136
- readonly updatedAt: Date;
137
- readonly deletedAt?: Date;
138
- readonly id: string;
139
- type: "entitlements.balance.threshold";
140
- name: string;
141
- disabled?: boolean;
142
- channels: import("./schemas.cjs").components["schemas"]["NotificationChannelMeta"][];
143
- thresholds: import("./schemas.cjs").components["schemas"]["NotificationRuleBalanceThresholdValue"][];
144
- features?: import("./schemas.cjs").components["schemas"]["FeatureMeta"][];
145
- }>;
188
+ get(id: operations['getNotificationRule']['parameters']['path']['ruleId'], options?: RequestOptions): Promise<import("openapi-typescript-helpers").SuccessResponse<{
189
+ 200: {
190
+ headers: {
191
+ [name: string]: unknown;
192
+ };
193
+ content: {
194
+ "application/json": import("./schemas.cjs").components["schemas"]["NotificationRule"];
195
+ };
196
+ };
197
+ 400: {
198
+ headers: {
199
+ [name: string]: unknown;
200
+ };
201
+ content: {
202
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["BadRequestProblemResponse"];
203
+ };
204
+ };
205
+ 401: {
206
+ headers: {
207
+ [name: string]: unknown;
208
+ };
209
+ content: {
210
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["UnauthorizedProblemResponse"];
211
+ };
212
+ };
213
+ 403: {
214
+ headers: {
215
+ [name: string]: unknown;
216
+ };
217
+ content: {
218
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["ForbiddenProblemResponse"];
219
+ };
220
+ };
221
+ 404: {
222
+ headers: {
223
+ [name: string]: unknown;
224
+ };
225
+ content: {
226
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["NotFoundProblemResponse"];
227
+ };
228
+ };
229
+ 412: {
230
+ headers: {
231
+ [name: string]: unknown;
232
+ };
233
+ content: {
234
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["PreconditionFailedProblemResponse"];
235
+ };
236
+ };
237
+ 500: {
238
+ headers: {
239
+ [name: string]: unknown;
240
+ };
241
+ content: {
242
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["InternalServerErrorProblemResponse"];
243
+ };
244
+ };
245
+ 503: {
246
+ headers: {
247
+ [name: string]: unknown;
248
+ };
249
+ content: {
250
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["ServiceUnavailableProblemResponse"];
251
+ };
252
+ };
253
+ default: {
254
+ headers: {
255
+ [name: string]: unknown;
256
+ };
257
+ content: {
258
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["UnexpectedProblemResponse"];
259
+ };
260
+ };
261
+ }, `${string}/${string}`>>;
146
262
  /**
147
263
  * Update a notification rule
148
264
  * @param id - The ID of the notification rule
@@ -150,18 +266,80 @@ export declare class NotificationRules {
150
266
  * @param signal - An optional abort signal
151
267
  * @returns The updated rule
152
268
  */
153
- update(id: operations['updateNotificationRule']['parameters']['path']['ruleId'], rule: NotificationRuleCreateRequest, options?: RequestOptions): Promise<{
154
- readonly createdAt: Date;
155
- readonly updatedAt: Date;
156
- readonly deletedAt?: Date;
157
- readonly id: string;
158
- type: "entitlements.balance.threshold";
159
- name: string;
160
- disabled?: boolean;
161
- channels: import("./schemas.cjs").components["schemas"]["NotificationChannelMeta"][];
162
- thresholds: import("./schemas.cjs").components["schemas"]["NotificationRuleBalanceThresholdValue"][];
163
- features?: import("./schemas.cjs").components["schemas"]["FeatureMeta"][];
164
- }>;
269
+ update(id: operations['updateNotificationRule']['parameters']['path']['ruleId'], rule: NotificationRuleCreateRequest, options?: RequestOptions): Promise<import("openapi-typescript-helpers").SuccessResponse<{
270
+ 200: {
271
+ headers: {
272
+ [name: string]: unknown;
273
+ };
274
+ content: {
275
+ "application/json": import("./schemas.cjs").components["schemas"]["NotificationRule"];
276
+ };
277
+ };
278
+ 400: {
279
+ headers: {
280
+ [name: string]: unknown;
281
+ };
282
+ content: {
283
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["BadRequestProblemResponse"];
284
+ };
285
+ };
286
+ 401: {
287
+ headers: {
288
+ [name: string]: unknown;
289
+ };
290
+ content: {
291
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["UnauthorizedProblemResponse"];
292
+ };
293
+ };
294
+ 403: {
295
+ headers: {
296
+ [name: string]: unknown;
297
+ };
298
+ content: {
299
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["ForbiddenProblemResponse"];
300
+ };
301
+ };
302
+ 404: {
303
+ headers: {
304
+ [name: string]: unknown;
305
+ };
306
+ content: {
307
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["NotFoundProblemResponse"];
308
+ };
309
+ };
310
+ 412: {
311
+ headers: {
312
+ [name: string]: unknown;
313
+ };
314
+ content: {
315
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["PreconditionFailedProblemResponse"];
316
+ };
317
+ };
318
+ 500: {
319
+ headers: {
320
+ [name: string]: unknown;
321
+ };
322
+ content: {
323
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["InternalServerErrorProblemResponse"];
324
+ };
325
+ };
326
+ 503: {
327
+ headers: {
328
+ [name: string]: unknown;
329
+ };
330
+ content: {
331
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["ServiceUnavailableProblemResponse"];
332
+ };
333
+ };
334
+ default: {
335
+ headers: {
336
+ [name: string]: unknown;
337
+ };
338
+ content: {
339
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["UnexpectedProblemResponse"];
340
+ };
341
+ };
342
+ }, `${string}/${string}`>>;
165
343
  /**
166
344
  * List notification rules
167
345
  * @param query - The query parameters
@@ -1,16 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Plans = void 0;
3
+ exports.PlanAddons = exports.Plans = void 0;
4
4
  const utils_js_1 = require("./utils.cjs");
5
+ /**
6
+ * Plans
7
+ * Manage customer subscription plans and addon assignments.
8
+ */
5
9
  class Plans {
6
10
  client;
11
+ addons;
7
12
  constructor(client) {
8
13
  this.client = client;
14
+ this.addons = new PlanAddons(this.client);
9
15
  }
10
16
  /**
11
17
  * Create a plan
12
18
  * @param plan - The plan to create
13
- * @param signal - An optional abort signal
19
+ * @param options - Optional request options
14
20
  * @returns The created plan
15
21
  */
16
22
  async create(plan, options) {
@@ -21,17 +27,17 @@ class Plans {
21
27
  return (0, utils_js_1.transformResponse)(resp);
22
28
  }
23
29
  /**
24
- * Get a plan by ID or key
25
- * @param idOrKey - The ID or key of the plan
26
- * @param signal - An optional abort signal
30
+ * Get a plan by ID
31
+ * @param planId - The ID of the plan to retrieve
32
+ * @param params - Optional query parameters
33
+ * @param options - Optional request options
27
34
  * @returns The plan
28
35
  */
29
- async get(id, options) {
36
+ async get(planId, params, options) {
30
37
  const resp = await this.client.GET('/api/v1/plans/{planId}', {
31
38
  params: {
32
- path: {
33
- planId: id,
34
- },
39
+ path: { planId },
40
+ query: params,
35
41
  },
36
42
  ...options,
37
43
  });
@@ -39,89 +45,160 @@ class Plans {
39
45
  }
40
46
  /**
41
47
  * List plans
42
- * @param query - The query parameters
43
- * @param signal - An optional abort signal
44
- * @returns The list of plans
48
+ * @param params - Optional parameters for listing plans
49
+ * @param options - Optional request options
50
+ * @returns A list of plans
45
51
  */
46
- async list(query, options) {
52
+ async list(params, options) {
47
53
  const resp = await this.client.GET('/api/v1/plans', {
48
- params: {
49
- query,
50
- },
54
+ params: { query: params },
51
55
  ...options,
52
56
  });
53
57
  return (0, utils_js_1.transformResponse)(resp);
54
58
  }
55
59
  /**
56
60
  * Update a plan
57
- * @param id - The ID of the plan
58
- * @param plan - The plan to update
59
- * @param signal - An optional abort signal
61
+ * @param planId - The ID of the plan to update
62
+ * @param plan - The plan data to update
63
+ * @param options - Optional request options
60
64
  * @returns The updated plan
61
65
  */
62
- async update(id, plan, options) {
66
+ async update(planId, plan, options) {
63
67
  const resp = await this.client.PUT('/api/v1/plans/{planId}', {
64
68
  body: plan,
65
- params: {
66
- path: {
67
- planId: id,
68
- },
69
- },
69
+ params: { path: { planId } },
70
70
  ...options,
71
71
  });
72
72
  return (0, utils_js_1.transformResponse)(resp);
73
73
  }
74
74
  /**
75
- * Delete a plan
76
- * @param id - The ID of the plan
77
- * @param signal - An optional abort signal
78
- * @returns The deleted plan
75
+ * Delete a plan by ID
76
+ * @param planId - The ID of the plan to delete
77
+ * @param options - Optional request options
78
+ * @returns void or standard error response structure
79
79
  */
80
- async delete(id, options) {
80
+ async delete(planId, options) {
81
81
  const resp = await this.client.DELETE('/api/v1/plans/{planId}', {
82
- params: {
83
- path: {
84
- planId: id,
85
- },
86
- },
82
+ params: { path: { planId } },
87
83
  ...options,
88
84
  });
89
85
  return (0, utils_js_1.transformResponse)(resp);
90
86
  }
91
87
  /**
92
88
  * Archive a plan
93
- * @param id - The ID of the plan
94
- * @param signal - An optional abort signal
89
+ * @param planId - The ID of the plan to archive
90
+ * @param options - Optional request options
95
91
  * @returns The archived plan
96
92
  */
97
- async archive(id, options) {
93
+ async archive(planId, options) {
98
94
  const resp = await this.client.POST('/api/v1/plans/{planId}/archive', {
99
- params: {
100
- path: {
101
- planId: id,
102
- },
103
- },
95
+ params: { path: { planId } },
104
96
  ...options,
105
97
  });
106
98
  return (0, utils_js_1.transformResponse)(resp);
107
99
  }
108
100
  /**
109
101
  * Publish a plan
110
- * @param id - The ID of the plan
111
- * @param signal - An optional abort signal
102
+ * @param planId - The ID of the plan to publish
103
+ * @param options - Optional request options
112
104
  * @returns The published plan
113
105
  */
114
- async publish(id, options) {
106
+ async publish(planId, options) {
115
107
  const resp = await this.client.POST('/api/v1/plans/{planId}/publish', {
108
+ params: { path: { planId } },
109
+ ...options,
110
+ });
111
+ return (0, utils_js_1.transformResponse)(resp);
112
+ }
113
+ }
114
+ exports.Plans = Plans;
115
+ /**
116
+ * Plan Addons
117
+ * Manage addon assignments for plans.
118
+ */
119
+ class PlanAddons {
120
+ client;
121
+ constructor(client) {
122
+ this.client = client;
123
+ }
124
+ /**
125
+ * List plan addons
126
+ * @param planId - The ID of the plan
127
+ * @param params - Optional query parameters
128
+ * @param options - Optional request options
129
+ * @returns A list of plan addons
130
+ */
131
+ async list(planId, params, options) {
132
+ const resp = await this.client.GET('/api/v1/plans/{planId}/addons', {
116
133
  params: {
117
- path: {
118
- planId: id,
119
- },
134
+ path: { planId },
135
+ query: params,
120
136
  },
121
137
  ...options,
122
138
  });
123
139
  return (0, utils_js_1.transformResponse)(resp);
124
140
  }
141
+ /**
142
+ * Create a plan addon
143
+ * @param planId - The ID of the plan
144
+ * @param planAddon - The plan addon to create
145
+ * @param options - Optional request options
146
+ * @returns The created plan addon
147
+ */
148
+ async create(planId, planAddon, options) {
149
+ const resp = await this.client.POST('/api/v1/plans/{planId}/addons', {
150
+ body: planAddon,
151
+ params: { path: { planId } },
152
+ ...options,
153
+ });
154
+ return (0, utils_js_1.transformResponse)(resp);
155
+ }
156
+ /**
157
+ * Get a plan addon by ID
158
+ * @param planId - The ID of the plan
159
+ * @param planAddonId - The ID of the plan addon
160
+ * @param options - Optional request options
161
+ * @returns The plan addon
162
+ */
163
+ async get(planId, planAddonId, options) {
164
+ const resp = await this.client.GET('/api/v1/plans/{planId}/addons/{planAddonId}', {
165
+ params: {
166
+ path: { planAddonId, planId },
167
+ },
168
+ ...options,
169
+ });
170
+ return (0, utils_js_1.transformResponse)(resp);
171
+ }
172
+ /**
173
+ * Update a plan addon
174
+ * @param planId - The ID of the plan
175
+ * @param planAddonId - The ID of the plan addon to update
176
+ * @param planAddon - The plan addon data to update
177
+ * @param options - Optional request options
178
+ * @returns The updated plan addon
179
+ */
180
+ async update(planId, planAddonId, planAddon, options) {
181
+ const resp = await this.client.PUT('/api/v1/plans/{planId}/addons/{planAddonId}', {
182
+ body: planAddon,
183
+ params: { path: { planAddonId, planId } },
184
+ ...options,
185
+ });
186
+ return (0, utils_js_1.transformResponse)(resp);
187
+ }
188
+ /**
189
+ * Delete a plan addon by ID
190
+ * @param planId - The ID of the plan
191
+ * @param planAddonId - The ID of the plan addon to delete
192
+ * @param options - Optional request options
193
+ * @returns void or standard error response structure
194
+ */
195
+ async delete(planId, planAddonId, options) {
196
+ const resp = await this.client.DELETE('/api/v1/plans/{planId}/addons/{planAddonId}', {
197
+ params: { path: { planAddonId, planId } },
198
+ ...options,
199
+ });
200
+ return (0, utils_js_1.transformResponse)(resp);
201
+ }
125
202
  }
126
- exports.Plans = Plans;
203
+ exports.PlanAddons = PlanAddons;
127
204
  //# sourceMappingURL=plans.js.map