@openmeter/sdk 1.0.0-beta-17e8fcd5cfec → 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 (40) 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 -30
  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.cjs +0 -4
  16. package/dist/cjs/src/zod/index.d.cts +1996 -1999
  17. package/dist/cjs/src/zod/index.js.map +1 -1
  18. package/dist/cjs/tsconfig.38c40c16.tsbuildinfo +1 -0
  19. package/dist/cjs/tsconfig.a243a3bf.tsbuildinfo +1 -0
  20. package/dist/src/client/addons.d.ts +147 -0
  21. package/dist/src/client/addons.js +101 -0
  22. package/dist/src/client/addons.js.map +1 -0
  23. package/dist/src/client/entitlements.d.ts +1 -1
  24. package/dist/src/client/index.d.ts +4 -0
  25. package/dist/src/client/index.js +6 -0
  26. package/dist/src/client/index.js.map +1 -1
  27. package/dist/src/client/notifications.d.ts +2 -2
  28. package/dist/src/client/schemas.d.ts +20 -30
  29. package/dist/src/client/subscription-addons.d.ts +123 -0
  30. package/dist/src/client/subscription-addons.js +66 -0
  31. package/dist/src/client/subscription-addons.js.map +1 -0
  32. package/dist/src/portal/index.js +1 -2
  33. package/dist/src/portal/index.js.map +1 -1
  34. package/dist/src/zod/index.d.ts +1996 -1999
  35. package/dist/src/zod/index.js +0 -4
  36. package/dist/src/zod/index.js.map +1 -1
  37. package/dist/tsconfig.tsbuildinfo +1 -1
  38. package/package.json +18 -18
  39. package/dist/cjs/tsconfig.2f45a57b.tsbuildinfo +0 -1
  40. package/dist/cjs/tsconfig.ed32b929.tsbuildinfo +0 -1
@@ -1,4 +1,5 @@
1
1
  import createClient, { createQuerySerializer, } from 'openapi-fetch';
2
+ import { Addons } from './addons.js';
2
3
  import { Apps } from './apps.js';
3
4
  import { Billing } from './billing.js';
4
5
  import { Customers } from './customers.js';
@@ -12,6 +13,7 @@ import { Notifications } from './notifications.js';
12
13
  import { Plans } from './plans.js';
13
14
  import { Portal } from './portal.js';
14
15
  import { Subjects } from './subjects.js';
16
+ import { SubscriptionAddons } from './subscription-addons.js';
15
17
  import { Subscriptions } from './subscriptions.js';
16
18
  import { encodeDates } from './utils.js';
17
19
  export * from './schemas.js';
@@ -22,6 +24,7 @@ export * from './common.js';
22
24
  export class OpenMeter {
23
25
  config;
24
26
  client;
27
+ addons;
25
28
  apps;
26
29
  billing;
27
30
  customers;
@@ -35,6 +38,7 @@ export class OpenMeter {
35
38
  plans;
36
39
  portal;
37
40
  subjects;
41
+ subscriptionAddons;
38
42
  subscriptions;
39
43
  constructor(config) {
40
44
  this.config = config;
@@ -55,6 +59,7 @@ export class OpenMeter {
55
59
  },
56
60
  })(encodeDates(q)),
57
61
  });
62
+ this.addons = new Addons(this.client);
58
63
  this.apps = new Apps(this.client);
59
64
  this.billing = new Billing(this.client);
60
65
  this.customers = new Customers(this.client);
@@ -68,6 +73,7 @@ export class OpenMeter {
68
73
  this.plans = new Plans(this.client);
69
74
  this.portal = new Portal(this.client);
70
75
  this.subjects = new Subjects(this.client);
76
+ this.subscriptionAddons = new SubscriptionAddons(this.client);
71
77
  this.subscriptions = new Subscriptions(this.client);
72
78
  }
73
79
  }
@@ -1 +1 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377
377
  readonly id: string;
378
378
  readonly type: import("./schemas.js").components["schemas"]["NotificationEventType"];
379
379
  readonly createdAt: Date;
380
- readonly rule: import("./schemas.js").components["schemas"]["NotificationRule"];
380
+ readonly rule: Omit<import("./schemas.js").components["schemas"]["NotificationRule"], "type">;
381
381
  readonly deliveryStatus: import("./schemas.js").components["schemas"]["NotificationEventDeliveryStatus"][];
