@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/types.d.ts
CHANGED
|
@@ -43,11 +43,11 @@ export interface CursorMetaPage {
|
|
|
43
43
|
/** URI to the last page. */
|
|
44
44
|
last?: string;
|
|
45
45
|
/** URI to the next page. */
|
|
46
|
-
next
|
|
46
|
+
next: string | null;
|
|
47
47
|
/** URI to the previous page. */
|
|
48
|
-
previous
|
|
48
|
+
previous: string | null;
|
|
49
49
|
/** Requested page size. */
|
|
50
|
-
size
|
|
50
|
+
size: number;
|
|
51
51
|
}
|
|
52
52
|
/** Standard error response. */
|
|
53
53
|
export interface BaseError {
|
|
@@ -188,6 +188,44 @@ export interface RateCardBooleanEntitlement {
|
|
|
188
188
|
/** The type of the entitlement template. */
|
|
189
189
|
type: 'boolean';
|
|
190
190
|
}
|
|
191
|
+
/** Model for installing an app from the catalog with an API key. */
|
|
192
|
+
export interface InstallAppStripeWithApiKey {
|
|
193
|
+
/** Type of the app. */
|
|
194
|
+
type: 'stripe';
|
|
195
|
+
/** Name of the app. */
|
|
196
|
+
name: string;
|
|
197
|
+
/**
|
|
198
|
+
* If true, a billing profile will be created for the app. The Stripe app will be
|
|
199
|
+
* also set as the default billing profile if the current default is a Sandbox app.
|
|
200
|
+
*/
|
|
201
|
+
createBillingProfile: boolean;
|
|
202
|
+
/** API key for the app. */
|
|
203
|
+
apiKey: string;
|
|
204
|
+
}
|
|
205
|
+
/** Base model for installing an app from the catalog. */
|
|
206
|
+
export interface InstallAppSandbox {
|
|
207
|
+
/** Type of the app. */
|
|
208
|
+
type: 'sandbox';
|
|
209
|
+
/** Name of the app. */
|
|
210
|
+
name: string;
|
|
211
|
+
/**
|
|
212
|
+
* If true, a billing profile will be created for the app. The Stripe app will be
|
|
213
|
+
* also set as the default billing profile if the current default is a Sandbox app.
|
|
214
|
+
*/
|
|
215
|
+
createBillingProfile: boolean;
|
|
216
|
+
}
|
|
217
|
+
/** Base model for installing an app from the catalog. */
|
|
218
|
+
export interface InstallAppExternalInvoicing {
|
|
219
|
+
/** Type of the app. */
|
|
220
|
+
type: 'external_invoicing';
|
|
221
|
+
/** Name of the app. */
|
|
222
|
+
name: string;
|
|
223
|
+
/**
|
|
224
|
+
* If true, a billing profile will be created for the app. The Stripe app will be
|
|
225
|
+
* also set as the default billing profile if the current default is a Sandbox app.
|
|
226
|
+
*/
|
|
227
|
+
createBillingProfile: boolean;
|
|
228
|
+
}
|
|
191
229
|
/**
|
|
192
230
|
* BillingWorkflowCollectionAlignmentSubscription specifies the alignment for
|
|
193
231
|
* collecting the pending line items into an invoice.
|
|
@@ -1781,20 +1819,6 @@ export interface UnitConfig {
|
|
|
1781
1819
|
*/
|
|
1782
1820
|
displayUnit?: string;
|
|
1783
1821
|
}
|
|
1784
|
-
/**
|
|
1785
|
-
* Available apps for billing integrations to connect with third-party services.
|
|
1786
|
-
* Apps can have various capabilities like syncing data from or to external
|
|
1787
|
-
* systems, integrating with third-party services for tax calculation, delivery of
|
|
1788
|
-
* invoices, collection of payments, etc.
|
|
1789
|
-
*/
|
|
1790
|
-
export interface AppCatalogItem {
|
|
1791
|
-
/** Type of the app. */
|
|
1792
|
-
type: 'sandbox' | 'stripe' | 'external_invoicing';
|
|
1793
|
-
/** Name of the app. */
|
|
1794
|
-
name: string;
|
|
1795
|
-
/** Description of the app. */
|
|
1796
|
-
description: string;
|
|
1797
|
-
}
|
|
1798
1822
|
/** Mapping of app types to tax codes. */
|
|
1799
1823
|
export interface TaxCodeAppMapping {
|
|
1800
1824
|
/** The app type that the tax code is associated with. */
|
|
@@ -1802,6 +1826,17 @@ export interface TaxCodeAppMapping {
|
|
|
1802
1826
|
/** Tax code. */
|
|
1803
1827
|
taxCode: string;
|
|
1804
1828
|
}
|
|
1829
|
+
/** App capability describes a function that an App can perform. */
|
|
1830
|
+
export interface AppCapability {
|
|
1831
|
+
/** Type of the capability. */
|
|
1832
|
+
type: 'report_usage' | 'report_events' | 'calculate_tax' | 'invoice_customers' | 'collect_payments';
|
|
1833
|
+
/** Key of the capability. */
|
|
1834
|
+
key: string;
|
|
1835
|
+
/** Name of the capability. */
|
|
1836
|
+
name: string;
|
|
1837
|
+
/** Description of the capability. */
|
|
1838
|
+
description: string;
|
|
1839
|
+
}
|
|
1805
1840
|
/**
|
|
1806
1841
|
* Identity stores the details required to identify an entity for tax purposes in a
|
|
1807
1842
|
* specific country.
|
|
@@ -2866,141 +2901,6 @@ export interface InvoiceUsageQuantityDetail {
|
|
|
2866
2901
|
*/
|
|
2867
2902
|
appliedUnitConfig: UnitConfig;
|
|
2868
2903
|
}
|
|
2869
|
-
/** Stripe app. */
|
|
2870
|
-
export interface AppStripe {
|
|
2871
|
-
id: string;
|
|
2872
|
-
/**
|
|
2873
|
-
* Display name of the resource.
|
|
2874
|
-
*
|
|
2875
|
-
* Between 1 and 256 characters.
|
|
2876
|
-
*/
|
|
2877
|
-
name: string;
|
|
2878
|
-
/**
|
|
2879
|
-
* Optional description of the resource.
|
|
2880
|
-
*
|
|
2881
|
-
* Maximum 1024 characters.
|
|
2882
|
-
*/
|
|
2883
|
-
description?: string;
|
|
2884
|
-
labels?: Labels;
|
|
2885
|
-
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
2886
|
-
createdAt: Date;
|
|
2887
|
-
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
2888
|
-
updatedAt: Date;
|
|
2889
|
-
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
2890
|
-
deletedAt?: Date;
|
|
2891
|
-
/** The app type. */
|
|
2892
|
-
type: 'stripe';
|
|
2893
|
-
/** The app catalog definition that this installed app is based on. */
|
|
2894
|
-
definition: AppCatalogItem;
|
|
2895
|
-
/** Status of the app connection. */
|
|
2896
|
-
status: 'ready' | 'unauthorized';
|
|
2897
|
-
/** The Stripe account ID associated with the connected Stripe account. */
|
|
2898
|
-
accountId: string;
|
|
2899
|
-
/** Indicates whether the app is connected to a live Stripe account. */
|
|
2900
|
-
livemode: boolean;
|
|
2901
|
-
/** The masked Stripe API key that only exposes the first and last few characters. */
|
|
2902
|
-
maskedApiKey: string;
|
|
2903
|
-
}
|
|
2904
|
-
/** Sandbox app can be used for testing billing features. */
|
|
2905
|
-
export interface AppSandbox {
|
|
2906
|
-
id: string;
|
|
2907
|
-
/**
|
|
2908
|
-
* Display name of the resource.
|
|
2909
|
-
*
|
|
2910
|
-
* Between 1 and 256 characters.
|
|
2911
|
-
*/
|
|
2912
|
-
name: string;
|
|
2913
|
-
/**
|
|
2914
|
-
* Optional description of the resource.
|
|
2915
|
-
*
|
|
2916
|
-
* Maximum 1024 characters.
|
|
2917
|
-
*/
|
|
2918
|
-
description?: string;
|
|
2919
|
-
labels?: Labels;
|
|
2920
|
-
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
2921
|
-
createdAt: Date;
|
|
2922
|
-
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
2923
|
-
updatedAt: Date;
|
|
2924
|
-
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
2925
|
-
deletedAt?: Date;
|
|
2926
|
-
/** The app type. */
|
|
2927
|
-
type: 'sandbox';
|
|
2928
|
-
/** The app catalog definition that this installed app is based on. */
|
|
2929
|
-
definition: AppCatalogItem;
|
|
2930
|
-
/** Status of the app connection. */
|
|
2931
|
-
status: 'ready' | 'unauthorized';
|
|
2932
|
-
}
|
|
2933
|
-
/**
|
|
2934
|
-
* External Invoicing app enables integration with third-party invoicing or payment
|
|
2935
|
-
* system.
|
|
2936
|
-
*
|
|
2937
|
-
* The app supports a bi-directional synchronization pattern where OpenMeter
|
|
2938
|
-
* Billing manages the invoice lifecycle while the external system handles invoice
|
|
2939
|
-
* presentation and payment collection.
|
|
2940
|
-
*
|
|
2941
|
-
* Integration workflow:
|
|
2942
|
-
*
|
|
2943
|
-
* 1. The billing system creates invoices and transitions them through lifecycle
|
|
2944
|
-
* states (draft → issuing → issued)
|
|
2945
|
-
* 2. The integration receives webhook notifications about invoice state changes
|
|
2946
|
-
* 3. The integration calls back to provide external system IDs and metadata
|
|
2947
|
-
* 4. The integration reports payment events back via the payment status API
|
|
2948
|
-
*
|
|
2949
|
-
* State synchronization is controlled by hooks that pause invoice progression
|
|
2950
|
-
* until the external system confirms synchronization via API callbacks.
|
|
2951
|
-
*/
|
|
2952
|
-
export interface AppExternalInvoicing {
|
|
2953
|
-
id: string;
|
|
2954
|
-
/**
|
|
2955
|
-
* Display name of the resource.
|
|
2956
|
-
*
|
|
2957
|
-
* Between 1 and 256 characters.
|
|
2958
|
-
*/
|
|
2959
|
-
name: string;
|
|
2960
|
-
/**
|
|
2961
|
-
* Optional description of the resource.
|
|
2962
|
-
*
|
|
2963
|
-
* Maximum 1024 characters.
|
|
2964
|
-
*/
|
|
2965
|
-
description?: string;
|
|
2966
|
-
labels?: Labels;
|
|
2967
|
-
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
2968
|
-
createdAt: Date;
|
|
2969
|
-
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
2970
|
-
updatedAt: Date;
|
|
2971
|
-
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
2972
|
-
deletedAt?: Date;
|
|
2973
|
-
/** The app type. */
|
|
2974
|
-
type: 'external_invoicing';
|
|
2975
|
-
/** The app catalog definition that this installed app is based on. */
|
|
2976
|
-
definition: AppCatalogItem;
|
|
2977
|
-
/** Status of the app connection. */
|
|
2978
|
-
status: 'ready' | 'unauthorized';
|
|
2979
|
-
/**
|
|
2980
|
-
* Enable draft synchronization hook.
|
|
2981
|
-
*
|
|
2982
|
-
* When enabled, invoices will pause at the draft state and wait for the
|
|
2983
|
-
* integration to call the draft synchronized endpoint before progressing to the
|
|
2984
|
-
* issuing state. This allows the external system to validate and prepare the
|
|
2985
|
-
* invoice data.
|
|
2986
|
-
*
|
|
2987
|
-
* When disabled, invoices automatically progress through the draft state based on
|
|
2988
|
-
* the configured workflow timing.
|
|
2989
|
-
*/
|
|
2990
|
-
enableDraftSyncHook: boolean;
|
|
2991
|
-
/**
|
|
2992
|
-
* Enable issuing synchronization hook.
|
|
2993
|
-
*
|
|
2994
|
-
* When enabled, invoices will pause at the issuing state and wait for the
|
|
2995
|
-
* integration to call the issuing synchronized endpoint before progressing to the
|
|
2996
|
-
* issued state. This ensures the external invoicing system has successfully
|
|
2997
|
-
* created and finalized the invoice before it is marked as issued.
|
|
2998
|
-
*
|
|
2999
|
-
* When disabled, invoices automatically progress through the issuing state and are
|
|
3000
|
-
* immediately marked as issued.
|
|
3001
|
-
*/
|
|
3002
|
-
enableIssuingSyncHook: boolean;
|
|
3003
|
-
}
|
|
3004
2904
|
/** TaxCode create request. */
|
|
3005
2905
|
export interface CreateTaxCodeRequest {
|
|
3006
2906
|
/**
|
|
@@ -3064,6 +2964,24 @@ export interface UpsertTaxCodeRequest {
|
|
|
3064
2964
|
/** Mapping of app types to tax codes. */
|
|
3065
2965
|
appMappings: TaxCodeAppMapping[];
|
|
3066
2966
|
}
|
|
2967
|
+
/**
|
|
2968
|
+
* Available apps for billing integrations to connect with third-party services.
|
|
2969
|
+
* Apps can have various capabilities like syncing data from or to external
|
|
2970
|
+
* systems, integrating with third-party services for tax calculation, delivery of
|
|
2971
|
+
* invoices, collection of payments, etc.
|
|
2972
|
+
*/
|
|
2973
|
+
export interface AppCatalogItem {
|
|
2974
|
+
/** Type of the app. */
|
|
2975
|
+
type: 'sandbox' | 'stripe' | 'external_invoicing';
|
|
2976
|
+
/** Name of the app. */
|
|
2977
|
+
name: string;
|
|
2978
|
+
/** Description of the app. */
|
|
2979
|
+
description: string;
|
|
2980
|
+
/** Capabilities of the app. */
|
|
2981
|
+
capabilities: AppCapability[];
|
|
2982
|
+
/** Available install methods of the app. */
|
|
2983
|
+
installMethods: ('with_oauth2' | 'with_api_key' | 'no_credentials_required')[];
|
|
2984
|
+
}
|
|
3067
2985
|
/**
|
|
3068
2986
|
* Invoice-level snapshot of the workflow configuration.
|
|
3069
2987
|
*
|
|
@@ -3616,6 +3534,146 @@ export interface TaxCodePagePaginatedResponse {
|
|
|
3616
3534
|
data: TaxCode[];
|
|
3617
3535
|
meta: PaginatedMeta;
|
|
3618
3536
|
}
|
|
3537
|
+
/** Stripe app. */
|
|
3538
|
+
export interface AppStripe {
|
|
3539
|
+
id: string;
|
|
3540
|
+
/**
|
|
3541
|
+
* Display name of the resource.
|
|
3542
|
+
*
|
|
3543
|
+
* Between 1 and 256 characters.
|
|
3544
|
+
*/
|
|
3545
|
+
name: string;
|
|
3546
|
+
/**
|
|
3547
|
+
* Optional description of the resource.
|
|
3548
|
+
*
|
|
3549
|
+
* Maximum 1024 characters.
|
|
3550
|
+
*/
|
|
3551
|
+
description?: string;
|
|
3552
|
+
labels?: Labels;
|
|
3553
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
3554
|
+
createdAt: Date;
|
|
3555
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
3556
|
+
updatedAt: Date;
|
|
3557
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
3558
|
+
deletedAt?: Date;
|
|
3559
|
+
/** The app type. */
|
|
3560
|
+
type: 'stripe';
|
|
3561
|
+
/** The app catalog definition that this installed app is based on. */
|
|
3562
|
+
definition: AppCatalogItem;
|
|
3563
|
+
/** Status of the app connection. */
|
|
3564
|
+
status: 'ready' | 'unauthorized';
|
|
3565
|
+
/** The Stripe account ID associated with the connected Stripe account. */
|
|
3566
|
+
accountId: string;
|
|
3567
|
+
/** Indicates whether the app is connected to a live Stripe account. */
|
|
3568
|
+
livemode: boolean;
|
|
3569
|
+
/** The masked Stripe API key that only exposes the first and last few characters. */
|
|
3570
|
+
maskedApiKey: string;
|
|
3571
|
+
}
|
|
3572
|
+
/** Sandbox app can be used for testing billing features. */
|
|
3573
|
+
export interface AppSandbox {
|
|
3574
|
+
id: string;
|
|
3575
|
+
/**
|
|
3576
|
+
* Display name of the resource.
|
|
3577
|
+
*
|
|
3578
|
+
* Between 1 and 256 characters.
|
|
3579
|
+
*/
|
|
3580
|
+
name: string;
|
|
3581
|
+
/**
|
|
3582
|
+
* Optional description of the resource.
|
|
3583
|
+
*
|
|
3584
|
+
* Maximum 1024 characters.
|
|
3585
|
+
*/
|
|
3586
|
+
description?: string;
|
|
3587
|
+
labels?: Labels;
|
|
3588
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
3589
|
+
createdAt: Date;
|
|
3590
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
3591
|
+
updatedAt: Date;
|
|
3592
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
3593
|
+
deletedAt?: Date;
|
|
3594
|
+
/** The app type. */
|
|
3595
|
+
type: 'sandbox';
|
|
3596
|
+
/** The app catalog definition that this installed app is based on. */
|
|
3597
|
+
definition: AppCatalogItem;
|
|
3598
|
+
/** Status of the app connection. */
|
|
3599
|
+
status: 'ready' | 'unauthorized';
|
|
3600
|
+
}
|
|
3601
|
+
/**
|
|
3602
|
+
* External Invoicing app enables integration with third-party invoicing or payment
|
|
3603
|
+
* system.
|
|
3604
|
+
*
|
|
3605
|
+
* The app supports a bi-directional synchronization pattern where OpenMeter
|
|
3606
|
+
* Billing manages the invoice lifecycle while the external system handles invoice
|
|
3607
|
+
* presentation and payment collection.
|
|
3608
|
+
*
|
|
3609
|
+
* Integration workflow:
|
|
3610
|
+
*
|
|
3611
|
+
* 1. The billing system creates invoices and transitions them through lifecycle
|
|
3612
|
+
* states (draft → issuing → issued)
|
|
3613
|
+
* 2. The integration receives webhook notifications about invoice state changes
|
|
3614
|
+
* 3. The integration calls back to provide external system IDs and metadata
|
|
3615
|
+
* 4. The integration reports payment events back via the payment status API
|
|
3616
|
+
*
|
|
3617
|
+
* State synchronization is controlled by hooks that pause invoice progression
|
|
3618
|
+
* until the external system confirms synchronization via API callbacks.
|
|
3619
|
+
*/
|
|
3620
|
+
export interface AppExternalInvoicing {
|
|
3621
|
+
id: string;
|
|
3622
|
+
/**
|
|
3623
|
+
* Display name of the resource.
|
|
3624
|
+
*
|
|
3625
|
+
* Between 1 and 256 characters.
|
|
3626
|
+
*/
|
|
3627
|
+
name: string;
|
|
3628
|
+
/**
|
|
3629
|
+
* Optional description of the resource.
|
|
3630
|
+
*
|
|
3631
|
+
* Maximum 1024 characters.
|
|
3632
|
+
*/
|
|
3633
|
+
description?: string;
|
|
3634
|
+
labels?: Labels;
|
|
3635
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
3636
|
+
createdAt: Date;
|
|
3637
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
3638
|
+
updatedAt: Date;
|
|
3639
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
3640
|
+
deletedAt?: Date;
|
|
3641
|
+
/** The app type. */
|
|
3642
|
+
type: 'external_invoicing';
|
|
3643
|
+
/** The app catalog definition that this installed app is based on. */
|
|
3644
|
+
definition: AppCatalogItem;
|
|
3645
|
+
/** Status of the app connection. */
|
|
3646
|
+
status: 'ready' | 'unauthorized';
|
|
3647
|
+
/**
|
|
3648
|
+
* Enable draft synchronization hook.
|
|
3649
|
+
*
|
|
3650
|
+
* When enabled, invoices will pause at the draft state and wait for the
|
|
3651
|
+
* integration to call the draft synchronized endpoint before progressing to the
|
|
3652
|
+
* issuing state. This allows the external system to validate and prepare the
|
|
3653
|
+
* invoice data.
|
|
3654
|
+
*
|
|
3655
|
+
* When disabled, invoices automatically progress through the draft state based on
|
|
3656
|
+
* the configured workflow timing.
|
|
3657
|
+
*/
|
|
3658
|
+
enableDraftSyncHook: boolean;
|
|
3659
|
+
/**
|
|
3660
|
+
* Enable issuing synchronization hook.
|
|
3661
|
+
*
|
|
3662
|
+
* When enabled, invoices will pause at the issuing state and wait for the
|
|
3663
|
+
* integration to call the issuing synchronized endpoint before progressing to the
|
|
3664
|
+
* issued state. This ensures the external invoicing system has successfully
|
|
3665
|
+
* created and finalized the invoice before it is marked as issued.
|
|
3666
|
+
*
|
|
3667
|
+
* When disabled, invoices automatically progress through the issuing state and are
|
|
3668
|
+
* immediately marked as issued.
|
|
3669
|
+
*/
|
|
3670
|
+
enableIssuingSyncHook: boolean;
|
|
3671
|
+
}
|
|
3672
|
+
/** Page paginated response. */
|
|
3673
|
+
export interface AppCatalogItemPagePaginatedResponse {
|
|
3674
|
+
data: AppCatalogItem[];
|
|
3675
|
+
meta: PaginatedMeta;
|
|
3676
|
+
}
|
|
3619
3677
|
/** Snapshot of the billing workflow configuration captured at invoice creation. */
|
|
3620
3678
|
export interface InvoiceWorkflowSettings {
|
|
3621
3679
|
/** The apps that will be used to orchestrate the invoice's workflow. */
|
|
@@ -3888,20 +3946,6 @@ export interface WorkflowCollectionSettings {
|
|
|
3888
3946
|
*/
|
|
3889
3947
|
interval: string;
|
|
3890
3948
|
}
|
|
3891
|
-
/** Page paginated response. */
|
|
3892
|
-
export interface AppPagePaginatedResponse {
|
|
3893
|
-
data: App[];
|
|
3894
|
-
meta: PaginatedMeta;
|
|
3895
|
-
}
|
|
3896
|
-
/** Applications used by a billing profile. */
|
|
3897
|
-
export interface ProfileApps {
|
|
3898
|
-
/** The tax app used for this workflow. */
|
|
3899
|
-
tax: App;
|
|
3900
|
-
/** The invoicing app used for this workflow. */
|
|
3901
|
-
invoicing: App;
|
|
3902
|
-
/** The payment app used for this workflow. */
|
|
3903
|
-
payment: App;
|
|
3904
|
-
}
|
|
3905
3949
|
/** Response of the governance query. */
|
|
3906
3950
|
export interface GovernanceQueryResponse {
|
|
3907
3951
|
/** Access evaluation results, one entry per resolved customer. */
|
|
@@ -4162,6 +4206,25 @@ export interface Workflow {
|
|
|
4162
4206
|
/** The tax settings for this workflow */
|
|
4163
4207
|
tax?: WorkflowTaxSettings;
|
|
4164
4208
|
}
|
|
4209
|
+
/** Page paginated response. */
|
|
4210
|
+
export interface AppPagePaginatedResponse {
|
|
4211
|
+
data: App[];
|
|
4212
|
+
meta: PaginatedMeta;
|
|
4213
|
+
}
|
|
4214
|
+
/** Response of the app install. */
|
|
4215
|
+
export interface BillingInstallAppResponse {
|
|
4216
|
+
app: App;
|
|
4217
|
+
defaultForCapabilityTypes: ('report_usage' | 'report_events' | 'calculate_tax' | 'invoice_customers' | 'collect_payments')[];
|
|
4218
|
+
}
|
|
4219
|
+
/** Applications used by a billing profile. */
|
|
4220
|
+
export interface ProfileApps {
|
|
4221
|
+
/** The tax app used for this workflow. */
|
|
4222
|
+
tax: App;
|
|
4223
|
+
/** The invoicing app used for this workflow. */
|
|
4224
|
+
invoicing: App;
|
|
4225
|
+
/** The payment app used for this workflow. */
|
|
4226
|
+
payment: App;
|
|
4227
|
+
}
|
|
4165
4228
|
/** A usage-based charge for a customer. */
|
|
4166
4229
|
export interface ChargeUsageBased {
|
|
4167
4230
|
id: string;
|
|
@@ -4963,6 +5026,8 @@ export type DateTimeFieldFilter = Date | {
|
|
|
4963
5026
|
* returned.
|
|
4964
5027
|
*/
|
|
4965
5028
|
export type SubscriptionEditTiming = 'immediate' | 'next_billing_cycle' | Date;
|
|
5029
|
+
/** Request to install an app from the catalog. */
|
|
5030
|
+
export type InstallAppRequest = InstallAppStripeWithApiKey | InstallAppSandbox | InstallAppExternalInvoicing;
|
|
4966
5031
|
/** Payment settings for a billing workflow. */
|
|
4967
5032
|
export type WorkflowPaymentSettings = WorkflowPaymentChargeAutomaticallySettings | WorkflowPaymentSendInvoiceSettings;
|
|
4968
5033
|
/** Payment settings for a billing workflow. */
|
|
@@ -4989,12 +5054,12 @@ export type FeatureUnitCost = FeatureManualUnitCost | FeatureLlmUnitCost;
|
|
|
4989
5054
|
* arrears items).
|
|
4990
5055
|
*/
|
|
4991
5056
|
export type WorkflowCollectionAlignment = WorkflowCollectionAlignmentSubscription | WorkflowCollectionAlignmentAnchored;
|
|
4992
|
-
/** Installed application. */
|
|
4993
|
-
export type App = AppStripe | AppSandbox | AppExternalInvoicing;
|
|
4994
5057
|
/** Price. */
|
|
4995
5058
|
export type Price = PriceFree | PriceFlat | PriceUnit | PriceGraduated | PriceVolume;
|
|
4996
5059
|
/** Price. */
|
|
4997
5060
|
export type UpdatePrice = UpdatePriceFree | UpdatePriceFlat | UpdatePriceUnit | UpdatePriceGraduated | UpdatePriceVolume;
|
|
5061
|
+
/** Installed application. */
|
|
5062
|
+
export type App = AppStripe | AppSandbox | AppExternalInvoicing;
|
|
4998
5063
|
/** Customer charge. */
|
|
4999
5064
|
export type CreateChargeRequest = CreateChargeFlatFeeRequest | CreateChargeUsageBasedRequest;
|
|
5000
5065
|
/** 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 } from '../models/operations/apps.js';
|
|
4
|
-
import type { App } from '../models/types.js';
|
|
3
|
+
import type { ListAppsRequest, ListAppsResponse, GetAppRequest, GetAppResponse, ListAppCatalogRequest, ListAppCatalogResponse, GetAppCatalogItemRequest, GetAppCatalogItemResponse, InstallAppRequest, InstallAppResponse } from '../models/operations/apps.js';
|
|
4
|
+
import type { App, AppCatalogItem } from '../models/types.js';
|
|
5
5
|
export declare class Apps {
|
|
6
6
|
private readonly _client;
|
|
7
7
|
constructor(_client: Client);
|
|
@@ -31,4 +31,38 @@ export declare class Apps {
|
|
|
31
31
|
* GET /openmeter/apps/{appId}
|
|
32
32
|
*/
|
|
33
33
|
get(request: GetAppRequest, options?: RequestOptions): Promise<GetAppResponse>;
|
|
34
|
+
/**
|
|
35
|
+
* List app catalog
|
|
36
|
+
*
|
|
37
|
+
* List available apps.
|
|
38
|
+
*
|
|
39
|
+
* GET /openmeter/app-catalog
|
|
40
|
+
*/
|
|
41
|
+
listCatalog(request?: ListAppCatalogRequest, options?: RequestOptions): Promise<ListAppCatalogResponse>;
|
|
42
|
+
/**
|
|
43
|
+
* List app catalog
|
|
44
|
+
*
|
|
45
|
+
* List available apps.
|
|
46
|
+
*
|
|
47
|
+
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
48
|
+
*
|
|
49
|
+
* GET /openmeter/app-catalog
|
|
50
|
+
*/
|
|
51
|
+
listCatalogAll(request?: ListAppCatalogRequest, options?: RequestOptions): AsyncIterable<AppCatalogItem>;
|
|
52
|
+
/**
|
|
53
|
+
* Get app catalog item by type
|
|
54
|
+
*
|
|
55
|
+
* Get an app catalog item by type.
|
|
56
|
+
*
|
|
57
|
+
* GET /openmeter/app-catalog/{appType}
|
|
58
|
+
*/
|
|
59
|
+
getCatalogItem(request: GetAppCatalogItemRequest, options?: RequestOptions): Promise<GetAppCatalogItemResponse>;
|
|
60
|
+
/**
|
|
61
|
+
* Install app from the catalog
|
|
62
|
+
*
|
|
63
|
+
* Install an app from the catalog.
|
|
64
|
+
*
|
|
65
|
+
* POST /openmeter/app-catalog/install
|
|
66
|
+
*/
|
|
67
|
+
install(request: InstallAppRequest, options?: RequestOptions): Promise<InstallAppResponse>;
|
|
34
68
|
}
|
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 } from '../funcs/apps.js';
|
|
4
|
+
import { listApps, getApp, listAppCatalog, getAppCatalogItem, installApp, } from '../funcs/apps.js';
|
|
5
5
|
export class Apps {
|
|
6
6
|
_client;
|
|
7
7
|
constructor(_client) {
|
|
@@ -39,4 +39,46 @@ export class Apps {
|
|
|
39
39
|
async get(request, options) {
|
|
40
40
|
return unwrap(await getApp(this._client, request, options));
|
|
41
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* List app catalog
|
|
44
|
+
*
|
|
45
|
+
* List available apps.
|
|
46
|
+
*
|
|
47
|
+
* GET /openmeter/app-catalog
|
|
48
|
+
*/
|
|
49
|
+
async listCatalog(request, options) {
|
|
50
|
+
return unwrap(await listAppCatalog(this._client, request, options));
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* List app catalog
|
|
54
|
+
*
|
|
55
|
+
* List available apps.
|
|
56
|
+
*
|
|
57
|
+
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
58
|
+
*
|
|
59
|
+
* GET /openmeter/app-catalog
|
|
60
|
+
*/
|
|
61
|
+
listCatalogAll(request, options) {
|
|
62
|
+
return paginatePages((req, opts) => listAppCatalog(this._client, req, opts), request ?? {}, options);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Get app catalog item by type
|
|
66
|
+
*
|
|
67
|
+
* Get an app catalog item by type.
|
|
68
|
+
*
|
|
69
|
+
* GET /openmeter/app-catalog/{appType}
|
|
70
|
+
*/
|
|
71
|
+
async getCatalogItem(request, options) {
|
|
72
|
+
return unwrap(await getAppCatalogItem(this._client, request, options));
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Install app from the catalog
|
|
76
|
+
*
|
|
77
|
+
* Install an app from the catalog.
|
|
78
|
+
*
|
|
79
|
+
* POST /openmeter/app-catalog/install
|
|
80
|
+
*/
|
|
81
|
+
async install(request, options) {
|
|
82
|
+
return unwrap(await installApp(this._client, request, options));
|
|
83
|
+
}
|
|
42
84
|
}
|