@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.js';
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.js';
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.js';
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
  }
@@ -1055,11 +1055,10 @@ async function bulkUpdatePools2(options) {
1055
1055
  throw transformedError;
1056
1056
  }
1057
1057
  }
1058
- async function checkBenefitEligibilityByFilter2(options) {
1059
- const { httpClient, sideEffects } = arguments[1];
1058
+ async function checkBenefitEligibilityByFilter2(namespace, options) {
1059
+ const { httpClient, sideEffects } = arguments[2];
1060
1060
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1061
- poolFilter: options?.poolFilter,
1062
- namespace: options?.namespace,
1061
+ namespace,
1063
1062
  itemReference: options?.itemReference,
1064
1063
  count: options?.count,
1065
1064
  targetDate: options?.targetDate,
@@ -1079,18 +1078,17 @@ async function checkBenefitEligibilityByFilter2(options) {
1079
1078
  {
1080
1079
  spreadPathsToArguments: {},
1081
1080
  explicitPathsToArguments: {
1082
- poolFilter: "$[0].poolFilter",
1083
- namespace: "$[0].namespace",
1084
- itemReference: "$[0].itemReference",
1085
- count: "$[0].count",
1086
- targetDate: "$[0].targetDate",
1087
- beneficiary: "$[0].beneficiary",
1088
- additionalData: "$[0].additionalData",
1089
- poolSelector: "$[0].poolSelector"
1081
+ namespace: "$[0]",
1082
+ itemReference: "$[1].itemReference",
1083
+ count: "$[1].count",
1084
+ targetDate: "$[1].targetDate",
1085
+ beneficiary: "$[1].beneficiary",
1086
+ additionalData: "$[1].additionalData",
1087
+ poolSelector: "$[1].poolSelector"
1090
1088
  },
1091
1089
  singleArgumentUnchanged: false
1092
1090
  },
1093
- ["options"]
1091
+ ["namespace", "options"]
1094
1092
  );
1095
1093
  sideEffects?.onError?.(err);
1096
1094
  throw transformedError;
@@ -1183,7 +1181,8 @@ function bulkUpdatePools3(httpClient) {
1183
1181
  );
1184
1182
  }
1185
1183
  function checkBenefitEligibilityByFilter3(httpClient) {
1186
- return (options) => checkBenefitEligibilityByFilter2(
1184
+ return (namespace, options) => checkBenefitEligibilityByFilter2(
1185
+ namespace,
1187
1186
  options,
1188
1187
  // @ts-ignore
1189
1188
  { httpClient }