@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
package/dist/models/schemas.js
CHANGED
|
@@ -110,9 +110,11 @@ export const cursorMetaPage = z
|
|
|
110
110
|
.object({
|
|
111
111
|
first: z.string().optional().describe('URI to the first page.'),
|
|
112
112
|
last: z.string().optional().describe('URI to the last page.'),
|
|
113
|
-
next: z.string().
|
|
114
|
-
previous: z
|
|
115
|
-
|
|
113
|
+
next: z.union([z.string(), z.null()]).describe('URI to the next page.'),
|
|
114
|
+
previous: z
|
|
115
|
+
.union([z.string(), z.null()])
|
|
116
|
+
.describe('URI to the previous page.'),
|
|
117
|
+
size: z.number().int().describe('Requested page size.'),
|
|
116
118
|
})
|
|
117
119
|
.describe('Cursor pagination metadata.');
|
|
118
120
|
export const invalidRules = z
|
|
@@ -496,9 +498,49 @@ export const rateCardBooleanEntitlement = z
|
|
|
496
498
|
export const appType = z
|
|
497
499
|
.enum(['sandbox', 'stripe', 'external_invoicing'])
|
|
498
500
|
.describe('The type of the app.');
|
|
501
|
+
export const appCapabilityType = z
|
|
502
|
+
.enum([
|
|
503
|
+
'report_usage',
|
|
504
|
+
'report_events',
|
|
505
|
+
'calculate_tax',
|
|
506
|
+
'invoice_customers',
|
|
507
|
+
'collect_payments',
|
|
508
|
+
])
|
|
509
|
+
.describe('Supported capability types for an App. Each capability defines an integration function that an App can perform.');
|
|
510
|
+
export const appInstallMethods = z
|
|
511
|
+
.enum(['with_oauth2', 'with_api_key', 'no_credentials_required'])
|
|
512
|
+
.describe('Supported installation methods for an app.');
|
|
499
513
|
export const appStatus = z
|
|
500
514
|
.enum(['ready', 'unauthorized'])
|
|
501
515
|
.describe('Connection status of an installed app.');
|
|
516
|
+
export const installAppStripeWithApiKey = z
|
|
517
|
+
.object({
|
|
518
|
+
type: z.literal('stripe').describe('Type of the app.'),
|
|
519
|
+
name: z.string().describe('Name of the app.'),
|
|
520
|
+
createBillingProfile: z
|
|
521
|
+
.boolean()
|
|
522
|
+
.describe('If true, a billing profile will be created for the app. The Stripe app will be also set as the default billing profile if the current default is a Sandbox app.'),
|
|
523
|
+
apiKey: z.string().describe('API key for the app.'),
|
|
524
|
+
})
|
|
525
|
+
.describe('Model for installing an app from the catalog with an API key.');
|
|
526
|
+
export const installAppSandbox = z
|
|
527
|
+
.object({
|
|
528
|
+
type: z.literal('sandbox').describe('Type of the app.'),
|
|
529
|
+
name: z.string().describe('Name of the app.'),
|
|
530
|
+
createBillingProfile: z
|
|
531
|
+
.boolean()
|
|
532
|
+
.describe('If true, a billing profile will be created for the app. The Stripe app will be also set as the default billing profile if the current default is a Sandbox app.'),
|
|
533
|
+
})
|
|
534
|
+
.describe('Base model for installing an app from the catalog.');
|
|
535
|
+
export const installAppExternalInvoicing = z
|
|
536
|
+
.object({
|
|
537
|
+
type: z.literal('external_invoicing').describe('Type of the app.'),
|
|
538
|
+
name: z.string().describe('Name of the app.'),
|
|
539
|
+
createBillingProfile: z
|
|
540
|
+
.boolean()
|
|
541
|
+
.describe('If true, a billing profile will be created for the app. The Stripe app will be also set as the default billing profile if the current default is a Sandbox app.'),
|
|
542
|
+
})
|
|
543
|
+
.describe('Base model for installing an app from the catalog.');
|
|
502
544
|
export const taxIdentificationCode = z
|
|
503
545
|
.string()
|
|
504
546
|
.min(1)
|
|
@@ -2004,19 +2046,27 @@ export const unitConfig = z
|
|
|
2004
2046
|
.describe('A human-readable label for the converted unit shown on invoices and in the customer portal (e.g., "GB", "hours", "M tokens"). Optional. When omitted, no unit label is rendered.'),
|
|
2005
2047
|
})
|
|
2006
2048
|
.describe('Unit conversion configuration. Transforms raw metered quantities into billing-ready units before pricing and entitlement evaluation. Applied at the rate card level so the same feature can be billed in different units across plans. Examples: - Meter bytes, bill GB: operation=divide, conversionFactor=1e9, rounding=ceiling, displayUnit="GB" - Meter seconds, bill hours: operation=divide, conversionFactor=3600, rounding=ceiling, displayUnit="hours" - Cost + 20% margin: operation=multiply, conversionFactor=1.2 - Bill per million tokens: operation=divide, conversionFactor=1e6, rounding=ceiling, displayUnit="M" v1 equivalents: - DynamicPrice(multiplier): operation=multiply, conversionFactor=multiplier + UnitPrice(amount=1) - PackagePrice(amount, quantityPerPkg): operation=divide, conversionFactor=quantityPerPkg, rounding=ceiling + UnitPrice(amount)');
|
|
2007
|
-
export const appCatalogItem = z
|
|
2008
|
-
.object({
|
|
2009
|
-
type: appType,
|
|
2010
|
-
name: z.string().describe('Name of the app.'),
|
|
2011
|
-
description: z.string().describe('Description of the app.'),
|
|
2012
|
-
})
|
|
2013
|
-
.describe('Available apps for billing integrations to connect with third-party services. Apps can have various capabilities like syncing data from or to external systems, integrating with third-party services for tax calculation, delivery of invoices, collection of payments, etc.');
|
|
2014
2049
|
export const taxCodeAppMapping = z
|
|
2015
2050
|
.object({
|
|
2016
2051
|
appType: appType,
|
|
2017
2052
|
taxCode: z.string().describe('Tax code.'),
|
|
2018
2053
|
})
|
|
2019
2054
|
.describe('Mapping of app types to tax codes.');
|
|
2055
|
+
export const appCapability = z
|
|
2056
|
+
.object({
|
|
2057
|
+
type: appCapabilityType,
|
|
2058
|
+
key: resourceKey,
|
|
2059
|
+
name: z.string().describe('Name of the capability.'),
|
|
2060
|
+
description: z.string().describe('Description of the capability.'),
|
|
2061
|
+
})
|
|
2062
|
+
.describe('App capability describes a function that an App can perform.');
|
|
2063
|
+
export const installAppRequest = z
|
|
2064
|
+
.discriminatedUnion('type', [
|
|
2065
|
+
installAppStripeWithApiKey,
|
|
2066
|
+
installAppSandbox,
|
|
2067
|
+
installAppExternalInvoicing,
|
|
2068
|
+
])
|
|
2069
|
+
.describe('Request to install an app from the catalog.');
|
|
2020
2070
|
export const partyTaxIdentity = z
|
|
2021
2071
|
.object({
|
|
2022
2072
|
code: taxIdentificationCode.optional(),
|
|
@@ -2837,87 +2887,6 @@ export const invoiceUsageQuantityDetail = z
|
|
|
2837
2887
|
appliedUnitConfig: unitConfig,
|
|
2838
2888
|
})
|
|
2839
2889
|
.describe('Usage quantity details on an invoice line item when UnitConfig is in effect. Provides the full audit trail from raw meter output to the invoiced amount.');
|
|
2840
|
-
export const appStripe = z
|
|
2841
|
-
.object({
|
|
2842
|
-
id: ulid,
|
|
2843
|
-
name: z
|
|
2844
|
-
.string()
|
|
2845
|
-
.min(1)
|
|
2846
|
-
.max(256)
|
|
2847
|
-
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
2848
|
-
description: z
|
|
2849
|
-
.string()
|
|
2850
|
-
.max(1024)
|
|
2851
|
-
.optional()
|
|
2852
|
-
.describe('Optional description of the resource. Maximum 1024 characters.'),
|
|
2853
|
-
labels: labels.optional(),
|
|
2854
|
-
createdAt: dateTime,
|
|
2855
|
-
updatedAt: dateTime,
|
|
2856
|
-
deletedAt: dateTime.optional(),
|
|
2857
|
-
type: z.literal('stripe').describe('The app type.'),
|
|
2858
|
-
definition: appCatalogItem,
|
|
2859
|
-
status: appStatus,
|
|
2860
|
-
accountId: z
|
|
2861
|
-
.string()
|
|
2862
|
-
.describe('The Stripe account ID associated with the connected Stripe account.'),
|
|
2863
|
-
livemode: z
|
|
2864
|
-
.boolean()
|
|
2865
|
-
.describe('Indicates whether the app is connected to a live Stripe account.'),
|
|
2866
|
-
maskedApiKey: z
|
|
2867
|
-
.string()
|
|
2868
|
-
.describe('The masked Stripe API key that only exposes the first and last few characters.'),
|
|
2869
|
-
})
|
|
2870
|
-
.describe('Stripe app.');
|
|
2871
|
-
export const appSandbox = z
|
|
2872
|
-
.object({
|
|
2873
|
-
id: ulid,
|
|
2874
|
-
name: z
|
|
2875
|
-
.string()
|
|
2876
|
-
.min(1)
|
|
2877
|
-
.max(256)
|
|
2878
|
-
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
2879
|
-
description: z
|
|
2880
|
-
.string()
|
|
2881
|
-
.max(1024)
|
|
2882
|
-
.optional()
|
|
2883
|
-
.describe('Optional description of the resource. Maximum 1024 characters.'),
|
|
2884
|
-
labels: labels.optional(),
|
|
2885
|
-
createdAt: dateTime,
|
|
2886
|
-
updatedAt: dateTime,
|
|
2887
|
-
deletedAt: dateTime.optional(),
|
|
2888
|
-
type: z.literal('sandbox').describe('The app type.'),
|
|
2889
|
-
definition: appCatalogItem,
|
|
2890
|
-
status: appStatus,
|
|
2891
|
-
})
|
|
2892
|
-
.describe('Sandbox app can be used for testing billing features.');
|
|
2893
|
-
export const appExternalInvoicing = z
|
|
2894
|
-
.object({
|
|
2895
|
-
id: ulid,
|
|
2896
|
-
name: z
|
|
2897
|
-
.string()
|
|
2898
|
-
.min(1)
|
|
2899
|
-
.max(256)
|
|
2900
|
-
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
2901
|
-
description: z
|
|
2902
|
-
.string()
|
|
2903
|
-
.max(1024)
|
|
2904
|
-
.optional()
|
|
2905
|
-
.describe('Optional description of the resource. Maximum 1024 characters.'),
|
|
2906
|
-
labels: labels.optional(),
|
|
2907
|
-
createdAt: dateTime,
|
|
2908
|
-
updatedAt: dateTime,
|
|
2909
|
-
deletedAt: dateTime.optional(),
|
|
2910
|
-
type: z.literal('external_invoicing').describe('The app type.'),
|
|
2911
|
-
definition: appCatalogItem,
|
|
2912
|
-
status: appStatus,
|
|
2913
|
-
enableDraftSyncHook: z
|
|
2914
|
-
.boolean()
|
|
2915
|
-
.describe('Enable draft synchronization hook. When enabled, invoices will pause at the draft state and wait for the integration to call the draft synchronized endpoint before progressing to the issuing state. This allows the external system to validate and prepare the invoice data. When disabled, invoices automatically progress through the draft state based on the configured workflow timing.'),
|
|
2916
|
-
enableIssuingSyncHook: z
|
|
2917
|
-
.boolean()
|
|
2918
|
-
.describe('Enable issuing synchronization hook. When enabled, invoices will pause at the issuing state and wait for the integration to call the issuing synchronized endpoint before progressing to the issued state. This ensures the external invoicing system has successfully created and finalized the invoice before it is marked as issued. When disabled, invoices automatically progress through the issuing state and are immediately marked as issued.'),
|
|
2919
|
-
})
|
|
2920
|
-
.describe('External Invoicing app enables integration with third-party invoicing or payment system. The app supports a bi-directional synchronization pattern where OpenMeter Billing manages the invoice lifecycle while the external system handles invoice presentation and payment collection. Integration workflow: 1. The billing system creates invoices and transitions them through lifecycle states (draft → issuing → issued) 2. The integration receives webhook notifications about invoice state changes 3. The integration calls back to provide external system IDs and metadata 4. The integration reports payment events back via the payment status API State synchronization is controlled by hooks that pause invoice progression until the external system confirms synchronization via API callbacks.');
|
|
2921
2890
|
export const createTaxCodeRequest = z
|
|
2922
2891
|
.object({
|
|
2923
2892
|
name: z
|
|
@@ -2978,6 +2947,17 @@ export const upsertTaxCodeRequest = z
|
|
|
2978
2947
|
.describe('Mapping of app types to tax codes.'),
|
|
2979
2948
|
})
|
|
2980
2949
|
.describe('TaxCode upsert request.');
|
|
2950
|
+
export const appCatalogItem = z
|
|
2951
|
+
.object({
|
|
2952
|
+
type: appType,
|
|
2953
|
+
name: z.string().describe('Name of the app.'),
|
|
2954
|
+
description: z.string().describe('Description of the app.'),
|
|
2955
|
+
capabilities: z.array(appCapability).describe('Capabilities of the app.'),
|
|
2956
|
+
installMethods: z
|
|
2957
|
+
.array(appInstallMethods)
|
|
2958
|
+
.describe('Available install methods of the app.'),
|
|
2959
|
+
})
|
|
2960
|
+
.describe('Available apps for billing integrations to connect with third-party services. Apps can have various capabilities like syncing data from or to external systems, integrating with third-party services for tax calculation, delivery of invoices, collection of payments, etc.');
|
|
2981
2961
|
export const invoiceWorkflow = z
|
|
2982
2962
|
.object({
|
|
2983
2963
|
invoicing: invoiceWorkflowInvoicingSettings.optional(),
|
|
@@ -3343,15 +3323,99 @@ export const workflowCollectionAlignment = z
|
|
|
3343
3323
|
workflowCollectionAlignmentAnchored,
|
|
3344
3324
|
])
|
|
3345
3325
|
.describe('The alignment for collecting the pending line items into an invoice. Defaults to subscription, which means that we are to create a new invoice every time the a subscription period starts (for in advance items) or ends (for in arrears items).');
|
|
3346
|
-
export const app = z
|
|
3347
|
-
.discriminatedUnion('type', [appStripe, appSandbox, appExternalInvoicing])
|
|
3348
|
-
.describe('Installed application.');
|
|
3349
3326
|
export const taxCodePagePaginatedResponse = z
|
|
3350
3327
|
.object({
|
|
3351
3328
|
data: z.array(taxCode),
|
|
3352
3329
|
meta: paginatedMeta,
|
|
3353
3330
|
})
|
|
3354
3331
|
.describe('Page paginated response.');
|
|
3332
|
+
export const appStripe = z
|
|
3333
|
+
.object({
|
|
3334
|
+
id: ulid,
|
|
3335
|
+
name: z
|
|
3336
|
+
.string()
|
|
3337
|
+
.min(1)
|
|
3338
|
+
.max(256)
|
|
3339
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
3340
|
+
description: z
|
|
3341
|
+
.string()
|
|
3342
|
+
.max(1024)
|
|
3343
|
+
.optional()
|
|
3344
|
+
.describe('Optional description of the resource. Maximum 1024 characters.'),
|
|
3345
|
+
labels: labels.optional(),
|
|
3346
|
+
createdAt: dateTime,
|
|
3347
|
+
updatedAt: dateTime,
|
|
3348
|
+
deletedAt: dateTime.optional(),
|
|
3349
|
+
type: z.literal('stripe').describe('The app type.'),
|
|
3350
|
+
definition: appCatalogItem,
|
|
3351
|
+
status: appStatus,
|
|
3352
|
+
accountId: z
|
|
3353
|
+
.string()
|
|
3354
|
+
.describe('The Stripe account ID associated with the connected Stripe account.'),
|
|
3355
|
+
livemode: z
|
|
3356
|
+
.boolean()
|
|
3357
|
+
.describe('Indicates whether the app is connected to a live Stripe account.'),
|
|
3358
|
+
maskedApiKey: z
|
|
3359
|
+
.string()
|
|
3360
|
+
.describe('The masked Stripe API key that only exposes the first and last few characters.'),
|
|
3361
|
+
})
|
|
3362
|
+
.describe('Stripe app.');
|
|
3363
|
+
export const appSandbox = z
|
|
3364
|
+
.object({
|
|
3365
|
+
id: ulid,
|
|
3366
|
+
name: z
|
|
3367
|
+
.string()
|
|
3368
|
+
.min(1)
|
|
3369
|
+
.max(256)
|
|
3370
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
3371
|
+
description: z
|
|
3372
|
+
.string()
|
|
3373
|
+
.max(1024)
|
|
3374
|
+
.optional()
|
|
3375
|
+
.describe('Optional description of the resource. Maximum 1024 characters.'),
|
|
3376
|
+
labels: labels.optional(),
|
|
3377
|
+
createdAt: dateTime,
|
|
3378
|
+
updatedAt: dateTime,
|
|
3379
|
+
deletedAt: dateTime.optional(),
|
|
3380
|
+
type: z.literal('sandbox').describe('The app type.'),
|
|
3381
|
+
definition: appCatalogItem,
|
|
3382
|
+
status: appStatus,
|
|
3383
|
+
})
|
|
3384
|
+
.describe('Sandbox app can be used for testing billing features.');
|
|
3385
|
+
export const appExternalInvoicing = z
|
|
3386
|
+
.object({
|
|
3387
|
+
id: ulid,
|
|
3388
|
+
name: z
|
|
3389
|
+
.string()
|
|
3390
|
+
.min(1)
|
|
3391
|
+
.max(256)
|
|
3392
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
3393
|
+
description: z
|
|
3394
|
+
.string()
|
|
3395
|
+
.max(1024)
|
|
3396
|
+
.optional()
|
|
3397
|
+
.describe('Optional description of the resource. Maximum 1024 characters.'),
|
|
3398
|
+
labels: labels.optional(),
|
|
3399
|
+
createdAt: dateTime,
|
|
3400
|
+
updatedAt: dateTime,
|
|
3401
|
+
deletedAt: dateTime.optional(),
|
|
3402
|
+
type: z.literal('external_invoicing').describe('The app type.'),
|
|
3403
|
+
definition: appCatalogItem,
|
|
3404
|
+
status: appStatus,
|
|
3405
|
+
enableDraftSyncHook: z
|
|
3406
|
+
.boolean()
|
|
3407
|
+
.describe('Enable draft synchronization hook. When enabled, invoices will pause at the draft state and wait for the integration to call the draft synchronized endpoint before progressing to the issuing state. This allows the external system to validate and prepare the invoice data. When disabled, invoices automatically progress through the draft state based on the configured workflow timing.'),
|
|
3408
|
+
enableIssuingSyncHook: z
|
|
3409
|
+
.boolean()
|
|
3410
|
+
.describe('Enable issuing synchronization hook. When enabled, invoices will pause at the issuing state and wait for the integration to call the issuing synchronized endpoint before progressing to the issued state. This ensures the external invoicing system has successfully created and finalized the invoice before it is marked as issued. When disabled, invoices automatically progress through the issuing state and are immediately marked as issued.'),
|
|
3411
|
+
})
|
|
3412
|
+
.describe('External Invoicing app enables integration with third-party invoicing or payment system. The app supports a bi-directional synchronization pattern where OpenMeter Billing manages the invoice lifecycle while the external system handles invoice presentation and payment collection. Integration workflow: 1. The billing system creates invoices and transitions them through lifecycle states (draft → issuing → issued) 2. The integration receives webhook notifications about invoice state changes 3. The integration calls back to provide external system IDs and metadata 4. The integration reports payment events back via the payment status API State synchronization is controlled by hooks that pause invoice progression until the external system confirms synchronization via API callbacks.');
|
|
3413
|
+
export const appCatalogItemPagePaginatedResponse = z
|
|
3414
|
+
.object({
|
|
3415
|
+
data: z.array(appCatalogItem),
|
|
3416
|
+
meta: paginatedMeta,
|
|
3417
|
+
})
|
|
3418
|
+
.describe('Page paginated response.');
|
|
3355
3419
|
export const invoiceWorkflowSettings = z
|
|
3356
3420
|
.object({
|
|
3357
3421
|
apps: invoiceWorkflowAppsReferences.optional(),
|
|
@@ -3534,19 +3598,9 @@ export const workflowCollectionSettings = z
|
|
|
3534
3598
|
.describe('This grace period can be used to delay the collection of the pending line items specified in alignment. This is useful, in case of multiple subscriptions having slightly different billing periods.'),
|
|
3535
3599
|
})
|
|
3536
3600
|
.describe('Workflow collection specifies how to collect the pending line items for an invoice.');
|
|
3537
|
-
export const
|
|
3538
|
-
.
|
|
3539
|
-
|
|
3540
|
-
meta: paginatedMeta,
|
|
3541
|
-
})
|
|
3542
|
-
.describe('Page paginated response.');
|
|
3543
|
-
export const profileApps = z
|
|
3544
|
-
.object({
|
|
3545
|
-
tax: app,
|
|
3546
|
-
invoicing: app,
|
|
3547
|
-
payment: app,
|
|
3548
|
-
})
|
|
3549
|
-
.describe('Applications used by a billing profile.');
|
|
3601
|
+
export const app = z
|
|
3602
|
+
.discriminatedUnion('type', [appStripe, appSandbox, appExternalInvoicing])
|
|
3603
|
+
.describe('Installed application.');
|
|
3550
3604
|
export const governanceQueryResponse = z
|
|
3551
3605
|
.object({
|
|
3552
3606
|
data: z
|
|
@@ -3711,6 +3765,25 @@ export const workflow = z
|
|
|
3711
3765
|
tax: workflowTaxSettings.optional(),
|
|
3712
3766
|
})
|
|
3713
3767
|
.describe('Billing workflow settings.');
|
|
3768
|
+
export const appPagePaginatedResponse = z
|
|
3769
|
+
.object({
|
|
3770
|
+
data: z.array(app),
|
|
3771
|
+
meta: paginatedMeta,
|
|
3772
|
+
})
|
|
3773
|
+
.describe('Page paginated response.');
|
|
3774
|
+
export const billingInstallAppResponse = z
|
|
3775
|
+
.object({
|
|
3776
|
+
app: app,
|
|
3777
|
+
defaultForCapabilityTypes: z.array(appCapabilityType),
|
|
3778
|
+
})
|
|
3779
|
+
.describe('Response of the app install.');
|
|
3780
|
+
export const profileApps = z
|
|
3781
|
+
.object({
|
|
3782
|
+
tax: app,
|
|
3783
|
+
invoicing: app,
|
|
3784
|
+
payment: app,
|
|
3785
|
+
})
|
|
3786
|
+
.describe('Applications used by a billing profile.');
|
|
3714
3787
|
export const chargeUsageBased = z
|
|
3715
3788
|
.object({
|
|
3716
3789
|
id: ulid,
|
|
@@ -4519,6 +4592,29 @@ export const getAppPathParams = z.object({
|
|
|
4519
4592
|
appId: ulid,
|
|
4520
4593
|
});
|
|
4521
4594
|
export const getAppResponse = app;
|
|
4595
|
+
export const listAppCatalogQueryParams = z.object({
|
|
4596
|
+
page: z
|
|
4597
|
+
.object({
|
|
4598
|
+
size: z.coerce
|
|
4599
|
+
.number()
|
|
4600
|
+
.int()
|
|
4601
|
+
.optional()
|
|
4602
|
+
.describe('The number of items to include per page.'),
|
|
4603
|
+
number: z.coerce.number().int().optional().describe('The page number.'),
|
|
4604
|
+
})
|
|
4605
|
+
.optional()
|
|
4606
|
+
.describe('Determines which page of the collection to retrieve.'),
|
|
4607
|
+
});
|
|
4608
|
+
export const listAppCatalogResponse = z.object({
|
|
4609
|
+
data: z.array(appCatalogItem),
|
|
4610
|
+
meta: paginatedMeta,
|
|
4611
|
+
});
|
|
4612
|
+
export const getAppCatalogItemPathParams = z.object({
|
|
4613
|
+
appType: appType,
|
|
4614
|
+
});
|
|
4615
|
+
export const getAppCatalogItemResponse = appCatalogItem;
|
|
4616
|
+
export const installAppBody = installAppRequest;
|
|
4617
|
+
export const installAppResponse = billingInstallAppResponse;
|
|
4522
4618
|
export const listBillingProfilesQueryParams = z.object({
|
|
4523
4619
|
page: z
|
|
4524
4620
|
.object({
|
|
@@ -4984,7 +5080,6 @@ export const sortQueryWire = z
|
|
|
4984
5080
|
order: z
|
|
4985
5081
|
.union([z.literal('asc'), z.literal('desc')])
|
|
4986
5082
|
.optional()
|
|
4987
|
-
.default('asc')
|
|
4988
5083
|
.describe('The sort order. `asc` for ascending, `desc` for descending.'),
|
|
4989
5084
|
})
|
|
4990
5085
|
.describe('Sort query. The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order.');
|
|
@@ -5004,9 +5099,11 @@ export const cursorMetaPageWire = z
|
|
|
5004
5099
|
.strictObject({
|
|
5005
5100
|
first: z.string().optional().describe('URI to the first page.'),
|
|
5006
5101
|
last: z.string().optional().describe('URI to the last page.'),
|
|
5007
|
-
next: z.string().
|
|
5008
|
-
previous: z
|
|
5009
|
-
|
|
5102
|
+
next: z.union([z.string(), z.null()]).describe('URI to the next page.'),
|
|
5103
|
+
previous: z
|
|
5104
|
+
.union([z.string(), z.null()])
|
|
5105
|
+
.describe('URI to the previous page.'),
|
|
5106
|
+
size: z.number().int().describe('Requested page size.'),
|
|
5010
5107
|
})
|
|
5011
5108
|
.describe('Cursor pagination metadata.');
|
|
5012
5109
|
export const invalidRulesWire = z
|
|
@@ -5059,7 +5156,6 @@ export const baseErrorWire = z
|
|
|
5059
5156
|
.intersection(z.object({
|
|
5060
5157
|
type: z
|
|
5061
5158
|
.string()
|
|
5062
|
-
.default('about:blank')
|
|
5063
5159
|
.describe('Type contains a URI that identifies the problem type.'),
|
|
5064
5160
|
status: z
|
|
5065
5161
|
.number()
|
|
@@ -5390,10 +5486,50 @@ export const rateCardBooleanEntitlementWire = z
|
|
|
5390
5486
|
export const appTypeWire = z
|
|
5391
5487
|
.enum(['sandbox', 'stripe', 'external_invoicing'])
|
|
5392
5488
|
.describe('The type of the app.');
|
|
5489
|
+
export const appCapabilityTypeWire = z
|
|
5490
|
+
.enum([
|
|
5491
|
+
'report_usage',
|
|
5492
|
+
'report_events',
|
|
5493
|
+
'calculate_tax',
|
|
5494
|
+
'invoice_customers',
|
|
5495
|
+
'collect_payments',
|
|
5496
|
+
])
|
|
5497
|
+
.describe('Supported capability types for an App. Each capability defines an integration function that an App can perform.');
|
|
5498
|
+
export const appInstallMethodsWire = z
|
|
5499
|
+
.enum(['with_oauth2', 'with_api_key', 'no_credentials_required'])
|
|
5500
|
+
.describe('Supported installation methods for an app.');
|
|
5393
5501
|
export const appStatusWire = z
|
|
5394
5502
|
.enum(['ready', 'unauthorized'])
|
|
5395
5503
|
.describe('Connection status of an installed app.');
|
|
5396
|
-
export const
|
|
5504
|
+
export const installAppStripeWithApiKeyWire = z
|
|
5505
|
+
.strictObject({
|
|
5506
|
+
type: z.literal('stripe').describe('Type of the app.'),
|
|
5507
|
+
name: z.string().describe('Name of the app.'),
|
|
5508
|
+
create_billing_profile: z
|
|
5509
|
+
.boolean()
|
|
5510
|
+
.describe('If true, a billing profile will be created for the app. The Stripe app will be also set as the default billing profile if the current default is a Sandbox app.'),
|
|
5511
|
+
api_key: z.string().describe('API key for the app.'),
|
|
5512
|
+
})
|
|
5513
|
+
.describe('Model for installing an app from the catalog with an API key.');
|
|
5514
|
+
export const installAppSandboxWire = z
|
|
5515
|
+
.strictObject({
|
|
5516
|
+
type: z.literal('sandbox').describe('Type of the app.'),
|
|
5517
|
+
name: z.string().describe('Name of the app.'),
|
|
5518
|
+
create_billing_profile: z
|
|
5519
|
+
.boolean()
|
|
5520
|
+
.describe('If true, a billing profile will be created for the app. The Stripe app will be also set as the default billing profile if the current default is a Sandbox app.'),
|
|
5521
|
+
})
|
|
5522
|
+
.describe('Base model for installing an app from the catalog.');
|
|
5523
|
+
export const installAppExternalInvoicingWire = z
|
|
5524
|
+
.strictObject({
|
|
5525
|
+
type: z.literal('external_invoicing').describe('Type of the app.'),
|
|
5526
|
+
name: z.string().describe('Name of the app.'),
|
|
5527
|
+
create_billing_profile: z
|
|
5528
|
+
.boolean()
|
|
5529
|
+
.describe('If true, a billing profile will be created for the app. The Stripe app will be also set as the default billing profile if the current default is a Sandbox app.'),
|
|
5530
|
+
})
|
|
5531
|
+
.describe('Base model for installing an app from the catalog.');
|
|
5532
|
+
export const taxIdentificationCodeWire = z
|
|
5397
5533
|
.string()
|
|
5398
5534
|
.min(1)
|
|
5399
5535
|
.max(32)
|
|
@@ -5421,7 +5557,6 @@ export const workflowPaymentSendInvoiceSettingsWire = z
|
|
|
5421
5557
|
due_after: z
|
|
5422
5558
|
.string()
|
|
5423
5559
|
.optional()
|
|
5424
|
-
.default('P30D')
|
|
5425
5560
|
.describe("The period after which the invoice is due. With some payment solutions it's only applicable for manual collection method."),
|
|
5426
5561
|
})
|
|
5427
5562
|
.describe('Payment settings for a billing workflow when the collection method is send invoice.');
|
|
@@ -5469,12 +5604,10 @@ export const invoiceWorkflowInvoicingSettingsWire = z
|
|
|
5469
5604
|
auto_advance: z
|
|
5470
5605
|
.boolean()
|
|
5471
5606
|
.optional()
|
|
5472
|
-
.default(true)
|
|
5473
5607
|
.describe('Whether to automatically issue the invoice after the draft_period has passed.'),
|
|
5474
5608
|
draft_period: z
|
|
5475
5609
|
.string()
|
|
5476
5610
|
.optional()
|
|
5477
|
-
.default('P0D')
|
|
5478
5611
|
.describe('The period for the invoice to be kept in draft status for manual reviews.'),
|
|
5479
5612
|
due_after: z
|
|
5480
5613
|
.string()
|
|
@@ -5504,12 +5637,10 @@ export const updateBillingInvoiceWorkflowInvoicingSettingsWire = z
|
|
|
5504
5637
|
auto_advance: z
|
|
5505
5638
|
.boolean()
|
|
5506
5639
|
.optional()
|
|
5507
|
-
.default(true)
|
|
5508
5640
|
.describe('Whether to automatically issue the invoice after the draft_period has passed.'),
|
|
5509
5641
|
draft_period: z
|
|
5510
5642
|
.string()
|
|
5511
5643
|
.optional()
|
|
5512
|
-
.default('P0D')
|
|
5513
5644
|
.describe('The period for the invoice to be kept in draft status for manual reviews.'),
|
|
5514
5645
|
})
|
|
5515
5646
|
.describe('Invoice-level invoicing settings. A subset of BillingWorkflowInvoicingSettings limited to fields that are meaningful per-invoice. progressive_billing is omitted as it is a gather-time / profile-level decision.');
|
|
@@ -5528,7 +5659,6 @@ export const updateBillingWorkflowPaymentSendInvoiceSettingsWire = z
|
|
|
5528
5659
|
due_after: z
|
|
5529
5660
|
.string()
|
|
5530
5661
|
.optional()
|
|
5531
|
-
.default('P30D')
|
|
5532
5662
|
.describe("The period after which the invoice is due. With some payment solutions it's only applicable for manual collection method."),
|
|
5533
5663
|
})
|
|
5534
5664
|
.describe('Payment settings for a billing workflow when the collection method is send invoice.');
|
|
@@ -6162,7 +6292,6 @@ export const eventWire = z
|
|
|
6162
6292
|
specversion: z
|
|
6163
6293
|
.string()
|
|
6164
6294
|
.min(1)
|
|
6165
|
-
.default('1.0')
|
|
6166
6295
|
.describe('The version of the CloudEvents specification which the event uses.'),
|
|
6167
6296
|
type: z
|
|
6168
6297
|
.string()
|
|
@@ -6657,15 +6786,9 @@ export const updateAddressWire = z
|
|
|
6657
6786
|
.describe('Address');
|
|
6658
6787
|
export const appStripeCreateCheckoutSessionCustomerUpdateWire = z
|
|
6659
6788
|
.strictObject({
|
|
6660
|
-
address: appStripeCreateCheckoutSessionCustomerUpdateBehaviorWire
|
|
6661
|
-
|
|
6662
|
-
|
|
6663
|
-
name: appStripeCreateCheckoutSessionCustomerUpdateBehaviorWire
|
|
6664
|
-
.optional()
|
|
6665
|
-
.default('never'),
|
|
6666
|
-
shipping: appStripeCreateCheckoutSessionCustomerUpdateBehaviorWire
|
|
6667
|
-
.optional()
|
|
6668
|
-
.default('never'),
|
|
6789
|
+
address: appStripeCreateCheckoutSessionCustomerUpdateBehaviorWire.optional(),
|
|
6790
|
+
name: appStripeCreateCheckoutSessionCustomerUpdateBehaviorWire.optional(),
|
|
6791
|
+
shipping: appStripeCreateCheckoutSessionCustomerUpdateBehaviorWire.optional(),
|
|
6669
6792
|
})
|
|
6670
6793
|
.describe('Controls which customer fields can be updated by the checkout session.');
|
|
6671
6794
|
export const appStripeCreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementWire = z
|
|
@@ -6678,11 +6801,8 @@ export const appStripeCreateCheckoutSessionTaxIdCollectionWire = z
|
|
|
6678
6801
|
enabled: z
|
|
6679
6802
|
.boolean()
|
|
6680
6803
|
.optional()
|
|
6681
|
-
.default(false)
|
|
6682
6804
|
.describe('Enable tax ID collection during checkout. Defaults to false.'),
|
|
6683
|
-
required: appStripeCreateCheckoutSessionTaxIdCollectionRequiredWire
|
|
6684
|
-
.optional()
|
|
6685
|
-
.default('never'),
|
|
6805
|
+
required: appStripeCreateCheckoutSessionTaxIdCollectionRequiredWire.optional(),
|
|
6686
6806
|
})
|
|
6687
6807
|
.describe('Tax ID collection configuration for checkout sessions.');
|
|
6688
6808
|
export const appStripeCreateCheckoutSessionResultWire = z
|
|
@@ -6756,10 +6876,8 @@ export const entitlementAccessResultWire = z
|
|
|
6756
6876
|
export const createCreditGrantPurchaseWire = z
|
|
6757
6877
|
.strictObject({
|
|
6758
6878
|
currency: currencyCodeWire,
|
|
6759
|
-
per_unit_cost_basis: numericWire.optional()
|
|
6760
|
-
availability_policy: creditAvailabilityPolicyWire
|
|
6761
|
-
.optional()
|
|
6762
|
-
.default('on_creation'),
|
|
6879
|
+
per_unit_cost_basis: numericWire.optional(),
|
|
6880
|
+
availability_policy: creditAvailabilityPolicyWire.optional(),
|
|
6763
6881
|
})
|
|
6764
6882
|
.describe('Purchase and payment terms of the grant.');
|
|
6765
6883
|
export const rateCardMeteredEntitlementWire = z
|
|
@@ -6770,7 +6888,6 @@ export const rateCardMeteredEntitlementWire = z
|
|
|
6770
6888
|
is_soft_limit: z
|
|
6771
6889
|
.boolean()
|
|
6772
6890
|
.optional()
|
|
6773
|
-
.default(false)
|
|
6774
6891
|
.describe('If soft limit is true, the subject can use the feature even if the entitlement is exhausted; access remains granted.'),
|
|
6775
6892
|
limit: z
|
|
6776
6893
|
.number()
|
|
@@ -6789,11 +6906,9 @@ export const recurringPeriodWire = z
|
|
|
6789
6906
|
export const creditGrantPurchaseWire = z
|
|
6790
6907
|
.strictObject({
|
|
6791
6908
|
currency: currencyCodeWire,
|
|
6792
|
-
per_unit_cost_basis: numericWire.optional()
|
|
6909
|
+
per_unit_cost_basis: numericWire.optional(),
|
|
6793
6910
|
amount: numericWire,
|
|
6794
|
-
availability_policy: creditAvailabilityPolicyWire
|
|
6795
|
-
.optional()
|
|
6796
|
-
.default('on_creation'),
|
|
6911
|
+
availability_policy: creditAvailabilityPolicyWire.optional(),
|
|
6797
6912
|
settlement_status: creditPurchasePaymentSettlementStatusWire.optional(),
|
|
6798
6913
|
})
|
|
6799
6914
|
.describe('Purchase and payment terms of the grant.');
|
|
@@ -6830,9 +6945,7 @@ export const listPlansParamsFilterWire = z
|
|
|
6830
6945
|
.describe('Filter options for listing plans.');
|
|
6831
6946
|
export const voidCreditGrantRequestWire = z
|
|
6832
6947
|
.strictObject({
|
|
6833
|
-
payment_adjustment: creditGrantVoidPaymentAdjustmentWire
|
|
6834
|
-
.optional()
|
|
6835
|
-
.default('none'),
|
|
6948
|
+
payment_adjustment: creditGrantVoidPaymentAdjustmentWire.optional(),
|
|
6836
6949
|
})
|
|
6837
6950
|
.describe('Request body for voiding a credit grant.');
|
|
6838
6951
|
export const subscriptionCreateWire = z
|
|
@@ -6885,12 +6998,11 @@ export const unitConfigWire = z
|
|
|
6885
6998
|
.strictObject({
|
|
6886
6999
|
operation: unitConfigOperationWire,
|
|
6887
7000
|
conversion_factor: numericWire,
|
|
6888
|
-
rounding: unitConfigRoundingModeWire.optional()
|
|
7001
|
+
rounding: unitConfigRoundingModeWire.optional(),
|
|
6889
7002
|
precision: z
|
|
6890
7003
|
.number()
|
|
6891
7004
|
.int()
|
|
6892
7005
|
.optional()
|
|
6893
|
-
.default(0)
|
|
6894
7006
|
.describe('The number of decimal places to retain after rounding. Only meaningful when rounding is not "none". Defaults to 0 (round to whole numbers).'),
|
|
6895
7007
|
display_unit: z
|
|
6896
7008
|
.string()
|
|
@@ -6898,19 +7010,27 @@ export const unitConfigWire = z
|
|
|
6898
7010
|
.describe('A human-readable label for the converted unit shown on invoices and in the customer portal (e.g., "GB", "hours", "M tokens"). Optional. When omitted, no unit label is rendered.'),
|
|
6899
7011
|
})
|
|
6900
7012
|
.describe('Unit conversion configuration. Transforms raw metered quantities into billing-ready units before pricing and entitlement evaluation. Applied at the rate card level so the same feature can be billed in different units across plans. Examples: - Meter bytes, bill GB: operation=divide, conversionFactor=1e9, rounding=ceiling, displayUnit="GB" - Meter seconds, bill hours: operation=divide, conversionFactor=3600, rounding=ceiling, displayUnit="hours" - Cost + 20% margin: operation=multiply, conversionFactor=1.2 - Bill per million tokens: operation=divide, conversionFactor=1e6, rounding=ceiling, displayUnit="M" v1 equivalents: - DynamicPrice(multiplier): operation=multiply, conversionFactor=multiplier + UnitPrice(amount=1) - PackagePrice(amount, quantityPerPkg): operation=divide, conversionFactor=quantityPerPkg, rounding=ceiling + UnitPrice(amount)');
|
|
6901
|
-
export const appCatalogItemWire = z
|
|
6902
|
-
.strictObject({
|
|
6903
|
-
type: appTypeWire,
|
|
6904
|
-
name: z.string().describe('Name of the app.'),
|
|
6905
|
-
description: z.string().describe('Description of the app.'),
|
|
6906
|
-
})
|
|
6907
|
-
.describe('Available apps for billing integrations to connect with third-party services. Apps can have various capabilities like syncing data from or to external systems, integrating with third-party services for tax calculation, delivery of invoices, collection of payments, etc.');
|
|
6908
7013
|
export const taxCodeAppMappingWire = z
|
|
6909
7014
|
.strictObject({
|
|
6910
7015
|
app_type: appTypeWire,
|
|
6911
7016
|
tax_code: z.string().describe('Tax code.'),
|
|
6912
7017
|
})
|
|
6913
7018
|
.describe('Mapping of app types to tax codes.');
|
|
7019
|
+
export const appCapabilityWire = z
|
|
7020
|
+
.strictObject({
|
|
7021
|
+
type: appCapabilityTypeWire,
|
|
7022
|
+
key: resourceKeyWire,
|
|
7023
|
+
name: z.string().describe('Name of the capability.'),
|
|
7024
|
+
description: z.string().describe('Description of the capability.'),
|
|
7025
|
+
})
|
|
7026
|
+
.describe('App capability describes a function that an App can perform.');
|
|
7027
|
+
export const installAppRequestWire = z
|
|
7028
|
+
.discriminatedUnion('type', [
|
|
7029
|
+
installAppStripeWithApiKeyWire,
|
|
7030
|
+
installAppSandboxWire,
|
|
7031
|
+
installAppExternalInvoicingWire,
|
|
7032
|
+
])
|
|
7033
|
+
.describe('Request to install an app from the catalog.');
|
|
6914
7034
|
export const partyTaxIdentityWire = z
|
|
6915
7035
|
.strictObject({
|
|
6916
7036
|
code: taxIdentificationCodeWire.optional(),
|
|
@@ -6926,21 +7046,16 @@ export const workflowInvoicingSettingsWire = z
|
|
|
6926
7046
|
auto_advance: z
|
|
6927
7047
|
.boolean()
|
|
6928
7048
|
.optional()
|
|
6929
|
-
.default(true)
|
|
6930
7049
|
.describe('Whether to automatically issue the invoice after the draftPeriod has passed.'),
|
|
6931
7050
|
draft_period: z
|
|
6932
7051
|
.string()
|
|
6933
7052
|
.optional()
|
|
6934
|
-
.default('P0D')
|
|
6935
7053
|
.describe('The period for the invoice to be kept in draft status for manual reviews.'),
|
|
6936
7054
|
progressive_billing: z
|
|
6937
7055
|
.boolean()
|
|
6938
7056
|
.optional()
|
|
6939
|
-
.default(true)
|
|
6940
7057
|
.describe('Should progressive billing be allowed for this workflow?'),
|
|
6941
|
-
subscription_end_proration_mode: workflowInvoicingSubscriptionEndProrationModeWire
|
|
6942
|
-
.optional()
|
|
6943
|
-
.default('bill_actual_period'),
|
|
7058
|
+
subscription_end_proration_mode: workflowInvoicingSubscriptionEndProrationModeWire.optional(),
|
|
6944
7059
|
})
|
|
6945
7060
|
.describe('Invoice settings for a billing workflow.');
|
|
6946
7061
|
export const workflowPaymentSettingsWire = z
|
|
@@ -7058,7 +7173,6 @@ export const governanceQueryRequestWire = z
|
|
|
7058
7173
|
include_credits: z
|
|
7059
7174
|
.boolean()
|
|
7060
7175
|
.optional()
|
|
7061
|
-
.default(false)
|
|
7062
7176
|
.describe('Whether to include credit balance availability for each resolved customer. When true, each feature evaluation includes credit balance checks. Defaults to `false`.'),
|
|
7063
7177
|
customer: governanceQueryRequestCustomersWire,
|
|
7064
7178
|
feature: governanceQueryRequestFeaturesWire.optional(),
|
|
@@ -7679,7 +7793,7 @@ export const subscriptionChangeResponseWire = z
|
|
|
7679
7793
|
.describe('Response for changing a subscription.');
|
|
7680
7794
|
export const subscriptionCancelWire = z
|
|
7681
7795
|
.strictObject({
|
|
7682
|
-
timing: subscriptionEditTimingWire.optional()
|
|
7796
|
+
timing: subscriptionEditTimingWire.optional(),
|
|
7683
7797
|
})
|
|
7684
7798
|
.describe('Request for canceling a subscription.');
|
|
7685
7799
|
export const subscriptionChangeWire = z
|
|
@@ -7731,87 +7845,6 @@ export const invoiceUsageQuantityDetailWire = z
|
|
|
7731
7845
|
applied_unit_config: unitConfigWire,
|
|
7732
7846
|
})
|
|
7733
7847
|
.describe('Usage quantity details on an invoice line item when UnitConfig is in effect. Provides the full audit trail from raw meter output to the invoiced amount.');
|
|
7734
|
-
export const appStripeWire = z
|
|
7735
|
-
.strictObject({
|
|
7736
|
-
id: ulidWire,
|
|
7737
|
-
name: z
|
|
7738
|
-
.string()
|
|
7739
|
-
.min(1)
|
|
7740
|
-
.max(256)
|
|
7741
|
-
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
7742
|
-
description: z
|
|
7743
|
-
.string()
|
|
7744
|
-
.max(1024)
|
|
7745
|
-
.optional()
|
|
7746
|
-
.describe('Optional description of the resource. Maximum 1024 characters.'),
|
|
7747
|
-
labels: labelsWire.optional(),
|
|
7748
|
-
created_at: dateTimeWire,
|
|
7749
|
-
updated_at: dateTimeWire,
|
|
7750
|
-
deleted_at: dateTimeWire.optional(),
|
|
7751
|
-
type: z.literal('stripe').describe('The app type.'),
|
|
7752
|
-
definition: appCatalogItemWire,
|
|
7753
|
-
status: appStatusWire,
|
|
7754
|
-
account_id: z
|
|
7755
|
-
.string()
|
|
7756
|
-
.describe('The Stripe account ID associated with the connected Stripe account.'),
|
|
7757
|
-
livemode: z
|
|
7758
|
-
.boolean()
|
|
7759
|
-
.describe('Indicates whether the app is connected to a live Stripe account.'),
|
|
7760
|
-
masked_api_key: z
|
|
7761
|
-
.string()
|
|
7762
|
-
.describe('The masked Stripe API key that only exposes the first and last few characters.'),
|
|
7763
|
-
})
|
|
7764
|
-
.describe('Stripe app.');
|
|
7765
|
-
export const appSandboxWire = z
|
|
7766
|
-
.strictObject({
|
|
7767
|
-
id: ulidWire,
|
|
7768
|
-
name: z
|
|
7769
|
-
.string()
|
|
7770
|
-
.min(1)
|
|
7771
|
-
.max(256)
|
|
7772
|
-
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
7773
|
-
description: z
|
|
7774
|
-
.string()
|
|
7775
|
-
.max(1024)
|
|
7776
|
-
.optional()
|
|
7777
|
-
.describe('Optional description of the resource. Maximum 1024 characters.'),
|
|
7778
|
-
labels: labelsWire.optional(),
|
|
7779
|
-
created_at: dateTimeWire,
|
|
7780
|
-
updated_at: dateTimeWire,
|
|
7781
|
-
deleted_at: dateTimeWire.optional(),
|
|
7782
|
-
type: z.literal('sandbox').describe('The app type.'),
|
|
7783
|
-
definition: appCatalogItemWire,
|
|
7784
|
-
status: appStatusWire,
|
|
7785
|
-
})
|
|
7786
|
-
.describe('Sandbox app can be used for testing billing features.');
|
|
7787
|
-
export const appExternalInvoicingWire = z
|
|
7788
|
-
.strictObject({
|
|
7789
|
-
id: ulidWire,
|
|
7790
|
-
name: z
|
|
7791
|
-
.string()
|
|
7792
|
-
.min(1)
|
|
7793
|
-
.max(256)
|
|
7794
|
-
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
7795
|
-
description: z
|
|
7796
|
-
.string()
|
|
7797
|
-
.max(1024)
|
|
7798
|
-
.optional()
|
|
7799
|
-
.describe('Optional description of the resource. Maximum 1024 characters.'),
|
|
7800
|
-
labels: labelsWire.optional(),
|
|
7801
|
-
created_at: dateTimeWire,
|
|
7802
|
-
updated_at: dateTimeWire,
|
|
7803
|
-
deleted_at: dateTimeWire.optional(),
|
|
7804
|
-
type: z.literal('external_invoicing').describe('The app type.'),
|
|
7805
|
-
definition: appCatalogItemWire,
|
|
7806
|
-
status: appStatusWire,
|
|
7807
|
-
enable_draft_sync_hook: z
|
|
7808
|
-
.boolean()
|
|
7809
|
-
.describe('Enable draft synchronization hook. When enabled, invoices will pause at the draft state and wait for the integration to call the draft synchronized endpoint before progressing to the issuing state. This allows the external system to validate and prepare the invoice data. When disabled, invoices automatically progress through the draft state based on the configured workflow timing.'),
|
|
7810
|
-
enable_issuing_sync_hook: z
|
|
7811
|
-
.boolean()
|
|
7812
|
-
.describe('Enable issuing synchronization hook. When enabled, invoices will pause at the issuing state and wait for the integration to call the issuing synchronized endpoint before progressing to the issued state. This ensures the external invoicing system has successfully created and finalized the invoice before it is marked as issued. When disabled, invoices automatically progress through the issuing state and are immediately marked as issued.'),
|
|
7813
|
-
})
|
|
7814
|
-
.describe('External Invoicing app enables integration with third-party invoicing or payment system. The app supports a bi-directional synchronization pattern where OpenMeter Billing manages the invoice lifecycle while the external system handles invoice presentation and payment collection. Integration workflow: 1. The billing system creates invoices and transitions them through lifecycle states (draft → issuing → issued) 2. The integration receives webhook notifications about invoice state changes 3. The integration calls back to provide external system IDs and metadata 4. The integration reports payment events back via the payment status API State synchronization is controlled by hooks that pause invoice progression until the external system confirms synchronization via API callbacks.');
|
|
7815
7848
|
export const createTaxCodeRequestWire = z
|
|
7816
7849
|
.strictObject({
|
|
7817
7850
|
name: z
|
|
@@ -7872,6 +7905,19 @@ export const upsertTaxCodeRequestWire = z
|
|
|
7872
7905
|
.describe('Mapping of app types to tax codes.'),
|
|
7873
7906
|
})
|
|
7874
7907
|
.describe('TaxCode upsert request.');
|
|
7908
|
+
export const appCatalogItemWire = z
|
|
7909
|
+
.strictObject({
|
|
7910
|
+
type: appTypeWire,
|
|
7911
|
+
name: z.string().describe('Name of the app.'),
|
|
7912
|
+
description: z.string().describe('Description of the app.'),
|
|
7913
|
+
capabilities: z
|
|
7914
|
+
.array(appCapabilityWire)
|
|
7915
|
+
.describe('Capabilities of the app.'),
|
|
7916
|
+
install_methods: z
|
|
7917
|
+
.array(appInstallMethodsWire)
|
|
7918
|
+
.describe('Available install methods of the app.'),
|
|
7919
|
+
})
|
|
7920
|
+
.describe('Available apps for billing integrations to connect with third-party services. Apps can have various capabilities like syncing data from or to external systems, integrating with third-party services for tax calculation, delivery of invoices, collection of payments, etc.');
|
|
7875
7921
|
export const invoiceWorkflowWire = z
|
|
7876
7922
|
.strictObject({
|
|
7877
7923
|
invoicing: invoiceWorkflowInvoicingSettingsWire.optional(),
|
|
@@ -8018,7 +8064,6 @@ export const createCreditGrantRequestWire = z
|
|
|
8018
8064
|
.gte(1)
|
|
8019
8065
|
.lte(1000)
|
|
8020
8066
|
.optional()
|
|
8021
|
-
.default(10)
|
|
8022
8067
|
.describe('Draw-down priority of the grant. Lower values have higher priority.'),
|
|
8023
8068
|
effective_at: dateTimeWire.optional(),
|
|
8024
8069
|
expires_after: iso8601DurationWire.optional(),
|
|
@@ -8055,7 +8100,6 @@ export const creditGrantWire = z
|
|
|
8055
8100
|
.gte(1)
|
|
8056
8101
|
.lte(1000)
|
|
8057
8102
|
.optional()
|
|
8058
|
-
.default(10)
|
|
8059
8103
|
.describe('Draw-down priority of the grant. Lower values have higher priority.'),
|
|
8060
8104
|
effective_at: dateTimeWire.optional(),
|
|
8061
8105
|
key: externalResourceKeyWire.optional(),
|
|
@@ -8104,12 +8148,10 @@ export const workflowTaxSettingsWire = z
|
|
|
8104
8148
|
enabled: z
|
|
8105
8149
|
.boolean()
|
|
8106
8150
|
.optional()
|
|
8107
|
-
.default(true)
|
|
8108
8151
|
.describe('Enable automatic tax calculation when tax is supported by the app. For example, with Stripe Invoicing when enabled, tax is calculated via Stripe Tax.'),
|
|
8109
8152
|
enforced: z
|
|
8110
8153
|
.boolean()
|
|
8111
8154
|
.optional()
|
|
8112
|
-
.default(false)
|
|
8113
8155
|
.describe('Enforce tax calculation when tax is supported by the app. When enabled, the billing system will not allow to create an invoice without tax calculation. Enforcement is different per apps, for example, Stripe app requires customer to have a tax location when starting a paid subscription.'),
|
|
8114
8156
|
default_tax_config: taxConfigWire.optional(),
|
|
8115
8157
|
})
|
|
@@ -8138,7 +8180,6 @@ export const meterQueryRequestWire = z
|
|
|
8138
8180
|
time_zone: z
|
|
8139
8181
|
.string()
|
|
8140
8182
|
.optional()
|
|
8141
|
-
.default('UTC')
|
|
8142
8183
|
.describe('The value is the name of the time zone as defined in the IANA Time Zone Database (http://www.iana.org/time-zones). The time zone is used to determine the start and end of the time buckets. If not specified, the UTC timezone will be used.'),
|
|
8143
8184
|
group_by_dimensions: z
|
|
8144
8185
|
.array(z.string())
|
|
@@ -8190,9 +8231,7 @@ export const updateSupplierWire = z
|
|
|
8190
8231
|
.describe("Snapshot of the supplier's information at the time the invoice was issued. Structurally a read-only subset of `BillingParty` (the type configured on the billing profile), so the snapshot stays aligned with the source. `key` is omitted because it is not part of the snapshotted supplier data.");
|
|
8191
8232
|
export const appStripeCreateCheckoutSessionRequestOptionsWire = z
|
|
8192
8233
|
.strictObject({
|
|
8193
|
-
billing_address_collection: appStripeCreateCheckoutSessionBillingAddressCollectionWire
|
|
8194
|
-
.optional()
|
|
8195
|
-
.default('auto'),
|
|
8234
|
+
billing_address_collection: appStripeCreateCheckoutSessionBillingAddressCollectionWire.optional(),
|
|
8196
8235
|
cancel_url: z
|
|
8197
8236
|
.string()
|
|
8198
8237
|
.optional()
|
|
@@ -8227,7 +8266,7 @@ export const appStripeCreateCheckoutSessionRequestOptionsWire = z
|
|
|
8227
8266
|
.string()
|
|
8228
8267
|
.optional()
|
|
8229
8268
|
.describe('Success URL to redirect customers after completing payment or setup. Not allowed when ui_mode is "embedded". See: https://docs.stripe.com/payments/checkout/custom-success-page'),
|
|
8230
|
-
ui_mode: appStripeCheckoutSessionUiModeWire.optional()
|
|
8269
|
+
ui_mode: appStripeCheckoutSessionUiModeWire.optional(),
|
|
8231
8270
|
payment_method_types: z
|
|
8232
8271
|
.array(z.string())
|
|
8233
8272
|
.optional()
|
|
@@ -8242,19 +8281,99 @@ export const workflowCollectionAlignmentWire = z
|
|
|
8242
8281
|
workflowCollectionAlignmentAnchoredWire,
|
|
8243
8282
|
])
|
|
8244
8283
|
.describe('The alignment for collecting the pending line items into an invoice. Defaults to subscription, which means that we are to create a new invoice every time the a subscription period starts (for in advance items) or ends (for in arrears items).');
|
|
8245
|
-
export const appWire = z
|
|
8246
|
-
.discriminatedUnion('type', [
|
|
8247
|
-
appStripeWire,
|
|
8248
|
-
appSandboxWire,
|
|
8249
|
-
appExternalInvoicingWire,
|
|
8250
|
-
])
|
|
8251
|
-
.describe('Installed application.');
|
|
8252
8284
|
export const taxCodePagePaginatedResponseWire = z
|
|
8253
8285
|
.strictObject({
|
|
8254
8286
|
data: z.array(taxCodeWire),
|
|
8255
8287
|
meta: paginatedMetaWire,
|
|
8256
8288
|
})
|
|
8257
8289
|
.describe('Page paginated response.');
|
|
8290
|
+
export const appStripeWire = z
|
|
8291
|
+
.strictObject({
|
|
8292
|
+
id: ulidWire,
|
|
8293
|
+
name: z
|
|
8294
|
+
.string()
|
|
8295
|
+
.min(1)
|
|
8296
|
+
.max(256)
|
|
8297
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
8298
|
+
description: z
|
|
8299
|
+
.string()
|
|
8300
|
+
.max(1024)
|
|
8301
|
+
.optional()
|
|
8302
|
+
.describe('Optional description of the resource. Maximum 1024 characters.'),
|
|
8303
|
+
labels: labelsWire.optional(),
|
|
8304
|
+
created_at: dateTimeWire,
|
|
8305
|
+
updated_at: dateTimeWire,
|
|
8306
|
+
deleted_at: dateTimeWire.optional(),
|
|
8307
|
+
type: z.literal('stripe').describe('The app type.'),
|
|
8308
|
+
definition: appCatalogItemWire,
|
|
8309
|
+
status: appStatusWire,
|
|
8310
|
+
account_id: z
|
|
8311
|
+
.string()
|
|
8312
|
+
.describe('The Stripe account ID associated with the connected Stripe account.'),
|
|
8313
|
+
livemode: z
|
|
8314
|
+
.boolean()
|
|
8315
|
+
.describe('Indicates whether the app is connected to a live Stripe account.'),
|
|
8316
|
+
masked_api_key: z
|
|
8317
|
+
.string()
|
|
8318
|
+
.describe('The masked Stripe API key that only exposes the first and last few characters.'),
|
|
8319
|
+
})
|
|
8320
|
+
.describe('Stripe app.');
|
|
8321
|
+
export const appSandboxWire = z
|
|
8322
|
+
.strictObject({
|
|
8323
|
+
id: ulidWire,
|
|
8324
|
+
name: z
|
|
8325
|
+
.string()
|
|
8326
|
+
.min(1)
|
|
8327
|
+
.max(256)
|
|
8328
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
8329
|
+
description: z
|
|
8330
|
+
.string()
|
|
8331
|
+
.max(1024)
|
|
8332
|
+
.optional()
|
|
8333
|
+
.describe('Optional description of the resource. Maximum 1024 characters.'),
|
|
8334
|
+
labels: labelsWire.optional(),
|
|
8335
|
+
created_at: dateTimeWire,
|
|
8336
|
+
updated_at: dateTimeWire,
|
|
8337
|
+
deleted_at: dateTimeWire.optional(),
|
|
8338
|
+
type: z.literal('sandbox').describe('The app type.'),
|
|
8339
|
+
definition: appCatalogItemWire,
|
|
8340
|
+
status: appStatusWire,
|
|
8341
|
+
})
|
|
8342
|
+
.describe('Sandbox app can be used for testing billing features.');
|
|
8343
|
+
export const appExternalInvoicingWire = z
|
|
8344
|
+
.strictObject({
|
|
8345
|
+
id: ulidWire,
|
|
8346
|
+
name: z
|
|
8347
|
+
.string()
|
|
8348
|
+
.min(1)
|
|
8349
|
+
.max(256)
|
|
8350
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
8351
|
+
description: z
|
|
8352
|
+
.string()
|
|
8353
|
+
.max(1024)
|
|
8354
|
+
.optional()
|
|
8355
|
+
.describe('Optional description of the resource. Maximum 1024 characters.'),
|
|
8356
|
+
labels: labelsWire.optional(),
|
|
8357
|
+
created_at: dateTimeWire,
|
|
8358
|
+
updated_at: dateTimeWire,
|
|
8359
|
+
deleted_at: dateTimeWire.optional(),
|
|
8360
|
+
type: z.literal('external_invoicing').describe('The app type.'),
|
|
8361
|
+
definition: appCatalogItemWire,
|
|
8362
|
+
status: appStatusWire,
|
|
8363
|
+
enable_draft_sync_hook: z
|
|
8364
|
+
.boolean()
|
|
8365
|
+
.describe('Enable draft synchronization hook. When enabled, invoices will pause at the draft state and wait for the integration to call the draft synchronized endpoint before progressing to the issuing state. This allows the external system to validate and prepare the invoice data. When disabled, invoices automatically progress through the draft state based on the configured workflow timing.'),
|
|
8366
|
+
enable_issuing_sync_hook: z
|
|
8367
|
+
.boolean()
|
|
8368
|
+
.describe('Enable issuing synchronization hook. When enabled, invoices will pause at the issuing state and wait for the integration to call the issuing synchronized endpoint before progressing to the issued state. This ensures the external invoicing system has successfully created and finalized the invoice before it is marked as issued. When disabled, invoices automatically progress through the issuing state and are immediately marked as issued.'),
|
|
8369
|
+
})
|
|
8370
|
+
.describe('External Invoicing app enables integration with third-party invoicing or payment system. The app supports a bi-directional synchronization pattern where OpenMeter Billing manages the invoice lifecycle while the external system handles invoice presentation and payment collection. Integration workflow: 1. The billing system creates invoices and transitions them through lifecycle states (draft → issuing → issued) 2. The integration receives webhook notifications about invoice state changes 3. The integration calls back to provide external system IDs and metadata 4. The integration reports payment events back via the payment status API State synchronization is controlled by hooks that pause invoice progression until the external system confirms synchronization via API callbacks.');
|
|
8371
|
+
export const appCatalogItemPagePaginatedResponseWire = z
|
|
8372
|
+
.strictObject({
|
|
8373
|
+
data: z.array(appCatalogItemWire),
|
|
8374
|
+
meta: paginatedMetaWire,
|
|
8375
|
+
})
|
|
8376
|
+
.describe('Page paginated response.');
|
|
8258
8377
|
export const invoiceWorkflowSettingsWire = z
|
|
8259
8378
|
.strictObject({
|
|
8260
8379
|
apps: invoiceWorkflowAppsReferencesWire.optional(),
|
|
@@ -8281,7 +8400,7 @@ export const invoiceDetailedLineWire = z
|
|
|
8281
8400
|
deleted_at: dateTimeWire.optional(),
|
|
8282
8401
|
service_period: closedPeriodWire,
|
|
8283
8402
|
totals: totalsWire,
|
|
8284
|
-
category: invoiceDetailedLineCostCategoryWire
|
|
8403
|
+
category: invoiceDetailedLineCostCategoryWire,
|
|
8285
8404
|
discounts: invoiceLineDiscountsWire.optional(),
|
|
8286
8405
|
credits_applied: z
|
|
8287
8406
|
.array(invoiceLineCreditsAppliedWire)
|
|
@@ -8431,29 +8550,20 @@ export const customerStripeCreateCheckoutSessionRequestWire = z
|
|
|
8431
8550
|
.describe('Request to create a Stripe Checkout Session for the customer. Checkout Sessions are used to collect payment method information from customers in a secure, Stripe-hosted interface. This integration uses setup mode to collect payment methods that can be charged later for subscription billing.');
|
|
8432
8551
|
export const workflowCollectionSettingsWire = z
|
|
8433
8552
|
.strictObject({
|
|
8434
|
-
alignment: workflowCollectionAlignmentWire.optional()
|
|
8435
|
-
type: 'subscription',
|
|
8436
|
-
}),
|
|
8553
|
+
alignment: workflowCollectionAlignmentWire.optional(),
|
|
8437
8554
|
interval: z
|
|
8438
8555
|
.string()
|
|
8439
8556
|
.optional()
|
|
8440
|
-
.default('PT1H')
|
|
8441
8557
|
.describe('This grace period can be used to delay the collection of the pending line items specified in alignment. This is useful, in case of multiple subscriptions having slightly different billing periods.'),
|
|
8442
8558
|
})
|
|
8443
8559
|
.describe('Workflow collection specifies how to collect the pending line items for an invoice.');
|
|
8444
|
-
export const
|
|
8445
|
-
.
|
|
8446
|
-
|
|
8447
|
-
|
|
8448
|
-
|
|
8449
|
-
|
|
8450
|
-
|
|
8451
|
-
.strictObject({
|
|
8452
|
-
tax: appWire,
|
|
8453
|
-
invoicing: appWire,
|
|
8454
|
-
payment: appWire,
|
|
8455
|
-
})
|
|
8456
|
-
.describe('Applications used by a billing profile.');
|
|
8560
|
+
export const appWire = z
|
|
8561
|
+
.discriminatedUnion('type', [
|
|
8562
|
+
appStripeWire,
|
|
8563
|
+
appSandboxWire,
|
|
8564
|
+
appExternalInvoicingWire,
|
|
8565
|
+
])
|
|
8566
|
+
.describe('Installed application.');
|
|
8457
8567
|
export const governanceQueryResponseWire = z
|
|
8458
8568
|
.strictObject({
|
|
8459
8569
|
data: z
|
|
@@ -8581,7 +8691,7 @@ export const rateCardWire = z
|
|
|
8581
8691
|
billing_cadence: iso8601DurationWire.optional(),
|
|
8582
8692
|
price: priceWire,
|
|
8583
8693
|
unit_config: unitConfigWire.optional(),
|
|
8584
|
-
payment_term: pricePaymentTermWire.optional()
|
|
8694
|
+
payment_term: pricePaymentTermWire.optional(),
|
|
8585
8695
|
commitments: spendCommitmentsWire.optional(),
|
|
8586
8696
|
discounts: rateCardDiscountsWire.optional(),
|
|
8587
8697
|
tax_config: rateCardTaxConfigWire.optional(),
|
|
@@ -8618,6 +8728,25 @@ export const workflowWire = z
|
|
|
8618
8728
|
tax: workflowTaxSettingsWire.optional(),
|
|
8619
8729
|
})
|
|
8620
8730
|
.describe('Billing workflow settings.');
|
|
8731
|
+
export const appPagePaginatedResponseWire = z
|
|
8732
|
+
.strictObject({
|
|
8733
|
+
data: z.array(appWire),
|
|
8734
|
+
meta: paginatedMetaWire,
|
|
8735
|
+
})
|
|
8736
|
+
.describe('Page paginated response.');
|
|
8737
|
+
export const billingInstallAppResponseWire = z
|
|
8738
|
+
.strictObject({
|
|
8739
|
+
app: appWire,
|
|
8740
|
+
default_for_capability_types: z.array(appCapabilityTypeWire),
|
|
8741
|
+
})
|
|
8742
|
+
.describe('Response of the app install.');
|
|
8743
|
+
export const profileAppsWire = z
|
|
8744
|
+
.strictObject({
|
|
8745
|
+
tax: appWire,
|
|
8746
|
+
invoicing: appWire,
|
|
8747
|
+
payment: appWire,
|
|
8748
|
+
})
|
|
8749
|
+
.describe('Applications used by a billing profile.');
|
|
8621
8750
|
export const chargeUsageBasedWire = z
|
|
8622
8751
|
.strictObject({
|
|
8623
8752
|
id: ulidWire,
|
|
@@ -8713,7 +8842,6 @@ export const addonWire = z
|
|
|
8713
8842
|
.number()
|
|
8714
8843
|
.int()
|
|
8715
8844
|
.gte(1)
|
|
8716
|
-
.default(1)
|
|
8717
8845
|
.describe('Version of the add-on. Incremented when the add-on is updated.'),
|
|
8718
8846
|
instance_type: addonInstanceTypeWire,
|
|
8719
8847
|
currency: billingCurrencyCodeWire,
|
|
@@ -8940,14 +9068,12 @@ export const planWire = z
|
|
|
8940
9068
|
.number()
|
|
8941
9069
|
.int()
|
|
8942
9070
|
.gte(1)
|
|
8943
|
-
.default(1)
|
|
8944
9071
|
.describe('Plans are versioned to allow you to make changes without affecting running subscriptions.'),
|
|
8945
9072
|
currency: currencyCodeWire,
|
|
8946
9073
|
billing_cadence: iso8601DurationWire,
|
|
8947
9074
|
pro_rating_enabled: z
|
|
8948
9075
|
.boolean()
|
|
8949
9076
|
.optional()
|
|
8950
|
-
.default(true)
|
|
8951
9077
|
.describe('Whether pro-rating is enabled for this plan.'),
|
|
8952
9078
|
effective_from: dateTimeWire.optional(),
|
|
8953
9079
|
effective_to: dateTimeWire.optional(),
|
|
@@ -8956,9 +9082,7 @@ export const planWire = z
|
|
|
8956
9082
|
.array(planPhaseWire)
|
|
8957
9083
|
.min(1)
|
|
8958
9084
|
.describe('The plan phases define the pricing ramp for a subscription. A phase switch occurs only at the end of a billing period. At least one phase is required.'),
|
|
8959
|
-
settlement_mode: settlementModeWire
|
|
8960
|
-
.optional()
|
|
8961
|
-
.default('credit_then_invoice'),
|
|
9085
|
+
settlement_mode: settlementModeWire.optional(),
|
|
8962
9086
|
validation_errors: z
|
|
8963
9087
|
.array(productCatalogValidationErrorWire)
|
|
8964
9088
|
.optional()
|
|
@@ -8984,7 +9108,6 @@ export const createPlanRequestWire = z
|
|
|
8984
9108
|
pro_rating_enabled: z
|
|
8985
9109
|
.boolean()
|
|
8986
9110
|
.optional()
|
|
8987
|
-
.default(true)
|
|
8988
9111
|
.describe('Whether pro-rating is enabled for this plan.'),
|
|
8989
9112
|
phases: z
|
|
8990
9113
|
.array(planPhaseWire)
|
|
@@ -9008,7 +9131,6 @@ export const upsertPlanRequestWire = z
|
|
|
9008
9131
|
pro_rating_enabled: z
|
|
9009
9132
|
.boolean()
|
|
9010
9133
|
.optional()
|
|
9011
|
-
.default(true)
|
|
9012
9134
|
.describe('Whether pro-rating is enabled for this plan.'),
|
|
9013
9135
|
phases: z
|
|
9014
9136
|
.array(planPhaseWire)
|
|
@@ -9128,7 +9250,10 @@ export const invoicePagePaginatedResponseWire = z
|
|
|
9128
9250
|
export const listMeteringEventsQueryParamsWire = z.object({
|
|
9129
9251
|
page: cursorPaginationQueryPageWire.optional(),
|
|
9130
9252
|
filter: listEventsParamsFilterWire.optional(),
|
|
9131
|
-
sort:
|
|
9253
|
+
sort: z
|
|
9254
|
+
.string()
|
|
9255
|
+
.optional()
|
|
9256
|
+
.describe('Sort events returned in the response. Supported sort attributes are: - `time` (default) - `ingested_at` - `stored_at` When omitted, events are sorted by `time desc` (most recent first). When a sort field is provided without a suffix, it sorts descending. Append the `asc` suffix to sort ascending, or the `desc` suffix to sort descending.'),
|
|
9132
9257
|
});
|
|
9133
9258
|
export const listMeteringEventsResponseWire = z.strictObject({
|
|
9134
9259
|
data: z.array(ingestedEventWire),
|
|
@@ -9156,7 +9281,10 @@ export const listMetersQueryParamsWire = z.object({
|
|
|
9156
9281
|
})
|
|
9157
9282
|
.optional()
|
|
9158
9283
|
.describe('Determines which page of the collection to retrieve.'),
|
|
9159
|
-
sort:
|
|
9284
|
+
sort: z
|
|
9285
|
+
.string()
|
|
9286
|
+
.optional()
|
|
9287
|
+
.describe('Sort meters returned in the response. Supported sort attributes are: - `key` - `name` - `aggregation` - `created_at` (default) - `updated_at` The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order.'),
|
|
9160
9288
|
filter: listMetersParamsFilterWire.optional(),
|
|
9161
9289
|
});
|
|
9162
9290
|
export const listMetersResponseWire = z.strictObject({
|
|
@@ -9199,7 +9327,10 @@ export const listCustomersQueryParamsWire = z.object({
|
|
|
9199
9327
|
})
|
|
9200
9328
|
.optional()
|
|
9201
9329
|
.describe('Determines which page of the collection to retrieve.'),
|
|
9202
|
-
sort:
|
|
9330
|
+
sort: z
|
|
9331
|
+
.string()
|
|
9332
|
+
.optional()
|
|
9333
|
+
.describe('Sort customers returned in the response. Supported sort attributes are: - `id` - `name` (default) - `created_at` The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order.'),
|
|
9203
9334
|
filter: listCustomersParamsFilterWire.optional(),
|
|
9204
9335
|
});
|
|
9205
9336
|
export const listCustomersResponseWire = z.strictObject({
|
|
@@ -9324,7 +9455,10 @@ export const listCustomerChargesQueryParamsWire = z.object({
|
|
|
9324
9455
|
})
|
|
9325
9456
|
.optional()
|
|
9326
9457
|
.describe('Determines which page of the collection to retrieve.'),
|
|
9327
|
-
sort:
|
|
9458
|
+
sort: z
|
|
9459
|
+
.string()
|
|
9460
|
+
.optional()
|
|
9461
|
+
.describe('Sort charges returned in the response. Supported sort attributes are: - `id` - `created_at` - `service_period.from` - `billing_period.from`'),
|
|
9328
9462
|
filter: listChargesParamsFilterWire.optional(),
|
|
9329
9463
|
expand: z
|
|
9330
9464
|
.array(chargesExpandWire)
|
|
@@ -9354,7 +9488,10 @@ export const listSubscriptionsQueryParamsWire = z.object({
|
|
|
9354
9488
|
})
|
|
9355
9489
|
.optional()
|
|
9356
9490
|
.describe('Determines which page of the collection to retrieve.'),
|
|
9357
|
-
sort:
|
|
9491
|
+
sort: z
|
|
9492
|
+
.string()
|
|
9493
|
+
.optional()
|
|
9494
|
+
.describe('Sort subscriptions returned in the response. Supported sort attributes are: - `id` - `active_from` (default) - `active_to` The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order.'),
|
|
9358
9495
|
filter: listSubscriptionsParamsFilterWire.optional(),
|
|
9359
9496
|
});
|
|
9360
9497
|
export const listSubscriptionsResponseWire = z.strictObject({
|
|
@@ -9399,7 +9536,10 @@ export const listSubscriptionAddonsQueryParamsWire = z.object({
|
|
|
9399
9536
|
})
|
|
9400
9537
|
.optional()
|
|
9401
9538
|
.describe('Determines which page of the collection to retrieve.'),
|
|
9402
|
-
sort:
|
|
9539
|
+
sort: z
|
|
9540
|
+
.string()
|
|
9541
|
+
.optional()
|
|
9542
|
+
.describe('Sort subscription addons returned in the response. Supported sort attributes are: - `id` - `created_at` (default) - `updated_at` The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order.'),
|
|
9403
9543
|
});
|
|
9404
9544
|
export const listSubscriptionAddonsResponseWire = z.strictObject({
|
|
9405
9545
|
data: z.array(subscriptionAddonWire),
|
|
@@ -9431,6 +9571,29 @@ export const getAppPathParamsWire = z.object({
|
|
|
9431
9571
|
appId: ulidWire,
|
|
9432
9572
|
});
|
|
9433
9573
|
export const getAppResponseWire = appWire;
|
|
9574
|
+
export const listAppCatalogQueryParamsWire = z.object({
|
|
9575
|
+
page: z
|
|
9576
|
+
.strictObject({
|
|
9577
|
+
size: z.coerce
|
|
9578
|
+
.number()
|
|
9579
|
+
.int()
|
|
9580
|
+
.optional()
|
|
9581
|
+
.describe('The number of items to include per page.'),
|
|
9582
|
+
number: z.coerce.number().int().optional().describe('The page number.'),
|
|
9583
|
+
})
|
|
9584
|
+
.optional()
|
|
9585
|
+
.describe('Determines which page of the collection to retrieve.'),
|
|
9586
|
+
});
|
|
9587
|
+
export const listAppCatalogResponseWire = z.strictObject({
|
|
9588
|
+
data: z.array(appCatalogItemWire),
|
|
9589
|
+
meta: paginatedMetaWire,
|
|
9590
|
+
});
|
|
9591
|
+
export const getAppCatalogItemPathParamsWire = z.object({
|
|
9592
|
+
appType: appTypeWire,
|
|
9593
|
+
});
|
|
9594
|
+
export const getAppCatalogItemResponseWire = appCatalogItemWire;
|
|
9595
|
+
export const installAppBodyWire = installAppRequestWire;
|
|
9596
|
+
export const installAppResponseWire = billingInstallAppResponseWire;
|
|
9434
9597
|
export const listBillingProfilesQueryParamsWire = z.object({
|
|
9435
9598
|
page: z
|
|
9436
9599
|
.strictObject({
|
|
@@ -9474,7 +9637,10 @@ export const listInvoicesQueryParamsWire = z.object({
|
|
|
9474
9637
|
})
|
|
9475
9638
|
.optional()
|
|
9476
9639
|
.describe('Determines which page of the collection to retrieve.'),
|
|
9477
|
-
sort:
|
|
9640
|
+
sort: z
|
|
9641
|
+
.string()
|
|
9642
|
+
.optional()
|
|
9643
|
+
.describe('Sort invoices returned in the response. Supported sort attributes: - `issued_at` - `created_at` (default) - `service_period_start` The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order.'),
|
|
9478
9644
|
filter: listInvoicesParamsFilterWire.optional(),
|
|
9479
9645
|
});
|
|
9480
9646
|
export const listInvoicesResponseWire = z.strictObject({
|
|
@@ -9556,7 +9722,10 @@ export const listCurrenciesQueryParamsWire = z.object({
|
|
|
9556
9722
|
})
|
|
9557
9723
|
.optional()
|
|
9558
9724
|
.describe('Determines which page of the collection to retrieve.'),
|
|
9559
|
-
sort:
|
|
9725
|
+
sort: z
|
|
9726
|
+
.string()
|
|
9727
|
+
.optional()
|
|
9728
|
+
.describe('Sort currencies returned in the response. Supported sort attributes are: - `code` (default) - `name` The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order.'),
|
|
9560
9729
|
filter: listCurrenciesParamsFilterWire.optional(),
|
|
9561
9730
|
});
|
|
9562
9731
|
export const listCurrenciesResponseWire = z.strictObject({
|
|
@@ -9603,7 +9772,10 @@ export const listFeaturesQueryParamsWire = z.object({
|
|
|
9603
9772
|
})
|
|
9604
9773
|
.optional()
|
|
9605
9774
|
.describe('Determines which page of the collection to retrieve.'),
|
|
9606
|
-
sort:
|
|
9775
|
+
sort: z
|
|
9776
|
+
.string()
|
|
9777
|
+
.optional()
|
|
9778
|
+
.describe('Sort features returned in the response. Supported sort attributes are: - `key` - `name` - `created_at` (default) - `updated_at` The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order.'),
|
|
9607
9779
|
filter: listFeatureParamsFilterWire.optional(),
|
|
9608
9780
|
});
|
|
9609
9781
|
export const listFeaturesResponseWire = z.strictObject({
|
|
@@ -9631,7 +9803,10 @@ export const queryFeatureCostBodyWire = meterQueryRequestWire;
|
|
|
9631
9803
|
export const queryFeatureCostResponseWire = featureCostQueryResultWire;
|
|
9632
9804
|
export const listLlmCostPricesQueryParamsWire = z.object({
|
|
9633
9805
|
filter: listLlmCostPricesParamsFilterWire.optional(),
|
|
9634
|
-
sort:
|
|
9806
|
+
sort: z
|
|
9807
|
+
.string()
|
|
9808
|
+
.optional()
|
|
9809
|
+
.describe('Sort prices returned in the response. Supported sort attributes are: - `id` - `provider.id` - `model.id` (default) - `effective_from` - `effective_to` The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order.'),
|
|
9635
9810
|
page: z
|
|
9636
9811
|
.strictObject({
|
|
9637
9812
|
size: z.coerce
|
|
@@ -9687,7 +9862,10 @@ export const listPlansQueryParamsWire = z.object({
|
|
|
9687
9862
|
})
|
|
9688
9863
|
.optional()
|
|
9689
9864
|
.describe('Determines which page of the collection to retrieve.'),
|
|
9690
|
-
sort:
|
|
9865
|
+
sort: z
|
|
9866
|
+
.string()
|
|
9867
|
+
.optional()
|
|
9868
|
+
.describe('Sort plans returned in the response. Supported sort attributes are: - `id` - `key` - `version` - `created_at` (default) - `updated_at`'),
|
|
9691
9869
|
filter: listPlansParamsFilterWire.optional(),
|
|
9692
9870
|
});
|
|
9693
9871
|
export const listPlansResponseWire = z.strictObject({
|
|
@@ -9728,7 +9906,10 @@ export const listAddonsQueryParamsWire = z.object({
|
|
|
9728
9906
|
})
|
|
9729
9907
|
.optional()
|
|
9730
9908
|
.describe('Determines which page of the collection to retrieve.'),
|
|
9731
|
-
sort:
|
|
9909
|
+
sort: z
|
|
9910
|
+
.string()
|
|
9911
|
+
.optional()
|
|
9912
|
+
.describe('Sort add-ons returned in the response. Supported sort attributes are: - `id` - `key` - `name` - `created_at` (default) - `updated_at` The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order.'),
|
|
9732
9913
|
filter: listAddonsParamsFilterWire.optional(),
|
|
9733
9914
|
});
|
|
9734
9915
|
export const listAddonsResponseWire = z.strictObject({
|