@wix/auto_sdk_benefit-programs_pools 1.0.81 → 1.0.83

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.
@@ -1,6 +1,6 @@
1
1
  import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
2
  import { Pool, UpdatePool, RedeemBenefitOptions, RedeemBenefitResponse, RedeemBenefitApplicationErrors, CheckBenefitEligibilityOptions, CheckBenefitEligibilityResponse, BulkCheckBenefitEligibilityOptions, BulkCheckBenefitEligibilityResponse, ItemReference, GetEligibleBenefitsOptions, GetEligibleBenefitsResponse, GetEligibleBenefitsApplicationErrors, BulkUpdatePoolsOptions, BulkUpdatePoolsResponse, CheckBenefitEligibilityByFilterOptions, CheckBenefitEligibilityByFilterResponse, CheckBenefitEligibilityByFilterApplicationErrors, PoolQuery, QueryPoolsOptions, typedQueryPools, PoolsQueryBuilder } from './index.typings.mjs';
3
- export { AccountInfo, ActionEvent, AlreadyExecuted, ApplicationError, AsyncResult, BalanceAmount, Benefit, BenefitAlreadyRedeemed, BenefitInfo, BenefitNotFound, BenefitReallocated, BenefitRedeemed, BenefitReservationCanceled, BenefitReservationReleased, BenefitReserved, BenefitResult, BenefitResultResultOneOf, BenefitResultType, BenefitResultTypeWithLiterals, BenefitSelector, BulkActionMetadata, BulkCheckBenefitEligibilityRequest, BulkEligibilityCheckResult, BulkPoolResult, BulkUpdatePoolsRequest, ByPoolDefinitionIdAndProgramDefinitionIdOptions, ByProgramIdOptions, CancelBenefitReservationRequest, CancelBenefitReservationResponse, CancelRedemptionApplicationErrors, CancelRedemptionOptions, CancelRedemptionRequest, CancelRedemptionResponse, CancellationDetails, ChainOperationInProgress, CheckBenefitEligibilityByFilterRequest, CheckBenefitEligibilityRequest, CommonIdentificationData, CommonIdentificationDataIdOneOf, CommonQueryWithEntityContext, CountNumberOfPoolsInProvisioningStatusRequest, CountNumberOfPoolsInProvisioningStatusResponse, CreatePoolRequest, CreatePoolResponse, CreditConfiguration, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, CustomPolicy, DeletePoolRequest, DeletePoolResponse, Details, DomainEvent, DomainEventBodyOneOf, EligibilityCheckResult, EligibleBenefit, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, ExtendedFields, FailureDetails, FixedIntervalPolicy, GetEligibleBenefitsRequest, GetPoolRequest, GetPoolResponse, HealPoolRequest, HealPoolResponse, HealPoolTenantRequest, HealPoolTenantResponse, IdentificationData, IdentificationDataIdOneOf, IdentityType, IdentityTypeWithLiterals, Intent, IntentWithLiterals, InvalidPoolDefinitionReference, ItemMetadata, MaskedPool, MessageEnvelope, NotEnoughBalance, NotLatestTransaction, Policy, PolicyExpression, PolicyExpressionAnd, PolicyExpressionEvaluatedToFalse, PolicyExpressionExpressionOneOf, PolicyExpressionNot, PolicyExpressionOr, PolicyExpressionType, PolicyExpressionTypeWithLiterals, PolicyPolicyOneOf, PoolDefinitionAndProgramDefinition, PoolDefinitionLookupId, PoolDefinitionLookupIdIdOneOf, PoolEnded, PoolFilter, PoolInfo, PoolNotActive, PoolNotFound, PoolOrigin, PoolOriginWithLiterals, PoolPaused, PoolProgramInfo, PoolProvisionJobFinished, PoolProvisioned, PoolQuerySpec, PoolRenewalAction, PoolRenewalActionActionOneOf, PoolRenewalActionType, PoolRenewalActionTypeWithLiterals, PoolRenewed, PoolResumed, PoolSelector, PoolSelectorType, PoolSelectorTypeWithLiterals, PoolStatus, PoolStatusUpdateJobFinished, PoolStatusUpdateJobFinishedContextOneOf, PoolStatusUpdateParamsPoolInfo, PoolStatusWithLiterals, PoolsQueryResult, ProgramDefinitionInfo, ProgramInfo, ProvisionPoolsForProgramRequest, ProvisionPoolsForProgramResponse, ProvisionPoolsForProgramResponseResultOneOf, ProvisionPoolsForProgramResponseType, ProvisionPoolsForProgramResponseTypeWithLiterals, QueryPoolsRequest, QueryPoolsResponse, RateLimitedPolicy, ReallocateBenefitApplicationErrors, ReallocateBenefitOptions, ReallocateBenefitRequest, ReallocateBenefitResponse, ReallocationDetails, RedeemBenefitRequest, RedemptionAlreadyCanceled, RedemptionCanceled, RedemptionDetails, ReleaseBenefitReservationRequest, ReleaseBenefitReservationResponse, RenewPoolsForProgramRequest, RenewPoolsForProgramResponse, ReserveBenefitRequest, ReserveBenefitResponse, RestoreInfo, RolloverConfiguration, SortOrder, SortOrderWithLiterals, Sorting, SyncResult, TimePeriod, TimePeriodWithLiterals, TransactionNotFound, Type, TypeWithLiterals, Update, UpdatePoolRequest, UpdatePoolResponse, UpdatePoolStatusRequest, UpdatePoolStatusRequestPoolSelectorOneOf, UpdatePoolStatusResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals, WeekDay, WeekDayWithLiterals, utils } from './index.typings.mjs';
3
+ export { AccountInfo, ActionEvent, AlreadyExecuted, ApplicationError, AsyncResult, BalanceAmount, Benefit, BenefitAlreadyRedeemed, BenefitInfo, BenefitNotFound, BenefitReallocated, BenefitRedeemed, BenefitReservationCanceled, BenefitReservationReleased, BenefitReserved, BenefitResult, BenefitResultResultOneOf, BenefitResultType, BenefitResultTypeWithLiterals, BenefitSelector, BulkActionMetadata, BulkCheckBenefitEligibilityRequest, BulkEligibilityCheckResult, BulkPoolResult, BulkUpdatePoolsRequest, ByPoolDefinitionIdAndProgramDefinitionIdOptions, ByProgramIdOptions, CancelBenefitReservationRequest, CancelBenefitReservationResponse, CancelRedemptionApplicationErrors, CancelRedemptionOptions, CancelRedemptionRequest, CancelRedemptionResponse, CancellationDetails, ChainOperationInProgress, CheckBenefitEligibilityByFilterRequest, CheckBenefitEligibilityRequest, CommonIdentificationData, CommonIdentificationDataIdOneOf, CommonQueryWithEntityContext, CountNumberOfPoolsInProvisioningStatusRequest, CountNumberOfPoolsInProvisioningStatusResponse, CreatePoolRequest, CreatePoolResponse, CreditConfiguration, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, CustomPolicy, DeletePoolRequest, DeletePoolResponse, Details, DomainEvent, DomainEventBodyOneOf, EligibilityCheckResult, EligibleBenefit, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, ExtendedFields, FailureDetails, FixedIntervalPolicy, GetEligibleBenefitsRequest, GetPoolRequest, GetPoolResponse, HealPoolRequest, HealPoolResponse, HealPoolTenantRequest, HealPoolTenantResponse, IdentificationData, IdentificationDataIdOneOf, IdentityType, IdentityTypeWithLiterals, Intent, IntentWithLiterals, InvalidPoolDefinitionReference, ItemMetadata, MaskedPool, MessageEnvelope, NotEnoughBalance, NotLatestTransaction, Policy, PolicyExpression, PolicyExpressionAnd, PolicyExpressionEvaluatedToFalse, PolicyExpressionExpressionOneOf, PolicyExpressionNot, PolicyExpressionOr, PolicyExpressionType, PolicyExpressionTypeWithLiterals, PolicyPolicyOneOf, PoolDefinitionAndProgramDefinition, PoolDefinitionLookupId, PoolDefinitionLookupIdIdOneOf, PoolEnded, PoolInfo, PoolNotActive, PoolNotFound, PoolOrigin, PoolOriginWithLiterals, PoolPaused, PoolProgramInfo, PoolProvisionJobFinished, PoolProvisioned, PoolQuerySpec, PoolRenewalAction, PoolRenewalActionActionOneOf, PoolRenewalActionType, PoolRenewalActionTypeWithLiterals, PoolRenewed, PoolResumed, PoolSelector, PoolSelectorType, PoolSelectorTypeWithLiterals, PoolStatus, PoolStatusUpdateJobFinished, PoolStatusUpdateJobFinishedContextOneOf, PoolStatusUpdateParamsPoolInfo, PoolStatusWithLiterals, PoolsQueryResult, ProgramDefinitionInfo, ProgramInfo, ProvisionPoolsForProgramRequest, ProvisionPoolsForProgramResponse, ProvisionPoolsForProgramResponseResultOneOf, ProvisionPoolsForProgramResponseType, ProvisionPoolsForProgramResponseTypeWithLiterals, QueryPoolsRequest, QueryPoolsResponse, RateLimitedPolicy, ReallocateBenefitApplicationErrors, ReallocateBenefitOptions, ReallocateBenefitRequest, ReallocateBenefitResponse, ReallocationDetails, RedeemBenefitRequest, RedemptionAlreadyCanceled, RedemptionCanceled, RedemptionDetails, ReleaseBenefitReservationRequest, ReleaseBenefitReservationResponse, RenewPoolsForProgramRequest, RenewPoolsForProgramResponse, ReserveBenefitRequest, ReserveBenefitResponse, RestoreInfo, RolloverConfiguration, SortOrder, SortOrderWithLiterals, Sorting, SyncResult, TimePeriod, TimePeriodWithLiterals, TransactionNotFound, Type, TypeWithLiterals, Update, UpdatePoolRequest, UpdatePoolResponse, UpdatePoolStatusRequest, UpdatePoolStatusRequestPoolSelectorOneOf, UpdatePoolStatusResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals, WeekDay, WeekDayWithLiterals, utils } from './index.typings.mjs';
4
4
 
