@openmeter/client 1.0.0-beta.228 → 1.0.0-beta.230
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 +130 -111
- package/dist/funcs/addons.js +115 -28
- package/dist/funcs/apps.js +37 -10
- package/dist/funcs/billing.js +79 -18
- package/dist/funcs/currencies.js +82 -22
- package/dist/funcs/customers.d.ts +3 -1
- package/dist/funcs/customers.js +396 -83
- package/dist/funcs/defaults.js +24 -4
- package/dist/funcs/entitlements.js +19 -5
- package/dist/funcs/events.js +26 -8
- package/dist/funcs/features.js +102 -24
- package/dist/funcs/governance.js +27 -5
- package/dist/funcs/index.d.ts +1 -0
- package/dist/funcs/index.js +1 -0
- package/dist/funcs/invoices.d.ts +8 -0
- package/dist/funcs/invoices.js +81 -0
- package/dist/funcs/llmCost.js +78 -22
- package/dist/funcs/meters.d.ts +2 -1
- package/dist/funcs/meters.js +121 -24
- package/dist/funcs/planAddons.js +106 -20
- package/dist/funcs/plans.js +115 -28
- package/dist/funcs/subscriptions.d.ts +2 -1
- package/dist/funcs/subscriptions.js +182 -38
- package/dist/funcs/tax.js +80 -19
- package/dist/index.d.ts +5 -1
- package/dist/index.js +2 -0
- package/dist/lib/config.d.ts +9 -0
- package/dist/lib/config.js +1 -7
- package/dist/lib/encodings.d.ts +1 -1
- package/dist/lib/encodings.js +5 -4
- package/dist/lib/wire.d.ts +18 -0
- package/dist/lib/wire.js +312 -0
- package/dist/models/operations/addons.d.ts +17 -5
- package/dist/models/operations/apps.d.ts +2 -1
- package/dist/models/operations/billing.d.ts +5 -4
- package/dist/models/operations/currencies.d.ts +27 -9
- package/dist/models/operations/customers.d.ts +84 -33
- package/dist/models/operations/defaults.d.ts +2 -1
- package/dist/models/operations/events.d.ts +20 -4
- package/dist/models/operations/features.d.ts +24 -8
- package/dist/models/operations/governance.d.ts +3 -2
- package/dist/models/operations/invoices.d.ts +48 -0
- package/dist/models/operations/invoices.js +2 -0
- package/dist/models/operations/llmCost.d.ts +16 -4
- package/dist/models/operations/meters.d.ts +29 -8
- package/dist/models/operations/planAddons.d.ts +7 -6
- package/dist/models/operations/plans.d.ts +14 -5
- package/dist/models/operations/subscriptions.d.ts +36 -10
- package/dist/models/operations/tax.d.ts +6 -5
- package/dist/models/schemas.d.ts +27219 -3021
- package/dist/models/schemas.js +7079 -1362
- package/dist/models/types.d.ts +4309 -1046
- package/dist/sdk/apps.js +1 -1
- package/dist/sdk/customers.d.ts +3 -1
- package/dist/sdk/customers.js +7 -1
- package/dist/sdk/entitlements.js +1 -1
- package/dist/sdk/events.js +1 -1
- package/dist/sdk/governance.js +1 -1
- package/dist/sdk/invoices.d.ts +12 -0
- package/dist/sdk/invoices.js +21 -0
- package/dist/sdk/meters.d.ts +2 -1
- package/dist/sdk/meters.js +4 -1
- package/dist/sdk/sdk.d.ts +3 -0
- package/dist/sdk/sdk.js +5 -0
- package/dist/sdk/subscriptions.d.ts +2 -1
- package/dist/sdk/subscriptions.js +4 -1
- package/package.json +4 -3
package/dist/sdk/apps.js
CHANGED
package/dist/sdk/customers.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 { 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, ListCreditTransactionsRequest, ListCreditTransactionsResponse, ListCustomerChargesRequest, ListCustomerChargesResponse } 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, UpdateCreditGrantExternalSettlementRequest, UpdateCreditGrantExternalSettlementResponse, ListCreditTransactionsRequest, ListCreditTransactionsResponse, ListCustomerChargesRequest, ListCustomerChargesResponse, CreateCustomerChargesRequest, CreateCustomerChargesResponse } from '../models/operations/customers.js';
|
|
4
4
|
export declare class Customers {
|
|
5
5
|
private readonly _client;
|
|
6
6
|
constructor(_client: Client);
|
|
@@ -43,6 +43,7 @@ export declare class CustomersCreditsGrants {
|
|
|
43
43
|
create(request: CreateCreditGrantRequest, options?: RequestOptions): Promise<CreateCreditGrantResponse>;
|
|
44
44
|
get(request: GetCreditGrantRequest, options?: RequestOptions): Promise<GetCreditGrantResponse>;
|
|
45
45
|
list(request: ListCreditGrantsRequest, options?: RequestOptions): Promise<ListCreditGrantsResponse>;
|
|
46
|
+
updateExternalSettlement(request: UpdateCreditGrantExternalSettlementRequest, options?: RequestOptions): Promise<UpdateCreditGrantExternalSettlementResponse>;
|
|
46
47
|
}
|
|
47
48
|
export declare class CustomersCreditsBalance {
|
|
48
49
|
private readonly _client;
|
|
@@ -63,5 +64,6 @@ export declare class CustomersCharges {
|
|
|
63
64
|
private readonly _client;
|
|
64
65
|
constructor(_client: Client);
|
|
65
66
|
list(request: ListCustomerChargesRequest, options?: RequestOptions): Promise<ListCustomerChargesResponse>;
|
|
67
|
+
create(request: CreateCustomerChargesRequest, options?: RequestOptions): Promise<CreateCustomerChargesResponse>;
|
|
66
68
|
}
|
|
67
69
|
//# sourceMappingURL=customers.d.ts.map
|
package/dist/sdk/customers.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { unwrap } from '../lib/types.js';
|
|
2
|
-
import { createCustomer, getCustomer, listCustomers, upsertCustomer, deleteCustomer, getCustomerBilling, updateCustomerBilling, updateCustomerBillingAppData, createCustomerStripeCheckoutSession, createCustomerStripePortalSession, createCreditGrant, getCreditGrant, listCreditGrants, getCustomerCreditBalance, createCreditAdjustment, listCreditTransactions, listCustomerCharges, } from '../funcs/customers.js';
|
|
2
|
+
import { createCustomer, getCustomer, listCustomers, upsertCustomer, deleteCustomer, getCustomerBilling, updateCustomerBilling, updateCustomerBillingAppData, createCustomerStripeCheckoutSession, createCustomerStripePortalSession, createCreditGrant, getCreditGrant, listCreditGrants, getCustomerCreditBalance, createCreditAdjustment, updateCreditGrantExternalSettlement, listCreditTransactions, listCustomerCharges, createCustomerCharges, } from '../funcs/customers.js';
|
|
3
3
|
export class Customers {
|
|
4
4
|
_client;
|
|
5
5
|
constructor(_client) {
|
|
@@ -90,6 +90,9 @@ export class CustomersCreditsGrants {
|
|
|
90
90
|
async list(request, options) {
|
|
91
91
|
return unwrap(await listCreditGrants(this._client, request, options));
|
|
92
92
|
}
|
|
93
|
+
async updateExternalSettlement(request, options) {
|
|
94
|
+
return unwrap(await updateCreditGrantExternalSettlement(this._client, request, options));
|
|
95
|
+
}
|
|
93
96
|
}
|
|
94
97
|
export class CustomersCreditsBalance {
|
|
95
98
|
_client;
|
|
@@ -126,5 +129,8 @@ export class CustomersCharges {
|
|
|
126
129
|
async list(request, options) {
|
|
127
130
|
return unwrap(await listCustomerCharges(this._client, request, options));
|
|
128
131
|
}
|
|
132
|
+
async create(request, options) {
|
|
133
|
+
return unwrap(await createCustomerCharges(this._client, request, options));
|
|
134
|
+
}
|
|
129
135
|
}
|
|
130
136
|
//# sourceMappingURL=customers.js.map
|
package/dist/sdk/entitlements.js
CHANGED
package/dist/sdk/events.js
CHANGED
package/dist/sdk/governance.js
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Client } from '../core.js';
|
|
2
|
+
import { type RequestOptions } from '../lib/types.js';
|
|
3
|
+
import type { ListInvoicesRequest, ListInvoicesResponse, GetInvoiceRequest, GetInvoiceResponse, UpdateInvoiceRequest, UpdateInvoiceResponse, DeleteInvoiceRequest, DeleteInvoiceResponse } from '../models/operations/invoices.js';
|
|
4
|
+
export declare class Invoices {
|
|
5
|
+
private readonly _client;
|
|
6
|
+
constructor(_client: Client);
|
|
7
|
+
list(request?: ListInvoicesRequest, options?: RequestOptions): Promise<ListInvoicesResponse>;
|
|
8
|
+
get(request: GetInvoiceRequest, options?: RequestOptions): Promise<GetInvoiceResponse>;
|
|
9
|
+
update(request: UpdateInvoiceRequest, options?: RequestOptions): Promise<UpdateInvoiceResponse>;
|
|
10
|
+
delete(request: DeleteInvoiceRequest, options?: RequestOptions): Promise<DeleteInvoiceResponse>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=invoices.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { unwrap } from '../lib/types.js';
|
|
2
|
+
import { listInvoices, getInvoice, updateInvoice, deleteInvoice, } from '../funcs/invoices.js';
|
|
3
|
+
export class Invoices {
|
|
4
|
+
_client;
|
|
5
|
+
constructor(_client) {
|
|
6
|
+
this._client = _client;
|
|
7
|
+
}
|
|
8
|
+
async list(request, options) {
|
|
9
|
+
return unwrap(await listInvoices(this._client, request, options));
|
|
10
|
+
}
|
|
11
|
+
async get(request, options) {
|
|
12
|
+
return unwrap(await getInvoice(this._client, request, options));
|
|
13
|
+
}
|
|
14
|
+
async update(request, options) {
|
|
15
|
+
return unwrap(await updateInvoice(this._client, request, options));
|
|
16
|
+
}
|
|
17
|
+
async delete(request, options) {
|
|
18
|
+
return unwrap(await deleteInvoice(this._client, request, options));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=invoices.js.map
|
package/dist/sdk/meters.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 { CreateMeterRequest, CreateMeterResponse, GetMeterRequest, GetMeterResponse, ListMetersRequest, ListMetersResponse, UpdateMeterRequest, UpdateMeterResponse, DeleteMeterRequest, DeleteMeterResponse, QueryMeterRequest, QueryMeterResponse } from '../models/operations/meters.js';
|
|
3
|
+
import type { CreateMeterRequest, CreateMeterResponse, GetMeterRequest, GetMeterResponse, ListMetersRequest, ListMetersResponse, UpdateMeterRequest, UpdateMeterResponse, DeleteMeterRequest, DeleteMeterResponse, QueryMeterRequest, QueryMeterResponse, QueryMeterCsvRequest, QueryMeterCsvResponse } from '../models/operations/meters.js';
|
|
4
4
|
export declare class Meters {
|
|
5
5
|
private readonly _client;
|
|
6
6
|
constructor(_client: Client);
|
|
@@ -10,5 +10,6 @@ export declare class Meters {
|
|
|
10
10
|
update(request: UpdateMeterRequest, options?: RequestOptions): Promise<UpdateMeterResponse>;
|
|
11
11
|
delete(request: DeleteMeterRequest, options?: RequestOptions): Promise<DeleteMeterResponse>;
|
|
12
12
|
query(request: QueryMeterRequest, options?: RequestOptions): Promise<QueryMeterResponse>;
|
|
13
|
+
queryCsv(request: QueryMeterCsvRequest, options?: RequestOptions): Promise<QueryMeterCsvResponse>;
|
|
13
14
|
}
|
|
14
15
|
//# sourceMappingURL=meters.d.ts.map
|
package/dist/sdk/meters.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { unwrap } from '../lib/types.js';
|
|
2
|
-
import { createMeter, getMeter, listMeters, updateMeter, deleteMeter, queryMeter, } from '../funcs/meters.js';
|
|
2
|
+
import { createMeter, getMeter, listMeters, updateMeter, deleteMeter, queryMeter, queryMeterCsv, } from '../funcs/meters.js';
|
|
3
3
|
export class Meters {
|
|
4
4
|
_client;
|
|
5
5
|
constructor(_client) {
|
|
@@ -23,5 +23,8 @@ export class Meters {
|
|
|
23
23
|
async query(request, options) {
|
|
24
24
|
return unwrap(await queryMeter(this._client, request, options));
|
|
25
25
|
}
|
|
26
|
+
async queryCsv(request, options) {
|
|
27
|
+
return unwrap(await queryMeterCsv(this._client, request, options));
|
|
28
|
+
}
|
|
26
29
|
}
|
|
27
30
|
//# sourceMappingURL=meters.js.map
|
package/dist/sdk/sdk.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { Entitlements } from './entitlements.js';
|
|
|
6
6
|
import { Subscriptions } from './subscriptions.js';
|
|
7
7
|
import { Apps } from './apps.js';
|
|
8
8
|
import { Billing } from './billing.js';
|
|
9
|
+
import { Invoices } from './invoices.js';
|
|
9
10
|
import { Tax } from './tax.js';
|
|
10
11
|
import { Currencies } from './currencies.js';
|
|
11
12
|
import { Features } from './features.js';
|
|
@@ -30,6 +31,8 @@ export declare class OpenMeter extends Client {
|
|
|
30
31
|
get apps(): Apps;
|
|
31
32
|
private _billing?;
|
|
32
33
|
get billing(): Billing;
|
|
34
|
+
private _invoices?;
|
|
35
|
+
get invoices(): Invoices;
|
|
33
36
|
private _tax?;
|
|
34
37
|
get tax(): Tax;
|
|
35
38
|
private _currencies?;
|
package/dist/sdk/sdk.js
CHANGED
|
@@ -6,6 +6,7 @@ import { Entitlements } from './entitlements.js';
|
|
|
6
6
|
import { Subscriptions } from './subscriptions.js';
|
|
7
7
|
import { Apps } from './apps.js';
|
|
8
8
|
import { Billing } from './billing.js';
|
|
9
|
+
import { Invoices } from './invoices.js';
|
|
9
10
|
import { Tax } from './tax.js';
|
|
10
11
|
import { Currencies } from './currencies.js';
|
|
11
12
|
import { Features } from './features.js';
|
|
@@ -44,6 +45,10 @@ export class OpenMeter extends Client {
|
|
|
44
45
|
get billing() {
|
|
45
46
|
return (this._billing ??= new Billing(this));
|
|
46
47
|
}
|
|
48
|
+
_invoices;
|
|
49
|
+
get invoices() {
|
|
50
|
+
return (this._invoices ??= new Invoices(this));
|
|
51
|
+
}
|
|
47
52
|
_tax;
|
|
48
53
|
get tax() {
|
|
49
54
|
return (this._tax ??= new Tax(this));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type RequestOptions } from '../lib/types.js';
|
|
3
|
-
import type { CreateSubscriptionRequest, CreateSubscriptionResponse, ListSubscriptionsRequest, ListSubscriptionsResponse, GetSubscriptionRequest, GetSubscriptionResponse, CancelSubscriptionRequest, CancelSubscriptionResponse, UnscheduleCancelationRequest, UnscheduleCancelationResponse, ChangeSubscriptionRequest, ChangeSubscriptionResponse, ListSubscriptionAddonsRequest, ListSubscriptionAddonsResponse, GetSubscriptionAddonRequest, GetSubscriptionAddonResponse } from '../models/operations/subscriptions.js';
|
|
3
|
+
import type { CreateSubscriptionRequest, CreateSubscriptionResponse, ListSubscriptionsRequest, ListSubscriptionsResponse, GetSubscriptionRequest, GetSubscriptionResponse, CancelSubscriptionRequest, CancelSubscriptionResponse, UnscheduleCancelationRequest, UnscheduleCancelationResponse, ChangeSubscriptionRequest, ChangeSubscriptionResponse, CreateSubscriptionAddonRequest, CreateSubscriptionAddonResponse, ListSubscriptionAddonsRequest, ListSubscriptionAddonsResponse, GetSubscriptionAddonRequest, GetSubscriptionAddonResponse } from '../models/operations/subscriptions.js';
|
|
4
4
|
export declare class Subscriptions {
|
|
5
5
|
private readonly _client;
|
|
6
6
|
constructor(_client: Client);
|
|
@@ -10,6 +10,7 @@ export declare class Subscriptions {
|
|
|
10
10
|
cancel(request: CancelSubscriptionRequest, options?: RequestOptions): Promise<CancelSubscriptionResponse>;
|
|
11
11
|
unscheduleCancelation(request: UnscheduleCancelationRequest, options?: RequestOptions): Promise<UnscheduleCancelationResponse>;
|
|
12
12
|
change(request: ChangeSubscriptionRequest, options?: RequestOptions): Promise<ChangeSubscriptionResponse>;
|
|
13
|
+
createAddon(request: CreateSubscriptionAddonRequest, options?: RequestOptions): Promise<CreateSubscriptionAddonResponse>;
|
|
13
14
|
listAddons(request: ListSubscriptionAddonsRequest, options?: RequestOptions): Promise<ListSubscriptionAddonsResponse>;
|
|
14
15
|
getAddon(request: GetSubscriptionAddonRequest, options?: RequestOptions): Promise<GetSubscriptionAddonResponse>;
|
|
15
16
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { unwrap } from '../lib/types.js';
|
|
2
|
-
import { createSubscription, listSubscriptions, getSubscription, cancelSubscription, unscheduleCancelation, changeSubscription, listSubscriptionAddons, getSubscriptionAddon, } from '../funcs/subscriptions.js';
|
|
2
|
+
import { createSubscription, listSubscriptions, getSubscription, cancelSubscription, unscheduleCancelation, changeSubscription, createSubscriptionAddon, listSubscriptionAddons, getSubscriptionAddon, } from '../funcs/subscriptions.js';
|
|
3
3
|
export class Subscriptions {
|
|
4
4
|
_client;
|
|
5
5
|
constructor(_client) {
|
|
@@ -23,6 +23,9 @@ export class Subscriptions {
|
|
|
23
23
|
async change(request, options) {
|
|
24
24
|
return unwrap(await changeSubscription(this._client, request, options));
|
|
25
25
|
}
|
|
26
|
+
async createAddon(request, options) {
|
|
27
|
+
return unwrap(await createSubscriptionAddon(this._client, request, options));
|
|
28
|
+
}
|
|
26
29
|
async listAddons(request, options) {
|
|
27
30
|
return unwrap(await listSubscriptionAddons(this._client, request, options));
|
|
28
31
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openmeter/client",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.230",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"homepage": "https://openmeter.io",
|
|
6
6
|
"repository": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"zod": "4.4.3"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@types/node": "25.9.
|
|
17
|
+
"@types/node": "25.9.2",
|
|
18
18
|
"typescript": "5.5.2"
|
|
19
19
|
},
|
|
20
20
|
"exports": {
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
|
-
"build": "tsc"
|
|
31
|
+
"build": "tsc",
|
|
32
|
+
"typecheck": "tsc --noEmit && tsc -p tsconfig.tests.json"
|
|
32
33
|
}
|
|
33
34
|
}
|