382
- readonly payload: import("./schemas.js").components["schemas"]["NotificationEventPayload"];
382
+ readonly payload: Omit<import("./schemas.js").components["schemas"]["NotificationEventPayload"], "type">;
383
383
  readonly annotations?: import("./schemas.js").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. */
@@ -5775,16 +5775,6 @@ export interface components {
5775
5775
  * @description Additional metadata for the resource.
5776
5776
  */
5777
5777
  metadata?: components['schemas']['Metadata'] | null;
5778
- /**
5779
- * Format: date-time
5780
- * @description The time until the invoice is in draft status.
5781
- *
5782
- * On draft invoice creation it is calculated from the workflow settings.
5783
- *
5784
- * If manual approval is required, the draftUntil time is set.
5785
- * @example 2023-01-01T01:01:01.001Z
5786
- */
5787
- draftUntil?: Date;
5788
5778
  /** @description The supplier of the lines included in the invoice. */
5789
5779
  supplier: components['schemas']['BillingPartyReplaceUpdate'];
5790
5780
  /** @description The customer the invoice is sent to. */
@@ -5916,7 +5906,7 @@ export interface components {
5916
5906
  * @deprecated
5917
5907
  * @description Price of the usage-based item being sold.
5918
5908
  */
5919
- price?: components['schemas']['RateCardUsageBasedPrice'];
5909
+ price?: Omit<components['schemas']['RateCardUsageBasedPrice'], 'type'>;
5920
5910
  /**
5921
5911
  * @deprecated
5922
5912
  * @description The feature that the usage is based on.
@@ -6074,7 +6064,7 @@ export interface components {
6074
6064
  * @deprecated
6075
6065
  * @description Price of the usage-based item being sold.
6076
6066
  */
6077
- price?: components['schemas']['RateCardUsageBasedPrice'];
6067
+ price?: Omit<components['schemas']['RateCardUsageBasedPrice'], 'type'>;
6078
6068
  /**
6079
6069
  * @deprecated
6080
6070
  * @description The feature that the usage is based on.
@@ -6144,7 +6134,7 @@ export interface components {
6144
6134
  * @deprecated
6145
6135
  * @description Price of the usage-based item being sold.
6146
6136
  */
6147
- price?: components['schemas']['RateCardUsageBasedPrice'];
6137
+ price?: Omit<components['schemas']['RateCardUsageBasedPrice'], 'type'>;
6148
6138
  /**
6149
6139
  * @deprecated
6150
6140
  * @description The feature that the usage is based on.
@@ -6201,7 +6191,7 @@ export interface components {
6201
6191
  * @deprecated
6202
6192
  * @description Price of the usage-based item being sold.
6203
6193
  */
6204
- price?: components['schemas']['RateCardUsageBasedPrice'];
6194
+ price?: Omit<components['schemas']['RateCardUsageBasedPrice'], 'type'>;
6205
6195
  /**
6206
6196
  * @deprecated
6207
6197
  * @description The feature that the usage is based on.
@@ -6227,7 +6217,7 @@ export interface components {
6227
6217
  taxConfig?: components['schemas']['TaxConfig'];
6228
6218
  /** @description The price of the rate card.
6229
6219
  * When null, the feature or service is free. */
6230
- price: components['schemas']['RateCardUsageBasedPrice'] | null;
6220
+ price: Omit<components['schemas']['RateCardUsageBasedPrice'], 'type'> | null;
6231
6221
  /** @description The discounts that are applied to the line. */
6232
6222
  discounts?: components['schemas']['BillingDiscounts'];
6233
6223
  };
@@ -6966,14 +6956,14 @@ export interface components {
6966
6956
  */
6967
6957
  readonly createdAt: Date;
6968
6958
  /** @description The nnotification rule which generated this event. */
6969
- readonly rule: components['schemas']['NotificationRule'];
6959
+ readonly rule: Omit<components['schemas']['NotificationRule'], 'type'>;
6970
6960
  /**
6971
6961
  * Delivery Status
6972
6962
  * @description The delivery status of the notification event.
6973
6963
  */
6974
6964
  readonly deliveryStatus: components['schemas']['NotificationEventDeliveryStatus'][];
6975
6965
  /** @description Timestamp when the notification event was created in RFC 3339 format. */
6976
- readonly payload: components['schemas']['NotificationEventPayload'];
6966
+ readonly payload: Omit<components['schemas']['NotificationEventPayload'], 'type'>;
6977
6967
  /**
6978
6968
  * Annotations
6979
6969
  * @description Set of key-value pairs managed by the system. Cannot be modified by user.
@@ -8223,7 +8213,7 @@ export interface components {
8223
8213
  featureKey?: string;
8224
8214
  /** @description The entitlement of the rate card.
8225
8215
  * Only available when featureKey is set. */
8226
- entitlementTemplate?: components['schemas']['RateCardEntitlement'];
8216
+ entitlementTemplate?: Omit<components['schemas']['RateCardEntitlement'], 'type'>;
8227
8217
  /**
8228
8218
  * Tax config
8229
8219
  * @description The tax config of the rate card.
@@ -8350,7 +8340,7 @@ export interface components {
8350
8340
  featureKey?: string;
8351
8341
  /** @description The entitlement of the rate card.
8352
8342
  * Only available when featureKey is set. */
8353
- entitlementTemplate?: components['schemas']['RateCardEntitlement'];
8343
+ entitlementTemplate?: Omit<components['schemas']['RateCardEntitlement'], 'type'>;
8354
8344
  /**
8355
8345
  * Tax config
8356
8346
  * @description The tax config of the rate card.
@@ -8365,7 +8355,7 @@ export interface components {
8365
8355
  billingCadence: string;
8366
8356
  /** @description The price of the rate card.
8367
8357
  * When null, the feature or service is free. */
8368
- price: components['schemas']['RateCardUsageBasedPrice'] | null;
8358
+ price: Omit<components['schemas']['RateCardUsageBasedPrice'], 'type'> | null;
8369
8359
  /**
8370
8360
  * Discounts
8371
8361
  * @description The discounts of the rate card.
@@ -9159,7 +9149,7 @@ export interface components {
9159
9149
  * Rate card
9160
9150
  * @description The rate card.
9161
9151
  */
9162
- rateCard: components['schemas']['RateCard'];
9152
+ rateCard: Omit<components['schemas']['RateCard'], 'type'>;
9163
9153
  /**
9164
9154
  * Affected subscription item IDs
9165
9155
  * @description The IDs of the subscription items that this rate card belongs to.
@@ -9410,7 +9400,7 @@ export interface components {
9410
9400
  * When null, the feature or service is free.
9411
9401
  * @example {}
9412
9402
  */
9413
- price: components['schemas']['RateCardUsageBasedPrice'] | null;
9403
+ price: Omit<components['schemas']['RateCardUsageBasedPrice'], 'type'> | null;
9414
9404
  /**
9415
9405
  * Discounts
9416
9406
  * @description The discounts applied to the rate card.
@@ -9430,7 +9420,7 @@ export interface components {
9430
9420
  /** @description The feature the customer is entitled to use. */
9431
9421
  feature: components['schemas']['Feature'];
9432
9422
  /** @description The entitlement of the Subscription Item. */
9433
- entitlement?: components['schemas']['Entitlement'];
9423
+ entitlement?: Omit<components['schemas']['Entitlement'], 'type'>;
9434
9424
  };
9435
9425
  /** @description Paginated response */
9436
9426
  SubscriptionPaginatedResponse: {
@@ -9779,14 +9769,14 @@ export interface components {
9779
9769
  /** @description How much of the total line items to be voided? (e.g. 100% means all charges are voided) */
9780
9770
  percentage: components['schemas']['Percentage'];
9781
9771
  /** @description The action to take on the line items. */
9782
- action: components['schemas']['VoidInvoiceLineActionCreate'];
9772
+ action: Omit<components['schemas']['VoidInvoiceLineActionCreate'], 'type'>;
9783
9773
  };
9784
9774
  /** @description InvoiceVoidAction describes how to handle the voided line items. */
9785
9775
  VoidInvoiceActionCreateItem: {
9786
9776
  /** @description How much of the total line items to be voided? (e.g. 100% means all charges are voided) */
9787
9777
  percentage: components['schemas']['Percentage'];
9788
9778
  /** @description The action to take on the line items. */
9789
- action: components['schemas']['VoidInvoiceLineActionCreateItem'];
9779
+ action: Omit<components['schemas']['VoidInvoiceLineActionCreateItem'], 'type'>;
9790
9780
  };
9791
9781
  /** @description Request to void an invoice */
9792
9782
  VoidInvoiceActionInput: {
@@ -0,0 +1,123 @@
1
+ import type { RequestOptions } from './common.js';
2
+ import type { operations, paths } from './schemas.js';
3
+ import type { Client } from 'openapi-fetch';
4
+ export declare class SubscriptionAddons {
5
+ private client;
6
+ constructor(client: Client<paths, `${string}/${string}`>);
7
+ /**
8
+ * Create a new subscription addon
9
+ * @param subscriptionId - The ID of the subscription
10
+ * @param addon - The subscription addon to create
11
+ * @param options - Optional request options
12
+ * @returns The created subscription addon
13
+ */
14
+ create(subscriptionId: string, addon: operations['createSubscriptionAddon']['requestBody']['content']['application/json'], options?: RequestOptions): Promise<{
15
+ readonly id: string;
16
+ name: string;
17
+ description?: string;
18
+ metadata?: import("./schemas.js").components["schemas"]["Metadata"] | null;
19
+ readonly createdAt: Date;
20
+ readonly updatedAt: Date;
21
+ readonly deletedAt?: Date;
22
+ readonly activeFrom: Date;
23
+ readonly activeTo?: Date;
24
+ addon: {
25
+ id: string;
26
+ readonly key: string;
27
+ readonly version: number;
28
+ readonly instanceType: import("./schemas.js").components["schemas"]["AddonInstanceType"];
29
+ };
30
+ readonly quantityAt: Date;
31
+ quantity: number;
32
+ readonly timeline: import("./schemas.js").components["schemas"]["SubscriptionAddonTimelineSegment"][];
33
+ readonly subscriptionId: string;
34
+ readonly rateCards: import("./schemas.js").components["schemas"]["SubscriptionAddonRateCard"][];
35
+ }>;
36
+ /**
37
+ * List all addons of a subscription
38
+ * @param subscriptionId - The ID of the subscription
39
+ * @param options - Optional request options
40
+ * @returns A list of subscription addons
41
+ */
42
+ list(subscriptionId: string, options?: RequestOptions): Promise<{
43
+ readonly id: string;
44
+ name: string;
45
+ description?: string;
46
+ metadata?: import("./schemas.js").components["schemas"]["Metadata"] | null;
47
+ readonly createdAt: Date;
48
+ readonly updatedAt: Date;
49
+ readonly deletedAt?: Date;
50
+ readonly activeFrom: Date;
51
+ readonly activeTo?: Date;
52
+ addon: {
53
+ id: string;
54
+ readonly key: string;
55
+ readonly version: number;
56
+ readonly instanceType: import("./schemas.js").components["schemas"]["AddonInstanceType"];
57
+ };
58
+ readonly quantityAt: Date;
59
+ quantity: number;
60
+ readonly timeline: import("./schemas.js").components["schemas"]["SubscriptionAddonTimelineSegment"][];
61
+ readonly subscriptionId: string;
62
+ readonly rateCards: import("./schemas.js").components["schemas"]["SubscriptionAddonRateCard"][];
63
+ }[]>;
64
+ /**
65
+ * Get a subscription addon by id
66
+ * @param subscriptionId - The ID of the subscription
67
+ * @param subscriptionAddonId - The ID of the subscription addon
68
+ * @param options - Optional request options
69
+ * @returns The subscription addon
70
+ */
71
+ get(subscriptionId: string, subscriptionAddonId: string, options?: RequestOptions): Promise<{
72
+ readonly id: string;
73
+ name: string;
74
+ description?: string;
75
+ metadata?: import("./schemas.js").components["schemas"]["Metadata"] | null;
76
+ readonly createdAt: Date;
77
+ readonly updatedAt: Date;
78
+ readonly deletedAt?: Date;
79
+ readonly activeFrom: Date;
80
+ readonly activeTo?: Date;
81
+ addon: {
82
+ id: string;
83
+ readonly key: string;
84
+ readonly version: number;
85
+ readonly instanceType: import("./schemas.js").components["schemas"]["AddonInstanceType"];
86
+ };
87
+ readonly quantityAt: Date;
88
+ quantity: number;
89
+ readonly timeline: import("./schemas.js").components["schemas"]["SubscriptionAddonTimelineSegment"][];
90
+ readonly subscriptionId: string;
91
+ readonly rateCards: import("./schemas.js").components["schemas"]["SubscriptionAddonRateCard"][];
92
+ }>;
93
+ /**
94
+ * Updates a subscription addon
95
+ * @param subscriptionId - The ID of the subscription
96
+ * @param subscriptionAddonId - The ID of the subscription addon to update
97
+ * @param addon - The subscription addon data to update
98
+ * @param options - Optional request options
99
+ * @returns The updated subscription addon
100
+ */
101
+ update(subscriptionId: string, subscriptionAddonId: string, addon: operations['updateSubscriptionAddon']['requestBody']['content']['application/json'], options?: RequestOptions): Promise<{
102
+ readonly id: string;
103
+ name: string;
104
+ description?: string;
105
+ metadata?: import("./schemas.js").components["schemas"]["Metadata"] | null;
106
+ readonly createdAt: Date;
107
+ readonly updatedAt: Date;
108
+ readonly deletedAt?: Date;
109
+ readonly activeFrom: Date;
110
+ readonly activeTo?: Date;
111
+ addon: {
112
+ id: string;
113
+ readonly key: string;
114
+ readonly version: number;
115
+ readonly instanceType: import("./schemas.js").components["schemas"]["AddonInstanceType"];
116
+ };
117
+ readonly quantityAt: Date;
118
+ quantity: number;
119
+ readonly timeline: import("./schemas.js").components["schemas"]["SubscriptionAddonTimelineSegment"][];
120
+ readonly subscriptionId: string;
121
+ readonly rateCards: import("./schemas.js").components["schemas"]["SubscriptionAddonRateCard"][];
122
+ }>;
123
+ }
@@ -0,0 +1,66 @@
1
+ import { transformResponse } from './utils.js';
2
+ export class SubscriptionAddons {
3
+ client;
4
+ constructor(client) {
5
+ this.client = client;
6
+ }
7
+ /**
8
+ * Create a new subscription addon
9
+ * @param subscriptionId - The ID of the subscription
10
+ * @param addon - The subscription addon to create
11
+ * @param options - Optional request options
12
+ * @returns The created subscription addon
13
+ */
14
+ async create(subscriptionId, addon, options) {
15
+ const resp = await this.client.POST('/api/v1/subscriptions/{subscriptionId}/addons', {
16
+ body: addon,
17
+ params: { path: { subscriptionId } },
18
+ ...options,
19
+ });
20
+ return transformResponse(resp);
21
+ }
22
+ /**
23
+ * List all addons of a subscription
24
+ * @param subscriptionId - The ID of the subscription
25
+ * @param options - Optional request options
26
+ * @returns A list of subscription addons
27
+ */
28
+ async list(subscriptionId, options) {
29
+ const resp = await this.client.GET('/api/v1/subscriptions/{subscriptionId}/addons', {
30
+ params: { path: { subscriptionId } },
31
+ ...options,
32
+ });
33
+ return transformResponse(resp);
34
+ }
35
+ /**
36
+ * Get a subscription addon by id
37
+ * @param subscriptionId - The ID of the subscription
38
+ * @param subscriptionAddonId - The ID of the subscription addon
39
+ * @param options - Optional request options
40
+ * @returns The subscription addon
41
+ */
42
+ async get(subscriptionId, subscriptionAddonId, options) {
43
+ const resp = await this.client.GET('/api/v1/subscriptions/{subscriptionId}/addons/{subscriptionAddonId}', {
44
+ params: { path: { subscriptionAddonId, subscriptionId } },
45
+ ...options,
46
+ });
47
+ return transformResponse(resp);
48
+ }
49
+ /**
50
+ * Updates a subscription addon
51
+ * @param subscriptionId - The ID of the subscription
52
+ * @param subscriptionAddonId - The ID of the subscription addon to update
53
+ * @param addon - The subscription addon data to update
54
+ * @param options - Optional request options
55
+ * @returns The updated subscription addon
56
+ */
57
+ async update(subscriptionId, subscriptionAddonId, addon, options) {
58
+ const resp = await this.client.PATCH('/api/v1/subscriptions/{subscriptionId}/addons/{subscriptionAddonId}', {
59
+ body: addon,
60
+ params: { path: { subscriptionAddonId, subscriptionId } },
61
+ ...options,
62
+ });
63
+ return transformResponse(resp);
64
+ }
65
+ }
66
+ //# sourceMappingURL=subscription-addons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscription-addons.js","sourceRoot":"","sources":["../../../src/client/subscription-addons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAK9C,MAAM,OAAO,kBAAkB;IACT;IAApB,YAAoB,MAA4C;QAA5C,WAAM,GAAN,MAAM,CAAsC;IAAG,CAAC;IAEpE;;;;;;OAMG;IACI,KAAK,CAAC,MAAM,CACjB,cAAsB,EACtB,KAA0F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CAAA;IAChC,CAAC;CACF"}
@@ -1,5 +1,4 @@
1
- import createClient from 'openapi-fetch';
2
- import { createQuerySerializer } from 'openapi-fetch/dist/cjs/index.cjs';
1
+ import createClient, { createQuerySerializer } from 'openapi-fetch';
3
2
  import { encodeDates, transformResponse } from '../client/utils.js';
4
3
  /**
5
4
  * OpenMeter Portal Client
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/portal/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;AACxE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAenE;;;GAGG;AACH,MAAM,OAAO,SAAS;IACZ,MAAM,CAAsC;IAEpD,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,YAAY,CAAQ;YAChC,GAAG,MAAM;YACT,OAAO,EAAE;gBACP,GAAG,MAAM,CAAC,OAAO;gBACjB,aAAa,EAAE,UAAU,MAAM,CAAC,WAAW,EAAE;aAC9C;YACD,eAAe,EAAE,CAAC,CAAC,EAAE,EAAE,CACrB,qBAAqB,CAAC;gBACpB,KAAK,EAAE;oBACL,OAAO,EAAE,IAAI;oBACb,KAAK,EAAE,MAAM;iBACd;gBACD,MAAM,EAAE;oBACN,OAAO,EAAE,IAAI;oBACb,KAAK,EAAE,YAAY;iBACpB;aACF,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;SACrB,CAAC,CAAA;IACJ,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,KAAK,CAChB,SAAiB,EACjB,KAaC,EACD,OAAwB;QAExB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAChC,yCAAyC,EACzC;YACE,OAAO,EAAE;gBACP,MAAM,EAAE,kBAAkB;aAC3B;YACD,MAAM,EAAE;gBACN,IAAI,EAAE;oBACJ,SAAS;iBACV;gBACD,KAAK;aACN;YACD,GAAG,OAAO;SACX,CACF,CAAA;QAED,OAAO,iBAAiB,CACtB,IAAI,CACgF,CAAA;IACxF,CAAC;CACF"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/portal/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,EAAE,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AACnE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAenE;;;GAGG;AACH,MAAM,OAAO,SAAS;IACZ,MAAM,CAAsC;IAEpD,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,YAAY,CAAQ;YAChC,GAAG,MAAM;YACT,OAAO,EAAE;gBACP,GAAG,MAAM,CAAC,OAAO;gBACjB,aAAa,EAAE,UAAU,MAAM,CAAC,WAAW,EAAE;aAC9C;YACD,eAAe,EAAE,CAAC,CAAC,EAAE,EAAE,CACrB,qBAAqB,CAAC;gBACpB,KAAK,EAAE;oBACL,OAAO,EAAE,IAAI;oBACb,KAAK,EAAE,MAAM;iBACd;gBACD,MAAM,EAAE;oBACN,OAAO,EAAE,IAAI;oBACb,KAAK,EAAE,YAAY;iBACpB;aACF,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;SACrB,CAAC,CAAA;IACJ,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,KAAK,CAChB,SAAiB,EACjB,KAaC,EACD,OAAwB;QAExB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAChC,yCAAyC,EACzC;YACE,OAAO,EAAE;gBACP,MAAM,EAAE,kBAAkB;aAC3B;YACD,MAAM,EAAE;gBACN,IAAI,EAAE;oBACJ,SAAS;iBACV;gBACD,KAAK;aACN;YACD,GAAG,OAAO;SACX,CACF,CAAA;QAED,OAAO,iBAAiB,CACtB,IAAI,CACgF,CAAA;IACxF,CAAC;CACF"}