@openmeter/client 1.0.0-beta-637770bdd2e8 → 1.0.0-beta-afebc8f9a2b9
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 +8 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -0
- package/dist/lib/version.d.ts +1 -1
- package/dist/lib/version.js +1 -1
- package/dist/models/schemas.d.ts +820 -480
- package/dist/models/schemas.js +194 -12
- package/dist/models/types.d.ts +125 -5
- package/dist/sdk/apps.d.ts +2 -44
- package/dist/sdk/apps.js +1 -53
- package/dist/sdk/internal.d.ts +2 -28
- package/dist/sdk/internal.js +1 -33
- package/dist/sdk/invoices.d.ts +112 -0
- package/dist/sdk/invoices.js +115 -0
- package/dist/sdk/sdk.d.ts +3 -0
- package/dist/sdk/sdk.js +5 -0
- package/package.json +1 -1
package/dist/models/schemas.js
CHANGED
|
@@ -3544,6 +3544,96 @@ export const appCatalogItemPagePaginatedResponse = z
|
|
|
3544
3544
|
meta: paginatedMeta,
|
|
3545
3545
|
})
|
|
3546
3546
|
.describe('Page paginated response.');
|
|
3547
|
+
export const installedAppStripe = z
|
|
3548
|
+
.object({
|
|
3549
|
+
id: ulid,
|
|
3550
|
+
name: z
|
|
3551
|
+
.string()
|
|
3552
|
+
.min(1)
|
|
3553
|
+
.max(256)
|
|
3554
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
3555
|
+
description: z
|
|
3556
|
+
.string()
|
|
3557
|
+
.max(1024)
|
|
3558
|
+
.optional()
|
|
3559
|
+
.describe('Optional description of the resource. Maximum 1024 characters.'),
|
|
3560
|
+
labels: labels.optional(),
|
|
3561
|
+
createdAt: dateTime,
|
|
3562
|
+
updatedAt: dateTime,
|
|
3563
|
+
deletedAt: dateTime.optional(),
|
|
3564
|
+
type: z.literal('stripe').describe('The app type.'),
|
|
3565
|
+
definition: appCatalogItem,
|
|
3566
|
+
status: appStatus,
|
|
3567
|
+
accountId: z
|
|
3568
|
+
.string()
|
|
3569
|
+
.describe('The Stripe account ID associated with the connected Stripe account.'),
|
|
3570
|
+
livemode: z
|
|
3571
|
+
.boolean()
|
|
3572
|
+
.describe('Indicates whether the app is connected to a live Stripe account.'),
|
|
3573
|
+
maskedApiKey: z
|
|
3574
|
+
.string()
|
|
3575
|
+
.describe('The masked Stripe API key that only exposes the first and last few characters.'),
|
|
3576
|
+
defaultForCapabilityTypes: z
|
|
3577
|
+
.array(appCapabilityType)
|
|
3578
|
+
.describe('Default capabilities of the installed app.'),
|
|
3579
|
+
})
|
|
3580
|
+
.describe('Response of an installed app.');
|
|
3581
|
+
export const installedAppSandbox = z
|
|
3582
|
+
.object({
|
|
3583
|
+
id: ulid,
|
|
3584
|
+
name: z
|
|
3585
|
+
.string()
|
|
3586
|
+
.min(1)
|
|
3587
|
+
.max(256)
|
|
3588
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
3589
|
+
description: z
|
|
3590
|
+
.string()
|
|
3591
|
+
.max(1024)
|
|
3592
|
+
.optional()
|
|
3593
|
+
.describe('Optional description of the resource. Maximum 1024 characters.'),
|
|
3594
|
+
labels: labels.optional(),
|
|
3595
|
+
createdAt: dateTime,
|
|
3596
|
+
updatedAt: dateTime,
|
|
3597
|
+
deletedAt: dateTime.optional(),
|
|
3598
|
+
type: z.literal('sandbox').describe('The app type.'),
|
|
3599
|
+
definition: appCatalogItem,
|
|
3600
|
+
status: appStatus,
|
|
3601
|
+
defaultForCapabilityTypes: z
|
|
3602
|
+
.array(appCapabilityType)
|
|
3603
|
+
.describe('Default capabilities of the installed app.'),
|
|
3604
|
+
})
|
|
3605
|
+
.describe('Response of an installed app.');
|
|
3606
|
+
export const installedAppExternalInvoicing = z
|
|
3607
|
+
.object({
|
|
3608
|
+
id: ulid,
|
|
3609
|
+
name: z
|
|
3610
|
+
.string()
|
|
3611
|
+
.min(1)
|
|
3612
|
+
.max(256)
|
|
3613
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
3614
|
+
description: z
|
|
3615
|
+
.string()
|
|
3616
|
+
.max(1024)
|
|
3617
|
+
.optional()
|
|
3618
|
+
.describe('Optional description of the resource. Maximum 1024 characters.'),
|
|
3619
|
+
labels: labels.optional(),
|
|
3620
|
+
createdAt: dateTime,
|
|
3621
|
+
updatedAt: dateTime,
|
|
3622
|
+
deletedAt: dateTime.optional(),
|
|
3623
|
+
type: z.literal('external_invoicing').describe('The app type.'),
|
|
3624
|
+
definition: appCatalogItem,
|
|
3625
|
+
status: appStatus,
|
|
3626
|
+
enableDraftSyncHook: z
|
|
3627
|
+
.boolean()
|
|
3628
|
+
.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.'),
|
|
3629
|
+
enableIssuingSyncHook: z
|
|
3630
|
+
.boolean()
|
|
3631
|
+
.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.'),
|
|
3632
|
+
defaultForCapabilityTypes: z
|
|
3633
|
+
.array(appCapabilityType)
|
|
3634
|
+
.describe('Default capabilities of the installed app.'),
|
|
3635
|
+
})
|
|
3636
|
+
.describe('Response of an installed app.');
|
|
3547
3637
|
export const invoiceWorkflowSettings = z
|
|
3548
3638
|
.object({
|
|
3549
3639
|
apps: invoiceWorkflowAppsReferences.optional(),
|
|
@@ -3729,6 +3819,13 @@ export const workflowCollectionSettings = z
|
|
|
3729
3819
|
export const app = z
|
|
3730
3820
|
.discriminatedUnion('type', [appStripe, appSandbox, appExternalInvoicing])
|
|
3731
3821
|
.describe('Installed application.');
|
|
3822
|
+
export const billingInstallAppResponse = z
|
|
3823
|
+
.discriminatedUnion('type', [
|
|
3824
|
+
installedAppStripe,
|
|
3825
|
+
installedAppSandbox,
|
|
3826
|
+
installedAppExternalInvoicing,
|
|
3827
|
+
])
|
|
3828
|
+
.describe('Response of the app install.');
|
|
3732
3829
|
export const entitlementAccessQueryResponse = z
|
|
3733
3830
|
.object({
|
|
3734
3831
|
data: z
|
|
@@ -3907,12 +4004,6 @@ export const appPagePaginatedResponse = z
|
|
|
3907
4004
|
meta: paginatedMeta,
|
|
3908
4005
|
})
|
|
3909
4006
|
.describe('Page paginated response.');
|
|
3910
|
-
export const billingInstallAppResponse = z
|
|
3911
|
-
.object({
|
|
3912
|
-
app: app,
|
|
3913
|
-
defaultForCapabilityTypes: z.array(appCapabilityType),
|
|
3914
|
-
})
|
|
3915
|
-
.describe('Response of the app install.');
|
|
3916
4007
|
export const profileApps = z
|
|
3917
4008
|
.object({
|
|
3918
4009
|
tax: app,
|
|
@@ -8743,6 +8834,96 @@ export const appCatalogItemPagePaginatedResponseWire = z
|
|
|
8743
8834
|
meta: paginatedMetaWire,
|
|
8744
8835
|
})
|
|
8745
8836
|
.describe('Page paginated response.');
|
|
8837
|
+
export const installedAppStripeWire = z
|
|
8838
|
+
.strictObject({
|
|
8839
|
+
id: ulidWire,
|
|
8840
|
+
name: z
|
|
8841
|
+
.string()
|
|
8842
|
+
.min(1)
|
|
8843
|
+
.max(256)
|
|
8844
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
8845
|
+
description: z
|
|
8846
|
+
.string()
|
|
8847
|
+
.max(1024)
|
|
8848
|
+
.optional()
|
|
8849
|
+
.describe('Optional description of the resource. Maximum 1024 characters.'),
|
|
8850
|
+
labels: labelsWire.optional(),
|
|
8851
|
+
created_at: dateTimeWire,
|
|
8852
|
+
updated_at: dateTimeWire,
|
|
8853
|
+
deleted_at: dateTimeWire.optional(),
|
|
8854
|
+
type: z.literal('stripe').describe('The app type.'),
|
|
8855
|
+
definition: appCatalogItemWire,
|
|
8856
|
+
status: appStatusWire,
|
|
8857
|
+
account_id: z
|
|
8858
|
+
.string()
|
|
8859
|
+
.describe('The Stripe account ID associated with the connected Stripe account.'),
|
|
8860
|
+
livemode: z
|
|
8861
|
+
.boolean()
|
|
8862
|
+
.describe('Indicates whether the app is connected to a live Stripe account.'),
|
|
8863
|
+
masked_api_key: z
|
|
8864
|
+
.string()
|
|
8865
|
+
.describe('The masked Stripe API key that only exposes the first and last few characters.'),
|
|
8866
|
+
default_for_capability_types: z
|
|
8867
|
+
.array(appCapabilityTypeWire)
|
|
8868
|
+
.describe('Default capabilities of the installed app.'),
|
|
8869
|
+
})
|
|
8870
|
+
.describe('Response of an installed app.');
|
|
8871
|
+
export const installedAppSandboxWire = z
|
|
8872
|
+
.strictObject({
|
|
8873
|
+
id: ulidWire,
|
|
8874
|
+
name: z
|
|
8875
|
+
.string()
|
|
8876
|
+
.min(1)
|
|
8877
|
+
.max(256)
|
|
8878
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
8879
|
+
description: z
|
|
8880
|
+
.string()
|
|
8881
|
+
.max(1024)
|
|
8882
|
+
.optional()
|
|
8883
|
+
.describe('Optional description of the resource. Maximum 1024 characters.'),
|
|
8884
|
+
labels: labelsWire.optional(),
|
|
8885
|
+
created_at: dateTimeWire,
|
|
8886
|
+
updated_at: dateTimeWire,
|
|
8887
|
+
deleted_at: dateTimeWire.optional(),
|
|
8888
|
+
type: z.literal('sandbox').describe('The app type.'),
|
|
8889
|
+
definition: appCatalogItemWire,
|
|
8890
|
+
status: appStatusWire,
|
|
8891
|
+
default_for_capability_types: z
|
|
8892
|
+
.array(appCapabilityTypeWire)
|
|
8893
|
+
.describe('Default capabilities of the installed app.'),
|
|
8894
|
+
})
|
|
8895
|
+
.describe('Response of an installed app.');
|
|
8896
|
+
export const installedAppExternalInvoicingWire = z
|
|
8897
|
+
.strictObject({
|
|
8898
|
+
id: ulidWire,
|
|
8899
|
+
name: z
|
|
8900
|
+
.string()
|
|
8901
|
+
.min(1)
|
|
8902
|
+
.max(256)
|
|
8903
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
8904
|
+
description: z
|
|
8905
|
+
.string()
|
|
8906
|
+
.max(1024)
|
|
8907
|
+
.optional()
|
|
8908
|
+
.describe('Optional description of the resource. Maximum 1024 characters.'),
|
|
8909
|
+
labels: labelsWire.optional(),
|
|
8910
|
+
created_at: dateTimeWire,
|
|
8911
|
+
updated_at: dateTimeWire,
|
|
8912
|
+
deleted_at: dateTimeWire.optional(),
|
|
8913
|
+
type: z.literal('external_invoicing').describe('The app type.'),
|
|
8914
|
+
definition: appCatalogItemWire,
|
|
8915
|
+
status: appStatusWire,
|
|
8916
|
+
enable_draft_sync_hook: z
|
|
8917
|
+
.boolean()
|
|
8918
|
+
.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.'),
|
|
8919
|
+
enable_issuing_sync_hook: z
|
|
8920
|
+
.boolean()
|
|
8921
|
+
.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.'),
|
|
8922
|
+
default_for_capability_types: z
|
|
8923
|
+
.array(appCapabilityTypeWire)
|
|
8924
|
+
.describe('Default capabilities of the installed app.'),
|
|
8925
|
+
})
|
|
8926
|
+
.describe('Response of an installed app.');
|
|
8746
8927
|
export const invoiceWorkflowSettingsWire = z
|
|
8747
8928
|
.strictObject({
|
|
8748
8929
|
apps: invoiceWorkflowAppsReferencesWire.optional(),
|
|
@@ -8933,6 +9114,13 @@ export const appWire = z
|
|
|
8933
9114
|
appExternalInvoicingWire,
|
|
8934
9115
|
])
|
|
8935
9116
|
.describe('Installed application.');
|
|
9117
|
+
export const billingInstallAppResponseWire = z
|
|
9118
|
+
.discriminatedUnion('type', [
|
|
9119
|
+
installedAppStripeWire,
|
|
9120
|
+
installedAppSandboxWire,
|
|
9121
|
+
installedAppExternalInvoicingWire,
|
|
9122
|
+
])
|
|
9123
|
+
.describe('Response of the app install.');
|
|
8936
9124
|
export const entitlementAccessQueryResponseWire = z
|
|
8937
9125
|
.strictObject({
|
|
8938
9126
|
data: z
|
|
@@ -9111,12 +9299,6 @@ export const appPagePaginatedResponseWire = z
|
|
|
9111
9299
|
meta: paginatedMetaWire,
|
|
9112
9300
|
})
|
|
9113
9301
|
.describe('Page paginated response.');
|
|
9114
|
-
export const billingInstallAppResponseWire = z
|
|
9115
|
-
.strictObject({
|
|
9116
|
-
app: appWire,
|
|
9117
|
-
default_for_capability_types: z.array(appCapabilityTypeWire),
|
|
9118
|
-
})
|
|
9119
|
-
.describe('Response of the app install.');
|
|
9120
9302
|
export const profileAppsWire = z
|
|
9121
9303
|
.strictObject({
|
|
9122
9304
|
tax: appWire,
|
package/dist/models/types.d.ts
CHANGED
|
@@ -3801,6 +3801,129 @@ export interface AppCatalogItemPagePaginatedResponse {
|
|
|
3801
3801
|
data: AppCatalogItem[];
|
|
3802
3802
|
meta: PaginatedMeta;
|
|
3803
3803
|
}
|
|
3804
|
+
/** Response of an installed app. */
|
|
3805
|
+
export interface InstalledAppStripe {
|
|
3806
|
+
id: string;
|
|
3807
|
+
/**
|
|
3808
|
+
* Display name of the resource.
|
|
3809
|
+
*
|
|
3810
|
+
* Between 1 and 256 characters.
|
|
3811
|
+
*/
|
|
3812
|
+
name: string;
|
|
3813
|
+
/**
|
|
3814
|
+
* Optional description of the resource.
|
|
3815
|
+
*
|
|
3816
|
+
* Maximum 1024 characters.
|
|
3817
|
+
*/
|
|
3818
|
+
description?: string;
|
|
3819
|
+
labels?: Labels;
|
|
3820
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
3821
|
+
createdAt: Date;
|
|
3822
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
3823
|
+
updatedAt: Date;
|
|
3824
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
3825
|
+
deletedAt?: Date;
|
|
3826
|
+
/** The app type. */
|
|
3827
|
+
type: 'stripe';
|
|
3828
|
+
/** The app catalog definition that this installed app is based on. */
|
|
3829
|
+
definition: AppCatalogItem;
|
|
3830
|
+
/** Status of the app connection. */
|
|
3831
|
+
status: 'ready' | 'unauthorized';
|
|
3832
|
+
/** The Stripe account ID associated with the connected Stripe account. */
|
|
3833
|
+
accountId: string;
|
|
3834
|
+
/** Indicates whether the app is connected to a live Stripe account. */
|
|
3835
|
+
livemode: boolean;
|
|
3836
|
+
/** The masked Stripe API key that only exposes the first and last few characters. */
|
|
3837
|
+
maskedApiKey: string;
|
|
3838
|
+
/** Default capabilities of the installed app. */
|
|
3839
|
+
defaultForCapabilityTypes: ('report_usage' | 'report_events' | 'calculate_tax' | 'invoice_customers' | 'collect_payments')[];
|
|
3840
|
+
}
|
|
3841
|
+
/** Response of an installed app. */
|
|
3842
|
+
export interface InstalledAppSandbox {
|
|
3843
|
+
id: string;
|
|
3844
|
+
/**
|
|
3845
|
+
* Display name of the resource.
|
|
3846
|
+
*
|
|
3847
|
+
* Between 1 and 256 characters.
|
|
3848
|
+
*/
|
|
3849
|
+
name: string;
|
|
3850
|
+
/**
|
|
3851
|
+
* Optional description of the resource.
|
|
3852
|
+
*
|
|
3853
|
+
* Maximum 1024 characters.
|
|
3854
|
+
*/
|
|
3855
|
+
description?: string;
|
|
3856
|
+
labels?: Labels;
|
|
3857
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
3858
|
+
createdAt: Date;
|
|
3859
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
3860
|
+
updatedAt: Date;
|
|
3861
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
3862
|
+
deletedAt?: Date;
|
|
3863
|
+
/** The app type. */
|
|
3864
|
+
type: 'sandbox';
|
|
3865
|
+
/** The app catalog definition that this installed app is based on. */
|
|
3866
|
+
definition: AppCatalogItem;
|
|
3867
|
+
/** Status of the app connection. */
|
|
3868
|
+
status: 'ready' | 'unauthorized';
|
|
3869
|
+
/** Default capabilities of the installed app. */
|
|
3870
|
+
defaultForCapabilityTypes: ('report_usage' | 'report_events' | 'calculate_tax' | 'invoice_customers' | 'collect_payments')[];
|
|
3871
|
+
}
|
|
3872
|
+
/** Response of an installed app. */
|
|
3873
|
+
export interface InstalledAppExternalInvoicing {
|
|
3874
|
+
id: string;
|
|
3875
|
+
/**
|
|
3876
|
+
* Display name of the resource.
|
|
3877
|
+
*
|
|
3878
|
+
* Between 1 and 256 characters.
|
|
3879
|
+
*/
|
|
3880
|
+
name: string;
|
|
3881
|
+
/**
|
|
3882
|
+
* Optional description of the resource.
|
|
3883
|
+
*
|
|
3884
|
+
* Maximum 1024 characters.
|
|
3885
|
+
*/
|
|
3886
|
+
description?: string;
|
|
3887
|
+
labels?: Labels;
|
|
3888
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
3889
|
+
createdAt: Date;
|
|
3890
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
3891
|
+
updatedAt: Date;
|
|
3892
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
3893
|
+
deletedAt?: Date;
|
|
3894
|
+
/** The app type. */
|
|
3895
|
+
type: 'external_invoicing';
|
|
3896
|
+
/** The app catalog definition that this installed app is based on. */
|
|
3897
|
+
definition: AppCatalogItem;
|
|
3898
|
+
/** Status of the app connection. */
|
|
3899
|
+
status: 'ready' | 'unauthorized';
|
|
3900
|
+
/**
|
|
3901
|
+
* Enable draft synchronization hook.
|
|
3902
|
+
*
|
|
3903
|
+
* When enabled, invoices will pause at the draft state and wait for the
|
|
3904
|
+
* integration to call the draft synchronized endpoint before progressing to the
|
|
3905
|
+
* issuing state. This allows the external system to validate and prepare the
|
|
3906
|
+
* invoice data.
|
|
3907
|
+
*
|
|
3908
|
+
* When disabled, invoices automatically progress through the draft state based on
|
|
3909
|
+
* the configured workflow timing.
|
|
3910
|
+
*/
|
|
3911
|
+
enableDraftSyncHook: boolean;
|
|
3912
|
+
/**
|
|
3913
|
+
* Enable issuing synchronization hook.
|
|
3914
|
+
*
|
|
3915
|
+
* When enabled, invoices will pause at the issuing state and wait for the
|
|
3916
|
+
* integration to call the issuing synchronized endpoint before progressing to the
|
|
3917
|
+
* issued state. This ensures the external invoicing system has successfully
|
|
3918
|
+
* created and finalized the invoice before it is marked as issued.
|
|
3919
|
+
*
|
|
3920
|
+
* When disabled, invoices automatically progress through the issuing state and are
|
|
3921
|
+
* immediately marked as issued.
|
|
3922
|
+
*/
|
|
3923
|
+
enableIssuingSyncHook: boolean;
|
|
3924
|
+
/** Default capabilities of the installed app. */
|
|
3925
|
+
defaultForCapabilityTypes: ('report_usage' | 'report_events' | 'calculate_tax' | 'invoice_customers' | 'collect_payments')[];
|
|
3926
|
+
}
|
|
3804
3927
|
/** Snapshot of the billing workflow configuration captured at invoice creation. */
|
|
3805
3928
|
export interface InvoiceWorkflowSettings {
|
|
3806
3929
|
/** The apps that will be used to orchestrate the invoice's workflow. */
|
|
@@ -4350,11 +4473,6 @@ export interface AppPagePaginatedResponse {
|
|
|
4350
4473
|
data: App[];
|
|
4351
4474
|
meta: PaginatedMeta;
|
|
4352
4475
|
}
|
|
4353
|
-
/** Response of the app install. */
|
|
4354
|
-
export interface BillingInstallAppResponse {
|
|
4355
|
-
app: App;
|
|
4356
|
-
defaultForCapabilityTypes: ('report_usage' | 'report_events' | 'calculate_tax' | 'invoice_customers' | 'collect_payments')[];
|
|
4357
|
-
}
|
|
4358
4476
|
/** Applications used by a billing profile. */
|
|
4359
4477
|
export interface ProfileApps {
|
|
4360
4478
|
/** The tax app used for this workflow. */
|
|
@@ -5361,6 +5479,8 @@ export type Price = PriceFree | PriceFlat | PriceUnit | PriceGraduated | PriceVo
|
|
|
5361
5479
|
export type UpdatePrice = UpdatePriceFree | UpdatePriceFlat | UpdatePriceUnit | UpdatePriceGraduated | UpdatePriceVolume;
|
|
5362
5480
|
/** Installed application. */
|
|
5363
5481
|
export type App = AppStripe | AppSandbox | AppExternalInvoicing;
|
|
5482
|
+
/** Response of the app install. */
|
|
5483
|
+
export type BillingInstallAppResponse = InstalledAppStripe | InstalledAppSandbox | InstalledAppExternalInvoicing;
|
|
5364
5484
|
/** Customer charge. */
|
|
5365
5485
|
export type CreateChargeRequest = CreateChargeFlatFeeRequest | CreateChargeUsageBasedRequest;
|
|
5366
5486
|
/** Customer charge. */
|
package/dist/sdk/apps.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type RequestOptions } from '../lib/types.js';
|
|
3
|
-
import type { ListAppsRequest, ListAppsResponse, GetAppRequest, GetAppResponse
|
|
4
|
-
import type { App
|
|
3
|
+
import type { ListAppsRequest, ListAppsResponse, GetAppRequest, GetAppResponse } from '../models/operations/apps.js';
|
|
4
|
+
import type { App } from '../models/types.js';
|
|
5
5
|
export declare class Apps {
|
|
6
6
|
private readonly _client;
|
|
7
7
|
constructor(_client: Client);
|
|
@@ -31,46 +31,4 @@ export declare class Apps {
|
|
|
31
31
|
* GET /openmeter/apps/{appId}
|
|
32
32
|
*/
|
|
33
33
|
get(request: GetAppRequest, options?: RequestOptions): Promise<GetAppResponse>;
|
|
34
|
-
/**
|
|
35
|
-
* Uninstall app
|
|
36
|
-
*
|
|
37
|
-
* Uninstall an app by ID.
|
|
38
|
-
*
|
|
39
|
-
* DELETE /openmeter/apps/{appId}
|
|
40
|
-
*/
|
|
41
|
-
uninstall(request: UninstallAppRequest, options?: RequestOptions): Promise<UninstallAppResponse>;
|
|
42
|
-
/**
|
|
43
|
-
* List app catalog
|
|
44
|
-
*
|
|
45
|
-
* List available apps.
|
|
46
|
-
*
|
|
47
|
-
* GET /openmeter/app-catalog
|
|
48
|
-
*/
|
|
49
|
-
listCatalog(request?: ListAppCatalogRequest, options?: RequestOptions): Promise<ListAppCatalogResponse>;
|
|
50
|
-
/**
|
|
51
|
-
* List app catalog
|
|
52
|
-
*
|
|
53
|
-
* List available apps.
|
|
54
|
-
*
|
|
55
|
-
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
56
|
-
*
|
|
57
|
-
* GET /openmeter/app-catalog
|
|
58
|
-
*/
|
|
59
|
-
listCatalogAll(request?: ListAppCatalogRequest, options?: RequestOptions): AsyncIterable<AppCatalogItem>;
|
|
60
|
-
/**
|
|
61
|
-
* Get app catalog item by type
|
|
62
|
-
*
|
|
63
|
-
* Get an app catalog item by type.
|
|
64
|
-
*
|
|
65
|
-
* GET /openmeter/app-catalog/{appType}
|
|
66
|
-
*/
|
|
67
|
-
getCatalogItem(request: GetAppCatalogItemRequest, options?: RequestOptions): Promise<GetAppCatalogItemResponse>;
|
|
68
|
-
/**
|
|
69
|
-
* Install app from the catalog
|
|
70
|
-
*
|
|
71
|
-
* Install an app from the catalog.
|
|
72
|
-
*
|
|
73
|
-
* POST /openmeter/app-catalog/install
|
|
74
|
-
*/
|
|
75
|
-
install(request: InstallAppRequest, options?: RequestOptions): Promise<InstallAppResponse>;
|
|
76
34
|
}
|
package/dist/sdk/apps.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
|
|
2
2
|
import { unwrap } from '../lib/types.js';
|
|
3
3
|
import { paginatePages } from '../lib/paginate.js';
|
|
4
|
-
import { listApps, getApp
|
|
4
|
+
import { listApps, getApp } from '../funcs/apps.js';
|
|
5
5
|
export class Apps {
|
|
6
6
|
_client;
|
|
7
7
|
constructor(_client) {
|
|
@@ -39,56 +39,4 @@ export class Apps {
|
|
|
39
39
|
async get(request, options) {
|
|
40
40
|
return unwrap(await getApp(this._client, request, options));
|
|
41
41
|
}
|
|
42
|
-
/**
|
|
43
|
-
* Uninstall app
|
|
44
|
-
*
|
|
45
|
-
* Uninstall an app by ID.
|
|
46
|
-
*
|
|
47
|
-
* DELETE /openmeter/apps/{appId}
|
|
48
|
-
*/
|
|
49
|
-
async uninstall(request, options) {
|
|
50
|
-
return unwrap(await uninstallApp(this._client, request, options));
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* List app catalog
|
|
54
|
-
*
|
|
55
|
-
* List available apps.
|
|
56
|
-
*
|
|
57
|
-
* GET /openmeter/app-catalog
|
|
58
|
-
*/
|
|
59
|
-
async listCatalog(request, options) {
|
|
60
|
-
return unwrap(await listAppCatalog(this._client, request, options));
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* List app catalog
|
|
64
|
-
*
|
|
65
|
-
* List available apps.
|
|
66
|
-
*
|
|
67
|
-
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
68
|
-
*
|
|
69
|
-
* GET /openmeter/app-catalog
|
|
70
|
-
*/
|
|
71
|
-
listCatalogAll(request, options) {
|
|
72
|
-
return paginatePages((req, opts) => listAppCatalog(this._client, req, opts), request ?? {}, options);
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Get app catalog item by type
|
|
76
|
-
*
|
|
77
|
-
* Get an app catalog item by type.
|
|
78
|
-
*
|
|
79
|
-
* GET /openmeter/app-catalog/{appType}
|
|
80
|
-
*/
|
|
81
|
-
async getCatalogItem(request, options) {
|
|
82
|
-
return unwrap(await getAppCatalogItem(this._client, request, options));
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Install app from the catalog
|
|
86
|
-
*
|
|
87
|
-
* Install an app from the catalog.
|
|
88
|
-
*
|
|
89
|
-
* POST /openmeter/app-catalog/install
|
|
90
|
-
*/
|
|
91
|
-
async install(request, options) {
|
|
92
|
-
return unwrap(await installApp(this._client, request, options));
|
|
93
|
-
}
|
|
94
42
|
}
|
package/dist/sdk/internal.d.ts
CHANGED
|
@@ -2,12 +2,12 @@ import { type Client } from '../core.js';
|
|
|
2
2
|
import { type RequestOptions } from '../lib/types.js';
|
|
3
3
|
import type { VoidCreditGrantRequest, VoidCreditGrantResponse } from '../models/operations/customers.js';
|
|
4
4
|
import type { CreateSubscriptionAddonRequest, CreateSubscriptionAddonResponse } from '../models/operations/subscriptions.js';
|
|
5
|
-
import type {
|
|
5
|
+
import type { UninstallAppRequest, UninstallAppResponse, UpdateAppRequest, UpdateAppResponse, ListAppCatalogRequest, ListAppCatalogResponse, GetAppCatalogItemRequest, GetAppCatalogItemResponse, InstallAppRequest, InstallAppResponse } from '../models/operations/apps.js';
|
|
6
6
|
import type { ListInvoicesRequest, ListInvoicesResponse, GetInvoiceRequest, GetInvoiceResponse, UpdateInvoiceRequest, UpdateInvoiceResponse, DeleteInvoiceRequest, DeleteInvoiceResponse, AdvanceInvoiceRequest, AdvanceInvoiceResponse, ApproveInvoiceRequest, ApproveInvoiceResponse, RetryInvoiceRequest, RetryInvoiceResponse, SnapshotQuantitiesInvoiceRequest, SnapshotQuantitiesInvoiceResponse } from '../models/operations/invoices.js';
|
|
7
7
|
import type { ListCurrenciesRequest, ListCurrenciesResponse, CreateCustomCurrencyRequest, CreateCustomCurrencyResponse, GetCustomCurrencyRequest, GetCustomCurrencyResponse, ListCostBasesRequest, ListCostBasesResponse, CreateCostBasisRequest, CreateCostBasisResponse } from '../models/operations/currencies.js';
|
|
8
8
|
import type { ListPlanAddonsRequest, ListPlanAddonsResponse } from '../models/operations/planAddons.js';
|
|
9
9
|
import type { QueryEntitlementAccessRequest, QueryEntitlementAccessResponse } from '../models/operations/entitlementAccess.js';
|
|
10
|
-
import type {
|
|
10
|
+
import type { AppCatalogItem, CostBasis, Currency, Invoice, PlanAddon } from '../models/types.js';
|
|
11
11
|
/**
|
|
12
12
|
* Operations marked internal in the API definition. They are not part of
|
|
13
13
|
* the customer surface: they may require additional permissions, and they
|
|
@@ -78,32 +78,6 @@ export declare class InternalSubscriptions {
|
|
|
78
78
|
export declare class InternalApps {
|
|
79
79
|
private readonly _client;
|
|
80
80
|
constructor(_client: Client);
|
|
81
|
-
/**
|
|
82
|
-
* List apps
|
|
83
|
-
*
|
|
84
|
-
* List installed apps.
|
|
85
|
-
*
|
|
86
|
-
* GET /openmeter/apps
|
|
87
|
-
*/
|
|
88
|
-
list(request?: ListAppsRequest, options?: RequestOptions): Promise<ListAppsResponse>;
|
|
89
|
-
/**
|
|
90
|
-
* List apps
|
|
91
|
-
*
|
|
92
|
-
* List installed apps.
|
|
93
|
-
*
|
|
94
|
-
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
95
|
-
*
|
|
96
|
-
* GET /openmeter/apps
|
|
97
|
-
*/
|
|
98
|
-
listAll(request?: ListAppsRequest, options?: RequestOptions): AsyncIterable<App>;
|
|
99
|
-
/**
|
|
100
|
-
* Get app
|
|
101
|
-
*
|
|
102
|
-
* Get an installed app.
|
|
103
|
-
*
|
|
104
|
-
* GET /openmeter/apps/{appId}
|
|
105
|
-
*/
|
|
106
|
-
get(request: GetAppRequest, options?: RequestOptions): Promise<GetAppResponse>;
|
|
107
81
|
/**
|
|
108
82
|
* Uninstall app
|
|
109
83
|
*
|
package/dist/sdk/internal.js
CHANGED
|
@@ -3,7 +3,7 @@ import { unwrap } from '../lib/types.js';
|
|
|
3
3
|
import { paginatePages } from '../lib/paginate.js';
|
|
4
4
|
import { voidCreditGrant } from '../funcs/customers.js';
|
|
5
5
|
import { createSubscriptionAddon } from '../funcs/subscriptions.js';
|
|
6
|
-
import {
|
|
6
|
+
import { uninstallApp, updateApp, listAppCatalog, getAppCatalogItem, installApp, } from '../funcs/apps.js';
|
|
7
7
|
import { listInvoices, getInvoice, updateInvoice, deleteInvoice, advanceInvoice, approveInvoice, retryInvoice, snapshotQuantitiesInvoice, } from '../funcs/invoices.js';
|
|
8
8
|
import { listCurrencies, createCustomCurrency, getCustomCurrency, listCostBases, createCostBasis, } from '../funcs/currencies.js';
|
|
9
9
|
import { listPlanAddons } from '../funcs/planAddons.js';
|
|
@@ -112,38 +112,6 @@ export class InternalApps {
|
|
|
112
112
|
constructor(_client) {
|
|
113
113
|
this._client = _client;
|
|
114
114
|
}
|
|
115
|
-
/**
|
|
116
|
-
* List apps
|
|
117
|
-
*
|
|
118
|
-
* List installed apps.
|
|
119
|
-
*
|
|
120
|
-
* GET /openmeter/apps
|
|
121
|
-
*/
|
|
122
|
-
async list(request, options) {
|
|
123
|
-
return unwrap(await listApps(this._client, request, options));
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* List apps
|
|
127
|
-
*
|
|
128
|
-
* List installed apps.
|
|
129
|
-
*
|
|
130
|
-
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
131
|
-
*
|
|
132
|
-
* GET /openmeter/apps
|
|
133
|
-
*/
|
|
134
|
-
listAll(request, options) {
|
|
135
|
-
return paginatePages((req, opts) => listApps(this._client, req, opts), request ?? {}, options);
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Get app
|
|
139
|
-
*
|
|
140
|
-
* Get an installed app.
|
|
141
|
-
*
|
|
142
|
-
* GET /openmeter/apps/{appId}
|
|
143
|
-
*/
|
|
144
|
-
async get(request, options) {
|
|
145
|
-
return unwrap(await getApp(this._client, request, options));
|
|
146
|
-
}
|
|
147
115
|
/**
|
|
148
116
|
* Uninstall app
|
|
149
117
|
*
|