@openmeter/client 1.0.0-beta.236 → 1.0.0-beta.238
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 +31 -22
- package/dist/funcs/charges.d.ts +11 -1
- package/dist/funcs/charges.js +45 -1
- package/dist/funcs/customers.d.ts +29 -1
- package/dist/funcs/customers.js +96 -2
- package/dist/funcs/features.js +1 -1
- package/dist/funcs/notifications.d.ts +15 -15
- package/dist/funcs/notifications.js +73 -73
- package/dist/index.d.ts +1 -1
- package/dist/lib/paginate.d.ts +12 -6
- package/dist/lib/paginate.js +23 -9
- package/dist/lib/version.d.ts +1 -1
- package/dist/lib/version.js +1 -1
- package/dist/models/operations/charges.d.ts +16 -3
- package/dist/models/operations/customers.d.ts +26 -6
- package/dist/models/operations/entitlementAccess.d.ts +3 -2
- package/dist/models/operations/events.d.ts +3 -2
- package/dist/models/operations/features.d.ts +1 -1
- package/dist/models/operations/notifications.d.ts +33 -33
- package/dist/models/schemas.d.ts +93856 -42843
- package/dist/models/schemas.js +5228 -911
- package/dist/models/types.d.ts +2626 -378
- package/dist/sdk/charges.d.ts +11 -1
- package/dist/sdk/charges.js +13 -1
- package/dist/sdk/customers.d.ts +15 -1
- package/dist/sdk/customers.js +17 -1
- package/dist/sdk/internal.d.ts +39 -12
- package/dist/sdk/internal.js +60 -23
- package/dist/sdk/notifications.d.ts +7 -7
- package/dist/sdk/notifications.js +13 -13
- package/package.json +2 -2
package/dist/sdk/charges.d.ts
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type RequestOptions } from '../lib/types.js';
|
|
3
|
-
import type { ListChargesRequest, ListChargesResponse } from '../models/operations/charges.js';
|
|
3
|
+
import type { GetChargeRequest, GetChargeResponse, ListChargesRequest, ListChargesResponse } from '../models/operations/charges.js';
|
|
4
4
|
import type { Charge } from '../models/types.js';
|
|
5
5
|
export declare class Charges {
|
|
6
6
|
private readonly _client;
|
|
7
7
|
constructor(_client: Client);
|
|
8
|
+
/**
|
|
9
|
+
* Get charge
|
|
10
|
+
*
|
|
11
|
+
* Get a flat fee or usage-based charge by ID.
|
|
12
|
+
*
|
|
13
|
+
* Deleted charges are returned with their status and realization history.
|
|
14
|
+
*
|
|
15
|
+
* GET /openmeter/charges/{chargeId}
|
|
16
|
+
*/
|
|
17
|
+
get(request: GetChargeRequest, options?: RequestOptions): Promise<GetChargeResponse>;
|
|
8
18
|
/**
|
|
9
19
|
* List charges
|
|
10
20
|
*
|
package/dist/sdk/charges.js
CHANGED
|
@@ -1,12 +1,24 @@
|
|
|
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 { listCharges } from '../funcs/charges.js';
|
|
4
|
+
import { getCharge, listCharges } from '../funcs/charges.js';
|
|
5
5
|
export class Charges {
|
|
6
6
|
_client;
|
|
7
7
|
constructor(_client) {
|
|
8
8
|
this._client = _client;
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Get charge
|
|
12
|
+
*
|
|
13
|
+
* Get a flat fee or usage-based charge by ID.
|
|
14
|
+
*
|
|
15
|
+
* Deleted charges are returned with their status and realization history.
|
|
16
|
+
*
|
|
17
|
+
* GET /openmeter/charges/{chargeId}
|
|
18
|
+
*/
|
|
19
|
+
async get(request, options) {
|
|
20
|
+
return unwrap(await getCharge(this._client, request, options));
|
|
21
|
+
}
|
|
10
22
|
/**
|
|
11
23
|
* List charges
|
|
12
24
|
*
|
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, CreateCustomerEntitlementRequest, CreateCustomerEntitlementResponse, OverrideCustomerEntitlementRequest, OverrideCustomerEntitlementResponse, GetCustomerEntitlementHistoryRequest, GetCustomerEntitlementHistoryResponse, GetCustomerEntitlementRequest, GetCustomerEntitlementResponse, ListCustomerEntitlementsRequest, ListCustomerEntitlementsResponse, ResetCustomerEntitlementUsageRequest, ResetCustomerEntitlementUsageResponse, DeleteCustomerEntitlementRequest, DeleteCustomerEntitlementResponse, CreateCustomerEntitlementGrantRequest, CreateCustomerEntitlementGrantResponse, ListCustomerEntitlementGrantsRequest, ListCustomerEntitlementGrantsResponse, 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';
|
|
3
|
+
import type { CreateCustomerRequest, CreateCustomerResponse, GetCustomerRequest, GetCustomerResponse, ListCustomersRequest, ListCustomersResponse, UpsertCustomerRequest, UpsertCustomerResponse, DeleteCustomerRequest, DeleteCustomerResponse, GetCustomerBillingRequest, GetCustomerBillingResponse, UpdateCustomerBillingRequest, UpdateCustomerBillingResponse, UpdateCustomerBillingProfileRequest, UpdateCustomerBillingProfileResponse, UpdateCustomerBillingAppDataRequest, UpdateCustomerBillingAppDataResponse, CreateCustomerStripeCheckoutSessionRequest, CreateCustomerStripeCheckoutSessionResponse, CreateCustomerStripePortalSessionRequest, CreateCustomerStripePortalSessionResponse, CreateCustomerEntitlementRequest, CreateCustomerEntitlementResponse, OverrideCustomerEntitlementRequest, OverrideCustomerEntitlementResponse, GetCustomerEntitlementHistoryRequest, GetCustomerEntitlementHistoryResponse, GetCustomerEntitlementRequest, GetCustomerEntitlementResponse, ListCustomerEntitlementsRequest, ListCustomerEntitlementsResponse, ResetCustomerEntitlementUsageRequest, ResetCustomerEntitlementUsageResponse, DeleteCustomerEntitlementRequest, DeleteCustomerEntitlementResponse, CreateCustomerEntitlementGrantRequest, CreateCustomerEntitlementGrantResponse, ListCustomerEntitlementGrantsRequest, ListCustomerEntitlementGrantsResponse, 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
4
|
import type { Charge, CreditGrant, CreditTransaction, Customer, Entitlement, EntitlementGrant } from '../models/types.js';
|
|
5
5
|
export declare class Customers {
|
|
6
6
|
private readonly _client;
|
|
@@ -64,9 +64,23 @@ export declare class CustomersBilling {
|
|
|
64
64
|
/**
|
|
65
65
|
* Update customer billing data
|
|
66
66
|
*
|
|
67
|
+
* Update billing data while preserving the current profile selection when
|
|
68
|
+
* billing_profile is omitted or null. Use the dedicated billing profile endpoint
|
|
69
|
+
* to remove the selection.
|
|
70
|
+
*
|
|
67
71
|
* PUT /openmeter/customers/{customerId}/billing
|
|
68
72
|
*/
|
|
69
73
|
update(request: UpdateCustomerBillingRequest, options?: RequestOptions): Promise<UpdateCustomerBillingResponse>;
|
|
74
|
+
/**
|
|
75
|
+
* Update customer billing profile
|
|
76
|
+
*
|
|
77
|
+
* Set the customer's explicit billing profile selection. Omitting billing_profile
|
|
78
|
+
* or setting it to null removes the selection and uses the current namespace
|
|
79
|
+
* default.
|
|
80
|
+
*
|
|
81
|
+
* PUT /openmeter/customers/{customerId}/billing/profile
|
|
82
|
+
*/
|
|
83
|
+
updateProfile(request: UpdateCustomerBillingProfileRequest, options?: RequestOptions): Promise<UpdateCustomerBillingProfileResponse>;
|
|
70
84
|
/**
|
|
71
85
|
* Update customer billing app data
|
|
72
86
|
*
|
package/dist/sdk/customers.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 { paginateCursor, paginatePages } from '../lib/paginate.js';
|
|
4
|
-
import { createCustomer, getCustomer, listCustomers, upsertCustomer, deleteCustomer, getCustomerBilling, updateCustomerBilling, updateCustomerBillingAppData, createCustomerStripeCheckoutSession, createCustomerStripePortalSession, createCustomerEntitlement, overrideCustomerEntitlement, getCustomerEntitlementHistory, getCustomerEntitlement, listCustomerEntitlements, resetCustomerEntitlementUsage, deleteCustomerEntitlement, createCustomerEntitlementGrant, listCustomerEntitlementGrants, createCreditGrant, getCreditGrant, listCreditGrants, getCustomerCreditBalance, createCreditAdjustment, voidCreditGrant, updateCreditGrantExternalSettlement, listCreditTransactions, listCustomerCharges, createCustomerCharges, } from '../funcs/customers.js';
|
|
4
|
+
import { createCustomer, getCustomer, listCustomers, upsertCustomer, deleteCustomer, getCustomerBilling, updateCustomerBilling, updateCustomerBillingProfile, updateCustomerBillingAppData, createCustomerStripeCheckoutSession, createCustomerStripePortalSession, createCustomerEntitlement, overrideCustomerEntitlement, getCustomerEntitlementHistory, getCustomerEntitlement, listCustomerEntitlements, resetCustomerEntitlementUsage, deleteCustomerEntitlement, createCustomerEntitlementGrant, listCustomerEntitlementGrants, createCreditGrant, getCreditGrant, listCreditGrants, getCustomerCreditBalance, createCreditAdjustment, voidCreditGrant, updateCreditGrantExternalSettlement, listCreditTransactions, listCustomerCharges, createCustomerCharges, } from '../funcs/customers.js';
|
|
5
5
|
export class Customers {
|
|
6
6
|
_client;
|
|
7
7
|
constructor(_client) {
|
|
@@ -90,11 +90,27 @@ export class CustomersBilling {
|
|
|
90
90
|
/**
|
|
91
91
|
* Update customer billing data
|
|
92
92
|
*
|
|
93
|
+
* Update billing data while preserving the current profile selection when
|
|
94
|
+
* billing_profile is omitted or null. Use the dedicated billing profile endpoint
|
|
95
|
+
* to remove the selection.
|
|
96
|
+
*
|
|
93
97
|
* PUT /openmeter/customers/{customerId}/billing
|
|
94
98
|
*/
|
|
95
99
|
async update(request, options) {
|
|
96
100
|
return unwrap(await updateCustomerBilling(this._client, request, options));
|
|
97
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* Update customer billing profile
|
|
104
|
+
*
|
|
105
|
+
* Set the customer's explicit billing profile selection. Omitting billing_profile
|
|
106
|
+
* or setting it to null removes the selection and uses the current namespace
|
|
107
|
+
* default.
|
|
108
|
+
*
|
|
109
|
+
* PUT /openmeter/customers/{customerId}/billing/profile
|
|
110
|
+
*/
|
|
111
|
+
async updateProfile(request, options) {
|
|
112
|
+
return unwrap(await updateCustomerBillingProfile(this._client, request, options));
|
|
113
|
+
}
|
|
98
114
|
/**
|
|
99
115
|
* Update customer billing app data
|
|
100
116
|
*
|
package/dist/sdk/internal.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type RequestOptions } from '../lib/types.js';
|
|
3
|
+
import type { InvoiceCustomerChargesRequest, InvoiceCustomerChargesResponse } from '../models/operations/customers.js';
|
|
3
4
|
import type { CreateSubscriptionAddonRequest, CreateSubscriptionAddonResponse, UpdateSubscriptionAddonRequest, UpdateSubscriptionAddonResponse } from '../models/operations/subscriptions.js';
|
|
4
5
|
import type { ExecuteAppActionRequest, ExecuteAppActionResponse } from '../models/operations/apps.js';
|
|
5
|
-
import type {
|
|
6
|
+
import type { ListBillingNotificationRulesRequest, ListBillingNotificationRulesResponse, CreateBillingNotificationRuleRequest, CreateBillingNotificationRuleResponse, GetBillingNotificationRuleRequest, GetBillingNotificationRuleResponse, UpdateBillingNotificationRuleRequest, UpdateBillingNotificationRuleResponse, DeleteBillingNotificationRuleRequest, DeleteBillingNotificationRuleResponse, TestBillingNotificationRuleRequest, TestBillingNotificationRuleResponse, ListBillingNotificationEventsRequest, ListBillingNotificationEventsResponse, GetBillingNotificationEventRequest, GetBillingNotificationEventResponse, ResendBillingNotificationEventRequest, ResendBillingNotificationEventResponse } from '../models/operations/notifications.js';
|
|
6
7
|
import type { NotificationEvent, NotificationRule } from '../models/types.js';
|
|
7
8
|
/**
|
|
8
9
|
* Operations marked internal in the API definition. They are not part of
|
|
@@ -12,6 +13,8 @@ import type { NotificationEvent, NotificationRule } from '../models/types.js';
|
|
|
12
13
|
export declare class Internal {
|
|
13
14
|
private readonly _client;
|
|
14
15
|
constructor(_client: Client);
|
|
16
|
+
private _customers?;
|
|
17
|
+
get customers(): InternalCustomers;
|
|
15
18
|
private _subscriptions?;
|
|
16
19
|
get subscriptions(): InternalSubscriptions;
|
|
17
20
|
private _apps?;
|
|
@@ -19,6 +22,30 @@ export declare class Internal {
|
|
|
19
22
|
private _notifications?;
|
|
20
23
|
get notifications(): InternalNotifications;
|
|
21
24
|
}
|
|
25
|
+
export declare class InternalCustomers {
|
|
26
|
+
private readonly _client;
|
|
27
|
+
constructor(_client: Client);
|
|
28
|
+
private _charges?;
|
|
29
|
+
get charges(): InternalCustomersCharges;
|
|
30
|
+
}
|
|
31
|
+
export declare class InternalCustomersCharges {
|
|
32
|
+
private readonly _client;
|
|
33
|
+
constructor(_client: Client);
|
|
34
|
+
/**
|
|
35
|
+
* Invoice a customer's charges
|
|
36
|
+
*
|
|
37
|
+
* Invoice a customer's charges outside the normal billing cycle. Collection
|
|
38
|
+
* alignment is bypassed. The customer's progressive billing setting applies unless
|
|
39
|
+
* explicitly overridden. All eligible pending lines are considered.
|
|
40
|
+
*
|
|
41
|
+
* Returns the created standard invoices, one per collected currency. Lines blocked
|
|
42
|
+
* by their owning engine remain pending. If all eligible lines are blocked or no
|
|
43
|
+
* lines are eligible, returns a validation error.
|
|
44
|
+
*
|
|
45
|
+
* POST /openmeter/customers/{customerId}/charges/invoice
|
|
46
|
+
*/
|
|
47
|
+
invoice(request: InvoiceCustomerChargesRequest, options?: RequestOptions): Promise<InvoiceCustomerChargesResponse>;
|
|
48
|
+
}
|
|
22
49
|
export declare class InternalSubscriptions {
|
|
23
50
|
private readonly _client;
|
|
24
51
|
constructor(_client: Client);
|
|
@@ -64,7 +91,7 @@ export declare class InternalNotifications {
|
|
|
64
91
|
*
|
|
65
92
|
* GET /openmeter/notification/rules
|
|
66
93
|
*/
|
|
67
|
-
|
|
94
|
+
listBillingRules(request?: ListBillingNotificationRulesRequest, options?: RequestOptions): Promise<ListBillingNotificationRulesResponse>;
|
|
68
95
|
/**
|
|
69
96
|
* List notification rules
|
|
70
97
|
*
|
|
@@ -74,7 +101,7 @@ export declare class InternalNotifications {
|
|
|
74
101
|
*
|
|
75
102
|
* GET /openmeter/notification/rules
|
|
76
103
|
*/
|
|
77
|
-
|
|
104
|
+
listBillingRulesAll(request?: ListBillingNotificationRulesRequest, options?: RequestOptions): AsyncIterable<NotificationRule>;
|
|
78
105
|
/**
|
|
79
106
|
* Create notification rule
|
|
80
107
|
*
|
|
@@ -82,7 +109,7 @@ export declare class InternalNotifications {
|
|
|
82
109
|
*
|
|
83
110
|
* POST /openmeter/notification/rules
|
|
84
111
|
*/
|
|
85
|
-
|
|
112
|
+
createBillingRule(request: CreateBillingNotificationRuleRequest, options?: RequestOptions): Promise<CreateBillingNotificationRuleResponse>;
|
|
86
113
|
/**
|
|
87
114
|
* Get notification rule
|
|
88
115
|
*
|
|
@@ -90,7 +117,7 @@ export declare class InternalNotifications {
|
|
|
90
117
|
*
|
|
91
118
|
* GET /openmeter/notification/rules/{notificationRuleId}
|
|
92
119
|
*/
|
|
93
|
-
|
|
120
|
+
getBillingRule(request: GetBillingNotificationRuleRequest, options?: RequestOptions): Promise<GetBillingNotificationRuleResponse>;
|
|
94
121
|
/**
|
|
95
122
|
* Update notification rule
|
|
96
123
|
*
|
|
@@ -98,7 +125,7 @@ export declare class InternalNotifications {
|
|
|
98
125
|
*
|
|
99
126
|
* PUT /openmeter/notification/rules/{notificationRuleId}
|
|
100
127
|
*/
|
|
101
|
-
|
|
128
|
+
updateBillingRule(request: UpdateBillingNotificationRuleRequest, options?: RequestOptions): Promise<UpdateBillingNotificationRuleResponse>;
|
|
102
129
|
/**
|
|
103
130
|
* Delete notification rule
|
|
104
131
|
*
|
|
@@ -106,7 +133,7 @@ export declare class InternalNotifications {
|
|
|
106
133
|
*
|
|
107
134
|
* DELETE /openmeter/notification/rules/{notificationRuleId}
|
|
108
135
|
*/
|
|
109
|
-
|
|
136
|
+
deleteBillingRule(request: DeleteBillingNotificationRuleRequest, options?: RequestOptions): Promise<DeleteBillingNotificationRuleResponse>;
|
|
110
137
|
/**
|
|
111
138
|
* Test notification rule
|
|
112
139
|
*
|
|
@@ -116,7 +143,7 @@ export declare class InternalNotifications {
|
|
|
116
143
|
*
|
|
117
144
|
* POST /openmeter/notification/rules/{notificationRuleId}/test
|
|
118
145
|
*/
|
|
119
|
-
|
|
146
|
+
testBillingRule(request: TestBillingNotificationRuleRequest, options?: RequestOptions): Promise<TestBillingNotificationRuleResponse>;
|
|
120
147
|
/**
|
|
121
148
|
* List notification events
|
|
122
149
|
*
|
|
@@ -124,7 +151,7 @@ export declare class InternalNotifications {
|
|
|
124
151
|
*
|
|
125
152
|
* GET /openmeter/notification/events
|
|
126
153
|
*/
|
|
127
|
-
|
|
154
|
+
listBillingEvents(request?: ListBillingNotificationEventsRequest, options?: RequestOptions): Promise<ListBillingNotificationEventsResponse>;
|
|
128
155
|
/**
|
|
129
156
|
* List notification events
|
|
130
157
|
*
|
|
@@ -134,7 +161,7 @@ export declare class InternalNotifications {
|
|
|
134
161
|
*
|
|
135
162
|
* GET /openmeter/notification/events
|
|
136
163
|
*/
|
|
137
|
-
|
|
164
|
+
listBillingEventsAll(request?: ListBillingNotificationEventsRequest, options?: RequestOptions): AsyncIterable<NotificationEvent>;
|
|
138
165
|
/**
|
|
139
166
|
* Get notification event
|
|
140
167
|
*
|
|
@@ -142,7 +169,7 @@ export declare class InternalNotifications {
|
|
|
142
169
|
*
|
|
143
170
|
* GET /openmeter/notification/events/{notificationEventId}
|
|
144
171
|
*/
|
|
145
|
-
|
|
172
|
+
getBillingEvent(request: GetBillingNotificationEventRequest, options?: RequestOptions): Promise<GetBillingNotificationEventResponse>;
|
|
146
173
|
/**
|
|
147
174
|
* Resend notification event
|
|
148
175
|
*
|
|
@@ -154,5 +181,5 @@ export declare class InternalNotifications {
|
|
|
154
181
|
*
|
|
155
182
|
* POST /openmeter/notification/events/{notificationEventId}/resend
|
|
156
183
|
*/
|
|
157
|
-
|
|
184
|
+
resendBillingEvent(request: ResendBillingNotificationEventRequest, options?: RequestOptions): Promise<ResendBillingNotificationEventResponse>;
|
|
158
185
|
}
|
package/dist/sdk/internal.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
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 { invoiceCustomerCharges } from '../funcs/customers.js';
|
|
4
5
|
import { createSubscriptionAddon, updateSubscriptionAddon, } from '../funcs/subscriptions.js';
|
|
5
6
|
import { executeAppAction } from '../funcs/apps.js';
|
|
6
|
-
import {
|
|
7
|
+
import { listBillingNotificationRules, createBillingNotificationRule, getBillingNotificationRule, updateBillingNotificationRule, deleteBillingNotificationRule, testBillingNotificationRule, listBillingNotificationEvents, getBillingNotificationEvent, resendBillingNotificationEvent, } from '../funcs/notifications.js';
|
|
7
8
|
/**
|
|
8
9
|
* Operations marked internal in the API definition. They are not part of
|
|
9
10
|
* the customer surface: they may require additional permissions, and they
|
|
@@ -14,6 +15,10 @@ export class Internal {
|
|
|
14
15
|
constructor(_client) {
|
|
15
16
|
this._client = _client;
|
|
16
17
|
}
|
|
18
|
+
_customers;
|
|
19
|
+
get customers() {
|
|
20
|
+
return (this._customers ??= new InternalCustomers(this._client));
|
|
21
|
+
}
|
|
17
22
|
_subscriptions;
|
|
18
23
|
get subscriptions() {
|
|
19
24
|
return (this._subscriptions ??= new InternalSubscriptions(this._client));
|
|
@@ -27,6 +32,38 @@ export class Internal {
|
|
|
27
32
|
return (this._notifications ??= new InternalNotifications(this._client));
|
|
28
33
|
}
|
|
29
34
|
}
|
|
35
|
+
export class InternalCustomers {
|
|
36
|
+
_client;
|
|
37
|
+
constructor(_client) {
|
|
38
|
+
this._client = _client;
|
|
39
|
+
}
|
|
40
|
+
_charges;
|
|
41
|
+
get charges() {
|
|
42
|
+
return (this._charges ??= new InternalCustomersCharges(this._client));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
export class InternalCustomersCharges {
|
|
46
|
+
_client;
|
|
47
|
+
constructor(_client) {
|
|
48
|
+
this._client = _client;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Invoice a customer's charges
|
|
52
|
+
*
|
|
53
|
+
* Invoice a customer's charges outside the normal billing cycle. Collection
|
|
54
|
+
* alignment is bypassed. The customer's progressive billing setting applies unless
|
|
55
|
+
* explicitly overridden. All eligible pending lines are considered.
|
|
56
|
+
*
|
|
57
|
+
* Returns the created standard invoices, one per collected currency. Lines blocked
|
|
58
|
+
* by their owning engine remain pending. If all eligible lines are blocked or no
|
|
59
|
+
* lines are eligible, returns a validation error.
|
|
60
|
+
*
|
|
61
|
+
* POST /openmeter/customers/{customerId}/charges/invoice
|
|
62
|
+
*/
|
|
63
|
+
async invoice(request, options) {
|
|
64
|
+
return unwrap(await invoiceCustomerCharges(this._client, request, options));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
30
67
|
export class InternalSubscriptions {
|
|
31
68
|
_client;
|
|
32
69
|
constructor(_client) {
|
|
@@ -84,8 +121,8 @@ export class InternalNotifications {
|
|
|
84
121
|
*
|
|
85
122
|
* GET /openmeter/notification/rules
|
|
86
123
|
*/
|
|
87
|
-
async
|
|
88
|
-
return unwrap(await
|
|
124
|
+
async listBillingRules(request, options) {
|
|
125
|
+
return unwrap(await listBillingNotificationRules(this._client, request, options));
|
|
89
126
|
}
|
|
90
127
|
/**
|
|
91
128
|
* List notification rules
|
|
@@ -96,8 +133,8 @@ export class InternalNotifications {
|
|
|
96
133
|
*
|
|
97
134
|
* GET /openmeter/notification/rules
|
|
98
135
|
*/
|
|
99
|
-
|
|
100
|
-
return paginatePages((req, opts) =>
|
|
136
|
+
listBillingRulesAll(request, options) {
|
|
137
|
+
return paginatePages((req, opts) => listBillingNotificationRules(this._client, req, opts), request ?? {}, options);
|
|
101
138
|
}
|
|
102
139
|
/**
|
|
103
140
|
* Create notification rule
|
|
@@ -106,8 +143,8 @@ export class InternalNotifications {
|
|
|
106
143
|
*
|
|
107
144
|
* POST /openmeter/notification/rules
|
|
108
145
|
*/
|
|
109
|
-
async
|
|
110
|
-
return unwrap(await
|
|
146
|
+
async createBillingRule(request, options) {
|
|
147
|
+
return unwrap(await createBillingNotificationRule(this._client, request, options));
|
|
111
148
|
}
|
|
112
149
|
/**
|
|
113
150
|
* Get notification rule
|
|
@@ -116,8 +153,8 @@ export class InternalNotifications {
|
|
|
116
153
|
*
|
|
117
154
|
* GET /openmeter/notification/rules/{notificationRuleId}
|
|
118
155
|
*/
|
|
119
|
-
async
|
|
120
|
-
return unwrap(await
|
|
156
|
+
async getBillingRule(request, options) {
|
|
157
|
+
return unwrap(await getBillingNotificationRule(this._client, request, options));
|
|
121
158
|
}
|
|
122
159
|
/**
|
|
123
160
|
* Update notification rule
|
|
@@ -126,8 +163,8 @@ export class InternalNotifications {
|
|
|
126
163
|
*
|
|
127
164
|
* PUT /openmeter/notification/rules/{notificationRuleId}
|
|
128
165
|
*/
|
|
129
|
-
async
|
|
130
|
-
return unwrap(await
|
|
166
|
+
async updateBillingRule(request, options) {
|
|
167
|
+
return unwrap(await updateBillingNotificationRule(this._client, request, options));
|
|
131
168
|
}
|
|
132
169
|
/**
|
|
133
170
|
* Delete notification rule
|
|
@@ -136,8 +173,8 @@ export class InternalNotifications {
|
|
|
136
173
|
*
|
|
137
174
|
* DELETE /openmeter/notification/rules/{notificationRuleId}
|
|
138
175
|
*/
|
|
139
|
-
async
|
|
140
|
-
return unwrap(await
|
|
176
|
+
async deleteBillingRule(request, options) {
|
|
177
|
+
return unwrap(await deleteBillingNotificationRule(this._client, request, options));
|
|
141
178
|
}
|
|
142
179
|
/**
|
|
143
180
|
* Test notification rule
|
|
@@ -148,8 +185,8 @@ export class InternalNotifications {
|
|
|
148
185
|
*
|
|
149
186
|
* POST /openmeter/notification/rules/{notificationRuleId}/test
|
|
150
187
|
*/
|
|
151
|
-
async
|
|
152
|
-
return unwrap(await
|
|
188
|
+
async testBillingRule(request, options) {
|
|
189
|
+
return unwrap(await testBillingNotificationRule(this._client, request, options));
|
|
153
190
|
}
|
|
154
191
|
/**
|
|
155
192
|
* List notification events
|
|
@@ -158,8 +195,8 @@ export class InternalNotifications {
|
|
|
158
195
|
*
|
|
159
196
|
* GET /openmeter/notification/events
|
|
160
197
|
*/
|
|
161
|
-
async
|
|
162
|
-
return unwrap(await
|
|
198
|
+
async listBillingEvents(request, options) {
|
|
199
|
+
return unwrap(await listBillingNotificationEvents(this._client, request, options));
|
|
163
200
|
}
|
|
164
201
|
/**
|
|
165
202
|
* List notification events
|
|
@@ -170,8 +207,8 @@ export class InternalNotifications {
|
|
|
170
207
|
*
|
|
171
208
|
* GET /openmeter/notification/events
|
|
172
209
|
*/
|
|
173
|
-
|
|
174
|
-
return paginatePages((req, opts) =>
|
|
210
|
+
listBillingEventsAll(request, options) {
|
|
211
|
+
return paginatePages((req, opts) => listBillingNotificationEvents(this._client, req, opts), request ?? {}, options);
|
|
175
212
|
}
|
|
176
213
|
/**
|
|
177
214
|
* Get notification event
|
|
@@ -180,8 +217,8 @@ export class InternalNotifications {
|
|
|
180
217
|
*
|
|
181
218
|
* GET /openmeter/notification/events/{notificationEventId}
|
|
182
219
|
*/
|
|
183
|
-
async
|
|
184
|
-
return unwrap(await
|
|
220
|
+
async getBillingEvent(request, options) {
|
|
221
|
+
return unwrap(await getBillingNotificationEvent(this._client, request, options));
|
|
185
222
|
}
|
|
186
223
|
/**
|
|
187
224
|
* Resend notification event
|
|
@@ -194,7 +231,7 @@ export class InternalNotifications {
|
|
|
194
231
|
*
|
|
195
232
|
* POST /openmeter/notification/events/{notificationEventId}/resend
|
|
196
233
|
*/
|
|
197
|
-
async
|
|
198
|
-
return unwrap(await
|
|
234
|
+
async resendBillingEvent(request, options) {
|
|
235
|
+
return unwrap(await resendBillingNotificationEvent(this._client, request, options));
|
|
199
236
|
}
|
|
200
237
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type RequestOptions } from '../lib/types.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ListBillingNotificationChannelsRequest, ListBillingNotificationChannelsResponse, CreateBillingNotificationChannelRequest, CreateBillingNotificationChannelResponse, GetBillingNotificationChannelRequest, GetBillingNotificationChannelResponse, UpdateBillingNotificationChannelRequest, UpdateBillingNotificationChannelResponse, DeleteBillingNotificationChannelRequest, DeleteBillingNotificationChannelResponse } from '../models/operations/notifications.js';
|
|
4
4
|
import type { NotificationChannel } from '../models/types.js';
|
|
5
5
|
export declare class Notifications {
|
|
6
6
|
private readonly _client;
|
|
@@ -12,7 +12,7 @@ export declare class Notifications {
|
|
|
12
12
|
*
|
|
13
13
|
* GET /openmeter/notification/channels
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
listBillingChannels(request?: ListBillingNotificationChannelsRequest, options?: RequestOptions): Promise<ListBillingNotificationChannelsResponse>;
|
|
16
16
|
/**
|
|
17
17
|
* List notification channels
|
|
18
18
|
*
|
|
@@ -22,7 +22,7 @@ export declare class Notifications {
|
|
|
22
22
|
*
|
|
23
23
|
* GET /openmeter/notification/channels
|
|
24
24
|
*/
|
|
25
|
-
|
|
25
|
+
listBillingChannelsAll(request?: ListBillingNotificationChannelsRequest, options?: RequestOptions): AsyncIterable<NotificationChannel>;
|
|
26
26
|
/**
|
|
27
27
|
* Create notification channel
|
|
28
28
|
*
|
|
@@ -30,7 +30,7 @@ export declare class Notifications {
|
|
|
30
30
|
*
|
|
31
31
|
* POST /openmeter/notification/channels
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
createBillingChannel(request: CreateBillingNotificationChannelRequest, options?: RequestOptions): Promise<CreateBillingNotificationChannelResponse>;
|
|
34
34
|
/**
|
|
35
35
|
* Get notification channel
|
|
36
36
|
*
|
|
@@ -38,7 +38,7 @@ export declare class Notifications {
|
|
|
38
38
|
*
|
|
39
39
|
* GET /openmeter/notification/channels/{notificationChannelId}
|
|
40
40
|
*/
|
|
41
|
-
|
|
41
|
+
getBillingChannel(request: GetBillingNotificationChannelRequest, options?: RequestOptions): Promise<GetBillingNotificationChannelResponse>;
|
|
42
42
|
/**
|
|
43
43
|
* Update notification channel
|
|
44
44
|
*
|
|
@@ -46,7 +46,7 @@ export declare class Notifications {
|
|
|
46
46
|
*
|
|
47
47
|
* PUT /openmeter/notification/channels/{notificationChannelId}
|
|
48
48
|
*/
|
|
49
|
-
|
|
49
|
+
updateBillingChannel(request: UpdateBillingNotificationChannelRequest, options?: RequestOptions): Promise<UpdateBillingNotificationChannelResponse>;
|
|
50
50
|
/**
|
|
51
51
|
* Delete notification channel
|
|
52
52
|
*
|
|
@@ -54,5 +54,5 @@ export declare class Notifications {
|
|
|
54
54
|
*
|
|
55
55
|
* DELETE /openmeter/notification/channels/{notificationChannelId}
|
|
56
56
|
*/
|
|
57
|
-
|
|
57
|
+
deleteBillingChannel(request: DeleteBillingNotificationChannelRequest, options?: RequestOptions): Promise<DeleteBillingNotificationChannelResponse>;
|
|
58
58
|
}
|
|
@@ -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 {
|
|
4
|
+
import { listBillingNotificationChannels, createBillingNotificationChannel, getBillingNotificationChannel, updateBillingNotificationChannel, deleteBillingNotificationChannel, } from '../funcs/notifications.js';
|
|
5
5
|
export class Notifications {
|
|
6
6
|
_client;
|
|
7
7
|
constructor(_client) {
|
|
@@ -14,8 +14,8 @@ export class Notifications {
|
|
|
14
14
|
*
|
|
15
15
|
* GET /openmeter/notification/channels
|
|
16
16
|
*/
|
|
17
|
-
async
|
|
18
|
-
return unwrap(await
|
|
17
|
+
async listBillingChannels(request, options) {
|
|
18
|
+
return unwrap(await listBillingNotificationChannels(this._client, request, options));
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* List notification channels
|
|
@@ -26,8 +26,8 @@ export class Notifications {
|
|
|
26
26
|
*
|
|
27
27
|
* GET /openmeter/notification/channels
|
|
28
28
|
*/
|
|
29
|
-
|
|
30
|
-
return paginatePages((req, opts) =>
|
|
29
|
+
listBillingChannelsAll(request, options) {
|
|
30
|
+
return paginatePages((req, opts) => listBillingNotificationChannels(this._client, req, opts), request ?? {}, options);
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
33
|
* Create notification channel
|
|
@@ -36,8 +36,8 @@ export class Notifications {
|
|
|
36
36
|
*
|
|
37
37
|
* POST /openmeter/notification/channels
|
|
38
38
|
*/
|
|
39
|
-
async
|
|
40
|
-
return unwrap(await
|
|
39
|
+
async createBillingChannel(request, options) {
|
|
40
|
+
return unwrap(await createBillingNotificationChannel(this._client, request, options));
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* Get notification channel
|
|
@@ -46,8 +46,8 @@ export class Notifications {
|
|
|
46
46
|
*
|
|
47
47
|
* GET /openmeter/notification/channels/{notificationChannelId}
|
|
48
48
|
*/
|
|
49
|
-
async
|
|
50
|
-
return unwrap(await
|
|
49
|
+
async getBillingChannel(request, options) {
|
|
50
|
+
return unwrap(await getBillingNotificationChannel(this._client, request, options));
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
53
|
* Update notification channel
|
|
@@ -56,8 +56,8 @@ export class Notifications {
|
|
|
56
56
|
*
|
|
57
57
|
* PUT /openmeter/notification/channels/{notificationChannelId}
|
|
58
58
|
*/
|
|
59
|
-
async
|
|
60
|
-
return unwrap(await
|
|
59
|
+
async updateBillingChannel(request, options) {
|
|
60
|
+
return unwrap(await updateBillingNotificationChannel(this._client, request, options));
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
63
|
* Delete notification channel
|
|
@@ -66,7 +66,7 @@ export class Notifications {
|
|
|
66
66
|
*
|
|
67
67
|
* DELETE /openmeter/notification/channels/{notificationChannelId}
|
|
68
68
|
*/
|
|
69
|
-
async
|
|
70
|
-
return unwrap(await
|
|
69
|
+
async deleteBillingChannel(request, options) {
|
|
70
|
+
return unwrap(await deleteBillingNotificationChannel(this._client, request, options));
|
|
71
71
|
}
|
|
72
72
|
}
|
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.238",
|
|
4
4
|
"description": "Official TypeScript SDK for the OpenMeter API — usage metering and billing",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"openmeter",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"sideEffects": false,
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"ky": "^2.0.2",
|
|
29
|
-
"zod": "^4.
|
|
29
|
+
"zod": "^4.6.7"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/node": "26.1.1",
|