@openmeter/client 1.0.0-beta.230 → 1.0.0-beta.231
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 +347 -68
- 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 +165 -2
- package/dist/funcs/customers.js +192 -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/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 +44 -1
- package/dist/funcs/invoices.js +45 -1
- 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 -6
- 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 +9 -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/governance.d.ts +0 -1
- package/dist/models/operations/governance.js +1 -1
- package/dist/models/operations/invoices.d.ts +4 -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 +162 -1
- package/dist/models/schemas.js +37 -5
- package/dist/models/types.d.ts +464 -577
- 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 +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 +180 -0
- package/dist/sdk/internal.js +224 -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/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/sdk/meters.js
CHANGED
|
@@ -1,30 +1,96 @@
|
|
|
1
|
+
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
|
|
1
2
|
import { unwrap } from '../lib/types.js';
|
|
3
|
+
import { paginatePages } from '../lib/paginate.js';
|
|
2
4
|
import { createMeter, getMeter, listMeters, updateMeter, deleteMeter, queryMeter, queryMeterCsv, } from '../funcs/meters.js';
|
|
3
5
|
export class Meters {
|
|
4
6
|
_client;
|
|
5
7
|
constructor(_client) {
|
|
6
8
|
this._client = _client;
|
|
7
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Create meter
|
|
12
|
+
*
|
|
13
|
+
* Create a meter.
|
|
14
|
+
*
|
|
15
|
+
* POST /openmeter/meters
|
|
16
|
+
*/
|
|
8
17
|
async create(request, options) {
|
|
9
18
|
return unwrap(await createMeter(this._client, request, options));
|
|
10
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Get meter
|
|
22
|
+
*
|
|
23
|
+
* Get a meter by ID.
|
|
24
|
+
*
|
|
25
|
+
* GET /openmeter/meters/{meterId}
|
|
26
|
+
*/
|
|
11
27
|
async get(request, options) {
|
|
12
28
|
return unwrap(await getMeter(this._client, request, options));
|
|
13
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* List meters
|
|
32
|
+
*
|
|
33
|
+
* List meters.
|
|
34
|
+
*
|
|
35
|
+
* GET /openmeter/meters
|
|
36
|
+
*/
|
|
14
37
|
async list(request, options) {
|
|
15
38
|
return unwrap(await listMeters(this._client, request, options));
|
|
16
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* List meters
|
|
42
|
+
*
|
|
43
|
+
* List meters.
|
|
44
|
+
*
|
|
45
|
+
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
46
|
+
*
|
|
47
|
+
* GET /openmeter/meters
|
|
48
|
+
*/
|
|
49
|
+
listAll(request, options) {
|
|
50
|
+
return paginatePages((req, opts) => listMeters(this._client, req, opts), request ?? {}, options);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Update meter
|
|
54
|
+
*
|
|
55
|
+
* Update a meter.
|
|
56
|
+
*
|
|
57
|
+
* PUT /openmeter/meters/{meterId}
|
|
58
|
+
*/
|
|
17
59
|
async update(request, options) {
|
|
18
60
|
return unwrap(await updateMeter(this._client, request, options));
|
|
19
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Delete meter
|
|
64
|
+
*
|
|
65
|
+
* Delete a meter.
|
|
66
|
+
*
|
|
67
|
+
* DELETE /openmeter/meters/{meterId}
|
|
68
|
+
*/
|
|
20
69
|
async delete(request, options) {
|
|
21
70
|
return unwrap(await deleteMeter(this._client, request, options));
|
|
22
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Query meter
|
|
74
|
+
*
|
|
75
|
+
* Query a meter for usage.
|
|
76
|
+
*
|
|
77
|
+
* Set `Accept: application/json` (the default) to get a structured JSON response.
|
|
78
|
+
* Set `Accept: text/csv` to download the same data as a CSV file suitable for
|
|
79
|
+
* spreadsheets. The CSV columns, in order, are:
|
|
80
|
+
*
|
|
81
|
+
* `from, to, [subject,] [customer_id, customer_key, customer_name,] <dimensions...>, value`
|
|
82
|
+
*
|
|
83
|
+
* The `subject` column is emitted only when `subject` is in the query's
|
|
84
|
+
* `group_by_dimensions`. The three `customer_*` columns are emitted together only
|
|
85
|
+
* when `customer_id` is in the query's `group_by_dimensions`.
|
|
86
|
+
*
|
|
87
|
+
* POST /openmeter/meters/{meterId}/query
|
|
88
|
+
*/
|
|
23
89
|
async query(request, options) {
|
|
24
90
|
return unwrap(await queryMeter(this._client, request, options));
|
|
25
91
|
}
|
|
92
|
+
/** POST /openmeter/meters/{meterId}/query */
|
|
26
93
|
async queryCsv(request, options) {
|
|
27
94
|
return unwrap(await queryMeterCsv(this._client, request, options));
|
|
28
95
|
}
|
|
29
96
|
}
|
|
30
|
-
//# sourceMappingURL=meters.js.map
|
package/dist/sdk/planAddons.d.ts
CHANGED
|
@@ -1,13 +1,58 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { 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
|
+
import type { PlanAddon } from '../models/types.js';
|
|
4
5
|
export declare class PlanAddons {
|
|
5
6
|
private readonly _client;
|
|
6
7
|
constructor(_client: Client);
|
|
8
|
+
/**
|
|
9
|
+
* List add-ons for plan
|
|
10
|
+
*
|
|
11
|
+
* List add-ons associated with a plan.
|
|
12
|
+
*
|
|
13
|
+
* GET /openmeter/plans/{planId}/addons
|
|
14
|
+
*/
|
|
7
15
|
list(request: ListPlanAddonsRequest, options?: RequestOptions): Promise<ListPlanAddonsResponse>;
|
|
16
|
+
/**
|
|
17
|
+
* List add-ons for plan
|
|
18
|
+
*
|
|
19
|
+
* List add-ons associated with a plan.
|
|
20
|
+
*
|
|
21
|
+
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
22
|
+
*
|
|
23
|
+
* GET /openmeter/plans/{planId}/addons
|
|
24
|
+
*/
|
|
25
|
+
listAll(request: ListPlanAddonsRequest, options?: RequestOptions): AsyncIterable<PlanAddon>;
|
|
26
|
+
/**
|
|
27
|
+
* Add add-on to plan
|
|
28
|
+
*
|
|
29
|
+
* Add an add-on to a plan.
|
|
30
|
+
*
|
|
31
|
+
* POST /openmeter/plans/{planId}/addons
|
|
32
|
+
*/
|
|
8
33
|
create(request: CreatePlanAddonRequest, options?: RequestOptions): Promise<CreatePlanAddonResponse>;
|
|
34
|
+
/**
|
|
35
|
+
* Get add-on association for plan
|
|
36
|
+
*
|
|
37
|
+
* Get an add-on association for a plan.
|
|
38
|
+
*
|
|
39
|
+
* GET /openmeter/plans/{planId}/addons/{planAddonId}
|
|
40
|
+
*/
|
|
9
41
|
get(request: GetPlanAddonRequest, options?: RequestOptions): Promise<GetPlanAddonResponse>;
|
|
42
|
+
/**
|
|
43
|
+
* Update add-on association for plan
|
|
44
|
+
*
|
|
45
|
+
* Update an add-on association for a plan.
|
|
46
|
+
*
|
|
47
|
+
* PUT /openmeter/plans/{planId}/addons/{planAddonId}
|
|
48
|
+
*/
|
|
10
49
|
update(request: UpdatePlanAddonRequest, options?: RequestOptions): Promise<UpdatePlanAddonResponse>;
|
|
50
|
+
/**
|
|
51
|
+
* Remove add-on from plan
|
|
52
|
+
*
|
|
53
|
+
* Remove an add-on from a plan.
|
|
54
|
+
*
|
|
55
|
+
* DELETE /openmeter/plans/{planId}/addons/{planAddonId}
|
|
56
|
+
*/
|
|
11
57
|
delete(request: DeletePlanAddonRequest, options?: RequestOptions): Promise<DeletePlanAddonResponse>;
|
|
12
58
|
}
|
|
13
|
-
//# sourceMappingURL=planAddons.d.ts.map
|
package/dist/sdk/planAddons.js
CHANGED
|
@@ -1,24 +1,72 @@
|
|
|
1
|
+
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
|
|
1
2
|
import { unwrap } from '../lib/types.js';
|
|
3
|
+
import { paginatePages } from '../lib/paginate.js';
|
|
2
4
|
import { listPlanAddons, createPlanAddon, getPlanAddon, updatePlanAddon, deletePlanAddon, } from '../funcs/planAddons.js';
|
|
3
5
|
export class PlanAddons {
|
|
4
6
|
_client;
|
|
5
7
|
constructor(_client) {
|
|
6
8
|
this._client = _client;
|
|
7
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* List add-ons for plan
|
|
12
|
+
*
|
|
13
|
+
* List add-ons associated with a plan.
|
|
14
|
+
*
|
|
15
|
+
* GET /openmeter/plans/{planId}/addons
|
|
16
|
+
*/
|
|
8
17
|
async list(request, options) {
|
|
9
18
|
return unwrap(await listPlanAddons(this._client, request, options));
|
|
10
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* List add-ons for plan
|
|
22
|
+
*
|
|
23
|
+
* List add-ons associated with a plan.
|
|
24
|
+
*
|
|
25
|
+
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
26
|
+
*
|
|
27
|
+
* GET /openmeter/plans/{planId}/addons
|
|
28
|
+
*/
|
|
29
|
+
listAll(request, options) {
|
|
30
|
+
return paginatePages((req, opts) => listPlanAddons(this._client, req, opts), request, options);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Add add-on to plan
|
|
34
|
+
*
|
|
35
|
+
* Add an add-on to a plan.
|
|
36
|
+
*
|
|
37
|
+
* POST /openmeter/plans/{planId}/addons
|
|
38
|
+
*/
|
|
11
39
|
async create(request, options) {
|
|
12
40
|
return unwrap(await createPlanAddon(this._client, request, options));
|
|
13
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Get add-on association for plan
|
|
44
|
+
*
|
|
45
|
+
* Get an add-on association for a plan.
|
|
46
|
+
*
|
|
47
|
+
* GET /openmeter/plans/{planId}/addons/{planAddonId}
|
|
48
|
+
*/
|
|
14
49
|
async get(request, options) {
|
|
15
50
|
return unwrap(await getPlanAddon(this._client, request, options));
|
|
16
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Update add-on association for plan
|
|
54
|
+
*
|
|
55
|
+
* Update an add-on association for a plan.
|
|
56
|
+
*
|
|
57
|
+
* PUT /openmeter/plans/{planId}/addons/{planAddonId}
|
|
58
|
+
*/
|
|
17
59
|
async update(request, options) {
|
|
18
60
|
return unwrap(await updatePlanAddon(this._client, request, options));
|
|
19
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Remove add-on from plan
|
|
64
|
+
*
|
|
65
|
+
* Remove an add-on from a plan.
|
|
66
|
+
*
|
|
67
|
+
* DELETE /openmeter/plans/{planId}/addons/{planAddonId}
|
|
68
|
+
*/
|
|
20
69
|
async delete(request, options) {
|
|
21
70
|
return unwrap(await deletePlanAddon(this._client, request, options));
|
|
22
71
|
}
|
|
23
72
|
}
|
|
24
|
-
//# sourceMappingURL=planAddons.js.map
|
package/dist/sdk/plans.d.ts
CHANGED
|
@@ -1,15 +1,74 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { 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
|
+
import type { Plan } from '../models/types.js';
|
|
4
5
|
export declare class Plans {
|
|
5
6
|
private readonly _client;
|
|
6
7
|
constructor(_client: Client);
|
|
8
|
+
/**
|
|
9
|
+
* List plans
|
|
10
|
+
*
|
|
11
|
+
* List all plans.
|
|
12
|
+
*
|
|
13
|
+
* GET /openmeter/plans
|
|
14
|
+
*/
|
|
7
15
|
list(request?: ListPlansRequest, options?: RequestOptions): Promise<ListPlansResponse>;
|
|
16
|
+
/**
|
|
17
|
+
* List plans
|
|
18
|
+
*
|
|
19
|
+
* List all plans.
|
|
20
|
+
*
|
|
21
|
+
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
22
|
+
*
|
|
23
|
+
* GET /openmeter/plans
|
|
24
|
+
*/
|
|
25
|
+
listAll(request?: ListPlansRequest, options?: RequestOptions): AsyncIterable<Plan>;
|
|
26
|
+
/**
|
|
27
|
+
* Create plan
|
|
28
|
+
*
|
|
29
|
+
* Create a new plan.
|
|
30
|
+
*
|
|
31
|
+
* POST /openmeter/plans
|
|
32
|
+
*/
|
|
8
33
|
create(request: CreatePlanRequest, options?: RequestOptions): Promise<CreatePlanResponse>;
|
|
34
|
+
/**
|
|
35
|
+
* Update plan
|
|
36
|
+
*
|
|
37
|
+
* Update a plan by id.
|
|
38
|
+
*
|
|
39
|
+
* PUT /openmeter/plans/{planId}
|
|
40
|
+
*/
|
|
9
41
|
update(request: UpdatePlanRequest, options?: RequestOptions): Promise<UpdatePlanResponse>;
|
|
42
|
+
/**
|
|
43
|
+
* Get plan
|
|
44
|
+
*
|
|
45
|
+
* Get a plan by id.
|
|
46
|
+
*
|
|
47
|
+
* GET /openmeter/plans/{planId}
|
|
48
|
+
*/
|
|
10
49
|
get(request: GetPlanRequest, options?: RequestOptions): Promise<GetPlanResponse>;
|
|
50
|
+
/**
|
|
51
|
+
* Delete plan
|
|
52
|
+
*
|
|
53
|
+
* Delete a plan by id.
|
|
54
|
+
*
|
|
55
|
+
* DELETE /openmeter/plans/{planId}
|
|
56
|
+
*/
|
|
11
57
|
delete(request: DeletePlanRequest, options?: RequestOptions): Promise<DeletePlanResponse>;
|
|
58
|
+
/**
|
|
59
|
+
* Archive plan version
|
|
60
|
+
*
|
|
61
|
+
* Archive a plan version.
|
|
62
|
+
*
|
|
63
|
+
* POST /openmeter/plans/{planId}/archive
|
|
64
|
+
*/
|
|
12
65
|
archive(request: ArchivePlanRequest, options?: RequestOptions): Promise<ArchivePlanResponse>;
|
|
66
|
+
/**
|
|
67
|
+
* Publish plan version
|
|
68
|
+
*
|
|
69
|
+
* Publish a plan version.
|
|
70
|
+
*
|
|
71
|
+
* POST /openmeter/plans/{planId}/publish
|
|
72
|
+
*/
|
|
13
73
|
publish(request: PublishPlanRequest, options?: RequestOptions): Promise<PublishPlanResponse>;
|
|
14
74
|
}
|
|
15
|
-
//# sourceMappingURL=plans.d.ts.map
|
package/dist/sdk/plans.js
CHANGED
|
@@ -1,30 +1,92 @@
|
|
|
1
|
+
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
|
|
1
2
|
import { unwrap } from '../lib/types.js';
|
|
3
|
+
import { paginatePages } from '../lib/paginate.js';
|
|
2
4
|
import { listPlans, createPlan, updatePlan, getPlan, deletePlan, archivePlan, publishPlan, } from '../funcs/plans.js';
|
|
3
5
|
export class Plans {
|
|
4
6
|
_client;
|
|
5
7
|
constructor(_client) {
|
|
6
8
|
this._client = _client;
|
|
7
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* List plans
|
|
12
|
+
*
|
|
13
|
+
* List all plans.
|
|
14
|
+
*
|
|
15
|
+
* GET /openmeter/plans
|
|
16
|
+
*/
|
|
8
17
|
async list(request, options) {
|
|
9
18
|
return unwrap(await listPlans(this._client, request, options));
|
|
10
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* List plans
|
|
22
|
+
*
|
|
23
|
+
* List all plans.
|
|
24
|
+
*
|
|
25
|
+
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
26
|
+
*
|
|
27
|
+
* GET /openmeter/plans
|
|
28
|
+
*/
|
|
29
|
+
listAll(request, options) {
|
|
30
|
+
return paginatePages((req, opts) => listPlans(this._client, req, opts), request ?? {}, options);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Create plan
|
|
34
|
+
*
|
|
35
|
+
* Create a new plan.
|
|
36
|
+
*
|
|
37
|
+
* POST /openmeter/plans
|
|
38
|
+
*/
|
|
11
39
|
async create(request, options) {
|
|
12
40
|
return unwrap(await createPlan(this._client, request, options));
|
|
13
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Update plan
|
|
44
|
+
*
|
|
45
|
+
* Update a plan by id.
|
|
46
|
+
*
|
|
47
|
+
* PUT /openmeter/plans/{planId}
|
|
48
|
+
*/
|
|
14
49
|
async update(request, options) {
|
|
15
50
|
return unwrap(await updatePlan(this._client, request, options));
|
|
16
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Get plan
|
|
54
|
+
*
|
|
55
|
+
* Get a plan by id.
|
|
56
|
+
*
|
|
57
|
+
* GET /openmeter/plans/{planId}
|
|
58
|
+
*/
|
|
17
59
|
async get(request, options) {
|
|
18
60
|
return unwrap(await getPlan(this._client, request, options));
|
|
19
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Delete plan
|
|
64
|
+
*
|
|
65
|
+
* Delete a plan by id.
|
|
66
|
+
*
|
|
67
|
+
* DELETE /openmeter/plans/{planId}
|
|
68
|
+
*/
|
|
20
69
|
async delete(request, options) {
|
|
21
70
|
return unwrap(await deletePlan(this._client, request, options));
|
|
22
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Archive plan version
|
|
74
|
+
*
|
|
75
|
+
* Archive a plan version.
|
|
76
|
+
*
|
|
77
|
+
* POST /openmeter/plans/{planId}/archive
|
|
78
|
+
*/
|
|
23
79
|
async archive(request, options) {
|
|
24
80
|
return unwrap(await archivePlan(this._client, request, options));
|
|
25
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Publish plan version
|
|
84
|
+
*
|
|
85
|
+
* Publish a plan version.
|
|
86
|
+
*
|
|
87
|
+
* POST /openmeter/plans/{planId}/publish
|
|
88
|
+
*/
|
|
26
89
|
async publish(request, options) {
|
|
27
90
|
return unwrap(await publishPlan(this._client, request, options));
|
|
28
91
|
}
|
|
29
92
|
}
|
|
30
|
-
//# sourceMappingURL=plans.js.map
|
package/dist/sdk/sdk.d.ts
CHANGED
|
@@ -6,16 +6,14 @@ import { Entitlements } from './entitlements.js';
|
|
|
6
6
|
import { Subscriptions } from './subscriptions.js';
|
|
7
7
|
import { Apps } from './apps.js';
|
|
8
8
|
import { Billing } from './billing.js';
|
|
9
|
-
import { Invoices } from './invoices.js';
|
|
10
9
|
import { Tax } from './tax.js';
|
|
11
|
-
import { Currencies } from './currencies.js';
|
|
12
10
|
import { Features } from './features.js';
|
|
13
11
|
import { LLMCost } from './llmCost.js';
|
|
14
12
|
import { Plans } from './plans.js';
|
|
15
13
|
import { Addons } from './addons.js';
|
|
16
14
|
import { PlanAddons } from './planAddons.js';
|
|
17
15
|
import { Defaults } from './defaults.js';
|
|
18
|
-
import {
|
|
16
|
+
import { Internal } from './internal.js';
|
|
19
17
|
export declare class OpenMeter extends Client {
|
|
20
18
|
private _events?;
|
|
21
19
|
get events(): Events;
|
|
@@ -31,12 +29,8 @@ export declare class OpenMeter extends Client {
|
|
|
31
29
|
get apps(): Apps;
|
|
32
30
|
private _billing?;
|
|
33
31
|
get billing(): Billing;
|
|
34
|
-
private _invoices?;
|
|
35
|
-
get invoices(): Invoices;
|
|
36
32
|
private _tax?;
|
|
37
33
|
get tax(): Tax;
|
|
38
|
-
private _currencies?;
|
|
39
|
-
get currencies(): Currencies;
|
|
40
34
|
private _features?;
|
|
41
35
|
get features(): Features;
|
|
42
36
|
private _llmCost?;
|
|
@@ -49,7 +43,12 @@ export declare class OpenMeter extends Client {
|
|
|
49
43
|
get planAddons(): PlanAddons;
|
|
50
44
|
private _defaults?;
|
|
51
45
|
get defaults(): Defaults;
|
|
52
|
-
private
|
|
53
|
-
|
|
46
|
+
private _internal?;
|
|
47
|
+
/**
|
|
48
|
+
* Operations marked internal in the API definition. They are not part
|
|
49
|
+
* of the customer surface: they may require additional permissions,
|
|
50
|
+
* and they can change or be removed without notice or semver
|
|
51
|
+
* consideration.
|
|
52
|
+
*/
|
|
53
|
+
get internal(): Internal;
|
|
54
54
|
}
|
|
55
|
-
//# sourceMappingURL=sdk.d.ts.map
|
package/dist/sdk/sdk.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
|
|
1
2
|
import { Client } from '../core.js';
|
|
2
3
|
import { Events } from './events.js';
|
|
3
4
|
import { Meters } from './meters.js';
|
|
@@ -6,16 +7,14 @@ import { Entitlements } from './entitlements.js';
|
|
|
6
7
|
import { Subscriptions } from './subscriptions.js';
|
|
7
8
|
import { Apps } from './apps.js';
|
|
8
9
|
import { Billing } from './billing.js';
|
|
9
|
-
import { Invoices } from './invoices.js';
|
|
10
10
|
import { Tax } from './tax.js';
|
|
11
|
-
import { Currencies } from './currencies.js';
|
|
12
11
|
import { Features } from './features.js';
|
|
13
12
|
import { LLMCost } from './llmCost.js';
|
|
14
13
|
import { Plans } from './plans.js';
|
|
15
14
|
import { Addons } from './addons.js';
|
|
16
15
|
import { PlanAddons } from './planAddons.js';
|
|
17
16
|
import { Defaults } from './defaults.js';
|
|
18
|
-
import {
|
|
17
|
+
import { Internal } from './internal.js';
|
|
19
18
|
export class OpenMeter extends Client {
|
|
20
19
|
_events;
|
|
21
20
|
get events() {
|
|
@@ -45,18 +44,10 @@ export class OpenMeter extends Client {
|
|
|
45
44
|
get billing() {
|
|
46
45
|
return (this._billing ??= new Billing(this));
|
|
47
46
|
}
|
|
48
|
-
_invoices;
|
|
49
|
-
get invoices() {
|
|
50
|
-
return (this._invoices ??= new Invoices(this));
|
|
51
|
-
}
|
|
52
47
|
_tax;
|
|
53
48
|
get tax() {
|
|
54
49
|
return (this._tax ??= new Tax(this));
|
|
55
50
|
}
|
|
56
|
-
_currencies;
|
|
57
|
-
get currencies() {
|
|
58
|
-
return (this._currencies ??= new Currencies(this));
|
|
59
|
-
}
|
|
60
51
|
_features;
|
|
61
52
|
get features() {
|
|
62
53
|
return (this._features ??= new Features(this));
|
|
@@ -81,9 +72,14 @@ export class OpenMeter extends Client {
|
|
|
81
72
|
get defaults() {
|
|
82
73
|
return (this._defaults ??= new Defaults(this));
|
|
83
74
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
75
|
+
_internal;
|
|
76
|
+
/**
|
|
77
|
+
* Operations marked internal in the API definition. They are not part
|
|
78
|
+
* of the customer surface: they may require additional permissions,
|
|
79
|
+
* and they can change or be removed without notice or semver
|
|
80
|
+
* consideration.
|
|
81
|
+
*/
|
|
82
|
+
get internal() {
|
|
83
|
+
return (this._internal ??= new Internal(this));
|
|
87
84
|
}
|
|
88
85
|
}
|
|
89
|
-
//# sourceMappingURL=sdk.js.map
|
|
@@ -1,17 +1,86 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type RequestOptions } from '../lib/types.js';
|
|
3
|
-
import type { CreateSubscriptionRequest, CreateSubscriptionResponse, ListSubscriptionsRequest, ListSubscriptionsResponse, GetSubscriptionRequest, GetSubscriptionResponse, CancelSubscriptionRequest, CancelSubscriptionResponse, UnscheduleCancelationRequest, UnscheduleCancelationResponse, ChangeSubscriptionRequest, ChangeSubscriptionResponse,
|
|
3
|
+
import type { CreateSubscriptionRequest, CreateSubscriptionResponse, ListSubscriptionsRequest, ListSubscriptionsResponse, GetSubscriptionRequest, GetSubscriptionResponse, CancelSubscriptionRequest, CancelSubscriptionResponse, UnscheduleCancelationRequest, UnscheduleCancelationResponse, ChangeSubscriptionRequest, ChangeSubscriptionResponse, ListSubscriptionAddonsRequest, ListSubscriptionAddonsResponse, GetSubscriptionAddonRequest, GetSubscriptionAddonResponse } from '../models/operations/subscriptions.js';
|
|
4
|
+
import type { Subscription, SubscriptionAddon } from '../models/types.js';
|
|
4
5
|
export declare class Subscriptions {
|
|
5
6
|
private readonly _client;
|
|
6
7
|
constructor(_client: Client);
|
|
8
|
+
/**
|
|
9
|
+
* Create subscription
|
|
10
|
+
*
|
|
11
|
+
* POST /openmeter/subscriptions
|
|
12
|
+
*/
|
|
7
13
|
create(request: CreateSubscriptionRequest, options?: RequestOptions): Promise<CreateSubscriptionResponse>;
|
|
14
|
+
/**
|
|
15
|
+
* List subscriptions
|
|
16
|
+
*
|
|
17
|
+
* GET /openmeter/subscriptions
|
|
18
|
+
*/
|
|
8
19
|
list(request?: ListSubscriptionsRequest, options?: RequestOptions): Promise<ListSubscriptionsResponse>;
|
|
20
|
+
/**
|
|
21
|
+
* List subscriptions
|
|
22
|
+
*
|
|
23
|
+
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
24
|
+
*
|
|
25
|
+
* GET /openmeter/subscriptions
|
|
26
|
+
*/
|
|
27
|
+
listAll(request?: ListSubscriptionsRequest, options?: RequestOptions): AsyncIterable<Subscription>;
|
|
28
|
+
/**
|
|
29
|
+
* Get subscription
|
|
30
|
+
*
|
|
31
|
+
* GET /openmeter/subscriptions/{subscriptionId}
|
|
32
|
+
*/
|
|
9
33
|
get(request: GetSubscriptionRequest, options?: RequestOptions): Promise<GetSubscriptionResponse>;
|
|
34
|
+
/**
|
|
35
|
+
* Cancel subscription
|
|
36
|
+
*
|
|
37
|
+
* Cancels the subscription. Will result in a scheduling conflict if there are
|
|
38
|
+
* other subscriptions scheduled to start after the cancelation time.
|
|
39
|
+
*
|
|
40
|
+
* POST /openmeter/subscriptions/{subscriptionId}/cancel
|
|
41
|
+
*/
|
|
10
42
|
cancel(request: CancelSubscriptionRequest, options?: RequestOptions): Promise<CancelSubscriptionResponse>;
|
|
43
|
+
/**
|
|
44
|
+
* Unschedule subscription cancelation
|
|
45
|
+
*
|
|
46
|
+
* Unschedules the subscription cancelation.
|
|
47
|
+
*
|
|
48
|
+
* POST /openmeter/subscriptions/{subscriptionId}/unschedule-cancelation
|
|
49
|
+
*/
|
|
11
50
|
unscheduleCancelation(request: UnscheduleCancelationRequest, options?: RequestOptions): Promise<UnscheduleCancelationResponse>;
|
|
51
|
+
/**
|
|
52
|
+
* Change subscription
|
|
53
|
+
*
|
|
54
|
+
* Closes a running subscription and starts a new one according to the
|
|
55
|
+
* specification. Can be used for upgrades, downgrades, and plan changes.
|
|
56
|
+
*
|
|
57
|
+
* POST /openmeter/subscriptions/{subscriptionId}/change
|
|
58
|
+
*/
|
|
12
59
|
change(request: ChangeSubscriptionRequest, options?: RequestOptions): Promise<ChangeSubscriptionResponse>;
|
|
13
|
-
|
|
60
|
+
/**
|
|
61
|
+
* List subscription addons
|
|
62
|
+
*
|
|
63
|
+
* List the add-ons of a subscription.
|
|
64
|
+
*
|
|
65
|
+
* GET /openmeter/subscriptions/{subscriptionId}/addons
|
|
66
|
+
*/
|
|
14
67
|
listAddons(request: ListSubscriptionAddonsRequest, options?: RequestOptions): Promise<ListSubscriptionAddonsResponse>;
|
|
68
|
+
/**
|
|
69
|
+
* List subscription addons
|
|
70
|
+
*
|
|
71
|
+
* List the add-ons of a subscription.
|
|
72
|
+
*
|
|
73
|
+
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
74
|
+
*
|
|
75
|
+
* GET /openmeter/subscriptions/{subscriptionId}/addons
|
|
76
|
+
*/
|
|
77
|
+
listAddonsAll(request: ListSubscriptionAddonsRequest, options?: RequestOptions): AsyncIterable<SubscriptionAddon>;
|
|
78
|
+
/**
|
|
79
|
+
* Get add-on association for subscription
|
|
80
|
+
*
|
|
81
|
+
* Get an add-on association for a subscription.
|
|
82
|
+
*
|
|
83
|
+
* GET /openmeter/subscriptions/{subscriptionId}/addons/{subscriptionAddonId}
|
|
84
|
+
*/
|
|
15
85
|
getAddon(request: GetSubscriptionAddonRequest, options?: RequestOptions): Promise<GetSubscriptionAddonResponse>;
|
|
16
86
|
}
|
|
17
|
-
//# sourceMappingURL=subscriptions.d.ts.map
|