@openmeter/client 1.0.0-beta-f16570f0651f → 1.0.0-beta-59287dd4a9b4
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/README.md +12 -11
- package/dist/funcs/apps.d.ts +9 -1
- package/dist/funcs/apps.js +27 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/lib/version.d.ts +1 -1
- package/dist/lib/version.js +1 -1
- package/dist/models/operations/apps.d.ts +4 -0
- package/dist/models/schemas.d.ts +6 -0
- package/dist/models/schemas.js +6 -0
- package/dist/sdk/apps.d.ts +9 -1
- package/dist/sdk/apps.js +11 -1
- package/dist/sdk/internal.d.ts +76 -1
- package/dist/sdk/internal.js +95 -0
- package/dist/sdk/sdk.d.ts +0 -3
- package/dist/sdk/sdk.js +0 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,7 +25,6 @@ TypeSpec definitions and ships fully-typed request and response models.
|
|
|
25
25
|
- [Customers](#customers)
|
|
26
26
|
- [Entitlements](#entitlements)
|
|
27
27
|
- [Subscriptions](#subscriptions)
|
|
28
|
-
- [Apps](#apps)
|
|
29
28
|
- [Billing](#billing)
|
|
30
29
|
- [Tax](#tax)
|
|
31
30
|
- [Features](#features)
|
|
@@ -36,6 +35,7 @@ TypeSpec definitions and ships fully-typed request and response models.
|
|
|
36
35
|
- [Defaults](#defaults)
|
|
37
36
|
- [Internal Operations](#internal-operations)
|
|
38
37
|
- [Internal Subscriptions](#internal-subscriptions)
|
|
38
|
+
- [Internal Apps](#internal-apps)
|
|
39
39
|
- [Internal Invoices](#internal-invoices)
|
|
40
40
|
- [Internal Currencies](#internal-currencies)
|
|
41
41
|
- [Internal Governance](#internal-governance)
|
|
@@ -321,16 +321,6 @@ The full call path, HTTP route, and a short description are listed below.
|
|
|
321
321
|
| `client.subscriptions.listAddons` | `GET /openmeter/subscriptions/{subscriptionId}/addons` | List the add-ons of a subscription. |
|
|
322
322
|
| `client.subscriptions.getAddon` | `GET /openmeter/subscriptions/{subscriptionId}/addons/{subscriptionAddonId}` | Get an add-on association for a subscription. |
|
|
323
323
|
|
|
324
|
-
### Apps
|
|
325
|
-
|
|
326
|
-
| Method | HTTP | Description |
|
|
327
|
-
| ---------------------------- | -------------------------------------- | -------------------------------- |
|
|
328
|
-
| `client.apps.list` | `GET /openmeter/apps` | List installed apps. |
|
|
329
|
-
| `client.apps.get` | `GET /openmeter/apps/{appId}` | Get an installed app. |
|
|
330
|
-
| `client.apps.listCatalog` | `GET /openmeter/app-catalog` | List available apps. |
|
|
331
|
-
| `client.apps.getCatalogItem` | `GET /openmeter/app-catalog/{appType}` | Get an app catalog item by type. |
|
|
332
|
-
| `client.apps.install` | `POST /openmeter/app-catalog/install` | Install an app from the catalog. |
|
|
333
|
-
|
|
334
324
|
### Billing
|
|
335
325
|
|
|
336
326
|
| Method | HTTP | Description |
|
|
@@ -426,6 +416,17 @@ they can change or be removed without notice or semver consideration.
|
|
|
426
416
|
| ------------------------------------------- | ------------------------------------------------------- | ----------------------------- |
|
|
427
417
|
| `client.internal.subscriptions.createAddon` | `POST /openmeter/subscriptions/{subscriptionId}/addons` | Add add-on to a subscription. |
|
|
428
418
|
|
|
419
|
+
### Internal Apps
|
|
420
|
+
|
|
421
|
+
| Method | HTTP | Description |
|
|
422
|
+
| ------------------------------------- | -------------------------------------- | -------------------------------- |
|
|
423
|
+
| `client.internal.apps.list` | `GET /openmeter/apps` | List installed apps. |
|
|
424
|
+
| `client.internal.apps.get` | `GET /openmeter/apps/{appId}` | Get an installed app. |
|
|
425
|
+
| `client.internal.apps.uninstall` | `DELETE /openmeter/apps/{appId}` | Uninstall an app by ID. |
|
|
426
|
+
| `client.internal.apps.listCatalog` | `GET /openmeter/app-catalog` | List available apps. |
|
|
427
|
+
| `client.internal.apps.getCatalogItem` | `GET /openmeter/app-catalog/{appType}` | Get an app catalog item by type. |
|
|
428
|
+
| `client.internal.apps.install` | `POST /openmeter/app-catalog/install` | Install an app from the catalog. |
|
|
429
|
+
|
|
429
430
|
### Internal Invoices
|
|
430
431
|
|
|
431
432
|
| Method | HTTP | Description |
|
package/dist/funcs/apps.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type Result, type RequestOptions } from '../lib/types.js';
|
|
3
|
-
import type { ListAppsRequest, ListAppsResponse, GetAppRequest, GetAppResponse, ListAppCatalogRequest, ListAppCatalogResponse, GetAppCatalogItemRequest, GetAppCatalogItemResponse, InstallAppRequest, InstallAppResponse } 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
4
|
/**
|
|
5
5
|
* List apps
|
|
6
6
|
*
|
|
@@ -17,6 +17,14 @@ export declare function listApps(client: Client, req?: ListAppsRequest, options?
|
|
|
17
17
|
* GET /openmeter/apps/{appId}
|
|
18
18
|
*/
|
|
19
19
|
export declare function getApp(client: Client, req: GetAppRequest, options?: RequestOptions): Promise<Result<GetAppResponse>>;
|
|
20
|
+
/**
|
|
21
|
+
* Uninstall app
|
|
22
|
+
*
|
|
23
|
+
* Uninstall an app by ID.
|
|
24
|
+
*
|
|
25
|
+
* DELETE /openmeter/apps/{appId}
|
|
26
|
+
*/
|
|
27
|
+
export declare function uninstallApp(client: Client, req: UninstallAppRequest, options?: RequestOptions): Promise<Result<UninstallAppResponse>>;
|
|
20
28
|
/**
|
|
21
29
|
* List app catalog
|
|
22
30
|
*
|
package/dist/funcs/apps.js
CHANGED
|
@@ -66,6 +66,33 @@ export function getApp(client, req, options) {
|
|
|
66
66
|
});
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Uninstall app
|
|
71
|
+
*
|
|
72
|
+
* Uninstall an app by ID.
|
|
73
|
+
*
|
|
74
|
+
* DELETE /openmeter/apps/{appId}
|
|
75
|
+
*/
|
|
76
|
+
export function uninstallApp(client, req, options) {
|
|
77
|
+
return request(async () => {
|
|
78
|
+
const pathParamsInput = {
|
|
79
|
+
appId: req.appId,
|
|
80
|
+
};
|
|
81
|
+
const pathParams = client._options.validate
|
|
82
|
+
? toPathWire(pathParamsInput, schemas.uninstallAppPathParams)
|
|
83
|
+
: pathParamsInput;
|
|
84
|
+
if (client._options.validate) {
|
|
85
|
+
assertValid(schemas.uninstallAppPathParamsWire, pathParams);
|
|
86
|
+
}
|
|
87
|
+
const path = `openmeter/apps/${(() => {
|
|
88
|
+
if (pathParams.appId === undefined) {
|
|
89
|
+
throw new Error('missing path parameter: appId');
|
|
90
|
+
}
|
|
91
|
+
return encodeURIComponent(String(pathParams.appId));
|
|
92
|
+
})()}`;
|
|
93
|
+
await http(client).delete(path, options);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
69
96
|
/**
|
|
70
97
|
* List app catalog
|
|
71
98
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ export { Meters } from './sdk/meters.js';
|
|
|
4
4
|
export { Customers } from './sdk/customers.js';
|
|
5
5
|
export { Entitlements } from './sdk/entitlements.js';
|
|
6
6
|
export { Subscriptions } from './sdk/subscriptions.js';
|
|
7
|
-
export { Apps } from './sdk/apps.js';
|
|
8
7
|
export { Billing } from './sdk/billing.js';
|
|
9
8
|
export { Tax } from './sdk/tax.js';
|
|
10
9
|
export { Features } from './sdk/features.js';
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,6 @@ export { Meters } from './sdk/meters.js';
|
|
|
5
5
|
export { Customers } from './sdk/customers.js';
|
|
6
6
|
export { Entitlements } from './sdk/entitlements.js';
|
|
7
7
|
export { Subscriptions } from './sdk/subscriptions.js';
|
|
8
|
-
export { Apps } from './sdk/apps.js';
|
|
9
8
|
export { Billing } from './sdk/billing.js';
|
|
10
9
|
export { Tax } from './sdk/tax.js';
|
|
11
10
|
export { Features } from './sdk/features.js';
|
package/dist/lib/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.0.0-beta-
|
|
1
|
+
export declare const SDK_VERSION = "1.0.0-beta-59287dd4a9b4";
|
package/dist/lib/version.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
// The committed value is a dev placeholder. The publish flow
|
|
3
3
|
// (`make -C api/spec publish-aip-sdk`) stamps the real release version here
|
|
4
4
|
// before `pnpm publish`, after `pnpm version` updates package.json.
|
|
5
|
-
export const SDK_VERSION = '1.0.0-beta-
|
|
5
|
+
export const SDK_VERSION = '1.0.0-beta-59287dd4a9b4';
|
|
@@ -13,6 +13,10 @@ export type GetAppRequest = {
|
|
|
13
13
|
appId: string;
|
|
14
14
|
};
|
|
15
15
|
export type GetAppResponse = App;
|
|
16
|
+
export type UninstallAppRequest = {
|
|
17
|
+
appId: string;
|
|
18
|
+
};
|
|
19
|
+
export type UninstallAppResponse = void;
|
|
16
20
|
export interface ListAppCatalogQuery {
|
|
17
21
|
/** Determines which page of the collection to retrieve. */
|
|
18
22
|
page?: {
|
package/dist/models/schemas.d.ts
CHANGED
|
@@ -13671,6 +13671,9 @@ export declare const getAppResponse: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
13671
13671
|
enableDraftSyncHook: z.ZodBoolean;
|
|
13672
13672
|
enableIssuingSyncHook: z.ZodBoolean;
|
|
13673
13673
|
}, z.core.$strip>], "type">;
|
|
13674
|
+
export declare const uninstallAppPathParams: z.ZodObject<{
|
|
13675
|
+
appId: z.ZodString;
|
|
13676
|
+
}, z.core.$strip>;
|
|
13674
13677
|
export declare const listAppCatalogQueryParams: z.ZodObject<{
|
|
13675
13678
|
page: z.ZodOptional<z.ZodObject<{
|
|
13676
13679
|
size: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
@@ -34010,6 +34013,9 @@ export declare const getAppResponseWire: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
34010
34013
|
enable_draft_sync_hook: z.ZodBoolean;
|
|
34011
34014
|
enable_issuing_sync_hook: z.ZodBoolean;
|
|
34012
34015
|
}, z.core.$strict>], "type">;
|
|
34016
|
+
export declare const uninstallAppPathParamsWire: z.ZodObject<{
|
|
34017
|
+
appId: z.ZodString;
|
|
34018
|
+
}, z.core.$strip>;
|
|
34013
34019
|
export declare const listAppCatalogQueryParamsWire: z.ZodObject<{
|
|
34014
34020
|
page: z.ZodOptional<z.ZodObject<{
|
|
34015
34021
|
size: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
package/dist/models/schemas.js
CHANGED
|
@@ -4646,6 +4646,9 @@ export const getAppPathParams = z.object({
|
|
|
4646
4646
|
appId: ulid,
|
|
4647
4647
|
});
|
|
4648
4648
|
export const getAppResponse = app;
|
|
4649
|
+
export const uninstallAppPathParams = z.object({
|
|
4650
|
+
appId: ulid,
|
|
4651
|
+
});
|
|
4649
4652
|
export const listAppCatalogQueryParams = z.object({
|
|
4650
4653
|
page: z
|
|
4651
4654
|
.object({
|
|
@@ -9683,6 +9686,9 @@ export const getAppPathParamsWire = z.object({
|
|
|
9683
9686
|
appId: ulidWire,
|
|
9684
9687
|
});
|
|
9685
9688
|
export const getAppResponseWire = appWire;
|
|
9689
|
+
export const uninstallAppPathParamsWire = z.object({
|
|
9690
|
+
appId: ulidWire,
|
|
9691
|
+
});
|
|
9686
9692
|
export const listAppCatalogQueryParamsWire = z.object({
|
|
9687
9693
|
page: z
|
|
9688
9694
|
.strictObject({
|
package/dist/sdk/apps.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type RequestOptions } from '../lib/types.js';
|
|
3
|
-
import type { ListAppsRequest, ListAppsResponse, GetAppRequest, GetAppResponse, ListAppCatalogRequest, ListAppCatalogResponse, GetAppCatalogItemRequest, GetAppCatalogItemResponse, InstallAppRequest, InstallAppResponse } 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
4
|
import type { App, AppCatalogItem } from '../models/types.js';
|
|
5
5
|
export declare class Apps {
|
|
6
6
|
private readonly _client;
|
|
@@ -31,6 +31,14 @@ export declare class Apps {
|
|
|
31
31
|
* GET /openmeter/apps/{appId}
|
|
32
32
|
*/
|
|
33
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>;
|
|
34
42
|
/**
|
|
35
43
|
* List app catalog
|
|
36
44
|
*
|
package/dist/sdk/apps.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
|
|
2
2
|
import { unwrap } from '../lib/types.js';
|
|
3
3
|
import { paginatePages } from '../lib/paginate.js';
|
|
4
|
-
import { listApps, getApp, listAppCatalog, getAppCatalogItem, installApp, } from '../funcs/apps.js';
|
|
4
|
+
import { listApps, getApp, uninstallApp, listAppCatalog, getAppCatalogItem, installApp, } from '../funcs/apps.js';
|
|
5
5
|
export class Apps {
|
|
6
6
|
_client;
|
|
7
7
|
constructor(_client) {
|
|
@@ -39,6 +39,16 @@ export class Apps {
|
|
|
39
39
|
async get(request, options) {
|
|
40
40
|
return unwrap(await getApp(this._client, request, options));
|
|
41
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
|
+
}
|
|
42
52
|
/**
|
|
43
53
|
* List app catalog
|
|
44
54
|
*
|
package/dist/sdk/internal.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type RequestOptions } from '../lib/types.js';
|
|
3
3
|
import type { CreateSubscriptionAddonRequest, CreateSubscriptionAddonResponse } from '../models/operations/subscriptions.js';
|
|
4
|
+
import type { ListAppsRequest, ListAppsResponse, GetAppRequest, GetAppResponse, UninstallAppRequest, UninstallAppResponse, ListAppCatalogRequest, ListAppCatalogResponse, GetAppCatalogItemRequest, GetAppCatalogItemResponse, InstallAppRequest, InstallAppResponse } from '../models/operations/apps.js';
|
|
4
5
|
import type { ListInvoicesRequest, ListInvoicesResponse, GetInvoiceRequest, GetInvoiceResponse, UpdateInvoiceRequest, UpdateInvoiceResponse, DeleteInvoiceRequest, DeleteInvoiceResponse, AdvanceInvoiceRequest, AdvanceInvoiceResponse, ApproveInvoiceRequest, ApproveInvoiceResponse, RetryInvoiceRequest, RetryInvoiceResponse, SnapshotQuantitiesInvoiceRequest, SnapshotQuantitiesInvoiceResponse } from '../models/operations/invoices.js';
|
|
5
6
|
import type { ListCurrenciesRequest, ListCurrenciesResponse, CreateCustomCurrencyRequest, CreateCustomCurrencyResponse, GetCustomCurrencyRequest, GetCustomCurrencyResponse, ListCostBasesRequest, ListCostBasesResponse, CreateCostBasisRequest, CreateCostBasisResponse } from '../models/operations/currencies.js';
|
|
6
7
|
import type { QueryGovernanceAccessRequest, QueryGovernanceAccessResponse } from '../models/operations/governance.js';
|
|
7
|
-
import type { CostBasis, Currency, Invoice } from '../models/types.js';
|
|
8
|
+
import type { App, AppCatalogItem, CostBasis, Currency, Invoice } from '../models/types.js';
|
|
8
9
|
/**
|
|
9
10
|
* Operations marked internal in the API definition. They are not part of
|
|
10
11
|
* the customer surface: they may require additional permissions, and they
|
|
@@ -15,6 +16,8 @@ export declare class Internal {
|
|
|
15
16
|
constructor(_client: Client);
|
|
16
17
|
private _subscriptions?;
|
|
17
18
|
get subscriptions(): InternalSubscriptions;
|
|
19
|
+
private _apps?;
|
|
20
|
+
get apps(): InternalApps;
|
|
18
21
|
private _invoices?;
|
|
19
22
|
get invoices(): InternalInvoices;
|
|
20
23
|
private _currencies?;
|
|
@@ -34,6 +37,78 @@ export declare class InternalSubscriptions {
|
|
|
34
37
|
*/
|
|
35
38
|
createAddon(request: CreateSubscriptionAddonRequest, options?: RequestOptions): Promise<CreateSubscriptionAddonResponse>;
|
|
36
39
|
}
|
|
40
|
+
export declare class InternalApps {
|
|
41
|
+
private readonly _client;
|
|
42
|
+
constructor(_client: Client);
|
|
43
|
+
/**
|
|
44
|
+
* List apps
|
|
45
|
+
*
|
|
46
|
+
* List installed apps.
|
|
47
|
+
*
|
|
48
|
+
* GET /openmeter/apps
|
|
49
|
+
*/
|
|
50
|
+
list(request?: ListAppsRequest, options?: RequestOptions): Promise<ListAppsResponse>;
|
|
51
|
+
/**
|
|
52
|
+
* List apps
|
|
53
|
+
*
|
|
54
|
+
* List installed apps.
|
|
55
|
+
*
|
|
56
|
+
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
57
|
+
*
|
|
58
|
+
* GET /openmeter/apps
|
|
59
|
+
*/
|
|
60
|
+
listAll(request?: ListAppsRequest, options?: RequestOptions): AsyncIterable<App>;
|
|
61
|
+
/**
|
|
62
|
+
* Get app
|
|
63
|
+
*
|
|
64
|
+
* Get an installed app.
|
|
65
|
+
*
|
|
66
|
+
* GET /openmeter/apps/{appId}
|
|
67
|
+
*/
|
|
68
|
+
get(request: GetAppRequest, options?: RequestOptions): Promise<GetAppResponse>;
|
|
69
|
+
/**
|
|
70
|
+
* Uninstall app
|
|
71
|
+
*
|
|
72
|
+
* Uninstall an app by ID.
|
|
73
|
+
*
|
|
74
|
+
* DELETE /openmeter/apps/{appId}
|
|
75
|
+
*/
|
|
76
|
+
uninstall(request: UninstallAppRequest, options?: RequestOptions): Promise<UninstallAppResponse>;
|
|
77
|
+
/**
|
|
78
|
+
* List app catalog
|
|
79
|
+
*
|
|
80
|
+
* List available apps.
|
|
81
|
+
*
|
|
82
|
+
* GET /openmeter/app-catalog
|
|
83
|
+
*/
|
|
84
|
+
listCatalog(request?: ListAppCatalogRequest, options?: RequestOptions): Promise<ListAppCatalogResponse>;
|
|
85
|
+
/**
|
|
86
|
+
* List app catalog
|
|
87
|
+
*
|
|
88
|
+
* List available apps.
|
|
89
|
+
*
|
|
90
|
+
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
91
|
+
*
|
|
92
|
+
* GET /openmeter/app-catalog
|
|
93
|
+
*/
|
|
94
|
+
listCatalogAll(request?: ListAppCatalogRequest, options?: RequestOptions): AsyncIterable<AppCatalogItem>;
|
|
95
|
+
/**
|
|
96
|
+
* Get app catalog item by type
|
|
97
|
+
*
|
|
98
|
+
* Get an app catalog item by type.
|
|
99
|
+
*
|
|
100
|
+
* GET /openmeter/app-catalog/{appType}
|
|
101
|
+
*/
|
|
102
|
+
getCatalogItem(request: GetAppCatalogItemRequest, options?: RequestOptions): Promise<GetAppCatalogItemResponse>;
|
|
103
|
+
/**
|
|
104
|
+
* Install app from the catalog
|
|
105
|
+
*
|
|
106
|
+
* Install an app from the catalog.
|
|
107
|
+
*
|
|
108
|
+
* POST /openmeter/app-catalog/install
|
|
109
|
+
*/
|
|
110
|
+
install(request: InstallAppRequest, options?: RequestOptions): Promise<InstallAppResponse>;
|
|
111
|
+
}
|
|
37
112
|
export declare class InternalInvoices {
|
|
38
113
|
private readonly _client;
|
|
39
114
|
constructor(_client: Client);
|
package/dist/sdk/internal.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { unwrap } from '../lib/types.js';
|
|
3
3
|
import { paginatePages } from '../lib/paginate.js';
|
|
4
4
|
import { createSubscriptionAddon } from '../funcs/subscriptions.js';
|
|
5
|
+
import { listApps, getApp, uninstallApp, listAppCatalog, getAppCatalogItem, installApp, } from '../funcs/apps.js';
|
|
5
6
|
import { listInvoices, getInvoice, updateInvoice, deleteInvoice, advanceInvoice, approveInvoice, retryInvoice, snapshotQuantitiesInvoice, } from '../funcs/invoices.js';
|
|
6
7
|
import { listCurrencies, createCustomCurrency, getCustomCurrency, listCostBases, createCostBasis, } from '../funcs/currencies.js';
|
|
7
8
|
import { queryGovernanceAccess } from '../funcs/governance.js';
|
|
@@ -19,6 +20,10 @@ export class Internal {
|
|
|
19
20
|
get subscriptions() {
|
|
20
21
|
return (this._subscriptions ??= new InternalSubscriptions(this._client));
|
|
21
22
|
}
|
|
23
|
+
_apps;
|
|
24
|
+
get apps() {
|
|
25
|
+
return (this._apps ??= new InternalApps(this._client));
|
|
26
|
+
}
|
|
22
27
|
_invoices;
|
|
23
28
|
get invoices() {
|
|
24
29
|
return (this._invoices ??= new InternalInvoices(this._client));
|
|
@@ -48,6 +53,96 @@ export class InternalSubscriptions {
|
|
|
48
53
|
return unwrap(await createSubscriptionAddon(this._client, request, options));
|
|
49
54
|
}
|
|
50
55
|
}
|
|
56
|
+
export class InternalApps {
|
|
57
|
+
_client;
|
|
58
|
+
constructor(_client) {
|
|
59
|
+
this._client = _client;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* List apps
|
|
63
|
+
*
|
|
64
|
+
* List installed apps.
|
|
65
|
+
*
|
|
66
|
+
* GET /openmeter/apps
|
|
67
|
+
*/
|
|
68
|
+
async list(request, options) {
|
|
69
|
+
return unwrap(await listApps(this._client, request, options));
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* List apps
|
|
73
|
+
*
|
|
74
|
+
* List installed apps.
|
|
75
|
+
*
|
|
76
|
+
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
77
|
+
*
|
|
78
|
+
* GET /openmeter/apps
|
|
79
|
+
*/
|
|
80
|
+
listAll(request, options) {
|
|
81
|
+
return paginatePages((req, opts) => listApps(this._client, req, opts), request ?? {}, options);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Get app
|
|
85
|
+
*
|
|
86
|
+
* Get an installed app.
|
|
87
|
+
*
|
|
88
|
+
* GET /openmeter/apps/{appId}
|
|
89
|
+
*/
|
|
90
|
+
async get(request, options) {
|
|
91
|
+
return unwrap(await getApp(this._client, request, options));
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Uninstall app
|
|
95
|
+
*
|
|
96
|
+
* Uninstall an app by ID.
|
|
97
|
+
*
|
|
98
|
+
* DELETE /openmeter/apps/{appId}
|
|
99
|
+
*/
|
|
100
|
+
async uninstall(request, options) {
|
|
101
|
+
return unwrap(await uninstallApp(this._client, request, options));
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* List app catalog
|
|
105
|
+
*
|
|
106
|
+
* List available apps.
|
|
107
|
+
*
|
|
108
|
+
* GET /openmeter/app-catalog
|
|
109
|
+
*/
|
|
110
|
+
async listCatalog(request, options) {
|
|
111
|
+
return unwrap(await listAppCatalog(this._client, request, options));
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* List app catalog
|
|
115
|
+
*
|
|
116
|
+
* List available apps.
|
|
117
|
+
*
|
|
118
|
+
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
119
|
+
*
|
|
120
|
+
* GET /openmeter/app-catalog
|
|
121
|
+
*/
|
|
122
|
+
listCatalogAll(request, options) {
|
|
123
|
+
return paginatePages((req, opts) => listAppCatalog(this._client, req, opts), request ?? {}, options);
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Get app catalog item by type
|
|
127
|
+
*
|
|
128
|
+
* Get an app catalog item by type.
|
|
129
|
+
*
|
|
130
|
+
* GET /openmeter/app-catalog/{appType}
|
|
131
|
+
*/
|
|
132
|
+
async getCatalogItem(request, options) {
|
|
133
|
+
return unwrap(await getAppCatalogItem(this._client, request, options));
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Install app from the catalog
|
|
137
|
+
*
|
|
138
|
+
* Install an app from the catalog.
|
|
139
|
+
*
|
|
140
|
+
* POST /openmeter/app-catalog/install
|
|
141
|
+
*/
|
|
142
|
+
async install(request, options) {
|
|
143
|
+
return unwrap(await installApp(this._client, request, options));
|
|
144
|
+
}
|
|
145
|
+
}
|
|
51
146
|
export class InternalInvoices {
|
|
52
147
|
_client;
|
|
53
148
|
constructor(_client) {
|
package/dist/sdk/sdk.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { Meters } from './meters.js';
|
|
|
4
4
|
import { Customers } from './customers.js';
|
|
5
5
|
import { Entitlements } from './entitlements.js';
|
|
6
6
|
import { Subscriptions } from './subscriptions.js';
|
|
7
|
-
import { Apps } from './apps.js';
|
|
8
7
|
import { Billing } from './billing.js';
|
|
9
8
|
import { Tax } from './tax.js';
|
|
10
9
|
import { Features } from './features.js';
|
|
@@ -25,8 +24,6 @@ export declare class OpenMeter extends Client {
|
|
|
25
24
|
get entitlements(): Entitlements;
|
|
26
25
|
private _subscriptions?;
|
|
27
26
|
get subscriptions(): Subscriptions;
|
|
28
|
-
private _apps?;
|
|
29
|
-
get apps(): Apps;
|
|
30
27
|
private _billing?;
|
|
31
28
|
get billing(): Billing;
|
|
32
29
|
private _tax?;
|
package/dist/sdk/sdk.js
CHANGED
|
@@ -5,7 +5,6 @@ import { Meters } from './meters.js';
|
|
|
5
5
|
import { Customers } from './customers.js';
|
|
6
6
|
import { Entitlements } from './entitlements.js';
|
|
7
7
|
import { Subscriptions } from './subscriptions.js';
|
|
8
|
-
import { Apps } from './apps.js';
|
|
9
8
|
import { Billing } from './billing.js';
|
|
10
9
|
import { Tax } from './tax.js';
|
|
11
10
|
import { Features } from './features.js';
|
|
@@ -36,10 +35,6 @@ export class OpenMeter extends Client {
|
|
|
36
35
|
get subscriptions() {
|
|
37
36
|
return (this._subscriptions ??= new Subscriptions(this));
|
|
38
37
|
}
|
|
39
|
-
_apps;
|
|
40
|
-
get apps() {
|
|
41
|
-
return (this._apps ??= new Apps(this));
|
|
42
|
-
}
|
|
43
38
|
_billing;
|
|
44
39
|
get billing() {
|
|
45
40
|
return (this._billing ??= new Billing(this));
|