@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,192 +0,0 @@
1
- import type { operations, paths, PlanCreate, PlanReplaceUpdate } from './schemas.cjs';
2
- import type { Client } from 'openapi-fetch';
3
- export declare class Plans {
4
- private client;
5
- constructor(client: Client<paths, `${string}/${string}`>);
6
- /**
7
- * Create a plan
8
- * @param plan - The plan to create
9
- * @param signal - An optional abort signal
10
- * @returns The created plan
11
- */
12
- create(plan: PlanCreate, signal?: AbortSignal): Promise<{
13
- data?: never;
14
- error: import("./utils.cjs").Problem;
15
- response: Response;
16
- } | {
17
- data: {
18
- readonly id: string;
19
- name: string;
20
- description?: string;
21
- metadata?: import("./schemas.cjs").components["schemas"]["Metadata"] | null;
22
- readonly createdAt: Date;
23
- readonly updatedAt: Date;
24
- readonly deletedAt?: Date;
25
- key: string;
26
- readonly version: number;
27
- currency: import("./schemas.cjs").components["schemas"]["CurrencyCode"];
28
- readonly effectiveFrom?: Date;
29
- readonly effectiveTo?: Date;
30
- readonly status: import("./schemas.cjs").components["schemas"]["PlanStatus"];
31
- phases: import("./schemas.cjs").components["schemas"]["PlanPhase"][];
32
- };
33
- error?: never;
34
- response: Response;
35
- }>;
36
- /**
37
- * Get a plan by ID or key
38
- * @param idOrKey - The ID or key of the plan
39
- * @param signal - An optional abort signal
40
- * @returns The plan
41
- */
42
- get(id: operations['getPlan']['parameters']['path']['planId'], signal?: AbortSignal): Promise<{
43
- data?: never;
44
- error: import("./utils.cjs").Problem;
45
- response: Response;
46
- } | {
47
- data: {
48
- readonly id: string;
49
- name: string;
50
- description?: string;
51
- metadata?: import("./schemas.cjs").components["schemas"]["Metadata"] | null;
52
- readonly createdAt: Date;
53
- readonly updatedAt: Date;
54
- readonly deletedAt?: Date;
55
- key: string;
56
- readonly version: number;
57
- currency: import("./schemas.cjs").components["schemas"]["CurrencyCode"];
58
- readonly effectiveFrom?: Date;
59
- readonly effectiveTo?: Date;
60
- readonly status: import("./schemas.cjs").components["schemas"]["PlanStatus"];
61
- phases: import("./schemas.cjs").components["schemas"]["PlanPhase"][];
62
- };
63
- error?: never;
64
- response: Response;
65
- }>;
66
- /**
67
- * List plans
68
- * @param query - The query parameters
69
- * @param signal - An optional abort signal
70
- * @returns The list of plans
71
- */
72
- list(query?: operations['listPlans']['parameters']['query'], signal?: AbortSignal): Promise<{
73
- data?: never;
74
- error: import("./utils.cjs").Problem;
75
- response: Response;
76
- } | {
77
- data: {
78
- totalCount: number;
79
- page: number;
80
- pageSize: number;
81
- items: import("./schemas.cjs").components["schemas"]["Plan"][];
82
- };
83
- error?: never;
84
- response: Response;
85
- }>;
86
- /**
87
- * Update a plan
88
- * @param id - The ID of the plan
89
- * @param plan - The plan to update
90
- * @param signal - An optional abort signal
91
- * @returns The updated plan
92
- */
93
- update(id: operations['updatePlan']['parameters']['path']['planId'], plan: PlanReplaceUpdate, signal?: AbortSignal): Promise<{
94
- data?: never;
95
- error: import("./utils.cjs").Problem;
96
- response: Response;
97
- } | {
98
- data: {
99
- readonly id: string;
100
- name: string;
101
- description?: string;
102
- metadata?: import("./schemas.cjs").components["schemas"]["Metadata"] | null;
103
- readonly createdAt: Date;
104
- readonly updatedAt: Date;
105
- readonly deletedAt?: Date;
106
- key: string;
107
- readonly version: number;
108
- currency: import("./schemas.cjs").components["schemas"]["CurrencyCode"];
109
- readonly effectiveFrom?: Date;
110
- readonly effectiveTo?: Date;
111
- readonly status: import("./schemas.cjs").components["schemas"]["PlanStatus"];
112
- phases: import("./schemas.cjs").components["schemas"]["PlanPhase"][];
113
- };
114
- error?: never;
115
- response: Response;
116
- }>;
117
- /**
118
- * Delete a plan
119
- * @param id - The ID of the plan
120
- * @param signal - An optional abort signal
121
- * @returns The deleted plan
122
- */
123
- delete(id: operations['deletePlan']['parameters']['path']['planId'], signal?: AbortSignal): Promise<{
124
- data?: never;
125
- error: import("./utils.cjs").Problem;
126
- response: Response;
127
- } | {
128
- data: undefined;
129
- error?: never;
130
- response: Response;
131
- }>;
132
- /**
133
- * Archive a plan
134
- * @param id - The ID of the plan
135
- * @param signal - An optional abort signal
136
- * @returns The archived plan
137
- */
138
- archive(id: operations['archivePlan']['parameters']['path']['planId'], signal?: AbortSignal): Promise<{
139
- data?: never;
140
- error: import("./utils.cjs").Problem;
141
- response: Response;
142
- } | {
143
- data: {
144
- readonly id: string;
145
- name: string;
146
- description?: string;
147
- metadata?: import("./schemas.cjs").components["schemas"]["Metadata"] | null;
148
- readonly createdAt: Date;
149
- readonly updatedAt: Date;
150
- readonly deletedAt?: Date;
151
- key: string;
152
- readonly version: number;
153
- currency: import("./schemas.cjs").components["schemas"]["CurrencyCode"];
154
- readonly effectiveFrom?: Date;
155
- readonly effectiveTo?: Date;
156
- readonly status: import("./schemas.cjs").components["schemas"]["PlanStatus"];
157
- phases: import("./schemas.cjs").components["schemas"]["PlanPhase"][];
158
- };
159
- error?: never;
160
- response: Response;
161
- }>;
162
- /**
163
- * Publish a plan
164
- * @param id - The ID of the plan
165
- * @param signal - An optional abort signal
166
- * @returns The published plan
167
- */
168
- publish(id: operations['publishPlan']['parameters']['path']['planId'], signal?: AbortSignal): Promise<{
169
- data?: never;
170
- error: import("./utils.cjs").Problem;
171
- response: Response;
172
- } | {
173
- data: {
174
- readonly id: string;
175
- name: string;
176
- description?: string;
177
- metadata?: import("./schemas.cjs").components["schemas"]["Metadata"] | null;
178
- readonly createdAt: Date;
179
- readonly updatedAt: Date;
180
- readonly deletedAt?: Date;
181
- key: string;
182
- readonly version: number;
183
- currency: import("./schemas.cjs").components["schemas"]["CurrencyCode"];
184
- readonly effectiveFrom?: Date;
185
- readonly effectiveTo?: Date;
186
- readonly status: import("./schemas.cjs").components["schemas"]["PlanStatus"];
187
- phases: import("./schemas.cjs").components["schemas"]["PlanPhase"][];
188
- };
189
- error?: never;
190
- response: Response;
191
- }>;
192
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"plans.js","sourceRoot":"","sources":["../../../src/plans.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAS9C,MAAa,KAAK;IACI;IAApB,YAAoB,MAA4C;QAA5C,WAAM,GAAN,MAAM,CAAsC;IAAG,CAAC;IAEpE;;;;;OAKG;IACI,KAAK,CAAC,MAAM,CAAC,IAAgB,EAAE,MAAoB;QACxD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,EAAE;YACnD,MAAM;YACN,IAAI,EAAE,IAAI;SACX,CAAC,CAAA;QAEF,OAAO,IAAA,4BAAiB,EAAC,IAAI,CAAC,CAAA;IAChC,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,GAAG,CACd,EAAyD,EACzD,MAAoB;QAEpB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,wBAAwB,EAAE;YAC3D,MAAM;YACN,MAAM,EAAE;gBACN,IAAI,EAAE;oBACJ,MAAM,EAAE,EAAE;iBACX;aACF;SACF,CAAC,CAAA;QAEF,OAAO,IAAA,4BAAiB,EAAC,IAAI,CAAC,CAAA;IAChC,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,IAAI,CACf,KAAsD,EACtD,MAAoB;QAEpB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,eAAe,EAAE;YAClD,MAAM;YACN,MAAM,EAAE;gBACN,KAAK;aACN;SACF,CAAC,CAAA;QAEF,OAAO,IAAA,4BAAiB,EAAC,IAAI,CAAC,CAAA;IAChC,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,MAAM,CACjB,EAA4D,EAC5D,IAAuB,EACvB,MAAoB;QAEpB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,wBAAwB,EAAE;YAC3D,MAAM;YACN,IAAI,EAAE,IAAI;YACV,MAAM,EAAE;gBACN,IAAI,EAAE;oBACJ,MAAM,EAAE,EAAE;iBACX;aACF;SACF,CAAC,CAAA;QAEF,OAAO,IAAA,4BAAiB,EAAC,IAAI,CAAC,CAAA;IAChC,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,MAAM,CACjB,EAA4D,EAC5D,MAAoB;QAEpB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,wBAAwB,EAAE;YAC9D,MAAM;YACN,MAAM,EAAE;gBACN,IAAI,EAAE;oBACJ,MAAM,EAAE,EAAE;iBACX;aACF;SACF,CAAC,CAAA;QAEF,OAAO,IAAA,4BAAiB,EAAC,IAAI,CAAC,CAAA;IAChC,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,OAAO,CAClB,EAA6D,EAC7D,MAAoB;QAEpB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gCAAgC,EAAE;YACpE,MAAM;YACN,MAAM,EAAE;gBACN,IAAI,EAAE;oBACJ,MAAM,EAAE,EAAE;iBACX;aACF;SACF,CAAC,CAAA;QAEF,OAAO,IAAA,4BAAiB,EAAC,IAAI,CAAC,CAAA;IAChC,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,OAAO,CAClB,EAA6D,EAC7D,MAAoB;QAEpB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gCAAgC,EAAE;YACpE,MAAM;YACN,MAAM,EAAE;gBACN,IAAI,EAAE;oBACJ,MAAM,EAAE,EAAE;iBACX;aACF;SACF,CAAC,CAAA;QAEF,OAAO,IAAA,4BAAiB,EAAC,IAAI,CAAC,CAAA;IAChC,CAAC;CACF;AAtJD,sBAsJC"}
@@ -1,76 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Subjects = void 0;
4
- const utils_js_1 = require("./utils.cjs");
5
- /**
6
- * Subjects
7
- * @description Subjects are entities that consume resources you wish to meter. These can range from users, servers, and services to devices. The design of subjects is intentionally generic, enabling flexible application across various metering scenarios. Meters are aggregating events for each subject..
8
- */
9
- class Subjects {
10
- client;
11
- constructor(client) {
12
- this.client = client;
13
- }
14
- /**
15
- * Upsert one or multiple subjects
16
- * If the subject does not exist, it will be created, otherwise it will be updated.
17
- *
18
- * @param subjects - The subjects to upsert
19
- * @param signal - An optional abort signal
20
- * @returns The upserted subjects
21
- */
22
- async upsert(subjects, signal) {
23
- const resp = await this.client.POST('/api/v1/subjects', {
24
- signal,
25
- body: Array.isArray(subjects) ? subjects : [subjects],
26
- });
27
- return (0, utils_js_1.transformResponse)(resp);
28
- }
29
- /**
30
- * Get a subject by ID or key
31
- * @param idOrKey - The ID or key of the subject
32
- * @param signal - An optional abort signal
33
- * @returns The subject
34
- */
35
- async get(idOrKey, signal) {
36
- const resp = await this.client.GET('/api/v1/subjects/{subjectIdOrKey}', {
37
- signal,
38
- params: {
39
- path: {
40
- subjectIdOrKey: idOrKey,
41
- },
42
- },
43
- });
44
- return (0, utils_js_1.transformResponse)(resp);
45
- }
46
- /**
47
- * List subjects
48
- * @param signal - An optional abort signal
49
- * @returns The subjects
50
- */
51
- async list(signal) {
52
- const resp = await this.client.GET('/api/v1/subjects', {
53
- signal,
54
- });
55
- return (0, utils_js_1.transformResponse)(resp);
56
- }
57
- /**
58
- * Delete a subject by ID or key
59
- * @param idOrKey - The ID or key of the subject
60
- * @param signal - An optional abort signal
61
- * @returns The deleted subject
62
- */
63
- async delete(idOrKey, signal) {
64
- const resp = await this.client.DELETE('/api/v1/subjects/{subjectIdOrKey}', {
65
- signal,
66
- params: {
67
- path: {
68
- subjectIdOrKey: idOrKey,
69
- },
70
- },
71
- });
72
- return (0, utils_js_1.transformResponse)(resp);
73
- }
74
- }
75
- exports.Subjects = Subjects;
76
- //# sourceMappingURL=subjects.js.map
@@ -1,101 +0,0 @@
1
- import type { operations, paths, SubjectUpsert } from './schemas.cjs';
2
- import type { Client } from 'openapi-fetch';
3
- /**
4
- * Subjects
5
- * @description Subjects are entities that consume resources you wish to meter. These can range from users, servers, and services to devices. The design of subjects is intentionally generic, enabling flexible application across various metering scenarios. Meters are aggregating events for each subject..
6
- */
7
- export declare class Subjects {
8
- private client;
9
- constructor(client: Client<paths, `${string}/${string}`>);
10
- /**
11
- * Upsert one or multiple subjects
12
- * If the subject does not exist, it will be created, otherwise it will be updated.
13
- *
14
- * @param subjects - The subjects to upsert
15
- * @param signal - An optional abort signal
16
- * @returns The upserted subjects
17
- */
18
- upsert(subjects: SubjectUpsert | SubjectUpsert[], signal?: AbortSignal): Promise<{
19
- data?: never;
20
- error: import("./utils.cjs").Problem;
21
- response: Response;
22
- } | {
23
- data: {
24
- readonly id: string;
25
- key: string;
26
- displayName?: string | null;
27
- metadata?: {
28
- [key: string]: unknown;
29
- } | null;
30
- currentPeriodStart?: Date;
31
- currentPeriodEnd?: Date;
32
- stripeCustomerId?: string | null;
33
- }[];
34
- error?: never;
35
- response: Response;
36
- }>;
37
- /**
38
- * Get a subject by ID or key
39
- * @param idOrKey - The ID or key of the subject
40
- * @param signal - An optional abort signal
41
- * @returns The subject
42
- */
43
- get(idOrKey: operations['getSubject']['parameters']['path']['subjectIdOrKey'], signal?: AbortSignal): Promise<{
44
- data?: never;
45
- error: import("./utils.cjs").Problem;
46
- response: Response;
47
- } | {
48
- data: {
49
- readonly id: string;
50
- key: string;
51
- displayName?: string | null;
52
- metadata?: {
53
- [key: string]: unknown;
54
- } | null;
55
- currentPeriodStart?: Date;
56
- currentPeriodEnd?: Date;
57
- stripeCustomerId?: string | null;
58
- };
59
- error?: never;
60
- response: Response;
61
- }>;
62
- /**
63
- * List subjects
64
- * @param signal - An optional abort signal
65
- * @returns The subjects
66
- */
67
- list(signal?: AbortSignal): Promise<{
68
- data?: never;
69
- error: import("./utils.cjs").Problem;
70
- response: Response;
71
- } | {
72
- data: {
73
- readonly id: string;
74
- key: string;
75
- displayName?: string | null;
76
- metadata?: {
77
- [key: string]: unknown;
78
- } | null;
79
- currentPeriodStart?: Date;
80
- currentPeriodEnd?: Date;
81
- stripeCustomerId?: string | null;
82
- }[];
83
- error?: never;
84
- response: Response;
85
- }>;
86
- /**
87
- * Delete a subject by ID or key
88
- * @param idOrKey - The ID or key of the subject
89
- * @param signal - An optional abort signal
90
- * @returns The deleted subject
91
- */
92
- delete(idOrKey: operations['deleteSubject']['parameters']['path']['subjectIdOrKey'], signal?: AbortSignal): Promise<{
93
- data?: never;
94
- error: import("./utils.cjs").Problem;
95
- response: Response;
96
- } | {
97
- data: undefined;
98
- error?: never;
99
- response: Response;
100
- }>;
101
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"subjects.js","sourceRoot":"","sources":["../../../src/subjects.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAI9C;;;GAGG;AACH,MAAa,QAAQ;IACC;IAApB,YAAoB,MAA4C;QAA5C,WAAM,GAAN,MAAM,CAAsC;IAAG,CAAC;IAEpE;;;;;;;OAOG;IACI,KAAK,CAAC,MAAM,CACjB,QAAyC,EACzC,MAAoB;QAEpB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,EAAE;YACtD,MAAM;YACN,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;SACtD,CAAC,CAAA;QAEF,OAAO,IAAA,4BAAiB,EAAC,IAAI,CAAC,CAAA;IAChC,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,GAAG,CACd,OAAyE,EACzE,MAAoB;QAEpB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,mCAAmC,EAAE;YACtE,MAAM;YACN,MAAM,EAAE;gBACN,IAAI,EAAE;oBACJ,cAAc,EAAE,OAAO;iBACxB;aACF;SACF,CAAC,CAAA;QAEF,OAAO,IAAA,4BAAiB,EAAC,IAAI,CAAC,CAAA;IAChC,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,IAAI,CAAC,MAAoB;QACpC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,kBAAkB,EAAE;YACrD,MAAM;SACP,CAAC,CAAA;QAEF,OAAO,IAAA,4BAAiB,EAAC,IAAI,CAAC,CAAA;IAChC,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,MAAM,CACjB,OAA4E,EAC5E,MAAoB;QAEpB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,mCAAmC,EAAE;YACzE,MAAM;YACN,MAAM,EAAE;gBACN,IAAI,EAAE;oBACJ,cAAc,EAAE,OAAO;iBACxB;aACF;SACF,CAAC,CAAA;QAEF,OAAO,IAAA,4BAAiB,EAAC,IAAI,CAAC,CAAA;IAChC,CAAC;CACF;AA/ED,4BA+EC"}
@@ -1,116 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Subscriptions = void 0;
4
- const utils_js_1 = require("./utils.cjs");
5
- /**
6
- * Subscriptions
7
- */
8
- class Subscriptions {
9
- client;
10
- constructor(client) {
11
- this.client = client;
12
- }
13
- /**
14
- * Create a subscription
15
- * @param body - The subscription to create
16
- * @param signal - An optional abort signal
17
- * @returns The created subscription
18
- */
19
- async create(body, signal) {
20
- const resp = await this.client.POST('/api/v1/subscriptions', {
21
- body,
22
- signal,
23
- });
24
- return (0, utils_js_1.transformResponse)(resp);
25
- }
26
- /**
27
- * Get a subscription
28
- * @param id - The subscription ID
29
- * @param signal - An optional abort signal
30
- * @returns The subscription
31
- */
32
- async get(id, signal) {
33
- const resp = await this.client.GET('/api/v1/subscriptions/{subscriptionId}', {
34
- signal,
35
- params: { path: { subscriptionId: id } },
36
- });
37
- return (0, utils_js_1.transformResponse)(resp);
38
- }
39
- /**
40
- * Edit a subscription
41
- * @param id - The subscription ID
42
- * @param body - The subscription to edit
43
- * @param signal - An optional abort signal
44
- * @returns The edited subscription
45
- */
46
- async edit(id, body, signal) {
47
- const resp = await this.client.PATCH('/api/v1/subscriptions/{subscriptionId}', {
48
- signal,
49
- params: { path: { subscriptionId: id } },
50
- body,
51
- });
52
- return (0, utils_js_1.transformResponse)(resp);
53
- }
54
- /**
55
- * Cancel a subscription
56
- * @param id - The subscription ID
57
- * @param body - The subscription to cancel
58
- * @param signal - An optional abort signal
59
- * @returns The canceled subscription
60
- */
61
- async cancel(id, body, signal) {
62
- const resp = await this.client.POST('/api/v1/subscriptions/{subscriptionId}/cancel', {
63
- signal,
64
- params: { path: { subscriptionId: id } },
65
- body,
66
- });
67
- return (0, utils_js_1.transformResponse)(resp);
68
- }
69
- /**
70
- * Change a subscription
71
- * @description Closes a running subscription and starts a new one according to the specification. Can be used for upgrades, downgrades, and plan changes.
72
- * @param id - The subscription ID
73
- * @param body - The subscription to change
74
- * @param signal - An optional abort signal
75
- * @returns The changed subscription
76
- */
77
- async change(id, body, signal) {
78
- const resp = await this.client.POST('/api/v1/subscriptions/{subscriptionId}/change', {
79
- signal,
80
- params: { path: { subscriptionId: id } },
81
- body,
82
- });
83
- return (0, utils_js_1.transformResponse)(resp);
84
- }
85
- /**
86
- * Migrate a subscription
87
- * @description Migrates the subscripiton to the provided version of the current plan.
88
- * @param id - The subscription ID
89
- * @param body - The subscription to migrate
90
- * @param signal - An optional abort signal
91
- * @returns The migrated subscription
92
- */
93
- async migrate(id, body, signal) {
94
- const resp = await this.client.POST('/api/v1/subscriptions/{subscriptionId}/migrate', {
95
- signal,
96
- params: { path: { subscriptionId: id } },
97
- body,
98
- });
99
- return (0, utils_js_1.transformResponse)(resp);
100
- }
101
- /**
102
- * Unschedule a cancelation
103
- * @param id - The subscription ID
104
- * @param signal - An optional abort signal
105
- * @returns The unscheduled subscription
106
- */
107
- async unscheduleCancelation(id, signal) {
108
- const resp = await this.client.POST('/api/v1/subscriptions/{subscriptionId}/unschedule-cancelation', {
109
- signal,
110
- params: { path: { subscriptionId: id } },
111
- });
112
- return (0, utils_js_1.transformResponse)(resp);
113
- }
114
- }
115
- exports.Subscriptions = Subscriptions;
116
- //# sourceMappingURL=subscriptions.js.map