@wix/auto_sdk_benefit-programs_pools 1.0.79 → 1.0.80

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.
Files changed (37) hide show
  1. package/build/cjs/index.d.ts +1 -1
  2. package/build/cjs/index.js +61 -0
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +88 -1
  5. package/build/cjs/index.typings.js +52 -0
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +82 -2
  8. package/build/cjs/meta.js +41 -0
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +1 -1
  11. package/build/es/index.mjs +60 -0
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +88 -1
  14. package/build/es/index.typings.mjs +51 -0
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +82 -2
  17. package/build/es/meta.mjs +40 -0
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +20 -3
  20. package/build/internal/cjs/index.js +61 -0
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +106 -1
  23. package/build/internal/cjs/index.typings.js +52 -0
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +82 -2
  26. package/build/internal/cjs/meta.js +41 -0
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +20 -3
  29. package/build/internal/es/index.mjs +60 -0
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +106 -1
  32. package/build/internal/es/index.typings.mjs +51 -0
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +82 -2
  35. package/build/internal/es/meta.mjs +40 -0
  36. package/build/internal/es/meta.mjs.map +1 -1
  37. package/package.json +2 -2
@@ -628,6 +628,38 @@ interface ReallocationDetails {
628
628
  /** Beneficiary of the entitlement */
629
629
  beneficiary?: CommonIdentificationData;
630
630
  }
