@wix/auto_sdk_benefit-programs_pools 1.0.89 → 1.0.91

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.
@@ -1184,6 +1184,20 @@ interface RedemptionAlreadyCanceled {
1184
1184
  */
1185
1185
  cancellationTransactionId?: string;
1186
1186
  }
1187
+ interface ItemNotAvailableInPool {
1188
+ /**
1189
+ * Pool ID
1190
+ * @format GUID
1191
+ */
1192
+ poolId?: string;
1193
+ /** Not found item reference in pool */
1194
+ itemReference?: ItemReference;
1195
+ /**
1196
+ * Key of the referenced benefit, if provided
1197
+ * @maxLength 64
1198
+ */
1199
+ benefitKey?: string | null;
1200
+ }
1187
1201
  interface ChainOperationInProgress {
1188
1202
  /**
1189
1203
  * ID of the pending transaction that hasn't settled yet.
@@ -1340,6 +1354,12 @@ interface CheckBenefitEligibilityRequest {
1340
1354
  * @maxLength 20
1341
1355
  */
1342
1356
  namespace: string;
1357
+ /**
1358
+ * Intent of the eligibility check.
1359
+ *
1360
+ * If not provided, `REDEMPTION` is used by default.
1361
+ */
1362
+ intent?: IntentWithLiterals;
1343
1363
  }
