@openmeter/client 1.0.0-beta-4bc7392a70e6
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 +318 -0
- package/dist/core.d.ts +10 -0
- package/dist/core.js +38 -0
- package/dist/funcs/addons.d.ts +11 -0
- package/dist/funcs/addons.js +53 -0
- package/dist/funcs/apps.d.ts +6 -0
- package/dist/funcs/apps.js +16 -0
- package/dist/funcs/billing.d.ts +9 -0
- package/dist/funcs/billing.js +33 -0
- package/dist/funcs/currencies.d.ts +8 -0
- package/dist/funcs/currencies.js +35 -0
- package/dist/funcs/customers.d.ts +21 -0
- package/dist/funcs/customers.js +141 -0
- package/dist/funcs/defaults.d.ts +6 -0
- package/dist/funcs/defaults.js +13 -0
- package/dist/funcs/entitlements.d.ts +5 -0
- package/dist/funcs/entitlements.js +10 -0
- package/dist/funcs/events.d.ts +6 -0
- package/dist/funcs/events.js +19 -0
- package/dist/funcs/features.d.ts +10 -0
- package/dist/funcs/features.js +49 -0
- package/dist/funcs/governance.d.ts +5 -0
- package/dist/funcs/governance.js +16 -0
- package/dist/funcs/index.d.ts +17 -0
- package/dist/funcs/index.js +17 -0
- package/dist/funcs/llmCost.d.ts +9 -0
- package/dist/funcs/llmCost.js +42 -0
- package/dist/funcs/meters.d.ts +10 -0
- package/dist/funcs/meters.js +49 -0
- package/dist/funcs/planAddons.d.ts +9 -0
- package/dist/funcs/planAddons.js +48 -0
- package/dist/funcs/plans.d.ts +11 -0
- package/dist/funcs/plans.js +47 -0
- package/dist/funcs/subscriptions.d.ts +12 -0
- package/dist/funcs/subscriptions.js +64 -0
- package/dist/funcs/tax.d.ts +9 -0
- package/dist/funcs/tax.js +40 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.js +23 -0
- package/dist/lib/config.d.ts +14 -0
- package/dist/lib/config.js +7 -0
- package/dist/lib/encodings.d.ts +8 -0
- package/dist/lib/encodings.js +56 -0
- package/dist/lib/request.d.ts +3 -0
- package/dist/lib/request.js +11 -0
- package/dist/lib/to-error.d.ts +2 -0
- package/dist/lib/to-error.js +16 -0
- package/dist/lib/types.d.ts +15 -0
- package/dist/lib/types.js +13 -0
- package/dist/models/errors.d.ts +16 -0
- package/dist/models/errors.js +28 -0
- package/dist/models/operations/addons.d.ts +38 -0
- package/dist/models/operations/addons.js +2 -0
- package/dist/models/operations/apps.d.ts +17 -0
- package/dist/models/operations/apps.js +2 -0
- package/dist/models/operations/billing.d.ts +26 -0
- package/dist/models/operations/billing.js +2 -0
- package/dist/models/operations/currencies.d.ts +35 -0
- package/dist/models/operations/currencies.js +2 -0
- package/dist/models/operations/customers.d.ts +117 -0
- package/dist/models/operations/customers.js +2 -0
- package/dist/models/operations/defaults.d.ts +6 -0
- package/dist/models/operations/defaults.js +2 -0
- package/dist/models/operations/entitlements.d.ts +6 -0
- package/dist/models/operations/entitlements.js +2 -0
- package/dist/models/operations/events.d.ts +13 -0
- package/dist/models/operations/events.js +2 -0
- package/dist/models/operations/features.d.ts +35 -0
- package/dist/models/operations/features.js +2 -0
- package/dist/models/operations/governance.d.ts +9 -0
- package/dist/models/operations/governance.js +2 -0
- package/dist/models/operations/llmCost.d.ts +35 -0
- package/dist/models/operations/llmCost.js +2 -0
- package/dist/models/operations/meters.d.ts +35 -0
- package/dist/models/operations/meters.js +2 -0
- package/dist/models/operations/planAddons.d.ts +34 -0
- package/dist/models/operations/planAddons.js +2 -0
- package/dist/models/operations/plans.d.ts +38 -0
- package/dist/models/operations/plans.js +2 -0
- package/dist/models/operations/subscriptions.d.ts +52 -0
- package/dist/models/operations/subscriptions.js +2 -0
- package/dist/models/operations/tax.d.ts +28 -0
- package/dist/models/operations/tax.js +2 -0
- package/dist/models/schemas.d.ts +11372 -0
- package/dist/models/schemas.js +4023 -0
- package/dist/models/types.d.ts +3385 -0
- package/dist/models/types.js +2 -0
- package/dist/sdk/addons.d.ts +15 -0
- package/dist/sdk/addons.js +30 -0
- package/dist/sdk/apps.d.ts +10 -0
- package/dist/sdk/apps.js +15 -0
- package/dist/sdk/billing.d.ts +13 -0
- package/dist/sdk/billing.js +24 -0
- package/dist/sdk/currencies.d.ts +12 -0
- package/dist/sdk/currencies.js +21 -0
- package/dist/sdk/customers.d.ts +67 -0
- package/dist/sdk/customers.js +130 -0
- package/dist/sdk/defaults.d.ts +10 -0
- package/dist/sdk/defaults.js +15 -0
- package/dist/sdk/entitlements.d.ts +9 -0
- package/dist/sdk/entitlements.js +12 -0
- package/dist/sdk/events.d.ts +10 -0
- package/dist/sdk/events.js +15 -0
- package/dist/sdk/features.d.ts +14 -0
- package/dist/sdk/features.js +27 -0
- package/dist/sdk/governance.d.ts +9 -0
- package/dist/sdk/governance.js +12 -0
- package/dist/sdk/llmCost.d.ts +13 -0
- package/dist/sdk/llmCost.js +24 -0
- package/dist/sdk/meters.d.ts +14 -0
- package/dist/sdk/meters.js +27 -0
- package/dist/sdk/planAddons.d.ts +13 -0
- package/dist/sdk/planAddons.js +24 -0
- package/dist/sdk/plans.d.ts +15 -0
- package/dist/sdk/plans.js +30 -0
- package/dist/sdk/sdk.d.ts +52 -0
- package/dist/sdk/sdk.js +84 -0
- package/dist/sdk/subscriptions.d.ts +16 -0
- package/dist/sdk/subscriptions.js +33 -0
- package/dist/sdk/tax.d.ts +13 -0
- package/dist/sdk/tax.js +24 -0
- package/package.json +33 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { unwrap } from '../lib/types.js';
|
|
2
|
+
import { listPlans, createPlan, updatePlan, getPlan, deletePlan, archivePlan, publishPlan, } from '../funcs/plans.js';
|
|
3
|
+
export class Plans {
|
|
4
|
+
_client;
|
|
5
|
+
constructor(_client) {
|
|
6
|
+
this._client = _client;
|
|
7
|
+
}
|
|
8
|
+
async list(request, options) {
|
|
9
|
+
return unwrap(await listPlans(this._client, request, options));
|
|
10
|
+
}
|
|
11
|
+
async create(request, options) {
|
|
12
|
+
return unwrap(await createPlan(this._client, request, options));
|
|
13
|
+
}
|
|
14
|
+
async update(request, options) {
|
|
15
|
+
return unwrap(await updatePlan(this._client, request, options));
|
|
16
|
+
}
|
|
17
|
+
async get(request, options) {
|
|
18
|
+
return unwrap(await getPlan(this._client, request, options));
|
|
19
|
+
}
|
|
20
|
+
async delete(request, options) {
|
|
21
|
+
return unwrap(await deletePlan(this._client, request, options));
|
|
22
|
+
}
|
|
23
|
+
async archive(request, options) {
|
|
24
|
+
return unwrap(await archivePlan(this._client, request, options));
|
|
25
|
+
}
|
|
26
|
+
async publish(request, options) {
|
|
27
|
+
return unwrap(await publishPlan(this._client, request, options));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=plans.js.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Client } from '../core.js';
|
|
2
|
+
import { Events } from './events.js';
|
|
3
|
+
import { Meters } from './meters.js';
|
|
4
|
+
import { Customers } from './customers.js';
|
|
5
|
+
import { Entitlements } from './entitlements.js';
|
|
6
|
+
import { Subscriptions } from './subscriptions.js';
|
|
7
|
+
import { Apps } from './apps.js';
|
|
8
|
+
import { Billing } from './billing.js';
|
|
9
|
+
import { Tax } from './tax.js';
|
|
10
|
+
import { Currencies } from './currencies.js';
|
|
11
|
+
import { Features } from './features.js';
|
|
12
|
+
import { LLMCost } from './llmCost.js';
|
|
13
|
+
import { Plans } from './plans.js';
|
|
14
|
+
import { Addons } from './addons.js';
|
|
15
|
+
import { PlanAddons } from './planAddons.js';
|
|
16
|
+
import { Defaults } from './defaults.js';
|
|
17
|
+
import { Governance } from './governance.js';
|
|
18
|
+
export declare class OpenMeter extends Client {
|
|
19
|
+
private _events?;
|
|
20
|
+
get events(): Events;
|
|
21
|
+
private _meters?;
|
|
22
|
+
get meters(): Meters;
|
|
23
|
+
private _customers?;
|
|
24
|
+
get customers(): Customers;
|
|
25
|
+
private _entitlements?;
|
|
26
|
+
get entitlements(): Entitlements;
|
|
27
|
+
private _subscriptions?;
|
|
28
|
+
get subscriptions(): Subscriptions;
|
|
29
|
+
private _apps?;
|
|
30
|
+
get apps(): Apps;
|
|
31
|
+
private _billing?;
|
|
32
|
+
get billing(): Billing;
|
|
33
|
+
private _tax?;
|
|
34
|
+
get tax(): Tax;
|
|
35
|
+
private _currencies?;
|
|
36
|
+
get currencies(): Currencies;
|
|
37
|
+
private _features?;
|
|
38
|
+
get features(): Features;
|
|
39
|
+
private _llmCost?;
|
|
40
|
+
get llmCost(): LLMCost;
|
|
41
|
+
private _plans?;
|
|
42
|
+
get plans(): Plans;
|
|
43
|
+
private _addons?;
|
|
44
|
+
get addons(): Addons;
|
|
45
|
+
private _planAddons?;
|
|
46
|
+
get planAddons(): PlanAddons;
|
|
47
|
+
private _defaults?;
|
|
48
|
+
get defaults(): Defaults;
|
|
49
|
+
private _governance?;
|
|
50
|
+
get governance(): Governance;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=sdk.d.ts.map
|
package/dist/sdk/sdk.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Client } from '../core.js';
|
|
2
|
+
import { Events } from './events.js';
|
|
3
|
+
import { Meters } from './meters.js';
|
|
4
|
+
import { Customers } from './customers.js';
|
|
5
|
+
import { Entitlements } from './entitlements.js';
|
|
6
|
+
import { Subscriptions } from './subscriptions.js';
|
|
7
|
+
import { Apps } from './apps.js';
|
|
8
|
+
import { Billing } from './billing.js';
|
|
9
|
+
import { Tax } from './tax.js';
|
|
10
|
+
import { Currencies } from './currencies.js';
|
|
11
|
+
import { Features } from './features.js';
|
|
12
|
+
import { LLMCost } from './llmCost.js';
|
|
13
|
+
import { Plans } from './plans.js';
|
|
14
|
+
import { Addons } from './addons.js';
|
|
15
|
+
import { PlanAddons } from './planAddons.js';
|
|
16
|
+
import { Defaults } from './defaults.js';
|
|
17
|
+
import { Governance } from './governance.js';
|
|
18
|
+
export class OpenMeter extends Client {
|
|
19
|
+
_events;
|
|
20
|
+
get events() {
|
|
21
|
+
return (this._events ??= new Events(this));
|
|
22
|
+
}
|
|
23
|
+
_meters;
|
|
24
|
+
get meters() {
|
|
25
|
+
return (this._meters ??= new Meters(this));
|
|
26
|
+
}
|
|
27
|
+
_customers;
|
|
28
|
+
get customers() {
|
|
29
|
+
return (this._customers ??= new Customers(this));
|
|
30
|
+
}
|
|
31
|
+
_entitlements;
|
|
32
|
+
get entitlements() {
|
|
33
|
+
return (this._entitlements ??= new Entitlements(this));
|
|
34
|
+
}
|
|
35
|
+
_subscriptions;
|
|
36
|
+
get subscriptions() {
|
|
37
|
+
return (this._subscriptions ??= new Subscriptions(this));
|
|
38
|
+
}
|
|
39
|
+
_apps;
|
|
40
|
+
get apps() {
|
|
41
|
+
return (this._apps ??= new Apps(this));
|
|
42
|
+
}
|
|
43
|
+
_billing;
|
|
44
|
+
get billing() {
|
|
45
|
+
return (this._billing ??= new Billing(this));
|
|
46
|
+
}
|
|
47
|
+
_tax;
|
|
48
|
+
get tax() {
|
|
49
|
+
return (this._tax ??= new Tax(this));
|
|
50
|
+
}
|
|
51
|
+
_currencies;
|
|
52
|
+
get currencies() {
|
|
53
|
+
return (this._currencies ??= new Currencies(this));
|
|
54
|
+
}
|
|
55
|
+
_features;
|
|
56
|
+
get features() {
|
|
57
|
+
return (this._features ??= new Features(this));
|
|
58
|
+
}
|
|
59
|
+
_llmCost;
|
|
60
|
+
get llmCost() {
|
|
61
|
+
return (this._llmCost ??= new LLMCost(this));
|
|
62
|
+
}
|
|
63
|
+
_plans;
|
|
64
|
+
get plans() {
|
|
65
|
+
return (this._plans ??= new Plans(this));
|
|
66
|
+
}
|
|
67
|
+
_addons;
|
|
68
|
+
get addons() {
|
|
69
|
+
return (this._addons ??= new Addons(this));
|
|
70
|
+
}
|
|
71
|
+
_planAddons;
|
|
72
|
+
get planAddons() {
|
|
73
|
+
return (this._planAddons ??= new PlanAddons(this));
|
|
74
|
+
}
|
|
75
|
+
_defaults;
|
|
76
|
+
get defaults() {
|
|
77
|
+
return (this._defaults ??= new Defaults(this));
|
|
78
|
+
}
|
|
79
|
+
_governance;
|
|
80
|
+
get governance() {
|
|
81
|
+
return (this._governance ??= new Governance(this));
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=sdk.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Client } from '../core.js';
|
|
2
|
+
import { type RequestOptions } from '../lib/types.js';
|
|
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
|
+
export declare class Subscriptions {
|
|
5
|
+
private readonly _client;
|
|
6
|
+
constructor(_client: Client);
|
|
7
|
+
create(request: CreateSubscriptionRequest, options?: RequestOptions): Promise<CreateSubscriptionResponse>;
|
|
8
|
+
list(request?: ListSubscriptionsRequest, options?: RequestOptions): Promise<ListSubscriptionsResponse>;
|
|
9
|
+
get(request: GetSubscriptionRequest, options?: RequestOptions): Promise<GetSubscriptionResponse>;
|
|
10
|
+
cancel(request: CancelSubscriptionRequest, options?: RequestOptions): Promise<CancelSubscriptionResponse>;
|
|
11
|
+
unscheduleCancelation(request: UnscheduleCancelationRequest, options?: RequestOptions): Promise<UnscheduleCancelationResponse>;
|
|
12
|
+
change(request: ChangeSubscriptionRequest, options?: RequestOptions): Promise<ChangeSubscriptionResponse>;
|
|
13
|
+
listAddons(request: ListSubscriptionAddonsRequest, options?: RequestOptions): Promise<ListSubscriptionAddonsResponse>;
|
|
14
|
+
getAddon(request: GetSubscriptionAddonRequest, options?: RequestOptions): Promise<GetSubscriptionAddonResponse>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=subscriptions.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { unwrap } from '../lib/types.js';
|
|
2
|
+
import { createSubscription, listSubscriptions, getSubscription, cancelSubscription, unscheduleCancelation, changeSubscription, listSubscriptionAddons, getSubscriptionAddon, } from '../funcs/subscriptions.js';
|
|
3
|
+
export class Subscriptions {
|
|
4
|
+
_client;
|
|
5
|
+
constructor(_client) {
|
|
6
|
+
this._client = _client;
|
|
7
|
+
}
|
|
8
|
+
async create(request, options) {
|
|
9
|
+
return unwrap(await createSubscription(this._client, request, options));
|
|
10
|
+
}
|
|
11
|
+
async list(request, options) {
|
|
12
|
+
return unwrap(await listSubscriptions(this._client, request, options));
|
|
13
|
+
}
|
|
14
|
+
async get(request, options) {
|
|
15
|
+
return unwrap(await getSubscription(this._client, request, options));
|
|
16
|
+
}
|
|
17
|
+
async cancel(request, options) {
|
|
18
|
+
return unwrap(await cancelSubscription(this._client, request, options));
|
|
19
|
+
}
|
|
20
|
+
async unscheduleCancelation(request, options) {
|
|
21
|
+
return unwrap(await unscheduleCancelation(this._client, request, options));
|
|
22
|
+
}
|
|
23
|
+
async change(request, options) {
|
|
24
|
+
return unwrap(await changeSubscription(this._client, request, options));
|
|
25
|
+
}
|
|
26
|
+
async listAddons(request, options) {
|
|
27
|
+
return unwrap(await listSubscriptionAddons(this._client, request, options));
|
|
28
|
+
}
|
|
29
|
+
async getAddon(request, options) {
|
|
30
|
+
return unwrap(await getSubscriptionAddon(this._client, request, options));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=subscriptions.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Client } from '../core.js';
|
|
2
|
+
import { type RequestOptions } from '../lib/types.js';
|
|
3
|
+
import type { CreateTaxCodeRequest, CreateTaxCodeResponse, GetTaxCodeRequest, GetTaxCodeResponse, ListTaxCodesRequest, ListTaxCodesResponse, UpsertTaxCodeRequest, UpsertTaxCodeResponse, DeleteTaxCodeRequest, DeleteTaxCodeResponse } from '../models/operations/tax.js';
|
|
4
|
+
export declare class Tax {
|
|
5
|
+
private readonly _client;
|
|
6
|
+
constructor(_client: Client);
|
|
7
|
+
createCode(request: CreateTaxCodeRequest, options?: RequestOptions): Promise<CreateTaxCodeResponse>;
|
|
8
|
+
getCode(request: GetTaxCodeRequest, options?: RequestOptions): Promise<GetTaxCodeResponse>;
|
|
9
|
+
listCodes(request?: ListTaxCodesRequest, options?: RequestOptions): Promise<ListTaxCodesResponse>;
|
|
10
|
+
upsertCode(request: UpsertTaxCodeRequest, options?: RequestOptions): Promise<UpsertTaxCodeResponse>;
|
|
11
|
+
deleteCode(request: DeleteTaxCodeRequest, options?: RequestOptions): Promise<DeleteTaxCodeResponse>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=tax.d.ts.map
|
package/dist/sdk/tax.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { unwrap } from '../lib/types.js';
|
|
2
|
+
import { createTaxCode, getTaxCode, listTaxCodes, upsertTaxCode, deleteTaxCode, } from '../funcs/tax.js';
|
|
3
|
+
export class Tax {
|
|
4
|
+
_client;
|
|
5
|
+
constructor(_client) {
|
|
6
|
+
this._client = _client;
|
|
7
|
+
}
|
|
8
|
+
async createCode(request, options) {
|
|
9
|
+
return unwrap(await createTaxCode(this._client, request, options));
|
|
10
|
+
}
|
|
11
|
+
async getCode(request, options) {
|
|
12
|
+
return unwrap(await getTaxCode(this._client, request, options));
|
|
13
|
+
}
|
|
14
|
+
async listCodes(request, options) {
|
|
15
|
+
return unwrap(await listTaxCodes(this._client, request, options));
|
|
16
|
+
}
|
|
17
|
+
async upsertCode(request, options) {
|
|
18
|
+
return unwrap(await upsertTaxCode(this._client, request, options));
|
|
19
|
+
}
|
|
20
|
+
async deleteCode(request, options) {
|
|
21
|
+
return unwrap(await deleteTaxCode(this._client, request, options));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=tax.js.map
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@openmeter/client",
|
|
3
|
+
"version": "1.0.0-beta-4bc7392a70e6",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"homepage": "https://openmeter.io",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/openmeterio/openmeter.git",
|
|
9
|
+
"directory": "api/spec/packages/aip-client-javascript"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"ky": "2.0.2",
|
|
14
|
+
"zod": "4.4.3"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@types/node": "25.9.1",
|
|
18
|
+
"typescript": "5.5.2"
|
|
19
|
+
},
|
|
20
|
+
"exports": {
|
|
21
|
+
"./zod": {
|
|
22
|
+
"types": "./dist/models/schemas.d.ts",
|
|
23
|
+
"default": "./dist/models/schemas.js"
|
|
24
|
+
},
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"default": "./dist/index.js"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "tsc"
|
|
32
|
+
}
|
|
33
|
+
}
|