@openmeter/client 1.0.0-beta-89ad46498d71 → 1.0.0-beta-2b50cff9e992
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 -10
- package/dist/funcs/customers.d.ts +15 -1
- package/dist/funcs/customers.js +57 -0
- 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/operations/customers.d.ts +22 -1
- package/dist/models/schemas.d.ts +222 -0
- package/dist/models/schemas.js +137 -0
- package/dist/models/types.d.ts +67 -0
- package/dist/sdk/entitlements.d.ts +1 -9
- package/dist/sdk/entitlements.js +1 -11
- package/dist/sdk/internal.d.ts +30 -1
- package/dist/sdk/internal.js +38 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -36,6 +36,7 @@ TypeSpec definitions and ships fully-typed request and response models.
|
|
|
36
36
|
- [Defaults](#defaults)
|
|
37
37
|
- [Internal Operations](#internal-operations)
|
|
38
38
|
- [Internal Customers](#internal-customers)
|
|
39
|
+
- [Internal Entitlements](#internal-entitlements)
|
|
39
40
|
- [Internal Subscriptions](#internal-subscriptions)
|
|
40
41
|
- [Internal Apps](#internal-apps)
|
|
41
42
|
- [Internal Invoices](#internal-invoices)
|
|
@@ -305,10 +306,9 @@ The full call path, HTTP route, and a short description are listed below.
|
|
|
305
306
|
|
|
306
307
|
### Entitlements
|
|
307
308
|
|
|
308
|
-
| Method | HTTP
|
|
309
|
-
| ---------------------------------------- |
|
|
310
|
-
| `client.entitlements.listCustomerAccess` | `GET /openmeter/customers/{customerId}/entitlement-access`
|
|
311
|
-
| `client.entitlements.getCustomerAccess` | `GET /openmeter/customers/{customerId}/entitlement-access/features/{featureKey}` | Get the customer's access to a single feature. |
|
|
309
|
+
| Method | HTTP | Description |
|
|
310
|
+
| ---------------------------------------- | ---------------------------------------------------------- | -------------------------------- |
|
|
311
|
+
| `client.entitlements.listCustomerAccess` | `GET /openmeter/customers/{customerId}/entitlement-access` | List customer entitlement access |
|
|
312
312
|
|
|
313
313
|
### Subscriptions
|
|
314
314
|
|
|
@@ -421,12 +421,19 @@ they can change or be removed without notice or semver consideration.
|
|
|
421
421
|
|
|
422
422
|
### Internal Customers
|
|
423
423
|
|
|
424
|
-
| Method
|
|
425
|
-
|
|
|
426
|
-
| `client.internal.customers.entitlements.create`
|
|
427
|
-
| `client.internal.customers.
|
|
428
|
-
| `client.internal.customers.
|
|
429
|
-
| `client.internal.customers.charges.
|
|
424
|
+
| Method | HTTP | Description |
|
|
425
|
+
| --------------------------------------------------- | ---------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
426
|
+
| `client.internal.customers.entitlements.create` | `POST /openmeter/customers/{customerId}/entitlements` | Create an entitlement for the customer. A customer can have only one active entitlement per feature. The feature must be compatible with the entitlement type. Entitlements cannot be modified after creation, only deleted. |
|
|
427
|
+
| `client.internal.customers.entitlements.getHistory` | `GET /openmeter/customers/{customerId}/entitlements/{entitlementId}/history` | Get the balance and usage history of a metered entitlement. The queried range may span multiple usage periods. `windowed_history` groups usage into windows of the requested size and reports the balance at the start of each window. `burndown_history` lists the periods in which grants were consumed in a fixed order, together with the usage taken from each grant. |
|
|
428
|
+
| `client.internal.customers.credits.grants.void` | `POST /openmeter/customers/{customerId}/credits/grants/{creditGrantId}/void` | Void a credit grant, forfeiting the remaining unused balance. Voiding is a forward-looking, irreversible operation. Credits already consumed by usage remain unaffected — only the remaining balance is forfeited. The grant reads as `voided` status afterwards. Payment state is not adjusted when `payment_adjustment` is `none`, so invoice-backed or externally collected payments may still collect the original amount. Only `active` grants can be voided; voiding a pending, expired, or fully consumed grant returns a conflict. Retrying a successful void is an idempotent success. |
|
|
429
|
+
| `client.internal.customers.charges.list` | `GET /openmeter/customers/{customerId}/charges` | List customer charges. Returns the customer's charges that are represented as either flat fee or usage-based charges. |
|
|
430
|
+
| `client.internal.customers.charges.create` | `POST /openmeter/customers/{customerId}/charges` | Create customer charge. |
|
|
431
|
+
|
|
432
|
+
### Internal Entitlements
|
|
433
|
+
|
|
434
|
+
| Method | HTTP | Description |
|
|
435
|
+
| ------------------------------------------------ | -------------------------------------------------------------------------------- | ---------------------------------------------- |
|
|
436
|
+
| `client.internal.entitlements.getCustomerAccess` | `GET /openmeter/customers/{customerId}/entitlement-access/features/{featureKey}` | Get the customer's access to a single feature. |
|
|
430
437
|
|
|
431
438
|
### Internal Subscriptions
|
|
432
439
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type Result, type RequestOptions } from '../lib/types.js';
|
|
3
|
-
import type { CreateCustomerRequest, CreateCustomerResponse, GetCustomerRequest, GetCustomerResponse, ListCustomersRequest, ListCustomersResponse, UpsertCustomerRequest, UpsertCustomerResponse, DeleteCustomerRequest, DeleteCustomerResponse, GetCustomerBillingRequest, GetCustomerBillingResponse, UpdateCustomerBillingRequest, UpdateCustomerBillingResponse, UpdateCustomerBillingAppDataRequest, UpdateCustomerBillingAppDataResponse, CreateCustomerStripeCheckoutSessionRequest, CreateCustomerStripeCheckoutSessionResponse, CreateCustomerStripePortalSessionRequest, CreateCustomerStripePortalSessionResponse, CreateCustomerEntitlementRequest, CreateCustomerEntitlementResponse, CreateCreditGrantRequest, CreateCreditGrantResponse, GetCreditGrantRequest, GetCreditGrantResponse, ListCreditGrantsRequest, ListCreditGrantsResponse, GetCustomerCreditBalanceRequest, GetCustomerCreditBalanceResponse, CreateCreditAdjustmentRequest, CreateCreditAdjustmentResponse, VoidCreditGrantRequest, VoidCreditGrantResponse, UpdateCreditGrantExternalSettlementRequest, UpdateCreditGrantExternalSettlementResponse, ListCreditTransactionsRequest, ListCreditTransactionsResponse, ListCustomerChargesRequest, ListCustomerChargesResponse, CreateCustomerChargesRequest, CreateCustomerChargesResponse } from '../models/operations/customers.js';
|
|
3
|
+
import type { CreateCustomerRequest, CreateCustomerResponse, GetCustomerRequest, GetCustomerResponse, ListCustomersRequest, ListCustomersResponse, UpsertCustomerRequest, UpsertCustomerResponse, DeleteCustomerRequest, DeleteCustomerResponse, GetCustomerBillingRequest, GetCustomerBillingResponse, UpdateCustomerBillingRequest, UpdateCustomerBillingResponse, UpdateCustomerBillingAppDataRequest, UpdateCustomerBillingAppDataResponse, CreateCustomerStripeCheckoutSessionRequest, CreateCustomerStripeCheckoutSessionResponse, CreateCustomerStripePortalSessionRequest, CreateCustomerStripePortalSessionResponse, CreateCustomerEntitlementRequest, CreateCustomerEntitlementResponse, GetCustomerEntitlementHistoryRequest, GetCustomerEntitlementHistoryResponse, CreateCreditGrantRequest, CreateCreditGrantResponse, GetCreditGrantRequest, GetCreditGrantResponse, ListCreditGrantsRequest, ListCreditGrantsResponse, GetCustomerCreditBalanceRequest, GetCustomerCreditBalanceResponse, CreateCreditAdjustmentRequest, CreateCreditAdjustmentResponse, VoidCreditGrantRequest, VoidCreditGrantResponse, UpdateCreditGrantExternalSettlementRequest, UpdateCreditGrantExternalSettlementResponse, ListCreditTransactionsRequest, ListCreditTransactionsResponse, ListCustomerChargesRequest, ListCustomerChargesResponse, CreateCustomerChargesRequest, CreateCustomerChargesResponse } from '../models/operations/customers.js';
|
|
4
4
|
/**
|
|
5
5
|
* Create customer
|
|
6
6
|
*
|
|
@@ -92,6 +92,20 @@ export declare function createCustomerStripePortalSession(client: Client, req: C
|
|
|
92
92
|
* POST /openmeter/customers/{customerId}/entitlements
|
|
93
93
|
*/
|
|
94
94
|
export declare function createCustomerEntitlement(client: Client, req: CreateCustomerEntitlementRequest, options?: RequestOptions): Promise<Result<CreateCustomerEntitlementResponse>>;
|
|
95
|
+
/**
|
|
96
|
+
* Get customer entitlement history
|
|
97
|
+
*
|
|
98
|
+
* Get the balance and usage history of a metered entitlement. The queried range
|
|
99
|
+
* may span multiple usage periods.
|
|
100
|
+
*
|
|
101
|
+
* `windowed_history` groups usage into windows of the requested size and reports
|
|
102
|
+
* the balance at the start of each window. `burndown_history` lists the periods in
|
|
103
|
+
* which grants were consumed in a fixed order, together with the usage taken from
|
|
104
|
+
* each grant.
|
|
105
|
+
*
|
|
106
|
+
* GET /openmeter/customers/{customerId}/entitlements/{entitlementId}/history
|
|
107
|
+
*/
|
|
108
|
+
export declare function getCustomerEntitlementHistory(client: Client, req: GetCustomerEntitlementHistoryRequest, options?: RequestOptions): Promise<Result<GetCustomerEntitlementHistoryResponse>>;
|
|
95
109
|
/**
|
|
96
110
|
* Create a new credit grant
|
|
97
111
|
*
|
package/dist/funcs/customers.js
CHANGED
|
@@ -394,6 +394,63 @@ export function createCustomerEntitlement(client, req, options) {
|
|
|
394
394
|
});
|
|
395
395
|
});
|
|
396
396
|
}
|
|
397
|
+
/**
|
|
398
|
+
* Get customer entitlement history
|
|
399
|
+
*
|
|
400
|
+
* Get the balance and usage history of a metered entitlement. The queried range
|
|
401
|
+
* may span multiple usage periods.
|
|
402
|
+
*
|
|
403
|
+
* `windowed_history` groups usage into windows of the requested size and reports
|
|
404
|
+
* the balance at the start of each window. `burndown_history` lists the periods in
|
|
405
|
+
* which grants were consumed in a fixed order, together with the usage taken from
|
|
406
|
+
* each grant.
|
|
407
|
+
*
|
|
408
|
+
* GET /openmeter/customers/{customerId}/entitlements/{entitlementId}/history
|
|
409
|
+
*/
|
|
410
|
+
export function getCustomerEntitlementHistory(client, req, options) {
|
|
411
|
+
return request(() => {
|
|
412
|
+
const pathParamsInput = {
|
|
413
|
+
customerId: req.customerId,
|
|
414
|
+
entitlementId: req.entitlementId,
|
|
415
|
+
};
|
|
416
|
+
const pathParams = client._options.validate
|
|
417
|
+
? toPathWire(pathParamsInput, schemas.getCustomerEntitlementHistoryPathParams)
|
|
418
|
+
: pathParamsInput;
|
|
419
|
+
if (client._options.validate) {
|
|
420
|
+
assertValid(schemas.getCustomerEntitlementHistoryPathParamsWire, pathParams);
|
|
421
|
+
}
|
|
422
|
+
const path = `openmeter/customers/${(() => {
|
|
423
|
+
if (pathParams.customerId === undefined) {
|
|
424
|
+
throw new Error('missing path parameter: customerId');
|
|
425
|
+
}
|
|
426
|
+
return encodeURIComponent(String(pathParams.customerId));
|
|
427
|
+
})()}/entitlements/${(() => {
|
|
428
|
+
if (pathParams.entitlementId === undefined) {
|
|
429
|
+
throw new Error('missing path parameter: entitlementId');
|
|
430
|
+
}
|
|
431
|
+
return encodeURIComponent(String(pathParams.entitlementId));
|
|
432
|
+
})()}/history`;
|
|
433
|
+
const query = toWire({
|
|
434
|
+
from: req.from,
|
|
435
|
+
to: req.to,
|
|
436
|
+
windowSize: req.windowSize,
|
|
437
|
+
timeZone: req.timeZone,
|
|
438
|
+
}, schemas.getCustomerEntitlementHistoryQueryParams);
|
|
439
|
+
if (client._options.validate) {
|
|
440
|
+
assertValid(schemas.getCustomerEntitlementHistoryQueryParamsWire, query);
|
|
441
|
+
}
|
|
442
|
+
const searchParams = toURLSearchParams(query);
|
|
443
|
+
return http(client)
|
|
444
|
+
.get(path, { ...options, searchParams })
|
|
445
|
+
.json()
|
|
446
|
+
.then((data) => {
|
|
447
|
+
if (client._options.validate) {
|
|
448
|
+
assertValid(schemas.getCustomerEntitlementHistoryResponseWire, data);
|
|
449
|
+
}
|
|
450
|
+
return fromWire(data, schemas.getCustomerEntitlementHistoryResponse);
|
|
451
|
+
});
|
|
452
|
+
});
|
|
453
|
+
}
|
|
397
454
|
/**
|
|
398
455
|
* Create a new credit grant
|
|
399
456
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -42,4 +42,4 @@ export type * from './models/operations/addons.js';
|
|
|
42
42
|
export type * from './models/operations/planAddons.js';
|
|
43
43
|
export type * from './models/operations/defaults.js';
|
|
44
44
|
export type * from './models/operations/entitlementAccess.js';
|
|
45
|
-
export type { Labels, CursorPaginationQueryPage, SortQuery, IngestedEventValidationError, CursorMetaPage, BaseError, PageMeta, QueryFilterString, AppStripeCheckoutSessionCustomTextParams, AppStripeCreateCustomerPortalSessionOptions, CreateLabels, PriceFree, RateCardStaticEntitlement, RateCardBooleanEntitlement, TaxConfigStripe, TaxConfigExternalInvoicing, InvoiceExternalReferences, InvoiceAvailableActionDetails, InvoiceWorkflowInvoicingSettings, WorkflowPaymentChargeAutomaticallySettings, WorkflowPaymentSendInvoiceSettings, ChargeFlatFeeDiscounts, SubscriptionEditRemoveItem, SubscriptionEditUnscheduleEdit, UpdateLabels, InstallAppStripeWithApiKey, InstallAppSandbox, InstallAppExternalInvoicing, WorkflowCollectionAlignmentSubscription, InvoiceLineExternalReferences, UpdateBillingInvoiceWorkflowInvoicingSettings, UpdateBillingWorkflowPaymentChargeAutomaticallySettings, UpdateBillingWorkflowPaymentSendInvoiceSettings, UpdatePriceFree, LlmCostProvider, LlmCostModel, ProductCatalogValidationError, EntitlementAccessQueryRequestCustomers, EntitlementAccessQueryRequestFeatures, QueryFilterInteger, QueryFilterFloat, QueryFilterBoolean, PagePaginationQuery, PublicLabels, SystemAccountAccessToken, PersonalAccessToken, KonnectAccessToken, AppCustomerDataStripe, AppCustomerDataExternalInvoicing, CreateChargeCostBasisDynamic, ChargeCostBasisDynamic, CurrencyFiat, ListCostBasesParamsFilter, CreateCurrencyCustomRequest, EntitlementAccessValue, EntitlementIssueAfterReset, CreateChargeCostBasisManual, ChargeCostBasisManual, PriceFlat, PriceUnit, SpendCommitments, RateCardDiscounts, Totals, ChargeRealizationDetailedLineCreditApplied, ChargeRealizationAmountDiscount, FeatureManualUnitCost, FeatureLlmUnitCostPricing, InvoiceLineCreditsApplied, InvoiceUsageQuantityDetail, UpdatePriceFlat, UpdatePriceUnit, UpdateDiscounts, LlmCostModelPricing, FiatCurrencyAmount, QueryFilterNumeric, CursorPaginationQuery, ListMetersParamsFilter, ListLlmCostPricesParamsFilter, LabelsFieldFilter, CustomerReference, ProfileReference, FeatureReference, CreateChargeCostBasisPinned, CreateResourceReference, ChargeCostBasisPinned, TaxCodeReference, CreditGrantInvoiceReference, CurrencyCustomReference, SubscriptionCostBasisPin, SubscriptionReference, AppReference, ChargeRealizationInvoiceReference, AddonReference, ChargeReference, UpdateResourceReference, BillingCustomerReference, ChargeFeature, Event, MeterQueryRow, AppStripeCreateCustomerPortalSessionResult, ClosedPeriod, ChargeResolvedCostBasis, SubscriptionAddonTimelineSegment, UpdateClosedPeriod, CostBasis, FeatureCostQueryRow, Resource, ResourceImmutable, QueryFilterDateTime, CursorMeta, InvalidParameterStandard, InvalidParameterMinimumLength, InvalidParameterMaximumLength, InvalidParameterChoiceItem, InvalidParameterDependentItem, Unauthorized, Forbidden, NotFound, Gone, Conflict, PayloadTooLarge, UnsupportedMediaType, UnprocessableContent, TooManyRequests, Internal, NotImplemented, NotAvailable, CreateCreditGrantFilters, CreditGrantFilters, SubscriptionPlanReference, UpsertPlanAddonRequest, ResourceWithKey, Meter, PaginatedMeta, QueryFilterStringMapItem, CustomerKeyReference, CustomerUsageAttribution, UpdateCustomerUsageAttribution, Address, UpdateAddress, AppStripeCreateCheckoutSessionCustomerUpdate, AppStripeCreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreement, AppStripeCreateCheckoutSessionTaxIdCollection, AppStripeCreateCheckoutSessionResult, CustomerStripeCreateCustomerPortalSessionRequest, RecurringPeriodInput, RecurringPeriod, RateCardMeteredEntitlement, SubscriptionPhaseCreate, SubscriptionEditStretchPhase, ListCreditGrantsParamsFilter, ValidationIssue, GetCreditBalanceParamsFilter, ListPlansParamsFilter, SubscriptionProRatingConfig, RateCardProrationConfiguration, UnitConfig, PartyTaxIdentity, UpdateBillingPartyTaxIdentity, InvoiceAvailableActions, ChargeRealizationPayment, SubscriptionEditRemovePhase, TaxCodeAppMapping, AppCapability, UpdateAppStripeRequest, UpdateAppSandboxRequest, UpdateAppExternalInvoicingRequest, WorkflowInvoicingSettings, InvoiceLineAmountDiscount, InvoiceLineUsageDiscount, InvoiceLineBaseDiscount, ListCurrenciesParamsFilter, EntitlementAccessQueryRequest, EntitlementFeatureAccessReason, EntitlementAccessQueryError, AppCustomerData, UpsertAppCustomerDataRequest, CreditAdjustment, ListCreditTransactionsParamsFilter, CurrencyAmount, EntitlementAccessResult, PriceTier, ChargeTotals, FeatureLlmUnitCost, UpdatePriceTier, LlmCostPrice, LlmCostOverrideCreate, ListCustomersParamsFilter, ListSubscriptionsParamsFilter, ListAppsParamsFilter, ListBillingProfilesParamsFilter, ListFeatureParamsFilter, ListAddonsParamsFilter, ListPlanAddonsParamsFilter, CreateTaxCodeConfig, TaxCodeConfig, TaxConfig, OrganizationDefaultTaxCodes, CreditBalance, CreditTransaction, InvoiceWorkflowAppsReferences, ProfileAppReferences, PlanAddon, UpdateTaxCodeConfig, ListEventsParamsFilter, ListCustomerChargesParamsFilter, ListInvoicesParamsFilter, ListChargesParamsFilter, ResourceFilters, FieldFilters, IngestedEvent, MeterQueryResult, ChargeRealizationDetailedLineFlatFee, ChargeRealizationDetailedLineUsageBased, CurrencyCustom, FeatureCostQueryResult, MeterPagePaginatedResponse, CostBasisPagePaginatedResponse, MeterQueryFilters, FeatureMeterReference, Customer, PartyAddresses, InvoiceCustomer, UpdateBillingPartyAddresses, UpdateInvoiceCustomer, AppStripeCreateCheckoutSessionConsentCollection, EntitlementGrantCreateRequest, CreateEntitlementStaticRequest, CreateEntitlementBooleanRequest, EntitlementMetered, EntitlementStatic, EntitlementBoolean, WorkflowCollectionAlignmentAnchored, SubscriptionEditAddPhase, SubscriptionBase, InvoiceStatusDetails, InvoiceWorkflow, SubscriptionCancel, SubscriptionMigrate, SubscriptionAddonUpdate, TaxCode, AppCatalogItem, InvoiceLineDiscounts, UpdateBillingInvoiceWorkflow, EntitlementFeatureAccess, CustomerData, UpsertCustomerBillingDataRequest, ChargeFlatFeeSystemIntent, ListCustomerEntitlementAccessResponseData, PriceGraduated, PriceVolume, UpdatePriceGraduated, UpdatePriceVolume, PricePagePaginatedResponse, CreateCreditGrantPurchase, CreditGrantPurchase, CreateChargeFlatFeeRequest, WorkflowTaxSettings, CreditBalances, CreditTransactionPaginatedResponse, PlanAddonPagePaginatedResponse, IngestedEventPaginatedResponse, InvalidParameters, MeterQueryRequest, CustomerPagePaginatedResponse, Supplier, Party, UpdateSupplier, AppStripeCreateCheckoutSessionRequestOptions, CreateEntitlementMeteredRequest, InvoiceWorkflowSettings, TaxCodePagePaginatedResponse, AppStripe, AppSandbox, AppExternalInvoicing, AppCatalogItemPagePaginatedResponse, InstalledAppStripe, InstalledAppSandbox, InstalledAppExternalInvoicing, InvoiceDetailedLine, UpdateInvoiceWorkflowSettings, EntitlementAccessQueryResult, Feature, CreditGrant, CurrencyPagePaginatedResponse, BadRequest, InvoiceBase, CustomerStripeCreateCheckoutSessionRequest, WorkflowCollectionSettings, ChargeRealizationInvoice, EntitlementAccessQueryResponse, RateCard, InvoiceLineRateCard, ChargeUsageBasedSystemIntent, CreateChargeUsageBasedRequest, FeaturePagePaginatedResponse, UpdateInvoiceLineRateCard, CreditGrantPagePaginatedResponse, Workflow, AppPagePaginatedResponse, ProfileApps, SubscriptionItem, PlanPhase, SubscriptionEditAddItem, SubscriptionAddonRateCard, Addon, UpsertAddonRequest, InvoiceStandardLine, UpdateInvoiceStandardLine, Profile, UpsertBillingProfileRequest, ChargeRealization, SubscriptionPhase, SubscriptionCustomPlan, Plan, UpsertPlanRequest, SubscriptionAddon, AddonPagePaginatedResponse, ProfilePagePaginatedResponse, Subscription, SubscriptionCreate, SubscriptionChange, PlanPagePaginatedResponse, SubscriptionEdit, SubscriptionAddonPagePaginatedResponse, InvoiceStandard, UpdateInvoiceStandardRequest, SubscriptionPagePaginatedResponse, SubscriptionChangeResponse, SubscriptionMigrateResponse, ChargeFlatFee, ChargeUsageBased, InvoicePagePaginatedResponse, ChargePagePaginatedResponse, StringFieldFilter, MeterAggregation, MeterQueryGranularity, StringFieldFilterExact, PricePaymentTerm, BillingCurrencyCode, CreateCurrencyCode, UlidFieldFilter, DateTimeFieldFilter, EntitlementMeasureUsageFrom, WorkflowPaymentSettings, SubscriptionCreateTiming, SubscriptionEditTiming, UpdateBillingWorkflowPaymentSettings, CreateChargeCostBasis, ChargeCostBasis, InvalidParameter, RateCardEntitlement, FeatureUnitCost, ChargeRealizationDetailedLine, Currency, CustomerOrReference, Entitlement, WorkflowCollectionAlignment, Price, PriceUsageBased, UpdatePrice, CreateEntitlementRequest, App, BillingInstallAppResponse, FeatureOrReference, ChargeRealizationInvoiceOrReference, CreateChargeRequest, SubscriptionEditOperation, InvoiceLine, UpdateInvoiceLine, SubscriptionOrReference, Invoice, Charge, SortQueryInput, BaseErrorInput, InvoiceWorkflowInvoicingSettingsInput, WorkflowPaymentSendInvoiceSettingsInput, UpdateBillingInvoiceWorkflowInvoicingSettingsInput, UpdateBillingWorkflowPaymentSendInvoiceSettingsInput, EntitlementIssueAfterResetInput, EventInput, UnauthorizedInput, ForbiddenInput, NotFoundInput, GoneInput, ConflictInput, PayloadTooLargeInput, UnsupportedMediaTypeInput, UnprocessableContentInput, TooManyRequestsInput, InternalInput, NotImplementedInput, NotAvailableInput, AppStripeCreateCheckoutSessionCustomerUpdateInput, AppStripeCreateCheckoutSessionTaxIdCollectionInput, RateCardMeteredEntitlementInput, VoidCreditGrantRequestInput, UnitConfigInput, WorkflowInvoicingSettingsInput, EntitlementAccessQueryRequestInput, IngestedEventInput, EntitlementMeteredInput, SubscriptionBaseInput, InvoiceWorkflowInput, SubscriptionCancelInput, SubscriptionMigrateInput, UpdateBillingInvoiceWorkflowInput, CreateCreditGrantPurchaseInput, CreditGrantPurchaseInput, WorkflowTaxSettingsInput, IngestedEventPaginatedResponseInput, MeterQueryRequestInput, AppStripeCreateCheckoutSessionRequestOptionsInput, CreateEntitlementMeteredRequestInput, InvoiceWorkflowSettingsInput, InvoiceDetailedLineInput, UpdateInvoiceWorkflowSettingsInput, CreateCreditGrantRequestInput, CreditGrantInput, BadRequestInput, CustomerStripeCreateCheckoutSessionRequestInput, WorkflowCollectionSettingsInput, ChargeRealizationInvoiceInput, RateCardInput, InvoiceLineRateCardInput, ChargeUsageBasedSystemIntentInput, CreateChargeUsageBasedRequestInput, CreditGrantPagePaginatedResponseInput, WorkflowInput, SubscriptionItemInput, PlanPhaseInput, SubscriptionEditAddItemInput, SubscriptionAddonRateCardInput, AddonInput, CreateAddonRequestInput, UpsertAddonRequestInput, InvoiceStandardLineInput, ProfileInput, CreateBillingProfileRequestInput, UpsertBillingProfileRequestInput, ChargeRealizationInput, SubscriptionPhaseInput, SubscriptionCustomPlanInput, PlanInput, CreatePlanRequestInput, UpsertPlanRequestInput, SubscriptionAddonInput, AddonPagePaginatedResponseInput, ProfilePagePaginatedResponseInput, SubscriptionInput, SubscriptionCreateInput, SubscriptionChangeInput, PlanPagePaginatedResponseInput, SubscriptionEditInput, SubscriptionAddonPagePaginatedResponseInput, InvoiceStandardInput, UpdateInvoiceStandardRequestInput, SubscriptionPagePaginatedResponseInput, SubscriptionChangeResponseInput, SubscriptionMigrateResponseInput, ChargeFlatFeeInput, ChargeUsageBasedInput, InvoicePagePaginatedResponseInput, ChargePagePaginatedResponseInput, WorkflowPaymentSettingsInput, UpdateBillingWorkflowPaymentSettingsInput, RateCardEntitlementInput, EntitlementInput, CreateEntitlementRequestInput, ChargeRealizationInvoiceOrReferenceInput, CreateChargeRequestInput, SubscriptionEditOperationInput, InvoiceLineInput, SubscriptionOrReferenceInput, InvoiceInput, UpdateInvoiceRequestInput, ChargeInput, } from './models/types.js';
|
|
45
|
+
export type { Labels, CursorPaginationQueryPage, SortQuery, IngestedEventValidationError, CursorMetaPage, BaseError, PageMeta, QueryFilterString, AppStripeCheckoutSessionCustomTextParams, AppStripeCreateCustomerPortalSessionOptions, CreateLabels, PriceFree, RateCardStaticEntitlement, RateCardBooleanEntitlement, TaxConfigStripe, TaxConfigExternalInvoicing, InvoiceExternalReferences, InvoiceAvailableActionDetails, InvoiceWorkflowInvoicingSettings, WorkflowPaymentChargeAutomaticallySettings, WorkflowPaymentSendInvoiceSettings, ChargeFlatFeeDiscounts, SubscriptionEditRemoveItem, SubscriptionEditUnscheduleEdit, UpdateLabels, InstallAppStripeWithApiKey, InstallAppSandbox, InstallAppExternalInvoicing, WorkflowCollectionAlignmentSubscription, InvoiceLineExternalReferences, UpdateBillingInvoiceWorkflowInvoicingSettings, UpdateBillingWorkflowPaymentChargeAutomaticallySettings, UpdateBillingWorkflowPaymentSendInvoiceSettings, UpdatePriceFree, LlmCostProvider, LlmCostModel, ProductCatalogValidationError, EntitlementAccessQueryRequestCustomers, EntitlementAccessQueryRequestFeatures, QueryFilterInteger, QueryFilterFloat, QueryFilterBoolean, PagePaginationQuery, PublicLabels, SystemAccountAccessToken, PersonalAccessToken, KonnectAccessToken, AppCustomerDataStripe, AppCustomerDataExternalInvoicing, CreateChargeCostBasisDynamic, ChargeCostBasisDynamic, CurrencyFiat, ListCostBasesParamsFilter, CreateCurrencyCustomRequest, EntitlementAccessValue, EntitlementIssueAfterReset, EntitlementBurndownBalance, EntitlementBurndownGrantBalances, CreateChargeCostBasisManual, ChargeCostBasisManual, PriceFlat, PriceUnit, SpendCommitments, RateCardDiscounts, Totals, ChargeRealizationDetailedLineCreditApplied, ChargeRealizationAmountDiscount, FeatureManualUnitCost, FeatureLlmUnitCostPricing, InvoiceLineCreditsApplied, InvoiceUsageQuantityDetail, UpdatePriceFlat, UpdatePriceUnit, UpdateDiscounts, LlmCostModelPricing, FiatCurrencyAmount, QueryFilterNumeric, CursorPaginationQuery, ListMetersParamsFilter, ListLlmCostPricesParamsFilter, LabelsFieldFilter, CustomerReference, ProfileReference, FeatureReference, EntitlementGrantUsage, CreateChargeCostBasisPinned, CreateResourceReference, ChargeCostBasisPinned, TaxCodeReference, CreditGrantInvoiceReference, CurrencyCustomReference, SubscriptionCostBasisPin, SubscriptionReference, AppReference, ChargeRealizationInvoiceReference, AddonReference, ChargeReference, UpdateResourceReference, BillingCustomerReference, ChargeFeature, Event, MeterQueryRow, AppStripeCreateCustomerPortalSessionResult, ClosedPeriod, ChargeResolvedCostBasis, SubscriptionAddonTimelineSegment, UpdateClosedPeriod, CostBasis, FeatureCostQueryRow, Resource, ResourceImmutable, QueryFilterDateTime, CursorMeta, InvalidParameterStandard, InvalidParameterMinimumLength, InvalidParameterMaximumLength, InvalidParameterChoiceItem, InvalidParameterDependentItem, Unauthorized, Forbidden, NotFound, Gone, Conflict, PayloadTooLarge, UnsupportedMediaType, UnprocessableContent, TooManyRequests, Internal, NotImplemented, NotAvailable, CreateCreditGrantFilters, CreditGrantFilters, SubscriptionPlanReference, UpsertPlanAddonRequest, ResourceWithKey, Meter, PaginatedMeta, QueryFilterStringMapItem, CustomerKeyReference, CustomerUsageAttribution, UpdateCustomerUsageAttribution, Address, UpdateAddress, AppStripeCreateCheckoutSessionCustomerUpdate, AppStripeCreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreement, AppStripeCreateCheckoutSessionTaxIdCollection, AppStripeCreateCheckoutSessionResult, CustomerStripeCreateCustomerPortalSessionRequest, RecurringPeriodInput, RecurringPeriod, RateCardMeteredEntitlement, SubscriptionPhaseCreate, SubscriptionEditStretchPhase, ListCreditGrantsParamsFilter, ValidationIssue, GetCreditBalanceParamsFilter, ListPlansParamsFilter, SubscriptionProRatingConfig, RateCardProrationConfiguration, UnitConfig, PartyTaxIdentity, UpdateBillingPartyTaxIdentity, InvoiceAvailableActions, ChargeRealizationPayment, SubscriptionEditRemovePhase, TaxCodeAppMapping, AppCapability, UpdateAppStripeRequest, UpdateAppSandboxRequest, UpdateAppExternalInvoicingRequest, WorkflowInvoicingSettings, InvoiceLineAmountDiscount, InvoiceLineUsageDiscount, InvoiceLineBaseDiscount, ListCurrenciesParamsFilter, EntitlementAccessQueryRequest, EntitlementFeatureAccessReason, EntitlementAccessQueryError, AppCustomerData, UpsertAppCustomerDataRequest, CreditAdjustment, ListCreditTransactionsParamsFilter, CurrencyAmount, EntitlementAccessResult, PriceTier, ChargeTotals, FeatureLlmUnitCost, UpdatePriceTier, LlmCostPrice, LlmCostOverrideCreate, ListCustomersParamsFilter, ListSubscriptionsParamsFilter, ListAppsParamsFilter, ListBillingProfilesParamsFilter, ListFeatureParamsFilter, ListAddonsParamsFilter, ListPlanAddonsParamsFilter, CreateTaxCodeConfig, TaxCodeConfig, TaxConfig, OrganizationDefaultTaxCodes, CreditBalance, CreditTransaction, InvoiceWorkflowAppsReferences, ProfileAppReferences, PlanAddon, UpdateTaxCodeConfig, ListEventsParamsFilter, ListCustomerChargesParamsFilter, ListInvoicesParamsFilter, ListChargesParamsFilter, ResourceFilters, FieldFilters, IngestedEvent, MeterQueryResult, EntitlementHistoryWindow, EntitlementBurndownSegment, ChargeRealizationDetailedLineFlatFee, ChargeRealizationDetailedLineUsageBased, CurrencyCustom, FeatureCostQueryResult, MeterPagePaginatedResponse, CostBasisPagePaginatedResponse, MeterQueryFilters, FeatureMeterReference, Customer, PartyAddresses, InvoiceCustomer, UpdateBillingPartyAddresses, UpdateInvoiceCustomer, AppStripeCreateCheckoutSessionConsentCollection, EntitlementGrantCreateRequest, CreateEntitlementStaticRequest, CreateEntitlementBooleanRequest, EntitlementMetered, EntitlementStatic, EntitlementBoolean, WorkflowCollectionAlignmentAnchored, SubscriptionEditAddPhase, SubscriptionBase, InvoiceStatusDetails, InvoiceWorkflow, SubscriptionCancel, SubscriptionMigrate, SubscriptionAddonUpdate, TaxCode, AppCatalogItem, InvoiceLineDiscounts, UpdateBillingInvoiceWorkflow, EntitlementFeatureAccess, CustomerData, UpsertCustomerBillingDataRequest, ChargeFlatFeeSystemIntent, ListCustomerEntitlementAccessResponseData, PriceGraduated, PriceVolume, UpdatePriceGraduated, UpdatePriceVolume, PricePagePaginatedResponse, CreateCreditGrantPurchase, CreditGrantPurchase, CreateChargeFlatFeeRequest, WorkflowTaxSettings, CreditBalances, CreditTransactionPaginatedResponse, PlanAddonPagePaginatedResponse, IngestedEventPaginatedResponse, EntitlementHistory, InvalidParameters, MeterQueryRequest, CustomerPagePaginatedResponse, Supplier, Party, UpdateSupplier, AppStripeCreateCheckoutSessionRequestOptions, CreateEntitlementMeteredRequest, InvoiceWorkflowSettings, TaxCodePagePaginatedResponse, AppStripe, AppSandbox, AppExternalInvoicing, AppCatalogItemPagePaginatedResponse, InstalledAppStripe, InstalledAppSandbox, InstalledAppExternalInvoicing, InvoiceDetailedLine, UpdateInvoiceWorkflowSettings, EntitlementAccessQueryResult, Feature, CreditGrant, CurrencyPagePaginatedResponse, BadRequest, InvoiceBase, CustomerStripeCreateCheckoutSessionRequest, WorkflowCollectionSettings, ChargeRealizationInvoice, EntitlementAccessQueryResponse, RateCard, InvoiceLineRateCard, ChargeUsageBasedSystemIntent, CreateChargeUsageBasedRequest, FeaturePagePaginatedResponse, UpdateInvoiceLineRateCard, CreditGrantPagePaginatedResponse, Workflow, AppPagePaginatedResponse, ProfileApps, SubscriptionItem, PlanPhase, SubscriptionEditAddItem, SubscriptionAddonRateCard, Addon, UpsertAddonRequest, InvoiceStandardLine, UpdateInvoiceStandardLine, Profile, UpsertBillingProfileRequest, ChargeRealization, SubscriptionPhase, SubscriptionCustomPlan, Plan, UpsertPlanRequest, SubscriptionAddon, AddonPagePaginatedResponse, ProfilePagePaginatedResponse, Subscription, SubscriptionCreate, SubscriptionChange, PlanPagePaginatedResponse, SubscriptionEdit, SubscriptionAddonPagePaginatedResponse, InvoiceStandard, UpdateInvoiceStandardRequest, SubscriptionPagePaginatedResponse, SubscriptionChangeResponse, SubscriptionMigrateResponse, ChargeFlatFee, ChargeUsageBased, InvoicePagePaginatedResponse, ChargePagePaginatedResponse, StringFieldFilter, MeterAggregation, MeterQueryGranularity, EntitlementHistoryWindowSize, StringFieldFilterExact, PricePaymentTerm, BillingCurrencyCode, CreateCurrencyCode, UlidFieldFilter, DateTimeFieldFilter, EntitlementMeasureUsageFrom, WorkflowPaymentSettings, SubscriptionCreateTiming, SubscriptionEditTiming, UpdateBillingWorkflowPaymentSettings, CreateChargeCostBasis, ChargeCostBasis, InvalidParameter, RateCardEntitlement, FeatureUnitCost, ChargeRealizationDetailedLine, Currency, CustomerOrReference, Entitlement, WorkflowCollectionAlignment, Price, PriceUsageBased, UpdatePrice, CreateEntitlementRequest, App, BillingInstallAppResponse, FeatureOrReference, ChargeRealizationInvoiceOrReference, CreateChargeRequest, SubscriptionEditOperation, InvoiceLine, UpdateInvoiceLine, SubscriptionOrReference, Invoice, Charge, SortQueryInput, BaseErrorInput, InvoiceWorkflowInvoicingSettingsInput, WorkflowPaymentSendInvoiceSettingsInput, UpdateBillingInvoiceWorkflowInvoicingSettingsInput, UpdateBillingWorkflowPaymentSendInvoiceSettingsInput, EntitlementIssueAfterResetInput, EventInput, UnauthorizedInput, ForbiddenInput, NotFoundInput, GoneInput, ConflictInput, PayloadTooLargeInput, UnsupportedMediaTypeInput, UnprocessableContentInput, TooManyRequestsInput, InternalInput, NotImplementedInput, NotAvailableInput, AppStripeCreateCheckoutSessionCustomerUpdateInput, AppStripeCreateCheckoutSessionTaxIdCollectionInput, RateCardMeteredEntitlementInput, VoidCreditGrantRequestInput, UnitConfigInput, WorkflowInvoicingSettingsInput, EntitlementAccessQueryRequestInput, IngestedEventInput, EntitlementMeteredInput, SubscriptionBaseInput, InvoiceWorkflowInput, SubscriptionCancelInput, SubscriptionMigrateInput, UpdateBillingInvoiceWorkflowInput, CreateCreditGrantPurchaseInput, CreditGrantPurchaseInput, WorkflowTaxSettingsInput, IngestedEventPaginatedResponseInput, MeterQueryRequestInput, AppStripeCreateCheckoutSessionRequestOptionsInput, CreateEntitlementMeteredRequestInput, InvoiceWorkflowSettingsInput, InvoiceDetailedLineInput, UpdateInvoiceWorkflowSettingsInput, CreateCreditGrantRequestInput, CreditGrantInput, BadRequestInput, CustomerStripeCreateCheckoutSessionRequestInput, WorkflowCollectionSettingsInput, ChargeRealizationInvoiceInput, RateCardInput, InvoiceLineRateCardInput, ChargeUsageBasedSystemIntentInput, CreateChargeUsageBasedRequestInput, CreditGrantPagePaginatedResponseInput, WorkflowInput, SubscriptionItemInput, PlanPhaseInput, SubscriptionEditAddItemInput, SubscriptionAddonRateCardInput, AddonInput, CreateAddonRequestInput, UpsertAddonRequestInput, InvoiceStandardLineInput, ProfileInput, CreateBillingProfileRequestInput, UpsertBillingProfileRequestInput, ChargeRealizationInput, SubscriptionPhaseInput, SubscriptionCustomPlanInput, PlanInput, CreatePlanRequestInput, UpsertPlanRequestInput, SubscriptionAddonInput, AddonPagePaginatedResponseInput, ProfilePagePaginatedResponseInput, SubscriptionInput, SubscriptionCreateInput, SubscriptionChangeInput, PlanPagePaginatedResponseInput, SubscriptionEditInput, SubscriptionAddonPagePaginatedResponseInput, InvoiceStandardInput, UpdateInvoiceStandardRequestInput, SubscriptionPagePaginatedResponseInput, SubscriptionChangeResponseInput, SubscriptionMigrateResponseInput, ChargeFlatFeeInput, ChargeUsageBasedInput, InvoicePagePaginatedResponseInput, ChargePagePaginatedResponseInput, WorkflowPaymentSettingsInput, UpdateBillingWorkflowPaymentSettingsInput, RateCardEntitlementInput, EntitlementInput, CreateEntitlementRequestInput, ChargeRealizationInvoiceOrReferenceInput, CreateChargeRequestInput, SubscriptionEditOperationInput, InvoiceLineInput, SubscriptionOrReferenceInput, InvoiceInput, UpdateInvoiceRequestInput, ChargeInput, } from './models/types.js';
|
package/dist/lib/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.0.0-beta-
|
|
1
|
+
export declare const SDK_VERSION = "1.0.0-beta-2b50cff9e992";
|
package/dist/lib/version.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
// The committed value is a dev placeholder. The publish flow
|
|
3
3
|
// (`make -C api/spec publish-aip-sdk`) stamps the real release version here
|
|
4
4
|
// before `pnpm publish`, after `pnpm version` updates package.json.
|
|
5
|
-
export const SDK_VERSION = '1.0.0-beta-
|
|
5
|
+
export const SDK_VERSION = '1.0.0-beta-2b50cff9e992';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AcceptDateStrings } from '../../lib/wire.js';
|
|
2
|
-
import type { AppCustomerData, AppStripeCreateCheckoutSessionResult, AppStripeCreateCustomerPortalSessionResult, Charge, ChargePagePaginatedResponse, CreateChargeRequestInput, CreateCreditAdjustmentRequest as CreateCreditAdjustmentRequestBody, CreateCreditGrantRequestInput, CreateCustomerRequest as CreateCustomerRequestBody, CreateEntitlementRequestInput, CreditAdjustment, CreditBalances, CreditGrant, CreditGrantPagePaginatedResponse, CreditTransactionPaginatedResponse, CursorPaginationQueryPage, Customer, CustomerData, CustomerPagePaginatedResponse, CustomerStripeCreateCheckoutSessionRequestInput, CustomerStripeCreateCustomerPortalSessionRequest, Entitlement, GetCreditBalanceParamsFilter, ListCreditGrantsParamsFilter, ListCreditTransactionsParamsFilter, ListCustomerChargesParamsFilter, ListCustomersParamsFilter, SortQueryInput, UpdateCreditGrantExternalSettlementRequest as UpdateCreditGrantExternalSettlementRequestBody, UpsertAppCustomerDataRequest, UpsertCustomerBillingDataRequest, UpsertCustomerRequest as UpsertCustomerRequestBody, VoidCreditGrantRequestInput } from '../types.js';
|
|
2
|
+
import type { AppCustomerData, AppStripeCreateCheckoutSessionResult, AppStripeCreateCustomerPortalSessionResult, Charge, ChargePagePaginatedResponse, CreateChargeRequestInput, CreateCreditAdjustmentRequest as CreateCreditAdjustmentRequestBody, CreateCreditGrantRequestInput, CreateCustomerRequest as CreateCustomerRequestBody, CreateEntitlementRequestInput, CreditAdjustment, CreditBalances, CreditGrant, CreditGrantPagePaginatedResponse, CreditTransactionPaginatedResponse, CursorPaginationQueryPage, Customer, CustomerData, CustomerPagePaginatedResponse, CustomerStripeCreateCheckoutSessionRequestInput, CustomerStripeCreateCustomerPortalSessionRequest, Entitlement, EntitlementHistory, EntitlementHistoryWindowSize, GetCreditBalanceParamsFilter, ListCreditGrantsParamsFilter, ListCreditTransactionsParamsFilter, ListCustomerChargesParamsFilter, ListCustomersParamsFilter, SortQueryInput, UpdateCreditGrantExternalSettlementRequest as UpdateCreditGrantExternalSettlementRequestBody, UpsertAppCustomerDataRequest, UpsertCustomerBillingDataRequest, UpsertCustomerRequest as UpsertCustomerRequestBody, VoidCreditGrantRequestInput } from '../types.js';
|
|
3
3
|
export type CreateCustomerRequest = AcceptDateStrings<CreateCustomerRequestBody>;
|
|
4
4
|
export type CreateCustomerResponse = Customer;
|
|
5
5
|
export type GetCustomerRequest = {
|
|
@@ -70,6 +70,27 @@ export type CreateCustomerEntitlementRequest = AcceptDateStrings<{
|
|
|
70
70
|
body: CreateEntitlementRequestInput;
|
|
71
71
|
}>;
|
|
72
72
|
export type CreateCustomerEntitlementResponse = Entitlement;
|
|
73
|
+
export interface GetCustomerEntitlementHistoryQuery {
|
|
74
|
+
/**
|
|
75
|
+
* The start of the queried range. Defaults to the last reset. Truncated to the
|
|
76
|
+
* minute. The range may span at most 1000 windows.
|
|
77
|
+
*/
|
|
78
|
+
from?: Date;
|
|
79
|
+
/**
|
|
80
|
+
* The end of the queried range. Defaults to the current time. Truncated to the
|
|
81
|
+
* minute unless it is the current time.
|
|
82
|
+
*/
|
|
83
|
+
to?: Date;
|
|
84
|
+
/** The size of the windows the usage is grouped into. */
|
|
85
|
+
windowSize: EntitlementHistoryWindowSize;
|
|
86
|
+
/** The IANA time zone the windows are aligned to. */
|
|
87
|
+
timeZone?: string;
|
|
88
|
+
}
|
|
89
|
+
export type GetCustomerEntitlementHistoryRequest = AcceptDateStrings<GetCustomerEntitlementHistoryQuery & {
|
|
90
|
+
customerId: string;
|
|
91
|
+
entitlementId: string;
|
|
92
|
+
}>;
|
|
93
|
+
export type GetCustomerEntitlementHistoryResponse = EntitlementHistory;
|
|
73
94
|
export type CreateCreditGrantRequest = AcceptDateStrings<{
|
|
74
95
|
customerId: string;
|
|
75
96
|
body: CreateCreditGrantRequestInput;
|
package/dist/models/schemas.d.ts
CHANGED
|
@@ -178,6 +178,7 @@ export declare const entitlementMeasureUsageFromPreset: z.ZodEnum<{
|
|
|
178
178
|
current_period_start: "current_period_start";
|
|
179
179
|
now: "now";
|
|
180
180
|
}>;
|
|
181
|
+
export declare const entitlementHistoryWindowSize: z.ZodUnion<readonly [z.ZodLiteral<"PT1H">, z.ZodLiteral<"P1D">]>;
|
|
181
182
|
export declare const createLabels: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
182
183
|
export declare const creditFundingMethod: z.ZodEnum<{
|
|
183
184
|
external: "external";
|
|
@@ -639,6 +640,14 @@ export declare const entitlementIssueAfterReset: z.ZodObject<{
|
|
|
639
640
|
amount: z.ZodString;
|
|
640
641
|
priority: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
641
642
|
}, z.core.$strip>;
|
|
643
|
+
export declare const entitlementBurndownBalance: z.ZodObject<{
|
|
644
|
+
start: z.ZodString;
|
|
645
|
+
end: z.ZodString;
|
|
646
|
+
}, z.core.$strip>;
|
|
647
|
+
export declare const entitlementBurndownGrantBalances: z.ZodObject<{
|
|
648
|
+
start: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
649
|
+
end: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
650
|
+
}, z.core.$strip>;
|
|
642
651
|
export declare const createChargeCostBasisManual: z.ZodObject<{
|
|
643
652
|
type: z.ZodLiteral<"manual">;
|
|
644
653
|
fiatCurrency: z.ZodOptional<z.ZodString>;
|
|
@@ -859,6 +868,10 @@ export declare const profileReference: z.ZodObject<{
|
|
|
859
868
|
export declare const featureReference: z.ZodObject<{
|
|
860
869
|
id: z.ZodString;
|
|
861
870
|
}, z.core.$strip>;
|
|
871
|
+
export declare const entitlementGrantUsage: z.ZodObject<{
|
|
872
|
+
grantId: z.ZodString;
|
|
873
|
+
usage: z.ZodString;
|
|
874
|
+
}, z.core.$strip>;
|
|
862
875
|
export declare const createChargeCostBasisPinned: z.ZodObject<{
|
|
863
876
|
type: z.ZodLiteral<"pinned">;
|
|
864
877
|
fiatCurrency: z.ZodString;
|
|
@@ -2675,6 +2688,34 @@ export declare const meterQueryResult: z.ZodObject<{
|
|
|
2675
2688
|
dimensions: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
2676
2689
|
}, z.core.$strip>>;
|
|
2677
2690
|
}, z.core.$strip>;
|
|
2691
|
+
export declare const entitlementHistoryWindow: z.ZodObject<{
|
|
2692
|
+
period: z.ZodObject<{
|
|
2693
|
+
from: z.ZodDate;
|
|
2694
|
+
to: z.ZodDate;
|
|
2695
|
+
}, z.core.$strip>;
|
|
2696
|
+
usage: z.ZodString;
|
|
2697
|
+
balanceAtStart: z.ZodString;
|
|
2698
|
+
}, z.core.$strip>;
|
|
2699
|
+
export declare const entitlementBurndownSegment: z.ZodObject<{
|
|
2700
|
+
period: z.ZodObject<{
|
|
2701
|
+
from: z.ZodDate;
|
|
2702
|
+
to: z.ZodDate;
|
|
2703
|
+
}, z.core.$strip>;
|
|
2704
|
+
usage: z.ZodString;
|
|
2705
|
+
overage: z.ZodString;
|
|
2706
|
+
balance: z.ZodObject<{
|
|
2707
|
+
start: z.ZodString;
|
|
2708
|
+
end: z.ZodString;
|
|
2709
|
+
}, z.core.$strip>;
|
|
2710
|
+
grantBalances: z.ZodObject<{
|
|
2711
|
+
start: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
2712
|
+
end: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
2713
|
+
}, z.core.$strip>;
|
|
2714
|
+
grantUsages: z.ZodArray<z.ZodObject<{
|
|
2715
|
+
grantId: z.ZodString;
|
|
2716
|
+
usage: z.ZodString;
|
|
2717
|
+
}, z.core.$strip>>;
|
|
2718
|
+
}, z.core.$strip>;
|
|
2678
2719
|
export declare const chargeRealizationDetailedLineFlatFee: z.ZodObject<{
|
|
2679
2720
|
id: z.ZodString;
|
|
2680
2721
|
createdAt: z.ZodDate;
|
|
@@ -3937,6 +3978,36 @@ export declare const ingestedEventPaginatedResponse: z.ZodObject<{
|
|
|
3937
3978
|
}, z.core.$strip>;
|
|
3938
3979
|
}, z.core.$strip>;
|
|
3939
3980
|
}, z.core.$strip>;
|
|
3981
|
+
export declare const entitlementHistory: z.ZodObject<{
|
|
3982
|
+
windowedHistory: z.ZodArray<z.ZodObject<{
|
|
3983
|
+
period: z.ZodObject<{
|
|
3984
|
+
from: z.ZodDate;
|
|
3985
|
+
to: z.ZodDate;
|
|
3986
|
+
}, z.core.$strip>;
|
|
3987
|
+
usage: z.ZodString;
|
|
3988
|
+
balanceAtStart: z.ZodString;
|
|
3989
|
+
}, z.core.$strip>>;
|
|
3990
|
+
burndownHistory: z.ZodArray<z.ZodObject<{
|
|
3991
|
+
period: z.ZodObject<{
|
|
3992
|
+
from: z.ZodDate;
|
|
3993
|
+
to: z.ZodDate;
|
|
3994
|
+
}, z.core.$strip>;
|
|
3995
|
+
usage: z.ZodString;
|
|
3996
|
+
overage: z.ZodString;
|
|
3997
|
+
balance: z.ZodObject<{
|
|
3998
|
+
start: z.ZodString;
|
|
3999
|
+
end: z.ZodString;
|
|
4000
|
+
}, z.core.$strip>;
|
|
4001
|
+
grantBalances: z.ZodObject<{
|
|
4002
|
+
start: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
4003
|
+
end: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
4004
|
+
}, z.core.$strip>;
|
|
4005
|
+
grantUsages: z.ZodArray<z.ZodObject<{
|
|
4006
|
+
grantId: z.ZodString;
|
|
4007
|
+
usage: z.ZodString;
|
|
4008
|
+
}, z.core.$strip>>;
|
|
4009
|
+
}, z.core.$strip>>;
|
|
4010
|
+
}, z.core.$strip>;
|
|
3940
4011
|
export declare const chargeRealizationDetailedLine: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3941
4012
|
id: z.ZodString;
|
|
3942
4013
|
createdAt: z.ZodDate;
|
|
@@ -18321,6 +18392,46 @@ export declare const createCustomerEntitlementResponse: z.ZodDiscriminatedUnion<
|
|
|
18321
18392
|
updatedAt: z.ZodDate;
|
|
18322
18393
|
deletedAt: z.ZodOptional<z.ZodDate>;
|
|
18323
18394
|
}, z.core.$strip>], "type">;
|
|
18395
|
+
export declare const getCustomerEntitlementHistoryPathParams: z.ZodObject<{
|
|
18396
|
+
customerId: z.ZodString;
|
|
18397
|
+
entitlementId: z.ZodString;
|
|
18398
|
+
}, z.core.$strip>;
|
|
18399
|
+
export declare const getCustomerEntitlementHistoryQueryParams: z.ZodObject<{
|
|
18400
|
+
from: z.ZodOptional<z.ZodDate>;
|
|
18401
|
+
to: z.ZodOptional<z.ZodDate>;
|
|
18402
|
+
windowSize: z.ZodUnion<readonly [z.ZodLiteral<"PT1H">, z.ZodLiteral<"P1D">]>;
|
|
18403
|
+
timeZone: z.ZodDefault<z.ZodOptional<z.ZodCoercedString<unknown>>>;
|
|
18404
|
+
}, z.core.$strip>;
|
|
18405
|
+
export declare const getCustomerEntitlementHistoryResponse: z.ZodObject<{
|
|
18406
|
+
windowedHistory: z.ZodArray<z.ZodObject<{
|
|
18407
|
+
period: z.ZodObject<{
|
|
18408
|
+
from: z.ZodDate;
|
|
18409
|
+
to: z.ZodDate;
|
|
18410
|
+
}, z.core.$strip>;
|
|
18411
|
+
usage: z.ZodString;
|
|
18412
|
+
balanceAtStart: z.ZodString;
|
|
18413
|
+
}, z.core.$strip>>;
|
|
18414
|
+
burndownHistory: z.ZodArray<z.ZodObject<{
|
|
18415
|
+
period: z.ZodObject<{
|
|
18416
|
+
from: z.ZodDate;
|
|
18417
|
+
to: z.ZodDate;
|
|
18418
|
+
}, z.core.$strip>;
|
|
18419
|
+
usage: z.ZodString;
|
|
18420
|
+
overage: z.ZodString;
|
|
18421
|
+
balance: z.ZodObject<{
|
|
18422
|
+
start: z.ZodString;
|
|
18423
|
+
end: z.ZodString;
|
|
18424
|
+
}, z.core.$strip>;
|
|
18425
|
+
grantBalances: z.ZodObject<{
|
|
18426
|
+
start: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
18427
|
+
end: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
18428
|
+
}, z.core.$strip>;
|
|
18429
|
+
grantUsages: z.ZodArray<z.ZodObject<{
|
|
18430
|
+
grantId: z.ZodString;
|
|
18431
|
+
usage: z.ZodString;
|
|
18432
|
+
}, z.core.$strip>>;
|
|
18433
|
+
}, z.core.$strip>>;
|
|
18434
|
+
}, z.core.$strip>;
|
|
18324
18435
|
export declare const createCreditGrantPathParams: z.ZodObject<{
|
|
18325
18436
|
customerId: z.ZodString;
|
|
18326
18437
|
}, z.core.$strip>;
|
|
@@ -33353,6 +33464,7 @@ export declare const entitlementMeasureUsageFromPresetWire: z.ZodEnum<{
|
|
|
33353
33464
|
current_period_start: "current_period_start";
|
|
33354
33465
|
now: "now";
|
|
33355
33466
|
}>;
|
|
33467
|
+
export declare const entitlementHistoryWindowSizeWire: z.ZodUnion<readonly [z.ZodLiteral<"PT1H">, z.ZodLiteral<"P1D">]>;
|
|
33356
33468
|
export declare const createLabelsWire: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
33357
33469
|
export declare const creditFundingMethodWire: z.ZodEnum<{
|
|
33358
33470
|
external: "external";
|
|
@@ -33814,6 +33926,14 @@ export declare const entitlementIssueAfterResetWire: z.ZodObject<{
|
|
|
33814
33926
|
amount: z.ZodString;
|
|
33815
33927
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
33816
33928
|
}, z.core.$strict>;
|
|
33929
|
+
export declare const entitlementBurndownBalanceWire: z.ZodObject<{
|
|
33930
|
+
start: z.ZodString;
|
|
33931
|
+
end: z.ZodString;
|
|
33932
|
+
}, z.core.$strict>;
|
|
33933
|
+
export declare const entitlementBurndownGrantBalancesWire: z.ZodObject<{
|
|
33934
|
+
start: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
33935
|
+
end: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
33936
|
+
}, z.core.$strict>;
|
|
33817
33937
|
export declare const createChargeCostBasisManualWire: z.ZodObject<{
|
|
33818
33938
|
type: z.ZodLiteral<"manual">;
|
|
33819
33939
|
fiat_currency: z.ZodOptional<z.ZodString>;
|
|
@@ -34034,6 +34154,10 @@ export declare const profileReferenceWire: z.ZodObject<{
|
|
|
34034
34154
|
export declare const featureReferenceWire: z.ZodObject<{
|
|
34035
34155
|
id: z.ZodString;
|
|
34036
34156
|
}, z.core.$strict>;
|
|
34157
|
+
export declare const entitlementGrantUsageWire: z.ZodObject<{
|
|
34158
|
+
grant_id: z.ZodString;
|
|
34159
|
+
usage: z.ZodString;
|
|
34160
|
+
}, z.core.$strict>;
|
|
34037
34161
|
export declare const createChargeCostBasisPinnedWire: z.ZodObject<{
|
|
34038
34162
|
type: z.ZodLiteral<"pinned">;
|
|
34039
34163
|
fiat_currency: z.ZodString;
|
|
@@ -35850,6 +35974,34 @@ export declare const meterQueryResultWire: z.ZodObject<{
|
|
|
35850
35974
|
dimensions: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
35851
35975
|
}, z.core.$strict>>;
|
|
35852
35976
|
}, z.core.$strict>;
|
|
35977
|
+
export declare const entitlementHistoryWindowWire: z.ZodObject<{
|
|
35978
|
+
period: z.ZodObject<{
|
|
35979
|
+
from: z.ZodString;
|
|
35980
|
+
to: z.ZodString;
|
|
35981
|
+
}, z.core.$strict>;
|
|
35982
|
+
usage: z.ZodString;
|
|
35983
|
+
balance_at_start: z.ZodString;
|
|
35984
|
+
}, z.core.$strict>;
|
|
35985
|
+
export declare const entitlementBurndownSegmentWire: z.ZodObject<{
|
|
35986
|
+
period: z.ZodObject<{
|
|
35987
|
+
from: z.ZodString;
|
|
35988
|
+
to: z.ZodString;
|
|
35989
|
+
}, z.core.$strict>;
|
|
35990
|
+
usage: z.ZodString;
|
|
35991
|
+
overage: z.ZodString;
|
|
35992
|
+
balance: z.ZodObject<{
|
|
35993
|
+
start: z.ZodString;
|
|
35994
|
+
end: z.ZodString;
|
|
35995
|
+
}, z.core.$strict>;
|
|
35996
|
+
grant_balances: z.ZodObject<{
|
|
35997
|
+
start: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
35998
|
+
end: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
35999
|
+
}, z.core.$strict>;
|
|
36000
|
+
grant_usages: z.ZodArray<z.ZodObject<{
|
|
36001
|
+
grant_id: z.ZodString;
|
|
36002
|
+
usage: z.ZodString;
|
|
36003
|
+
}, z.core.$strict>>;
|
|
36004
|
+
}, z.core.$strict>;
|
|
35853
36005
|
export declare const chargeRealizationDetailedLineFlatFeeWire: z.ZodObject<{
|
|
35854
36006
|
id: z.ZodString;
|
|
35855
36007
|
created_at: z.ZodString;
|
|
@@ -37112,6 +37264,36 @@ export declare const ingestedEventPaginatedResponseWire: z.ZodObject<{
|
|
|
37112
37264
|
}, z.core.$strict>;
|
|
37113
37265
|
}, z.core.$strict>;
|
|
37114
37266
|
}, z.core.$strict>;
|
|
37267
|
+
export declare const entitlementHistoryWire: z.ZodObject<{
|
|
37268
|
+
windowed_history: z.ZodArray<z.ZodObject<{
|
|
37269
|
+
period: z.ZodObject<{
|
|
37270
|
+
from: z.ZodString;
|
|
37271
|
+
to: z.ZodString;
|
|
37272
|
+
}, z.core.$strict>;
|
|
37273
|
+
usage: z.ZodString;
|
|
37274
|
+
balance_at_start: z.ZodString;
|
|
37275
|
+
}, z.core.$strict>>;
|
|
37276
|
+
burndown_history: z.ZodArray<z.ZodObject<{
|
|
37277
|
+
period: z.ZodObject<{
|
|
37278
|
+
from: z.ZodString;
|
|
37279
|
+
to: z.ZodString;
|
|
37280
|
+
}, z.core.$strict>;
|
|
37281
|
+
usage: z.ZodString;
|
|
37282
|
+
overage: z.ZodString;
|
|
37283
|
+
balance: z.ZodObject<{
|
|
37284
|
+
start: z.ZodString;
|
|
37285
|
+
end: z.ZodString;
|
|
37286
|
+
}, z.core.$strict>;
|
|
37287
|
+
grant_balances: z.ZodObject<{
|
|
37288
|
+
start: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
37289
|
+
end: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
37290
|
+
}, z.core.$strict>;
|
|
37291
|
+
grant_usages: z.ZodArray<z.ZodObject<{
|
|
37292
|
+
grant_id: z.ZodString;
|
|
37293
|
+
usage: z.ZodString;
|
|
37294
|
+
}, z.core.$strict>>;
|
|
37295
|
+
}, z.core.$strict>>;
|
|
37296
|
+
}, z.core.$strict>;
|
|
37115
37297
|
export declare const chargeRealizationDetailedLineWire: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
37116
37298
|
id: z.ZodString;
|
|
37117
37299
|
created_at: z.ZodString;
|
|
@@ -51487,6 +51669,46 @@ export declare const createCustomerEntitlementResponseWire: z.ZodDiscriminatedUn
|
|
|
51487
51669
|
updated_at: z.ZodString;
|
|
51488
51670
|
deleted_at: z.ZodOptional<z.ZodString>;
|
|
51489
51671
|
}, z.core.$strict>], "type">;
|
|
51672
|
+
export declare const getCustomerEntitlementHistoryPathParamsWire: z.ZodObject<{
|
|
51673
|
+
customerId: z.ZodString;
|
|
51674
|
+
entitlementId: z.ZodString;
|
|
51675
|
+
}, z.core.$strip>;
|
|
51676
|
+
export declare const getCustomerEntitlementHistoryQueryParamsWire: z.ZodObject<{
|
|
51677
|
+
from: z.ZodOptional<z.ZodString>;
|
|
51678
|
+
to: z.ZodOptional<z.ZodString>;
|
|
51679
|
+
window_size: z.ZodUnion<readonly [z.ZodLiteral<"PT1H">, z.ZodLiteral<"P1D">]>;
|
|
51680
|
+
time_zone: z.ZodOptional<z.ZodCoercedString<unknown>>;
|
|
51681
|
+
}, z.core.$strip>;
|
|
51682
|
+
export declare const getCustomerEntitlementHistoryResponseWire: z.ZodObject<{
|
|
51683
|
+
windowed_history: z.ZodArray<z.ZodObject<{
|
|
51684
|
+
period: z.ZodObject<{
|
|
51685
|
+
from: z.ZodString;
|
|
51686
|
+
to: z.ZodString;
|
|
51687
|
+
}, z.core.$strict>;
|
|
51688
|
+
usage: z.ZodString;
|
|
51689
|
+
balance_at_start: z.ZodString;
|
|
51690
|
+
}, z.core.$strict>>;
|
|
51691
|
+
burndown_history: z.ZodArray<z.ZodObject<{
|
|
51692
|
+
period: z.ZodObject<{
|
|
51693
|
+
from: z.ZodString;
|
|
51694
|
+
to: z.ZodString;
|
|
51695
|
+
}, z.core.$strict>;
|
|
51696
|
+
usage: z.ZodString;
|
|
51697
|
+
overage: z.ZodString;
|
|
51698
|
+
balance: z.ZodObject<{
|
|
51699
|
+
start: z.ZodString;
|
|
51700
|
+
end: z.ZodString;
|
|
51701
|
+
}, z.core.$strict>;
|
|
51702
|
+
grant_balances: z.ZodObject<{
|
|
51703
|
+
start: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
51704
|
+
end: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
51705
|
+
}, z.core.$strict>;
|
|
51706
|
+
grant_usages: z.ZodArray<z.ZodObject<{
|
|
51707
|
+
grant_id: z.ZodString;
|
|
51708
|
+
usage: z.ZodString;
|
|
51709
|
+
}, z.core.$strict>>;
|
|
51710
|
+
}, z.core.$strict>>;
|
|
51711
|
+
}, z.core.$strict>;
|
|
51490
51712
|
export declare const createCreditGrantPathParamsWire: z.ZodObject<{
|
|
51491
51713
|
customerId: z.ZodString;
|
|
51492
51714
|
}, z.core.$strip>;
|
package/dist/models/schemas.js
CHANGED
|
@@ -385,6 +385,9 @@ export const iso8601Duration = z
|
|
|
385
385
|
export const entitlementMeasureUsageFromPreset = z
|
|
386
386
|
.enum(['current_period_start', 'now'])
|
|
387
387
|
.describe('Preset for the time from which usage is measured. - `current_period_start`: the start of the current usage period. - `now`: the entitlement creation time.');
|
|
388
|
+
export const entitlementHistoryWindowSize = z
|
|
389
|
+
.union([z.literal('PT1H'), z.literal('P1D')])
|
|
390
|
+
.describe('The meter query granularities the usage history can be grouped into. Sub-hour windows are too expensive to compute and monthly windows are not supported.');
|
|
388
391
|
export const createLabels = z
|
|
389
392
|
.record(z.string(), z.string())
|
|
390
393
|
.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 "\\_".');
|
|
@@ -1198,6 +1201,22 @@ export const entitlementIssueAfterReset = z
|
|
|
1198
1201
|
.describe('The priority of the grant created after each reset. Lower values have higher priority.'),
|
|
1199
1202
|
})
|
|
1200
1203
|
.describe('Usage granted automatically after each reset of a metered entitlement. The balance returns to `amount` after every reset.');
|
|
1204
|
+
export const entitlementBurndownBalance = z
|
|
1205
|
+
.object({
|
|
1206
|
+
start: numeric,
|
|
1207
|
+
end: numeric,
|
|
1208
|
+
})
|
|
1209
|
+
.describe('Entitlement balance at the boundaries of a burndown segment.');
|
|
1210
|
+
export const entitlementBurndownGrantBalances = z
|
|
1211
|
+
.object({
|
|
1212
|
+
start: z
|
|
1213
|
+
.record(z.string(), numeric)
|
|
1214
|
+
.describe('The balance of each active grant at the start of the segment.'),
|
|
1215
|
+
end: z
|
|
1216
|
+
.record(z.string(), numeric)
|
|
1217
|
+
.describe('The balance of each active grant at the end of the segment.'),
|
|
1218
|
+
})
|
|
1219
|
+
.describe('Grant balances at the boundaries of a burndown segment, keyed by grant ID.');
|
|
1201
1220
|
export const createChargeCostBasisManual = z
|
|
1202
1221
|
.object({
|
|
1203
1222
|
type: z
|
|
@@ -1434,6 +1453,12 @@ export const featureReference = z
|
|
|
1434
1453
|
id: ulid,
|
|
1435
1454
|
})
|
|
1436
1455
|
.describe('Feature reference.');
|
|
1456
|
+
export const entitlementGrantUsage = z
|
|
1457
|
+
.object({
|
|
1458
|
+
grantId: ulid,
|
|
1459
|
+
usage: numeric,
|
|
1460
|
+
})
|
|
1461
|
+
.describe('Usage taken from a single grant.');
|
|
1437
1462
|
export const createChargeCostBasisPinned = z
|
|
1438
1463
|
.object({
|
|
1439
1464
|
type: z
|
|
@@ -2991,6 +3016,25 @@ export const meterQueryResult = z
|
|
|
2991
3016
|
.describe('The usage data. If no data is available, an empty array is returned.'),
|
|
2992
3017
|
})
|
|
2993
3018
|
.describe('Meter query result.');
|
|
3019
|
+
export const entitlementHistoryWindow = z
|
|
3020
|
+
.object({
|
|
3021
|
+
period: closedPeriod,
|
|
3022
|
+
usage: numeric,
|
|
3023
|
+
balanceAtStart: numeric,
|
|
3024
|
+
})
|
|
3025
|
+
.describe('Usage and balance of a single history window.');
|
|
3026
|
+
export const entitlementBurndownSegment = z
|
|
3027
|
+
.object({
|
|
3028
|
+
period: closedPeriod,
|
|
3029
|
+
usage: numeric,
|
|
3030
|
+
overage: numeric,
|
|
3031
|
+
balance: entitlementBurndownBalance,
|
|
3032
|
+
grantBalances: entitlementBurndownGrantBalances,
|
|
3033
|
+
grantUsages: z
|
|
3034
|
+
.array(entitlementGrantUsage)
|
|
3035
|
+
.describe('The grants consumed in the segment and the usage taken from each.'),
|
|
3036
|
+
})
|
|
3037
|
+
.describe('A period in which grants were consumed in a fixed order.');
|
|
2994
3038
|
export const chargeRealizationDetailedLineFlatFee = z
|
|
2995
3039
|
.object({
|
|
2996
3040
|
id: ulid,
|
|
@@ -3751,6 +3795,16 @@ export const ingestedEventPaginatedResponse = z
|
|
|
3751
3795
|
meta: cursorMeta,
|
|
3752
3796
|
})
|
|
3753
3797
|
.describe('Cursor paginated response.');
|
|
3798
|
+
export const entitlementHistory = z
|
|
3799
|
+
.object({
|
|
3800
|
+
windowedHistory: z
|
|
3801
|
+
.array(entitlementHistoryWindow)
|
|
3802
|
+
.describe('Usage in half-open windows of the requested size, aligned to the requested time zone. Empty windows are included; windows before usage measurement began are omitted.'),
|
|
3803
|
+
burndownHistory: z
|
|
3804
|
+
.array(entitlementBurndownSegment)
|
|
3805
|
+
.describe('Periods in which grants were consumed in a fixed order. A new segment starts whenever grant priorities change or a usage period starts.'),
|
|
3806
|
+
})
|
|
3807
|
+
.describe('Balance and usage history of a metered entitlement.');
|
|
3754
3808
|
export const chargeRealizationDetailedLine = z
|
|
3755
3809
|
.discriminatedUnion('type', [
|
|
3756
3810
|
chargeRealizationDetailedLineFlatFee,
|
|
@@ -5488,6 +5542,21 @@ export const createCustomerEntitlementPathParams = z.object({
|
|
|
5488
5542
|
});
|
|
5489
5543
|
export const createCustomerEntitlementBody = createEntitlementRequest;
|
|
5490
5544
|
export const createCustomerEntitlementResponse = entitlement;
|
|
5545
|
+
export const getCustomerEntitlementHistoryPathParams = z.object({
|
|
5546
|
+
customerId: ulid,
|
|
5547
|
+
entitlementId: ulid,
|
|
5548
|
+
});
|
|
5549
|
+
export const getCustomerEntitlementHistoryQueryParams = z.object({
|
|
5550
|
+
from: dateTime.optional(),
|
|
5551
|
+
to: dateTime.optional(),
|
|
5552
|
+
windowSize: entitlementHistoryWindowSize,
|
|
5553
|
+
timeZone: z.coerce
|
|
5554
|
+
.string()
|
|
5555
|
+
.optional()
|
|
5556
|
+
.default('UTC')
|
|
5557
|
+
.describe('The IANA time zone the windows are aligned to.'),
|
|
5558
|
+
});
|
|
5559
|
+
export const getCustomerEntitlementHistoryResponse = entitlementHistory;
|
|
5491
5560
|
export const createCreditGrantPathParams = z.object({
|
|
5492
5561
|
customerId: ulid,
|
|
5493
5562
|
});
|
|
@@ -6526,6 +6595,9 @@ export const iso8601DurationWire = z
|
|
|
6526
6595
|
export const entitlementMeasureUsageFromPresetWire = z
|
|
6527
6596
|
.enum(['current_period_start', 'now'])
|
|
6528
6597
|
.describe('Preset for the time from which usage is measured. - `current_period_start`: the start of the current usage period. - `now`: the entitlement creation time.');
|
|
6598
|
+
export const entitlementHistoryWindowSizeWire = z
|
|
6599
|
+
.union([z.literal('PT1H'), z.literal('P1D')])
|
|
6600
|
+
.describe('The meter query granularities the usage history can be grouped into. Sub-hour windows are too expensive to compute and monthly windows are not supported.');
|
|
6529
6601
|
export const createLabelsWire = z
|
|
6530
6602
|
.record(z.string(), z.string())
|
|
6531
6603
|
.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 "\\_".');
|
|
@@ -7332,6 +7404,22 @@ export const entitlementIssueAfterResetWire = z
|
|
|
7332
7404
|
.describe('The priority of the grant created after each reset. Lower values have higher priority.'),
|
|
7333
7405
|
})
|
|
7334
7406
|
.describe('Usage granted automatically after each reset of a metered entitlement. The balance returns to `amount` after every reset.');
|
|
7407
|
+
export const entitlementBurndownBalanceWire = z
|
|
7408
|
+
.strictObject({
|
|
7409
|
+
start: numericWire,
|
|
7410
|
+
end: numericWire,
|
|
7411
|
+
})
|
|
7412
|
+
.describe('Entitlement balance at the boundaries of a burndown segment.');
|
|
7413
|
+
export const entitlementBurndownGrantBalancesWire = z
|
|
7414
|
+
.strictObject({
|
|
7415
|
+
start: z
|
|
7416
|
+
.record(z.string(), numericWire)
|
|
7417
|
+
.describe('The balance of each active grant at the start of the segment.'),
|
|
7418
|
+
end: z
|
|
7419
|
+
.record(z.string(), numericWire)
|
|
7420
|
+
.describe('The balance of each active grant at the end of the segment.'),
|
|
7421
|
+
})
|
|
7422
|
+
.describe('Grant balances at the boundaries of a burndown segment, keyed by grant ID.');
|
|
7335
7423
|
export const createChargeCostBasisManualWire = z
|
|
7336
7424
|
.strictObject({
|
|
7337
7425
|
type: z
|
|
@@ -7568,6 +7656,12 @@ export const featureReferenceWire = z
|
|
|
7568
7656
|
id: ulidWire,
|
|
7569
7657
|
})
|
|
7570
7658
|
.describe('Feature reference.');
|
|
7659
|
+
export const entitlementGrantUsageWire = z
|
|
7660
|
+
.strictObject({
|
|
7661
|
+
grant_id: ulidWire,
|
|
7662
|
+
usage: numericWire,
|
|
7663
|
+
})
|
|
7664
|
+
.describe('Usage taken from a single grant.');
|
|
7571
7665
|
export const createChargeCostBasisPinnedWire = z
|
|
7572
7666
|
.strictObject({
|
|
7573
7667
|
type: z
|
|
@@ -9105,6 +9199,25 @@ export const meterQueryResultWire = z
|
|
|
9105
9199
|
.describe('The usage data. If no data is available, an empty array is returned.'),
|
|
9106
9200
|
})
|
|
9107
9201
|
.describe('Meter query result.');
|
|
9202
|
+
export const entitlementHistoryWindowWire = z
|
|
9203
|
+
.strictObject({
|
|
9204
|
+
period: closedPeriodWire,
|
|
9205
|
+
usage: numericWire,
|
|
9206
|
+
balance_at_start: numericWire,
|
|
9207
|
+
})
|
|
9208
|
+
.describe('Usage and balance of a single history window.');
|
|
9209
|
+
export const entitlementBurndownSegmentWire = z
|
|
9210
|
+
.strictObject({
|
|
9211
|
+
period: closedPeriodWire,
|
|
9212
|
+
usage: numericWire,
|
|
9213
|
+
overage: numericWire,
|
|
9214
|
+
balance: entitlementBurndownBalanceWire,
|
|
9215
|
+
grant_balances: entitlementBurndownGrantBalancesWire,
|
|
9216
|
+
grant_usages: z
|
|
9217
|
+
.array(entitlementGrantUsageWire)
|
|
9218
|
+
.describe('The grants consumed in the segment and the usage taken from each.'),
|
|
9219
|
+
})
|
|
9220
|
+
.describe('A period in which grants were consumed in a fixed order.');
|
|
9108
9221
|
export const chargeRealizationDetailedLineFlatFeeWire = z
|
|
9109
9222
|
.strictObject({
|
|
9110
9223
|
id: ulidWire,
|
|
@@ -9863,6 +9976,16 @@ export const ingestedEventPaginatedResponseWire = z
|
|
|
9863
9976
|
meta: cursorMetaWire,
|
|
9864
9977
|
})
|
|
9865
9978
|
.describe('Cursor paginated response.');
|
|
9979
|
+
export const entitlementHistoryWire = z
|
|
9980
|
+
.strictObject({
|
|
9981
|
+
windowed_history: z
|
|
9982
|
+
.array(entitlementHistoryWindowWire)
|
|
9983
|
+
.describe('Usage in half-open windows of the requested size, aligned to the requested time zone. Empty windows are included; windows before usage measurement began are omitted.'),
|
|
9984
|
+
burndown_history: z
|
|
9985
|
+
.array(entitlementBurndownSegmentWire)
|
|
9986
|
+
.describe('Periods in which grants were consumed in a fixed order. A new segment starts whenever grant priorities change or a usage period starts.'),
|
|
9987
|
+
})
|
|
9988
|
+
.describe('Balance and usage history of a metered entitlement.');
|
|
9866
9989
|
export const chargeRealizationDetailedLineWire = z
|
|
9867
9990
|
.discriminatedUnion('type', [
|
|
9868
9991
|
chargeRealizationDetailedLineFlatFeeWire,
|
|
@@ -11603,6 +11726,20 @@ export const createCustomerEntitlementPathParamsWire = z.object({
|
|
|
11603
11726
|
});
|
|
11604
11727
|
export const createCustomerEntitlementBodyWire = createEntitlementRequestWire;
|
|
11605
11728
|
export const createCustomerEntitlementResponseWire = entitlementWire;
|
|
11729
|
+
export const getCustomerEntitlementHistoryPathParamsWire = z.object({
|
|
11730
|
+
customerId: ulidWire,
|
|
11731
|
+
entitlementId: ulidWire,
|
|
11732
|
+
});
|
|
11733
|
+
export const getCustomerEntitlementHistoryQueryParamsWire = z.object({
|
|
11734
|
+
from: dateTimeWire.optional(),
|
|
11735
|
+
to: dateTimeWire.optional(),
|
|
11736
|
+
window_size: entitlementHistoryWindowSizeWire,
|
|
11737
|
+
time_zone: z.coerce
|
|
11738
|
+
.string()
|
|
11739
|
+
.optional()
|
|
11740
|
+
.describe('The IANA time zone the windows are aligned to.'),
|
|
11741
|
+
});
|
|
11742
|
+
export const getCustomerEntitlementHistoryResponseWire = entitlementHistoryWire;
|
|
11606
11743
|
export const createCreditGrantPathParamsWire = z.object({
|
|
11607
11744
|
customerId: ulidWire,
|
|
11608
11745
|
});
|
package/dist/models/types.d.ts
CHANGED
|
@@ -632,6 +632,20 @@ export interface EntitlementIssueAfterReset {
|
|
|
632
632
|
*/
|
|
633
633
|
priority: number;
|
|
634
634
|
}
|
|
635
|
+
/** Entitlement balance at the boundaries of a burndown segment. */
|
|
636
|
+
export interface EntitlementBurndownBalance {
|
|
637
|
+
/** The balance at the start of the segment. */
|
|
638
|
+
start: string;
|
|
639
|
+
/** The balance at the end of the segment. */
|
|
640
|
+
end: string;
|
|
641
|
+
}
|
|
642
|
+
/** Grant balances at the boundaries of a burndown segment, keyed by grant ID. */
|
|
643
|
+
export interface EntitlementBurndownGrantBalances {
|
|
644
|
+
/** The balance of each active grant at the start of the segment. */
|
|
645
|
+
start: Record<string, string>;
|
|
646
|
+
/** The balance of each active grant at the end of the segment. */
|
|
647
|
+
end: Record<string, string>;
|
|
648
|
+
}
|
|
635
649
|
/** Cost basis with an explicit conversion rate supplied with the charge. */
|
|
636
650
|
export interface CreateChargeCostBasisManual {
|
|
637
651
|
/** Discriminator selecting the cost basis mode. */
|
|
@@ -890,6 +904,13 @@ export interface ProfileReference {
|
|
|
890
904
|
export interface FeatureReference {
|
|
891
905
|
id: string;
|
|
892
906
|
}
|
|
907
|
+
/** Usage taken from a single grant. */
|
|
908
|
+
export interface EntitlementGrantUsage {
|
|
909
|
+
/** The ID of the grant. */
|
|
910
|
+
grantId: string;
|
|
911
|
+
/** The usage taken from the grant. */
|
|
912
|
+
usage: string;
|
|
913
|
+
}
|
|
893
914
|
/** Cost basis pinned to a specific cost basis resource of the custom currency. */
|
|
894
915
|
export interface CreateChargeCostBasisPinned {
|
|
895
916
|
/** Discriminator selecting the cost basis mode. */
|
|
@@ -2932,6 +2953,33 @@ export interface MeterQueryResult {
|
|
|
2932
2953
|
/** The usage data. If no data is available, an empty array is returned. */
|
|
2933
2954
|
data: MeterQueryRow[];
|
|
2934
2955
|
}
|
|
2956
|
+
/** Usage and balance of a single history window. */
|
|
2957
|
+
export interface EntitlementHistoryWindow {
|
|
2958
|
+
/** The period the window covers. */
|
|
2959
|
+
period: ClosedPeriod;
|
|
2960
|
+
/** The usage recorded in the window. */
|
|
2961
|
+
usage: string;
|
|
2962
|
+
/** The entitlement balance at the start of the window. */
|
|
2963
|
+
balanceAtStart: string;
|
|
2964
|
+
}
|
|
2965
|
+
/** A period in which grants were consumed in a fixed order. */
|
|
2966
|
+
export interface EntitlementBurndownSegment {
|
|
2967
|
+
/** The period the segment covers. */
|
|
2968
|
+
period: ClosedPeriod;
|
|
2969
|
+
/** The usage recorded in the segment. */
|
|
2970
|
+
usage: string;
|
|
2971
|
+
/** The usage in the segment not covered by any grant. */
|
|
2972
|
+
overage: string;
|
|
2973
|
+
/** The entitlement balance at the start and at the end of the segment. */
|
|
2974
|
+
balance: EntitlementBurndownBalance;
|
|
2975
|
+
/**
|
|
2976
|
+
* The balance of each active grant at the start and at the end of the segment,
|
|
2977
|
+
* keyed by grant ID.
|
|
2978
|
+
*/
|
|
2979
|
+
grantBalances: EntitlementBurndownGrantBalances;
|
|
2980
|
+
/** The grants consumed in the segment and the usage taken from each. */
|
|
2981
|
+
grantUsages: EntitlementGrantUsage[];
|
|
2982
|
+
}
|
|
2935
2983
|
/** A detailed line produced by a flat fee charge's realization run. */
|
|
2936
2984
|
export interface ChargeRealizationDetailedLineFlatFee {
|
|
2937
2985
|
id: string;
|
|
@@ -4009,6 +4057,20 @@ export interface IngestedEventPaginatedResponse {
|
|
|
4009
4057
|
data: IngestedEvent[];
|
|
4010
4058
|
meta: CursorMeta;
|
|
4011
4059
|
}
|
|
4060
|
+
/** Balance and usage history of a metered entitlement. */
|
|
4061
|
+
export interface EntitlementHistory {
|
|
4062
|
+
/**
|
|
4063
|
+
* Usage in half-open windows of the requested size, aligned to the requested time
|
|
4064
|
+
* zone. Empty windows are included; windows before usage measurement began are
|
|
4065
|
+
* omitted.
|
|
4066
|
+
*/
|
|
4067
|
+
windowedHistory: EntitlementHistoryWindow[];
|
|
4068
|
+
/**
|
|
4069
|
+
* Periods in which grants were consumed in a fixed order. A new segment starts
|
|
4070
|
+
* whenever grant priorities change or a usage period starts.
|
|
4071
|
+
*/
|
|
4072
|
+
burndownHistory: EntitlementBurndownSegment[];
|
|
4073
|
+
}
|
|
4012
4074
|
/** The list of parameters that failed validation. */
|
|
4013
4075
|
export type InvalidParameters = InvalidParameter[];
|
|
4014
4076
|
/** A meter query request. */
|
|
@@ -6579,6 +6641,11 @@ export type MeterAggregation = 'sum' | 'count' | 'unique_count' | 'avg' | 'min'
|
|
|
6579
6641
|
* format.
|
|
6580
6642
|
*/
|
|
6581
6643
|
export type MeterQueryGranularity = 'PT1M' | 'PT1H' | 'P1D' | 'P1M';
|
|
6644
|
+
/**
|
|
6645
|
+
* The meter query granularities the usage history can be grouped into. Sub-hour
|
|
6646
|
+
* windows are too expensive to compute and monthly windows are not supported.
|
|
6647
|
+
*/
|
|
6648
|
+
export type EntitlementHistoryWindowSize = 'PT1H' | 'P1D';
|
|
6582
6649
|
/**
|
|
6583
6650
|
* Filters on the given string field value by exact match. All properties are
|
|
6584
6651
|
* optional; provide exactly one to specify the comparison.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type RequestOptions } from '../lib/types.js';
|
|
3
|
-
import type { ListCustomerEntitlementAccessRequest, ListCustomerEntitlementAccessResponse
|
|
3
|
+
import type { ListCustomerEntitlementAccessRequest, ListCustomerEntitlementAccessResponse } from '../models/operations/entitlements.js';
|
|
4
4
|
export declare class Entitlements {
|
|
5
5
|
private readonly _client;
|
|
6
6
|
constructor(_client: Client);
|
|
@@ -10,12 +10,4 @@ export declare class Entitlements {
|
|
|
10
10
|
* GET /openmeter/customers/{customerId}/entitlement-access
|
|
11
11
|
*/
|
|
12
12
|
listCustomerAccess(request: ListCustomerEntitlementAccessRequest, options?: RequestOptions): Promise<ListCustomerEntitlementAccessResponse>;
|
|
13
|
-
/**
|
|
14
|
-
* Get customer entitlement access
|
|
15
|
-
*
|
|
16
|
-
* Get the customer's access to a single feature.
|
|
17
|
-
*
|
|
18
|
-
* GET /openmeter/customers/{customerId}/entitlement-access/features/{featureKey}
|
|
19
|
-
*/
|
|
20
|
-
getCustomerAccess(request: GetCustomerEntitlementAccessRequest, options?: RequestOptions): Promise<GetCustomerEntitlementAccessResponse>;
|
|
21
13
|
}
|
package/dist/sdk/entitlements.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
|
|
2
2
|
import { unwrap } from '../lib/types.js';
|
|
3
|
-
import { listCustomerEntitlementAccess
|
|
3
|
+
import { listCustomerEntitlementAccess } from '../funcs/entitlements.js';
|
|
4
4
|
export class Entitlements {
|
|
5
5
|
_client;
|
|
6
6
|
constructor(_client) {
|
|
@@ -14,14 +14,4 @@ export class Entitlements {
|
|
|
14
14
|
async listCustomerAccess(request, options) {
|
|
15
15
|
return unwrap(await listCustomerEntitlementAccess(this._client, request, options));
|
|
16
16
|
}
|
|
17
|
-
/**
|
|
18
|
-
* Get customer entitlement access
|
|
19
|
-
*
|
|
20
|
-
* Get the customer's access to a single feature.
|
|
21
|
-
*
|
|
22
|
-
* GET /openmeter/customers/{customerId}/entitlement-access/features/{featureKey}
|
|
23
|
-
*/
|
|
24
|
-
async getCustomerAccess(request, options) {
|
|
25
|
-
return unwrap(await getCustomerEntitlementAccess(this._client, request, options));
|
|
26
|
-
}
|
|
27
17
|
}
|
package/dist/sdk/internal.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type RequestOptions } from '../lib/types.js';
|
|
3
|
-
import type { CreateCustomerEntitlementRequest, CreateCustomerEntitlementResponse, VoidCreditGrantRequest, VoidCreditGrantResponse, ListCustomerChargesRequest, ListCustomerChargesResponse, CreateCustomerChargesRequest, CreateCustomerChargesResponse } from '../models/operations/customers.js';
|
|
3
|
+
import type { CreateCustomerEntitlementRequest, CreateCustomerEntitlementResponse, GetCustomerEntitlementHistoryRequest, GetCustomerEntitlementHistoryResponse, VoidCreditGrantRequest, VoidCreditGrantResponse, ListCustomerChargesRequest, ListCustomerChargesResponse, CreateCustomerChargesRequest, CreateCustomerChargesResponse } from '../models/operations/customers.js';
|
|
4
|
+
import type { GetCustomerEntitlementAccessRequest, GetCustomerEntitlementAccessResponse } from '../models/operations/entitlements.js';
|
|
4
5
|
import type { UnscheduleSubscriptionRequest, UnscheduleSubscriptionResponse, RestoreSubscriptionRequest, RestoreSubscriptionResponse, MigrateSubscriptionRequest, MigrateSubscriptionResponse, CreateSubscriptionAddonRequest, CreateSubscriptionAddonResponse, UpdateSubscriptionAddonRequest, UpdateSubscriptionAddonResponse } from '../models/operations/subscriptions.js';
|
|
5
6
|
import type { UninstallAppRequest, UninstallAppResponse, UpdateAppRequest, UpdateAppResponse, ListAppCatalogRequest, ListAppCatalogResponse, GetAppCatalogItemRequest, GetAppCatalogItemResponse, InstallAppRequest, InstallAppResponse } from '../models/operations/apps.js';
|
|
6
7
|
import type { ListInvoicesRequest, ListInvoicesResponse, GetInvoiceRequest, GetInvoiceResponse, UpdateInvoiceRequest, UpdateInvoiceResponse, DeleteInvoiceRequest, DeleteInvoiceResponse, AdvanceInvoiceRequest, AdvanceInvoiceResponse, ApproveInvoiceRequest, ApproveInvoiceResponse, RetryInvoiceRequest, RetryInvoiceResponse, SnapshotQuantitiesInvoiceRequest, SnapshotQuantitiesInvoiceResponse } from '../models/operations/invoices.js';
|
|
@@ -19,6 +20,8 @@ export declare class Internal {
|
|
|
19
20
|
constructor(_client: Client);
|
|
20
21
|
private _customers?;
|
|
21
22
|
get customers(): InternalCustomers;
|
|
23
|
+
private _entitlements?;
|
|
24
|
+
get entitlements(): InternalEntitlements;
|
|
22
25
|
private _subscriptions?;
|
|
23
26
|
get subscriptions(): InternalSubscriptions;
|
|
24
27
|
private _apps?;
|
|
@@ -59,6 +62,20 @@ export declare class InternalCustomersEntitlements {
|
|
|
59
62
|
* POST /openmeter/customers/{customerId}/entitlements
|
|
60
63
|
*/
|
|
61
64
|
create(request: CreateCustomerEntitlementRequest, options?: RequestOptions): Promise<CreateCustomerEntitlementResponse>;
|
|
65
|
+
/**
|
|
66
|
+
* Get customer entitlement history
|
|
67
|
+
*
|
|
68
|
+
* Get the balance and usage history of a metered entitlement. The queried range
|
|
69
|
+
* may span multiple usage periods.
|
|
70
|
+
*
|
|
71
|
+
* `windowed_history` groups usage into windows of the requested size and reports
|
|
72
|
+
* the balance at the start of each window. `burndown_history` lists the periods in
|
|
73
|
+
* which grants were consumed in a fixed order, together with the usage taken from
|
|
74
|
+
* each grant.
|
|
75
|
+
*
|
|
76
|
+
* GET /openmeter/customers/{customerId}/entitlements/{entitlementId}/history
|
|
77
|
+
*/
|
|
78
|
+
getHistory(request: GetCustomerEntitlementHistoryRequest, options?: RequestOptions): Promise<GetCustomerEntitlementHistoryResponse>;
|
|
62
79
|
}
|
|
63
80
|
export declare class InternalCustomersCredits {
|
|
64
81
|
private readonly _client;
|
|
@@ -122,6 +139,18 @@ export declare class InternalCustomersCharges {
|
|
|
122
139
|
*/
|
|
123
140
|
create(request: CreateCustomerChargesRequest, options?: RequestOptions): Promise<CreateCustomerChargesResponse>;
|
|
124
141
|
}
|
|
142
|
+
export declare class InternalEntitlements {
|
|
143
|
+
private readonly _client;
|
|
144
|
+
constructor(_client: Client);
|
|
145
|
+
/**
|
|
146
|
+
* Get customer entitlement access
|
|
147
|
+
*
|
|
148
|
+
* Get the customer's access to a single feature.
|
|
149
|
+
*
|
|
150
|
+
* GET /openmeter/customers/{customerId}/entitlement-access/features/{featureKey}
|
|
151
|
+
*/
|
|
152
|
+
getCustomerAccess(request: GetCustomerEntitlementAccessRequest, options?: RequestOptions): Promise<GetCustomerEntitlementAccessResponse>;
|
|
153
|
+
}
|
|
125
154
|
export declare class InternalSubscriptions {
|
|
126
155
|
private readonly _client;
|
|
127
156
|
constructor(_client: Client);
|
package/dist/sdk/internal.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
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 { createCustomerEntitlement, voidCreditGrant, listCustomerCharges, createCustomerCharges, } from '../funcs/customers.js';
|
|
4
|
+
import { createCustomerEntitlement, getCustomerEntitlementHistory, voidCreditGrant, listCustomerCharges, createCustomerCharges, } from '../funcs/customers.js';
|
|
5
|
+
import { getCustomerEntitlementAccess } from '../funcs/entitlements.js';
|
|
5
6
|
import { unscheduleSubscription, restoreSubscription, migrateSubscription, createSubscriptionAddon, updateSubscriptionAddon, } from '../funcs/subscriptions.js';
|
|
6
7
|
import { uninstallApp, updateApp, listAppCatalog, getAppCatalogItem, installApp, } from '../funcs/apps.js';
|
|
7
8
|
import { listInvoices, getInvoice, updateInvoice, deleteInvoice, advanceInvoice, approveInvoice, retryInvoice, snapshotQuantitiesInvoice, } from '../funcs/invoices.js';
|
|
@@ -23,6 +24,10 @@ export class Internal {
|
|
|
23
24
|
get customers() {
|
|
24
25
|
return (this._customers ??= new InternalCustomers(this._client));
|
|
25
26
|
}
|
|
27
|
+
_entitlements;
|
|
28
|
+
get entitlements() {
|
|
29
|
+
return (this._entitlements ??= new InternalEntitlements(this._client));
|
|
30
|
+
}
|
|
26
31
|
_subscriptions;
|
|
27
32
|
get subscriptions() {
|
|
28
33
|
return (this._subscriptions ??= new InternalSubscriptions(this._client));
|
|
@@ -89,6 +94,22 @@ export class InternalCustomersEntitlements {
|
|
|
89
94
|
async create(request, options) {
|
|
90
95
|
return unwrap(await createCustomerEntitlement(this._client, request, options));
|
|
91
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Get customer entitlement history
|
|
99
|
+
*
|
|
100
|
+
* Get the balance and usage history of a metered entitlement. The queried range
|
|
101
|
+
* may span multiple usage periods.
|
|
102
|
+
*
|
|
103
|
+
* `windowed_history` groups usage into windows of the requested size and reports
|
|
104
|
+
* the balance at the start of each window. `burndown_history` lists the periods in
|
|
105
|
+
* which grants were consumed in a fixed order, together with the usage taken from
|
|
106
|
+
* each grant.
|
|
107
|
+
*
|
|
108
|
+
* GET /openmeter/customers/{customerId}/entitlements/{entitlementId}/history
|
|
109
|
+
*/
|
|
110
|
+
async getHistory(request, options) {
|
|
111
|
+
return unwrap(await getCustomerEntitlementHistory(this._client, request, options));
|
|
112
|
+
}
|
|
92
113
|
}
|
|
93
114
|
export class InternalCustomersCredits {
|
|
94
115
|
_client;
|
|
@@ -168,6 +189,22 @@ export class InternalCustomersCharges {
|
|
|
168
189
|
return unwrap(await createCustomerCharges(this._client, request, options));
|
|
169
190
|
}
|
|
170
191
|
}
|
|
192
|
+
export class InternalEntitlements {
|
|
193
|
+
_client;
|
|
194
|
+
constructor(_client) {
|
|
195
|
+
this._client = _client;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Get customer entitlement access
|
|
199
|
+
*
|
|
200
|
+
* Get the customer's access to a single feature.
|
|
201
|
+
*
|
|
202
|
+
* GET /openmeter/customers/{customerId}/entitlement-access/features/{featureKey}
|
|
203
|
+
*/
|
|
204
|
+
async getCustomerAccess(request, options) {
|
|
205
|
+
return unwrap(await getCustomerEntitlementAccess(this._client, request, options));
|
|
206
|
+
}
|
|
207
|
+
}
|
|
171
208
|
export class InternalSubscriptions {
|
|
172
209
|
_client;
|
|
173
210
|
constructor(_client) {
|