1344
1364
  declare enum Intent {
1345
1365
  /** Check whether the benefit can be redeemed. */
@@ -2010,9 +2030,13 @@ type ReallocateBenefitApplicationErrors = {
2010
2030
  description?: string;
2011
2031
  data?: Record<string, any>;
2012
2032
  } | {
2013
- code?: 'POOL_NOT_ACTIVE';
2033
+ code?: 'POOL_NOT_REALLOCATABLE';
2014
2034
  description?: string;
2015
2035
  data?: PoolNotActive;
2036
+ } | {
2037
+ code?: 'ITEM_NOT_AVAILABLE_IN_POOL';
2038
+ description?: string;
2039
+ data?: ItemNotAvailableInPool;
2016
2040
  } | {
2017
2041
  code?: 'POLICY_EXPRESSION_EVALUATED_TO_FALSE';
2018
2042
  description?: string;
@@ -2405,6 +2429,28 @@ interface RedeemBenefitOptions {
2405
2429
  */
2406
2430
  namespace: string;
2407
2431
  }
2432
+ /**
2433
+ * Reallocates a redeemed benefit to a new target date.
2434
+ *
2435
+ * The reallocation is recorded as a new zero-amount transaction that supersedes the specified transaction in the redemption's transaction chain.
2436
+ * The specified transaction must be the latest transaction in the chain. The item, count and benefit key are carried over from the original redemption; only the target date changes.
2437
+ * @param transactionId - ID of the latest transaction in the redemption's transaction chain.
2438
+ * For a redemption that has never been reallocated, this is the redemption transaction ID.
2439
+ * @public
2440
+ * @documentationMaturity preview
2441
+ * @requiredField options
2442
+ * @requiredField options.beneficiary
2443
+ * @requiredField options.idempotencyKey
2444
+ * @requiredField options.namespace
2445
+ * @requiredField options.targetDate
2446
+ * @requiredField transactionId
2447
+ * @permissionId benefit_programs:v1:pool:reallocate_benefit
2448
+ * @applicableIdentity APP
2449
+ * @fqn wix.benefit_programs.v1.pool.PoolService.ReallocateBenefit
2450
+ */
2451
+ declare function reallocateBenefit(transactionId: string, options: NonNullablePaths<ReallocateBenefitOptions, `beneficiary` | `idempotencyKey` | `namespace` | `targetDate`, 0>): Promise<NonNullablePaths<ReallocateBenefitResponse, `transactionId`, 0> & {
2452
+ __applicationErrorsType?: ReallocateBenefitApplicationErrors;
2453
+ }>;
2408
2454
  interface ReallocateBenefitOptions {
2409
2455
  /** New date that the item will be provided to the beneficiary. */
2410
2456
  targetDate: Date | null;
@@ -2423,6 +2469,25 @@ interface ReallocateBenefitOptions {
2423
2469
  */
2424
2470
  namespace: string;
2425
2471
  }
2472
+ /**
2473
+ * Cancels a redemption, crediting the redeemed amount back to the pool's available balance.
2474
+ *
2475
+ * The cancellation is recorded as a new transaction that supersedes the specified transaction and terminates the redemption's transaction chain.
2476
+ * The specified transaction must be the latest transaction in the chain. The credited amount is always the amount of the original redemption, regardless of any reallocations in between.
2477
+ * @param transactionId - ID of the latest transaction in the redemption's transaction chain.
2478
+ * For a redemption that has never been reallocated, this is the redemption transaction ID.
2479
+ * @public
2480
+ * @documentationMaturity preview
2481
+ * @requiredField options
2482
+ * @requiredField options.idempotencyKey
2483
+ * @requiredField transactionId
2484
+ * @permissionId benefit_programs:v1:pool:cancel_redemption
2485
+ * @applicableIdentity APP
2486
+ * @fqn wix.benefit_programs.v1.pool.PoolService.CancelRedemption
2487
+ */
2488
+ declare function cancelRedemption(transactionId: string, options: NonNullablePaths<CancelRedemptionOptions, `idempotencyKey`, 0>): Promise<NonNullablePaths<CancelRedemptionResponse, `transactionId`, 0> & {
2489
+ __applicationErrorsType?: CancelRedemptionApplicationErrors;
2490
+ }>;
2426
2491
  interface CancelRedemptionOptions {
2427
2492
  /**
2428
2493
  * Unique identifier, generated by the client.
@@ -2478,6 +2543,12 @@ interface CheckBenefitEligibilityOptions {
2478
2543
  * @maxLength 20
2479
2544
  */
2480
2545
  namespace: string;
2546
+ /**
2547
+ * Intent of the eligibility check.
2548
+ *
2549
+ * If not provided, `REDEMPTION` is used by default.
2550
+ */
2551
+ intent?: IntentWithLiterals;
2481
2552
  }
2482
2553
  /**
2483
2554
  * Checks if benefits can currently be redeemed.
@@ -2628,4 +2699,4 @@ interface CheckBenefitEligibilityByFilterOptions {
2628
2699
  poolSelector?: PoolSelector;
2629
2700
  }
2630
2701
 
2631
- export { type AccountInfo, type ActionEvent, type AlreadyExecuted, type ApplicationError, type AsyncResult, type BalanceAmount, type Benefit, type BenefitAlreadyRedeemed, type BenefitInfo, type BenefitNotFound, type BenefitReallocated, type BenefitRedeemed, type BenefitReservationCanceled, type BenefitReservationReleased, type BenefitReserved, type BenefitResult, type BenefitResultResultOneOf, BenefitResultType, type BenefitResultTypeWithLiterals, type BenefitSelector, type BulkActionMetadata, type BulkCheckBenefitEligibilityOptions, type BulkCheckBenefitEligibilityRequest, type BulkCheckBenefitEligibilityResponse, type BulkEligibilityCheckResult, type BulkPoolResult, type BulkUpdatePoolsOptions, type BulkUpdatePoolsRequest, type BulkUpdatePoolsResponse, type ByPoolDefinitionIdAndProgramDefinitionIdOptions, type ByProgramIdOptions, type CancelBenefitReservationRequest, type CancelBenefitReservationResponse, type CancelRedemptionApplicationErrors, type CancelRedemptionOptions, type CancelRedemptionRequest, type CancelRedemptionResponse, type CancellationDetails, type ChainOperationInProgress, type CheckBenefitEligibilityByFilterApplicationErrors, type CheckBenefitEligibilityByFilterOptions, type CheckBenefitEligibilityByFilterRequest, type CheckBenefitEligibilityByFilterResponse, type CheckBenefitEligibilityOptions, type CheckBenefitEligibilityRequest, type CheckBenefitEligibilityResponse, type CommonIdentificationData, type CommonIdentificationDataIdOneOf, type CommonQueryWithEntityContext, type CountNumberOfPoolsInProvisioningStatusRequest, type CountNumberOfPoolsInProvisioningStatusResponse, type CreatePoolRequest, type CreatePoolResponse, type CreditConfiguration, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type CustomPolicy, type DeletePoolRequest, type DeletePoolResponse, type Details, type DomainEvent, type DomainEventBodyOneOf, type EligibilityCheckResult, type EligibleBenefit, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type ExtendedFields, type FailureDetails, type FixedIntervalPolicy, type GetEligibleBenefitsApplicationErrors, type GetEligibleBenefitsOptions, type GetEligibleBenefitsRequest, type GetEligibleBenefitsResponse, type GetPoolRequest, type GetPoolResponse, type HealPoolRequest, type HealPoolResponse, type HealPoolTenantRequest, type HealPoolTenantResponse, type IdentificationData, type IdentificationDataIdOneOf, IdentityType, type IdentityTypeWithLiterals, Intent, type IntentWithLiterals, type InvalidPoolDefinitionReference, type ItemMetadata, type ItemReference, type MaskedPool, type MessageEnvelope, type NotEnoughBalance, type NotLatestTransaction, type Policy, type PolicyExpression, type PolicyExpressionAnd, type PolicyExpressionEvaluatedToFalse, type PolicyExpressionExpressionOneOf, type PolicyExpressionNot, type PolicyExpressionOr, PolicyExpressionType, type PolicyExpressionTypeWithLiterals, type PolicyPolicyOneOf, type Pool, type PoolDefinitionAndProgramDefinition, type PoolDefinitionLookupId, type PoolDefinitionLookupIdIdOneOf, type PoolEnded, type PoolInfo, type PoolNotActive, type PoolNotFound, PoolOrigin, type PoolOriginWithLiterals, type PoolPaused, type PoolProgramInfo, type PoolProvisionJobFinished, type PoolProvisioned, type PoolQuery, type PoolQuerySpec, type PoolRenewalAction, type PoolRenewalActionActionOneOf, PoolRenewalActionType, type PoolRenewalActionTypeWithLiterals, type PoolRenewed, type PoolResumed, type PoolSelector, PoolSelectorType, type PoolSelectorTypeWithLiterals, PoolStatus, type PoolStatusUpdateJobFinished, type PoolStatusUpdateJobFinishedContextOneOf, type PoolStatusUpdateParamsPoolInfo, type PoolStatusWithLiterals, type PoolsQueryBuilder, type PoolsQueryResult, type ProgramDefinitionInfo, type ProgramInfo, type ProvisionPoolsForProgramRequest, type ProvisionPoolsForProgramResponse, type ProvisionPoolsForProgramResponseResultOneOf, ProvisionPoolsForProgramResponseType, type ProvisionPoolsForProgramResponseTypeWithLiterals, type QueryPoolsOptions, type QueryPoolsRequest, type QueryPoolsResponse, type RateLimitedPolicy, type ReallocateBenefitApplicationErrors, type ReallocateBenefitOptions, type ReallocateBenefitRequest, type ReallocateBenefitResponse, type ReallocationDetails, type RedeemBenefitApplicationErrors, type RedeemBenefitOptions, type RedeemBenefitRequest, type RedeemBenefitResponse, type RedemptionAlreadyCanceled, type RedemptionCanceled, type RedemptionDetails, type ReleaseBenefitReservationRequest, type ReleaseBenefitReservationResponse, type RenewPoolsForProgramRequest, type RenewPoolsForProgramResponse, type ReserveBenefitRequest, type ReserveBenefitResponse, type RestoreInfo, type RolloverConfiguration, SortOrder, type SortOrderWithLiterals, type Sorting, type SyncResult, TimePeriod, type TimePeriodWithLiterals, type TransactionNotFound, Type, type TypeWithLiterals, type Update, type UpdatePool, type UpdatePoolRequest, type UpdatePoolResponse, type UpdatePoolStatusRequest, type UpdatePoolStatusRequestPoolSelectorOneOf, type UpdatePoolStatusResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, WeekDay, type WeekDayWithLiterals, bulkCheckBenefitEligibility, bulkUpdatePools, checkBenefitEligibility, checkBenefitEligibilityByFilter, getEligibleBenefits, getPool, queryPools, redeemBenefit, typedQueryPools, updatePool, utils };
2702
+ export { type AccountInfo, type ActionEvent, type AlreadyExecuted, type ApplicationError, type AsyncResult, type BalanceAmount, type Benefit, type BenefitAlreadyRedeemed, type BenefitInfo, type BenefitNotFound, type BenefitReallocated, type BenefitRedeemed, type BenefitReservationCanceled, type BenefitReservationReleased, type BenefitReserved, type BenefitResult, type BenefitResultResultOneOf, BenefitResultType, type BenefitResultTypeWithLiterals, type BenefitSelector, type BulkActionMetadata, type BulkCheckBenefitEligibilityOptions, type BulkCheckBenefitEligibilityRequest, type BulkCheckBenefitEligibilityResponse, type BulkEligibilityCheckResult, type BulkPoolResult, type BulkUpdatePoolsOptions, type BulkUpdatePoolsRequest, type BulkUpdatePoolsResponse, type ByPoolDefinitionIdAndProgramDefinitionIdOptions, type ByProgramIdOptions, type CancelBenefitReservationRequest, type CancelBenefitReservationResponse, type CancelRedemptionApplicationErrors, type CancelRedemptionOptions, type CancelRedemptionRequest, type CancelRedemptionResponse, type CancellationDetails, type ChainOperationInProgress, type CheckBenefitEligibilityByFilterApplicationErrors, type CheckBenefitEligibilityByFilterOptions, type CheckBenefitEligibilityByFilterRequest, type CheckBenefitEligibilityByFilterResponse, type CheckBenefitEligibilityOptions, type CheckBenefitEligibilityRequest, type CheckBenefitEligibilityResponse, type CommonIdentificationData, type CommonIdentificationDataIdOneOf, type CommonQueryWithEntityContext, type CountNumberOfPoolsInProvisioningStatusRequest, type CountNumberOfPoolsInProvisioningStatusResponse, type CreatePoolRequest, type CreatePoolResponse, type CreditConfiguration, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type CustomPolicy, type DeletePoolRequest, type DeletePoolResponse, type Details, type DomainEvent, type DomainEventBodyOneOf, type EligibilityCheckResult, type EligibleBenefit, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type ExtendedFields, type FailureDetails, type FixedIntervalPolicy, type GetEligibleBenefitsApplicationErrors, type GetEligibleBenefitsOptions, type GetEligibleBenefitsRequest, type GetEligibleBenefitsResponse, type GetPoolRequest, type GetPoolResponse, type HealPoolRequest, type HealPoolResponse, type HealPoolTenantRequest, type HealPoolTenantResponse, type IdentificationData, type IdentificationDataIdOneOf, IdentityType, type IdentityTypeWithLiterals, Intent, type IntentWithLiterals, type InvalidPoolDefinitionReference, type ItemMetadata, type ItemNotAvailableInPool, type ItemReference, type MaskedPool, type MessageEnvelope, type NotEnoughBalance, type NotLatestTransaction, type Policy, type PolicyExpression, type PolicyExpressionAnd, type PolicyExpressionEvaluatedToFalse, type PolicyExpressionExpressionOneOf, type PolicyExpressionNot, type PolicyExpressionOr, PolicyExpressionType, type PolicyExpressionTypeWithLiterals, type PolicyPolicyOneOf, type Pool, type PoolDefinitionAndProgramDefinition, type PoolDefinitionLookupId, type PoolDefinitionLookupIdIdOneOf, type PoolEnded, type PoolInfo, type PoolNotActive, type PoolNotFound, PoolOrigin, type PoolOriginWithLiterals, type PoolPaused, type PoolProgramInfo, type PoolProvisionJobFinished, type PoolProvisioned, type PoolQuery, type PoolQuerySpec, type PoolRenewalAction, type PoolRenewalActionActionOneOf, PoolRenewalActionType, type PoolRenewalActionTypeWithLiterals, type PoolRenewed, type PoolResumed, type PoolSelector, PoolSelectorType, type PoolSelectorTypeWithLiterals, PoolStatus, type PoolStatusUpdateJobFinished, type PoolStatusUpdateJobFinishedContextOneOf, type PoolStatusUpdateParamsPoolInfo, type PoolStatusWithLiterals, type PoolsQueryBuilder, type PoolsQueryResult, type ProgramDefinitionInfo, type ProgramInfo, type ProvisionPoolsForProgramRequest, type ProvisionPoolsForProgramResponse, type ProvisionPoolsForProgramResponseResultOneOf, ProvisionPoolsForProgramResponseType, type ProvisionPoolsForProgramResponseTypeWithLiterals, type QueryPoolsOptions, type QueryPoolsRequest, type QueryPoolsResponse, type RateLimitedPolicy, type ReallocateBenefitApplicationErrors, type ReallocateBenefitOptions, type ReallocateBenefitRequest, type ReallocateBenefitResponse, type ReallocationDetails, type RedeemBenefitApplicationErrors, type RedeemBenefitOptions, type RedeemBenefitRequest, type RedeemBenefitResponse, type RedemptionAlreadyCanceled, type RedemptionCanceled, type RedemptionDetails, type ReleaseBenefitReservationRequest, type ReleaseBenefitReservationResponse, type RenewPoolsForProgramRequest, type RenewPoolsForProgramResponse, type ReserveBenefitRequest, type ReserveBenefitResponse, type RestoreInfo, type RolloverConfiguration, SortOrder, type SortOrderWithLiterals, type Sorting, type SyncResult, TimePeriod, type TimePeriodWithLiterals, type TransactionNotFound, Type, type TypeWithLiterals, type Update, type UpdatePool, type UpdatePoolRequest, type UpdatePoolResponse, type UpdatePoolStatusRequest, type UpdatePoolStatusRequestPoolSelectorOneOf, type UpdatePoolStatusResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, WeekDay, type WeekDayWithLiterals, bulkCheckBenefitEligibility, bulkUpdatePools, cancelRedemption, checkBenefitEligibility, checkBenefitEligibilityByFilter, getEligibleBenefits, getPool, queryPools, reallocateBenefit, redeemBenefit, typedQueryPools, updatePool, utils };