@openmeter/sdk 1.0.0-beta-68e509d89485 → 1.0.0-beta-d7c858bf3710

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 (36) hide show
  1. package/dist/cjs/src/client/addons.cjs +105 -0
  2. package/dist/cjs/src/client/addons.d.cts +147 -0
  3. package/dist/cjs/src/client/addons.js.map +1 -0
  4. package/dist/cjs/src/client/entitlements.d.cts +1 -1
  5. package/dist/cjs/src/client/index.cjs +6 -0
  6. package/dist/cjs/src/client/index.d.cts +4 -0
  7. package/dist/cjs/src/client/index.js.map +1 -1
  8. package/dist/cjs/src/client/notifications.d.cts +2 -2
  9. package/dist/cjs/src/client/schemas.d.cts +20 -20
  10. package/dist/cjs/src/client/subscription-addons.cjs +70 -0
  11. package/dist/cjs/src/client/subscription-addons.d.cts +123 -0
  12. package/dist/cjs/src/client/subscription-addons.js.map +1 -0
  13. package/dist/cjs/src/portal/index.cjs +35 -6
  14. package/dist/cjs/src/portal/index.js.map +1 -1
  15. package/dist/cjs/src/zod/index.d.cts +1996 -1996
  16. package/dist/cjs/tsconfig.38c40c16.tsbuildinfo +1 -0
  17. package/dist/cjs/tsconfig.a243a3bf.tsbuildinfo +1 -0
  18. package/dist/src/client/addons.d.ts +147 -0
  19. package/dist/src/client/addons.js +101 -0
  20. package/dist/src/client/addons.js.map +1 -0
  21. package/dist/src/client/entitlements.d.ts +1 -1
  22. package/dist/src/client/index.d.ts +4 -0
  23. package/dist/src/client/index.js +6 -0
  24. package/dist/src/client/index.js.map +1 -1
  25. package/dist/src/client/notifications.d.ts +2 -2
  26. package/dist/src/client/schemas.d.ts +20 -20
  27. package/dist/src/client/subscription-addons.d.ts +123 -0
  28. package/dist/src/client/subscription-addons.js +66 -0
  29. package/dist/src/client/subscription-addons.js.map +1 -0
  30. package/dist/src/portal/index.js +1 -2
  31. package/dist/src/portal/index.js.map +1 -1
  32. package/dist/src/zod/index.d.ts +1996 -1996
  33. package/dist/tsconfig.tsbuildinfo +1 -1
  34. package/package.json +18 -18
  35. package/dist/cjs/tsconfig.4948a0ec.tsbuildinfo +0 -1
  36. package/dist/cjs/tsconfig.f8b75769.tsbuildinfo +0 -1
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Addons = void 0;
4
+ const utils_js_1 = require("./utils.cjs");
5
+ class Addons {
6
+ client;
7
+ constructor(client) {
8
+ this.client = client;
9
+ }
10
+ /**
11
+ * Create a addon
12
+ * @param addon - The addon to create
13
+ * @param options - Optional request options
14
+ * @returns The created addon
15
+ */
16
+ async create(addon, options) {
17
+ const resp = await this.client.POST('/api/v1/addons', {
18
+ body: addon,
19
+ ...options,
20
+ });
21
+ return (0, utils_js_1.transformResponse)(resp);
22
+ }
23
+ /**
24
+ * List addons
25
+ * @param params - Optional parameters for listing addons
26
+ * @param options - Optional request options
27
+ * @returns A list of addons
28
+ */
29
+ async list(params, options) {
30
+ const resp = await this.client.GET('/api/v1/addons', {
31
+ params: { query: params },
32
+ ...options,
33
+ });
34
+ return (0, utils_js_1.transformResponse)(resp);
35
+ }
36
+ /**
37
+ * Get an addon by ID
38
+ * @param addonId - The ID of the addon to retrieve
39
+ * @param options - Optional request options
40
+ * @returns The addon
41
+ */
42
+ async get(addonId, options) {
43
+ const resp = await this.client.GET('/api/v1/addons/{addonId}', {
44
+ params: { path: { addonId } },
45
+ ...options,
46
+ });
47
+ return (0, utils_js_1.transformResponse)(resp);
48
+ }
49
+ /**
50
+ * Update an addon
51
+ * @param addonId - The ID of the addon to update
52
+ * @param addon - The addon data to update
53
+ * @param options - Optional request options
54
+ * @returns The updated addon
55
+ */
56
+ async update(addonId, addon, options) {
57
+ const resp = await this.client.PUT('/api/v1/addons/{addonId}', {
58
+ body: addon,
59
+ params: { path: { addonId } },
60
+ ...options,
61
+ });
62
+ return (0, utils_js_1.transformResponse)(resp);
63
+ }
64
+ /**
65
+ * Delete an addon by ID
66
+ * @param addonId - The ID of the addon to delete
67
+ * @param options - Optional request options
68
+ * @returns void or standard error response structure
69
+ */
70
+ async delete(addonId, options) {
71
+ const resp = await this.client.DELETE('/api/v1/addons/{addonId}', {
72
+ params: { path: { addonId } },
73
+ ...options,
74
+ });
75
+ return (0, utils_js_1.transformResponse)(resp);
76
+ }
77
+ /**
78
+ * Publish an addon
79
+ * @param addonId - The ID of the addon to publish
80
+ * @param options - Optional request options
81
+ * @returns The published addon
82
+ */
83
+ async publish(addonId, options) {
84
+ const resp = await this.client.POST('/api/v1/addons/{addonId}/publish', {
85
+ params: { path: { addonId } },
86
+ ...options,
87
+ });
88
+ return (0, utils_js_1.transformResponse)(resp);
89
+ }
90
+ /**
91
+ * Archive an addon
92
+ * @param addonId - The ID of the addon to archive
93
+ * @param options - Optional request options
94
+ * @returns The archived addon
95
+ */
96
+ async archive(addonId, options) {
97
+ const resp = await this.client.POST('/api/v1/addons/{addonId}/archive', {
98
+ params: { path: { addonId } },
99
+ ...options,
100
+ });
101
+ return (0, utils_js_1.transformResponse)(resp);
102
+ }
103
+ }
104
+ exports.Addons = Addons;
105
+ //# sourceMappingURL=addons.js.map
@@ -0,0 +1,147 @@
1
+ import type { RequestOptions } from './common.cjs';
2
+ import type { paths, AddonCreate, operations } from './schemas.cjs';
3
+ import type { Client } from 'openapi-fetch';
4
+ export declare class Addons {
5
+ private client;
6
+ constructor(client: Client<paths, `${string}/${string}`>);
7
+ /**
8
+ * Create a addon
9
+ * @param addon - The addon to create
10
+ * @param options - Optional request options
11
+ * @returns The created addon
12
+ */
13
+ create(addon: AddonCreate, options?: RequestOptions): Promise<{
14
+ readonly id: string;
15
+ name: string;
16
+ description?: string;
17
+ metadata?: import("./schemas.cjs").components["schemas"]["Metadata"] | null;
18
+ readonly createdAt: Date;
19
+ readonly updatedAt: Date;
20
+ readonly deletedAt?: Date;
21
+ key: string;
22
+ readonly annotations?: import("./schemas.cjs").components["schemas"]["Annotations"];
23
+ readonly version: number;
24
+ instanceType: import("./schemas.cjs").components["schemas"]["AddonInstanceType"];
25
+ currency: import("./schemas.cjs").components["schemas"]["CurrencyCode"];
26
+ readonly effectiveFrom?: Date;
27
+ readonly effectiveTo?: Date;
28
+ readonly status: import("./schemas.cjs").components["schemas"]["AddonStatus"];
29
+ rateCards: import("./schemas.cjs").components["schemas"]["RateCard"][];
30
+ }>;
31
+ /**
32
+ * List addons
33
+ * @param params - Optional parameters for listing addons
34
+ * @param options - Optional request options
35
+ * @returns A list of addons
36
+ */
37
+ list(params?: operations['listAddons']['parameters']['query'], options?: RequestOptions): Promise<{
38
+ totalCount: number;
39
+ page: number;
40
+ pageSize: number;
41
+ items: import("./schemas.cjs").components["schemas"]["Addon"][];
42
+ }>;
43
+ /**
44
+ * Get an addon by ID
45
+ * @param addonId - The ID of the addon to retrieve
46
+ * @param options - Optional request options
47
+ * @returns The addon
48
+ */
49
+ get(addonId: string, options?: RequestOptions): Promise<{
50
+ readonly id: string;
51
+ name: string;
52
+ description?: string;
53
+ metadata?: import("./schemas.cjs").components["schemas"]["Metadata"] | null;
54
+ readonly createdAt: Date;
55
+ readonly updatedAt: Date;
56
+ readonly deletedAt?: Date;
57
+ key: string;
58
+ readonly annotations?: import("./schemas.cjs").components["schemas"]["Annotations"];
59
+ readonly version: number;
60
+ instanceType: import("./schemas.cjs").components["schemas"]["AddonInstanceType"];
61
+ currency: import("./schemas.cjs").components["schemas"]["CurrencyCode"];
62
+ readonly effectiveFrom?: Date;
63
+ readonly effectiveTo?: Date;
64
+ readonly status: import("./schemas.cjs").components["schemas"]["AddonStatus"];
65
+ rateCards: import("./schemas.cjs").components["schemas"]["RateCard"][];
66
+ }>;
67
+ /**
68
+ * Update an addon
69
+ * @param addonId - The ID of the addon to update
70
+ * @param addon - The addon data to update
71
+ * @param options - Optional request options
72
+ * @returns The updated addon
73
+ */
74
+ update(addonId: string, addon: operations['updateAddon']['requestBody']['content']['application/json'], options?: RequestOptions): Promise<{
75
+ readonly id: string;
76
+ name: string;
77
+ description?: string;
78
+ metadata?: import("./schemas.cjs").components["schemas"]["Metadata"] | null;
79
+ readonly createdAt: Date;
80
+ readonly updatedAt: Date;
81
+ readonly deletedAt?: Date;
82
+ key: string;
83
+ readonly annotations?: import("./schemas.cjs").components["schemas"]["Annotations"];
84
+ readonly version: number;
85
+ instanceType: import("./schemas.cjs").components["schemas"]["AddonInstanceType"];
86
+ currency: import("./schemas.cjs").components["schemas"]["CurrencyCode"];
87
+ readonly effectiveFrom?: Date;
88
+ readonly effectiveTo?: Date;
89
+ readonly status: import("./schemas.cjs").components["schemas"]["AddonStatus"];
90
+ rateCards: import("./schemas.cjs").components["schemas"]["RateCard"][];
91
+ }>;
92
+ /**
93
+ * Delete an addon by ID
94
+ * @param addonId - The ID of the addon to delete
95
+ * @param options - Optional request options
96
+ * @returns void or standard error response structure
97
+ */
98
+ delete(addonId: string, options?: RequestOptions): Promise<undefined>;
99
+ /**
100
+ * Publish an addon
101
+ * @param addonId - The ID of the addon to publish
102
+ * @param options - Optional request options
103
+ * @returns The published addon
104
+ */
105
+ publish(addonId: string, options?: RequestOptions): Promise<{
106
+ readonly id: string;
107
+ name: string;
108
+ description?: string;
109
+ metadata?: import("./schemas.cjs").components["schemas"]["Metadata"] | null;
110
+ readonly createdAt: Date;
111
+ readonly updatedAt: Date;
112
+ readonly deletedAt?: Date;
113
+ key: string;
114
+ readonly annotations?: import("./schemas.cjs").components["schemas"]["Annotations"];
115
+ readonly version: number;
116
+ instanceType: import("./schemas.cjs").components["schemas"]["AddonInstanceType"];
117
+ currency: import("./schemas.cjs").components["schemas"]["CurrencyCode"];
118
+ readonly effectiveFrom?: Date;
119
+ readonly effectiveTo?: Date;
120
+ readonly status: import("./schemas.cjs").components["schemas"]["AddonStatus"];
121
+ rateCards: import("./schemas.cjs").components["schemas"]["RateCard"][];
122
+ }>;
123
+ /**
124
+ * Archive an addon
125
+ * @param addonId - The ID of the addon to archive
126
+ * @param options - Optional request options
127
+ * @returns The archived addon
128
+ */
129
+ archive(addonId: string, options?: RequestOptions): Promise<{
130
+ readonly id: string;
131
+ name: string;
132
+ description?: string;
133
+ metadata?: import("./schemas.cjs").components["schemas"]["Metadata"] | null;
134
+ readonly createdAt: Date;
135
+ readonly updatedAt: Date;
136
+ readonly deletedAt?: Date;
137
+ key: string;
138
+ readonly annotations?: import("./schemas.cjs").components["schemas"]["Annotations"];
139
+ readonly version: number;
140
+ instanceType: import("./schemas.cjs").components["schemas"]["AddonInstanceType"];
141
+ currency: import("./schemas.cjs").components["schemas"]["CurrencyCode"];
142
+ readonly effectiveFrom?: Date;
143
+ readonly effectiveTo?: Date;
144
+ readonly status: import("./schemas.cjs").components["schemas"]["AddonStatus"];
145
+ rateCards: import("./schemas.cjs").components["schemas"]["RateCard"][];
146
+ }>;
147
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addons.js","sourceRoot":"","sources":["../../../../src/client/addons.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAK9C,MAAa,MAAM;IACG;IAApB,YAAoB,MAA4C;QAA5C,WAAM,GAAN,MAAM,CAAsC;IAAG,CAAC;IAEpE;;;;;OAKG;IACI,KAAK,CAAC,MAAM,CAAC,KAAkB,EAAE,OAAwB;QAC9D,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAAE;YACpD,IAAI,EAAE,KAAK;YACX,GAAG,OAAO;SACX,CAAC,CAAA;QAEF,OAAO,IAAA,4BAAiB,EAAC,IAAI,CAAC,CAAA;IAChC,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,IAAI,CACf,MAAwD,EACxD,OAAwB;QAExB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,gBAAgB,EAAE;YACnD,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;YACzB,GAAG,OAAO;SACX,CAAC,CAAA;QAEF,OAAO,IAAA,4BAAiB,EAAC,IAAI,CAAC,CAAA;IAChC,CAA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,CAAC,CAAA;IAChC,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,OAAO,CAAC,OAAe,EAAE,OAAwB;QAC5D,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,kCAAkC,EAAE;YACtE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE;YAC7B,GAAG,OAAO;SACX,CAAC,CAAA;QAEF,OAAO,IAAA,4BAAiB,EAAC,IAAI,CAAC,CAAA;IAChC,CAAC;CACF;AApHD,wBAoHC"}
@@ -257,9 +257,9 @@ export declare class Entitlements {
257
257
  usagePeriod?: import("./schemas.cjs").components["schemas"]["RecurringPeriod"];
258
258
  } & {
259
259
  readonly id: string;
260
+ type: import("./schemas.cjs").components["schemas"]["EntitlementType"];
260
261
  readonly createdAt: Date;
261
262
  readonly updatedAt: Date;
262
- type: import("./schemas.cjs").components["schemas"]["EntitlementType"];
263
263
  activeFrom: Date;
264
264
  subjectKey: string;
265
265
  featureKey: string;
@@ -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;IAC1B,MAAM,CAAQ;IACd,QAAQ,CAAU;IAClB,IAAI,CAAM;IACV,MAAM,CAAQ;IACd,aAAa,CAAe;IAC5B,KAAK,CAAO;IACZ,MAAM,CAAQ;IACd,QAAQ,CAAU;IAClB,aAAa,CAAe;IAEnC,YAAmB,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QAC/B,IAAI,CAAC,MAAM,GAAG,IAAA,uBAAY,EAAQ;YAChC,GAAG,MAAM;YACT,OAAO,EAAE;gBACP,GAAG,MAAM,CAAC,OAAO;gBACjB,aAAa,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS;aACrE;YACD,eAAe,EAAE,CAAC,CAAC,EAAE,EAAE,CACrB,IAAA,qCAAqB,EAAC;gBACpB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AC,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"}
@@ -377,9 +377,9 @@ export declare class NotificationEvents {
377
377
  readonly id: string;
378
378
  readonly type: import("./schemas.cjs").components["schemas"]["NotificationEventType"];
379
379
  readonly createdAt: Date;
380
- readonly rule: import("./schemas.cjs").components["schemas"]["NotificationRule"];
380
+ readonly rule: Omit<import("./schemas.cjs").components["schemas"]["NotificationRule"], "type">;
381
381
  readonly deliveryStatus: import("./schemas.cjs").components["schemas"]["NotificationEventDeliveryStatus"][];
382
- readonly payload: import("./schemas.cjs").components["schemas"]["NotificationEventPayload"];
382
+ readonly payload: Omit<import("./schemas.cjs").components["schemas"]["NotificationEventPayload"], "type">;
383
383
  readonly annotations?: import("./schemas.cjs").components["schemas"]["Annotations"];
384
384
  }>;
385
385
  /**
@@ -2539,11 +2539,11 @@ export interface components {
2539
2539
  /** @description BillingProfileApps represents the applications used by a billing profile */
2540
2540
  BillingProfileApps: {
2541
2541
  /** @description The tax app used for this workflow */
2542
- readonly tax: components['schemas']['App'];
2542
+ readonly tax: Omit<components['schemas']['App'], 'type'>;
2543
2543
  /** @description The invoicing app used for this workflow */
2544
- readonly invoicing: components['schemas']['App'];
2544
+ readonly invoicing: Omit<components['schemas']['App'], 'type'>;
2545
2545
  /** @description The payment app used for this workflow */
2546
- readonly payment: components['schemas']['App'];
2546
+ readonly payment: Omit<components['schemas']['App'], 'type'>;
2547
2547
  };
2548
2548
  /** @description BillingProfileAppsCreate represents the input for creating a billing profile's apps */
2549
2549
  BillingProfileAppsCreate: {
@@ -5539,7 +5539,7 @@ export interface components {
5539
5539
  */
5540
5540
  readonly id: string;
5541
5541
  /** @description Reason code. */
5542
- readonly reason: components['schemas']['BillingDiscountReason'];
5542
+ readonly reason: Omit<components['schemas']['BillingDiscountReason'], 'type'>;
5543
5543
  /** @description Text description as to why the discount was applied. */
5544
5544
  readonly description?: string;
5545
5545
  /** @description External IDs of the invoice in other apps such as Stripe. */
@@ -5641,7 +5641,7 @@ export interface components {
5641
5641
  */
5642
5642
  readonly id: string;
5643
5643
  /** @description Reason code. */
5644
- readonly reason: components['schemas']['BillingDiscountReason'];
5644
+ readonly reason: Omit<components['schemas']['BillingDiscountReason'], 'type'>;
5645
5645
  /** @description Text description as to why the discount was applied. */
5646
5646
  readonly description?: string;
5647
5647
  /** @description External IDs of the invoice in other apps such as Stripe. */
@@ -5906,7 +5906,7 @@ export interface components {
5906
5906
  * @deprecated
5907
5907
  * @description Price of the usage-based item being sold.
5908
5908
  */
5909
- price?: components['schemas']['RateCardUsageBasedPrice'];
5909
+ price?: Omit<components['schemas']['RateCardUsageBasedPrice'], 'type'>;
5910
5910
  /**
5911
5911
  * @deprecated
5912
5912
  * @description The feature that the usage is based on.
@@ -6064,7 +6064,7 @@ export interface components {
6064
6064
  * @deprecated
6065
6065
  * @description Price of the usage-based item being sold.
6066
6066
  */
6067
- price?: components['schemas']['RateCardUsageBasedPrice'];
6067
+ price?: Omit<components['schemas']['RateCardUsageBasedPrice'], 'type'>;
6068
6068
  /**
6069
6069
  * @deprecated
6070
6070
  * @description The feature that the usage is based on.
@@ -6134,7 +6134,7 @@ export interface components {
6134
6134
  * @deprecated
6135
6135
  * @description Price of the usage-based item being sold.
6136
6136
  */
6137
- price?: components['schemas']['RateCardUsageBasedPrice'];
6137
+ price?: Omit<components['schemas']['RateCardUsageBasedPrice'], 'type'>;
6138
6138
  /**
6139
6139
  * @deprecated
6140
6140
  * @description The feature that the usage is based on.
@@ -6191,7 +6191,7 @@ export interface components {
6191
6191
  * @deprecated
6192
6192
  * @description Price of the usage-based item being sold.
6193
6193
  */
6194
- price?: components['schemas']['RateCardUsageBasedPrice'];
6194
+ price?: Omit<components['schemas']['RateCardUsageBasedPrice'], 'type'>;
6195
6195
  /**
6196
6196
  * @deprecated
6197
6197
  * @description The feature that the usage is based on.
@@ -6217,7 +6217,7 @@ export interface components {
6217
6217
  taxConfig?: components['schemas']['TaxConfig'];
6218
6218
  /** @description The price of the rate card.
6219
6219
  * When null, the feature or service is free. */
6220
- price: components['schemas']['RateCardUsageBasedPrice'] | null;
6220
+ price: Omit<components['schemas']['RateCardUsageBasedPrice'], 'type'> | null;
6221
6221
  /** @description The discounts that are applied to the line. */
6222
6222
  discounts?: components['schemas']['BillingDiscounts'];
6223
6223
  };
@@ -6956,14 +6956,14 @@ export interface components {
6956
6956
  */
6957
6957
  readonly createdAt: Date;
6958
6958
  /** @description The nnotification rule which generated this event. */
6959
- readonly rule: components['schemas']['NotificationRule'];
6959
+ readonly rule: Omit<components['schemas']['NotificationRule'], 'type'>;
6960
6960
  /**
6961
6961
  * Delivery Status
6962
6962
  * @description The delivery status of the notification event.
6963
6963
  */
6964
6964
  readonly deliveryStatus: components['schemas']['NotificationEventDeliveryStatus'][];
6965
6965
  /** @description Timestamp when the notification event was created in RFC 3339 format. */
6966
- readonly payload: components['schemas']['NotificationEventPayload'];
6966
+ readonly payload: Omit<components['schemas']['NotificationEventPayload'], 'type'>;
6967
6967
  /**
6968
6968
  * Annotations
6969
6969
  * @description Set of key-value pairs managed by the system. Cannot be modified by user.
@@ -8213,7 +8213,7 @@ export interface components {
8213
8213
  featureKey?: string;
8214
8214
  /** @description The entitlement of the rate card.
8215
8215
  * Only available when featureKey is set. */
8216
- entitlementTemplate?: components['schemas']['RateCardEntitlement'];
8216
+ entitlementTemplate?: Omit<components['schemas']['RateCardEntitlement'], 'type'>;
8217
8217
  /**
8218
8218
  * Tax config
8219
8219
  * @description The tax config of the rate card.
@@ -8340,7 +8340,7 @@ export interface components {
8340
8340
  featureKey?: string;
8341
8341
  /** @description The entitlement of the rate card.
8342
8342
  * Only available when featureKey is set. */
8343
- entitlementTemplate?: components['schemas']['RateCardEntitlement'];
8343
+ entitlementTemplate?: Omit<components['schemas']['RateCardEntitlement'], 'type'>;
8344
8344
  /**
8345
8345
  * Tax config
8346
8346
  * @description The tax config of the rate card.
@@ -8355,7 +8355,7 @@ export interface components {
8355
8355
  billingCadence: string;
8356
8356
  /** @description The price of the rate card.
8357
8357
  * When null, the feature or service is free. */
8358
- price: components['schemas']['RateCardUsageBasedPrice'] | null;
8358
+ price: Omit<components['schemas']['RateCardUsageBasedPrice'], 'type'> | null;
8359
8359
  /**
8360
8360
  * Discounts
8361
8361
  * @description The discounts of the rate card.
@@ -9149,7 +9149,7 @@ export interface components {
9149
9149
  * Rate card
9150
9150
  * @description The rate card.
9151
9151
  */
9152
- rateCard: components['schemas']['RateCard'];
9152
+ rateCard: Omit<components['schemas']['RateCard'], 'type'>;
9153
9153
  /**
9154
9154
  * Affected subscription item IDs
9155
9155
  * @description The IDs of the subscription items that this rate card belongs to.
@@ -9400,7 +9400,7 @@ export interface components {
9400
9400
  * When null, the feature or service is free.
9401
9401
  * @example {}
9402
9402
  */
9403
- price: components['schemas']['RateCardUsageBasedPrice'] | null;
9403
+ price: Omit<components['schemas']['RateCardUsageBasedPrice'], 'type'> | null;
9404
9404
  /**
9405
9405
  * Discounts
9406
9406
  * @description The discounts applied to the rate card.
@@ -9420,7 +9420,7 @@ export interface components {
9420
9420
  /** @description The feature the customer is entitled to use. */
9421
9421
  feature: components['schemas']['Feature'];
9422
9422
  /** @description The entitlement of the Subscription Item. */
9423
- entitlement?: components['schemas']['Entitlement'];
9423
+ entitlement?: Omit<components['schemas']['Entitlement'], 'type'>;
9424
9424
  };
9425
9425
  /** @description Paginated response */
9426
9426
  SubscriptionPaginatedResponse: {
@@ -9769,14 +9769,14 @@ export interface components {
9769
9769
  /** @description How much of the total line items to be voided? (e.g. 100% means all charges are voided) */
9770
9770
  percentage: components['schemas']['Percentage'];
9771
9771
  /** @description The action to take on the line items. */
9772
- action: components['schemas']['VoidInvoiceLineActionCreate'];
9772
+ action: Omit<components['schemas']['VoidInvoiceLineActionCreate'], 'type'>;
9773
9773
  };
9774
9774
  /** @description InvoiceVoidAction describes how to handle the voided line items. */
9775
9775
  VoidInvoiceActionCreateItem: {
9776
9776
  /** @description How much of the total line items to be voided? (e.g. 100% means all charges are voided) */
9777
9777
  percentage: components['schemas']['Percentage'];
9778
9778
  /** @description The action to take on the line items. */
9779
- action: components['schemas']['VoidInvoiceLineActionCreateItem'];
9779
+ action: Omit<components['schemas']['VoidInvoiceLineActionCreateItem'], 'type'>;
9780
9780
  };
9781
9781
  /** @description Request to void an invoice */
9782
9782
  VoidInvoiceActionInput: {
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SubscriptionAddons = void 0;
4
+ const utils_js_1 = require("./utils.cjs");
5
+ class SubscriptionAddons {
6
+ client;
7
+ constructor(client) {
8
+ this.client = client;
9
+ }
10
+ /**
11
+ * Create a new subscription addon
12
+ * @param subscriptionId - The ID of the subscription
13
+ * @param addon - The subscription addon to create
14
+ * @param options - Optional request options
15
+ * @returns The created subscription addon
16
+ */
17
+ async create(subscriptionId, addon, options) {
18
+ const resp = await this.client.POST('/api/v1/subscriptions/{subscriptionId}/addons', {
19
+ body: addon,
20
+ params: { path: { subscriptionId } },
21
+ ...options,
22
+ });
23
+ return (0, utils_js_1.transformResponse)(resp);
24
+ }
25
+ /**
26
+ * List all addons of a subscription
27
+ * @param subscriptionId - The ID of the subscription
28
+ * @param options - Optional request options
29
+ * @returns A list of subscription addons
30
+ */
31
+ async list(subscriptionId, options) {
32
+ const resp = await this.client.GET('/api/v1/subscriptions/{subscriptionId}/addons', {
33
+ params: { path: { subscriptionId } },
34
+ ...options,
35
+ });
36
+ return (0, utils_js_1.transformResponse)(resp);
37
+ }
38
+ /**
39
+ * Get a subscription addon by id
40
+ * @param subscriptionId - The ID of the subscription
41
+ * @param subscriptionAddonId - The ID of the subscription addon
42
+ * @param options - Optional request options
43
+ * @returns The subscription addon
44
+ */
45
+ async get(subscriptionId, subscriptionAddonId, options) {
46
+ const resp = await this.client.GET('/api/v1/subscriptions/{subscriptionId}/addons/{subscriptionAddonId}', {
47
+ params: { path: { subscriptionAddonId, subscriptionId } },
48
+ ...options,
49
+ });
50
+ return (0, utils_js_1.transformResponse)(resp);
51
+ }
52
+ /**
53
+ * Updates a subscription addon
54
+ * @param subscriptionId - The ID of the subscription
55
+ * @param subscriptionAddonId - The ID of the subscription addon to update
56
+ * @param addon - The subscription addon data to update
57
+ * @param options - Optional request options
58
+ * @returns The updated subscription addon
59
+ */
60
+ async update(subscriptionId, subscriptionAddonId, addon, options) {
61
+ const resp = await this.client.PATCH('/api/v1/subscriptions/{subscriptionId}/addons/{subscriptionAddonId}', {
62
+ body: addon,
63
+ params: { path: { subscriptionAddonId, subscriptionId } },
64
+ ...options,
65
+ });
66
+ return (0, utils_js_1.transformResponse)(resp);
67
+ }
68
+ }
69
+ exports.SubscriptionAddons = SubscriptionAddons;
70
+ //# sourceMappingURL=subscription-addons.js.map