@openmeter/client 1.0.0-beta-1d51ec73a3d5 → 1.0.0-beta-05de7df7a13f
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 +17 -0
- package/dist/funcs/governance.d.ts +18 -0
- package/dist/funcs/governance.js +48 -0
- package/dist/funcs/index.d.ts +2 -0
- package/dist/funcs/index.js +2 -0
- package/dist/funcs/invoices.d.ts +51 -0
- package/dist/funcs/invoices.js +125 -0
- package/dist/index.d.ts +3 -1
- package/dist/lib/version.d.ts +1 -1
- package/dist/lib/version.js +1 -1
- package/dist/models/operations/governance.d.ts +9 -0
- package/dist/models/operations/governance.js +2 -0
- package/dist/models/operations/invoices.d.ts +45 -0
- package/dist/models/operations/invoices.js +2 -0
- package/dist/models/schemas.d.ts +3498 -1002
- package/dist/models/schemas.js +72 -0
- package/dist/models/types.d.ts +59 -9
- package/dist/sdk/internal.d.ts +92 -1
- package/dist/sdk/internal.js +111 -0
- package/package.json +1 -1
package/dist/models/schemas.js
CHANGED
|
@@ -4550,6 +4550,37 @@ export const updateBillingProfileResponse = profile;
|
|
|
4550
4550
|
export const deleteBillingProfilePathParams = z.object({
|
|
4551
4551
|
id: ulid,
|
|
4552
4552
|
});
|
|
4553
|
+
export const listInvoicesQueryParams = z.object({
|
|
4554
|
+
page: z
|
|
4555
|
+
.object({
|
|
4556
|
+
size: z.coerce
|
|
4557
|
+
.number()
|
|
4558
|
+
.int()
|
|
4559
|
+
.optional()
|
|
4560
|
+
.describe('The number of items to include per page.'),
|
|
4561
|
+
number: z.coerce.number().int().optional().describe('The page number.'),
|
|
4562
|
+
})
|
|
4563
|
+
.optional()
|
|
4564
|
+
.describe('Determines which page of the collection to retrieve.'),
|
|
4565
|
+
sort: sortQuery.optional(),
|
|
4566
|
+
filter: listInvoicesParamsFilter.optional(),
|
|
4567
|
+
});
|
|
4568
|
+
export const listInvoicesResponse = z.object({
|
|
4569
|
+
data: z.array(invoice),
|
|
4570
|
+
meta: paginatedMeta,
|
|
4571
|
+
});
|
|
4572
|
+
export const getInvoicePathParams = z.object({
|
|
4573
|
+
invoiceId: ulid,
|
|
4574
|
+
});
|
|
4575
|
+
export const getInvoiceResponse = invoice;
|
|
4576
|
+
export const updateInvoicePathParams = z.object({
|
|
4577
|
+
invoiceId: ulid,
|
|
4578
|
+
});
|
|
4579
|
+
export const updateInvoiceBody = updateInvoiceRequest;
|
|
4580
|
+
export const updateInvoiceResponse = invoice;
|
|
4581
|
+
export const deleteInvoicePathParams = z.object({
|
|
4582
|
+
invoiceId: ulid,
|
|
4583
|
+
});
|
|
4553
4584
|
export const createTaxCodeBody = createTaxCodeRequest;
|
|
4554
4585
|
export const createTaxCodeResponse = taxCode;
|
|
4555
4586
|
export const getTaxCodePathParams = z.object({
|
|
@@ -4841,6 +4872,11 @@ export const deletePlanAddonPathParams = z.object({
|
|
|
4841
4872
|
export const getOrganizationDefaultTaxCodesResponse = organizationDefaultTaxCodes;
|
|
4842
4873
|
export const updateOrganizationDefaultTaxCodesBody = updateOrganizationDefaultTaxCodesRequest;
|
|
4843
4874
|
export const updateOrganizationDefaultTaxCodesResponse = organizationDefaultTaxCodes;
|
|
4875
|
+
export const queryGovernanceAccessQueryParams = z.object({
|
|
4876
|
+
page: cursorPaginationQueryPage.optional(),
|
|
4877
|
+
});
|
|
4878
|
+
export const queryGovernanceAccessBody = governanceQueryRequest;
|
|
4879
|
+
export const queryGovernanceAccessResponse = governanceQueryResponse;
|
|
4844
4880
|
export const labelsWire = z
|
|
4845
4881
|
.record(z.string(), z.string())
|
|
4846
4882
|
.describe('Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types. Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "\\_".');
|
|
@@ -9410,6 +9446,37 @@ export const updateBillingProfileResponseWire = profileWire;
|
|
|
9410
9446
|
export const deleteBillingProfilePathParamsWire = z.object({
|
|
9411
9447
|
id: ulidWire,
|
|
9412
9448
|
});
|
|
9449
|
+
export const listInvoicesQueryParamsWire = z.object({
|
|
9450
|
+
page: z
|
|
9451
|
+
.strictObject({
|
|
9452
|
+
size: z.coerce
|
|
9453
|
+
.number()
|
|
9454
|
+
.int()
|
|
9455
|
+
.optional()
|
|
9456
|
+
.describe('The number of items to include per page.'),
|
|
9457
|
+
number: z.coerce.number().int().optional().describe('The page number.'),
|
|
9458
|
+
})
|
|
9459
|
+
.optional()
|
|
9460
|
+
.describe('Determines which page of the collection to retrieve.'),
|
|
9461
|
+
sort: sortQueryWire.optional(),
|
|
9462
|
+
filter: listInvoicesParamsFilterWire.optional(),
|
|
9463
|
+
});
|
|
9464
|
+
export const listInvoicesResponseWire = z.strictObject({
|
|
9465
|
+
data: z.array(invoiceWire),
|
|
9466
|
+
meta: paginatedMetaWire,
|
|
9467
|
+
});
|
|
9468
|
+
export const getInvoicePathParamsWire = z.object({
|
|
9469
|
+
invoiceId: ulidWire,
|
|
9470
|
+
});
|
|
9471
|
+
export const getInvoiceResponseWire = invoiceWire;
|
|
9472
|
+
export const updateInvoicePathParamsWire = z.object({
|
|
9473
|
+
invoiceId: ulidWire,
|
|
9474
|
+
});
|
|
9475
|
+
export const updateInvoiceBodyWire = updateInvoiceRequestWire;
|
|
9476
|
+
export const updateInvoiceResponseWire = invoiceWire;
|
|
9477
|
+
export const deleteInvoicePathParamsWire = z.object({
|
|
9478
|
+
invoiceId: ulidWire,
|
|
9479
|
+
});
|
|
9413
9480
|
export const createTaxCodeBodyWire = createTaxCodeRequestWire;
|
|
9414
9481
|
export const createTaxCodeResponseWire = taxCodeWire;
|
|
9415
9482
|
export const getTaxCodePathParamsWire = z.object({
|
|
@@ -9701,3 +9768,8 @@ export const deletePlanAddonPathParamsWire = z.object({
|
|
|
9701
9768
|
export const getOrganizationDefaultTaxCodesResponseWire = organizationDefaultTaxCodesWire;
|
|
9702
9769
|
export const updateOrganizationDefaultTaxCodesBodyWire = updateOrganizationDefaultTaxCodesRequestWire;
|
|
9703
9770
|
export const updateOrganizationDefaultTaxCodesResponseWire = organizationDefaultTaxCodesWire;
|
|
9771
|
+
export const queryGovernanceAccessQueryParamsWire = z.object({
|
|
9772
|
+
page: cursorPaginationQueryPageWire.optional(),
|
|
9773
|
+
});
|
|
9774
|
+
export const queryGovernanceAccessBodyWire = governanceQueryRequestWire;
|
|
9775
|
+
export const queryGovernanceAccessResponseWire = governanceQueryResponseWire;
|
package/dist/models/types.d.ts
CHANGED
|
@@ -3109,7 +3109,7 @@ export interface UpdateBillingInvoiceWorkflow {
|
|
|
3109
3109
|
/** Invoicing settings for this invoice. */
|
|
3110
3110
|
invoicing?: UpdateBillingInvoiceWorkflowInvoicingSettings;
|
|
3111
3111
|
/** Payment settings for this invoice. */
|
|
3112
|
-
payment?:
|
|
3112
|
+
payment?: UpdateBillingWorkflowPaymentSettings;
|
|
3113
3113
|
}
|
|
3114
3114
|
/** Access status for a single feature. */
|
|
3115
3115
|
export interface GovernanceFeatureAccess {
|
|
@@ -4138,7 +4138,7 @@ export interface InvoiceLineRateCard {
|
|
|
4138
4138
|
/** Rate card configuration snapshot for a usage-based invoice line. */
|
|
4139
4139
|
export interface UpdateInvoiceLineRateCard {
|
|
4140
4140
|
/** The price definition used to calculate charges for this line. */
|
|
4141
|
-
price:
|
|
4141
|
+
price: UpdatePrice;
|
|
4142
4142
|
/** Tax configuration snapshot for this line. */
|
|
4143
4143
|
taxConfig?: UpdateRateCardTaxConfig;
|
|
4144
4144
|
/** The feature key associated with this line's rate card. */
|
|
@@ -4861,7 +4861,7 @@ export interface InvoiceStandard {
|
|
|
4861
4861
|
* from the update request are deleted. Detailed (child) lines are always computed
|
|
4862
4862
|
* and cannot be edited directly.
|
|
4863
4863
|
*/
|
|
4864
|
-
lines?:
|
|
4864
|
+
lines?: InvoiceLine[];
|
|
4865
4865
|
}
|
|
4866
4866
|
/** InvoiceStandard update request. */
|
|
4867
4867
|
export interface UpdateInvoiceStandardRequest {
|
|
@@ -4892,11 +4892,11 @@ export interface UpdateInvoiceStandardRequest {
|
|
|
4892
4892
|
* from the update request are deleted. Detailed (child) lines are always computed
|
|
4893
4893
|
* and cannot be edited directly.
|
|
4894
4894
|
*/
|
|
4895
|
-
lines?:
|
|
4895
|
+
lines?: UpdateInvoiceLine[];
|
|
4896
4896
|
}
|
|
4897
4897
|
/** Page paginated response. */
|
|
4898
4898
|
export interface InvoicePagePaginatedResponse {
|
|
4899
|
-
data:
|
|
4899
|
+
data: Invoice[];
|
|
4900
4900
|
meta: PaginatedMeta;
|
|
4901
4901
|
}
|
|
4902
4902
|
/**
|
|
@@ -4965,6 +4965,8 @@ export type DateTimeFieldFilter = Date | {
|
|
|
4965
4965
|
export type SubscriptionEditTiming = 'immediate' | 'next_billing_cycle' | Date;
|
|
4966
4966
|
/** Payment settings for a billing workflow. */
|
|
4967
4967
|
export type WorkflowPaymentSettings = WorkflowPaymentChargeAutomaticallySettings | WorkflowPaymentSendInvoiceSettings;
|
|
4968
|
+
/** Payment settings for a billing workflow. */
|
|
4969
|
+
export type UpdateBillingWorkflowPaymentSettings = UpdateBillingWorkflowPaymentChargeAutomaticallySettings | UpdateBillingWorkflowPaymentSendInvoiceSettings;
|
|
4968
4970
|
/** A parameter that failed validation. */
|
|
4969
4971
|
export type InvalidParameter = InvalidParameterStandard | InvalidParameterMinimumLength | InvalidParameterMaximumLength | InvalidParameterChoiceItem | InvalidParameterDependentItem;
|
|
4970
4972
|
/**
|
|
@@ -4991,10 +4993,38 @@ export type WorkflowCollectionAlignment = WorkflowCollectionAlignmentSubscriptio
|
|
|
4991
4993
|
export type App = AppStripe | AppSandbox | AppExternalInvoicing;
|
|
4992
4994
|
/** Price. */
|
|
4993
4995
|
export type Price = PriceFree | PriceFlat | PriceUnit | PriceGraduated | PriceVolume;
|
|
4996
|
+
/** Price. */
|
|
4997
|
+
export type UpdatePrice = UpdatePriceFree | UpdatePriceFlat | UpdatePriceUnit | UpdatePriceGraduated | UpdatePriceVolume;
|
|
4994
4998
|
/** Customer charge. */
|
|
4995
4999
|
export type CreateChargeRequest = CreateChargeFlatFeeRequest | CreateChargeUsageBasedRequest;
|
|
4996
5000
|
/** Customer charge. */
|
|
4997
5001
|
export type Charge = ChargeFlatFee | ChargeUsageBased;
|
|
5002
|
+
/**
|
|
5003
|
+
* A top-level line item on an invoice.
|
|
5004
|
+
*
|
|
5005
|
+
* Each line represents a single charge, typically associated with a rate card from
|
|
5006
|
+
* a subscription. Detailed (child) lines are nested under `detailed_lines` when
|
|
5007
|
+
* present.
|
|
5008
|
+
*/
|
|
5009
|
+
export type InvoiceLine = InvoiceStandardLine;
|
|
5010
|
+
/**
|
|
5011
|
+
* A top-level line item on an invoice.
|
|
5012
|
+
*
|
|
5013
|
+
* Each line represents a single charge, typically associated with a rate card from
|
|
5014
|
+
* a subscription. Detailed (child) lines are nested under `detailed_lines` when
|
|
5015
|
+
* present.
|
|
5016
|
+
*/
|
|
5017
|
+
export type UpdateInvoiceLine = UpdateInvoiceStandardLine;
|
|
5018
|
+
/**
|
|
5019
|
+
* An invoice issued to a customer.
|
|
5020
|
+
*
|
|
5021
|
+
* The `type` field determines the concrete variant:
|
|
5022
|
+
*
|
|
5023
|
+
* - `standard`: a standard invoice for charges owed.
|
|
5024
|
+
*/
|
|
5025
|
+
export type Invoice = InvoiceStandard;
|
|
5026
|
+
/** UpdateInvoiceRequest update request. */
|
|
5027
|
+
export type UpdateInvoiceRequest = UpdateInvoiceStandardRequest;
|
|
4998
5028
|
/**
|
|
4999
5029
|
* Sort query.
|
|
5000
5030
|
*
|
|
@@ -5405,7 +5435,7 @@ export interface UpdateBillingInvoiceWorkflowInput {
|
|
|
5405
5435
|
/** Invoicing settings for this invoice. */
|
|
5406
5436
|
invoicing?: UpdateBillingInvoiceWorkflowInvoicingSettingsInput;
|
|
5407
5437
|
/** Payment settings for this invoice. */
|
|
5408
|
-
payment?:
|
|
5438
|
+
payment?: UpdateBillingWorkflowPaymentSettingsInput;
|
|
5409
5439
|
}
|
|
5410
5440
|
/** CreditGrant create request. */
|
|
5411
5441
|
export interface CreateCreditGrantRequestInput {
|
|
@@ -6438,7 +6468,7 @@ export interface InvoiceStandardInput {
|
|
|
6438
6468
|
* from the update request are deleted. Detailed (child) lines are always computed
|
|
6439
6469
|
* and cannot be edited directly.
|
|
6440
6470
|
*/
|
|
6441
|
-
lines?:
|
|
6471
|
+
lines?: InvoiceLineInput[];
|
|
6442
6472
|
}
|
|
6443
6473
|
/** InvoiceStandard update request. */
|
|
6444
6474
|
export interface UpdateInvoiceStandardRequestInput {
|
|
@@ -6469,17 +6499,37 @@ export interface UpdateInvoiceStandardRequestInput {
|
|
|
6469
6499
|
* from the update request are deleted. Detailed (child) lines are always computed
|
|
6470
6500
|
* and cannot be edited directly.
|
|
6471
6501
|
*/
|
|
6472
|
-
lines?:
|
|
6502
|
+
lines?: UpdateInvoiceLine[];
|
|
6473
6503
|
}
|
|
6474
6504
|
/** Page paginated response. */
|
|
6475
6505
|
export interface InvoicePagePaginatedResponseInput {
|
|
6476
|
-
data:
|
|
6506
|
+
data: InvoiceInput[];
|
|
6477
6507
|
meta: PaginatedMeta;
|
|
6478
6508
|
}
|
|
6479
6509
|
/** Payment settings for a billing workflow. */
|
|
6480
6510
|
export type WorkflowPaymentSettingsInput = WorkflowPaymentChargeAutomaticallySettings | WorkflowPaymentSendInvoiceSettingsInput;
|
|
6511
|
+
/** Payment settings for a billing workflow. */
|
|
6512
|
+
export type UpdateBillingWorkflowPaymentSettingsInput = UpdateBillingWorkflowPaymentChargeAutomaticallySettings | UpdateBillingWorkflowPaymentSendInvoiceSettingsInput;
|
|
6481
6513
|
/**
|
|
6482
6514
|
* Entitlement template configured on a rate card. The feature is taken from the
|
|
6483
6515
|
* rate card itself, so it is omitted here.
|
|
6484
6516
|
*/
|
|
6485
6517
|
export type RateCardEntitlementInput = RateCardMeteredEntitlementInput | RateCardStaticEntitlement | RateCardBooleanEntitlement;
|
|
6518
|
+
/**
|
|
6519
|
+
* A top-level line item on an invoice.
|
|
6520
|
+
*
|
|
6521
|
+
* Each line represents a single charge, typically associated with a rate card from
|
|
6522
|
+
* a subscription. Detailed (child) lines are nested under `detailed_lines` when
|
|
6523
|
+
* present.
|
|
6524
|
+
*/
|
|
6525
|
+
export type InvoiceLineInput = InvoiceStandardLineInput;
|
|
6526
|
+
/**
|
|
6527
|
+
* An invoice issued to a customer.
|
|
6528
|
+
*
|
|
6529
|
+
* The `type` field determines the concrete variant:
|
|
6530
|
+
*
|
|
6531
|
+
* - `standard`: a standard invoice for charges owed.
|
|
6532
|
+
*/
|
|
6533
|
+
export type InvoiceInput = InvoiceStandardInput;
|
|
6534
|
+
/** UpdateInvoiceRequest update request. */
|
|
6535
|
+
export type UpdateInvoiceRequestInput = UpdateInvoiceStandardRequestInput;
|
package/dist/sdk/internal.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type RequestOptions } from '../lib/types.js';
|
|
3
3
|
import type { CreateSubscriptionAddonRequest, CreateSubscriptionAddonResponse } from '../models/operations/subscriptions.js';
|
|
4
|
+
import type { ListInvoicesRequest, ListInvoicesResponse, GetInvoiceRequest, GetInvoiceResponse, UpdateInvoiceRequest, UpdateInvoiceResponse, DeleteInvoiceRequest, DeleteInvoiceResponse } from '../models/operations/invoices.js';
|
|
4
5
|
import type { ListCurrenciesRequest, ListCurrenciesResponse, CreateCustomCurrencyRequest, CreateCustomCurrencyResponse, ListCostBasesRequest, ListCostBasesResponse, CreateCostBasisRequest, CreateCostBasisResponse } from '../models/operations/currencies.js';
|
|
5
|
-
import type {
|
|
6
|
+
import type { QueryGovernanceAccessRequest, QueryGovernanceAccessResponse } from '../models/operations/governance.js';
|
|
7
|
+
import type { CostBasis, Currency, Invoice } from '../models/types.js';
|
|
6
8
|
/**
|
|
7
9
|
* Operations marked internal in the API definition. They are not part of
|
|
8
10
|
* the customer surface: they may require additional permissions, and they
|
|
@@ -13,8 +15,12 @@ export declare class Internal {
|
|
|
13
15
|
constructor(_client: Client);
|
|
14
16
|
private _subscriptions?;
|
|
15
17
|
get subscriptions(): InternalSubscriptions;
|
|
18
|
+
private _invoices?;
|
|
19
|
+
get invoices(): InternalInvoices;
|
|
16
20
|
private _currencies?;
|
|
17
21
|
get currencies(): InternalCurrencies;
|
|
22
|
+
private _governance?;
|
|
23
|
+
get governance(): InternalGovernance;
|
|
18
24
|
}
|
|
19
25
|
export declare class InternalSubscriptions {
|
|
20
26
|
private readonly _client;
|
|
@@ -28,6 +34,72 @@ export declare class InternalSubscriptions {
|
|
|
28
34
|
*/
|
|
29
35
|
createAddon(request: CreateSubscriptionAddonRequest, options?: RequestOptions): Promise<CreateSubscriptionAddonResponse>;
|
|
30
36
|
}
|
|
37
|
+
export declare class InternalInvoices {
|
|
38
|
+
private readonly _client;
|
|
39
|
+
constructor(_client: Client);
|
|
40
|
+
/**
|
|
41
|
+
* List billing invoices
|
|
42
|
+
*
|
|
43
|
+
* List billing invoices.
|
|
44
|
+
*
|
|
45
|
+
* Returns a page of invoices. Gathering invoices are never included. Use `filter`
|
|
46
|
+
* to narrow by status, customer, dates, or service period start. Use `sort` to
|
|
47
|
+
* control ordering.
|
|
48
|
+
*
|
|
49
|
+
* GET /openmeter/billing/invoices
|
|
50
|
+
*/
|
|
51
|
+
list(request?: ListInvoicesRequest, options?: RequestOptions): Promise<ListInvoicesResponse>;
|
|
52
|
+
/**
|
|
53
|
+
* List billing invoices
|
|
54
|
+
*
|
|
55
|
+
* List billing invoices.
|
|
56
|
+
*
|
|
57
|
+
* Returns a page of invoices. Gathering invoices are never included. Use `filter`
|
|
58
|
+
* to narrow by status, customer, dates, or service period start. Use `sort` to
|
|
59
|
+
* control ordering.
|
|
60
|
+
*
|
|
61
|
+
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
62
|
+
*
|
|
63
|
+
* GET /openmeter/billing/invoices
|
|
64
|
+
*/
|
|
65
|
+
listAll(request?: ListInvoicesRequest, options?: RequestOptions): AsyncIterable<Invoice>;
|
|
66
|
+
/**
|
|
67
|
+
* Get a billing invoice
|
|
68
|
+
*
|
|
69
|
+
* Get a billing invoice by ID.
|
|
70
|
+
*
|
|
71
|
+
* Returns the full invoice resource including line items, status details, totals,
|
|
72
|
+
* and workflow configuration snapshot.
|
|
73
|
+
*
|
|
74
|
+
* GET /openmeter/billing/invoices/{invoiceId}
|
|
75
|
+
*/
|
|
76
|
+
get(request: GetInvoiceRequest, options?: RequestOptions): Promise<GetInvoiceResponse>;
|
|
77
|
+
/**
|
|
78
|
+
* Update a billing invoice
|
|
79
|
+
*
|
|
80
|
+
* Update a billing invoice.
|
|
81
|
+
*
|
|
82
|
+
* Only the mutable fields of the invoice can be edited: description, labels,
|
|
83
|
+
* supplier, customer, workflow settings, and top-level lines. Top-level lines are
|
|
84
|
+
* matched by `id`; lines without an `id` are created, and existing lines omitted
|
|
85
|
+
* from `lines` are deleted. Detailed (child) lines are always computed and cannot
|
|
86
|
+
* be edited directly. Only invoices in draft status can be updated.
|
|
87
|
+
*
|
|
88
|
+
* PUT /openmeter/billing/invoices/{invoiceId}
|
|
89
|
+
*/
|
|
90
|
+
update(request: UpdateInvoiceRequest, options?: RequestOptions): Promise<UpdateInvoiceResponse>;
|
|
91
|
+
/**
|
|
92
|
+
* Delete a billing invoice
|
|
93
|
+
*
|
|
94
|
+
* Delete a billing invoice.
|
|
95
|
+
*
|
|
96
|
+
* Only standard invoices in draft status can be deleted. Deleting an invoice will
|
|
97
|
+
* also delete all associated line items and workflow configuration.
|
|
98
|
+
*
|
|
99
|
+
* DELETE /openmeter/billing/invoices/{invoiceId}
|
|
100
|
+
*/
|
|
101
|
+
delete(request: DeleteInvoiceRequest, options?: RequestOptions): Promise<DeleteInvoiceResponse>;
|
|
102
|
+
}
|
|
31
103
|
export declare class InternalCurrencies {
|
|
32
104
|
private readonly _client;
|
|
33
105
|
constructor(_client: Client);
|
|
@@ -87,3 +159,22 @@ export declare class InternalCurrencies {
|
|
|
87
159
|
*/
|
|
88
160
|
createCostBasis(request: CreateCostBasisRequest, options?: RequestOptions): Promise<CreateCostBasisResponse>;
|
|
89
161
|
}
|
|
162
|
+
export declare class InternalGovernance {
|
|
163
|
+
private readonly _client;
|
|
164
|
+
constructor(_client: Client);
|
|
165
|
+
/**
|
|
166
|
+
* Query governance access
|
|
167
|
+
*
|
|
168
|
+
* Query feature access for a list of customers.
|
|
169
|
+
*
|
|
170
|
+
* The endpoint resolves each provided identifier to a customer and returns the
|
|
171
|
+
* access status for the requested features, plus optional credit balance
|
|
172
|
+
* availability.
|
|
173
|
+
*
|
|
174
|
+
* _Designed to be called on a fixed refresh interval and the query response is
|
|
175
|
+
* intended to be cached._
|
|
176
|
+
*
|
|
177
|
+
* POST /openmeter/governance/query
|
|
178
|
+
*/
|
|
179
|
+
queryAccess(request: QueryGovernanceAccessRequest, options?: RequestOptions): Promise<QueryGovernanceAccessResponse>;
|
|
180
|
+
}
|
package/dist/sdk/internal.js
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
import { unwrap } from '../lib/types.js';
|
|
3
3
|
import { paginatePages } from '../lib/paginate.js';
|
|
4
4
|
import { createSubscriptionAddon } from '../funcs/subscriptions.js';
|
|
5
|
+
import { listInvoices, getInvoice, updateInvoice, deleteInvoice, } from '../funcs/invoices.js';
|
|
5
6
|
import { listCurrencies, createCustomCurrency, listCostBases, createCostBasis, } from '../funcs/currencies.js';
|
|
7
|
+
import { queryGovernanceAccess } from '../funcs/governance.js';
|
|
6
8
|
/**
|
|
7
9
|
* Operations marked internal in the API definition. They are not part of
|
|
8
10
|
* the customer surface: they may require additional permissions, and they
|
|
@@ -17,10 +19,18 @@ export class Internal {
|
|
|
17
19
|
get subscriptions() {
|
|
18
20
|
return (this._subscriptions ??= new InternalSubscriptions(this._client));
|
|
19
21
|
}
|
|
22
|
+
_invoices;
|
|
23
|
+
get invoices() {
|
|
24
|
+
return (this._invoices ??= new InternalInvoices(this._client));
|
|
25
|
+
}
|
|
20
26
|
_currencies;
|
|
21
27
|
get currencies() {
|
|
22
28
|
return (this._currencies ??= new InternalCurrencies(this._client));
|
|
23
29
|
}
|
|
30
|
+
_governance;
|
|
31
|
+
get governance() {
|
|
32
|
+
return (this._governance ??= new InternalGovernance(this._client));
|
|
33
|
+
}
|
|
24
34
|
}
|
|
25
35
|
export class InternalSubscriptions {
|
|
26
36
|
_client;
|
|
@@ -38,6 +48,84 @@ export class InternalSubscriptions {
|
|
|
38
48
|
return unwrap(await createSubscriptionAddon(this._client, request, options));
|
|
39
49
|
}
|
|
40
50
|
}
|
|
51
|
+
export class InternalInvoices {
|
|
52
|
+
_client;
|
|
53
|
+
constructor(_client) {
|
|
54
|
+
this._client = _client;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* List billing invoices
|
|
58
|
+
*
|
|
59
|
+
* List billing invoices.
|
|
60
|
+
*
|
|
61
|
+
* Returns a page of invoices. Gathering invoices are never included. Use `filter`
|
|
62
|
+
* to narrow by status, customer, dates, or service period start. Use `sort` to
|
|
63
|
+
* control ordering.
|
|
64
|
+
*
|
|
65
|
+
* GET /openmeter/billing/invoices
|
|
66
|
+
*/
|
|
67
|
+
async list(request, options) {
|
|
68
|
+
return unwrap(await listInvoices(this._client, request, options));
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* List billing invoices
|
|
72
|
+
*
|
|
73
|
+
* List billing invoices.
|
|
74
|
+
*
|
|
75
|
+
* Returns a page of invoices. Gathering invoices are never included. Use `filter`
|
|
76
|
+
* to narrow by status, customer, dates, or service period start. Use `sort` to
|
|
77
|
+
* control ordering.
|
|
78
|
+
*
|
|
79
|
+
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
80
|
+
*
|
|
81
|
+
* GET /openmeter/billing/invoices
|
|
82
|
+
*/
|
|
83
|
+
listAll(request, options) {
|
|
84
|
+
return paginatePages((req, opts) => listInvoices(this._client, req, opts), request ?? {}, options);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Get a billing invoice
|
|
88
|
+
*
|
|
89
|
+
* Get a billing invoice by ID.
|
|
90
|
+
*
|
|
91
|
+
* Returns the full invoice resource including line items, status details, totals,
|
|
92
|
+
* and workflow configuration snapshot.
|
|
93
|
+
*
|
|
94
|
+
* GET /openmeter/billing/invoices/{invoiceId}
|
|
95
|
+
*/
|
|
96
|
+
async get(request, options) {
|
|
97
|
+
return unwrap(await getInvoice(this._client, request, options));
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Update a billing invoice
|
|
101
|
+
*
|
|
102
|
+
* Update a billing invoice.
|
|
103
|
+
*
|
|
104
|
+
* Only the mutable fields of the invoice can be edited: description, labels,
|
|
105
|
+
* supplier, customer, workflow settings, and top-level lines. Top-level lines are
|
|
106
|
+
* matched by `id`; lines without an `id` are created, and existing lines omitted
|
|
107
|
+
* from `lines` are deleted. Detailed (child) lines are always computed and cannot
|
|
108
|
+
* be edited directly. Only invoices in draft status can be updated.
|
|
109
|
+
*
|
|
110
|
+
* PUT /openmeter/billing/invoices/{invoiceId}
|
|
111
|
+
*/
|
|
112
|
+
async update(request, options) {
|
|
113
|
+
return unwrap(await updateInvoice(this._client, request, options));
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Delete a billing invoice
|
|
117
|
+
*
|
|
118
|
+
* Delete a billing invoice.
|
|
119
|
+
*
|
|
120
|
+
* Only standard invoices in draft status can be deleted. Deleting an invoice will
|
|
121
|
+
* also delete all associated line items and workflow configuration.
|
|
122
|
+
*
|
|
123
|
+
* DELETE /openmeter/billing/invoices/{invoiceId}
|
|
124
|
+
*/
|
|
125
|
+
async delete(request, options) {
|
|
126
|
+
return unwrap(await deleteInvoice(this._client, request, options));
|
|
127
|
+
}
|
|
128
|
+
}
|
|
41
129
|
export class InternalCurrencies {
|
|
42
130
|
_client;
|
|
43
131
|
constructor(_client) {
|
|
@@ -111,3 +199,26 @@ export class InternalCurrencies {
|
|
|
111
199
|
return unwrap(await createCostBasis(this._client, request, options));
|
|
112
200
|
}
|
|
113
201
|
}
|
|
202
|
+
export class InternalGovernance {
|
|
203
|
+
_client;
|
|
204
|
+
constructor(_client) {
|
|
205
|
+
this._client = _client;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Query governance access
|
|
209
|
+
*
|
|
210
|
+
* Query feature access for a list of customers.
|
|
211
|
+
*
|
|
212
|
+
* The endpoint resolves each provided identifier to a customer and returns the
|
|
213
|
+
* access status for the requested features, plus optional credit balance
|
|
214
|
+
* availability.
|
|
215
|
+
*
|
|
216
|
+
* _Designed to be called on a fixed refresh interval and the query response is
|
|
217
|
+
* intended to be cached._
|
|
218
|
+
*
|
|
219
|
+
* POST /openmeter/governance/query
|
|
220
|
+
*/
|
|
221
|
+
async queryAccess(request, options) {
|
|
222
|
+
return unwrap(await queryGovernanceAccess(this._client, request, options));
|
|
223
|
+
}
|
|
224
|
+
}
|