@openmeter/client 1.0.0-beta.228 → 1.0.0-beta.229
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/README.md +108 -108
- package/dist/funcs/addons.js +18 -14
- package/dist/funcs/apps.js +1 -3
- package/dist/funcs/billing.js +1 -3
- package/dist/funcs/customers.js +33 -19
- package/dist/funcs/features.js +13 -7
- package/dist/funcs/governance.js +5 -1
- package/dist/funcs/llmCost.js +7 -5
- package/dist/funcs/meters.js +13 -7
- package/dist/funcs/planAddons.js +19 -8
- package/dist/funcs/plans.js +9 -11
- package/dist/funcs/subscriptions.js +19 -14
- package/dist/funcs/tax.js +10 -6
- package/dist/lib/config.js +1 -7
- package/dist/models/operations/customers.d.ts +1 -1
- package/dist/models/schemas.d.ts +9 -9
- package/dist/models/schemas.js +927 -930
- package/dist/models/types.d.ts +119 -119
- package/dist/sdk/apps.js +1 -1
- package/dist/sdk/entitlements.js +1 -1
- package/dist/sdk/events.js +1 -1
- package/dist/sdk/governance.js +1 -1
- package/package.json +1 -1
package/dist/funcs/meters.js
CHANGED
|
@@ -7,10 +7,10 @@ export function createMeter(client, req, options) {
|
|
|
7
7
|
.json());
|
|
8
8
|
}
|
|
9
9
|
export function getMeter(client, req, options) {
|
|
10
|
-
const path = encodePath('openmeter/meters/{meterId}', {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const path = encodePath('openmeter/meters/{meterId}', {
|
|
11
|
+
meterId: req.meterId,
|
|
12
|
+
});
|
|
13
|
+
return request(() => http(client).get(path, options).json());
|
|
14
14
|
}
|
|
15
15
|
export function listMeters(client, req = {}, options) {
|
|
16
16
|
const searchParams = toURLSearchParams({
|
|
@@ -23,19 +23,25 @@ export function listMeters(client, req = {}, options) {
|
|
|
23
23
|
.json());
|
|
24
24
|
}
|
|
25
25
|
export function updateMeter(client, req, options) {
|
|
26
|
-
const path = encodePath('openmeter/meters/{meterId}', {
|
|
26
|
+
const path = encodePath('openmeter/meters/{meterId}', {
|
|
27
|
+
meterId: req.meterId,
|
|
28
|
+
});
|
|
27
29
|
return request(() => http(client)
|
|
28
30
|
.put(path, { ...options, json: req.body })
|
|
29
31
|
.json());
|
|
30
32
|
}
|
|
31
33
|
export function deleteMeter(client, req, options) {
|
|
32
|
-
const path = encodePath('openmeter/meters/{meterId}', {
|
|
34
|
+
const path = encodePath('openmeter/meters/{meterId}', {
|
|
35
|
+
meterId: req.meterId,
|
|
36
|
+
});
|
|
33
37
|
return request(async () => {
|
|
34
38
|
await http(client).delete(path, options);
|
|
35
39
|
});
|
|
36
40
|
}
|
|
37
41
|
export function queryMeter(client, req, options) {
|
|
38
|
-
const path = encodePath('openmeter/meters/{meterId}/query', {
|
|
42
|
+
const path = encodePath('openmeter/meters/{meterId}/query', {
|
|
43
|
+
meterId: req.meterId,
|
|
44
|
+
});
|
|
39
45
|
return request(() => http(client)
|
|
40
46
|
.post(path, { ...options, json: req.body })
|
|
41
47
|
.json());
|
package/dist/funcs/planAddons.js
CHANGED
|
@@ -5,31 +5,42 @@ export function listPlanAddons(client, req, options) {
|
|
|
5
5
|
const searchParams = toURLSearchParams({
|
|
6
6
|
page: req.page,
|
|
7
7
|
});
|
|
8
|
-
const path = encodePath('openmeter/plans/{planId}/addons', {
|
|
8
|
+
const path = encodePath('openmeter/plans/{planId}/addons', {
|
|
9
|
+
planId: req.planId,
|
|
10
|
+
});
|
|
9
11
|
return request(() => http(client)
|
|
10
12
|
.get(path, { ...options, searchParams })
|
|
11
13
|
.json());
|
|
12
14
|
}
|
|
13
15
|
export function createPlanAddon(client, req, options) {
|
|
14
|
-
const path = encodePath('openmeter/plans/{planId}/addons', {
|
|
16
|
+
const path = encodePath('openmeter/plans/{planId}/addons', {
|
|
17
|
+
planId: req.planId,
|
|
18
|
+
});
|
|
15
19
|
return request(() => http(client)
|
|
16
20
|
.post(path, { ...options, json: req.body })
|
|
17
21
|
.json());
|
|
18
22
|
}
|
|
19
23
|
export function getPlanAddon(client, req, options) {
|
|
20
|
-
const path = encodePath('openmeter/plans/{planId}/addons/{planAddonId}', {
|
|
21
|
-
|
|
22
|
-
.
|
|
23
|
-
|
|
24
|
+
const path = encodePath('openmeter/plans/{planId}/addons/{planAddonId}', {
|
|
25
|
+
planId: req.planId,
|
|
26
|
+
planAddonId: req.planAddonId,
|
|
27
|
+
});
|
|
28
|
+
return request(() => http(client).get(path, options).json());
|
|
24
29
|
}
|
|
25
30
|
export function updatePlanAddon(client, req, options) {
|
|
26
|
-
const path = encodePath('openmeter/plans/{planId}/addons/{planAddonId}', {
|
|
31
|
+
const path = encodePath('openmeter/plans/{planId}/addons/{planAddonId}', {
|
|
32
|
+
planId: req.planId,
|
|
33
|
+
planAddonId: req.planAddonId,
|
|
34
|
+
});
|
|
27
35
|
return request(() => http(client)
|
|
28
36
|
.put(path, { ...options, json: req.body })
|
|
29
37
|
.json());
|
|
30
38
|
}
|
|
31
39
|
export function deletePlanAddon(client, req, options) {
|
|
32
|
-
const path = encodePath('openmeter/plans/{planId}/addons/{planAddonId}', {
|
|
40
|
+
const path = encodePath('openmeter/plans/{planId}/addons/{planAddonId}', {
|
|
41
|
+
planId: req.planId,
|
|
42
|
+
planAddonId: req.planAddonId,
|
|
43
|
+
});
|
|
33
44
|
return request(async () => {
|
|
34
45
|
await http(client).delete(path, options);
|
|
35
46
|
});
|
package/dist/funcs/plans.js
CHANGED
|
@@ -24,9 +24,7 @@ export function updatePlan(client, req, options) {
|
|
|
24
24
|
}
|
|
25
25
|
export function getPlan(client, req, options) {
|
|
26
26
|
const path = encodePath('openmeter/plans/{planId}', { planId: req.planId });
|
|
27
|
-
return request(() => http(client)
|
|
28
|
-
.get(path, options)
|
|
29
|
-
.json());
|
|
27
|
+
return request(() => http(client).get(path, options).json());
|
|
30
28
|
}
|
|
31
29
|
export function deletePlan(client, req, options) {
|
|
32
30
|
const path = encodePath('openmeter/plans/{planId}', { planId: req.planId });
|
|
@@ -35,15 +33,15 @@ export function deletePlan(client, req, options) {
|
|
|
35
33
|
});
|
|
36
34
|
}
|
|
37
35
|
export function archivePlan(client, req, options) {
|
|
38
|
-
const path = encodePath('openmeter/plans/{planId}/archive', {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
const path = encodePath('openmeter/plans/{planId}/archive', {
|
|
37
|
+
planId: req.planId,
|
|
38
|
+
});
|
|
39
|
+
return request(() => http(client).post(path, options).json());
|
|
42
40
|
}
|
|
43
41
|
export function publishPlan(client, req, options) {
|
|
44
|
-
const path = encodePath('openmeter/plans/{planId}/publish', {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
const path = encodePath('openmeter/plans/{planId}/publish', {
|
|
43
|
+
planId: req.planId,
|
|
44
|
+
});
|
|
45
|
+
return request(() => http(client).post(path, options).json());
|
|
48
46
|
}
|
|
49
47
|
//# sourceMappingURL=plans.js.map
|
|
@@ -17,25 +17,27 @@ export function listSubscriptions(client, req = {}, options) {
|
|
|
17
17
|
.json());
|
|
18
18
|
}
|
|
19
19
|
export function getSubscription(client, req, options) {
|
|
20
|
-
const path = encodePath('openmeter/subscriptions/{subscriptionId}', {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
const path = encodePath('openmeter/subscriptions/{subscriptionId}', {
|
|
21
|
+
subscriptionId: req.subscriptionId,
|
|
22
|
+
});
|
|
23
|
+
return request(() => http(client).get(path, options).json());
|
|
24
24
|
}
|
|
25
25
|
export function cancelSubscription(client, req, options) {
|
|
26
|
-
const path = encodePath('openmeter/subscriptions/{subscriptionId}/cancel', {
|
|
26
|
+
const path = encodePath('openmeter/subscriptions/{subscriptionId}/cancel', {
|
|
27
|
+
subscriptionId: req.subscriptionId,
|
|
28
|
+
});
|
|
27
29
|
return request(() => http(client)
|
|
28
30
|
.post(path, { ...options, json: req.body })
|
|
29
31
|
.json());
|
|
30
32
|
}
|
|
31
33
|
export function unscheduleCancelation(client, req, options) {
|
|
32
34
|
const path = encodePath('openmeter/subscriptions/{subscriptionId}/unschedule-cancelation', { subscriptionId: req.subscriptionId });
|
|
33
|
-
return request(() => http(client)
|
|
34
|
-
.post(path, options)
|
|
35
|
-
.json());
|
|
35
|
+
return request(() => http(client).post(path, options).json());
|
|
36
36
|
}
|
|
37
37
|
export function changeSubscription(client, req, options) {
|
|
38
|
-
const path = encodePath('openmeter/subscriptions/{subscriptionId}/change', {
|
|
38
|
+
const path = encodePath('openmeter/subscriptions/{subscriptionId}/change', {
|
|
39
|
+
subscriptionId: req.subscriptionId,
|
|
40
|
+
});
|
|
39
41
|
return request(() => http(client)
|
|
40
42
|
.post(path, { ...options, json: req.body })
|
|
41
43
|
.json());
|
|
@@ -45,15 +47,18 @@ export function listSubscriptionAddons(client, req, options) {
|
|
|
45
47
|
page: req.page,
|
|
46
48
|
sort: encodeSort(req.sort),
|
|
47
49
|
});
|
|
48
|
-
const path = encodePath('openmeter/subscriptions/{subscriptionId}/addons', {
|
|
50
|
+
const path = encodePath('openmeter/subscriptions/{subscriptionId}/addons', {
|
|
51
|
+
subscriptionId: req.subscriptionId,
|
|
52
|
+
});
|
|
49
53
|
return request(() => http(client)
|
|
50
54
|
.get(path, { ...options, searchParams })
|
|
51
55
|
.json());
|
|
52
56
|
}
|
|
53
57
|
export function getSubscriptionAddon(client, req, options) {
|
|
54
|
-
const path = encodePath('openmeter/subscriptions/{subscriptionId}/addons/{subscriptionAddonId}', {
|
|
55
|
-
|
|
56
|
-
.
|
|
57
|
-
|
|
58
|
+
const path = encodePath('openmeter/subscriptions/{subscriptionId}/addons/{subscriptionAddonId}', {
|
|
59
|
+
subscriptionId: req.subscriptionId,
|
|
60
|
+
subscriptionAddonId: req.subscriptionAddonId,
|
|
61
|
+
});
|
|
62
|
+
return request(() => http(client).get(path, options).json());
|
|
58
63
|
}
|
|
59
64
|
//# sourceMappingURL=subscriptions.js.map
|
package/dist/funcs/tax.js
CHANGED
|
@@ -7,10 +7,10 @@ export function createTaxCode(client, req, options) {
|
|
|
7
7
|
.json());
|
|
8
8
|
}
|
|
9
9
|
export function getTaxCode(client, req, options) {
|
|
10
|
-
const path = encodePath('openmeter/tax-codes/{taxCodeId}', {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const path = encodePath('openmeter/tax-codes/{taxCodeId}', {
|
|
11
|
+
taxCodeId: req.taxCodeId,
|
|
12
|
+
});
|
|
13
|
+
return request(() => http(client).get(path, options).json());
|
|
14
14
|
}
|
|
15
15
|
export function listTaxCodes(client, req = {}, options) {
|
|
16
16
|
const searchParams = toURLSearchParams({
|
|
@@ -22,13 +22,17 @@ export function listTaxCodes(client, req = {}, options) {
|
|
|
22
22
|
.json());
|
|
23
23
|
}
|
|
24
24
|
export function upsertTaxCode(client, req, options) {
|
|
25
|
-
const path = encodePath('openmeter/tax-codes/{taxCodeId}', {
|
|
25
|
+
const path = encodePath('openmeter/tax-codes/{taxCodeId}', {
|
|
26
|
+
taxCodeId: req.taxCodeId,
|
|
27
|
+
});
|
|
26
28
|
return request(() => http(client)
|
|
27
29
|
.put(path, { ...options, json: req.body })
|
|
28
30
|
.json());
|
|
29
31
|
}
|
|
30
32
|
export function deleteTaxCode(client, req, options) {
|
|
31
|
-
const path = encodePath('openmeter/tax-codes/{taxCodeId}', {
|
|
33
|
+
const path = encodePath('openmeter/tax-codes/{taxCodeId}', {
|
|
34
|
+
taxCodeId: req.taxCodeId,
|
|
35
|
+
});
|
|
32
36
|
return request(async () => {
|
|
33
37
|
await http(client).delete(path, options);
|
|
34
38
|
});
|
package/dist/lib/config.js
CHANGED
|
@@ -3,11 +3,5 @@ export const ServerList = [
|
|
|
3
3
|
'http://localhost:{port}/api/v3',
|
|
4
4
|
'https://openmeter.cloud/api/v3',
|
|
5
5
|
];
|
|
6
|
-
export const Regions = [
|
|
7
|
-
'in',
|
|
8
|
-
'me',
|
|
9
|
-
'au',
|
|
10
|
-
'eu',
|
|
11
|
-
'us',
|
|
12
|
-
];
|
|
6
|
+
export const Regions = ['in', 'me', 'au', 'eu', 'us'];
|
|
13
7
|
//# sourceMappingURL=config.js.map
|
|
@@ -108,7 +108,7 @@ export interface ListCustomerChargesQuery {
|
|
|
108
108
|
/** Filter charges. To filter charges by status add the following query param: `filter[status][oeq]=created,active` */
|
|
109
109
|
filter?: ListChargesParamsFilter;
|
|
110
110
|
/** Expand full objects for referenced entities. Supported values are: - `real_time_usage`: Expand the charge's real-time usage. */
|
|
111
|
-
expand?:
|
|
111
|
+
expand?: 'real_time_usage'[];
|
|
112
112
|
}
|
|
113
113
|
export type ListCustomerChargesRequest = ListCustomerChargesQuery & {
|
|
114
114
|
customerId: string;
|
package/dist/models/schemas.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
export declare const labels: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
3
3
|
export declare const currencyCode: z.ZodString;
|
|
4
4
|
export declare const numeric: z.ZodString;
|
|
@@ -2725,7 +2725,7 @@ export declare const createCreditGrantRequest: z.ZodObject<{
|
|
|
2725
2725
|
filters: z.ZodOptional<z.ZodObject<{
|
|
2726
2726
|
features: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2727
2727
|
}, z.core.$strip>>;
|
|
2728
|
-
priority: z.ZodDefault<z.ZodOptional<z.
|
|
2728
|
+
priority: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
2729
2729
|
expires_after: z.ZodOptional<z.ZodString>;
|
|
2730
2730
|
}, z.core.$strip>;
|
|
2731
2731
|
export declare const creditGrant: z.ZodObject<{
|
|
@@ -2774,7 +2774,7 @@ export declare const creditGrant: z.ZodObject<{
|
|
|
2774
2774
|
filters: z.ZodOptional<z.ZodObject<{
|
|
2775
2775
|
features: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2776
2776
|
}, z.core.$strip>>;
|
|
2777
|
-
priority: z.ZodDefault<z.ZodOptional<z.
|
|
2777
|
+
priority: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
2778
2778
|
expires_after: z.ZodOptional<z.ZodString>;
|
|
2779
2779
|
expires_at: z.ZodOptional<z.ZodString>;
|
|
2780
2780
|
voided_at: z.ZodOptional<z.ZodString>;
|
|
@@ -3578,7 +3578,7 @@ export declare const creditGrantPagePaginatedResponse: z.ZodObject<{
|
|
|
3578
3578
|
filters: z.ZodOptional<z.ZodObject<{
|
|
3579
3579
|
features: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3580
3580
|
}, z.core.$strip>>;
|
|
3581
|
-
priority: z.ZodDefault<z.ZodOptional<z.
|
|
3581
|
+
priority: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
3582
3582
|
expires_after: z.ZodOptional<z.ZodString>;
|
|
3583
3583
|
expires_at: z.ZodOptional<z.ZodString>;
|
|
3584
3584
|
voided_at: z.ZodOptional<z.ZodString>;
|
|
@@ -6957,7 +6957,7 @@ export declare const createCreditGrantBody: z.ZodObject<{
|
|
|
6957
6957
|
filters: z.ZodOptional<z.ZodObject<{
|
|
6958
6958
|
features: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6959
6959
|
}, z.core.$strip>>;
|
|
6960
|
-
priority: z.ZodDefault<z.ZodOptional<z.
|
|
6960
|
+
priority: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
6961
6961
|
expires_after: z.ZodOptional<z.ZodString>;
|
|
6962
6962
|
}, z.core.$strip>;
|
|
6963
6963
|
export declare const createCreditGrantResponse: z.ZodObject<{
|
|
@@ -7006,7 +7006,7 @@ export declare const createCreditGrantResponse: z.ZodObject<{
|
|
|
7006
7006
|
filters: z.ZodOptional<z.ZodObject<{
|
|
7007
7007
|
features: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
7008
7008
|
}, z.core.$strip>>;
|
|
7009
|
-
priority: z.ZodDefault<z.ZodOptional<z.
|
|
7009
|
+
priority: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
7010
7010
|
expires_after: z.ZodOptional<z.ZodString>;
|
|
7011
7011
|
expires_at: z.ZodOptional<z.ZodString>;
|
|
7012
7012
|
voided_at: z.ZodOptional<z.ZodString>;
|
|
@@ -7067,7 +7067,7 @@ export declare const getCreditGrantResponse: z.ZodObject<{
|
|
|
7067
7067
|
filters: z.ZodOptional<z.ZodObject<{
|
|
7068
7068
|
features: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
7069
7069
|
}, z.core.$strip>>;
|
|
7070
|
-
priority: z.ZodDefault<z.ZodOptional<z.
|
|
7070
|
+
priority: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
7071
7071
|
expires_after: z.ZodOptional<z.ZodString>;
|
|
7072
7072
|
expires_at: z.ZodOptional<z.ZodString>;
|
|
7073
7073
|
voided_at: z.ZodOptional<z.ZodString>;
|
|
@@ -7143,7 +7143,7 @@ export declare const listCreditGrantsResponse: z.ZodObject<{
|
|
|
7143
7143
|
filters: z.ZodOptional<z.ZodObject<{
|
|
7144
7144
|
features: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
7145
7145
|
}, z.core.$strip>>;
|
|
7146
|
-
priority: z.ZodDefault<z.ZodOptional<z.
|
|
7146
|
+
priority: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
7147
7147
|
expires_after: z.ZodOptional<z.ZodString>;
|
|
7148
7148
|
expires_at: z.ZodOptional<z.ZodString>;
|
|
7149
7149
|
voided_at: z.ZodOptional<z.ZodString>;
|
|
@@ -7257,7 +7257,7 @@ export declare const updateCreditGrantExternalSettlementResponse: z.ZodObject<{
|
|
|
7257
7257
|
filters: z.ZodOptional<z.ZodObject<{
|
|
7258
7258
|
features: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
7259
7259
|
}, z.core.$strip>>;
|
|
7260
|
-
priority: z.ZodDefault<z.ZodOptional<z.
|
|
7260
|
+
priority: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
7261
7261
|
expires_after: z.ZodOptional<z.ZodString>;
|
|
7262
7262
|
expires_at: z.ZodOptional<z.ZodString>;
|
|
7263
7263
|
voided_at: z.ZodOptional<z.ZodString>;
|