@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.
- package/dist/cjs/src/client/addons.cjs +105 -0
- package/dist/cjs/src/client/addons.d.cts +147 -0
- package/dist/cjs/src/client/addons.js.map +1 -0
- package/dist/cjs/src/client/entitlements.d.cts +1 -1
- package/dist/cjs/src/client/index.cjs +6 -0
- package/dist/cjs/src/client/index.d.cts +4 -0
- package/dist/cjs/src/client/index.js.map +1 -1
- package/dist/cjs/src/client/notifications.d.cts +2 -2
- package/dist/cjs/src/client/schemas.d.cts +20 -30
- package/dist/cjs/src/client/subscription-addons.cjs +70 -0
- package/dist/cjs/src/client/subscription-addons.d.cts +123 -0
- package/dist/cjs/src/client/subscription-addons.js.map +1 -0
- package/dist/cjs/src/portal/index.cjs +35 -6
- package/dist/cjs/src/portal/index.js.map +1 -1
- package/dist/cjs/src/zod/index.cjs +0 -4
- package/dist/cjs/src/zod/index.d.cts +1996 -1999
- package/dist/cjs/src/zod/index.js.map +1 -1
- package/dist/cjs/tsconfig.38c40c16.tsbuildinfo +1 -0
- package/dist/cjs/tsconfig.a243a3bf.tsbuildinfo +1 -0
- package/dist/src/client/addons.d.ts +147 -0
- package/dist/src/client/addons.js +101 -0
- package/dist/src/client/addons.js.map +1 -0
- package/dist/src/client/entitlements.d.ts +1 -1
- package/dist/src/client/index.d.ts +4 -0
- package/dist/src/client/index.js +6 -0
- package/dist/src/client/index.js.map +1 -1
- package/dist/src/client/notifications.d.ts +2 -2
- package/dist/src/client/schemas.d.ts +20 -30
- package/dist/src/client/subscription-addons.d.ts +123 -0
- package/dist/src/client/subscription-addons.js +66 -0
- package/dist/src/client/subscription-addons.js.map +1 -0
- package/dist/src/portal/index.js +1 -2
- package/dist/src/portal/index.js.map +1 -1
- package/dist/src/zod/index.d.ts +1996 -1999
- package/dist/src/zod/index.js +0 -4
- package/dist/src/zod/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +18 -18
- package/dist/cjs/tsconfig.2f45a57b.tsbuildinfo +0 -1
- package/dist/cjs/tsconfig.ed32b929.tsbuildinfo +0 -1
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import type { RequestOptions } from './common.cjs';
|
|
2
|
+
import type { operations, paths } from './schemas.cjs';
|
|
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.cjs").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.cjs").components["schemas"]["AddonInstanceType"];
|
|
29
|
+
};
|
|
30
|
+
readonly quantityAt: Date;
|
|
31
|
+
quantity: number;
|
|
32
|
+
readonly timeline: import("./schemas.cjs").components["schemas"]["SubscriptionAddonTimelineSegment"][];
|
|
33
|
+
readonly subscriptionId: string;
|
|
34
|
+
readonly rateCards: import("./schemas.cjs").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.cjs").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.cjs").components["schemas"]["AddonInstanceType"];
|
|
57
|
+
};
|
|
58
|
+
readonly quantityAt: Date;
|
|
59
|
+
quantity: number;
|
|
60
|
+
readonly timeline: import("./schemas.cjs").components["schemas"]["SubscriptionAddonTimelineSegment"][];
|
|
61
|
+
readonly subscriptionId: string;
|
|
62
|
+
readonly rateCards: import("./schemas.cjs").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.cjs").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.cjs").components["schemas"]["AddonInstanceType"];
|
|
86
|
+
};
|
|
87
|
+
readonly quantityAt: Date;
|
|
88
|
+
quantity: number;
|
|
89
|
+
readonly timeline: import("./schemas.cjs").components["schemas"]["SubscriptionAddonTimelineSegment"][];
|
|
90
|
+
readonly subscriptionId: string;
|
|
91
|
+
readonly rateCards: import("./schemas.cjs").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.cjs").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.cjs").components["schemas"]["AddonInstanceType"];
|
|
116
|
+
};
|
|
117
|
+
readonly quantityAt: Date;
|
|
118
|
+
quantity: number;
|
|
119
|
+
readonly timeline: import("./schemas.cjs").components["schemas"]["SubscriptionAddonTimelineSegment"][];
|
|
120
|
+
readonly subscriptionId: string;
|
|
121
|
+
readonly rateCards: import("./schemas.cjs").components["schemas"]["SubscriptionAddonRateCard"][];
|
|
122
|
+
}>;
|
|
123
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription-addons.js","sourceRoot":"","sources":["../../../../src/client/subscription-addons.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAK9C,MAAa,kBAAkB;IACT;IAApB,YAAoB,MAA4C;QAA5C,WAAM,GAAN,MAAM,CAAsC;IAAG,CAAC;IAEpE;;;;;;OAMG;IACI,KAAK,CAAC,MAAM,CACjB,cAAsB,EACtB,KAA0F,EAC1F,OAAwB;QAExB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CACjC,+CAA+C,EAC/C;YACE,IAAI,EAAE,KAAK;YACX,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,cAAc,EAAE,EAAE;YACpC,GAAG,OAAO;SACX,CACF,CAAA;QAED,OAAO,IAAA,4BAAiB,EAAC,IAAI,CAAC,CAAA;IAChC,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,IAAI,CAAC,cAAsB,EAAE,OAAwB;QAChE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAChC,+CAA+C,EAC/C;YACE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,cAAc,EAAE,EAAE;YACpC,GAAG,OAAO;SACX,CACF,CAAA;QAED,OAAO,IAAA,4BAAiB,EAAC,IAAI,CAAC,CAAA;IAChC,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,GAAG,CACd,cAAsB,EACtB,mBAA2B,EAC3B,OAAwB;QAExB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAChC,qEAAqE,EACrE;YACE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,mBAAmB,EAAE,cAAc,EAAE,EAAE;YACzD,GAAG,OAAO;SACX,CACF,CAAA;QAED,OAAO,IAAA,4BAAiB,EAAC,IAAI,CAAC,CAAA;IAChC,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,MAAM,CACjB,cAAsB,EACtB,mBAA2B,EAC3B,KAA0F,EAC1F,OAAwB;QAExB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAClC,qEAAqE,EACrE;YACE,IAAI,EAAE,KAAK;YACX,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,mBAAmB,EAAE,cAAc,EAAE,EAAE;YACzD,GAAG,OAAO;SACX,CACF,CAAA;QAED,OAAO,IAAA,4BAAiB,EAAC,IAAI,CAAC,CAAA;IAChC,CAAC;CACF;AA7FD,gDA6FC"}
|
|
@@ -1,11 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
5
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
36
|
exports.OpenMeter = void 0;
|
|
7
|
-
const openapi_fetch_1 =
|
|
8
|
-
const index_cjs_1 = require("openapi-fetch/dist/cjs/index.cjs");
|
|
37
|
+
const openapi_fetch_1 = __importStar(require("openapi-fetch"));
|
|
9
38
|
const utils_js_1 = require("../client/utils.cjs");
|
|
10
39
|
/**
|
|
11
40
|
* OpenMeter Portal Client
|
|
@@ -20,7 +49,7 @@ class OpenMeter {
|
|
|
20
49
|
...config.headers,
|
|
21
50
|
Authorization: `Bearer ${config.portalToken}`,
|
|
22
51
|
},
|
|
23
|
-
querySerializer: (q) => (0,
|
|
52
|
+
querySerializer: (q) => (0, openapi_fetch_1.createQuerySerializer)({
|
|
24
53
|
array: {
|
|
25
54
|
explode: true,
|
|
26
55
|
style: 'form',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/portal/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/portal/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+DAAmE;AACnE,iDAAmE;AAenE;;;GAGG;AACH,MAAa,SAAS;IACZ,MAAM,CAAsC;IAEpD,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,IAAA,uBAAY,EAAQ;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,IAAA,qCAAqB,EAAC;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,IAAA,sBAAW,EAAC,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,IAAA,4BAAiB,EACtB,IAAI,CACgF,CAAA;IACxF,CAAC;CACF;AAtED,8BAsEC"}
|
|
@@ -3484,10 +3484,6 @@ exports.updateInvoiceBody = zod_1.z
|
|
|
3484
3484
|
.max(exports.updateInvoiceBodyDescriptionMax)
|
|
3485
3485
|
.optional()
|
|
3486
3486
|
.describe('Optional description of the resource. Maximum 1024 characters.'),
|
|
3487
|
-
draftUntil: zod_1.z
|
|
3488
|
-
.date()
|
|
3489
|
-
.optional()
|
|
3490
|
-
.describe('The time until the invoice is in draft status.\n\nOn draft invoice creation it is calculated from the workflow settings.\n\nIf manual approval is required, the draftUntil time is set.'),
|
|
3491
3487
|
lines: zod_1.z
|
|
3492
3488
|
.array(zod_1.z
|
|
3493
3489
|
.discriminatedUnion('type', [
|