@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/funcs/addons.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 { ListAddonsRequest, ListAddonsResponse, CreateAddonRequest, CreateAddonResponse, UpdateAddonRequest, UpdateAddonResponse, GetAddonRequest, GetAddonResponse, DeleteAddonRequest, DeleteAddonResponse, ArchiveAddonRequest, ArchiveAddonResponse, PublishAddonRequest, PublishAddonResponse } from '../models/operations/addons.js';
|
|
4
|
+
/**
|
|
5
|
+
* List add-ons
|
|
6
|
+
*
|
|
7
|
+
* List all add-ons.
|
|
8
|
+
*
|
|
9
|
+
* GET /openmeter/addons
|
|
10
|
+
*/
|
|
4
11
|
export declare function listAddons(client: Client, req?: ListAddonsRequest, options?: RequestOptions): Promise<Result<ListAddonsResponse>>;
|
|
12
|
+
/**
|
|
13
|
+
* Create add-on
|
|
14
|
+
*
|
|
15
|
+
* Create a new add-on.
|
|
16
|
+
*
|
|
17
|
+
* POST /openmeter/addons
|
|
18
|
+
*/
|
|
5
19
|
export declare function createAddon(client: Client, req: CreateAddonRequest, options?: RequestOptions): Promise<Result<CreateAddonResponse>>;
|
|
20
|
+
/**
|
|
21
|
+
* Update add-on
|
|
22
|
+
*
|
|
23
|
+
* Update an add-on by id.
|
|
24
|
+
*
|
|
25
|
+
* PUT /openmeter/addons/{addonId}
|
|
26
|
+
*/
|
|
6
27
|
export declare function updateAddon(client: Client, req: UpdateAddonRequest, options?: RequestOptions): Promise<Result<UpdateAddonResponse>>;
|
|
28
|
+
/**
|
|
29
|
+
* Get add-on
|
|
30
|
+
*
|
|
31
|
+
* Get add-on by id.
|
|
32
|
+
*
|
|
33
|
+
* GET /openmeter/addons/{addonId}
|
|
34
|
+
*/
|
|
7
35
|
export declare function getAddon(client: Client, req: GetAddonRequest, options?: RequestOptions): Promise<Result<GetAddonResponse>>;
|
|
36
|
+
/**
|
|
37
|
+
* Soft delete add-on
|
|
38
|
+
*
|
|
39
|
+
* Soft delete add-on by id.
|
|
40
|
+
*
|
|
41
|
+
* DELETE /openmeter/addons/{addonId}
|
|
42
|
+
*/
|
|
8
43
|
export declare function deleteAddon(client: Client, req: DeleteAddonRequest, options?: RequestOptions): Promise<Result<DeleteAddonResponse>>;
|
|
44
|
+
/**
|
|
45
|
+
* Archive add-on version
|
|
46
|
+
*
|
|
47
|
+
* Archive an add-on version.
|
|
48
|
+
*
|
|
49
|
+
* POST /openmeter/addons/{addonId}/archive
|
|
50
|
+
*/
|
|
9
51
|
export declare function archiveAddon(client: Client, req: ArchiveAddonRequest, options?: RequestOptions): Promise<Result<ArchiveAddonResponse>>;
|
|
52
|
+
/**
|
|
53
|
+
* Publish add-on version
|
|
54
|
+
*
|
|
55
|
+
* Publish an add-on version.
|
|
56
|
+
*
|
|
57
|
+
* POST /openmeter/addons/{addonId}/publish
|
|
58
|
+
*/
|
|
10
59
|
export declare function publishAddon(client: Client, req: PublishAddonRequest, options?: RequestOptions): Promise<Result<PublishAddonResponse>>;
|
|
11
|
-
//# sourceMappingURL=addons.d.ts.map
|
package/dist/funcs/addons.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 add-ons
|
|
9
|
+
*
|
|
10
|
+
* List all add-ons.
|
|
11
|
+
*
|
|
12
|
+
* GET /openmeter/addons
|
|
13
|
+
*/
|
|
6
14
|
export function listAddons(client, req = {}, options) {
|
|
7
15
|
return request(() => {
|
|
8
16
|
const query = toWire({
|
|
@@ -25,6 +33,13 @@ export function listAddons(client, req = {}, options) {
|
|
|
25
33
|
});
|
|
26
34
|
});
|
|
27
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Create add-on
|
|
38
|
+
*
|
|
39
|
+
* Create a new add-on.
|
|
40
|
+
*
|
|
41
|
+
* POST /openmeter/addons
|
|
42
|
+
*/
|
|
28
43
|
export function createAddon(client, req, options) {
|
|
29
44
|
return request(() => {
|
|
30
45
|
const body = toWire(req, schemas.createAddonBody);
|
|
@@ -42,6 +57,13 @@ export function createAddon(client, req, options) {
|
|
|
42
57
|
});
|
|
43
58
|
});
|
|
44
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* Update add-on
|
|
62
|
+
*
|
|
63
|
+
* Update an add-on by id.
|
|
64
|
+
*
|
|
65
|
+
* PUT /openmeter/addons/{addonId}
|
|
66
|
+
*/
|
|
45
67
|
export function updateAddon(client, req, options) {
|
|
46
68
|
return request(() => {
|
|
47
69
|
const path = `openmeter/addons/${(() => {
|
|
@@ -65,6 +87,13 @@ export function updateAddon(client, req, options) {
|
|
|
65
87
|
});
|
|
66
88
|
});
|
|
67
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* Get add-on
|
|
92
|
+
*
|
|
93
|
+
* Get add-on by id.
|
|
94
|
+
*
|
|
95
|
+
* GET /openmeter/addons/{addonId}
|
|
96
|
+
*/
|
|
68
97
|
export function getAddon(client, req, options) {
|
|
69
98
|
return request(() => {
|
|
70
99
|
const path = `openmeter/addons/${(() => {
|
|
@@ -84,6 +113,13 @@ export function getAddon(client, req, options) {
|
|
|
84
113
|
});
|
|
85
114
|
});
|
|
86
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
* Soft delete add-on
|
|
118
|
+
*
|
|
119
|
+
* Soft delete add-on by id.
|
|
120
|
+
*
|
|
121
|
+
* DELETE /openmeter/addons/{addonId}
|
|
122
|
+
*/
|
|
87
123
|
export function deleteAddon(client, req, options) {
|
|
88
124
|
return request(async () => {
|
|
89
125
|
const path = `openmeter/addons/${(() => {
|
|
@@ -95,6 +131,13 @@ export function deleteAddon(client, req, options) {
|
|
|
95
131
|
await http(client).delete(path, options);
|
|
96
132
|
});
|
|
97
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* Archive add-on version
|
|
136
|
+
*
|
|
137
|
+
* Archive an add-on version.
|
|
138
|
+
*
|
|
139
|
+
* POST /openmeter/addons/{addonId}/archive
|
|
140
|
+
*/
|
|
98
141
|
export function archiveAddon(client, req, options) {
|
|
99
142
|
return request(() => {
|
|
100
143
|
const path = `openmeter/addons/${(() => {
|
|
@@ -114,6 +157,13 @@ export function archiveAddon(client, req, options) {
|
|
|
114
157
|
});
|
|
115
158
|
});
|
|
116
159
|
}
|
|
160
|
+
/**
|
|
161
|
+
* Publish add-on version
|
|
162
|
+
*
|
|
163
|
+
* Publish an add-on version.
|
|
164
|
+
*
|
|
165
|
+
* POST /openmeter/addons/{addonId}/publish
|
|
166
|
+
*/
|
|
117
167
|
export function publishAddon(client, req, options) {
|
|
118
168
|
return request(() => {
|
|
119
169
|
const path = `openmeter/addons/${(() => {
|
|
@@ -133,4 +183,3 @@ export function publishAddon(client, req, options) {
|
|
|
133
183
|
});
|
|
134
184
|
});
|
|
135
185
|
}
|
|
136
|
-
//# sourceMappingURL=addons.js.map
|
package/dist/funcs/apps.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 { ListAppsRequest, ListAppsResponse, GetAppRequest, GetAppResponse } from '../models/operations/apps.js';
|
|
4
|
+
/**
|
|
5
|
+
* List apps
|
|
6
|
+
*
|
|
7
|
+
* List installed apps.
|
|
8
|
+
*
|
|
9
|
+
* GET /openmeter/apps
|
|
10
|
+
*/
|
|
4
11
|
export declare function listApps(client: Client, req?: ListAppsRequest, options?: RequestOptions): Promise<Result<ListAppsResponse>>;
|
|
12
|
+
/**
|
|
13
|
+
* Get app
|
|
14
|
+
*
|
|
15
|
+
* Get an installed app.
|
|
16
|
+
*
|
|
17
|
+
* GET /openmeter/apps/{appId}
|
|
18
|
+
*/
|
|
5
19
|
export declare function getApp(client: Client, req: GetAppRequest, options?: RequestOptions): Promise<Result<GetAppResponse>>;
|
|
6
|
-
//# sourceMappingURL=apps.d.ts.map
|
package/dist/funcs/apps.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 apps
|
|
9
|
+
*
|
|
10
|
+
* List installed apps.
|
|
11
|
+
*
|
|
12
|
+
* GET /openmeter/apps
|
|
13
|
+
*/
|
|
6
14
|
export function listApps(client, req = {}, options) {
|
|
7
15
|
return request(() => {
|
|
8
16
|
const query = toWire({
|
|
@@ -23,6 +31,13 @@ export function listApps(client, req = {}, options) {
|
|
|
23
31
|
});
|
|
24
32
|
});
|
|
25
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Get app
|
|
36
|
+
*
|
|
37
|
+
* Get an installed app.
|
|
38
|
+
*
|
|
39
|
+
* GET /openmeter/apps/{appId}
|
|
40
|
+
*/
|
|
26
41
|
export function getApp(client, req, options) {
|
|
27
42
|
return request(() => {
|
|
28
43
|
const path = `openmeter/apps/${(() => {
|
|
@@ -42,4 +57,3 @@ export function getApp(client, req, options) {
|
|
|
42
57
|
});
|
|
43
58
|
});
|
|
44
59
|
}
|
|
45
|
-
//# sourceMappingURL=apps.js.map
|
package/dist/funcs/billing.d.ts
CHANGED
|
@@ -1,9 +1,54 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type Result, type RequestOptions } from '../lib/types.js';
|
|
3
3
|
import type { ListBillingProfilesRequest, ListBillingProfilesResponse, CreateBillingProfileRequest, CreateBillingProfileResponse, GetBillingProfileRequest, GetBillingProfileResponse, UpdateBillingProfileRequest, UpdateBillingProfileResponse, DeleteBillingProfileRequest, DeleteBillingProfileResponse } from '../models/operations/billing.js';
|
|
4
|
+
/**
|
|
5
|
+
* List billing profiles
|
|
6
|
+
*
|
|
7
|
+
* List billing profiles.
|
|
8
|
+
*
|
|
9
|
+
* GET /openmeter/profiles
|
|
10
|
+
*/
|
|
4
11
|
export declare function listBillingProfiles(client: Client, req?: ListBillingProfilesRequest, options?: RequestOptions): Promise<Result<ListBillingProfilesResponse>>;
|
|
12
|
+
/**
|
|
13
|
+
* Create a new billing profile
|
|
14
|
+
*
|
|
15
|
+
* Create a new billing profile.
|
|
16
|
+
*
|
|
17
|
+
* Billing profiles contain the settings for billing and controls invoice
|
|
18
|
+
* generation. An organization can have multiple billing profiles defined. A
|
|
19
|
+
* billing profile is linked to a specific app. This association is established
|
|
20
|
+
* during the billing profile's creation and remains immutable.
|
|
21
|
+
*
|
|
22
|
+
* POST /openmeter/profiles
|
|
23
|
+
*/
|
|
5
24
|
export declare function createBillingProfile(client: Client, req: CreateBillingProfileRequest, options?: RequestOptions): Promise<Result<CreateBillingProfileResponse>>;
|
|
25
|
+
/**
|
|
26
|
+
* Get a billing profile
|
|
27
|
+
*
|
|
28
|
+
* Get a billing profile.
|
|
29
|
+
*
|
|
30
|
+
* GET /openmeter/profiles/{id}
|
|
31
|
+
*/
|
|
6
32
|
export declare function getBillingProfile(client: Client, req: GetBillingProfileRequest, options?: RequestOptions): Promise<Result<GetBillingProfileResponse>>;
|
|
33
|
+
/**
|
|
34
|
+
* Update a billing profile
|
|
35
|
+
*
|
|
36
|
+
* Update a billing profile.
|
|
37
|
+
*
|
|
38
|
+
* PUT /openmeter/profiles/{id}
|
|
39
|
+
*/
|
|
7
40
|
export declare function updateBillingProfile(client: Client, req: UpdateBillingProfileRequest, options?: RequestOptions): Promise<Result<UpdateBillingProfileResponse>>;
|
|
41
|
+
/**
|
|
42
|
+
* Delete a billing profile
|
|
43
|
+
*
|
|
44
|
+
* Delete a billing profile.
|
|
45
|
+
*
|
|
46
|
+
* Only such billing profiles can be deleted that are:
|
|
47
|
+
*
|
|
48
|
+
* - not the default profile
|
|
49
|
+
* - not pinned to any customer using customer overrides
|
|
50
|
+
* - only have finalized invoices
|
|
51
|
+
*
|
|
52
|
+
* DELETE /openmeter/profiles/{id}
|
|
53
|
+
*/
|
|
8
54
|
export declare function deleteBillingProfile(client: Client, req: DeleteBillingProfileRequest, options?: RequestOptions): Promise<Result<DeleteBillingProfileResponse>>;
|
|
9
|
-
//# sourceMappingURL=billing.d.ts.map
|
package/dist/funcs/billing.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 billing profiles
|
|
9
|
+
*
|
|
10
|
+
* List billing profiles.
|
|
11
|
+
*
|
|
12
|
+
* GET /openmeter/profiles
|
|
13
|
+
*/
|
|
6
14
|
export function listBillingProfiles(client, req = {}, options) {
|
|
7
15
|
return request(() => {
|
|
8
16
|
const query = toWire({
|
|
@@ -23,6 +31,18 @@ export function listBillingProfiles(client, req = {}, options) {
|
|
|
23
31
|
});
|
|
24
32
|
});
|
|
25
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Create a new billing profile
|
|
36
|
+
*
|
|
37
|
+
* Create a new billing profile.
|
|
38
|
+
*
|
|
39
|
+
* Billing profiles contain the settings for billing and controls invoice
|
|
40
|
+
* generation. An organization can have multiple billing profiles defined. A
|
|
41
|
+
* billing profile is linked to a specific app. This association is established
|
|
42
|
+
* during the billing profile's creation and remains immutable.
|
|
43
|
+
*
|
|
44
|
+
* POST /openmeter/profiles
|
|
45
|
+
*/
|
|
26
46
|
export function createBillingProfile(client, req, options) {
|
|
27
47
|
return request(() => {
|
|
28
48
|
const body = toWire(req, schemas.createBillingProfileBody);
|
|
@@ -40,6 +60,13 @@ export function createBillingProfile(client, req, options) {
|
|
|
40
60
|
});
|
|
41
61
|
});
|
|
42
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Get a billing profile
|
|
65
|
+
*
|
|
66
|
+
* Get a billing profile.
|
|
67
|
+
*
|
|
68
|
+
* GET /openmeter/profiles/{id}
|
|
69
|
+
*/
|
|
43
70
|
export function getBillingProfile(client, req, options) {
|
|
44
71
|
return request(() => {
|
|
45
72
|
const path = `openmeter/profiles/${(() => {
|
|
@@ -59,6 +86,13 @@ export function getBillingProfile(client, req, options) {
|
|
|
59
86
|
});
|
|
60
87
|
});
|
|
61
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* Update a billing profile
|
|
91
|
+
*
|
|
92
|
+
* Update a billing profile.
|
|
93
|
+
*
|
|
94
|
+
* PUT /openmeter/profiles/{id}
|
|
95
|
+
*/
|
|
62
96
|
export function updateBillingProfile(client, req, options) {
|
|
63
97
|
return request(() => {
|
|
64
98
|
const path = `openmeter/profiles/${(() => {
|
|
@@ -82,6 +116,19 @@ export function updateBillingProfile(client, req, options) {
|
|
|
82
116
|
});
|
|
83
117
|
});
|
|
84
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* Delete a billing profile
|
|
121
|
+
*
|
|
122
|
+
* Delete a billing profile.
|
|
123
|
+
*
|
|
124
|
+
* Only such billing profiles can be deleted that are:
|
|
125
|
+
*
|
|
126
|
+
* - not the default profile
|
|
127
|
+
* - not pinned to any customer using customer overrides
|
|
128
|
+
* - only have finalized invoices
|
|
129
|
+
*
|
|
130
|
+
* DELETE /openmeter/profiles/{id}
|
|
131
|
+
*/
|
|
85
132
|
export function deleteBillingProfile(client, req, options) {
|
|
86
133
|
return request(async () => {
|
|
87
134
|
const path = `openmeter/profiles/${(() => {
|
|
@@ -93,4 +140,3 @@ export function deleteBillingProfile(client, req, options) {
|
|
|
93
140
|
await http(client).delete(path, options);
|
|
94
141
|
});
|
|
95
142
|
}
|
|
96
|
-
//# sourceMappingURL=billing.js.map
|
|
@@ -1,8 +1,37 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type Result, type RequestOptions } from '../lib/types.js';
|
|
3
3
|
import type { ListCurrenciesRequest, ListCurrenciesResponse, CreateCustomCurrencyRequest, CreateCustomCurrencyResponse, ListCostBasesRequest, ListCostBasesResponse, CreateCostBasisRequest, CreateCostBasisResponse } from '../models/operations/currencies.js';
|
|
4
|
+
/**
|
|
5
|
+
* List currencies
|
|
6
|
+
*
|
|
7
|
+
* List currencies supported by the billing system.
|
|
8
|
+
*
|
|
9
|
+
* GET /openmeter/currencies
|
|
10
|
+
*/
|
|
4
11
|
export declare function listCurrencies(client: Client, req?: ListCurrenciesRequest, options?: RequestOptions): Promise<Result<ListCurrenciesResponse>>;
|
|
12
|
+
/**
|
|
13
|
+
* Create custom currency
|
|
14
|
+
*
|
|
15
|
+
* Create a custom currency. This operation allows defining your own custom
|
|
16
|
+
* currency for billing purposes.
|
|
17
|
+
*
|
|
18
|
+
* POST /openmeter/currencies/custom
|
|
19
|
+
*/
|
|
5
20
|
export declare function createCustomCurrency(client: Client, req: CreateCustomCurrencyRequest, options?: RequestOptions): Promise<Result<CreateCustomCurrencyResponse>>;
|
|
21
|
+
/**
|
|
22
|
+
* List cost bases
|
|
23
|
+
*
|
|
24
|
+
* List cost bases for a currency. For custom currencies, there can be multiple
|
|
25
|
+
* cost bases with different `effective_from` dates.
|
|
26
|
+
*
|
|
27
|
+
* GET /openmeter/currencies/custom/{currencyId}/cost-bases
|
|
28
|
+
*/
|
|
6
29
|
export declare function listCostBases(client: Client, req: ListCostBasesRequest, options?: RequestOptions): Promise<Result<ListCostBasesResponse>>;
|
|
30
|
+
/**
|
|
31
|
+
* Create cost basis
|
|
32
|
+
*
|
|
33
|
+
* Create a cost basis for a currency.
|
|
34
|
+
*
|
|
35
|
+
* POST /openmeter/currencies/custom/{currencyId}/cost-bases
|
|
36
|
+
*/
|
|
7
37
|
export declare function createCostBasis(client: Client, req: CreateCostBasisRequest, options?: RequestOptions): Promise<Result<CreateCostBasisResponse>>;
|
|
8
|
-
//# sourceMappingURL=currencies.d.ts.map
|
package/dist/funcs/currencies.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 currencies
|
|
9
|
+
*
|
|
10
|
+
* List currencies supported by the billing system.
|
|
11
|
+
*
|
|
12
|
+
* GET /openmeter/currencies
|
|
13
|
+
*/
|
|
6
14
|
export function listCurrencies(client, req = {}, options) {
|
|
7
15
|
return request(() => {
|
|
8
16
|
const query = toWire({
|
|
@@ -25,6 +33,14 @@ export function listCurrencies(client, req = {}, options) {
|
|
|
25
33
|
});
|
|
26
34
|
});
|
|
27
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Create custom currency
|
|
38
|
+
*
|
|
39
|
+
* Create a custom currency. This operation allows defining your own custom
|
|
40
|
+
* currency for billing purposes.
|
|
41
|
+
*
|
|
42
|
+
* POST /openmeter/currencies/custom
|
|
43
|
+
*/
|
|
28
44
|
export function createCustomCurrency(client, req, options) {
|
|
29
45
|
return request(() => {
|
|
30
46
|
const body = toWire(req, schemas.createCustomCurrencyBody);
|
|
@@ -42,6 +58,14 @@ export function createCustomCurrency(client, req, options) {
|
|
|
42
58
|
});
|
|
43
59
|
});
|
|
44
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* List cost bases
|
|
63
|
+
*
|
|
64
|
+
* List cost bases for a currency. For custom currencies, there can be multiple
|
|
65
|
+
* cost bases with different `effective_from` dates.
|
|
66
|
+
*
|
|
67
|
+
* GET /openmeter/currencies/custom/{currencyId}/cost-bases
|
|
68
|
+
*/
|
|
45
69
|
export function listCostBases(client, req, options) {
|
|
46
70
|
return request(() => {
|
|
47
71
|
const path = `openmeter/currencies/custom/${(() => {
|
|
@@ -69,6 +93,13 @@ export function listCostBases(client, req, options) {
|
|
|
69
93
|
});
|
|
70
94
|
});
|
|
71
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* Create cost basis
|
|
98
|
+
*
|
|
99
|
+
* Create a cost basis for a currency.
|
|
100
|
+
*
|
|
101
|
+
* POST /openmeter/currencies/custom/{currencyId}/cost-bases
|
|
102
|
+
*/
|
|
72
103
|
export function createCostBasis(client, req, options) {
|
|
73
104
|
return request(() => {
|
|
74
105
|
const path = `openmeter/currencies/custom/${(() => {
|
|
@@ -92,4 +123,3 @@ export function createCostBasis(client, req, options) {
|
|
|
92
123
|
});
|
|
93
124
|
});
|
|
94
125
|
}
|
|
95
|
-
//# sourceMappingURL=currencies.js.map
|
|
@@ -1,23 +1,186 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type Result, type RequestOptions } from '../lib/types.js';
|
|
3
|
-
import type { CreateCustomerRequest, CreateCustomerResponse, GetCustomerRequest, GetCustomerResponse, ListCustomersRequest, ListCustomersResponse, UpsertCustomerRequest, UpsertCustomerResponse, DeleteCustomerRequest, DeleteCustomerResponse, GetCustomerBillingRequest, GetCustomerBillingResponse, UpdateCustomerBillingRequest, UpdateCustomerBillingResponse, UpdateCustomerBillingAppDataRequest, UpdateCustomerBillingAppDataResponse, CreateCustomerStripeCheckoutSessionRequest, CreateCustomerStripeCheckoutSessionResponse, CreateCustomerStripePortalSessionRequest, CreateCustomerStripePortalSessionResponse, CreateCreditGrantRequest, CreateCreditGrantResponse, GetCreditGrantRequest, GetCreditGrantResponse, ListCreditGrantsRequest, ListCreditGrantsResponse, GetCustomerCreditBalanceRequest, GetCustomerCreditBalanceResponse, CreateCreditAdjustmentRequest, CreateCreditAdjustmentResponse, UpdateCreditGrantExternalSettlementRequest, UpdateCreditGrantExternalSettlementResponse, ListCreditTransactionsRequest, ListCreditTransactionsResponse, ListCustomerChargesRequest, ListCustomerChargesResponse, CreateCustomerChargesRequest, CreateCustomerChargesResponse } from '../models/operations/customers.js';
|
|
3
|
+
import type { CreateCustomerRequest, CreateCustomerResponse, GetCustomerRequest, GetCustomerResponse, ListCustomersRequest, ListCustomersResponse, UpsertCustomerRequest, UpsertCustomerResponse, DeleteCustomerRequest, DeleteCustomerResponse, GetCustomerBillingRequest, GetCustomerBillingResponse, UpdateCustomerBillingRequest, UpdateCustomerBillingResponse, UpdateCustomerBillingAppDataRequest, UpdateCustomerBillingAppDataResponse, CreateCustomerStripeCheckoutSessionRequest, CreateCustomerStripeCheckoutSessionResponse, CreateCustomerStripePortalSessionRequest, CreateCustomerStripePortalSessionResponse, CreateCreditGrantRequest, CreateCreditGrantResponse, GetCreditGrantRequest, GetCreditGrantResponse, ListCreditGrantsRequest, ListCreditGrantsResponse, GetCustomerCreditBalanceRequest, GetCustomerCreditBalanceResponse, CreateCreditAdjustmentRequest, CreateCreditAdjustmentResponse, VoidCreditGrantRequest, VoidCreditGrantResponse, UpdateCreditGrantExternalSettlementRequest, UpdateCreditGrantExternalSettlementResponse, ListCreditTransactionsRequest, ListCreditTransactionsResponse, ListCustomerChargesRequest, ListCustomerChargesResponse, CreateCustomerChargesRequest, CreateCustomerChargesResponse } from '../models/operations/customers.js';
|
|
4
|
+
/**
|
|
5
|
+
* Create customer
|
|
6
|
+
*
|
|
7
|
+
* POST /openmeter/customers
|
|
8
|
+
*/
|
|
4
9
|
export declare function createCustomer(client: Client, req: CreateCustomerRequest, options?: RequestOptions): Promise<Result<CreateCustomerResponse>>;
|
|
10
|
+
/**
|
|
11
|
+
* Get customer
|
|
12
|
+
*
|
|
13
|
+
* GET /openmeter/customers/{customerId}
|
|
14
|
+
*/
|
|
5
15
|
export declare function getCustomer(client: Client, req: GetCustomerRequest, options?: RequestOptions): Promise<Result<GetCustomerResponse>>;
|
|
16
|
+
/**
|
|
17
|
+
* List customers
|
|
18
|
+
*
|
|
19
|
+
* GET /openmeter/customers
|
|
20
|
+
*/
|
|
6
21
|
export declare function listCustomers(client: Client, req?: ListCustomersRequest, options?: RequestOptions): Promise<Result<ListCustomersResponse>>;
|
|
22
|
+
/**
|
|
23
|
+
* Upsert customer
|
|
24
|
+
*
|
|
25
|
+
* PUT /openmeter/customers/{customerId}
|
|
26
|
+
*/
|
|
7
27
|
export declare function upsertCustomer(client: Client, req: UpsertCustomerRequest, options?: RequestOptions): Promise<Result<UpsertCustomerResponse>>;
|
|
28
|
+
/**
|
|
29
|
+
* Delete customer
|
|
30
|
+
*
|
|
31
|
+
* DELETE /openmeter/customers/{customerId}
|
|
32
|
+
*/
|
|
8
33
|
export declare function deleteCustomer(client: Client, req: DeleteCustomerRequest, options?: RequestOptions): Promise<Result<DeleteCustomerResponse>>;
|
|
34
|
+
/**
|
|
35
|
+
* Get customer billing data
|
|
36
|
+
*
|
|
37
|
+
* GET /openmeter/customers/{customerId}/billing
|
|
38
|
+
*/
|
|
9
39
|
export declare function getCustomerBilling(client: Client, req: GetCustomerBillingRequest, options?: RequestOptions): Promise<Result<GetCustomerBillingResponse>>;
|
|
40
|
+
/**
|
|
41
|
+
* Update customer billing data
|
|
42
|
+
*
|
|
43
|
+
* PUT /openmeter/customers/{customerId}/billing
|
|
44
|
+
*/
|
|
10
45
|
export declare function updateCustomerBilling(client: Client, req: UpdateCustomerBillingRequest, options?: RequestOptions): Promise<Result<UpdateCustomerBillingResponse>>;
|
|
46
|
+
/**
|
|
47
|
+
* Update customer billing app data
|
|
48
|
+
*
|
|
49
|
+
* PUT /openmeter/customers/{customerId}/billing/app-data
|
|
50
|
+
*/
|
|
11
51
|
export declare function updateCustomerBillingAppData(client: Client, req: UpdateCustomerBillingAppDataRequest, options?: RequestOptions): Promise<Result<UpdateCustomerBillingAppDataResponse>>;
|
|
52
|
+
/**
|
|
53
|
+
* Create Stripe Checkout Session
|
|
54
|
+
*
|
|
55
|
+
* Create a [Stripe Checkout Session](https://docs.stripe.com/payments/checkout)
|
|
56
|
+
* for the customer.
|
|
57
|
+
*
|
|
58
|
+
* Creates a Checkout Session for collecting payment method information from
|
|
59
|
+
* customers. The session operates in "setup" mode, which collects payment details
|
|
60
|
+
* without charging the customer immediately. The collected payment method can be
|
|
61
|
+
* used for future subscription billing.
|
|
62
|
+
*
|
|
63
|
+
* For hosted checkout sessions, redirect customers to the returned URL. For
|
|
64
|
+
* embedded sessions, use the client_secret to initialize Stripe.js in your
|
|
65
|
+
* application.
|
|
66
|
+
*
|
|
67
|
+
* POST /openmeter/customers/{customerId}/billing/stripe/checkout-sessions
|
|
68
|
+
*/
|
|
12
69
|
export declare function createCustomerStripeCheckoutSession(client: Client, req: CreateCustomerStripeCheckoutSessionRequest, options?: RequestOptions): Promise<Result<CreateCustomerStripeCheckoutSessionResponse>>;
|
|
70
|
+
/**
|
|
71
|
+
* Create Stripe customer portal session
|
|
72
|
+
*
|
|
73
|
+
* Create Stripe Customer Portal Session.
|
|
74
|
+
*
|
|
75
|
+
* Useful to redirect the customer to the Stripe Customer Portal to manage their
|
|
76
|
+
* payment methods, change their billing address and access their invoice history.
|
|
77
|
+
* Only returns URL if the customer billing profile is linked to a stripe app and
|
|
78
|
+
* customer.
|
|
79
|
+
*
|
|
80
|
+
* POST /openmeter/customers/{customerId}/billing/stripe/portal-sessions
|
|
81
|
+
*/
|
|
13
82
|
export declare function createCustomerStripePortalSession(client: Client, req: CreateCustomerStripePortalSessionRequest, options?: RequestOptions): Promise<Result<CreateCustomerStripePortalSessionResponse>>;
|
|
83
|
+
/**
|
|
84
|
+
* Create a new credit grant
|
|
85
|
+
*
|
|
86
|
+
* Create a new credit grant. A credit grant represents an allocation of prepaid
|
|
87
|
+
* credits to a customer.
|
|
88
|
+
*
|
|
89
|
+
* POST /openmeter/customers/{customerId}/credits/grants
|
|
90
|
+
*/
|
|
14
91
|
export declare function createCreditGrant(client: Client, req: CreateCreditGrantRequest, options?: RequestOptions): Promise<Result<CreateCreditGrantResponse>>;
|
|
92
|
+
/**
|
|
93
|
+
* Get a credit grant
|
|
94
|
+
*
|
|
95
|
+
* Get a credit grant.
|
|
96
|
+
*
|
|
97
|
+
* GET /openmeter/customers/{customerId}/credits/grants/{creditGrantId}
|
|
98
|
+
*/
|
|
15
99
|
export declare function getCreditGrant(client: Client, req: GetCreditGrantRequest, options?: RequestOptions): Promise<Result<GetCreditGrantResponse>>;
|
|
100
|
+
/**
|
|
101
|
+
* List credit grants
|
|
102
|
+
*
|
|
103
|
+
* List credit grants.
|
|
104
|
+
*
|
|
105
|
+
* GET /openmeter/customers/{customerId}/credits/grants
|
|
106
|
+
*/
|
|
16
107
|
export declare function listCreditGrants(client: Client, req: ListCreditGrantsRequest, options?: RequestOptions): Promise<Result<ListCreditGrantsResponse>>;
|
|
108
|
+
/**
|
|
109
|
+
* Get a customer's credit balance
|
|
110
|
+
*
|
|
111
|
+
* Get a credit balance.
|
|
112
|
+
*
|
|
113
|
+
* GET /openmeter/customers/{customerId}/credits/balance
|
|
114
|
+
*/
|
|
17
115
|
export declare function getCustomerCreditBalance(client: Client, req: GetCustomerCreditBalanceRequest, options?: RequestOptions): Promise<Result<GetCustomerCreditBalanceResponse>>;
|
|
116
|
+
/**
|
|
117
|
+
* Create a credit adjustment
|
|
118
|
+
*
|
|
119
|
+
* A credit adjustment can be used to make manual adjustments to a customer's
|
|
120
|
+
* credit balance.
|
|
121
|
+
*
|
|
122
|
+
* Supported use-cases:
|
|
123
|
+
*
|
|
124
|
+
* - Usage correction
|
|
125
|
+
*
|
|
126
|
+
* POST /openmeter/customers/{customerId}/credits/adjustments
|
|
127
|
+
*/
|
|
18
128
|
export declare function createCreditAdjustment(client: Client, req: CreateCreditAdjustmentRequest, options?: RequestOptions): Promise<Result<CreateCreditAdjustmentResponse>>;
|
|
129
|
+
/**
|
|
130
|
+
* Void credit grant
|
|
131
|
+
*
|
|
132
|
+
* Void a credit grant, forfeiting the remaining unused balance.
|
|
133
|
+
*
|
|
134
|
+
* Voiding is a forward-looking, irreversible operation. Credits already consumed
|
|
135
|
+
* by usage remain unaffected — only the remaining balance is forfeited. The grant
|
|
136
|
+
* reads as `voided` status afterwards. Payment state is not adjusted when
|
|
137
|
+
* `payment_adjustment` is `none`, so invoice-backed or externally collected
|
|
138
|
+
* payments may still collect the original amount. Only `active` grants can be
|
|
139
|
+
* voided; voiding a pending, expired, or fully consumed grant returns a conflict.
|
|
140
|
+
* Retrying a successful void is an idempotent success.
|
|
141
|
+
*
|
|
142
|
+
* POST /openmeter/customers/{customerId}/credits/grants/{creditGrantId}/void
|
|
143
|
+
*/
|
|
144
|
+
export declare function voidCreditGrant(client: Client, req: VoidCreditGrantRequest, options?: RequestOptions): Promise<Result<VoidCreditGrantResponse>>;
|
|
145
|
+
/**
|
|
146
|
+
* Update credit grant external settlement status
|
|
147
|
+
*
|
|
148
|
+
* Update the payment settlement status of an externally funded credit grant.
|
|
149
|
+
*
|
|
150
|
+
* Use this endpoint to synchronize the payment state of an external payment with
|
|
151
|
+
* the system so that revenue recognition and credit availability work as expected.
|
|
152
|
+
*
|
|
153
|
+
* POST /openmeter/customers/{customerId}/credits/grants/{creditGrantId}/settlement/external
|
|
154
|
+
*/
|
|
19
155
|
export declare function updateCreditGrantExternalSettlement(client: Client, req: UpdateCreditGrantExternalSettlementRequest, options?: RequestOptions): Promise<Result<UpdateCreditGrantExternalSettlementResponse>>;
|
|
156
|
+
/**
|
|
157
|
+
* List credit transactions
|
|
158
|
+
*
|
|
159
|
+
* List credit transactions for a customer.
|
|
160
|
+
*
|
|
161
|
+
* Returns an immutable, chronological record of credit movements: funded credits
|
|
162
|
+
* and consumed credits. Transactions are returned in reverse chronological order
|
|
163
|
+
* by default.
|
|
164
|
+
*
|
|
165
|
+
* GET /openmeter/customers/{customerId}/credits/transactions
|
|
166
|
+
*/
|
|
20
167
|
export declare function listCreditTransactions(client: Client, req: ListCreditTransactionsRequest, options?: RequestOptions): Promise<Result<ListCreditTransactionsResponse>>;
|
|
168
|
+
/**
|
|
169
|
+
* List customer charges
|
|
170
|
+
*
|
|
171
|
+
* List customer charges.
|
|
172
|
+
*
|
|
173
|
+
* Returns the customer's charges that are represented as either flat fee or
|
|
174
|
+
* usage-based charges.
|
|
175
|
+
*
|
|
176
|
+
* GET /openmeter/customers/{customerId}/charges
|
|
177
|
+
*/
|
|
21
178
|
export declare function listCustomerCharges(client: Client, req: ListCustomerChargesRequest, options?: RequestOptions): Promise<Result<ListCustomerChargesResponse>>;
|
|
179
|
+
/**
|
|
180
|
+
* Create customer charge
|
|
181
|
+
*
|
|
182
|
+
* Create customer charge.
|
|
183
|
+
*
|
|
184
|
+
* POST /openmeter/customers/{customerId}/charges
|
|
185
|
+
*/
|
|
22
186
|
export declare function createCustomerCharges(client: Client, req: CreateCustomerChargesRequest, options?: RequestOptions): Promise<Result<CreateCustomerChargesResponse>>;
|
|
23
|
-
//# sourceMappingURL=customers.d.ts.map
|