5
5
  declare function getPool$1(httpClient: HttpClient): GetPoolSignature;
6
6
  interface GetPoolSignature {
@@ -82,15 +82,16 @@ interface BulkUpdatePoolsSignature {
82
82
  declare function checkBenefitEligibilityByFilter$1(httpClient: HttpClient): CheckBenefitEligibilityByFilterSignature;
83
83
  interface CheckBenefitEligibilityByFilterSignature {
84
84
  /**
85
- * Checks benefit eligibility across the pools that match the filter.
85
+ * Checks benefit eligibility across the beneficiary's pools that contain a benefit for the given item.
86
86
  *
87
- * The filter selects pools (not individual benefits), using the same fields supported by Query Pools. For field support, see [Filtering and Sorting](https://dev.wix.com/docs/rest/business-solutions/benefit-programs/pools/filtering-and-sorting).
87
+ * Pools are matched by `itemReference` within `namespace` and must belong to `beneficiary`, which defaults to the calling identity. `poolSelector` narrows the matched pools further.
88
88
  *
89
89
  * To be redeemed, a benefit's pool must be active and the associated balance must be greater than the cost of the benefit.
90
90
  *
91
91
  * Each benefit is checked independently. For example, if there is a benefit with a price of 3 credits and a benefit with a price of 4 credits, and there are 5 available credits, both benefits would be returned as eligible, but they can't both be redeemed.
92
+ * @param - Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created.
92
93
  */
93
- (options?: NonNullablePaths<CheckBenefitEligibilityByFilterOptions, `count` | `itemReference` | `itemReference.externalId` | `itemReference.providerAppId` | `namespace`, 3>): Promise<NonNullablePaths<CheckBenefitEligibilityByFilterResponse, `results`, 2> & {
94
+ (namespace: string, options?: NonNullablePaths<CheckBenefitEligibilityByFilterOptions, `count` | `itemReference` | `itemReference.externalId` | `itemReference.providerAppId`, 3>): Promise<NonNullablePaths<CheckBenefitEligibilityByFilterResponse, `results`, 2> & {
94
95
  __applicationErrorsType?: CheckBenefitEligibilityByFilterApplicationErrors;
95
96
  }>;
96
97
  }
@@ -1007,11 +1007,10 @@ async function bulkUpdatePools2(options) {
1007
1007
  throw transformedError;
1008
1008
  }
1009
1009
  }
1010
- async function checkBenefitEligibilityByFilter2(options) {
1011
- const { httpClient, sideEffects } = arguments[1];
1010
+ async function checkBenefitEligibilityByFilter2(namespace, options) {
1011
+ const { httpClient, sideEffects } = arguments[2];
1012
1012
  const payload = renameKeysFromSDKRequestToRESTRequest({
1013
- poolFilter: options?.poolFilter,
1014
- namespace: options?.namespace,
1013
+ namespace,
1015
1014
  itemReference: options?.itemReference,
1016
1015
  count: options?.count,
1017
1016
  targetDate: options?.targetDate,
@@ -1031,18 +1030,17 @@ async function checkBenefitEligibilityByFilter2(options) {
1031
1030
  {
1032
1031
  spreadPathsToArguments: {},
1033
1032
  explicitPathsToArguments: {
1034
- poolFilter: "$[0].poolFilter",
1035
- namespace: "$[0].namespace",
1036
- itemReference: "$[0].itemReference",
1037
- count: "$[0].count",
1038
- targetDate: "$[0].targetDate",
1039
- beneficiary: "$[0].beneficiary",
1040
- additionalData: "$[0].additionalData",
1041
- poolSelector: "$[0].poolSelector"
1033
+ namespace: "$[0]",
1034
+ itemReference: "$[1].itemReference",
1035
+ count: "$[1].count",
1036
+ targetDate: "$[1].targetDate",
1037
+ beneficiary: "$[1].beneficiary",
1038
+ additionalData: "$[1].additionalData",
1039
+ poolSelector: "$[1].poolSelector"
1042
1040
  },
1043
1041
  singleArgumentUnchanged: false
1044
1042
  },
1045
- ["options"]
1043
+ ["namespace", "options"]
1046
1044
  );
1047
1045
  sideEffects?.onError?.(err);
1048
1046
  throw transformedError;
@@ -1135,7 +1133,8 @@ function bulkUpdatePools3(httpClient) {
1135
1133
  );
1136
1134
  }
1137
1135
  function checkBenefitEligibilityByFilter3(httpClient) {
1138
- return (options) => checkBenefitEligibilityByFilter2(
1136
+ return (namespace, options) => checkBenefitEligibilityByFilter2(
1137
+ namespace,
1139
1138
  options,
1140
1139
  // @ts-ignore
1141
1140
  { httpClient }