@openmeter/client 1.0.0-beta.230 → 1.0.0-beta.232
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/LICENSE +202 -0
- package/README.md +365 -76
- package/dist/core.d.ts +0 -1
- package/dist/core.js +11 -1
- package/dist/funcs/addons.d.ts +49 -1
- package/dist/funcs/addons.js +109 -12
- package/dist/funcs/apps.d.ts +55 -2
- package/dist/funcs/apps.js +179 -4
- package/dist/funcs/billing.d.ts +46 -1
- package/dist/funcs/billing.js +81 -8
- package/dist/funcs/currencies.d.ts +39 -2
- package/dist/funcs/currencies.js +93 -6
- package/dist/funcs/customers.d.ts +165 -2
- package/dist/funcs/customers.js +402 -40
- package/dist/funcs/defaults.d.ts +10 -1
- package/dist/funcs/defaults.js +11 -1
- package/dist/funcs/entitlements.d.ts +5 -1
- package/dist/funcs/entitlements.js +18 -4
- package/dist/funcs/events.d.ts +14 -1
- package/dist/funcs/events.js +18 -1
- package/dist/funcs/features.d.ts +42 -1
- package/dist/funcs/features.js +91 -10
- package/dist/funcs/governance.d.ts +14 -1
- package/dist/funcs/governance.js +15 -1
- package/dist/funcs/index.d.ts +0 -1
- package/dist/funcs/index.js +1 -1
- package/dist/funcs/invoices.d.ts +102 -2
- package/dist/funcs/invoices.js +247 -8
- package/dist/funcs/llmCost.d.ts +36 -1
- package/dist/funcs/llmCost.js +63 -6
- package/dist/funcs/meters.d.ts +53 -1
- package/dist/funcs/meters.js +113 -12
- package/dist/funcs/planAddons.d.ts +35 -1
- package/dist/funcs/planAddons.js +101 -18
- package/dist/funcs/plans.d.ts +49 -1
- package/dist/funcs/plans.js +109 -12
- package/dist/funcs/subscriptions.d.ts +59 -1
- package/dist/funcs/subscriptions.js +147 -18
- package/dist/funcs/tax.d.ts +25 -1
- package/dist/funcs/tax.js +60 -8
- package/dist/index.d.ts +4 -7
- package/dist/index.js +4 -6
- package/dist/lib/config.d.ts +2 -3
- package/dist/lib/config.js +1 -1
- package/dist/lib/encodings.d.ts +0 -1
- package/dist/lib/encodings.js +1 -1
- package/dist/lib/paginate.d.ts +56 -0
- package/dist/lib/paginate.js +60 -0
- package/dist/lib/request.d.ts +0 -1
- package/dist/lib/request.js +1 -1
- package/dist/lib/to-error.d.ts +0 -1
- package/dist/lib/to-error.js +1 -1
- package/dist/lib/types.d.ts +0 -1
- package/dist/lib/types.js +1 -1
- package/dist/lib/version.d.ts +1 -0
- package/dist/lib/version.js +5 -0
- package/dist/lib/wire.d.ts +4 -1
- package/dist/lib/wire.js +118 -7
- package/dist/models/errors.d.ts +13 -2
- package/dist/models/errors.js +31 -4
- package/dist/models/operations/addons.d.ts +0 -1
- package/dist/models/operations/addons.js +1 -1
- package/dist/models/operations/apps.d.ts +26 -5
- package/dist/models/operations/apps.js +1 -1
- package/dist/models/operations/billing.d.ts +0 -1
- package/dist/models/operations/billing.js +1 -1
- package/dist/models/operations/currencies.d.ts +10 -1
- package/dist/models/operations/currencies.js +1 -1
- package/dist/models/operations/customers.d.ts +11 -7
- package/dist/models/operations/customers.js +1 -1
- package/dist/models/operations/defaults.d.ts +0 -1
- package/dist/models/operations/defaults.js +1 -1
- package/dist/models/operations/entitlements.d.ts +0 -1
- package/dist/models/operations/entitlements.js +1 -1
- package/dist/models/operations/events.d.ts +0 -1
- package/dist/models/operations/events.js +1 -1
- package/dist/models/operations/features.d.ts +0 -1
- package/dist/models/operations/features.js +1 -1
- package/dist/models/operations/governance.d.ts +0 -1
- package/dist/models/operations/governance.js +1 -1
- package/dist/models/operations/invoices.d.ts +20 -7
- package/dist/models/operations/invoices.js +1 -1
- package/dist/models/operations/llmCost.d.ts +0 -1
- package/dist/models/operations/llmCost.js +1 -1
- package/dist/models/operations/meters.d.ts +0 -1
- package/dist/models/operations/meters.js +1 -1
- package/dist/models/operations/planAddons.d.ts +0 -1
- package/dist/models/operations/planAddons.js +1 -1
- package/dist/models/operations/plans.d.ts +0 -1
- package/dist/models/operations/plans.js +1 -1
- package/dist/models/operations/subscriptions.d.ts +0 -1
- package/dist/models/operations/subscriptions.js +1 -1
- package/dist/models/operations/tax.d.ts +0 -1
- package/dist/models/operations/tax.js +1 -1
- package/dist/models/schemas.d.ts +11651 -6090
- package/dist/models/schemas.js +991 -468
- package/dist/models/types.d.ts +941 -810
- package/dist/models/types.js +1 -1
- package/dist/sdk/addons.d.ts +60 -1
- package/dist/sdk/addons.js +63 -1
- package/dist/sdk/apps.d.ts +68 -2
- package/dist/sdk/apps.js +81 -2
- package/dist/sdk/billing.d.ts +57 -1
- package/dist/sdk/billing.js +60 -1
- package/dist/sdk/customers.d.ts +211 -2
- package/dist/sdk/customers.js +222 -2
- package/dist/sdk/defaults.d.ts +10 -1
- package/dist/sdk/defaults.js +11 -1
- package/dist/sdk/entitlements.d.ts +5 -1
- package/dist/sdk/entitlements.js +6 -1
- package/dist/sdk/events.d.ts +25 -1
- package/dist/sdk/events.js +28 -1
- package/dist/sdk/features.d.ts +53 -1
- package/dist/sdk/features.js +56 -1
- package/dist/sdk/internal.d.ts +328 -0
- package/dist/sdk/internal.js +404 -0
- package/dist/sdk/invoices.d.ts +5 -2
- package/dist/sdk/invoices.js +13 -2
- package/dist/sdk/llmCost.d.ts +57 -1
- package/dist/sdk/llmCost.js +62 -1
- package/dist/sdk/meters.d.ts +64 -1
- package/dist/sdk/meters.js +67 -1
- package/dist/sdk/planAddons.d.ts +46 -1
- package/dist/sdk/planAddons.js +49 -1
- package/dist/sdk/plans.d.ts +60 -1
- package/dist/sdk/plans.js +63 -1
- package/dist/sdk/sdk.d.ts +9 -13
- package/dist/sdk/sdk.js +11 -20
- package/dist/sdk/subscriptions.d.ts +72 -3
- package/dist/sdk/subscriptions.js +77 -5
- package/dist/sdk/tax.d.ts +34 -1
- package/dist/sdk/tax.js +37 -1
- package/package.json +30 -6
- package/dist/sdk/currencies.d.ts +0 -12
- package/dist/sdk/currencies.js +0 -21
- package/dist/sdk/governance.d.ts +0 -9
- package/dist/sdk/governance.js +0 -12
package/dist/funcs/defaults.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
|
|
1
2
|
import { http } from '../core.js';
|
|
2
3
|
import { request } from '../lib/request.js';
|
|
3
4
|
import { toWire, fromWire, assertValid } from '../lib/wire.js';
|
|
4
5
|
import * as schemas from '../models/schemas.js';
|
|
6
|
+
/**
|
|
7
|
+
* Get organization default tax codes
|
|
8
|
+
*
|
|
9
|
+
* GET /openmeter/defaults/tax-codes
|
|
10
|
+
*/
|
|
5
11
|
export function getOrganizationDefaultTaxCodes(client, req, options) {
|
|
6
12
|
return request(() => http(client)
|
|
7
13
|
.get('openmeter/defaults/tax-codes', options)
|
|
@@ -13,6 +19,11 @@ export function getOrganizationDefaultTaxCodes(client, req, options) {
|
|
|
13
19
|
return fromWire(data, schemas.getOrganizationDefaultTaxCodesResponse);
|
|
14
20
|
}));
|
|
15
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Update organization default tax codes
|
|
24
|
+
*
|
|
25
|
+
* PUT /openmeter/defaults/tax-codes
|
|
26
|
+
*/
|
|
16
27
|
export function updateOrganizationDefaultTaxCodes(client, req, options) {
|
|
17
28
|
return request(() => {
|
|
18
29
|
const body = toWire(req, schemas.updateOrganizationDefaultTaxCodesBody);
|
|
@@ -30,4 +41,3 @@ export function updateOrganizationDefaultTaxCodes(client, req, options) {
|
|
|
30
41
|
});
|
|
31
42
|
});
|
|
32
43
|
}
|
|
33
|
-
//# sourceMappingURL=defaults.js.map
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type Result, type RequestOptions } from '../lib/types.js';
|
|
3
3
|
import type { ListCustomerEntitlementAccessRequest, ListCustomerEntitlementAccessResponse } from '../models/operations/entitlements.js';
|
|
4
|
+
/**
|
|
5
|
+
* List customer entitlement access
|
|
6
|
+
*
|
|
7
|
+
* GET /openmeter/customers/{customerId}/entitlement-access
|
|
8
|
+
*/
|
|
4
9
|
export declare function listCustomerEntitlementAccess(client: Client, req: ListCustomerEntitlementAccessRequest, options?: RequestOptions): Promise<Result<ListCustomerEntitlementAccessResponse>>;
|
|
5
|
-
//# sourceMappingURL=entitlements.d.ts.map
|
|
@@ -1,14 +1,29 @@
|
|
|
1
|
+
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
|
|
1
2
|
import { http } from '../core.js';
|
|
2
3
|
import { request } from '../lib/request.js';
|
|
3
|
-
import { fromWire, assertValid } from '../lib/wire.js';
|
|
4
|
+
import { toPathWire, fromWire, assertValid } from '../lib/wire.js';
|
|
4
5
|
import * as schemas from '../models/schemas.js';
|
|
6
|
+
/**
|
|
7
|
+
* List customer entitlement access
|
|
8
|
+
*
|
|
9
|
+
* GET /openmeter/customers/{customerId}/entitlement-access
|
|
10
|
+
*/
|
|
5
11
|
export function listCustomerEntitlementAccess(client, req, options) {
|
|
6
12
|
return request(() => {
|
|
13
|
+
const pathParamsInput = {
|
|
14
|
+
customerId: req.customerId,
|
|
15
|
+
};
|
|
16
|
+
const pathParams = client._options.validate
|
|
17
|
+
? toPathWire(pathParamsInput, schemas.listCustomerEntitlementAccessPathParams)
|
|
18
|
+
: pathParamsInput;
|
|
19
|
+
if (client._options.validate) {
|
|
20
|
+
assertValid(schemas.listCustomerEntitlementAccessPathParamsWire, pathParams);
|
|
21
|
+
}
|
|
7
22
|
const path = `openmeter/customers/${(() => {
|
|
8
|
-
if (
|
|
23
|
+
if (pathParams.customerId === undefined) {
|
|
9
24
|
throw new Error('missing path parameter: customerId');
|
|
10
25
|
}
|
|
11
|
-
return encodeURIComponent(String(
|
|
26
|
+
return encodeURIComponent(String(pathParams.customerId));
|
|
12
27
|
})()}/entitlement-access`;
|
|
13
28
|
return http(client)
|
|
14
29
|
.get(path, options)
|
|
@@ -21,4 +36,3 @@ export function listCustomerEntitlementAccess(client, req, options) {
|
|
|
21
36
|
});
|
|
22
37
|
});
|
|
23
38
|
}
|
|
24
|
-
//# sourceMappingURL=entitlements.js.map
|
package/dist/funcs/events.d.ts
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type Result, type RequestOptions } from '../lib/types.js';
|
|
3
3
|
import type { ListMeteringEventsRequest, ListMeteringEventsResponse, IngestMeteringEventsRequest, IngestMeteringEventsResponse } from '../models/operations/events.js';
|
|
4
|
+
/**
|
|
5
|
+
* List metering events
|
|
6
|
+
*
|
|
7
|
+
* List ingested events.
|
|
8
|
+
*
|
|
9
|
+
* GET /openmeter/events
|
|
10
|
+
*/
|
|
4
11
|
export declare function listMeteringEvents(client: Client, req?: ListMeteringEventsRequest, options?: RequestOptions): Promise<Result<ListMeteringEventsResponse>>;
|
|
12
|
+
/**
|
|
13
|
+
* Ingest metering events
|
|
14
|
+
*
|
|
15
|
+
* Ingests an event or batch of events following the CloudEvents specification.
|
|
16
|
+
*
|
|
17
|
+
* POST /openmeter/events
|
|
18
|
+
*/
|
|
5
19
|
export declare function ingestMeteringEvents(client: Client, req: IngestMeteringEventsRequest, options?: RequestOptions): Promise<Result<IngestMeteringEventsResponse>>;
|
|
6
|
-
//# sourceMappingURL=events.d.ts.map
|
package/dist/funcs/events.js
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
|
+
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
|
|
1
2
|
import { http } from '../core.js';
|
|
2
3
|
import { request } from '../lib/request.js';
|
|
3
4
|
import { toURLSearchParams, encodeSort } from '../lib/encodings.js';
|
|
4
5
|
import { toWire, fromWire, assertValid, toSnakeCase } from '../lib/wire.js';
|
|
5
6
|
import * as schemas from '../models/schemas.js';
|
|
7
|
+
/**
|
|
8
|
+
* List metering events
|
|
9
|
+
*
|
|
10
|
+
* List ingested events.
|
|
11
|
+
*
|
|
12
|
+
* GET /openmeter/events
|
|
13
|
+
*/
|
|
6
14
|
export function listMeteringEvents(client, req = {}, options) {
|
|
7
15
|
return request(() => {
|
|
16
|
+
if (client._options.validate && req.sort !== undefined) {
|
|
17
|
+
assertValid(schemas.listMeteringEventsQueryParams.shape.sort, req.sort);
|
|
18
|
+
}
|
|
8
19
|
const query = toWire({
|
|
9
20
|
page: req.page,
|
|
10
21
|
filter: req.filter,
|
|
@@ -25,6 +36,13 @@ export function listMeteringEvents(client, req = {}, options) {
|
|
|
25
36
|
});
|
|
26
37
|
});
|
|
27
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Ingest metering events
|
|
41
|
+
*
|
|
42
|
+
* Ingests an event or batch of events following the CloudEvents specification.
|
|
43
|
+
*
|
|
44
|
+
* POST /openmeter/events
|
|
45
|
+
*/
|
|
28
46
|
export function ingestMeteringEvents(client, req, options) {
|
|
29
47
|
return request(async () => {
|
|
30
48
|
const body = toWire(req, schemas.ingestMeteringEventsBody);
|
|
@@ -34,4 +52,3 @@ export function ingestMeteringEvents(client, req, options) {
|
|
|
34
52
|
await http(client).post('openmeter/events', { ...options, json: body });
|
|
35
53
|
});
|
|
36
54
|
}
|
|
37
|
-
//# sourceMappingURL=events.js.map
|
package/dist/funcs/features.d.ts
CHANGED
|
@@ -1,10 +1,51 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type Result, type RequestOptions } from '../lib/types.js';
|
|
3
3
|
import type { ListFeaturesRequest, ListFeaturesResponse, CreateFeatureRequest, CreateFeatureResponse, GetFeatureRequest, GetFeatureResponse, UpdateFeatureRequest, UpdateFeatureResponse, DeleteFeatureRequest, DeleteFeatureResponse, QueryFeatureCostRequest, QueryFeatureCostResponse } from '../models/operations/features.js';
|
|
4
|
+
/**
|
|
5
|
+
* List features
|
|
6
|
+
*
|
|
7
|
+
* List all features.
|
|
8
|
+
*
|
|
9
|
+
* GET /openmeter/features
|
|
10
|
+
*/
|
|
4
11
|
export declare function listFeatures(client: Client, req?: ListFeaturesRequest, options?: RequestOptions): Promise<Result<ListFeaturesResponse>>;
|
|
12
|
+
/**
|
|
13
|
+
* Create feature
|
|
14
|
+
*
|
|
15
|
+
* Create a feature.
|
|
16
|
+
*
|
|
17
|
+
* POST /openmeter/features
|
|
18
|
+
*/
|
|
5
19
|
export declare function createFeature(client: Client, req: CreateFeatureRequest, options?: RequestOptions): Promise<Result<CreateFeatureResponse>>;
|
|
20
|
+
/**
|
|
21
|
+
* Get feature
|
|
22
|
+
*
|
|
23
|
+
* Get a feature by id.
|
|
24
|
+
*
|
|
25
|
+
* GET /openmeter/features/{featureId}
|
|
26
|
+
*/
|
|
6
27
|
export declare function getFeature(client: Client, req: GetFeatureRequest, options?: RequestOptions): Promise<Result<GetFeatureResponse>>;
|
|
28
|
+
/**
|
|
29
|
+
* Update feature
|
|
30
|
+
*
|
|
31
|
+
* Update a feature by id. Currently only the unit_cost field can be updated.
|
|
32
|
+
*
|
|
33
|
+
* PATCH /openmeter/features/{featureId}
|
|
34
|
+
*/
|
|
7
35
|
export declare function updateFeature(client: Client, req: UpdateFeatureRequest, options?: RequestOptions): Promise<Result<UpdateFeatureResponse>>;
|
|
36
|
+
/**
|
|
37
|
+
* Delete feature
|
|
38
|
+
*
|
|
39
|
+
* Delete a feature by id.
|
|
40
|
+
*
|
|
41
|
+
* DELETE /openmeter/features/{featureId}
|
|
42
|
+
*/
|
|
8
43
|
export declare function deleteFeature(client: Client, req: DeleteFeatureRequest, options?: RequestOptions): Promise<Result<DeleteFeatureResponse>>;
|
|
44
|
+
/**
|
|
45
|
+
* Query feature cost
|
|
46
|
+
*
|
|
47
|
+
* Query the cost of a feature.
|
|
48
|
+
*
|
|
49
|
+
* POST /openmeter/features/{featureId}/cost/query
|
|
50
|
+
*/
|
|
9
51
|
export declare function queryFeatureCost(client: Client, req: QueryFeatureCostRequest, options?: RequestOptions): Promise<Result<QueryFeatureCostResponse>>;
|
|
10
|
-
//# sourceMappingURL=features.d.ts.map
|
package/dist/funcs/features.js
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
|
+
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
|
|
1
2
|
import { http } from '../core.js';
|
|
2
3
|
import { request } from '../lib/request.js';
|
|
3
4
|
import { toURLSearchParams, encodeSort } from '../lib/encodings.js';
|
|
4
|
-
import { toWire, fromWire, assertValid, toSnakeCase } from '../lib/wire.js';
|
|
5
|
+
import { toWire, toPathWire, fromWire, assertValid, toSnakeCase, } from '../lib/wire.js';
|
|
5
6
|
import * as schemas from '../models/schemas.js';
|
|
7
|
+
/**
|
|
8
|
+
* List features
|
|
9
|
+
*
|
|
10
|
+
* List all features.
|
|
11
|
+
*
|
|
12
|
+
* GET /openmeter/features
|
|
13
|
+
*/
|
|
6
14
|
export function listFeatures(client, req = {}, options) {
|
|
7
15
|
return request(() => {
|
|
16
|
+
if (client._options.validate && req.sort !== undefined) {
|
|
17
|
+
assertValid(schemas.listFeaturesQueryParams.shape.sort, req.sort);
|
|
18
|
+
}
|
|
8
19
|
const query = toWire({
|
|
9
20
|
page: req.page,
|
|
10
21
|
sort: encodeSort(req.sort, toSnakeCase),
|
|
@@ -25,6 +36,13 @@ export function listFeatures(client, req = {}, options) {
|
|
|
25
36
|
});
|
|
26
37
|
});
|
|
27
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Create feature
|
|
41
|
+
*
|
|
42
|
+
* Create a feature.
|
|
43
|
+
*
|
|
44
|
+
* POST /openmeter/features
|
|
45
|
+
*/
|
|
28
46
|
export function createFeature(client, req, options) {
|
|
29
47
|
return request(() => {
|
|
30
48
|
const body = toWire(req, schemas.createFeatureBody);
|
|
@@ -42,13 +60,29 @@ export function createFeature(client, req, options) {
|
|
|
42
60
|
});
|
|
43
61
|
});
|
|
44
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Get feature
|
|
65
|
+
*
|
|
66
|
+
* Get a feature by id.
|
|
67
|
+
*
|
|
68
|
+
* GET /openmeter/features/{featureId}
|
|
69
|
+
*/
|
|
45
70
|
export function getFeature(client, req, options) {
|
|
46
71
|
return request(() => {
|
|
72
|
+
const pathParamsInput = {
|
|
73
|
+
featureId: req.featureId,
|
|
74
|
+
};
|
|
75
|
+
const pathParams = client._options.validate
|
|
76
|
+
? toPathWire(pathParamsInput, schemas.getFeaturePathParams)
|
|
77
|
+
: pathParamsInput;
|
|
78
|
+
if (client._options.validate) {
|
|
79
|
+
assertValid(schemas.getFeaturePathParamsWire, pathParams);
|
|
80
|
+
}
|
|
47
81
|
const path = `openmeter/features/${(() => {
|
|
48
|
-
if (
|
|
82
|
+
if (pathParams.featureId === undefined) {
|
|
49
83
|
throw new Error('missing path parameter: featureId');
|
|
50
84
|
}
|
|
51
|
-
return encodeURIComponent(String(
|
|
85
|
+
return encodeURIComponent(String(pathParams.featureId));
|
|
52
86
|
})()}`;
|
|
53
87
|
return http(client)
|
|
54
88
|
.get(path, options)
|
|
@@ -61,13 +95,29 @@ export function getFeature(client, req, options) {
|
|
|
61
95
|
});
|
|
62
96
|
});
|
|
63
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* Update feature
|
|
100
|
+
*
|
|
101
|
+
* Update a feature by id. Currently only the unit_cost field can be updated.
|
|
102
|
+
*
|
|
103
|
+
* PATCH /openmeter/features/{featureId}
|
|
104
|
+
*/
|
|
64
105
|
export function updateFeature(client, req, options) {
|
|
65
106
|
return request(() => {
|
|
107
|
+
const pathParamsInput = {
|
|
108
|
+
featureId: req.featureId,
|
|
109
|
+
};
|
|
110
|
+
const pathParams = client._options.validate
|
|
111
|
+
? toPathWire(pathParamsInput, schemas.updateFeaturePathParams)
|
|
112
|
+
: pathParamsInput;
|
|
113
|
+
if (client._options.validate) {
|
|
114
|
+
assertValid(schemas.updateFeaturePathParamsWire, pathParams);
|
|
115
|
+
}
|
|
66
116
|
const path = `openmeter/features/${(() => {
|
|
67
|
-
if (
|
|
117
|
+
if (pathParams.featureId === undefined) {
|
|
68
118
|
throw new Error('missing path parameter: featureId');
|
|
69
119
|
}
|
|
70
|
-
return encodeURIComponent(String(
|
|
120
|
+
return encodeURIComponent(String(pathParams.featureId));
|
|
71
121
|
})()}`;
|
|
72
122
|
const body = toWire(req.body, schemas.updateFeatureBody);
|
|
73
123
|
if (client._options.validate) {
|
|
@@ -84,24 +134,56 @@ export function updateFeature(client, req, options) {
|
|
|
84
134
|
});
|
|
85
135
|
});
|
|
86
136
|
}
|
|
137
|
+
/**
|
|
138
|
+
* Delete feature
|
|
139
|
+
*
|
|
140
|
+
* Delete a feature by id.
|
|
141
|
+
*
|
|
142
|
+
* DELETE /openmeter/features/{featureId}
|
|
143
|
+
*/
|
|
87
144
|
export function deleteFeature(client, req, options) {
|
|
88
145
|
return request(async () => {
|
|
146
|
+
const pathParamsInput = {
|
|
147
|
+
featureId: req.featureId,
|
|
148
|
+
};
|
|
149
|
+
const pathParams = client._options.validate
|
|
150
|
+
? toPathWire(pathParamsInput, schemas.deleteFeaturePathParams)
|
|
151
|
+
: pathParamsInput;
|
|
152
|
+
if (client._options.validate) {
|
|
153
|
+
assertValid(schemas.deleteFeaturePathParamsWire, pathParams);
|
|
154
|
+
}
|
|
89
155
|
const path = `openmeter/features/${(() => {
|
|
90
|
-
if (
|
|
156
|
+
if (pathParams.featureId === undefined) {
|
|
91
157
|
throw new Error('missing path parameter: featureId');
|
|
92
158
|
}
|
|
93
|
-
return encodeURIComponent(String(
|
|
159
|
+
return encodeURIComponent(String(pathParams.featureId));
|
|
94
160
|
})()}`;
|
|
95
161
|
await http(client).delete(path, options);
|
|
96
162
|
});
|
|
97
163
|
}
|
|
164
|
+
/**
|
|
165
|
+
* Query feature cost
|
|
166
|
+
*
|
|
167
|
+
* Query the cost of a feature.
|
|
168
|
+
*
|
|
169
|
+
* POST /openmeter/features/{featureId}/cost/query
|
|
170
|
+
*/
|
|
98
171
|
export function queryFeatureCost(client, req, options) {
|
|
99
172
|
return request(() => {
|
|
173
|
+
const pathParamsInput = {
|
|
174
|
+
featureId: req.featureId,
|
|
175
|
+
};
|
|
176
|
+
const pathParams = client._options.validate
|
|
177
|
+
? toPathWire(pathParamsInput, schemas.queryFeatureCostPathParams)
|
|
178
|
+
: pathParamsInput;
|
|
179
|
+
if (client._options.validate) {
|
|
180
|
+
assertValid(schemas.queryFeatureCostPathParamsWire, pathParams);
|
|
181
|
+
}
|
|
100
182
|
const path = `openmeter/features/${(() => {
|
|
101
|
-
if (
|
|
183
|
+
if (pathParams.featureId === undefined) {
|
|
102
184
|
throw new Error('missing path parameter: featureId');
|
|
103
185
|
}
|
|
104
|
-
return encodeURIComponent(String(
|
|
186
|
+
return encodeURIComponent(String(pathParams.featureId));
|
|
105
187
|
})()}/cost/query`;
|
|
106
188
|
const body = toWire(req.body, schemas.queryFeatureCostBody);
|
|
107
189
|
if (client._options.validate) {
|
|
@@ -118,4 +200,3 @@ export function queryFeatureCost(client, req, options) {
|
|
|
118
200
|
});
|
|
119
201
|
});
|
|
120
202
|
}
|
|
121
|
-
//# sourceMappingURL=features.js.map
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type Result, type RequestOptions } from '../lib/types.js';
|
|
3
3
|
import type { QueryGovernanceAccessRequest, QueryGovernanceAccessResponse } from '../models/operations/governance.js';
|
|
4
|
+
/**
|
|
5
|
+
* Query governance access
|
|
6
|
+
*
|
|
7
|
+
* Query feature access for a list of customers.
|
|
8
|
+
*
|
|
9
|
+
* The endpoint resolves each provided identifier to a customer and returns the
|
|
10
|
+
* access status for the requested features, plus optional credit balance
|
|
11
|
+
* availability.
|
|
12
|
+
*
|
|
13
|
+
* _Designed to be called on a fixed refresh interval and the query response is
|
|
14
|
+
* intended to be cached._
|
|
15
|
+
*
|
|
16
|
+
* POST /openmeter/governance/query
|
|
17
|
+
*/
|
|
4
18
|
export declare function queryGovernanceAccess(client: Client, req: QueryGovernanceAccessRequest, options?: RequestOptions): Promise<Result<QueryGovernanceAccessResponse>>;
|
|
5
|
-
//# sourceMappingURL=governance.d.ts.map
|
package/dist/funcs/governance.js
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
|
+
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
|
|
1
2
|
import { http } from '../core.js';
|
|
2
3
|
import { request } from '../lib/request.js';
|
|
3
4
|
import { toURLSearchParams } from '../lib/encodings.js';
|
|
4
5
|
import { toWire, fromWire, assertValid } from '../lib/wire.js';
|
|
5
6
|
import * as schemas from '../models/schemas.js';
|
|
7
|
+
/**
|
|
8
|
+
* Query governance access
|
|
9
|
+
*
|
|
10
|
+
* Query feature access for a list of customers.
|
|
11
|
+
*
|
|
12
|
+
* The endpoint resolves each provided identifier to a customer and returns the
|
|
13
|
+
* access status for the requested features, plus optional credit balance
|
|
14
|
+
* availability.
|
|
15
|
+
*
|
|
16
|
+
* _Designed to be called on a fixed refresh interval and the query response is
|
|
17
|
+
* intended to be cached._
|
|
18
|
+
*
|
|
19
|
+
* POST /openmeter/governance/query
|
|
20
|
+
*/
|
|
6
21
|
export function queryGovernanceAccess(client, req, options) {
|
|
7
22
|
return request(() => {
|
|
8
23
|
const body = toWire(req.body, schemas.queryGovernanceAccessBody);
|
|
@@ -31,4 +46,3 @@ export function queryGovernanceAccess(client, req, options) {
|
|
|
31
46
|
});
|
|
32
47
|
});
|
|
33
48
|
}
|
|
34
|
-
//# sourceMappingURL=governance.js.map
|
package/dist/funcs/index.d.ts
CHANGED
package/dist/funcs/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
|
|
1
2
|
export * from './events.js';
|
|
2
3
|
export * from './meters.js';
|
|
3
4
|
export * from './customers.js';
|
|
@@ -15,4 +16,3 @@ export * from './addons.js';
|
|
|
15
16
|
export * from './planAddons.js';
|
|
16
17
|
export * from './defaults.js';
|
|
17
18
|
export * from './governance.js';
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
package/dist/funcs/invoices.d.ts
CHANGED
|
@@ -1,8 +1,108 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type Result, type RequestOptions } from '../lib/types.js';
|
|
3
|
-
import type { ListInvoicesRequest, ListInvoicesResponse, GetInvoiceRequest, GetInvoiceResponse, UpdateInvoiceRequest, UpdateInvoiceResponse, DeleteInvoiceRequest, DeleteInvoiceResponse } from '../models/operations/invoices.js';
|
|
3
|
+
import type { ListInvoicesRequest, ListInvoicesResponse, GetInvoiceRequest, GetInvoiceResponse, UpdateInvoiceRequest, UpdateInvoiceResponse, DeleteInvoiceRequest, DeleteInvoiceResponse, AdvanceInvoiceRequest, AdvanceInvoiceResponse, ApproveInvoiceRequest, ApproveInvoiceResponse, RetryInvoiceRequest, RetryInvoiceResponse, SnapshotQuantitiesInvoiceRequest, SnapshotQuantitiesInvoiceResponse } from '../models/operations/invoices.js';
|
|
4
|
+
/**
|
|
5
|
+
* List billing invoices
|
|
6
|
+
*
|
|
7
|
+
* List billing invoices.
|
|
8
|
+
*
|
|
9
|
+
* Returns a page of invoices. Gathering invoices are never included. Use `filter`
|
|
10
|
+
* to narrow by status, customer, dates, or service period start. Use `sort` to
|
|
11
|
+
* control ordering.
|
|
12
|
+
*
|
|
13
|
+
* GET /openmeter/billing/invoices
|
|
14
|
+
*/
|
|
4
15
|
export declare function listInvoices(client: Client, req?: ListInvoicesRequest, options?: RequestOptions): Promise<Result<ListInvoicesResponse>>;
|
|
16
|
+
/**
|
|
17
|
+
* Get a billing invoice
|
|
18
|
+
*
|
|
19
|
+
* Get a billing invoice by ID.
|
|
20
|
+
*
|
|
21
|
+
* Returns the full invoice resource including line items, status details, totals,
|
|
22
|
+
* and workflow configuration snapshot.
|
|
23
|
+
*
|
|
24
|
+
* GET /openmeter/billing/invoices/{invoiceId}
|
|
25
|
+
*/
|
|
5
26
|
export declare function getInvoice(client: Client, req: GetInvoiceRequest, options?: RequestOptions): Promise<Result<GetInvoiceResponse>>;
|
|
27
|
+
/**
|
|
28
|
+
* Update a billing invoice
|
|
29
|
+
*
|
|
30
|
+
* Update a billing invoice.
|
|
31
|
+
*
|
|
32
|
+
* Only the mutable fields of the invoice can be edited: description, labels,
|
|
33
|
+
* supplier, customer, workflow settings, and top-level lines. Top-level lines are
|
|
34
|
+
* matched by `id`; lines without an `id` are created, and existing lines omitted
|
|
35
|
+
* from `lines` are deleted. Detailed (child) lines are always computed and cannot
|
|
36
|
+
* be edited directly. Only invoices in draft status can be updated.
|
|
37
|
+
*
|
|
38
|
+
* PUT /openmeter/billing/invoices/{invoiceId}
|
|
39
|
+
*/
|
|
6
40
|
export declare function updateInvoice(client: Client, req: UpdateInvoiceRequest, options?: RequestOptions): Promise<Result<UpdateInvoiceResponse>>;
|
|
41
|
+
/**
|
|
42
|
+
* Delete a billing invoice
|
|
43
|
+
*
|
|
44
|
+
* Delete a billing invoice.
|
|
45
|
+
*
|
|
46
|
+
* Only standard invoices in draft status can be deleted. Deleting an invoice will
|
|
47
|
+
* also delete all associated line items and workflow configuration.
|
|
48
|
+
*
|
|
49
|
+
* DELETE /openmeter/billing/invoices/{invoiceId}
|
|
50
|
+
*/
|
|
7
51
|
export declare function deleteInvoice(client: Client, req: DeleteInvoiceRequest, options?: RequestOptions): Promise<Result<DeleteInvoiceResponse>>;
|
|
8
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Advance billing invoice's next status
|
|
54
|
+
*
|
|
55
|
+
* Advance a billing invoice.
|
|
56
|
+
*
|
|
57
|
+
* Advances the invoice to the next workflow state. The next state is determined by
|
|
58
|
+
* the invoice's current status and workflow configuration. Only invoices in draft
|
|
59
|
+
* or issued status can be advanced.
|
|
60
|
+
*
|
|
61
|
+
* POST /openmeter/billing/invoices/{invoiceId}/advance
|
|
62
|
+
*/
|
|
63
|
+
export declare function advanceInvoice(client: Client, req: AdvanceInvoiceRequest, options?: RequestOptions): Promise<Result<AdvanceInvoiceResponse>>;
|
|
64
|
+
/**
|
|
65
|
+
* Send the invoice to the customer
|
|
66
|
+
*
|
|
67
|
+
* Approve a billing invoice.
|
|
68
|
+
*
|
|
69
|
+
* This call instantly sends the invoice to the customer using the configured
|
|
70
|
+
* billing profile app.
|
|
71
|
+
*
|
|
72
|
+
* This call is valid in two invoice statuses:
|
|
73
|
+
*
|
|
74
|
+
* - draft: the invoice will be sent to the customer, the invoice state becomes
|
|
75
|
+
* issued
|
|
76
|
+
* - manual_approval_needed: the invoice will be sent to the customer, the invoice
|
|
77
|
+
* state becomes issued
|
|
78
|
+
*
|
|
79
|
+
* POST /openmeter/billing/invoices/{invoiceId}/approve
|
|
80
|
+
*/
|
|
81
|
+
export declare function approveInvoice(client: Client, req: ApproveInvoiceRequest, options?: RequestOptions): Promise<Result<ApproveInvoiceResponse>>;
|
|
82
|
+
/**
|
|
83
|
+
* Retry advancing the invoice after a failed attempt
|
|
84
|
+
*
|
|
85
|
+
* Retry sending a billing invoice.
|
|
86
|
+
*
|
|
87
|
+
* Retry advancing the invoice after a failed attempt.
|
|
88
|
+
*
|
|
89
|
+
* The action can be called when the invoice's statusDetails' actions field contain
|
|
90
|
+
* the "retry" action.
|
|
91
|
+
*
|
|
92
|
+
* POST /openmeter/billing/invoices/{invoiceId}/retry
|
|
93
|
+
*/
|
|
94
|
+
export declare function retryInvoice(client: Client, req: RetryInvoiceRequest, options?: RequestOptions): Promise<Result<RetryInvoiceResponse>>;
|
|
95
|
+
/**
|
|
96
|
+
* Snapshot quantities for usage based line items
|
|
97
|
+
*
|
|
98
|
+
* Snapshot quantities for usage-based line items.
|
|
99
|
+
*
|
|
100
|
+
* This call will snapshot the quantities for all usage based line items in the
|
|
101
|
+
* invoice.
|
|
102
|
+
*
|
|
103
|
+
* This call is only valid in draft.waiting_for_collection status, where the
|
|
104
|
+
* collection period can be skipped using this action.
|
|
105
|
+
*
|
|
106
|
+
* POST /openmeter/billing/invoices/{invoiceId}/snapshot-quantities
|
|
107
|
+
*/
|
|
108
|
+
export declare function snapshotQuantitiesInvoice(client: Client, req: SnapshotQuantitiesInvoiceRequest, options?: RequestOptions): Promise<Result<SnapshotQuantitiesInvoiceResponse>>;
|