@openmeter/client 1.0.0-beta-62b7ce950326 → 1.0.0-beta-106e6d4e7951
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 +7 -4
- package/dist/funcs/addons.js +59 -11
- package/dist/funcs/apps.d.ts +25 -1
- package/dist/funcs/apps.js +98 -3
- package/dist/funcs/billing.js +34 -7
- package/dist/funcs/currencies.js +26 -5
- package/dist/funcs/customers.js +214 -43
- package/dist/funcs/entitlements.js +12 -3
- package/dist/funcs/events.js +3 -0
- package/dist/funcs/features.js +48 -9
- package/dist/funcs/invoices.js +81 -15
- package/dist/funcs/llmCost.js +26 -5
- package/dist/funcs/meters.js +59 -11
- package/dist/funcs/planAddons.js +65 -17
- package/dist/funcs/plans.js +59 -11
- package/dist/funcs/subscriptions.js +87 -17
- package/dist/funcs/tax.js +34 -7
- package/dist/index.d.ts +1 -1
- package/dist/lib/paginate.d.ts +1 -1
- package/dist/lib/version.d.ts +1 -1
- package/dist/lib/version.js +1 -1
- package/dist/lib/wire.d.ts +1 -0
- package/dist/lib/wire.js +26 -4
- package/dist/models/operations/apps.d.ts +16 -1
- package/dist/models/schemas.d.ts +3719 -2023
- package/dist/models/schemas.js +479 -298
- package/dist/models/types.d.ts +233 -168
- package/dist/sdk/apps.d.ts +36 -2
- package/dist/sdk/apps.js +43 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { http } from '../core.js';
|
|
3
3
|
import { request } from '../lib/request.js';
|
|
4
4
|
import { toURLSearchParams, encodeSort } from '../lib/encodings.js';
|
|
5
|
-
import { toWire, fromWire, assertValid, toSnakeCase } from '../lib/wire.js';
|
|
5
|
+
import { toWire, toPathWire, fromWire, assertValid, toSnakeCase, } from '../lib/wire.js';
|
|
6
6
|
import * as schemas from '../models/schemas.js';
|
|
7
7
|
/**
|
|
8
8
|
* Create subscription
|
|
@@ -33,6 +33,9 @@ export function createSubscription(client, req, options) {
|
|
|
33
33
|
*/
|
|
34
34
|
export function listSubscriptions(client, req = {}, options) {
|
|
35
35
|
return request(() => {
|
|
36
|
+
if (client._options.validate && req.sort !== undefined) {
|
|
37
|
+
assertValid(schemas.listSubscriptionsQueryParams.shape.sort, req.sort);
|
|
38
|
+
}
|
|
36
39
|
const query = toWire({
|
|
37
40
|
page: req.page,
|
|
38
41
|
sort: encodeSort(req.sort, toSnakeCase),
|
|
@@ -60,11 +63,20 @@ export function listSubscriptions(client, req = {}, options) {
|
|
|
60
63
|
*/
|
|
61
64
|
export function getSubscription(client, req, options) {
|
|
62
65
|
return request(() => {
|
|
66
|
+
const pathParamsInput = {
|
|
67
|
+
subscriptionId: req.subscriptionId,
|
|
68
|
+
};
|
|
69
|
+
const pathParams = client._options.validate
|
|
70
|
+
? toPathWire(pathParamsInput, schemas.getSubscriptionPathParams)
|
|
71
|
+
: pathParamsInput;
|
|
72
|
+
if (client._options.validate) {
|
|
73
|
+
assertValid(schemas.getSubscriptionPathParamsWire, pathParams);
|
|
74
|
+
}
|
|
63
75
|
const path = `openmeter/subscriptions/${(() => {
|
|
64
|
-
if (
|
|
76
|
+
if (pathParams.subscriptionId === undefined) {
|
|
65
77
|
throw new Error('missing path parameter: subscriptionId');
|
|
66
78
|
}
|
|
67
|
-
return encodeURIComponent(String(
|
|
79
|
+
return encodeURIComponent(String(pathParams.subscriptionId));
|
|
68
80
|
})()}`;
|
|
69
81
|
return http(client)
|
|
70
82
|
.get(path, options)
|
|
@@ -87,11 +99,20 @@ export function getSubscription(client, req, options) {
|
|
|
87
99
|
*/
|
|
88
100
|
export function cancelSubscription(client, req, options) {
|
|
89
101
|
return request(() => {
|
|
102
|
+
const pathParamsInput = {
|
|
103
|
+
subscriptionId: req.subscriptionId,
|
|
104
|
+
};
|
|
105
|
+
const pathParams = client._options.validate
|
|
106
|
+
? toPathWire(pathParamsInput, schemas.cancelSubscriptionPathParams)
|
|
107
|
+
: pathParamsInput;
|
|
108
|
+
if (client._options.validate) {
|
|
109
|
+
assertValid(schemas.cancelSubscriptionPathParamsWire, pathParams);
|
|
110
|
+
}
|
|
90
111
|
const path = `openmeter/subscriptions/${(() => {
|
|
91
|
-
if (
|
|
112
|
+
if (pathParams.subscriptionId === undefined) {
|
|
92
113
|
throw new Error('missing path parameter: subscriptionId');
|
|
93
114
|
}
|
|
94
|
-
return encodeURIComponent(String(
|
|
115
|
+
return encodeURIComponent(String(pathParams.subscriptionId));
|
|
95
116
|
})()}/cancel`;
|
|
96
117
|
const body = toWire(req.body, schemas.cancelSubscriptionBody);
|
|
97
118
|
if (client._options.validate) {
|
|
@@ -117,11 +138,20 @@ export function cancelSubscription(client, req, options) {
|
|
|
117
138
|
*/
|
|
118
139
|
export function unscheduleCancelation(client, req, options) {
|
|
119
140
|
return request(() => {
|
|
141
|
+
const pathParamsInput = {
|
|
142
|
+
subscriptionId: req.subscriptionId,
|
|
143
|
+
};
|
|
144
|
+
const pathParams = client._options.validate
|
|
145
|
+
? toPathWire(pathParamsInput, schemas.unscheduleCancelationPathParams)
|
|
146
|
+
: pathParamsInput;
|
|
147
|
+
if (client._options.validate) {
|
|
148
|
+
assertValid(schemas.unscheduleCancelationPathParamsWire, pathParams);
|
|
149
|
+
}
|
|
120
150
|
const path = `openmeter/subscriptions/${(() => {
|
|
121
|
-
if (
|
|
151
|
+
if (pathParams.subscriptionId === undefined) {
|
|
122
152
|
throw new Error('missing path parameter: subscriptionId');
|
|
123
153
|
}
|
|
124
|
-
return encodeURIComponent(String(
|
|
154
|
+
return encodeURIComponent(String(pathParams.subscriptionId));
|
|
125
155
|
})()}/unschedule-cancelation`;
|
|
126
156
|
return http(client)
|
|
127
157
|
.post(path, options)
|
|
@@ -144,11 +174,20 @@ export function unscheduleCancelation(client, req, options) {
|
|
|
144
174
|
*/
|
|
145
175
|
export function changeSubscription(client, req, options) {
|
|
146
176
|
return request(() => {
|
|
177
|
+
const pathParamsInput = {
|
|
178
|
+
subscriptionId: req.subscriptionId,
|
|
179
|
+
};
|
|
180
|
+
const pathParams = client._options.validate
|
|
181
|
+
? toPathWire(pathParamsInput, schemas.changeSubscriptionPathParams)
|
|
182
|
+
: pathParamsInput;
|
|
183
|
+
if (client._options.validate) {
|
|
184
|
+
assertValid(schemas.changeSubscriptionPathParamsWire, pathParams);
|
|
185
|
+
}
|
|
147
186
|
const path = `openmeter/subscriptions/${(() => {
|
|
148
|
-
if (
|
|
187
|
+
if (pathParams.subscriptionId === undefined) {
|
|
149
188
|
throw new Error('missing path parameter: subscriptionId');
|
|
150
189
|
}
|
|
151
|
-
return encodeURIComponent(String(
|
|
190
|
+
return encodeURIComponent(String(pathParams.subscriptionId));
|
|
152
191
|
})()}/change`;
|
|
153
192
|
const body = toWire(req.body, schemas.changeSubscriptionBody);
|
|
154
193
|
if (client._options.validate) {
|
|
@@ -174,11 +213,20 @@ export function changeSubscription(client, req, options) {
|
|
|
174
213
|
*/
|
|
175
214
|
export function createSubscriptionAddon(client, req, options) {
|
|
176
215
|
return request(() => {
|
|
216
|
+
const pathParamsInput = {
|
|
217
|
+
subscriptionId: req.subscriptionId,
|
|
218
|
+
};
|
|
219
|
+
const pathParams = client._options.validate
|
|
220
|
+
? toPathWire(pathParamsInput, schemas.createSubscriptionAddonPathParams)
|
|
221
|
+
: pathParamsInput;
|
|
222
|
+
if (client._options.validate) {
|
|
223
|
+
assertValid(schemas.createSubscriptionAddonPathParamsWire, pathParams);
|
|
224
|
+
}
|
|
177
225
|
const path = `openmeter/subscriptions/${(() => {
|
|
178
|
-
if (
|
|
226
|
+
if (pathParams.subscriptionId === undefined) {
|
|
179
227
|
throw new Error('missing path parameter: subscriptionId');
|
|
180
228
|
}
|
|
181
|
-
return encodeURIComponent(String(
|
|
229
|
+
return encodeURIComponent(String(pathParams.subscriptionId));
|
|
182
230
|
})()}/addons`;
|
|
183
231
|
const body = toWire(req.body, schemas.createSubscriptionAddonBody);
|
|
184
232
|
if (client._options.validate) {
|
|
@@ -204,12 +252,24 @@ export function createSubscriptionAddon(client, req, options) {
|
|
|
204
252
|
*/
|
|
205
253
|
export function listSubscriptionAddons(client, req, options) {
|
|
206
254
|
return request(() => {
|
|
255
|
+
const pathParamsInput = {
|
|
256
|
+
subscriptionId: req.subscriptionId,
|
|
257
|
+
};
|
|
258
|
+
const pathParams = client._options.validate
|
|
259
|
+
? toPathWire(pathParamsInput, schemas.listSubscriptionAddonsPathParams)
|
|
260
|
+
: pathParamsInput;
|
|
261
|
+
if (client._options.validate) {
|
|
262
|
+
assertValid(schemas.listSubscriptionAddonsPathParamsWire, pathParams);
|
|
263
|
+
}
|
|
207
264
|
const path = `openmeter/subscriptions/${(() => {
|
|
208
|
-
if (
|
|
265
|
+
if (pathParams.subscriptionId === undefined) {
|
|
209
266
|
throw new Error('missing path parameter: subscriptionId');
|
|
210
267
|
}
|
|
211
|
-
return encodeURIComponent(String(
|
|
268
|
+
return encodeURIComponent(String(pathParams.subscriptionId));
|
|
212
269
|
})()}/addons`;
|
|
270
|
+
if (client._options.validate && req.sort !== undefined) {
|
|
271
|
+
assertValid(schemas.listSubscriptionAddonsQueryParams.shape.sort, req.sort);
|
|
272
|
+
}
|
|
213
273
|
const query = toWire({
|
|
214
274
|
page: req.page,
|
|
215
275
|
sort: encodeSort(req.sort, toSnakeCase),
|
|
@@ -238,16 +298,26 @@ export function listSubscriptionAddons(client, req, options) {
|
|
|
238
298
|
*/
|
|
239
299
|
export function getSubscriptionAddon(client, req, options) {
|
|
240
300
|
return request(() => {
|
|
301
|
+
const pathParamsInput = {
|
|
302
|
+
subscriptionId: req.subscriptionId,
|
|
303
|
+
subscriptionAddonId: req.subscriptionAddonId,
|
|
304
|
+
};
|
|
305
|
+
const pathParams = client._options.validate
|
|
306
|
+
? toPathWire(pathParamsInput, schemas.getSubscriptionAddonPathParams)
|
|
307
|
+
: pathParamsInput;
|
|
308
|
+
if (client._options.validate) {
|
|
309
|
+
assertValid(schemas.getSubscriptionAddonPathParamsWire, pathParams);
|
|
310
|
+
}
|
|
241
311
|
const path = `openmeter/subscriptions/${(() => {
|
|
242
|
-
if (
|
|
312
|
+
if (pathParams.subscriptionId === undefined) {
|
|
243
313
|
throw new Error('missing path parameter: subscriptionId');
|
|
244
314
|
}
|
|
245
|
-
return encodeURIComponent(String(
|
|
315
|
+
return encodeURIComponent(String(pathParams.subscriptionId));
|
|
246
316
|
})()}/addons/${(() => {
|
|
247
|
-
if (
|
|
317
|
+
if (pathParams.subscriptionAddonId === undefined) {
|
|
248
318
|
throw new Error('missing path parameter: subscriptionAddonId');
|
|
249
319
|
}
|
|
250
|
-
return encodeURIComponent(String(
|
|
320
|
+
return encodeURIComponent(String(pathParams.subscriptionAddonId));
|
|
251
321
|
})()}`;
|
|
252
322
|
return http(client)
|
|
253
323
|
.get(path, options)
|
package/dist/funcs/tax.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { http } from '../core.js';
|
|
3
3
|
import { request } from '../lib/request.js';
|
|
4
4
|
import { toURLSearchParams } from '../lib/encodings.js';
|
|
5
|
-
import { toWire, fromWire, assertValid } from '../lib/wire.js';
|
|
5
|
+
import { toWire, toPathWire, fromWire, assertValid } from '../lib/wire.js';
|
|
6
6
|
import * as schemas from '../models/schemas.js';
|
|
7
7
|
/**
|
|
8
8
|
* Create tax code
|
|
@@ -33,11 +33,20 @@ export function createTaxCode(client, req, options) {
|
|
|
33
33
|
*/
|
|
34
34
|
export function getTaxCode(client, req, options) {
|
|
35
35
|
return request(() => {
|
|
36
|
+
const pathParamsInput = {
|
|
37
|
+
taxCodeId: req.taxCodeId,
|
|
38
|
+
};
|
|
39
|
+
const pathParams = client._options.validate
|
|
40
|
+
? toPathWire(pathParamsInput, schemas.getTaxCodePathParams)
|
|
41
|
+
: pathParamsInput;
|
|
42
|
+
if (client._options.validate) {
|
|
43
|
+
assertValid(schemas.getTaxCodePathParamsWire, pathParams);
|
|
44
|
+
}
|
|
36
45
|
const path = `openmeter/tax-codes/${(() => {
|
|
37
|
-
if (
|
|
46
|
+
if (pathParams.taxCodeId === undefined) {
|
|
38
47
|
throw new Error('missing path parameter: taxCodeId');
|
|
39
48
|
}
|
|
40
|
-
return encodeURIComponent(String(
|
|
49
|
+
return encodeURIComponent(String(pathParams.taxCodeId));
|
|
41
50
|
})()}`;
|
|
42
51
|
return http(client)
|
|
43
52
|
.get(path, options)
|
|
@@ -83,11 +92,20 @@ export function listTaxCodes(client, req = {}, options) {
|
|
|
83
92
|
*/
|
|
84
93
|
export function upsertTaxCode(client, req, options) {
|
|
85
94
|
return request(() => {
|
|
95
|
+
const pathParamsInput = {
|
|
96
|
+
taxCodeId: req.taxCodeId,
|
|
97
|
+
};
|
|
98
|
+
const pathParams = client._options.validate
|
|
99
|
+
? toPathWire(pathParamsInput, schemas.upsertTaxCodePathParams)
|
|
100
|
+
: pathParamsInput;
|
|
101
|
+
if (client._options.validate) {
|
|
102
|
+
assertValid(schemas.upsertTaxCodePathParamsWire, pathParams);
|
|
103
|
+
}
|
|
86
104
|
const path = `openmeter/tax-codes/${(() => {
|
|
87
|
-
if (
|
|
105
|
+
if (pathParams.taxCodeId === undefined) {
|
|
88
106
|
throw new Error('missing path parameter: taxCodeId');
|
|
89
107
|
}
|
|
90
|
-
return encodeURIComponent(String(
|
|
108
|
+
return encodeURIComponent(String(pathParams.taxCodeId));
|
|
91
109
|
})()}`;
|
|
92
110
|
const body = toWire(req.body, schemas.upsertTaxCodeBody);
|
|
93
111
|
if (client._options.validate) {
|
|
@@ -111,11 +129,20 @@ export function upsertTaxCode(client, req, options) {
|
|
|
111
129
|
*/
|
|
112
130
|
export function deleteTaxCode(client, req, options) {
|
|
113
131
|
return request(async () => {
|
|
132
|
+
const pathParamsInput = {
|
|
133
|
+
taxCodeId: req.taxCodeId,
|
|
134
|
+
};
|
|
135
|
+
const pathParams = client._options.validate
|
|
136
|
+
? toPathWire(pathParamsInput, schemas.deleteTaxCodePathParams)
|
|
137
|
+
: pathParamsInput;
|
|
138
|
+
if (client._options.validate) {
|
|
139
|
+
assertValid(schemas.deleteTaxCodePathParamsWire, pathParams);
|
|
140
|
+
}
|
|
114
141
|
const path = `openmeter/tax-codes/${(() => {
|
|
115
|
-
if (
|
|
142
|
+
if (pathParams.taxCodeId === undefined) {
|
|
116
143
|
throw new Error('missing path parameter: taxCodeId');
|
|
117
144
|
}
|
|
118
|
-
return encodeURIComponent(String(
|
|
145
|
+
return encodeURIComponent(String(pathParams.taxCodeId));
|
|
119
146
|
})()}`;
|
|
120
147
|
await http(client).delete(path, options);
|
|
121
148
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -41,4 +41,4 @@ export type * from './models/operations/addons.js';
|
|
|
41
41
|
export type * from './models/operations/planAddons.js';
|
|
42
42
|
export type * from './models/operations/defaults.js';
|
|
43
43
|
export type * from './models/operations/governance.js';
|
|
44
|
-
export type { Labels, CursorPaginationQueryPage, SortQuery, IngestedEventValidationError, CursorMetaPage, BaseError, PageMeta, QueryFilterString, AppStripeCheckoutSessionCustomTextParams, AppStripeCreateCustomerPortalSessionOptions, CreateLabels, TaxConfigStripe, TaxConfigExternalInvoicing, ChargeFlatFeeDiscounts, PriceFree, RateCardStaticEntitlement, RateCardBooleanEntitlement, WorkflowCollectionAlignmentSubscription, WorkflowPaymentChargeAutomaticallySettings, WorkflowPaymentSendInvoiceSettings, InvoiceExternalReferences, InvoiceAvailableActionDetails, InvoiceWorkflowInvoicingSettings, InvoiceLineExternalReferences, UpdateLabels, UpdateBillingInvoiceWorkflowInvoicingSettings, UpdateBillingWorkflowPaymentChargeAutomaticallySettings, UpdateBillingWorkflowPaymentSendInvoiceSettings, UpdatePriceFree, LlmCostProvider, LlmCostModel, ProductCatalogValidationError, GovernanceQueryRequestCustomers, GovernanceQueryRequestFeatures, QueryFilterInteger, QueryFilterFloat, QueryFilterBoolean, PagePaginationQuery, PublicLabels, SystemAccountAccessToken, PersonalAccessToken, KonnectAccessToken, AppCustomerDataStripe, AppCustomerDataExternalInvoicing, CurrencyFiat, ListCostBasesParamsFilter, CurrencyAmount, PriceFlat, PriceUnit, RateCardDiscounts, Totals, SpendCommitments, InvoiceLineCreditsApplied, UpdatePriceFlat, UpdatePriceUnit, UpdateDiscounts, FeatureManualUnitCost, FeatureLlmUnitCostPricing, LlmCostModelPricing, QueryFilterNumeric, CursorPaginationQuery, ListMetersParamsFilter, ListLlmCostPricesParamsFilter, LabelsFieldFilter, CustomerReference, ProfileReference, CreateResourceReference, TaxCodeReference, CreditGrantInvoiceReference, BillingCustomerReference, SubscriptionReference, AddonReference, FeatureReference, AppReference, ChargeReference, UpdateResourceReference, Event, MeterQueryRow, AppStripeCreateCustomerPortalSessionResult, ClosedPeriod, SubscriptionAddonTimelineSegment, UpdateClosedPeriod, CostBasis, FeatureCostQueryRow, Resource, ResourceImmutable, QueryFilterDateTime, CursorMeta, InvalidParameterStandard, InvalidParameterMinimumLength, InvalidParameterMaximumLength, InvalidParameterChoiceItem, InvalidParameterDependentItem, Unauthorized, Forbidden, NotFound, Gone, Conflict, PayloadTooLarge, UnsupportedMediaType, UnprocessableContent, TooManyRequests, Internal, NotImplemented, NotAvailable, CreateCreditGrantFilters, CreditGrantFilters, UpsertPlanAddonRequest, ResourceWithKey, Meter, PaginatedMeta, QueryFilterStringMapItem, CustomerKeyReference, CustomerUsageAttribution, UpdateCustomerUsageAttribution, Address, UpdateAddress, AppStripeCreateCheckoutSessionCustomerUpdate, AppStripeCreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreement, AppStripeCreateCheckoutSessionTaxIdCollection, AppStripeCreateCheckoutSessionResult, CustomerStripeCreateCustomerPortalSessionRequest, EntitlementAccessResult, CreateCreditGrantPurchase, RateCardMeteredEntitlement, RecurringPeriod, CreditGrantPurchase, ListCreditGrantsParamsFilter, GetCreditBalanceParamsFilter, ListChargesParamsFilter, ListPlansParamsFilter, SubscriptionCreate, RateCardProrationConfiguration, Subscription, UnitConfig,
|
|
44
|
+
export type { Labels, CursorPaginationQueryPage, SortQuery, IngestedEventValidationError, CursorMetaPage, BaseError, PageMeta, QueryFilterString, AppStripeCheckoutSessionCustomTextParams, AppStripeCreateCustomerPortalSessionOptions, CreateLabels, TaxConfigStripe, TaxConfigExternalInvoicing, ChargeFlatFeeDiscounts, PriceFree, RateCardStaticEntitlement, RateCardBooleanEntitlement, InstallAppStripeWithApiKey, InstallAppSandbox, InstallAppExternalInvoicing, WorkflowCollectionAlignmentSubscription, WorkflowPaymentChargeAutomaticallySettings, WorkflowPaymentSendInvoiceSettings, InvoiceExternalReferences, InvoiceAvailableActionDetails, InvoiceWorkflowInvoicingSettings, InvoiceLineExternalReferences, UpdateLabels, UpdateBillingInvoiceWorkflowInvoicingSettings, UpdateBillingWorkflowPaymentChargeAutomaticallySettings, UpdateBillingWorkflowPaymentSendInvoiceSettings, UpdatePriceFree, LlmCostProvider, LlmCostModel, ProductCatalogValidationError, GovernanceQueryRequestCustomers, GovernanceQueryRequestFeatures, QueryFilterInteger, QueryFilterFloat, QueryFilterBoolean, PagePaginationQuery, PublicLabels, SystemAccountAccessToken, PersonalAccessToken, KonnectAccessToken, AppCustomerDataStripe, AppCustomerDataExternalInvoicing, CurrencyFiat, ListCostBasesParamsFilter, CurrencyAmount, PriceFlat, PriceUnit, RateCardDiscounts, Totals, SpendCommitments, InvoiceLineCreditsApplied, UpdatePriceFlat, UpdatePriceUnit, UpdateDiscounts, FeatureManualUnitCost, FeatureLlmUnitCostPricing, LlmCostModelPricing, QueryFilterNumeric, CursorPaginationQuery, ListMetersParamsFilter, ListLlmCostPricesParamsFilter, LabelsFieldFilter, CustomerReference, ProfileReference, CreateResourceReference, TaxCodeReference, CreditGrantInvoiceReference, BillingCustomerReference, SubscriptionReference, AddonReference, FeatureReference, AppReference, ChargeReference, UpdateResourceReference, Event, MeterQueryRow, AppStripeCreateCustomerPortalSessionResult, ClosedPeriod, SubscriptionAddonTimelineSegment, UpdateClosedPeriod, CostBasis, FeatureCostQueryRow, Resource, ResourceImmutable, QueryFilterDateTime, CursorMeta, InvalidParameterStandard, InvalidParameterMinimumLength, InvalidParameterMaximumLength, InvalidParameterChoiceItem, InvalidParameterDependentItem, Unauthorized, Forbidden, NotFound, Gone, Conflict, PayloadTooLarge, UnsupportedMediaType, UnprocessableContent, TooManyRequests, Internal, NotImplemented, NotAvailable, CreateCreditGrantFilters, CreditGrantFilters, UpsertPlanAddonRequest, ResourceWithKey, Meter, PaginatedMeta, QueryFilterStringMapItem, CustomerKeyReference, CustomerUsageAttribution, UpdateCustomerUsageAttribution, Address, UpdateAddress, AppStripeCreateCheckoutSessionCustomerUpdate, AppStripeCreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreement, AppStripeCreateCheckoutSessionTaxIdCollection, AppStripeCreateCheckoutSessionResult, CustomerStripeCreateCustomerPortalSessionRequest, EntitlementAccessResult, CreateCreditGrantPurchase, RateCardMeteredEntitlement, RecurringPeriod, CreditGrantPurchase, ListCreditGrantsParamsFilter, GetCreditBalanceParamsFilter, ListChargesParamsFilter, ListPlansParamsFilter, SubscriptionCreate, RateCardProrationConfiguration, Subscription, UnitConfig, TaxCodeAppMapping, AppCapability, PartyTaxIdentity, UpdateBillingPartyTaxIdentity, WorkflowInvoicingSettings, InvoiceValidationIssue, InvoiceAvailableActions, InvoiceLineAmountDiscount, InvoiceLineUsageDiscount, InvoiceLineBaseDiscount, ListCurrenciesParamsFilter, CurrencyCustom, CreateCurrencyCustomRequest, GovernanceQueryRequest, GovernanceFeatureAccessReason, GovernanceQueryError, AppCustomerData, UpsertAppCustomerDataRequest, CreditAdjustment, CreditBalance, ListCreditTransactionsParamsFilter, CreditTransaction, PriceTier, ChargeTotals, UpdatePriceTier, FeatureLlmUnitCost, LlmCostPrice, LlmCostOverrideCreate, ListCustomersParamsFilter, ListSubscriptionsParamsFilter, ListFeatureParamsFilter, ListAddonsParamsFilter, CreateCreditGrantTaxConfig, CreditGrantTaxConfig, TaxConfig, RateCardTaxConfig, OrganizationDefaultTaxCodes, PlanAddon, ProfileAppReferences, InvoiceWorkflowAppsReferences, UpdateRateCardTaxConfig, ListEventsParamsFilter, ListInvoicesParamsFilter, ResourceFilters, FieldFilters, IngestedEvent, MeterQueryResult, FeatureCostQueryResult, MeterPagePaginatedResponse, CostBasisPagePaginatedResponse, MeterQueryFilters, FeatureMeterReference, Customer, PartyAddresses, InvoiceCustomer, UpdateBillingPartyAddresses, UpdateInvoiceCustomer, AppStripeCreateCheckoutSessionConsentCollection, ListCustomerEntitlementAccessResponseData, WorkflowCollectionAlignmentAnchored, ChargeFlatFeeSystemIntent, SubscriptionPagePaginatedResponse, SubscriptionChangeResponse, SubscriptionCancel, SubscriptionChange, InvoiceUsageQuantityDetail, TaxCode, AppCatalogItem, InvoiceWorkflow, InvoiceStatusDetails, InvoiceLineDiscounts, UpdateBillingInvoiceWorkflow, GovernanceFeatureAccess, CustomerData, UpsertCustomerBillingDataRequest, CreditBalances, CreditTransactionPaginatedResponse, PriceGraduated, PriceVolume, UpdatePriceGraduated, UpdatePriceVolume, PricePagePaginatedResponse, CreditGrant, CreateChargeFlatFeeRequest, WorkflowTaxSettings, PlanAddonPagePaginatedResponse, IngestedEventPaginatedResponse, InvalidParameters, MeterQueryRequest, CustomerPagePaginatedResponse, Party, Supplier, UpdateSupplier, AppStripeCreateCheckoutSessionRequestOptions, TaxCodePagePaginatedResponse, AppStripe, AppSandbox, AppExternalInvoicing, AppCatalogItemPagePaginatedResponse, InvoiceWorkflowSettings, InvoiceDetailedLine, UpdateInvoiceWorkflowSettings, CurrencyPagePaginatedResponse, GovernanceQueryResult, Feature, CreditGrantPagePaginatedResponse, BadRequest, InvoiceBase, CustomerStripeCreateCheckoutSessionRequest, WorkflowCollectionSettings, GovernanceQueryResponse, ChargeFlatFee, ChargeUsageBasedSystemIntent, CreateChargeUsageBasedRequest, RateCard, InvoiceLineRateCard, UpdateInvoiceLineRateCard, FeaturePagePaginatedResponse, Workflow, AppPagePaginatedResponse, BillingInstallAppResponse, ProfileApps, ChargeUsageBased, SubscriptionAddonRateCard, PlanPhase, Addon, UpsertAddonRequest, InvoiceStandardLine, UpdateInvoiceStandardLine, Profile, UpsertBillingProfileRequest, SubscriptionAddon, Plan, UpsertPlanRequest, AddonPagePaginatedResponse, ProfilePagePaginatedResponse, ChargePagePaginatedResponse, SubscriptionAddonPagePaginatedResponse, PlanPagePaginatedResponse, InvoiceStandard, UpdateInvoiceStandardRequest, InvoicePagePaginatedResponse, StringFieldFilter, MeterAggregation, MeterQueryGranularity, StringFieldFilterExact, PricePaymentTerm, BillingCurrencyCode, CreateCurrencyCode, UlidFieldFilter, DateTimeFieldFilter, SubscriptionEditTiming, WorkflowPaymentSettings, UpdateBillingWorkflowPaymentSettings, InvalidParameter, RateCardEntitlement, Currency, FeatureUnitCost, WorkflowCollectionAlignment, Price, UpdatePrice, App, CreateChargeRequest, Charge, InvoiceLine, UpdateInvoiceLine, Invoice, SortQueryInput, BaseErrorInput, WorkflowPaymentSendInvoiceSettingsInput, InvoiceWorkflowInvoicingSettingsInput, UpdateBillingInvoiceWorkflowInvoicingSettingsInput, UpdateBillingWorkflowPaymentSendInvoiceSettingsInput, EventInput, UnauthorizedInput, ForbiddenInput, NotFoundInput, GoneInput, ConflictInput, PayloadTooLargeInput, UnsupportedMediaTypeInput, UnprocessableContentInput, TooManyRequestsInput, InternalInput, NotImplementedInput, NotAvailableInput, AppStripeCreateCheckoutSessionCustomerUpdateInput, AppStripeCreateCheckoutSessionTaxIdCollectionInput, CreateCreditGrantPurchaseInput, RateCardMeteredEntitlementInput, CreditGrantPurchaseInput, VoidCreditGrantRequestInput, UnitConfigInput, WorkflowInvoicingSettingsInput, GovernanceQueryRequestInput, IngestedEventInput, SubscriptionCancelInput, InvoiceUsageQuantityDetailInput, InvoiceWorkflowInput, UpdateBillingInvoiceWorkflowInput, CreateCreditGrantRequestInput, CreditGrantInput, WorkflowTaxSettingsInput, IngestedEventPaginatedResponseInput, MeterQueryRequestInput, AppStripeCreateCheckoutSessionRequestOptionsInput, InvoiceWorkflowSettingsInput, InvoiceDetailedLineInput, UpdateInvoiceWorkflowSettingsInput, CreditGrantPagePaginatedResponseInput, BadRequestInput, CustomerStripeCreateCheckoutSessionRequestInput, WorkflowCollectionSettingsInput, RateCardInput, WorkflowInput, SubscriptionAddonRateCardInput, PlanPhaseInput, AddonInput, CreateAddonRequestInput, UpsertAddonRequestInput, InvoiceStandardLineInput, ProfileInput, CreateBillingProfileRequestInput, UpsertBillingProfileRequestInput, SubscriptionAddonInput, PlanInput, CreatePlanRequestInput, UpsertPlanRequestInput, AddonPagePaginatedResponseInput, ProfilePagePaginatedResponseInput, SubscriptionAddonPagePaginatedResponseInput, PlanPagePaginatedResponseInput, InvoiceStandardInput, UpdateInvoiceStandardRequestInput, InvoicePagePaginatedResponseInput, WorkflowPaymentSettingsInput, UpdateBillingWorkflowPaymentSettingsInput, RateCardEntitlementInput, InvoiceLineInput, InvoiceInput, UpdateInvoiceRequestInput, } from './models/types.js';
|
package/dist/lib/paginate.d.ts
CHANGED
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-106e6d4e7951";
|
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-106e6d4e7951';
|
package/dist/lib/wire.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export declare class DepthLimitExceededError extends Error {
|
|
|
12
12
|
constructor();
|
|
13
13
|
}
|
|
14
14
|
export declare function toWire<T>(data: T, schema: ZodType): T;
|
|
15
|
+
export declare function toPathWire<T>(data: T, schema: ZodType): T;
|
|
15
16
|
export declare function fromWire<S extends ZodType>(data: unknown, schema: S): output<S>;
|
|
16
17
|
export declare class ValidationError extends Error {
|
|
17
18
|
readonly issues: unknown;
|
package/dist/lib/wire.js
CHANGED
|
@@ -201,6 +201,9 @@ function walk(data, schema, dir, depth = 0) {
|
|
|
201
201
|
const valueSchema = needsWalk(d.valueType) ? d.valueType : undefined;
|
|
202
202
|
const out = Object.create(null);
|
|
203
203
|
for (const [key, value] of Object.entries(record)) {
|
|
204
|
+
if (dir.omitUndefinedObjectEntries && value === undefined) {
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
204
207
|
out[key] = valueSchema ? walk(value, valueSchema, dir, depth + 1) : value;
|
|
205
208
|
}
|
|
206
209
|
Object.setPrototypeOf(out, Object.prototype);
|
|
@@ -223,6 +226,9 @@ function walk(data, schema, dir, depth = 0) {
|
|
|
223
226
|
// loop reassigning `out`'s own prototype instead of adding a visible key.
|
|
224
227
|
const out = Object.create(null);
|
|
225
228
|
for (const [key, value] of Object.entries(record)) {
|
|
229
|
+
if (dir.omitUndefinedObjectEntries && value === undefined) {
|
|
230
|
+
continue;
|
|
231
|
+
}
|
|
226
232
|
const fieldSchema = fieldFor(shape, key);
|
|
227
233
|
// Keys the schema does not declare are dropped, so the result matches the
|
|
228
234
|
// typed shape exactly (a server-added field has no place in the type).
|
|
@@ -346,6 +352,14 @@ const toWireDirection = {
|
|
|
346
352
|
return Number(value);
|
|
347
353
|
},
|
|
348
354
|
applyDefaults: true,
|
|
355
|
+
omitUndefinedObjectEntries: true,
|
|
356
|
+
};
|
|
357
|
+
// Path binding names are transport metadata, not JSON object member names, so
|
|
358
|
+
// they must remain exactly as declared while their values receive the same
|
|
359
|
+
// Date/bigint/default mapping used by request bodies and query parameters.
|
|
360
|
+
const toPathWireDirection = {
|
|
361
|
+
...toWireDirection,
|
|
362
|
+
rename: (key) => key,
|
|
349
363
|
};
|
|
350
364
|
const fromWireDirection = {
|
|
351
365
|
rename: toCamelCase,
|
|
@@ -355,18 +369,26 @@ const fromWireDirection = {
|
|
|
355
369
|
? BigInt(value)
|
|
356
370
|
: value,
|
|
357
371
|
applyDefaults: false,
|
|
372
|
+
omitUndefinedObjectEntries: false,
|
|
358
373
|
};
|
|
359
374
|
// Rewrite a request body or query object from the camelCase public shape to the
|
|
360
375
|
// snake_case wire shape, driven by its schema. Record keys (label/dimension names)
|
|
361
376
|
// are preserved; `Date` values serialize to RFC 3339 strings; `bigint` values
|
|
362
377
|
// (int64 fields) become JSON numbers; omitted required-with-default fields are
|
|
363
|
-
// filled with their declared default (see requiredDefault)
|
|
364
|
-
//
|
|
365
|
-
//
|
|
366
|
-
//
|
|
378
|
+
// filled with their declared default (see requiredDefault); explicit undefined
|
|
379
|
+
// object/record entries are omitted just as JSON.stringify would omit them. The
|
|
380
|
+
// return is typed as the input `T` so call sites stay cast-free (the runtime object
|
|
381
|
+
// has snake keys and wire-encoded dates, but the value is write-only — it flows
|
|
382
|
+
// straight into `json:`/`toURLSearchParams`, both of which accept any object).
|
|
367
383
|
export function toWire(data, schema) {
|
|
368
384
|
return walk(data, schema, toWireDirection);
|
|
369
385
|
}
|
|
386
|
+
// Rewrite path-parameter values to their transport representation without
|
|
387
|
+
// renaming the path binding keys. The returned object is subsequently validated
|
|
388
|
+
// against the generated `…PathParamsWire` schema and URL-encoded by the func.
|
|
389
|
+
export function toPathWire(data, schema) {
|
|
390
|
+
return walk(data, schema, toPathWireDirection);
|
|
391
|
+
}
|
|
370
392
|
// Rewrite a response body from the snake_case wire shape to the camelCase public
|
|
371
393
|
// shape: renames keys and revives RFC 3339 strings into `Date`s at date-typed
|
|
372
394
|
// nodes — never applies defaults or any other coercion. The result is the
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AcceptDateStrings } from '../../lib/wire.js';
|
|
2
|
-
import type { App, AppPagePaginatedResponse } from '../types.js';
|
|
2
|
+
import type { App, AppCatalogItem, AppCatalogItemPagePaginatedResponse, AppPagePaginatedResponse, BillingInstallAppResponse, InstallAppRequest as InstallAppRequestBody } from '../types.js';
|
|
3
3
|
export interface ListAppsQuery {
|
|
4
4
|
/** Determines which page of the collection to retrieve. */
|
|
5
5
|
page?: {
|
|
@@ -13,3 +13,18 @@ export type GetAppRequest = {
|
|
|
13
13
|
appId: string;
|
|
14
14
|
};
|
|
15
15
|
export type GetAppResponse = App;
|
|
16
|
+
export interface ListAppCatalogQuery {
|
|
17
|
+
/** Determines which page of the collection to retrieve. */
|
|
18
|
+
page?: {
|
|
19
|
+
size?: number;
|
|
20
|
+
number?: number;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export type ListAppCatalogRequest = AcceptDateStrings<ListAppCatalogQuery>;
|
|
24
|
+
export type ListAppCatalogResponse = AppCatalogItemPagePaginatedResponse;
|
|
25
|
+
export type GetAppCatalogItemRequest = {
|
|
26
|
+
appType: string;
|
|
27
|
+
};
|
|
28
|
+
export type GetAppCatalogItemResponse = AppCatalogItem;
|
|
29
|
+
export type InstallAppRequest = AcceptDateStrings<InstallAppRequestBody>;
|
|
30
|
+
export type InstallAppResponse = BillingInstallAppResponse;
|