631
+ interface RedemptionCanceled {
632
+ /** Pool which the canceled redemption belongs to */
633
+ pool?: Pool;
634
+ /** Details of the cancellation */
635
+ cancellationDetails?: CancellationDetails;
636
+ }
637
+ interface CancellationDetails {
638
+ /**
639
+ * Id of the cancellation transaction. This is the terminal transaction of the chain
640
+ * @format GUID
641
+ */
642
+ transactionId?: string;
643
+ /**
644
+ * Id of the transaction superseded by the cancellation
645
+ * @format GUID
646
+ */
647
+ previousTransactionId?: string;
648
+ /** Reference of the item whose redemption was canceled */
649
+ itemReference?: ItemReference;
650
+ /**
651
+ * Number of items that were redeemed
652
+ * @min 1
653
+ */
654
+ itemCount?: number;
655
+ /**
656
+ * Idempotency key of the cancellation request
657
+ * @maxLength 200
658
+ */
659
+ idempotencyKey?: string;
660
+ /** Beneficiary of the entitlement */
661
+ beneficiary?: CommonIdentificationData;
662
+ }
631
663
  interface PoolPaused {
632
664
  /** Pool which has been paused */
633
665
  pool?: Pool;
@@ -1121,6 +1153,27 @@ interface AlreadyExecuted {
1121
1153
  */
1122
1154
  idempotencyKey?: string;
1123
1155
  }
1156
+ interface CancelRedemptionRequest {
1157
+ /**
1158
+ * ID of the latest transaction in the redemption's transaction chain.
1159
+ * For a redemption that has never been reallocated, this is the redemption transaction ID.
1160
+ * @format GUID
1161
+ */
1162
+ transactionId: string;
1163
+ /**
1164
+ * Unique identifier, generated by the client.
1165
+ * Used to recognize repeated attempts to make the same request.
1166
+ * @maxLength 200
1167
+ */
1168
+ idempotencyKey: string;
1169
+ }
1170
+ interface CancelRedemptionResponse {
1171
+ /**
1172
+ * ID of the cancellation transaction. This is the terminal transaction of the chain.
1173
+ * @format GUID
1174
+ */
1175
+ transactionId?: string;
1176
+ }
1124
1177
  interface ReserveBenefitRequest {
1125
1178
  /**
1126
1179
  * Id of the pool that is being redeemed from
@@ -1955,6 +2008,32 @@ type ReallocateBenefitApplicationErrors = {
1955
2008
  data?: AlreadyExecuted;
1956
2009
  };
1957
2010
  /** @docsIgnore */
2011
+ type CancelRedemptionApplicationErrors = {
2012
+ code?: 'TRANSACTION_NOT_FOUND';
2013
+ description?: string;
2014
+ data?: TransactionNotFound;
2015
+ } | {
2016
+ code?: 'NOT_LATEST_TRANSACTION';
2017
+ description?: string;
2018
+ data?: NotLatestTransaction;
2019
+ } | {
2020
+ code?: 'REDEMPTION_ALREADY_CANCELED';
2021
+ description?: string;
2022
+ data?: RedemptionAlreadyCanceled;
2023
+ } | {
2024
+ code?: 'TRANSACTION_NOT_CANCELABLE';
2025
+ description?: string;
2026
+ data?: Record<string, any>;
2027
+ } | {
2028
+ code?: 'CHAIN_OPERATION_IN_PROGRESS';
2029
+ description?: string;
2030
+ data?: ChainOperationInProgress;
2031
+ } | {
2032
+ code?: 'ALREADY_EXECUTED';
2033
+ description?: string;
2034
+ data?: AlreadyExecuted;
2035
+ };
2036
+ /** @docsIgnore */
1958
2037
  type GetEligibleBenefitsApplicationErrors = {
1959
2038
  code?: 'INVALID_ITEM_REFERENCE';
1960
2039
  description?: string;
@@ -2329,6 +2408,14 @@ interface ReallocateBenefitOptions {
2329
2408
  */
2330
2409
  namespace: string;
2331
2410
  }
2411
+ interface CancelRedemptionOptions {
2412
+ /**
2413
+ * Unique identifier, generated by the client.
2414
+ * Used to recognize repeated attempts to make the same request.
2415
+ * @maxLength 200
2416
+ */
2417
+ idempotencyKey: string;
2418
+ }
2332
2419
  /**
2333
2420
  * Checks if a benefit can currently be redeemed.
2334
2421
  *
@@ -2551,4 +2638,4 @@ interface CheckBenefitEligibilityByFilterOptions {
2551
2638
  poolSelector?: PoolSelector;
2552
2639
  }
2553
2640
 
2554
- 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 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 PoolFilter, 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 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 };
2641
+ 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 PoolFilter, 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 };
@@ -36,6 +36,7 @@ __export(index_typings_exports, {
36
36
  WeekDay: () => WeekDay,
37
37
  bulkCheckBenefitEligibility: () => bulkCheckBenefitEligibility2,
38
38
  bulkUpdatePools: () => bulkUpdatePools2,
39
+ cancelRedemption: () => cancelRedemption2,
39
40
  checkBenefitEligibility: () => checkBenefitEligibility2,
40
41
  checkBenefitEligibilityByFilter: () => checkBenefitEligibilityByFilter2,
41
42
  getEligibleBenefits: () => getEligibleBenefits2,
@@ -411,6 +412,27 @@ function reallocateBenefit(payload) {
411
412
  }
412
413
  return __reallocateBenefit;
413
414
  }
415
+ function cancelRedemption(payload) {
416
+ function __cancelRedemption({ host }) {
417
+ const metadata = {
418
+ entityFqdn: "wix.benefit_programs.v1.pool",
419
+ method: "POST",
420
+ methodFqn: "wix.benefit_programs.v1.pool.PoolService.CancelRedemption",
421
+ packageName: PACKAGE_NAME,
422
+ migrationOptions: {
423
+ optInTransformResponse: true
424
+ },
425
+ url: resolveWixBenefitProgramsV1PoolPoolServiceUrl({
426
+ protoPath: "/v1/benefits/cancel-redemption",
427
+ data: payload,
428
+ host
429
+ }),
430
+ data: payload
431
+ };
432
+ return metadata;
433
+ }
434
+ return __cancelRedemption;
435
+ }
414
436
  function checkBenefitEligibility(payload) {
415
437
  function __checkBenefitEligibility({ host }) {
416
438
  const serializedData = (0, import_transform_paths.transformPaths)(payload, [
@@ -865,6 +887,35 @@ async function reallocateBenefit2(transactionId, options) {
865
887
  throw transformedError;
866
888
  }
867
889
  }
890
+ async function cancelRedemption2(transactionId, options) {
891
+ const { httpClient, sideEffects } = arguments[2];
892
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
893
+ transactionId,
894
+ idempotencyKey: options?.idempotencyKey
895
+ });
896
+ const reqOpts = cancelRedemption(payload);
897
+ sideEffects?.onSiteCall?.();
898
+ try {
899
+ const result = await httpClient.request(reqOpts);
900
+ sideEffects?.onSuccess?.(result);
901
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
902
+ } catch (err) {
903
+ const transformedError = (0, import_transform_error.transformError)(
904
+ err,
905
+ {
906
+ spreadPathsToArguments: {},
907
+ explicitPathsToArguments: {
908
+ transactionId: "$[0]",
909
+ idempotencyKey: "$[1].idempotencyKey"
910
+ },
911
+ singleArgumentUnchanged: false
912
+ },
913
+ ["transactionId", "options"]
914
+ );
915
+ sideEffects?.onError?.(err);
916
+ throw transformedError;
917
+ }
918
+ }
868
919
  async function checkBenefitEligibility2(poolId, options) {
869
920
  const { httpClient, sideEffects } = arguments[2];
870
921
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
@@ -1064,6 +1115,7 @@ async function checkBenefitEligibilityByFilter2(options) {
1064
1115
  WeekDay,
1065
1116
  bulkCheckBenefitEligibility,
1066
1117
  bulkUpdatePools,
1118
+ cancelRedemption,
1067
1119
  checkBenefitEligibility,
1068
1120
  checkBenefitEligibilityByFilter,
1069
1121
  getEligibleBenefits,