@openmeter/client 1.0.0-beta.230 → 1.0.0-beta.232
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +365 -76
- package/dist/core.d.ts +0 -1
- package/dist/core.js +11 -1
- package/dist/funcs/addons.d.ts +49 -1
- package/dist/funcs/addons.js +109 -12
- package/dist/funcs/apps.d.ts +55 -2
- package/dist/funcs/apps.js +179 -4
- package/dist/funcs/billing.d.ts +46 -1
- package/dist/funcs/billing.js +81 -8
- package/dist/funcs/currencies.d.ts +39 -2
- package/dist/funcs/currencies.js +93 -6
- package/dist/funcs/customers.d.ts +165 -2
- package/dist/funcs/customers.js +402 -40
- package/dist/funcs/defaults.d.ts +10 -1
- package/dist/funcs/defaults.js +11 -1
- package/dist/funcs/entitlements.d.ts +5 -1
- package/dist/funcs/entitlements.js +18 -4
- package/dist/funcs/events.d.ts +14 -1
- package/dist/funcs/events.js +18 -1
- package/dist/funcs/features.d.ts +42 -1
- package/dist/funcs/features.js +91 -10
- package/dist/funcs/governance.d.ts +14 -1
- package/dist/funcs/governance.js +15 -1
- package/dist/funcs/index.d.ts +0 -1
- package/dist/funcs/index.js +1 -1
- package/dist/funcs/invoices.d.ts +102 -2
- package/dist/funcs/invoices.js +247 -8
- package/dist/funcs/llmCost.d.ts +36 -1
- package/dist/funcs/llmCost.js +63 -6
- package/dist/funcs/meters.d.ts +53 -1
- package/dist/funcs/meters.js +113 -12
- package/dist/funcs/planAddons.d.ts +35 -1
- package/dist/funcs/planAddons.js +101 -18
- package/dist/funcs/plans.d.ts +49 -1
- package/dist/funcs/plans.js +109 -12
- package/dist/funcs/subscriptions.d.ts +59 -1
- package/dist/funcs/subscriptions.js +147 -18
- package/dist/funcs/tax.d.ts +25 -1
- package/dist/funcs/tax.js +60 -8
- package/dist/index.d.ts +4 -7
- package/dist/index.js +4 -6
- package/dist/lib/config.d.ts +2 -3
- package/dist/lib/config.js +1 -1
- package/dist/lib/encodings.d.ts +0 -1
- package/dist/lib/encodings.js +1 -1
- package/dist/lib/paginate.d.ts +56 -0
- package/dist/lib/paginate.js +60 -0
- package/dist/lib/request.d.ts +0 -1
- package/dist/lib/request.js +1 -1
- package/dist/lib/to-error.d.ts +0 -1
- package/dist/lib/to-error.js +1 -1
- package/dist/lib/types.d.ts +0 -1
- package/dist/lib/types.js +1 -1
- package/dist/lib/version.d.ts +1 -0
- package/dist/lib/version.js +5 -0
- package/dist/lib/wire.d.ts +4 -1
- package/dist/lib/wire.js +118 -7
- package/dist/models/errors.d.ts +13 -2
- package/dist/models/errors.js +31 -4
- package/dist/models/operations/addons.d.ts +0 -1
- package/dist/models/operations/addons.js +1 -1
- package/dist/models/operations/apps.d.ts +26 -5
- package/dist/models/operations/apps.js +1 -1
- package/dist/models/operations/billing.d.ts +0 -1
- package/dist/models/operations/billing.js +1 -1
- package/dist/models/operations/currencies.d.ts +10 -1
- package/dist/models/operations/currencies.js +1 -1
- package/dist/models/operations/customers.d.ts +11 -7
- package/dist/models/operations/customers.js +1 -1
- package/dist/models/operations/defaults.d.ts +0 -1
- package/dist/models/operations/defaults.js +1 -1
- package/dist/models/operations/entitlements.d.ts +0 -1
- package/dist/models/operations/entitlements.js +1 -1
- package/dist/models/operations/events.d.ts +0 -1
- package/dist/models/operations/events.js +1 -1
- package/dist/models/operations/features.d.ts +0 -1
- package/dist/models/operations/features.js +1 -1
- package/dist/models/operations/governance.d.ts +0 -1
- package/dist/models/operations/governance.js +1 -1
- package/dist/models/operations/invoices.d.ts +20 -7
- package/dist/models/operations/invoices.js +1 -1
- package/dist/models/operations/llmCost.d.ts +0 -1
- package/dist/models/operations/llmCost.js +1 -1
- package/dist/models/operations/meters.d.ts +0 -1
- package/dist/models/operations/meters.js +1 -1
- package/dist/models/operations/planAddons.d.ts +0 -1
- package/dist/models/operations/planAddons.js +1 -1
- package/dist/models/operations/plans.d.ts +0 -1
- package/dist/models/operations/plans.js +1 -1
- package/dist/models/operations/subscriptions.d.ts +0 -1
- package/dist/models/operations/subscriptions.js +1 -1
- package/dist/models/operations/tax.d.ts +0 -1
- package/dist/models/operations/tax.js +1 -1
- package/dist/models/schemas.d.ts +11651 -6090
- package/dist/models/schemas.js +991 -468
- package/dist/models/types.d.ts +941 -810
- package/dist/models/types.js +1 -1
- package/dist/sdk/addons.d.ts +60 -1
- package/dist/sdk/addons.js +63 -1
- package/dist/sdk/apps.d.ts +68 -2
- package/dist/sdk/apps.js +81 -2
- package/dist/sdk/billing.d.ts +57 -1
- package/dist/sdk/billing.js +60 -1
- package/dist/sdk/customers.d.ts +211 -2
- package/dist/sdk/customers.js +222 -2
- package/dist/sdk/defaults.d.ts +10 -1
- package/dist/sdk/defaults.js +11 -1
- package/dist/sdk/entitlements.d.ts +5 -1
- package/dist/sdk/entitlements.js +6 -1
- package/dist/sdk/events.d.ts +25 -1
- package/dist/sdk/events.js +28 -1
- package/dist/sdk/features.d.ts +53 -1
- package/dist/sdk/features.js +56 -1
- package/dist/sdk/internal.d.ts +328 -0
- package/dist/sdk/internal.js +404 -0
- package/dist/sdk/invoices.d.ts +5 -2
- package/dist/sdk/invoices.js +13 -2
- package/dist/sdk/llmCost.d.ts +57 -1
- package/dist/sdk/llmCost.js +62 -1
- package/dist/sdk/meters.d.ts +64 -1
- package/dist/sdk/meters.js +67 -1
- package/dist/sdk/planAddons.d.ts +46 -1
- package/dist/sdk/planAddons.js +49 -1
- package/dist/sdk/plans.d.ts +60 -1
- package/dist/sdk/plans.js +63 -1
- package/dist/sdk/sdk.d.ts +9 -13
- package/dist/sdk/sdk.js +11 -20
- package/dist/sdk/subscriptions.d.ts +72 -3
- package/dist/sdk/subscriptions.js +77 -5
- package/dist/sdk/tax.d.ts +34 -1
- package/dist/sdk/tax.js +37 -1
- package/package.json +30 -6
- package/dist/sdk/currencies.d.ts +0 -12
- package/dist/sdk/currencies.js +0 -21
- package/dist/sdk/governance.d.ts +0 -9
- package/dist/sdk/governance.js +0 -12
package/dist/models/types.js
CHANGED
package/dist/sdk/addons.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 { ListAddonsRequest, ListAddonsResponse, CreateAddonRequest, CreateAddonResponse, UpdateAddonRequest, UpdateAddonResponse, GetAddonRequest, GetAddonResponse, DeleteAddonRequest, DeleteAddonResponse, ArchiveAddonRequest, ArchiveAddonResponse, PublishAddonRequest, PublishAddonResponse } from '../models/operations/addons.js';
|
|
4
|
+
import type { Addon } from '../models/types.js';
|
|
4
5
|
export declare class Addons {
|
|
5
6
|
private readonly _client;
|
|
6
7
|
constructor(_client: Client);
|
|
8
|
+
/**
|
|
9
|
+
* List add-ons
|
|
10
|
+
*
|
|
11
|
+
* List all add-ons.
|
|
12
|
+
*
|
|
13
|
+
* GET /openmeter/addons
|
|
14
|
+
*/
|
|
7
15
|
list(request?: ListAddonsRequest, options?: RequestOptions): Promise<ListAddonsResponse>;
|
|
16
|
+
/**
|
|
17
|
+
* List add-ons
|
|
18
|
+
*
|
|
19
|
+
* List all add-ons.
|
|
20
|
+
*
|
|
21
|
+
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
22
|
+
*
|
|
23
|
+
* GET /openmeter/addons
|
|
24
|
+
*/
|
|
25
|
+
listAll(request?: ListAddonsRequest, options?: RequestOptions): AsyncIterable<Addon>;
|
|
26
|
+
/**
|
|
27
|
+
* Create add-on
|
|
28
|
+
*
|
|
29
|
+
* Create a new add-on.
|
|
30
|
+
*
|
|
31
|
+
* POST /openmeter/addons
|
|
32
|
+
*/
|
|
8
33
|
create(request: CreateAddonRequest, options?: RequestOptions): Promise<CreateAddonResponse>;
|
|
34
|
+
/**
|
|
35
|
+
* Update add-on
|
|
36
|
+
*
|
|
37
|
+
* Update an add-on by id.
|
|
38
|
+
*
|
|
39
|
+
* PUT /openmeter/addons/{addonId}
|
|
40
|
+
*/
|
|
9
41
|
update(request: UpdateAddonRequest, options?: RequestOptions): Promise<UpdateAddonResponse>;
|
|
42
|
+
/**
|
|
43
|
+
* Get add-on
|
|
44
|
+
*
|
|
45
|
+
* Get add-on by id.
|
|
46
|
+
*
|
|
47
|
+
* GET /openmeter/addons/{addonId}
|
|
48
|
+
*/
|
|
10
49
|
get(request: GetAddonRequest, options?: RequestOptions): Promise<GetAddonResponse>;
|
|
50
|
+
/**
|
|
51
|
+
* Soft delete add-on
|
|
52
|
+
*
|
|
53
|
+
* Soft delete add-on by id.
|
|
54
|
+
*
|
|
55
|
+
* DELETE /openmeter/addons/{addonId}
|
|
56
|
+
*/
|
|
11
57
|
delete(request: DeleteAddonRequest, options?: RequestOptions): Promise<DeleteAddonResponse>;
|
|
58
|
+
/**
|
|
59
|
+
* Archive add-on version
|
|
60
|
+
*
|
|
61
|
+
* Archive an add-on version.
|
|
62
|
+
*
|
|
63
|
+
* POST /openmeter/addons/{addonId}/archive
|
|
64
|
+
*/
|
|
12
65
|
archive(request: ArchiveAddonRequest, options?: RequestOptions): Promise<ArchiveAddonResponse>;
|
|
66
|
+
/**
|
|
67
|
+
* Publish add-on version
|
|
68
|
+
*
|
|
69
|
+
* Publish an add-on version.
|
|
70
|
+
*
|
|
71
|
+
* POST /openmeter/addons/{addonId}/publish
|
|
72
|
+
*/
|
|
13
73
|
publish(request: PublishAddonRequest, options?: RequestOptions): Promise<PublishAddonResponse>;
|
|
14
74
|
}
|
|
15
|
-
//# sourceMappingURL=addons.d.ts.map
|
package/dist/sdk/addons.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 { listAddons, createAddon, updateAddon, getAddon, deleteAddon, archiveAddon, publishAddon, } from '../funcs/addons.js';
|
|
3
5
|
export class Addons {
|
|
4
6
|
_client;
|
|
5
7
|
constructor(_client) {
|
|
6
8
|
this._client = _client;
|
|
7
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* List add-ons
|
|
12
|
+
*
|
|
13
|
+
* List all add-ons.
|
|
14
|
+
*
|
|
15
|
+
* GET /openmeter/addons
|
|
16
|
+
*/
|
|
8
17
|
async list(request, options) {
|
|
9
18
|
return unwrap(await listAddons(this._client, request, options));
|
|
10
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* List add-ons
|
|
22
|
+
*
|
|
23
|
+
* List all add-ons.
|
|
24
|
+
*
|
|
25
|
+
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
26
|
+
*
|
|
27
|
+
* GET /openmeter/addons
|
|
28
|
+
*/
|
|
29
|
+
listAll(request, options) {
|
|
30
|
+
return paginatePages((req, opts) => listAddons(this._client, req, opts), request ?? {}, options);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Create add-on
|
|
34
|
+
*
|
|
35
|
+
* Create a new add-on.
|
|
36
|
+
*
|
|
37
|
+
* POST /openmeter/addons
|
|
38
|
+
*/
|
|
11
39
|
async create(request, options) {
|
|
12
40
|
return unwrap(await createAddon(this._client, request, options));
|
|
13
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Update add-on
|
|
44
|
+
*
|
|
45
|
+
* Update an add-on by id.
|
|
46
|
+
*
|
|
47
|
+
* PUT /openmeter/addons/{addonId}
|
|
48
|
+
*/
|
|
14
49
|
async update(request, options) {
|
|
15
50
|
return unwrap(await updateAddon(this._client, request, options));
|
|
16
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Get add-on
|
|
54
|
+
*
|
|
55
|
+
* Get add-on by id.
|
|
56
|
+
*
|
|
57
|
+
* GET /openmeter/addons/{addonId}
|
|
58
|
+
*/
|
|
17
59
|
async get(request, options) {
|
|
18
60
|
return unwrap(await getAddon(this._client, request, options));
|
|
19
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Soft delete add-on
|
|
64
|
+
*
|
|
65
|
+
* Soft delete add-on by id.
|
|
66
|
+
*
|
|
67
|
+
* DELETE /openmeter/addons/{addonId}
|
|
68
|
+
*/
|
|
20
69
|
async delete(request, options) {
|
|
21
70
|
return unwrap(await deleteAddon(this._client, request, options));
|
|
22
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Archive add-on version
|
|
74
|
+
*
|
|
75
|
+
* Archive an add-on version.
|
|
76
|
+
*
|
|
77
|
+
* POST /openmeter/addons/{addonId}/archive
|
|
78
|
+
*/
|
|
23
79
|
async archive(request, options) {
|
|
24
80
|
return unwrap(await archiveAddon(this._client, request, options));
|
|
25
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Publish add-on version
|
|
84
|
+
*
|
|
85
|
+
* Publish an add-on version.
|
|
86
|
+
*
|
|
87
|
+
* POST /openmeter/addons/{addonId}/publish
|
|
88
|
+
*/
|
|
26
89
|
async publish(request, options) {
|
|
27
90
|
return unwrap(await publishAddon(this._client, request, options));
|
|
28
91
|
}
|
|
29
92
|
}
|
|
30
|
-
//# sourceMappingURL=addons.js.map
|
package/dist/sdk/apps.d.ts
CHANGED
|
@@ -1,10 +1,76 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type RequestOptions } from '../lib/types.js';
|
|
3
|
-
import type { ListAppsRequest, ListAppsResponse, GetAppRequest, GetAppResponse } from '../models/operations/apps.js';
|
|
3
|
+
import type { ListAppsRequest, ListAppsResponse, GetAppRequest, GetAppResponse, UninstallAppRequest, UninstallAppResponse, ListAppCatalogRequest, ListAppCatalogResponse, GetAppCatalogItemRequest, GetAppCatalogItemResponse, InstallAppRequest, InstallAppResponse } from '../models/operations/apps.js';
|
|
4
|
+
import type { App, AppCatalogItem } from '../models/types.js';
|
|
4
5
|
export declare class Apps {
|
|
5
6
|
private readonly _client;
|
|
6
7
|
constructor(_client: Client);
|
|
8
|
+
/**
|
|
9
|
+
* List apps
|
|
10
|
+
*
|
|
11
|
+
* List installed apps.
|
|
12
|
+
*
|
|
13
|
+
* GET /openmeter/apps
|
|
14
|
+
*/
|
|
7
15
|
list(request?: ListAppsRequest, options?: RequestOptions): Promise<ListAppsResponse>;
|
|
16
|
+
/**
|
|
17
|
+
* List apps
|
|
18
|
+
*
|
|
19
|
+
* List installed apps.
|
|
20
|
+
*
|
|
21
|
+
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
22
|
+
*
|
|
23
|
+
* GET /openmeter/apps
|
|
24
|
+
*/
|
|
25
|
+
listAll(request?: ListAppsRequest, options?: RequestOptions): AsyncIterable<App>;
|
|
26
|
+
/**
|
|
27
|
+
* Get app
|
|
28
|
+
*
|
|
29
|
+
* Get an installed app.
|
|
30
|
+
*
|
|
31
|
+
* GET /openmeter/apps/{appId}
|
|
32
|
+
*/
|
|
8
33
|
get(request: GetAppRequest, options?: RequestOptions): Promise<GetAppResponse>;
|
|
34
|
+
/**
|
|
35
|
+
* Uninstall app
|
|
36
|
+
*
|
|
37
|
+
* Uninstall an app by ID.
|
|
38
|
+
*
|
|
39
|
+
* DELETE /openmeter/apps/{appId}
|
|
40
|
+
*/
|
|
41
|
+
uninstall(request: UninstallAppRequest, options?: RequestOptions): Promise<UninstallAppResponse>;
|
|
42
|
+
/**
|
|
43
|
+
* List app catalog
|
|
44
|
+
*
|
|
45
|
+
* List available apps.
|
|
46
|
+
*
|
|
47
|
+
* GET /openmeter/app-catalog
|
|
48
|
+
*/
|
|
49
|
+
listCatalog(request?: ListAppCatalogRequest, options?: RequestOptions): Promise<ListAppCatalogResponse>;
|
|
50
|
+
/**
|
|
51
|
+
* List app catalog
|
|
52
|
+
*
|
|
53
|
+
* List available apps.
|
|
54
|
+
*
|
|
55
|
+
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
56
|
+
*
|
|
57
|
+
* GET /openmeter/app-catalog
|
|
58
|
+
*/
|
|
59
|
+
listCatalogAll(request?: ListAppCatalogRequest, options?: RequestOptions): AsyncIterable<AppCatalogItem>;
|
|
60
|
+
/**
|
|
61
|
+
* Get app catalog item by type
|
|
62
|
+
*
|
|
63
|
+
* Get an app catalog item by type.
|
|
64
|
+
*
|
|
65
|
+
* GET /openmeter/app-catalog/{appType}
|
|
66
|
+
*/
|
|
67
|
+
getCatalogItem(request: GetAppCatalogItemRequest, options?: RequestOptions): Promise<GetAppCatalogItemResponse>;
|
|
68
|
+
/**
|
|
69
|
+
* Install app from the catalog
|
|
70
|
+
*
|
|
71
|
+
* Install an app from the catalog.
|
|
72
|
+
*
|
|
73
|
+
* POST /openmeter/app-catalog/install
|
|
74
|
+
*/
|
|
75
|
+
install(request: InstallAppRequest, options?: RequestOptions): Promise<InstallAppResponse>;
|
|
9
76
|
}
|
|
10
|
-
//# sourceMappingURL=apps.d.ts.map
|
package/dist/sdk/apps.js
CHANGED
|
@@ -1,15 +1,94 @@
|
|
|
1
|
+
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
|
|
1
2
|
import { unwrap } from '../lib/types.js';
|
|
2
|
-
import {
|
|
3
|
+
import { paginatePages } from '../lib/paginate.js';
|
|
4
|
+
import { listApps, getApp, uninstallApp, listAppCatalog, getAppCatalogItem, installApp, } from '../funcs/apps.js';
|
|
3
5
|
export class Apps {
|
|
4
6
|
_client;
|
|
5
7
|
constructor(_client) {
|
|
6
8
|
this._client = _client;
|
|
7
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* List apps
|
|
12
|
+
*
|
|
13
|
+
* List installed apps.
|
|
14
|
+
*
|
|
15
|
+
* GET /openmeter/apps
|
|
16
|
+
*/
|
|
8
17
|
async list(request, options) {
|
|
9
18
|
return unwrap(await listApps(this._client, request, options));
|
|
10
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* List apps
|
|
22
|
+
*
|
|
23
|
+
* List installed apps.
|
|
24
|
+
*
|
|
25
|
+
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
26
|
+
*
|
|
27
|
+
* GET /openmeter/apps
|
|
28
|
+
*/
|
|
29
|
+
listAll(request, options) {
|
|
30
|
+
return paginatePages((req, opts) => listApps(this._client, req, opts), request ?? {}, options);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get app
|
|
34
|
+
*
|
|
35
|
+
* Get an installed app.
|
|
36
|
+
*
|
|
37
|
+
* GET /openmeter/apps/{appId}
|
|
38
|
+
*/
|
|
11
39
|
async get(request, options) {
|
|
12
40
|
return unwrap(await getApp(this._client, request, options));
|
|
13
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Uninstall app
|
|
44
|
+
*
|
|
45
|
+
* Uninstall an app by ID.
|
|
46
|
+
*
|
|
47
|
+
* DELETE /openmeter/apps/{appId}
|
|
48
|
+
*/
|
|
49
|
+
async uninstall(request, options) {
|
|
50
|
+
return unwrap(await uninstallApp(this._client, request, options));
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* List app catalog
|
|
54
|
+
*
|
|
55
|
+
* List available apps.
|
|
56
|
+
*
|
|
57
|
+
* GET /openmeter/app-catalog
|
|
58
|
+
*/
|
|
59
|
+
async listCatalog(request, options) {
|
|
60
|
+
return unwrap(await listAppCatalog(this._client, request, options));
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* List app catalog
|
|
64
|
+
*
|
|
65
|
+
* List available apps.
|
|
66
|
+
*
|
|
67
|
+
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
68
|
+
*
|
|
69
|
+
* GET /openmeter/app-catalog
|
|
70
|
+
*/
|
|
71
|
+
listCatalogAll(request, options) {
|
|
72
|
+
return paginatePages((req, opts) => listAppCatalog(this._client, req, opts), request ?? {}, options);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Get app catalog item by type
|
|
76
|
+
*
|
|
77
|
+
* Get an app catalog item by type.
|
|
78
|
+
*
|
|
79
|
+
* GET /openmeter/app-catalog/{appType}
|
|
80
|
+
*/
|
|
81
|
+
async getCatalogItem(request, options) {
|
|
82
|
+
return unwrap(await getAppCatalogItem(this._client, request, options));
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Install app from the catalog
|
|
86
|
+
*
|
|
87
|
+
* Install an app from the catalog.
|
|
88
|
+
*
|
|
89
|
+
* POST /openmeter/app-catalog/install
|
|
90
|
+
*/
|
|
91
|
+
async install(request, options) {
|
|
92
|
+
return unwrap(await installApp(this._client, request, options));
|
|
93
|
+
}
|
|
14
94
|
}
|
|
15
|
-
//# sourceMappingURL=apps.js.map
|
package/dist/sdk/billing.d.ts
CHANGED
|
@@ -1,13 +1,69 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { 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
|
+
import type { Profile } from '../models/types.js';
|
|
4
5
|
export declare class Billing {
|
|
5
6
|
private readonly _client;
|
|
6
7
|
constructor(_client: Client);
|
|
8
|
+
/**
|
|
9
|
+
* List billing profiles
|
|
10
|
+
*
|
|
11
|
+
* List billing profiles.
|
|
12
|
+
*
|
|
13
|
+
* GET /openmeter/profiles
|
|
14
|
+
*/
|
|
7
15
|
listProfiles(request?: ListBillingProfilesRequest, options?: RequestOptions): Promise<ListBillingProfilesResponse>;
|
|
16
|
+
/**
|
|
17
|
+
* List billing profiles
|
|
18
|
+
*
|
|
19
|
+
* List billing profiles.
|
|
20
|
+
*
|
|
21
|
+
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
22
|
+
*
|
|
23
|
+
* GET /openmeter/profiles
|
|
24
|
+
*/
|
|
25
|
+
listProfilesAll(request?: ListBillingProfilesRequest, options?: RequestOptions): AsyncIterable<Profile>;
|
|
26
|
+
/**
|
|
27
|
+
* Create a new billing profile
|
|
28
|
+
*
|
|
29
|
+
* Create a new billing profile.
|
|
30
|
+
*
|
|
31
|
+
* Billing profiles contain the settings for billing and controls invoice
|
|
32
|
+
* generation. An organization can have multiple billing profiles defined. A
|
|
33
|
+
* billing profile is linked to a specific app. This association is established
|
|
34
|
+
* during the billing profile's creation and remains immutable.
|
|
35
|
+
*
|
|
36
|
+
* POST /openmeter/profiles
|
|
37
|
+
*/
|
|
8
38
|
createProfile(request: CreateBillingProfileRequest, options?: RequestOptions): Promise<CreateBillingProfileResponse>;
|
|
39
|
+
/**
|
|
40
|
+
* Get a billing profile
|
|
41
|
+
*
|
|
42
|
+
* Get a billing profile.
|
|
43
|
+
*
|
|
44
|
+
* GET /openmeter/profiles/{id}
|
|
45
|
+
*/
|
|
9
46
|
getProfile(request: GetBillingProfileRequest, options?: RequestOptions): Promise<GetBillingProfileResponse>;
|
|
47
|
+
/**
|
|
48
|
+
* Update a billing profile
|
|
49
|
+
*
|
|
50
|
+
* Update a billing profile.
|
|
51
|
+
*
|
|
52
|
+
* PUT /openmeter/profiles/{id}
|
|
53
|
+
*/
|
|
10
54
|
updateProfile(request: UpdateBillingProfileRequest, options?: RequestOptions): Promise<UpdateBillingProfileResponse>;
|
|
55
|
+
/**
|
|
56
|
+
* Delete a billing profile
|
|
57
|
+
*
|
|
58
|
+
* Delete a billing profile.
|
|
59
|
+
*
|
|
60
|
+
* Only such billing profiles can be deleted that are:
|
|
61
|
+
*
|
|
62
|
+
* - not the default profile
|
|
63
|
+
* - not pinned to any customer using customer overrides
|
|
64
|
+
* - only have finalized invoices
|
|
65
|
+
*
|
|
66
|
+
* DELETE /openmeter/profiles/{id}
|
|
67
|
+
*/
|
|
11
68
|
deleteProfile(request: DeleteBillingProfileRequest, options?: RequestOptions): Promise<DeleteBillingProfileResponse>;
|
|
12
69
|
}
|
|
13
|
-
//# sourceMappingURL=billing.d.ts.map
|
package/dist/sdk/billing.js
CHANGED
|
@@ -1,24 +1,83 @@
|
|
|
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 { listBillingProfiles, createBillingProfile, getBillingProfile, updateBillingProfile, deleteBillingProfile, } from '../funcs/billing.js';
|
|
3
5
|
export class Billing {
|
|
4
6
|
_client;
|
|
5
7
|
constructor(_client) {
|
|
6
8
|
this._client = _client;
|
|
7
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* List billing profiles
|
|
12
|
+
*
|
|
13
|
+
* List billing profiles.
|
|
14
|
+
*
|
|
15
|
+
* GET /openmeter/profiles
|
|
16
|
+
*/
|
|
8
17
|
async listProfiles(request, options) {
|
|
9
18
|
return unwrap(await listBillingProfiles(this._client, request, options));
|
|
10
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* List billing profiles
|
|
22
|
+
*
|
|
23
|
+
* List billing profiles.
|
|
24
|
+
*
|
|
25
|
+
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
26
|
+
*
|
|
27
|
+
* GET /openmeter/profiles
|
|
28
|
+
*/
|
|
29
|
+
listProfilesAll(request, options) {
|
|
30
|
+
return paginatePages((req, opts) => listBillingProfiles(this._client, req, opts), request ?? {}, options);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Create a new billing profile
|
|
34
|
+
*
|
|
35
|
+
* Create a new billing profile.
|
|
36
|
+
*
|
|
37
|
+
* Billing profiles contain the settings for billing and controls invoice
|
|
38
|
+
* generation. An organization can have multiple billing profiles defined. A
|
|
39
|
+
* billing profile is linked to a specific app. This association is established
|
|
40
|
+
* during the billing profile's creation and remains immutable.
|
|
41
|
+
*
|
|
42
|
+
* POST /openmeter/profiles
|
|
43
|
+
*/
|
|
11
44
|
async createProfile(request, options) {
|
|
12
45
|
return unwrap(await createBillingProfile(this._client, request, options));
|
|
13
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Get a billing profile
|
|
49
|
+
*
|
|
50
|
+
* Get a billing profile.
|
|
51
|
+
*
|
|
52
|
+
* GET /openmeter/profiles/{id}
|
|
53
|
+
*/
|
|
14
54
|
async getProfile(request, options) {
|
|
15
55
|
return unwrap(await getBillingProfile(this._client, request, options));
|
|
16
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Update a billing profile
|
|
59
|
+
*
|
|
60
|
+
* Update a billing profile.
|
|
61
|
+
*
|
|
62
|
+
* PUT /openmeter/profiles/{id}
|
|
63
|
+
*/
|
|
17
64
|
async updateProfile(request, options) {
|
|
18
65
|
return unwrap(await updateBillingProfile(this._client, request, options));
|
|
19
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Delete a billing profile
|
|
69
|
+
*
|
|
70
|
+
* Delete a billing profile.
|
|
71
|
+
*
|
|
72
|
+
* Only such billing profiles can be deleted that are:
|
|
73
|
+
*
|
|
74
|
+
* - not the default profile
|
|
75
|
+
* - not pinned to any customer using customer overrides
|
|
76
|
+
* - only have finalized invoices
|
|
77
|
+
*
|
|
78
|
+
* DELETE /openmeter/profiles/{id}
|
|
79
|
+
*/
|
|
20
80
|
async deleteProfile(request, options) {
|
|
21
81
|
return unwrap(await deleteBillingProfile(this._client, request, options));
|
|
22
82
|
}
|
|
23
83
|
}
|
|
24
|
-
//# sourceMappingURL=billing.js.map
|