@openmeter/client 1.0.0-beta-d27628286134 → 1.0.0-beta-05e3994fd90d
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/dist/index.d.ts +1 -1
- package/dist/lib/version.d.ts +1 -1
- package/dist/lib/version.js +1 -1
- package/dist/models/schemas.d.ts +20174 -15256
- package/dist/models/schemas.js +448 -8
- package/dist/models/types.d.ts +316 -4
- package/package.json +1 -1
package/dist/models/types.d.ts
CHANGED
|
@@ -755,6 +755,16 @@ export interface PagePaginationQuery {
|
|
|
755
755
|
* list of objects.
|
|
756
756
|
*/
|
|
757
757
|
export type PublicLabels = Record<string, string>;
|
|
758
|
+
/**
|
|
759
|
+
* Rule configuration of `v1.billing.invoice.created`. Invoice Rules have no
|
|
760
|
+
* type-specific settings.
|
|
761
|
+
*/
|
|
762
|
+
export type InvoiceCreatedV1RuleConfig = Record<string, never>;
|
|
763
|
+
/**
|
|
764
|
+
* Rule configuration of `v1.billing.invoice.updated`. Invoice Rules have no
|
|
765
|
+
* type-specific settings.
|
|
766
|
+
*/
|
|
767
|
+
export type InvoiceUpdatedV1RuleConfig = Record<string, never>;
|
|
758
768
|
/**
|
|
759
769
|
* The system account access token is meant for automations and integrations that
|
|
760
770
|
* are not directly associated with a human identity.
|
|
@@ -3577,6 +3587,22 @@ export interface CustomerProfile {
|
|
|
3577
3587
|
*/
|
|
3578
3588
|
effectiveBillingProfile: ProfileReference;
|
|
3579
3589
|
}
|
|
3590
|
+
/** The feature filter shared by the entitlement Rule configurations. */
|
|
3591
|
+
export interface EntitlementFeaturesRuleConfig {
|
|
3592
|
+
/**
|
|
3593
|
+
* The features the rule applies to. When omitted, the rule applies to every
|
|
3594
|
+
* feature.
|
|
3595
|
+
*/
|
|
3596
|
+
features?: FeatureReference[];
|
|
3597
|
+
}
|
|
3598
|
+
/** Rule configuration of `v1.entitlement.usage_period.reset`. */
|
|
3599
|
+
export interface EntitlementUsagePeriodResetV1RuleConfig {
|
|
3600
|
+
/**
|
|
3601
|
+
* The features the rule applies to. When omitted, the rule applies to every
|
|
3602
|
+
* feature.
|
|
3603
|
+
*/
|
|
3604
|
+
features?: FeatureReference[];
|
|
3605
|
+
}
|
|
3580
3606
|
/**
|
|
3581
3607
|
* Tax configuration for a billable resource.
|
|
3582
3608
|
*
|
|
@@ -5157,6 +5183,16 @@ export interface NotificationRuleBalanceThresholdRequest {
|
|
|
5157
5183
|
*/
|
|
5158
5184
|
features?: FeatureReference[];
|
|
5159
5185
|
}
|
|
5186
|
+
/** Rule configuration of `v1.entitlement.balance_threshold.triggered`. */
|
|
5187
|
+
export interface EntitlementBalanceThresholdTriggeredV1RuleConfig {
|
|
5188
|
+
/** The thresholds that generate an event when crossed. */
|
|
5189
|
+
thresholds: NotificationBalanceThreshold[];
|
|
5190
|
+
/**
|
|
5191
|
+
* The features the rule applies to. When omitted, the rule applies to every
|
|
5192
|
+
* feature.
|
|
5193
|
+
*/
|
|
5194
|
+
features?: FeatureReference[];
|
|
5195
|
+
}
|
|
5160
5196
|
/**
|
|
5161
5197
|
* The delivery status of a notification event for one channel of the generating
|
|
5162
5198
|
* rule.
|
|
@@ -7461,6 +7497,40 @@ export interface NotificationEventV1BillingWorkflowCollectionSettings {
|
|
|
7461
7497
|
*/
|
|
7462
7498
|
interval?: string;
|
|
7463
7499
|
}
|
|
7500
|
+
/**
|
|
7501
|
+
* Payload of `v1.entitlement.balance_threshold.triggered`, the legacy
|
|
7502
|
+
* `entitlements.balance.threshold` Event type.
|
|
7503
|
+
*/
|
|
7504
|
+
export interface EntitlementBalanceThresholdTriggeredV1Payload {
|
|
7505
|
+
/** Entitlement. */
|
|
7506
|
+
entitlement: NotificationEventV1EntitlementMetered;
|
|
7507
|
+
/** Feature. */
|
|
7508
|
+
feature: NotificationEventV1Feature;
|
|
7509
|
+
/** Subject. */
|
|
7510
|
+
subject: NotificationEventV1Subject;
|
|
7511
|
+
/** Entitlement Value. */
|
|
7512
|
+
value: NotificationEventV1EntitlementValue;
|
|
7513
|
+
/** Customer. */
|
|
7514
|
+
customer?: NotificationEventV1Customer;
|
|
7515
|
+
/** Threshold. */
|
|
7516
|
+
threshold: NotificationEventV1RuleBalanceThresholdValue;
|
|
7517
|
+
}
|
|
7518
|
+
/**
|
|
7519
|
+
* Payload of `v1.entitlement.usage_period.reset`, the legacy `entitlements.reset`
|
|
7520
|
+
* Event type.
|
|
7521
|
+
*/
|
|
7522
|
+
export interface EntitlementUsagePeriodResetV1Payload {
|
|
7523
|
+
/** Entitlement. */
|
|
7524
|
+
entitlement: NotificationEventV1EntitlementMetered;
|
|
7525
|
+
/** Feature. */
|
|
7526
|
+
feature: NotificationEventV1Feature;
|
|
7527
|
+
/** Subject. */
|
|
7528
|
+
subject: NotificationEventV1Subject;
|
|
7529
|
+
/** Entitlement Value. */
|
|
7530
|
+
value: NotificationEventV1EntitlementValue;
|
|
7531
|
+
/** Customer. */
|
|
7532
|
+
customer?: NotificationEventV1Customer;
|
|
7533
|
+
}
|
|
7464
7534
|
/**
|
|
7465
7535
|
* Data of the payload for notification event with `entitlements.balance.threshold`
|
|
7466
7536
|
* type.
|
|
@@ -8057,7 +8127,7 @@ export interface NotificationEventBalanceThresholdPayload {
|
|
|
8057
8127
|
/** When the event was generated. */
|
|
8058
8128
|
timestamp: Date;
|
|
8059
8129
|
/** The entities and threshold the event refers to. */
|
|
8060
|
-
data:
|
|
8130
|
+
data: EntitlementBalanceThresholdTriggeredV1Payload;
|
|
8061
8131
|
}
|
|
8062
8132
|
/** An entitlement reset notification event payload. */
|
|
8063
8133
|
export interface NotificationEventResetPayload {
|
|
@@ -8068,7 +8138,7 @@ export interface NotificationEventResetPayload {
|
|
|
8068
8138
|
/** When the event was generated. */
|
|
8069
8139
|
timestamp: Date;
|
|
8070
8140
|
/** The entities the event refers to. */
|
|
8071
|
-
data:
|
|
8141
|
+
data: EntitlementUsagePeriodResetV1Payload;
|
|
8072
8142
|
}
|
|
8073
8143
|
/**
|
|
8074
8144
|
* InvoiceUsageBasedLine represents a line item that is sold to the customer based
|
|
@@ -8838,6 +8908,248 @@ export interface UpdateInvoiceStandardRequest {
|
|
|
8838
8908
|
*/
|
|
8839
8909
|
lines?: UpdateInvoiceLine[];
|
|
8840
8910
|
}
|
|
8911
|
+
/**
|
|
8912
|
+
* Payload of `v1.billing.invoice.created`, the legacy `invoice.created` Event
|
|
8913
|
+
* type: the invoice as it was created.
|
|
8914
|
+
*/
|
|
8915
|
+
export interface InvoiceCreatedV1Payload {
|
|
8916
|
+
/** A unique identifier for the resource. */
|
|
8917
|
+
id: string;
|
|
8918
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
8919
|
+
description?: string;
|
|
8920
|
+
/** Additional metadata for the resource. */
|
|
8921
|
+
metadata?: NotificationEventV1Metadata | null;
|
|
8922
|
+
/** Timestamp of when the resource was created. */
|
|
8923
|
+
createdAt: Date;
|
|
8924
|
+
/** Timestamp of when the resource was last updated. */
|
|
8925
|
+
updatedAt: Date;
|
|
8926
|
+
/** Timestamp of when the resource was permanently deleted. */
|
|
8927
|
+
deletedAt?: Date;
|
|
8928
|
+
/**
|
|
8929
|
+
* Type of the invoice.
|
|
8930
|
+
*
|
|
8931
|
+
* The type of invoice determines the purpose of the invoice and how it should be
|
|
8932
|
+
* handled.
|
|
8933
|
+
*
|
|
8934
|
+
* Supported types:
|
|
8935
|
+
*
|
|
8936
|
+
* - standard: A regular commercial invoice document between a supplier and
|
|
8937
|
+
* customer.
|
|
8938
|
+
* - credit_note: Reflects a refund either partial or complete of the preceding
|
|
8939
|
+
* document. A credit note effectively _extends_ the previous document.
|
|
8940
|
+
*/
|
|
8941
|
+
type: 'standard' | 'credit_note';
|
|
8942
|
+
/** The taxable entity supplying the goods or services. */
|
|
8943
|
+
supplier: NotificationEventV1BillingParty;
|
|
8944
|
+
/** Legal entity receiving the goods or services. */
|
|
8945
|
+
customer: NotificationEventV1BillingInvoiceCustomerExtendedDetails;
|
|
8946
|
+
/**
|
|
8947
|
+
* Number specifies the human readable key used to reference this Invoice.
|
|
8948
|
+
*
|
|
8949
|
+
* The invoice number can change in the draft phases, as we are allocating
|
|
8950
|
+
* temporary draft invoice numbers, but it's final as soon as the invoice gets
|
|
8951
|
+
* finalized (issued state).
|
|
8952
|
+
*
|
|
8953
|
+
* Please note that the number is (depending on the upstream settings) either
|
|
8954
|
+
* unique for the whole organization or unique for the customer, or in multi
|
|
8955
|
+
* (stripe) account setups unique for the account.
|
|
8956
|
+
*/
|
|
8957
|
+
number: string;
|
|
8958
|
+
/**
|
|
8959
|
+
* Currency for all invoice line items.
|
|
8960
|
+
*
|
|
8961
|
+
* Multi currency invoices are not supported yet.
|
|
8962
|
+
*/
|
|
8963
|
+
currency: string;
|
|
8964
|
+
/**
|
|
8965
|
+
* Key information regarding previous invoices and potentially details as to why
|
|
8966
|
+
* they were corrected.
|
|
8967
|
+
*/
|
|
8968
|
+
preceding?: NotificationEventV1InvoiceDocumentRef[];
|
|
8969
|
+
/** Summary of all the invoice totals, including taxes (calculated). */
|
|
8970
|
+
totals: NotificationEventV1InvoiceTotals;
|
|
8971
|
+
/**
|
|
8972
|
+
* The status of the invoice.
|
|
8973
|
+
*
|
|
8974
|
+
* This field only conatins a simplified status, for more detailed information use
|
|
8975
|
+
* the statusDetails field.
|
|
8976
|
+
*/
|
|
8977
|
+
status: 'gathering' | 'draft' | 'issuing' | 'issued' | 'payment_processing' | 'overdue' | 'paid' | 'uncollectible' | 'voided';
|
|
8978
|
+
/** The details of the current invoice status. */
|
|
8979
|
+
statusDetails: NotificationEventV1InvoiceStatusDetails;
|
|
8980
|
+
/**
|
|
8981
|
+
* The time the invoice was issued.
|
|
8982
|
+
*
|
|
8983
|
+
* Depending on the status of the invoice this can mean multiple things:
|
|
8984
|
+
*
|
|
8985
|
+
* - draft, gathering: The time the invoice will be issued based on the workflow
|
|
8986
|
+
* settings.
|
|
8987
|
+
* - issued: The time the invoice was issued.
|
|
8988
|
+
*/
|
|
8989
|
+
issuedAt?: Date;
|
|
8990
|
+
/**
|
|
8991
|
+
* The time until the invoice is in draft status.
|
|
8992
|
+
*
|
|
8993
|
+
* On draft invoice creation it is calculated from the workflow settings.
|
|
8994
|
+
*
|
|
8995
|
+
* If manual approval is required, the draftUntil time is set.
|
|
8996
|
+
*/
|
|
8997
|
+
draftUntil?: Date;
|
|
8998
|
+
/** The time when the quantity snapshots on the invoice lines were taken. */
|
|
8999
|
+
quantitySnapshotedAt?: Date;
|
|
9000
|
+
/** The time when the invoice will be/has been collected. */
|
|
9001
|
+
collectionAt?: Date;
|
|
9002
|
+
/** Due time of the fulfillment of the invoice (if available). */
|
|
9003
|
+
dueAt?: Date;
|
|
9004
|
+
/** The period the invoice covers. If the invoice has no line items, it's not set. */
|
|
9005
|
+
period?: NotificationEventV1Period;
|
|
9006
|
+
/**
|
|
9007
|
+
* The time the invoice was voided.
|
|
9008
|
+
*
|
|
9009
|
+
* If the invoice was voided, this field will be set to the time the invoice was
|
|
9010
|
+
* voided.
|
|
9011
|
+
*/
|
|
9012
|
+
voidedAt?: Date;
|
|
9013
|
+
/** The time the invoice was sent to customer. */
|
|
9014
|
+
sentToCustomerAt?: Date;
|
|
9015
|
+
/**
|
|
9016
|
+
* The workflow associated with the invoice.
|
|
9017
|
+
*
|
|
9018
|
+
* It is always a snapshot of the workflow settings at the time of invoice
|
|
9019
|
+
* creation. The field is optional as it should be explicitly requested with expand
|
|
9020
|
+
* options.
|
|
9021
|
+
*/
|
|
9022
|
+
workflow: NotificationEventV1InvoiceWorkflowSettings;
|
|
9023
|
+
/** List of invoice lines representing each of the items sold to the customer. */
|
|
9024
|
+
lines?: NotificationEventV1InvoiceLine[];
|
|
9025
|
+
/** Information on when, how, and to whom the invoice should be paid. */
|
|
9026
|
+
payment?: NotificationEventV1InvoicePaymentTerms;
|
|
9027
|
+
/** Validation issues reported by the invoice workflow. */
|
|
9028
|
+
validationIssues?: NotificationEventV1ValidationIssue[];
|
|
9029
|
+
/** External IDs of the invoice in other apps such as Stripe. */
|
|
9030
|
+
externalIds?: NotificationEventV1InvoiceAppExternalIds;
|
|
9031
|
+
}
|
|
9032
|
+
/**
|
|
9033
|
+
* Payload of `v1.billing.invoice.updated`, the legacy `invoice.updated` Event
|
|
9034
|
+
* type: the invoice after the update.
|
|
9035
|
+
*/
|
|
9036
|
+
export interface InvoiceUpdatedV1Payload {
|
|
9037
|
+
/** A unique identifier for the resource. */
|
|
9038
|
+
id: string;
|
|
9039
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
9040
|
+
description?: string;
|
|
9041
|
+
/** Additional metadata for the resource. */
|
|
9042
|
+
metadata?: NotificationEventV1Metadata | null;
|
|
9043
|
+
/** Timestamp of when the resource was created. */
|
|
9044
|
+
createdAt: Date;
|
|
9045
|
+
/** Timestamp of when the resource was last updated. */
|
|
9046
|
+
updatedAt: Date;
|
|
9047
|
+
/** Timestamp of when the resource was permanently deleted. */
|
|
9048
|
+
deletedAt?: Date;
|
|
9049
|
+
/**
|
|
9050
|
+
* Type of the invoice.
|
|
9051
|
+
*
|
|
9052
|
+
* The type of invoice determines the purpose of the invoice and how it should be
|
|
9053
|
+
* handled.
|
|
9054
|
+
*
|
|
9055
|
+
* Supported types:
|
|
9056
|
+
*
|
|
9057
|
+
* - standard: A regular commercial invoice document between a supplier and
|
|
9058
|
+
* customer.
|
|
9059
|
+
* - credit_note: Reflects a refund either partial or complete of the preceding
|
|
9060
|
+
* document. A credit note effectively _extends_ the previous document.
|
|
9061
|
+
*/
|
|
9062
|
+
type: 'standard' | 'credit_note';
|
|
9063
|
+
/** The taxable entity supplying the goods or services. */
|
|
9064
|
+
supplier: NotificationEventV1BillingParty;
|
|
9065
|
+
/** Legal entity receiving the goods or services. */
|
|
9066
|
+
customer: NotificationEventV1BillingInvoiceCustomerExtendedDetails;
|
|
9067
|
+
/**
|
|
9068
|
+
* Number specifies the human readable key used to reference this Invoice.
|
|
9069
|
+
*
|
|
9070
|
+
* The invoice number can change in the draft phases, as we are allocating
|
|
9071
|
+
* temporary draft invoice numbers, but it's final as soon as the invoice gets
|
|
9072
|
+
* finalized (issued state).
|
|
9073
|
+
*
|
|
9074
|
+
* Please note that the number is (depending on the upstream settings) either
|
|
9075
|
+
* unique for the whole organization or unique for the customer, or in multi
|
|
9076
|
+
* (stripe) account setups unique for the account.
|
|
9077
|
+
*/
|
|
9078
|
+
number: string;
|
|
9079
|
+
/**
|
|
9080
|
+
* Currency for all invoice line items.
|
|
9081
|
+
*
|
|
9082
|
+
* Multi currency invoices are not supported yet.
|
|
9083
|
+
*/
|
|
9084
|
+
currency: string;
|
|
9085
|
+
/**
|
|
9086
|
+
* Key information regarding previous invoices and potentially details as to why
|
|
9087
|
+
* they were corrected.
|
|
9088
|
+
*/
|
|
9089
|
+
preceding?: NotificationEventV1InvoiceDocumentRef[];
|
|
9090
|
+
/** Summary of all the invoice totals, including taxes (calculated). */
|
|
9091
|
+
totals: NotificationEventV1InvoiceTotals;
|
|
9092
|
+
/**
|
|
9093
|
+
* The status of the invoice.
|
|
9094
|
+
*
|
|
9095
|
+
* This field only conatins a simplified status, for more detailed information use
|
|
9096
|
+
* the statusDetails field.
|
|
9097
|
+
*/
|
|
9098
|
+
status: 'gathering' | 'draft' | 'issuing' | 'issued' | 'payment_processing' | 'overdue' | 'paid' | 'uncollectible' | 'voided';
|
|
9099
|
+
/** The details of the current invoice status. */
|
|
9100
|
+
statusDetails: NotificationEventV1InvoiceStatusDetails;
|
|
9101
|
+
/**
|
|
9102
|
+
* The time the invoice was issued.
|
|
9103
|
+
*
|
|
9104
|
+
* Depending on the status of the invoice this can mean multiple things:
|
|
9105
|
+
*
|
|
9106
|
+
* - draft, gathering: The time the invoice will be issued based on the workflow
|
|
9107
|
+
* settings.
|
|
9108
|
+
* - issued: The time the invoice was issued.
|
|
9109
|
+
*/
|
|
9110
|
+
issuedAt?: Date;
|
|
9111
|
+
/**
|
|
9112
|
+
* The time until the invoice is in draft status.
|
|
9113
|
+
*
|
|
9114
|
+
* On draft invoice creation it is calculated from the workflow settings.
|
|
9115
|
+
*
|
|
9116
|
+
* If manual approval is required, the draftUntil time is set.
|
|
9117
|
+
*/
|
|
9118
|
+
draftUntil?: Date;
|
|
9119
|
+
/** The time when the quantity snapshots on the invoice lines were taken. */
|
|
9120
|
+
quantitySnapshotedAt?: Date;
|
|
9121
|
+
/** The time when the invoice will be/has been collected. */
|
|
9122
|
+
collectionAt?: Date;
|
|
9123
|
+
/** Due time of the fulfillment of the invoice (if available). */
|
|
9124
|
+
dueAt?: Date;
|
|
9125
|
+
/** The period the invoice covers. If the invoice has no line items, it's not set. */
|
|
9126
|
+
period?: NotificationEventV1Period;
|
|
9127
|
+
/**
|
|
9128
|
+
* The time the invoice was voided.
|
|
9129
|
+
*
|
|
9130
|
+
* If the invoice was voided, this field will be set to the time the invoice was
|
|
9131
|
+
* voided.
|
|
9132
|
+
*/
|
|
9133
|
+
voidedAt?: Date;
|
|
9134
|
+
/** The time the invoice was sent to customer. */
|
|
9135
|
+
sentToCustomerAt?: Date;
|
|
9136
|
+
/**
|
|
9137
|
+
* The workflow associated with the invoice.
|
|
9138
|
+
*
|
|
9139
|
+
* It is always a snapshot of the workflow settings at the time of invoice
|
|
9140
|
+
* creation. The field is optional as it should be explicitly requested with expand
|
|
9141
|
+
* options.
|
|
9142
|
+
*/
|
|
9143
|
+
workflow: NotificationEventV1InvoiceWorkflowSettings;
|
|
9144
|
+
/** List of invoice lines representing each of the items sold to the customer. */
|
|
9145
|
+
lines?: NotificationEventV1InvoiceLine[];
|
|
9146
|
+
/** Information on when, how, and to whom the invoice should be paid. */
|
|
9147
|
+
payment?: NotificationEventV1InvoicePaymentTerms;
|
|
9148
|
+
/** Validation issues reported by the invoice workflow. */
|
|
9149
|
+
validationIssues?: NotificationEventV1ValidationIssue[];
|
|
9150
|
+
/** External IDs of the invoice in other apps such as Stripe. */
|
|
9151
|
+
externalIds?: NotificationEventV1InvoiceAppExternalIds;
|
|
9152
|
+
}
|
|
8841
9153
|
/** Invoice represents an invoice in the system. */
|
|
8842
9154
|
export interface NotificationEventV1Invoice {
|
|
8843
9155
|
/** A unique identifier for the resource. */
|
|
@@ -8988,7 +9300,7 @@ export interface NotificationEventInvoiceCreatedPayload {
|
|
|
8988
9300
|
/** When the event was generated. */
|
|
8989
9301
|
timestamp: Date;
|
|
8990
9302
|
/** The invoice the event refers to. */
|
|
8991
|
-
data:
|
|
9303
|
+
data: InvoiceCreatedV1Payload;
|
|
8992
9304
|
}
|
|
8993
9305
|
/** An invoice updated notification event payload. */
|
|
8994
9306
|
export interface NotificationEventInvoiceUpdatedPayload {
|
|
@@ -8999,7 +9311,7 @@ export interface NotificationEventInvoiceUpdatedPayload {
|
|
|
8999
9311
|
/** When the event was generated. */
|
|
9000
9312
|
timestamp: Date;
|
|
9001
9313
|
/** The invoice the event refers to. */
|
|
9002
|
-
data:
|
|
9314
|
+
data: InvoiceUpdatedV1Payload;
|
|
9003
9315
|
}
|
|
9004
9316
|
/** A flat fee charge for a customer. */
|
|
9005
9317
|
export interface ChargeFlatFee {
|