@openmeter/client 1.0.0-beta-4d26c6d3c7fe → 1.0.0-beta-e7a04be10ed8
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 +316 -55
- package/dist/core.d.ts +0 -1
- package/dist/core.js +8 -1
- package/dist/funcs/addons.d.ts +49 -1
- package/dist/funcs/addons.js +50 -1
- package/dist/funcs/apps.d.ts +14 -1
- package/dist/funcs/apps.js +15 -1
- package/dist/funcs/billing.d.ts +46 -1
- package/dist/funcs/billing.js +47 -1
- package/dist/funcs/currencies.d.ts +30 -1
- package/dist/funcs/currencies.js +31 -1
- package/dist/funcs/customers.d.ts +148 -1
- package/dist/funcs/customers.js +149 -1
- 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 +6 -1
- package/dist/funcs/events.d.ts +14 -1
- package/dist/funcs/events.js +15 -1
- package/dist/funcs/features.d.ts +42 -1
- package/dist/funcs/features.js +43 -1
- package/dist/funcs/index.d.ts +0 -3
- package/dist/funcs/index.js +1 -3
- package/dist/funcs/llmCost.d.ts +36 -1
- package/dist/funcs/llmCost.js +37 -1
- package/dist/funcs/meters.d.ts +53 -1
- package/dist/funcs/meters.js +54 -1
- package/dist/funcs/planAddons.d.ts +35 -1
- package/dist/funcs/planAddons.js +36 -1
- package/dist/funcs/plans.d.ts +49 -1
- package/dist/funcs/plans.js +50 -1
- package/dist/funcs/subscriptions.d.ts +59 -1
- package/dist/funcs/subscriptions.js +60 -1
- package/dist/funcs/tax.d.ts +25 -1
- package/dist/funcs/tax.js +26 -1
- package/dist/index.d.ts +4 -8
- package/dist/index.js +4 -5
- package/dist/lib/config.d.ts +0 -1
- 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 +3 -1
- package/dist/lib/wire.js +93 -4
- 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 +2 -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 +0 -1
- package/dist/models/operations/currencies.js +1 -1
- package/dist/models/operations/customers.d.ts +3 -6
- 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/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 +4453 -6950
- package/dist/models/schemas.js +1 -73
- package/dist/models/types.d.ts +381 -566
- 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 +25 -1
- package/dist/sdk/apps.js +28 -1
- package/dist/sdk/billing.d.ts +57 -1
- package/dist/sdk/billing.js +60 -1
- package/dist/sdk/customers.d.ts +194 -1
- package/dist/sdk/customers.js +203 -1
- 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 +89 -0
- package/dist/sdk/internal.js +113 -0
- 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 -10
- package/dist/sdk/sdk.js +11 -15
- 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 +28 -4
- package/dist/funcs/governance.d.ts +0 -5
- package/dist/funcs/governance.js +0 -34
- package/dist/funcs/invoices.d.ts +0 -8
- package/dist/funcs/invoices.js +0 -81
- package/dist/models/operations/governance.d.ts +0 -10
- package/dist/models/operations/governance.js +0 -2
- package/dist/models/operations/invoices.d.ts +0 -48
- package/dist/models/operations/invoices.js +0 -2
- 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/sdk/invoices.d.ts +0 -12
- package/dist/sdk/invoices.js +0 -21
package/dist/funcs/llmCost.js
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
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 LLM cost prices
|
|
9
|
+
*
|
|
10
|
+
* List global LLM cost prices. Returns prices with overrides applied if any.
|
|
11
|
+
*
|
|
12
|
+
* GET /openmeter/llm-cost/prices
|
|
13
|
+
*/
|
|
6
14
|
export function listLlmCostPrices(client, req = {}, options) {
|
|
7
15
|
return request(() => {
|
|
8
16
|
const query = toWire({
|
|
@@ -25,6 +33,14 @@ export function listLlmCostPrices(client, req = {}, options) {
|
|
|
25
33
|
});
|
|
26
34
|
});
|
|
27
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Get LLM cost price
|
|
38
|
+
*
|
|
39
|
+
* Get a specific LLM cost price by ID. Returns the price with overrides applied if
|
|
40
|
+
* any.
|
|
41
|
+
*
|
|
42
|
+
* GET /openmeter/llm-cost/prices/{priceId}
|
|
43
|
+
*/
|
|
28
44
|
export function getLlmCostPrice(client, req, options) {
|
|
29
45
|
return request(() => {
|
|
30
46
|
const path = `openmeter/llm-cost/prices/${(() => {
|
|
@@ -44,6 +60,13 @@ export function getLlmCostPrice(client, req, options) {
|
|
|
44
60
|
});
|
|
45
61
|
});
|
|
46
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* List LLM cost overrides
|
|
65
|
+
*
|
|
66
|
+
* List per-namespace price overrides.
|
|
67
|
+
*
|
|
68
|
+
* GET /openmeter/llm-cost/overrides
|
|
69
|
+
*/
|
|
47
70
|
export function listLlmCostOverrides(client, req = {}, options) {
|
|
48
71
|
return request(() => {
|
|
49
72
|
const query = toWire({
|
|
@@ -65,6 +88,13 @@ export function listLlmCostOverrides(client, req = {}, options) {
|
|
|
65
88
|
});
|
|
66
89
|
});
|
|
67
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Create LLM cost override
|
|
93
|
+
*
|
|
94
|
+
* Create a per-namespace price override.
|
|
95
|
+
*
|
|
96
|
+
* POST /openmeter/llm-cost/overrides
|
|
97
|
+
*/
|
|
68
98
|
export function createLlmCostOverride(client, req, options) {
|
|
69
99
|
return request(() => {
|
|
70
100
|
const body = toWire(req, schemas.createLlmCostOverrideBody);
|
|
@@ -82,6 +112,13 @@ export function createLlmCostOverride(client, req, options) {
|
|
|
82
112
|
});
|
|
83
113
|
});
|
|
84
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* Delete LLM cost override
|
|
117
|
+
*
|
|
118
|
+
* Delete a per-namespace price override.
|
|
119
|
+
*
|
|
120
|
+
* DELETE /openmeter/llm-cost/overrides/{priceId}
|
|
121
|
+
*/
|
|
85
122
|
export function deleteLlmCostOverride(client, req, options) {
|
|
86
123
|
return request(async () => {
|
|
87
124
|
const path = `openmeter/llm-cost/overrides/${(() => {
|
|
@@ -93,4 +130,3 @@ export function deleteLlmCostOverride(client, req, options) {
|
|
|
93
130
|
await http(client).delete(path, options);
|
|
94
131
|
});
|
|
95
132
|
}
|
|
96
|
-
//# sourceMappingURL=llmCost.js.map
|
package/dist/funcs/meters.d.ts
CHANGED
|
@@ -1,11 +1,63 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type Result, type RequestOptions } from '../lib/types.js';
|
|
3
3
|
import type { CreateMeterRequest, CreateMeterResponse, GetMeterRequest, GetMeterResponse, ListMetersRequest, ListMetersResponse, UpdateMeterRequest, UpdateMeterResponse, DeleteMeterRequest, DeleteMeterResponse, QueryMeterRequest, QueryMeterResponse, QueryMeterCsvRequest, QueryMeterCsvResponse } from '../models/operations/meters.js';
|
|
4
|
+
/**
|
|
5
|
+
* Create meter
|
|
6
|
+
*
|
|
7
|
+
* Create a meter.
|
|
8
|
+
*
|
|
9
|
+
* POST /openmeter/meters
|
|
10
|
+
*/
|
|
4
11
|
export declare function createMeter(client: Client, req: CreateMeterRequest, options?: RequestOptions): Promise<Result<CreateMeterResponse>>;
|
|
12
|
+
/**
|
|
13
|
+
* Get meter
|
|
14
|
+
*
|
|
15
|
+
* Get a meter by ID.
|
|
16
|
+
*
|
|
17
|
+
* GET /openmeter/meters/{meterId}
|
|
18
|
+
*/
|
|
5
19
|
export declare function getMeter(client: Client, req: GetMeterRequest, options?: RequestOptions): Promise<Result<GetMeterResponse>>;
|
|
20
|
+
/**
|
|
21
|
+
* List meters
|
|
22
|
+
*
|
|
23
|
+
* List meters.
|
|
24
|
+
*
|
|
25
|
+
* GET /openmeter/meters
|
|
26
|
+
*/
|
|
6
27
|
export declare function listMeters(client: Client, req?: ListMetersRequest, options?: RequestOptions): Promise<Result<ListMetersResponse>>;
|
|
28
|
+
/**
|
|
29
|
+
* Update meter
|
|
30
|
+
*
|
|
31
|
+
* Update a meter.
|
|
32
|
+
*
|
|
33
|
+
* PUT /openmeter/meters/{meterId}
|
|
34
|
+
*/
|
|
7
35
|
export declare function updateMeter(client: Client, req: UpdateMeterRequest, options?: RequestOptions): Promise<Result<UpdateMeterResponse>>;
|
|
36
|
+
/**
|
|
37
|
+
* Delete meter
|
|
38
|
+
*
|
|
39
|
+
* Delete a meter.
|
|
40
|
+
*
|
|
41
|
+
* DELETE /openmeter/meters/{meterId}
|
|
42
|
+
*/
|
|
8
43
|
export declare function deleteMeter(client: Client, req: DeleteMeterRequest, options?: RequestOptions): Promise<Result<DeleteMeterResponse>>;
|
|
44
|
+
/**
|
|
45
|
+
* Query meter
|
|
46
|
+
*
|
|
47
|
+
* Query a meter for usage.
|
|
48
|
+
*
|
|
49
|
+
* Set `Accept: application/json` (the default) to get a structured JSON response.
|
|
50
|
+
* Set `Accept: text/csv` to download the same data as a CSV file suitable for
|
|
51
|
+
* spreadsheets. The CSV columns, in order, are:
|
|
52
|
+
*
|
|
53
|
+
* `from, to, [subject,] [customer_id, customer_key, customer_name,] <dimensions...>, value`
|
|
54
|
+
*
|
|
55
|
+
* The `subject` column is emitted only when `subject` is in the query's
|
|
56
|
+
* `group_by_dimensions`. The three `customer_*` columns are emitted together only
|
|
57
|
+
* when `customer_id` is in the query's `group_by_dimensions`.
|
|
58
|
+
*
|
|
59
|
+
* POST /openmeter/meters/{meterId}/query
|
|
60
|
+
*/
|
|
9
61
|
export declare function queryMeter(client: Client, req: QueryMeterRequest, options?: RequestOptions): Promise<Result<QueryMeterResponse>>;
|
|
62
|
+
/** POST /openmeter/meters/{meterId}/query */
|
|
10
63
|
export declare function queryMeterCsv(client: Client, req: QueryMeterCsvRequest, options?: RequestOptions): Promise<Result<QueryMeterCsvResponse>>;
|
|
11
|
-
//# sourceMappingURL=meters.d.ts.map
|
package/dist/funcs/meters.js
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
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
|
+
* Create meter
|
|
9
|
+
*
|
|
10
|
+
* Create a meter.
|
|
11
|
+
*
|
|
12
|
+
* POST /openmeter/meters
|
|
13
|
+
*/
|
|
6
14
|
export function createMeter(client, req, options) {
|
|
7
15
|
return request(() => {
|
|
8
16
|
const body = toWire(req, schemas.createMeterBody);
|
|
@@ -20,6 +28,13 @@ export function createMeter(client, req, options) {
|
|
|
20
28
|
});
|
|
21
29
|
});
|
|
22
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Get meter
|
|
33
|
+
*
|
|
34
|
+
* Get a meter by ID.
|
|
35
|
+
*
|
|
36
|
+
* GET /openmeter/meters/{meterId}
|
|
37
|
+
*/
|
|
23
38
|
export function getMeter(client, req, options) {
|
|
24
39
|
return request(() => {
|
|
25
40
|
const path = `openmeter/meters/${(() => {
|
|
@@ -39,6 +54,13 @@ export function getMeter(client, req, options) {
|
|
|
39
54
|
});
|
|
40
55
|
});
|
|
41
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* List meters
|
|
59
|
+
*
|
|
60
|
+
* List meters.
|
|
61
|
+
*
|
|
62
|
+
* GET /openmeter/meters
|
|
63
|
+
*/
|
|
42
64
|
export function listMeters(client, req = {}, options) {
|
|
43
65
|
return request(() => {
|
|
44
66
|
const query = toWire({
|
|
@@ -61,6 +83,13 @@ export function listMeters(client, req = {}, options) {
|
|
|
61
83
|
});
|
|
62
84
|
});
|
|
63
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* Update meter
|
|
88
|
+
*
|
|
89
|
+
* Update a meter.
|
|
90
|
+
*
|
|
91
|
+
* PUT /openmeter/meters/{meterId}
|
|
92
|
+
*/
|
|
64
93
|
export function updateMeter(client, req, options) {
|
|
65
94
|
return request(() => {
|
|
66
95
|
const path = `openmeter/meters/${(() => {
|
|
@@ -84,6 +113,13 @@ export function updateMeter(client, req, options) {
|
|
|
84
113
|
});
|
|
85
114
|
});
|
|
86
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
* Delete meter
|
|
118
|
+
*
|
|
119
|
+
* Delete a meter.
|
|
120
|
+
*
|
|
121
|
+
* DELETE /openmeter/meters/{meterId}
|
|
122
|
+
*/
|
|
87
123
|
export function deleteMeter(client, req, options) {
|
|
88
124
|
return request(async () => {
|
|
89
125
|
const path = `openmeter/meters/${(() => {
|
|
@@ -95,6 +131,23 @@ export function deleteMeter(client, req, options) {
|
|
|
95
131
|
await http(client).delete(path, options);
|
|
96
132
|
});
|
|
97
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* Query meter
|
|
136
|
+
*
|
|
137
|
+
* Query a meter for usage.
|
|
138
|
+
*
|
|
139
|
+
* Set `Accept: application/json` (the default) to get a structured JSON response.
|
|
140
|
+
* Set `Accept: text/csv` to download the same data as a CSV file suitable for
|
|
141
|
+
* spreadsheets. The CSV columns, in order, are:
|
|
142
|
+
*
|
|
143
|
+
* `from, to, [subject,] [customer_id, customer_key, customer_name,] <dimensions...>, value`
|
|
144
|
+
*
|
|
145
|
+
* The `subject` column is emitted only when `subject` is in the query's
|
|
146
|
+
* `group_by_dimensions`. The three `customer_*` columns are emitted together only
|
|
147
|
+
* when `customer_id` is in the query's `group_by_dimensions`.
|
|
148
|
+
*
|
|
149
|
+
* POST /openmeter/meters/{meterId}/query
|
|
150
|
+
*/
|
|
98
151
|
export function queryMeter(client, req, options) {
|
|
99
152
|
return request(() => {
|
|
100
153
|
const path = `openmeter/meters/${(() => {
|
|
@@ -118,6 +171,7 @@ export function queryMeter(client, req, options) {
|
|
|
118
171
|
});
|
|
119
172
|
});
|
|
120
173
|
}
|
|
174
|
+
/** POST /openmeter/meters/{meterId}/query */
|
|
121
175
|
export function queryMeterCsv(client, req, options) {
|
|
122
176
|
const headers = new Headers(options?.headers);
|
|
123
177
|
headers.set('accept', 'text/csv');
|
|
@@ -137,4 +191,3 @@ export function queryMeterCsv(client, req, options) {
|
|
|
137
191
|
.text();
|
|
138
192
|
});
|
|
139
193
|
}
|
|
140
|
-
//# sourceMappingURL=meters.js.map
|
|
@@ -1,9 +1,43 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type Result, type RequestOptions } from '../lib/types.js';
|
|
3
3
|
import type { ListPlanAddonsRequest, ListPlanAddonsResponse, CreatePlanAddonRequest, CreatePlanAddonResponse, GetPlanAddonRequest, GetPlanAddonResponse, UpdatePlanAddonRequest, UpdatePlanAddonResponse, DeletePlanAddonRequest, DeletePlanAddonResponse } from '../models/operations/planAddons.js';
|
|
4
|
+
/**
|
|
5
|
+
* List add-ons for plan
|
|
6
|
+
*
|
|
7
|
+
* List add-ons associated with a plan.
|
|
8
|
+
*
|
|
9
|
+
* GET /openmeter/plans/{planId}/addons
|
|
10
|
+
*/
|
|
4
11
|
export declare function listPlanAddons(client: Client, req: ListPlanAddonsRequest, options?: RequestOptions): Promise<Result<ListPlanAddonsResponse>>;
|
|
12
|
+
/**
|
|
13
|
+
* Add add-on to plan
|
|
14
|
+
*
|
|
15
|
+
* Add an add-on to a plan.
|
|
16
|
+
*
|
|
17
|
+
* POST /openmeter/plans/{planId}/addons
|
|
18
|
+
*/
|
|
5
19
|
export declare function createPlanAddon(client: Client, req: CreatePlanAddonRequest, options?: RequestOptions): Promise<Result<CreatePlanAddonResponse>>;
|
|
20
|
+
/**
|
|
21
|
+
* Get add-on association for plan
|
|
22
|
+
*
|
|
23
|
+
* Get an add-on association for a plan.
|
|
24
|
+
*
|
|
25
|
+
* GET /openmeter/plans/{planId}/addons/{planAddonId}
|
|
26
|
+
*/
|
|
6
27
|
export declare function getPlanAddon(client: Client, req: GetPlanAddonRequest, options?: RequestOptions): Promise<Result<GetPlanAddonResponse>>;
|
|
28
|
+
/**
|
|
29
|
+
* Update add-on association for plan
|
|
30
|
+
*
|
|
31
|
+
* Update an add-on association for a plan.
|
|
32
|
+
*
|
|
33
|
+
* PUT /openmeter/plans/{planId}/addons/{planAddonId}
|
|
34
|
+
*/
|
|
7
35
|
export declare function updatePlanAddon(client: Client, req: UpdatePlanAddonRequest, options?: RequestOptions): Promise<Result<UpdatePlanAddonResponse>>;
|
|
36
|
+
/**
|
|
37
|
+
* Remove add-on from plan
|
|
38
|
+
*
|
|
39
|
+
* Remove an add-on from a plan.
|
|
40
|
+
*
|
|
41
|
+
* DELETE /openmeter/plans/{planId}/addons/{planAddonId}
|
|
42
|
+
*/
|
|
8
43
|
export declare function deletePlanAddon(client: Client, req: DeletePlanAddonRequest, options?: RequestOptions): Promise<Result<DeletePlanAddonResponse>>;
|
|
9
|
-
//# sourceMappingURL=planAddons.d.ts.map
|
package/dist/funcs/planAddons.js
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
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
|
+
* List add-ons for plan
|
|
9
|
+
*
|
|
10
|
+
* List add-ons associated with a plan.
|
|
11
|
+
*
|
|
12
|
+
* GET /openmeter/plans/{planId}/addons
|
|
13
|
+
*/
|
|
6
14
|
export function listPlanAddons(client, req, options) {
|
|
7
15
|
return request(() => {
|
|
8
16
|
const path = `openmeter/plans/${(() => {
|
|
@@ -29,6 +37,13 @@ export function listPlanAddons(client, req, options) {
|
|
|
29
37
|
});
|
|
30
38
|
});
|
|
31
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Add add-on to plan
|
|
42
|
+
*
|
|
43
|
+
* Add an add-on to a plan.
|
|
44
|
+
*
|
|
45
|
+
* POST /openmeter/plans/{planId}/addons
|
|
46
|
+
*/
|
|
32
47
|
export function createPlanAddon(client, req, options) {
|
|
33
48
|
return request(() => {
|
|
34
49
|
const path = `openmeter/plans/${(() => {
|
|
@@ -52,6 +67,13 @@ export function createPlanAddon(client, req, options) {
|
|
|
52
67
|
});
|
|
53
68
|
});
|
|
54
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* Get add-on association for plan
|
|
72
|
+
*
|
|
73
|
+
* Get an add-on association for a plan.
|
|
74
|
+
*
|
|
75
|
+
* GET /openmeter/plans/{planId}/addons/{planAddonId}
|
|
76
|
+
*/
|
|
55
77
|
export function getPlanAddon(client, req, options) {
|
|
56
78
|
return request(() => {
|
|
57
79
|
const path = `openmeter/plans/${(() => {
|
|
@@ -76,6 +98,13 @@ export function getPlanAddon(client, req, options) {
|
|
|
76
98
|
});
|
|
77
99
|
});
|
|
78
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* Update add-on association for plan
|
|
103
|
+
*
|
|
104
|
+
* Update an add-on association for a plan.
|
|
105
|
+
*
|
|
106
|
+
* PUT /openmeter/plans/{planId}/addons/{planAddonId}
|
|
107
|
+
*/
|
|
79
108
|
export function updatePlanAddon(client, req, options) {
|
|
80
109
|
return request(() => {
|
|
81
110
|
const path = `openmeter/plans/${(() => {
|
|
@@ -104,6 +133,13 @@ export function updatePlanAddon(client, req, options) {
|
|
|
104
133
|
});
|
|
105
134
|
});
|
|
106
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* Remove add-on from plan
|
|
138
|
+
*
|
|
139
|
+
* Remove an add-on from a plan.
|
|
140
|
+
*
|
|
141
|
+
* DELETE /openmeter/plans/{planId}/addons/{planAddonId}
|
|
142
|
+
*/
|
|
107
143
|
export function deletePlanAddon(client, req, options) {
|
|
108
144
|
return request(async () => {
|
|
109
145
|
const path = `openmeter/plans/${(() => {
|
|
@@ -120,4 +156,3 @@ export function deletePlanAddon(client, req, options) {
|
|
|
120
156
|
await http(client).delete(path, options);
|
|
121
157
|
});
|
|
122
158
|
}
|
|
123
|
-
//# sourceMappingURL=planAddons.js.map
|
package/dist/funcs/plans.d.ts
CHANGED
|
@@ -1,11 +1,59 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type Result, type RequestOptions } from '../lib/types.js';
|
|
3
3
|
import type { ListPlansRequest, ListPlansResponse, CreatePlanRequest, CreatePlanResponse, UpdatePlanRequest, UpdatePlanResponse, GetPlanRequest, GetPlanResponse, DeletePlanRequest, DeletePlanResponse, ArchivePlanRequest, ArchivePlanResponse, PublishPlanRequest, PublishPlanResponse } from '../models/operations/plans.js';
|
|
4
|
+
/**
|
|
5
|
+
* List plans
|
|
6
|
+
*
|
|
7
|
+
* List all plans.
|
|
8
|
+
*
|
|
9
|
+
* GET /openmeter/plans
|
|
10
|
+
*/
|
|
4
11
|
export declare function listPlans(client: Client, req?: ListPlansRequest, options?: RequestOptions): Promise<Result<ListPlansResponse>>;
|
|
12
|
+
/**
|
|
13
|
+
* Create plan
|
|
14
|
+
*
|
|
15
|
+
* Create a new plan.
|
|
16
|
+
*
|
|
17
|
+
* POST /openmeter/plans
|
|
18
|
+
*/
|
|
5
19
|
export declare function createPlan(client: Client, req: CreatePlanRequest, options?: RequestOptions): Promise<Result<CreatePlanResponse>>;
|
|
20
|
+
/**
|
|
21
|
+
* Update plan
|
|
22
|
+
*
|
|
23
|
+
* Update a plan by id.
|
|
24
|
+
*
|
|
25
|
+
* PUT /openmeter/plans/{planId}
|
|
26
|
+
*/
|
|
6
27
|
export declare function updatePlan(client: Client, req: UpdatePlanRequest, options?: RequestOptions): Promise<Result<UpdatePlanResponse>>;
|
|
28
|
+
/**
|
|
29
|
+
* Get plan
|
|
30
|
+
*
|
|
31
|
+
* Get a plan by id.
|
|
32
|
+
*
|
|
33
|
+
* GET /openmeter/plans/{planId}
|
|
34
|
+
*/
|
|
7
35
|
export declare function getPlan(client: Client, req: GetPlanRequest, options?: RequestOptions): Promise<Result<GetPlanResponse>>;
|
|
36
|
+
/**
|
|
37
|
+
* Delete plan
|
|
38
|
+
*
|
|
39
|
+
* Delete a plan by id.
|
|
40
|
+
*
|
|
41
|
+
* DELETE /openmeter/plans/{planId}
|
|
42
|
+
*/
|
|
8
43
|
export declare function deletePlan(client: Client, req: DeletePlanRequest, options?: RequestOptions): Promise<Result<DeletePlanResponse>>;
|
|
44
|
+
/**
|
|
45
|
+
* Archive plan version
|
|
46
|
+
*
|
|
47
|
+
* Archive a plan version.
|
|
48
|
+
*
|
|
49
|
+
* POST /openmeter/plans/{planId}/archive
|
|
50
|
+
*/
|
|
9
51
|
export declare function archivePlan(client: Client, req: ArchivePlanRequest, options?: RequestOptions): Promise<Result<ArchivePlanResponse>>;
|
|
52
|
+
/**
|
|
53
|
+
* Publish plan version
|
|
54
|
+
*
|
|
55
|
+
* Publish a plan version.
|
|
56
|
+
*
|
|
57
|
+
* POST /openmeter/plans/{planId}/publish
|
|
58
|
+
*/
|
|
10
59
|
export declare function publishPlan(client: Client, req: PublishPlanRequest, options?: RequestOptions): Promise<Result<PublishPlanResponse>>;
|
|
11
|
-
//# sourceMappingURL=plans.d.ts.map
|
package/dist/funcs/plans.js
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
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 plans
|
|
9
|
+
*
|
|
10
|
+
* List all plans.
|
|
11
|
+
*
|
|
12
|
+
* GET /openmeter/plans
|
|
13
|
+
*/
|
|
6
14
|
export function listPlans(client, req = {}, options) {
|
|
7
15
|
return request(() => {
|
|
8
16
|
const query = toWire({
|
|
@@ -25,6 +33,13 @@ export function listPlans(client, req = {}, options) {
|
|
|
25
33
|
});
|
|
26
34
|
});
|
|
27
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Create plan
|
|
38
|
+
*
|
|
39
|
+
* Create a new plan.
|
|
40
|
+
*
|
|
41
|
+
* POST /openmeter/plans
|
|
42
|
+
*/
|
|
28
43
|
export function createPlan(client, req, options) {
|
|
29
44
|
return request(() => {
|
|
30
45
|
const body = toWire(req, schemas.createPlanBody);
|
|
@@ -42,6 +57,13 @@ export function createPlan(client, req, options) {
|
|
|
42
57
|
});
|
|
43
58
|
});
|
|
44
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* Update plan
|
|
62
|
+
*
|
|
63
|
+
* Update a plan by id.
|
|
64
|
+
*
|
|
65
|
+
* PUT /openmeter/plans/{planId}
|
|
66
|
+
*/
|
|
45
67
|
export function updatePlan(client, req, options) {
|
|
46
68
|
return request(() => {
|
|
47
69
|
const path = `openmeter/plans/${(() => {
|
|
@@ -65,6 +87,13 @@ export function updatePlan(client, req, options) {
|
|
|
65
87
|
});
|
|
66
88
|
});
|
|
67
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* Get plan
|
|
92
|
+
*
|
|
93
|
+
* Get a plan by id.
|
|
94
|
+
*
|
|
95
|
+
* GET /openmeter/plans/{planId}
|
|
96
|
+
*/
|
|
68
97
|
export function getPlan(client, req, options) {
|
|
69
98
|
return request(() => {
|
|
70
99
|
const path = `openmeter/plans/${(() => {
|
|
@@ -84,6 +113,13 @@ export function getPlan(client, req, options) {
|
|
|
84
113
|
});
|
|
85
114
|
});
|
|
86
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
* Delete plan
|
|
118
|
+
*
|
|
119
|
+
* Delete a plan by id.
|
|
120
|
+
*
|
|
121
|
+
* DELETE /openmeter/plans/{planId}
|
|
122
|
+
*/
|
|
87
123
|
export function deletePlan(client, req, options) {
|
|
88
124
|
return request(async () => {
|
|
89
125
|
const path = `openmeter/plans/${(() => {
|
|
@@ -95,6 +131,13 @@ export function deletePlan(client, req, options) {
|
|
|
95
131
|
await http(client).delete(path, options);
|
|
96
132
|
});
|
|
97
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* Archive plan version
|
|
136
|
+
*
|
|
137
|
+
* Archive a plan version.
|
|
138
|
+
*
|
|
139
|
+
* POST /openmeter/plans/{planId}/archive
|
|
140
|
+
*/
|
|
98
141
|
export function archivePlan(client, req, options) {
|
|
99
142
|
return request(() => {
|
|
100
143
|
const path = `openmeter/plans/${(() => {
|
|
@@ -114,6 +157,13 @@ export function archivePlan(client, req, options) {
|
|
|
114
157
|
});
|
|
115
158
|
});
|
|
116
159
|
}
|
|
160
|
+
/**
|
|
161
|
+
* Publish plan version
|
|
162
|
+
*
|
|
163
|
+
* Publish a plan version.
|
|
164
|
+
*
|
|
165
|
+
* POST /openmeter/plans/{planId}/publish
|
|
166
|
+
*/
|
|
117
167
|
export function publishPlan(client, req, options) {
|
|
118
168
|
return request(() => {
|
|
119
169
|
const path = `openmeter/plans/${(() => {
|
|
@@ -133,4 +183,3 @@ export function publishPlan(client, req, options) {
|
|
|
133
183
|
});
|
|
134
184
|
});
|
|
135
185
|
}
|
|
136
|
-
//# sourceMappingURL=plans.js.map
|
|
@@ -1,13 +1,71 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type Result, type RequestOptions } from '../lib/types.js';
|
|
3
3
|
import type { CreateSubscriptionRequest, CreateSubscriptionResponse, ListSubscriptionsRequest, ListSubscriptionsResponse, GetSubscriptionRequest, GetSubscriptionResponse, CancelSubscriptionRequest, CancelSubscriptionResponse, UnscheduleCancelationRequest, UnscheduleCancelationResponse, ChangeSubscriptionRequest, ChangeSubscriptionResponse, CreateSubscriptionAddonRequest, CreateSubscriptionAddonResponse, ListSubscriptionAddonsRequest, ListSubscriptionAddonsResponse, GetSubscriptionAddonRequest, GetSubscriptionAddonResponse } from '../models/operations/subscriptions.js';
|
|
4
|
+
/**
|
|
5
|
+
* Create subscription
|
|
6
|
+
*
|
|
7
|
+
* POST /openmeter/subscriptions
|
|
8
|
+
*/
|
|
4
9
|
export declare function createSubscription(client: Client, req: CreateSubscriptionRequest, options?: RequestOptions): Promise<Result<CreateSubscriptionResponse>>;
|
|
10
|
+
/**
|
|
11
|
+
* List subscriptions
|
|
12
|
+
*
|
|
13
|
+
* GET /openmeter/subscriptions
|
|
14
|
+
*/
|
|
5
15
|
export declare function listSubscriptions(client: Client, req?: ListSubscriptionsRequest, options?: RequestOptions): Promise<Result<ListSubscriptionsResponse>>;
|
|
16
|
+
/**
|
|
17
|
+
* Get subscription
|
|
18
|
+
*
|
|
19
|
+
* GET /openmeter/subscriptions/{subscriptionId}
|
|
20
|
+
*/
|
|
6
21
|
export declare function getSubscription(client: Client, req: GetSubscriptionRequest, options?: RequestOptions): Promise<Result<GetSubscriptionResponse>>;
|
|
22
|
+
/**
|
|
23
|
+
* Cancel subscription
|
|
24
|
+
*
|
|
25
|
+
* Cancels the subscription. Will result in a scheduling conflict if there are
|
|
26
|
+
* other subscriptions scheduled to start after the cancelation time.
|
|
27
|
+
*
|
|
28
|
+
* POST /openmeter/subscriptions/{subscriptionId}/cancel
|
|
29
|
+
*/
|
|
7
30
|
export declare function cancelSubscription(client: Client, req: CancelSubscriptionRequest, options?: RequestOptions): Promise<Result<CancelSubscriptionResponse>>;
|
|
31
|
+
/**
|
|
32
|
+
* Unschedule subscription cancelation
|
|
33
|
+
*
|
|
34
|
+
* Unschedules the subscription cancelation.
|
|
35
|
+
*
|
|
36
|
+
* POST /openmeter/subscriptions/{subscriptionId}/unschedule-cancelation
|
|
37
|
+
*/
|
|
8
38
|
export declare function unscheduleCancelation(client: Client, req: UnscheduleCancelationRequest, options?: RequestOptions): Promise<Result<UnscheduleCancelationResponse>>;
|
|
39
|
+
/**
|
|
40
|
+
* Change subscription
|
|
41
|
+
*
|
|
42
|
+
* Closes a running subscription and starts a new one according to the
|
|
43
|
+
* specification. Can be used for upgrades, downgrades, and plan changes.
|
|
44
|
+
*
|
|
45
|
+
* POST /openmeter/subscriptions/{subscriptionId}/change
|
|
46
|
+
*/
|
|
9
47
|
export declare function changeSubscription(client: Client, req: ChangeSubscriptionRequest, options?: RequestOptions): Promise<Result<ChangeSubscriptionResponse>>;
|
|
48
|
+
/**
|
|
49
|
+
* Create a new subscription add-on
|
|
50
|
+
*
|
|
51
|
+
* Add add-on to a subscription.
|
|
52
|
+
*
|
|
53
|
+
* POST /openmeter/subscriptions/{subscriptionId}/addons
|
|
54
|
+
*/
|
|
10
55
|
export declare function createSubscriptionAddon(client: Client, req: CreateSubscriptionAddonRequest, options?: RequestOptions): Promise<Result<CreateSubscriptionAddonResponse>>;
|
|
56
|
+
/**
|
|
57
|
+
* List subscription addons
|
|
58
|
+
*
|
|
59
|
+
* List the add-ons of a subscription.
|
|
60
|
+
*
|
|
61
|
+
* GET /openmeter/subscriptions/{subscriptionId}/addons
|
|
62
|
+
*/
|
|
11
63
|
export declare function listSubscriptionAddons(client: Client, req: ListSubscriptionAddonsRequest, options?: RequestOptions): Promise<Result<ListSubscriptionAddonsResponse>>;
|
|
64
|
+
/**
|
|
65
|
+
* Get add-on association for subscription
|
|
66
|
+
*
|
|
67
|
+
* Get an add-on association for a subscription.
|
|
68
|
+
*
|
|
69
|
+
* GET /openmeter/subscriptions/{subscriptionId}/addons/{subscriptionAddonId}
|
|
70
|
+
*/
|
|
12
71
|
export declare function getSubscriptionAddon(client: Client, req: GetSubscriptionAddonRequest, options?: RequestOptions): Promise<Result<GetSubscriptionAddonResponse>>;
|
|
13
|
-
//# sourceMappingURL=subscriptions.d.ts.map
|