@openmeter/client 1.0.0-beta-49638d2a32a7 → 1.0.0-beta-3bef3b26f622
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -6
- package/dist/funcs/entitlements.d.ts +10 -1
- package/dist/funcs/entitlements.js +50 -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/entitlements.d.ts +19 -1
- package/dist/models/schemas.d.ts +94 -6
- package/dist/models/schemas.js +58 -6
- package/dist/models/types.d.ts +31 -1
- package/dist/sdk/internal.d.ts +10 -1
- package/dist/sdk/internal.js +12 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -440,12 +440,13 @@ they can change or be removed without notice or semver consideration.
|
|
|
440
440
|
|
|
441
441
|
### Internal Entitlements
|
|
442
442
|
|
|
443
|
-
| Method
|
|
444
|
-
|
|
|
445
|
-
| `client.internal.entitlements.getCustomerAccess`
|
|
446
|
-
| `client.internal.entitlements.
|
|
447
|
-
| `client.internal.entitlements.
|
|
448
|
-
| `client.internal.entitlements.
|
|
443
|
+
| Method | HTTP | Description |
|
|
444
|
+
| ----------------------------------------------------------- | -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
445
|
+
| `client.internal.entitlements.getCustomerAccess` | `GET /openmeter/customers/{customerId}/entitlement-access/features/{featureKey}` | Get the customer's access to a single feature. |
|
|
446
|
+
| `client.internal.entitlements.getCustomerValueByFeatureKey` | `GET /openmeter/customers/{customerId}/entitlement-access/features/{featureKey}/value` | Get the customer's entitlement value for a feature at a point in time. Without an active entitlement, the result denies access and omits the type. |
|
|
447
|
+
| `client.internal.entitlements.list` | `GET /openmeter/entitlements` | List the active entitlements of all customers. Intended for administrative use. To list the entitlements of a single customer, use the customer entitlements endpoints; to check entitlement access, use the entitlement access endpoints. |
|
|
448
|
+
| `client.internal.entitlements.get` | `GET /openmeter/entitlements/{entitlementId}` | Get an entitlement by ID. To check entitlement access, use the entitlement access endpoints instead. |
|
|
449
|
+
| `client.internal.entitlements.getCustomerValue` | `GET /openmeter/customers/{customerId}/entitlements/{entitlementId}/value` | Get the customer's access through a single entitlement, optionally evaluated at a point in time. |
|
|
449
450
|
|
|
450
451
|
### Internal Grants
|
|
451
452
|
|
|
@@ -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 { ListCustomerEntitlementAccessRequest, ListCustomerEntitlementAccessResponse, GetCustomerEntitlementAccessRequest, GetCustomerEntitlementAccessResponse, ListEntitlementsRequest, ListEntitlementsResponse, GetEntitlementRequest, GetEntitlementResponse, GetCustomerEntitlementValueRequest, GetCustomerEntitlementValueResponse } from '../models/operations/entitlements.js';
|
|
3
|
+
import type { ListCustomerEntitlementAccessRequest, ListCustomerEntitlementAccessResponse, GetCustomerEntitlementAccessRequest, GetCustomerEntitlementAccessResponse, GetCustomerEntitlementValueByFeatureKeyRequest, GetCustomerEntitlementValueByFeatureKeyResponse, ListEntitlementsRequest, ListEntitlementsResponse, GetEntitlementRequest, GetEntitlementResponse, GetCustomerEntitlementValueRequest, GetCustomerEntitlementValueResponse } from '../models/operations/entitlements.js';
|
|
4
4
|
/**
|
|
5
5
|
* List customer entitlement access
|
|
6
6
|
*
|
|
@@ -15,6 +15,15 @@ export declare function listCustomerEntitlementAccess(client: Client, req: ListC
|
|
|
15
15
|
* GET /openmeter/customers/{customerId}/entitlement-access/features/{featureKey}
|
|
16
16
|
*/
|
|
17
17
|
export declare function getCustomerEntitlementAccess(client: Client, req: GetCustomerEntitlementAccessRequest, options?: RequestOptions): Promise<Result<GetCustomerEntitlementAccessResponse>>;
|
|
18
|
+
/**
|
|
19
|
+
* Get customer entitlement value by feature key
|
|
20
|
+
*
|
|
21
|
+
* Get the customer's entitlement value for a feature at a point in time. Without
|
|
22
|
+
* an active entitlement, the result denies access and omits the type.
|
|
23
|
+
*
|
|
24
|
+
* GET /openmeter/customers/{customerId}/entitlement-access/features/{featureKey}/value
|
|
25
|
+
*/
|
|
26
|
+
export declare function getCustomerEntitlementValueByFeatureKey(client: Client, req: GetCustomerEntitlementValueByFeatureKeyRequest, options?: RequestOptions): Promise<Result<GetCustomerEntitlementValueByFeatureKeyResponse>>;
|
|
18
27
|
/**
|
|
19
28
|
* List entitlements
|
|
20
29
|
*
|
|
@@ -78,6 +78,56 @@ export function getCustomerEntitlementAccess(client, req, options) {
|
|
|
78
78
|
});
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* Get customer entitlement value by feature key
|
|
83
|
+
*
|
|
84
|
+
* Get the customer's entitlement value for a feature at a point in time. Without
|
|
85
|
+
* an active entitlement, the result denies access and omits the type.
|
|
86
|
+
*
|
|
87
|
+
* GET /openmeter/customers/{customerId}/entitlement-access/features/{featureKey}/value
|
|
88
|
+
*/
|
|
89
|
+
export function getCustomerEntitlementValueByFeatureKey(client, req, options) {
|
|
90
|
+
return request(() => {
|
|
91
|
+
const pathParamsInput = {
|
|
92
|
+
customerId: req.customerId,
|
|
93
|
+
featureKey: req.featureKey,
|
|
94
|
+
};
|
|
95
|
+
const pathParams = client._options.validate
|
|
96
|
+
? toPathWire(pathParamsInput, schemas.getCustomerEntitlementValueByFeatureKeyPathParams)
|
|
97
|
+
: pathParamsInput;
|
|
98
|
+
if (client._options.validate) {
|
|
99
|
+
assertValid(schemas.getCustomerEntitlementValueByFeatureKeyPathParamsWire, pathParams);
|
|
100
|
+
}
|
|
101
|
+
const path = `openmeter/customers/${(() => {
|
|
102
|
+
if (pathParams.customerId === undefined) {
|
|
103
|
+
throw new Error('missing path parameter: customerId');
|
|
104
|
+
}
|
|
105
|
+
return encodeURIComponent(String(pathParams.customerId));
|
|
106
|
+
})()}/entitlement-access/features/${(() => {
|
|
107
|
+
if (pathParams.featureKey === undefined) {
|
|
108
|
+
throw new Error('missing path parameter: featureKey');
|
|
109
|
+
}
|
|
110
|
+
return encodeURIComponent(String(pathParams.featureKey));
|
|
111
|
+
})()}/value`;
|
|
112
|
+
const query = toWire({
|
|
113
|
+
expand: req.expand,
|
|
114
|
+
at: req.at,
|
|
115
|
+
}, schemas.getCustomerEntitlementValueByFeatureKeyQueryParams);
|
|
116
|
+
if (client._options.validate) {
|
|
117
|
+
assertValid(schemas.getCustomerEntitlementValueByFeatureKeyQueryParamsWire, query);
|
|
118
|
+
}
|
|
119
|
+
const searchParams = toURLSearchParams(query);
|
|
120
|
+
return http(client)
|
|
121
|
+
.get(path, { ...options, searchParams })
|
|
122
|
+
.json()
|
|
123
|
+
.then((data) => {
|
|
124
|
+
if (client._options.validate) {
|
|
125
|
+
assertValid(schemas.getCustomerEntitlementValueByFeatureKeyResponseWire, data);
|
|
126
|
+
}
|
|
127
|
+
return fromWire(data, schemas.getCustomerEntitlementValueByFeatureKeyResponse);
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
}
|
|
81
131
|
/**
|
|
82
132
|
* List entitlements
|
|
83
133
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -44,4 +44,4 @@ export type * from './models/operations/planAddons.js';
|
|
|
44
44
|
export type * from './models/operations/defaults.js';
|
|
45
45
|
export type * from './models/operations/entitlementAccess.js';
|
|
46
46
|
export type * from './models/operations/notifications.js';
|
|
47
|
-
export type { Labels, CursorPaginationQueryPage, SortQuery, IngestedEventValidationError, CursorMetaPage, BaseError, PageMeta, QueryFilterString, AppStripeCheckoutSessionCustomTextParams, AppStripeCreateCustomerPortalSessionOptions, CreateLabels, CreateVersionFilter, VersionFilter, 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, SubscriptionPlanReference, UpsertPlanAddonRequest, ResourceWithKey, Meter, PaginatedMeta, QueryFilterStringMapItem, CustomerKeyReference, CustomerUsageAttribution, UpdateCustomerUsageAttribution, Address, UpdateAddress, AppStripeCreateCheckoutSessionCustomerUpdate, AppStripeCreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreement, AppStripeCreateCheckoutSessionTaxIdCollection, AppStripeCreateCheckoutSessionResult, CustomerStripeCreateCustomerPortalSessionRequest, EntitlementAccessCheckResult, RecurringPeriodInput, RecurringPeriod, RateCardMeteredEntitlement, SubscriptionPhaseCreate, SubscriptionEditStretchPhase, GetCreditBalanceParamsFilter, ListPlansParamsFilter, CreateCreditGrantPlanFilter, CreditGrantPlanFilter, ListCreditGrantsParamsFilter, ValidationIssue, SubscriptionProRatingConfig, RateCardProrationConfiguration, UnitConfig, PartyTaxIdentity, UpdateBillingPartyTaxIdentity, InvoiceAvailableActions, ChargeRealizationPayment, SubscriptionEditRemovePhase, TaxCodeAppMapping, AppCapability, UpdateAppStripeRequest, UpdateAppSandboxRequest, UpdateAppExternalInvoicingRequest, WorkflowInvoicingSettings, InvoiceLineAmountDiscount, InvoiceLineUsageDiscount, InvoiceLineBaseDiscount, ListCurrenciesParamsFilter, EntitlementAccessQueryRequest, EntitlementFeatureAccessReason, EntitlementAccessQueryError, NotificationChannel, AppCustomerData, UpsertAppCustomerDataRequest, CreditAdjustment, ListCreditTransactionsParamsFilter, CurrencyAmount, EntitlementValueResult, PriceTier, ChargeTotals, FeatureLlmUnitCost, UpdatePriceTier, LlmCostPrice, LlmCostOverrideCreate, ListCustomersParamsFilter, ListCustomerEntitlementsParamsFilter, ListEntitlementsParamsFilter, ListGrantsParamsFilter, ListSubscriptionsParamsFilter, ListAppsParamsFilter, ListBillingProfilesParamsFilter, ListFeatureParamsFilter, ListAddonsParamsFilter, ListPlanAddonsParamsFilter, CreateTaxCodeConfig, TaxCodeConfig, TaxConfig, OrganizationDefaultTaxCodes, CreditBalance, CreditTransaction, InvoiceWorkflowAppsReferences, ProfileAppReferences, PlanAddon, UpdateTaxCodeConfig, ListEventsParamsFilter, ListCustomerChargesParamsFilter, ListInvoicesParamsFilter, ListChargesParamsFilter, ListNotificationChannelsParamsFilter, 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, EntitlementGrant, WorkflowCollectionAlignmentAnchored, SubscriptionEditAddPhase, CreateCreditGrantFilters, CreditGrantFilters, SubscriptionBase, InvoiceStatusDetails, InvoiceWorkflow, SubscriptionCancel, SubscriptionMigrate, SubscriptionAddonUpdate, TaxCode, AppCatalogItem, InvoiceLineDiscounts, UpdateBillingInvoiceWorkflow, EntitlementFeatureAccess, NotificationChannelPagePaginatedResponse, 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, EntitlementGrantPagePaginatedResponse, InvoiceWorkflowSettings, TaxCodePagePaginatedResponse, AppStripe, AppSandbox, AppExternalInvoicing, AppCatalogItemPagePaginatedResponse, InstalledAppStripe, InstalledAppSandbox, InstalledAppExternalInvoicing, InvoiceDetailedLine, UpdateInvoiceWorkflowSettings, EntitlementAccessQueryResult, Feature, CreditGrant, CurrencyPagePaginatedResponse, BadRequest, InvoiceBase, CustomerStripeCreateCheckoutSessionRequest, EntitlementPagePaginatedResponse, 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, BooleanFieldFilter, 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, ResetCustomerEntitlementUsageRequestInput, UnauthorizedInput, ForbiddenInput, NotFoundInput, GoneInput, ConflictInput, PayloadTooLargeInput, UnsupportedMediaTypeInput, UnprocessableContentInput, TooManyRequestsInput, InternalInput, NotImplementedInput, NotAvailableInput, AppStripeCreateCheckoutSessionCustomerUpdateInput, AppStripeCreateCheckoutSessionTaxIdCollectionInput, RateCardMeteredEntitlementInput, VoidCreditGrantRequestInput, UnitConfigInput, WorkflowInvoicingSettingsInput, EntitlementAccessQueryRequestInput, NotificationChannelInput, CreateNotificationChannelRequestInput, UpdateNotificationChannelRequestInput, IngestedEventInput, EntitlementMeteredInput, SubscriptionBaseInput, InvoiceWorkflowInput, SubscriptionCancelInput, SubscriptionMigrateInput, UpdateBillingInvoiceWorkflowInput, NotificationChannelPagePaginatedResponseInput, CreateCreditGrantPurchaseInput, CreditGrantPurchaseInput, WorkflowTaxSettingsInput, IngestedEventPaginatedResponseInput, MeterQueryRequestInput, AppStripeCreateCheckoutSessionRequestOptionsInput, CreateEntitlementMeteredRequestInput, InvoiceWorkflowSettingsInput, InvoiceDetailedLineInput, UpdateInvoiceWorkflowSettingsInput, CreateCreditGrantRequestInput, CreditGrantInput, BadRequestInput, CustomerStripeCreateCheckoutSessionRequestInput, EntitlementPagePaginatedResponseInput, 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';
|
|
47
|
+
export type { Labels, CursorPaginationQueryPage, SortQuery, IngestedEventValidationError, CursorMetaPage, BaseError, PageMeta, QueryFilterString, AppStripeCheckoutSessionCustomTextParams, AppStripeCreateCustomerPortalSessionOptions, CreateLabels, CreateVersionFilter, VersionFilter, 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, SubscriptionPlanReference, UpsertPlanAddonRequest, ResourceWithKey, Meter, PaginatedMeta, QueryFilterStringMapItem, CustomerKeyReference, CustomerUsageAttribution, UpdateCustomerUsageAttribution, Address, UpdateAddress, AppStripeCreateCheckoutSessionCustomerUpdate, AppStripeCreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreement, AppStripeCreateCheckoutSessionTaxIdCollection, AppStripeCreateCheckoutSessionResult, CustomerStripeCreateCustomerPortalSessionRequest, EntitlementAccessCheckResult, RecurringPeriodInput, RecurringPeriod, RateCardMeteredEntitlement, SubscriptionPhaseCreate, SubscriptionEditStretchPhase, GetCreditBalanceParamsFilter, ListPlansParamsFilter, CreateCreditGrantPlanFilter, CreditGrantPlanFilter, ListCreditGrantsParamsFilter, ValidationIssue, SubscriptionProRatingConfig, RateCardProrationConfiguration, UnitConfig, PartyTaxIdentity, UpdateBillingPartyTaxIdentity, InvoiceAvailableActions, ChargeRealizationPayment, SubscriptionEditRemovePhase, TaxCodeAppMapping, AppCapability, UpdateAppStripeRequest, UpdateAppSandboxRequest, UpdateAppExternalInvoicingRequest, WorkflowInvoicingSettings, InvoiceLineAmountDiscount, InvoiceLineUsageDiscount, InvoiceLineBaseDiscount, ListCurrenciesParamsFilter, EntitlementAccessQueryRequest, EntitlementFeatureAccessReason, EntitlementAccessQueryError, NotificationChannel, AppCustomerData, UpsertAppCustomerDataRequest, CreditAdjustment, ListCreditTransactionsParamsFilter, CurrencyAmount, EntitlementValueResult, EntitlementFeatureValueResult, PriceTier, ChargeTotals, FeatureLlmUnitCost, UpdatePriceTier, LlmCostPrice, LlmCostOverrideCreate, ListCustomersParamsFilter, ListCustomerEntitlementsParamsFilter, ListEntitlementsParamsFilter, ListGrantsParamsFilter, ListSubscriptionsParamsFilter, ListAppsParamsFilter, ListBillingProfilesParamsFilter, ListFeatureParamsFilter, ListAddonsParamsFilter, ListPlanAddonsParamsFilter, CreateTaxCodeConfig, TaxCodeConfig, TaxConfig, OrganizationDefaultTaxCodes, CreditBalance, CreditTransaction, InvoiceWorkflowAppsReferences, ProfileAppReferences, PlanAddon, UpdateTaxCodeConfig, ListEventsParamsFilter, ListCustomerChargesParamsFilter, ListInvoicesParamsFilter, ListChargesParamsFilter, ListNotificationChannelsParamsFilter, 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, EntitlementGrant, WorkflowCollectionAlignmentAnchored, SubscriptionEditAddPhase, CreateCreditGrantFilters, CreditGrantFilters, SubscriptionBase, InvoiceStatusDetails, InvoiceWorkflow, SubscriptionCancel, SubscriptionMigrate, SubscriptionAddonUpdate, TaxCode, AppCatalogItem, InvoiceLineDiscounts, UpdateBillingInvoiceWorkflow, EntitlementFeatureAccess, NotificationChannelPagePaginatedResponse, 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, EntitlementGrantPagePaginatedResponse, InvoiceWorkflowSettings, TaxCodePagePaginatedResponse, AppStripe, AppSandbox, AppExternalInvoicing, AppCatalogItemPagePaginatedResponse, InstalledAppStripe, InstalledAppSandbox, InstalledAppExternalInvoicing, InvoiceDetailedLine, UpdateInvoiceWorkflowSettings, EntitlementAccessQueryResult, Feature, CreditGrant, CurrencyPagePaginatedResponse, BadRequest, InvoiceBase, CustomerStripeCreateCheckoutSessionRequest, EntitlementPagePaginatedResponse, 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, BooleanFieldFilter, 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, ResetCustomerEntitlementUsageRequestInput, UnauthorizedInput, ForbiddenInput, NotFoundInput, GoneInput, ConflictInput, PayloadTooLargeInput, UnsupportedMediaTypeInput, UnprocessableContentInput, TooManyRequestsInput, InternalInput, NotImplementedInput, NotAvailableInput, AppStripeCreateCheckoutSessionCustomerUpdateInput, AppStripeCreateCheckoutSessionTaxIdCollectionInput, RateCardMeteredEntitlementInput, VoidCreditGrantRequestInput, UnitConfigInput, WorkflowInvoicingSettingsInput, EntitlementAccessQueryRequestInput, NotificationChannelInput, CreateNotificationChannelRequestInput, UpdateNotificationChannelRequestInput, IngestedEventInput, EntitlementMeteredInput, SubscriptionBaseInput, InvoiceWorkflowInput, SubscriptionCancelInput, SubscriptionMigrateInput, UpdateBillingInvoiceWorkflowInput, NotificationChannelPagePaginatedResponseInput, CreateCreditGrantPurchaseInput, CreditGrantPurchaseInput, WorkflowTaxSettingsInput, IngestedEventPaginatedResponseInput, MeterQueryRequestInput, AppStripeCreateCheckoutSessionRequestOptionsInput, CreateEntitlementMeteredRequestInput, InvoiceWorkflowSettingsInput, InvoiceDetailedLineInput, UpdateInvoiceWorkflowSettingsInput, CreateCreditGrantRequestInput, CreditGrantInput, BadRequestInput, CustomerStripeCreateCheckoutSessionRequestInput, EntitlementPagePaginatedResponseInput, 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-3bef3b26f622";
|
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-3bef3b26f622';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AcceptDateStrings } from '../../lib/wire.js';
|
|
2
|
-
import type { Entitlement, EntitlementAccessCheckResult, EntitlementPagePaginatedResponse, EntitlementValueResult, ListCustomerEntitlementAccessResponseData, ListEntitlementsParamsFilter, SortQueryInput } from '../types.js';
|
|
2
|
+
import type { Entitlement, EntitlementAccessCheckResult, EntitlementFeatureValueResult, EntitlementPagePaginatedResponse, EntitlementValueResult, ListCustomerEntitlementAccessResponseData, ListEntitlementsParamsFilter, SortQueryInput } from '../types.js';
|
|
3
3
|
export type ListCustomerEntitlementAccessRequest = {
|
|
4
4
|
customerId: string;
|
|
5
5
|
};
|
|
@@ -9,6 +9,24 @@ export type GetCustomerEntitlementAccessRequest = {
|
|
|
9
9
|
featureKey: string;
|
|
10
10
|
};
|
|
11
11
|
export type GetCustomerEntitlementAccessResponse = EntitlementAccessCheckResult;
|
|
12
|
+
export interface GetCustomerEntitlementValueByFeatureKeyQuery {
|
|
13
|
+
/**
|
|
14
|
+
* Expand computed fields.
|
|
15
|
+
*
|
|
16
|
+
* Supported values are:
|
|
17
|
+
*
|
|
18
|
+
* - `value`: Expand the balance details of a metered entitlement; it sets the
|
|
19
|
+
* `value` field.
|
|
20
|
+
*/
|
|
21
|
+
expand?: 'value'[];
|
|
22
|
+
/** The point in time to evaluate the entitlement at. Defaults to the current time. */
|
|
23
|
+
at?: Date;
|
|
24
|
+
}
|
|
25
|
+
export type GetCustomerEntitlementValueByFeatureKeyRequest = AcceptDateStrings<GetCustomerEntitlementValueByFeatureKeyQuery & {
|
|
26
|
+
customerId: string;
|
|
27
|
+
featureKey: string;
|
|
28
|
+
}>;
|
|
29
|
+
export type GetCustomerEntitlementValueByFeatureKeyResponse = EntitlementFeatureValueResult;
|
|
12
30
|
export interface ListEntitlementsQuery {
|
|
13
31
|
/** Determines which page of the collection to retrieve. */
|
|
14
32
|
page?: {
|
package/dist/models/schemas.d.ts
CHANGED
|
@@ -170,6 +170,9 @@ export declare const entitlementType: z.ZodEnum<{
|
|
|
170
170
|
metered: "metered";
|
|
171
171
|
static: "static";
|
|
172
172
|
}>;
|
|
173
|
+
export declare const entitlementAccessExpand: z.ZodEnum<{
|
|
174
|
+
value: "value";
|
|
175
|
+
}>;
|
|
173
176
|
export declare const iso8601Duration: z.ZodString;
|
|
174
177
|
export declare const entitlementMeasureUsageFromPreset: z.ZodEnum<{
|
|
175
178
|
current_period_start: "current_period_start";
|
|
@@ -181,9 +184,6 @@ export declare const stringFieldFilterExact: z.ZodUnion<readonly [z.ZodString, z
|
|
|
181
184
|
oeq: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
182
185
|
neq: z.ZodOptional<z.ZodString>;
|
|
183
186
|
}, z.core.$strip>]>;
|
|
184
|
-
export declare const entitlementAccessExpand: z.ZodEnum<{
|
|
185
|
-
value: "value";
|
|
186
|
-
}>;
|
|
187
187
|
export declare const createLabels: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
188
188
|
export declare const creditFundingMethod: z.ZodEnum<{
|
|
189
189
|
external: "external";
|
|
@@ -1890,6 +1890,23 @@ export declare const entitlementValueResult: z.ZodObject<{
|
|
|
1890
1890
|
grantBalances: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
1891
1891
|
}, z.core.$strip>>;
|
|
1892
1892
|
}, z.core.$strip>;
|
|
1893
|
+
export declare const entitlementFeatureValueResult: z.ZodObject<{
|
|
1894
|
+
featureKey: z.ZodString;
|
|
1895
|
+
hasAccess: z.ZodBoolean;
|
|
1896
|
+
config: z.ZodOptional<z.ZodString>;
|
|
1897
|
+
value: z.ZodOptional<z.ZodObject<{
|
|
1898
|
+
balance: z.ZodString;
|
|
1899
|
+
usage: z.ZodString;
|
|
1900
|
+
overage: z.ZodString;
|
|
1901
|
+
totalAvailableGrantAmount: z.ZodString;
|
|
1902
|
+
grantBalances: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
1903
|
+
}, z.core.$strip>>;
|
|
1904
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
1905
|
+
boolean: "boolean";
|
|
1906
|
+
metered: "metered";
|
|
1907
|
+
static: "static";
|
|
1908
|
+
}>>;
|
|
1909
|
+
}, z.core.$strip>;
|
|
1893
1910
|
export declare const priceTier: z.ZodObject<{
|
|
1894
1911
|
upToAmount: z.ZodOptional<z.ZodString>;
|
|
1895
1912
|
flatPrice: z.ZodOptional<z.ZodObject<{
|
|
@@ -18624,6 +18641,33 @@ export declare const getCustomerEntitlementAccessResponse: z.ZodObject<{
|
|
|
18624
18641
|
static: "static";
|
|
18625
18642
|
}>>;
|
|
18626
18643
|
}, z.core.$strip>;
|
|
18644
|
+
export declare const getCustomerEntitlementValueByFeatureKeyPathParams: z.ZodObject<{
|
|
18645
|
+
customerId: z.ZodString;
|
|
18646
|
+
featureKey: z.ZodString;
|
|
18647
|
+
}, z.core.$strip>;
|
|
18648
|
+
export declare const getCustomerEntitlementValueByFeatureKeyQueryParams: z.ZodObject<{
|
|
18649
|
+
expand: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
18650
|
+
value: "value";
|
|
18651
|
+
}>>>;
|
|
18652
|
+
at: z.ZodOptional<z.ZodDate>;
|
|
18653
|
+
}, z.core.$strip>;
|
|
18654
|
+
export declare const getCustomerEntitlementValueByFeatureKeyResponse: z.ZodObject<{
|
|
18655
|
+
featureKey: z.ZodString;
|
|
18656
|
+
hasAccess: z.ZodBoolean;
|
|
18657
|
+
config: z.ZodOptional<z.ZodString>;
|
|
18658
|
+
value: z.ZodOptional<z.ZodObject<{
|
|
18659
|
+
balance: z.ZodString;
|
|
18660
|
+
usage: z.ZodString;
|
|
18661
|
+
overage: z.ZodString;
|
|
18662
|
+
totalAvailableGrantAmount: z.ZodString;
|
|
18663
|
+
grantBalances: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
18664
|
+
}, z.core.$strip>>;
|
|
18665
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
18666
|
+
boolean: "boolean";
|
|
18667
|
+
metered: "metered";
|
|
18668
|
+
static: "static";
|
|
18669
|
+
}>>;
|
|
18670
|
+
}, z.core.$strip>;
|
|
18627
18671
|
export declare const createCustomerEntitlementPathParams: z.ZodObject<{
|
|
18628
18672
|
customerId: z.ZodString;
|
|
18629
18673
|
}, z.core.$strip>;
|
|
@@ -34769,6 +34813,9 @@ export declare const entitlementTypeWire: z.ZodEnum<{
|
|
|
34769
34813
|
metered: "metered";
|
|
34770
34814
|
static: "static";
|
|
34771
34815
|
}>;
|
|
34816
|
+
export declare const entitlementAccessExpandWire: z.ZodEnum<{
|
|
34817
|
+
value: "value";
|
|
34818
|
+
}>;
|
|
34772
34819
|
export declare const iso8601DurationWire: z.ZodString;
|
|
34773
34820
|
export declare const entitlementMeasureUsageFromPresetWire: z.ZodEnum<{
|
|
34774
34821
|
current_period_start: "current_period_start";
|
|
@@ -34780,9 +34827,6 @@ export declare const stringFieldFilterExactWire: z.ZodUnion<readonly [z.ZodStrin
|
|
|
34780
34827
|
oeq: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
34781
34828
|
neq: z.ZodOptional<z.ZodString>;
|
|
34782
34829
|
}, z.core.$strict>]>;
|
|
34783
|
-
export declare const entitlementAccessExpandWire: z.ZodEnum<{
|
|
34784
|
-
value: "value";
|
|
34785
|
-
}>;
|
|
34786
34830
|
export declare const createLabelsWire: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
34787
34831
|
export declare const creditFundingMethodWire: z.ZodEnum<{
|
|
34788
34832
|
external: "external";
|
|
@@ -36489,6 +36533,23 @@ export declare const entitlementValueResultWire: z.ZodObject<{
|
|
|
36489
36533
|
grant_balances: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
36490
36534
|
}, z.core.$strict>>;
|
|
36491
36535
|
}, z.core.$strict>;
|
|
36536
|
+
export declare const entitlementFeatureValueResultWire: z.ZodObject<{
|
|
36537
|
+
feature_key: z.ZodString;
|
|
36538
|
+
has_access: z.ZodBoolean;
|
|
36539
|
+
config: z.ZodOptional<z.ZodString>;
|
|
36540
|
+
value: z.ZodOptional<z.ZodObject<{
|
|
36541
|
+
balance: z.ZodString;
|
|
36542
|
+
usage: z.ZodString;
|
|
36543
|
+
overage: z.ZodString;
|
|
36544
|
+
total_available_grant_amount: z.ZodString;
|
|
36545
|
+
grant_balances: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
36546
|
+
}, z.core.$strict>>;
|
|
36547
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
36548
|
+
boolean: "boolean";
|
|
36549
|
+
metered: "metered";
|
|
36550
|
+
static: "static";
|
|
36551
|
+
}>>;
|
|
36552
|
+
}, z.core.$strict>;
|
|
36492
36553
|
export declare const priceTierWire: z.ZodObject<{
|
|
36493
36554
|
up_to_amount: z.ZodOptional<z.ZodString>;
|
|
36494
36555
|
flat_price: z.ZodOptional<z.ZodObject<{
|
|
@@ -53214,6 +53275,33 @@ export declare const getCustomerEntitlementAccessResponseWire: z.ZodObject<{
|
|
|
53214
53275
|
static: "static";
|
|
53215
53276
|
}>>;
|
|
53216
53277
|
}, z.core.$strict>;
|
|
53278
|
+
export declare const getCustomerEntitlementValueByFeatureKeyPathParamsWire: z.ZodObject<{
|
|
53279
|
+
customerId: z.ZodString;
|
|
53280
|
+
featureKey: z.ZodString;
|
|
53281
|
+
}, z.core.$strip>;
|
|
53282
|
+
export declare const getCustomerEntitlementValueByFeatureKeyQueryParamsWire: z.ZodObject<{
|
|
53283
|
+
expand: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
53284
|
+
value: "value";
|
|
53285
|
+
}>>>;
|
|
53286
|
+
at: z.ZodOptional<z.ZodString>;
|
|
53287
|
+
}, z.core.$strip>;
|
|
53288
|
+
export declare const getCustomerEntitlementValueByFeatureKeyResponseWire: z.ZodObject<{
|
|
53289
|
+
feature_key: z.ZodString;
|
|
53290
|
+
has_access: z.ZodBoolean;
|
|
53291
|
+
config: z.ZodOptional<z.ZodString>;
|
|
53292
|
+
value: z.ZodOptional<z.ZodObject<{
|
|
53293
|
+
balance: z.ZodString;
|
|
53294
|
+
usage: z.ZodString;
|
|
53295
|
+
overage: z.ZodString;
|
|
53296
|
+
total_available_grant_amount: z.ZodString;
|
|
53297
|
+
grant_balances: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
53298
|
+
}, z.core.$strict>>;
|
|
53299
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
53300
|
+
boolean: "boolean";
|
|
53301
|
+
metered: "metered";
|
|
53302
|
+
static: "static";
|
|
53303
|
+
}>>;
|
|
53304
|
+
}, z.core.$strict>;
|
|
53217
53305
|
export declare const createCustomerEntitlementPathParamsWire: z.ZodObject<{
|
|
53218
53306
|
customerId: z.ZodString;
|
|
53219
53307
|
}, z.core.$strip>;
|
package/dist/models/schemas.js
CHANGED
|
@@ -375,6 +375,9 @@ export const appStripeCreateCustomerPortalSessionOptions = z
|
|
|
375
375
|
export const entitlementType = z
|
|
376
376
|
.enum(['metered', 'static', 'boolean'])
|
|
377
377
|
.describe('The type of the entitlement.');
|
|
378
|
+
export const entitlementAccessExpand = z
|
|
379
|
+
.enum(['value'])
|
|
380
|
+
.describe('Expands for customer entitlement access. Values: - `value`: The balance details of a metered entitlement; it sets the `value` field.');
|
|
378
381
|
export const iso8601Duration = z
|
|
379
382
|
.string()
|
|
380
383
|
.regex(new RegExp('^P(?:\\d+(?:\\.\\d+)?Y)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?$'))
|
|
@@ -404,9 +407,6 @@ export const stringFieldFilterExact = z
|
|
|
404
407
|
}),
|
|
405
408
|
])
|
|
406
409
|
.describe('Filters on the given string field value by exact match. All properties are optional; provide exactly one to specify the comparison.');
|
|
407
|
-
export const entitlementAccessExpand = z
|
|
408
|
-
.enum(['value'])
|
|
409
|
-
.describe('Expands for customer entitlement access. Values: - `value`: The balance details of a metered entitlement; it sets the `value` field.');
|
|
410
410
|
export const createLabels = z
|
|
411
411
|
.record(z.string(), z.string())
|
|
412
412
|
.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 "\\_".');
|
|
@@ -2813,6 +2813,20 @@ export const entitlementValueResult = z
|
|
|
2813
2813
|
value: entitlementAccessValue.optional(),
|
|
2814
2814
|
})
|
|
2815
2815
|
.describe('Entitlement value result.');
|
|
2816
|
+
export const entitlementFeatureValueResult = z
|
|
2817
|
+
.object({
|
|
2818
|
+
featureKey: resourceKey,
|
|
2819
|
+
hasAccess: z
|
|
2820
|
+
.boolean()
|
|
2821
|
+
.describe('Whether the customer has access to the feature. Always true for `boolean` and `static` entitlements. Depends on balance for `metered` entitlements.'),
|
|
2822
|
+
config: z
|
|
2823
|
+
.string()
|
|
2824
|
+
.optional()
|
|
2825
|
+
.describe('Only available for static entitlements. Config is the JSON parsable configuration of the entitlement. Useful to describe per customer configuration.'),
|
|
2826
|
+
value: entitlementAccessValue.optional(),
|
|
2827
|
+
type: entitlementType.optional(),
|
|
2828
|
+
})
|
|
2829
|
+
.describe('Entitlement value looked up by feature key. A missing entitlement has no type and does not grant access.');
|
|
2816
2830
|
export const priceTier = z
|
|
2817
2831
|
.object({
|
|
2818
2832
|
upToAmount: numeric.optional(),
|
|
@@ -5801,6 +5815,18 @@ export const getCustomerEntitlementAccessPathParams = z.object({
|
|
|
5801
5815
|
featureKey: resourceKey,
|
|
5802
5816
|
});
|
|
5803
5817
|
export const getCustomerEntitlementAccessResponse = entitlementAccessCheckResult;
|
|
5818
|
+
export const getCustomerEntitlementValueByFeatureKeyPathParams = z.object({
|
|
5819
|
+
customerId: ulid,
|
|
5820
|
+
featureKey: resourceKey,
|
|
5821
|
+
});
|
|
5822
|
+
export const getCustomerEntitlementValueByFeatureKeyQueryParams = z.object({
|
|
5823
|
+
expand: z
|
|
5824
|
+
.array(entitlementAccessExpand)
|
|
5825
|
+
.optional()
|
|
5826
|
+
.describe('Expand computed fields. Supported values are: - `value`: Expand the balance details of a metered entitlement; it sets the `value` field.'),
|
|
5827
|
+
at: dateTime.optional(),
|
|
5828
|
+
});
|
|
5829
|
+
export const getCustomerEntitlementValueByFeatureKeyResponse = entitlementFeatureValueResult;
|
|
5804
5830
|
export const createCustomerEntitlementPathParams = z.object({
|
|
5805
5831
|
customerId: ulid,
|
|
5806
5832
|
});
|
|
@@ -7020,6 +7046,9 @@ export const appStripeCreateCustomerPortalSessionOptionsWire = z
|
|
|
7020
7046
|
export const entitlementTypeWire = z
|
|
7021
7047
|
.enum(['metered', 'static', 'boolean'])
|
|
7022
7048
|
.describe('The type of the entitlement.');
|
|
7049
|
+
export const entitlementAccessExpandWire = z
|
|
7050
|
+
.enum(['value'])
|
|
7051
|
+
.describe('Expands for customer entitlement access. Values: - `value`: The balance details of a metered entitlement; it sets the `value` field.');
|
|
7023
7052
|
export const iso8601DurationWire = z
|
|
7024
7053
|
.string()
|
|
7025
7054
|
.regex(new RegExp('^P(?:\\d+(?:\\.\\d+)?Y)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?$'))
|
|
@@ -7049,9 +7078,6 @@ export const stringFieldFilterExactWire = z
|
|
|
7049
7078
|
}),
|
|
7050
7079
|
])
|
|
7051
7080
|
.describe('Filters on the given string field value by exact match. All properties are optional; provide exactly one to specify the comparison.');
|
|
7052
|
-
export const entitlementAccessExpandWire = z
|
|
7053
|
-
.enum(['value'])
|
|
7054
|
-
.describe('Expands for customer entitlement access. Values: - `value`: The balance details of a metered entitlement; it sets the `value` field.');
|
|
7055
7081
|
export const createLabelsWire = z
|
|
7056
7082
|
.record(z.string(), z.string())
|
|
7057
7083
|
.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 "\\_".');
|
|
@@ -9427,6 +9453,20 @@ export const entitlementValueResultWire = z
|
|
|
9427
9453
|
value: entitlementAccessValueWire.optional(),
|
|
9428
9454
|
})
|
|
9429
9455
|
.describe('Entitlement value result.');
|
|
9456
|
+
export const entitlementFeatureValueResultWire = z
|
|
9457
|
+
.strictObject({
|
|
9458
|
+
feature_key: resourceKeyWire,
|
|
9459
|
+
has_access: z
|
|
9460
|
+
.boolean()
|
|
9461
|
+
.describe('Whether the customer has access to the feature. Always true for `boolean` and `static` entitlements. Depends on balance for `metered` entitlements.'),
|
|
9462
|
+
config: z
|
|
9463
|
+
.string()
|
|
9464
|
+
.optional()
|
|
9465
|
+
.describe('Only available for static entitlements. Config is the JSON parsable configuration of the entitlement. Useful to describe per customer configuration.'),
|
|
9466
|
+
value: entitlementAccessValueWire.optional(),
|
|
9467
|
+
type: entitlementTypeWire.optional(),
|
|
9468
|
+
})
|
|
9469
|
+
.describe('Entitlement value looked up by feature key. A missing entitlement has no type and does not grant access.');
|
|
9430
9470
|
export const priceTierWire = z
|
|
9431
9471
|
.strictObject({
|
|
9432
9472
|
up_to_amount: numericWire.optional(),
|
|
@@ -12416,6 +12456,18 @@ export const getCustomerEntitlementAccessPathParamsWire = z.object({
|
|
|
12416
12456
|
featureKey: resourceKeyWire,
|
|
12417
12457
|
});
|
|
12418
12458
|
export const getCustomerEntitlementAccessResponseWire = entitlementAccessCheckResultWire;
|
|
12459
|
+
export const getCustomerEntitlementValueByFeatureKeyPathParamsWire = z.object({
|
|
12460
|
+
customerId: ulidWire,
|
|
12461
|
+
featureKey: resourceKeyWire,
|
|
12462
|
+
});
|
|
12463
|
+
export const getCustomerEntitlementValueByFeatureKeyQueryParamsWire = z.object({
|
|
12464
|
+
expand: z
|
|
12465
|
+
.array(entitlementAccessExpandWire)
|
|
12466
|
+
.optional()
|
|
12467
|
+
.describe('Expand computed fields. Supported values are: - `value`: Expand the balance details of a metered entitlement; it sets the `value` field.'),
|
|
12468
|
+
at: dateTimeWire.optional(),
|
|
12469
|
+
});
|
|
12470
|
+
export const getCustomerEntitlementValueByFeatureKeyResponseWire = entitlementFeatureValueResultWire;
|
|
12419
12471
|
export const createCustomerEntitlementPathParamsWire = z.object({
|
|
12420
12472
|
customerId: ulidWire,
|
|
12421
12473
|
});
|
package/dist/models/types.d.ts
CHANGED
|
@@ -2533,7 +2533,7 @@ export interface CurrencyAmount {
|
|
|
2533
2533
|
export interface EntitlementValueResult {
|
|
2534
2534
|
/** The type of the entitlement. */
|
|
2535
2535
|
type: 'metered' | 'static' | 'boolean';
|
|
2536
|
-
/** The feature key
|
|
2536
|
+
/** The feature key being evaluated. */
|
|
2537
2537
|
featureKey: string;
|
|
2538
2538
|
/**
|
|
2539
2539
|
* Whether the customer has access to the feature. Always true for `boolean` and
|
|
@@ -2551,6 +2551,36 @@ export interface EntitlementValueResult {
|
|
|
2551
2551
|
*/
|
|
2552
2552
|
value?: EntitlementAccessValue;
|
|
2553
2553
|
}
|
|
2554
|
+
/**
|
|
2555
|
+
* Entitlement value looked up by feature key. A missing entitlement has no type
|
|
2556
|
+
* and does not grant access.
|
|
2557
|
+
*/
|
|
2558
|
+
export interface EntitlementFeatureValueResult {
|
|
2559
|
+
/** The feature key being evaluated. */
|
|
2560
|
+
featureKey: string;
|
|
2561
|
+
/**
|
|
2562
|
+
* Whether the customer has access to the feature. Always true for `boolean` and
|
|
2563
|
+
* `static` entitlements. Depends on balance for `metered` entitlements.
|
|
2564
|
+
*/
|
|
2565
|
+
hasAccess: boolean;
|
|
2566
|
+
/**
|
|
2567
|
+
* Only available for static entitlements. Config is the JSON parsable
|
|
2568
|
+
* configuration of the entitlement. Useful to describe per customer configuration.
|
|
2569
|
+
*/
|
|
2570
|
+
config?: string;
|
|
2571
|
+
/**
|
|
2572
|
+
* Only available for metered entitlements. The balance details of the entitlement
|
|
2573
|
+
* at the evaluation time. Requires the `value` expand.
|
|
2574
|
+
*/
|
|
2575
|
+
value?: EntitlementAccessValue;
|
|
2576
|
+
/**
|
|
2577
|
+
* The type of the entitlement.
|
|
2578
|
+
*
|
|
2579
|
+
* If not provided, the feature has no entitlement defined (has access is always
|
|
2580
|
+
* false in this case)
|
|
2581
|
+
*/
|
|
2582
|
+
type?: 'metered' | 'static' | 'boolean';
|
|
2583
|
+
}
|
|
2554
2584
|
/**
|
|
2555
2585
|
* A price tier used in graduated and volume pricing.
|
|
2556
2586
|
*
|
package/dist/sdk/internal.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type RequestOptions } from '../lib/types.js';
|
|
3
3
|
import type { CreateCustomerEntitlementRequest, CreateCustomerEntitlementResponse, OverrideCustomerEntitlementRequest, OverrideCustomerEntitlementResponse, GetCustomerEntitlementHistoryRequest, GetCustomerEntitlementHistoryResponse, GetCustomerEntitlementRequest, GetCustomerEntitlementResponse, ListCustomerEntitlementsRequest, ListCustomerEntitlementsResponse, ResetCustomerEntitlementUsageRequest, ResetCustomerEntitlementUsageResponse, DeleteCustomerEntitlementRequest, DeleteCustomerEntitlementResponse, CreateCustomerEntitlementGrantRequest, CreateCustomerEntitlementGrantResponse, ListCustomerEntitlementGrantsRequest, ListCustomerEntitlementGrantsResponse, VoidCreditGrantRequest, VoidCreditGrantResponse, ListCustomerChargesRequest, ListCustomerChargesResponse, CreateCustomerChargesRequest, CreateCustomerChargesResponse } from '../models/operations/customers.js';
|
|
4
|
-
import type { GetCustomerEntitlementAccessRequest, GetCustomerEntitlementAccessResponse, ListEntitlementsRequest, ListEntitlementsResponse, GetEntitlementRequest, GetEntitlementResponse, GetCustomerEntitlementValueRequest, GetCustomerEntitlementValueResponse } from '../models/operations/entitlements.js';
|
|
4
|
+
import type { GetCustomerEntitlementAccessRequest, GetCustomerEntitlementAccessResponse, GetCustomerEntitlementValueByFeatureKeyRequest, GetCustomerEntitlementValueByFeatureKeyResponse, ListEntitlementsRequest, ListEntitlementsResponse, GetEntitlementRequest, GetEntitlementResponse, GetCustomerEntitlementValueRequest, GetCustomerEntitlementValueResponse } from '../models/operations/entitlements.js';
|
|
5
5
|
import type { ListGrantsRequest, ListGrantsResponse, VoidGrantRequest, VoidGrantResponse } from '../models/operations/grants.js';
|
|
6
6
|
import type { UnscheduleSubscriptionRequest, UnscheduleSubscriptionResponse, RestoreSubscriptionRequest, RestoreSubscriptionResponse, MigrateSubscriptionRequest, MigrateSubscriptionResponse, CreateSubscriptionAddonRequest, CreateSubscriptionAddonResponse, UpdateSubscriptionAddonRequest, UpdateSubscriptionAddonResponse } from '../models/operations/subscriptions.js';
|
|
7
7
|
import type { UninstallAppRequest, UninstallAppResponse, UpdateAppRequest, UpdateAppResponse, ListAppCatalogRequest, ListAppCatalogResponse, GetAppCatalogItemRequest, GetAppCatalogItemResponse, InstallAppRequest, InstallAppResponse } from '../models/operations/apps.js';
|
|
@@ -273,6 +273,15 @@ export declare class InternalEntitlements {
|
|
|
273
273
|
* GET /openmeter/customers/{customerId}/entitlement-access/features/{featureKey}
|
|
274
274
|
*/
|
|
275
275
|
getCustomerAccess(request: GetCustomerEntitlementAccessRequest, options?: RequestOptions): Promise<GetCustomerEntitlementAccessResponse>;
|
|
276
|
+
/**
|
|
277
|
+
* Get customer entitlement value by feature key
|
|
278
|
+
*
|
|
279
|
+
* Get the customer's entitlement value for a feature at a point in time. Without
|
|
280
|
+
* an active entitlement, the result denies access and omits the type.
|
|
281
|
+
*
|
|
282
|
+
* GET /openmeter/customers/{customerId}/entitlement-access/features/{featureKey}/value
|
|
283
|
+
*/
|
|
284
|
+
getCustomerValueByFeatureKey(request: GetCustomerEntitlementValueByFeatureKeyRequest, options?: RequestOptions): Promise<GetCustomerEntitlementValueByFeatureKeyResponse>;
|
|
276
285
|
/**
|
|
277
286
|
* List entitlements
|
|
278
287
|
*
|
package/dist/sdk/internal.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { unwrap } from '../lib/types.js';
|
|
3
3
|
import { paginatePages } from '../lib/paginate.js';
|
|
4
4
|
import { createCustomerEntitlement, overrideCustomerEntitlement, getCustomerEntitlementHistory, getCustomerEntitlement, listCustomerEntitlements, resetCustomerEntitlementUsage, deleteCustomerEntitlement, createCustomerEntitlementGrant, listCustomerEntitlementGrants, voidCreditGrant, listCustomerCharges, createCustomerCharges, } from '../funcs/customers.js';
|
|
5
|
-
import { getCustomerEntitlementAccess, listEntitlements, getEntitlement, getCustomerEntitlementValue, } from '../funcs/entitlements.js';
|
|
5
|
+
import { getCustomerEntitlementAccess, getCustomerEntitlementValueByFeatureKey, listEntitlements, getEntitlement, getCustomerEntitlementValue, } from '../funcs/entitlements.js';
|
|
6
6
|
import { listGrants, voidGrant } from '../funcs/grants.js';
|
|
7
7
|
import { unscheduleSubscription, restoreSubscription, migrateSubscription, createSubscriptionAddon, updateSubscriptionAddon, } from '../funcs/subscriptions.js';
|
|
8
8
|
import { uninstallApp, updateApp, listAppCatalog, getAppCatalogItem, installApp, } from '../funcs/apps.js';
|
|
@@ -353,6 +353,17 @@ export class InternalEntitlements {
|
|
|
353
353
|
async getCustomerAccess(request, options) {
|
|
354
354
|
return unwrap(await getCustomerEntitlementAccess(this._client, request, options));
|
|
355
355
|
}
|
|
356
|
+
/**
|
|
357
|
+
* Get customer entitlement value by feature key
|
|
358
|
+
*
|
|
359
|
+
* Get the customer's entitlement value for a feature at a point in time. Without
|
|
360
|
+
* an active entitlement, the result denies access and omits the type.
|
|
361
|
+
*
|
|
362
|
+
* GET /openmeter/customers/{customerId}/entitlement-access/features/{featureKey}/value
|
|
363
|
+
*/
|
|
364
|
+
async getCustomerValueByFeatureKey(request, options) {
|
|
365
|
+
return unwrap(await getCustomerEntitlementValueByFeatureKey(this._client, request, options));
|
|
366
|
+
}
|
|
356
367
|
/**
|
|
357
368
|
* List entitlements
|
|
358
369
|
*
|