@wix/auto_sdk_benefit-programs_pools 1.0.39 → 1.0.41

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 +76 -0
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +77 -2
  5. package/build/cjs/index.typings.js +68 -0
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +50 -3
  8. package/build/cjs/meta.js +47 -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 +75 -0
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +77 -2
  14. package/build/es/index.typings.mjs +67 -0
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +50 -3
  17. package/build/es/meta.mjs +46 -0
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +17 -3
  20. package/build/internal/cjs/index.js +76 -0
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +96 -2
  23. package/build/internal/cjs/index.typings.js +68 -0
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +50 -3
  26. package/build/internal/cjs/meta.js +47 -0
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +17 -3
  29. package/build/internal/es/index.mjs +75 -0
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +96 -2
  32. package/build/internal/es/index.typings.mjs +67 -0
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +50 -3
  35. package/build/internal/es/meta.mjs +46 -0
  36. package/build/internal/es/meta.mjs.map +1 -1
  37. package/package.json +2 -2
@@ -886,7 +886,7 @@ interface PoolInfo {
886
886
  displayName?: string;
887
887
  /**
888
888
  * Pool description
889
- * @maxLength 256
889
+ * @maxLength 450
890
890
  */
891
891
  description?: string | null;
892
892
  }
@@ -1569,6 +1569,52 @@ interface CountNumberOfPoolsInProvisioningStatusResponse {
1569
1569
  /** Number of pools in provisioning status */
1570
1570
  count?: number;
1571
1571
  }
1572
+ interface CheckEligibilityByFilterRequest {
1573
+ /** Defines filtering and sorting criteria used to select pools when checking eligibility. */
1574
+ poolFilter?: PoolFilter;
1575
+ /**
1576
+ * 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.
1577
+ * @minLength 1
1578
+ * @maxLength 20
1579
+ */
1580
+ namespace: string;
1581
+ /** Information about the item to check. */
1582
+ itemReference: ItemReference;
1583
+ /**
1584
+ * Amount of items to check.
1585
+ *
1586
+ * Ensures the balance is high enough to redeem this many it
1587
+ * @min 1
1588
+ */
1589
+ count: number;
1590
+ /**
1591
+ * Date that the item will be provided to the beneficiary.
1592
+ *
1593
+ * This parameter should be used to manage the potential logistics of providing the item.
1594
+ */
1595
+ targetDate?: Date | null;
1596
+ /** Pool beneficiary. */
1597
+ beneficiary: CommonIdentificationData;
1598
+ /** Additional information. */
1599
+ additionalData?: Record<string, any> | null;
1600
+ }
1601
+ interface PoolFilter {
1602
+ /** Filter options. To learn more, see [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language). */
1603
+ filter?: Record<string, any> | null;
1604
+ /**
1605
+ * List of sort objects.
1606
+ * @maxSize 5
1607
+ */
1608
+ sort?: Sorting[];
1609
+ }
1610
+ interface CheckEligibilityByFilterResponse {
1611
+ /**
1612
+ * Result of the eligibility check.
1613
+ * @minSize 1
1614
+ * @maxSize 100
1615
+ */
1616
+ result?: EligibilityCheckResult[];
1617
+ }
1572
1618
  interface DomainEvent extends DomainEventBodyOneOf {
1573
1619
  createdEvent?: EntityCreatedEvent;
1574
1620
  updatedEvent?: EntityUpdatedEvent;
@@ -2152,5 +2198,53 @@ interface BulkUpdatePoolsOptions {
2152
2198
  */
2153
2199
  returnEntity?: boolean;
2154
2200
  }
2201
+ /**
2202
+ * Determines eligibility for each benefit based on the filter.
2203
+ *
2204
+ * To be redeemed, a benefit's pool must be active and the associated balance must be greater than the cost of the benefit.
2205
+ *
2206
+ * 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.
2207
+ * @internal
2208
+ * @documentationMaturity preview
2209
+ * @requiredField options.beneficiary
2210
+ * @requiredField options.count
2211
+ * @requiredField options.itemReference
2212
+ * @requiredField options.itemReference.externalId
2213
+ * @requiredField options.itemReference.providerAppId
2214
+ * @requiredField options.namespace
2215
+ * @permissionId BENEFIT_PROGRAMS.POOL_REDEEM
2216
+ * @applicableIdentity APP
2217
+ * @fqn wix.benefit_programs.v1.pool.PoolService.CheckEligibilityByFilter
2218
+ */
2219
+ declare function checkEligibilityByFilter(options?: NonNullablePaths<CheckEligibilityByFilterOptions, `beneficiary` | `count` | `itemReference` | `itemReference.externalId` | `itemReference.providerAppId` | `namespace`, 3>): Promise<NonNullablePaths<CheckEligibilityByFilterResponse, `result` | `result.${number}.notEnoughBalanceOptions.poolId` | `result.${number}.notEnoughBalanceOptions.itemReference.externalId` | `result.${number}.notEnoughBalanceOptions.itemReference.category` | `result.${number}.notEnoughBalanceOptions.itemReference.providerAppId` | `result.${number}.notEnoughBalanceOptions.availableBalance` | `result.${number}.notEnoughBalanceOptions.requestedBalance` | `result.${number}.poolNotActiveOptions.poolId` | `result.${number}.poolNotActiveOptions.poolStatus` | `result.${number}.benefitNotFoundOptions.poolId` | `result.${number}.poolNotFoundOptions.poolId` | `result.${number}.type`, 6>>;
2220
+ interface CheckEligibilityByFilterOptions {
2221
+ /** Defines filtering and sorting criteria used to select pools when checking eligibility. */
2222
+ poolFilter?: PoolFilter;
2223
+ /**
2224
+ * 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.
2225
+ * @minLength 1
2226
+ * @maxLength 20
2227
+ */
2228
+ namespace: string;
2229
+ /** Information about the item to check. */
2230
+ itemReference: ItemReference;
2231
+ /**
2232
+ * Amount of items to check.
2233
+ *
2234
+ * Ensures the balance is high enough to redeem this many it
2235
+ * @min 1
2236
+ */
2237
+ count: number;
2238
+ /**
2239
+ * Date that the item will be provided to the beneficiary.
2240
+ *
2241
+ * This parameter should be used to manage the potential logistics of providing the item.
2242
+ */
2243
+ targetDate?: Date | null;
2244
+ /** Pool beneficiary. */
2245
+ beneficiary: CommonIdentificationData;
2246
+ /** Additional information. */
2247
+ additionalData?: Record<string, any> | null;
2248
+ }
2155
2249
 
2156
- export { type ActionEvent, type ApplicationError, type AsyncResult, type BalanceAmount, type Benefit, type BenefitAlreadyRedeemed, type BenefitInfo, type BenefitNotFound, type BenefitRedeemed, type BenefitReservationCanceled, type BenefitReservationReleased, type BenefitReserved, type BenefitSelector, type BulkActionMetadata, type BulkCheckBenefitEligibilityOptions, type BulkCheckBenefitEligibilityRequest, type BulkCheckBenefitEligibilityResponse, type BulkEligibilityCheckResult, type BulkPoolResult, type BulkUpdatePoolsOptions, type BulkUpdatePoolsRequest, type BulkUpdatePoolsResponse, type ByItemReference, type ByItemReferenceFilter, type ByPoolDefinitionIdAndProgramDefinitionIdOptions, type ByProgramIdOptions, type CancelBenefitReservationRequest, type CancelBenefitReservationResponse, type CheckBenefitEligibilityOptions, type CheckBenefitEligibilityRequest, type CheckBenefitEligibilityResponse, type CommonIdentificationData, type CommonIdentificationDataIdOneOf, 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 EligibilityCheckResultResultOneOf, EligibilityCheckResultType, type EligibilityCheckResultTypeWithLiterals, type Eligible, type EligibleBenefit, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type ExtendedFields, type FailureDetails, type Filter, type FilterFilterOneOf, type FixedIntervalPolicy, type GetEligibleBenefitsApplicationErrors, type GetEligibleBenefitsOptions, type GetEligibleBenefitsRequest, type GetEligibleBenefitsResponse, type GetPoolRequest, type GetPoolResponse, type IdentificationData, type IdentificationDataIdOneOf, IdentityType, type IdentityTypeWithLiterals, type InvalidPoolDefinitionReference, type ItemMetadata, type ItemReference, type ListPoolsRequest, ListPoolsRequestType, type ListPoolsRequestTypeWithLiterals, type ListPoolsResponse, type MaskedPool, type MessageEnvelope, type NotEnoughBalance, 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 PoolRenewalAction, type PoolRenewalActionActionOneOf, PoolRenewalActionType, type PoolRenewalActionTypeWithLiterals, type PoolRenewed, type PoolResumed, PoolSelectorType, type PoolSelectorTypeWithLiterals, PoolStatus, type PoolStatusUpdateJobFinished, type PoolStatusUpdateJobFinishedContextOneOf, type PoolStatusUpdateParamsPoolInfo, type PoolStatusWithLiterals, type PoolWithItems, type PoolsQueryBuilder, type PoolsQueryResult, type ProgramDefinitionInfo, type ProgramInfo, type ProvisionPoolsForProgramRequest, type ProvisionPoolsForProgramResponse, type ProvisionPoolsForProgramResponseResultOneOf, ProvisionPoolsForProgramResponseType, type ProvisionPoolsForProgramResponseTypeWithLiterals, type QueryPoolsRequest, type QueryPoolsResponse, type RateLimitedPolicy, type RateLimitedPolicyPeriodOneOf, RateLimitedPolicyType, type RateLimitedPolicyTypeWithLiterals, type RedeemBenefitApplicationErrors, type RedeemBenefitOptions, type RedeemBenefitRequest, type RedeemBenefitResponse, 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, 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, getEligibleBenefits, getPool, queryPools, redeemBenefit, typedQueryPools, updatePool };
2250
+ export { type ActionEvent, type ApplicationError, type AsyncResult, type BalanceAmount, type Benefit, type BenefitAlreadyRedeemed, type BenefitInfo, type BenefitNotFound, type BenefitRedeemed, type BenefitReservationCanceled, type BenefitReservationReleased, type BenefitReserved, type BenefitSelector, type BulkActionMetadata, type BulkCheckBenefitEligibilityOptions, type BulkCheckBenefitEligibilityRequest, type BulkCheckBenefitEligibilityResponse, type BulkEligibilityCheckResult, type BulkPoolResult, type BulkUpdatePoolsOptions, type BulkUpdatePoolsRequest, type BulkUpdatePoolsResponse, type ByItemReference, type ByItemReferenceFilter, type ByPoolDefinitionIdAndProgramDefinitionIdOptions, type ByProgramIdOptions, type CancelBenefitReservationRequest, type CancelBenefitReservationResponse, type CheckBenefitEligibilityOptions, type CheckBenefitEligibilityRequest, type CheckBenefitEligibilityResponse, type CheckEligibilityByFilterOptions, type CheckEligibilityByFilterRequest, type CheckEligibilityByFilterResponse, type CommonIdentificationData, type CommonIdentificationDataIdOneOf, 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 EligibilityCheckResultResultOneOf, EligibilityCheckResultType, type EligibilityCheckResultTypeWithLiterals, type Eligible, type EligibleBenefit, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type ExtendedFields, type FailureDetails, type Filter, type FilterFilterOneOf, type FixedIntervalPolicy, type GetEligibleBenefitsApplicationErrors, type GetEligibleBenefitsOptions, type GetEligibleBenefitsRequest, type GetEligibleBenefitsResponse, type GetPoolRequest, type GetPoolResponse, type IdentificationData, type IdentificationDataIdOneOf, IdentityType, type IdentityTypeWithLiterals, type InvalidPoolDefinitionReference, type ItemMetadata, type ItemReference, type ListPoolsRequest, ListPoolsRequestType, type ListPoolsRequestTypeWithLiterals, type ListPoolsResponse, type MaskedPool, type MessageEnvelope, type NotEnoughBalance, 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 PoolRenewalAction, type PoolRenewalActionActionOneOf, PoolRenewalActionType, type PoolRenewalActionTypeWithLiterals, type PoolRenewed, type PoolResumed, PoolSelectorType, type PoolSelectorTypeWithLiterals, PoolStatus, type PoolStatusUpdateJobFinished, type PoolStatusUpdateJobFinishedContextOneOf, type PoolStatusUpdateParamsPoolInfo, type PoolStatusWithLiterals, type PoolWithItems, type PoolsQueryBuilder, type PoolsQueryResult, type ProgramDefinitionInfo, type ProgramInfo, type ProvisionPoolsForProgramRequest, type ProvisionPoolsForProgramResponse, type ProvisionPoolsForProgramResponseResultOneOf, ProvisionPoolsForProgramResponseType, type ProvisionPoolsForProgramResponseTypeWithLiterals, type QueryPoolsRequest, type QueryPoolsResponse, type RateLimitedPolicy, type RateLimitedPolicyPeriodOneOf, RateLimitedPolicyType, type RateLimitedPolicyTypeWithLiterals, type RedeemBenefitApplicationErrors, type RedeemBenefitOptions, type RedeemBenefitRequest, type RedeemBenefitResponse, 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, 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, checkEligibilityByFilter, getEligibleBenefits, getPool, queryPools, redeemBenefit, typedQueryPools, updatePool };
@@ -466,6 +466,33 @@ function bulkUpdatePools(payload) {
466
466
  }
467
467
  return __bulkUpdatePools;
468
468
  }
469
+ function checkEligibilityByFilter(payload) {
470
+ function __checkEligibilityByFilter({ host }) {
471
+ const serializedData = transformPaths(payload, [
472
+ {
473
+ transformFn: transformSDKTimestampToRESTTimestamp,
474
+ paths: [{ path: "targetDate" }]
475
+ }
476
+ ]);
477
+ const metadata = {
478
+ entityFqdn: "wix.benefit_programs.v1.pool",
479
+ method: "POST",
480
+ methodFqn: "wix.benefit_programs.v1.pool.PoolService.CheckEligibilityByFilter",
481
+ packageName: PACKAGE_NAME,
482
+ migrationOptions: {
483
+ optInTransformResponse: true
484
+ },
485
+ url: resolveWixBenefitProgramsV1PoolPoolServiceUrl({
486
+ protoPath: "/v1/pools/check-eligibility-by-filter",
487
+ data: serializedData,
488
+ host
489
+ }),
490
+ data: serializedData
491
+ };
492
+ return metadata;
493
+ }
494
+ return __checkEligibilityByFilter;
495
+ }
469
496
 
470
497
  // src/benefit-programs-v1-pool-pools.universal.ts
471
498
  import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
@@ -864,6 +891,45 @@ async function bulkUpdatePools2(options) {
864
891
  throw transformedError;
865
892
  }
866
893
  }
894
+ async function checkEligibilityByFilter2(options) {
895
+ const { httpClient, sideEffects } = arguments[1];
896
+ const payload = renameKeysFromSDKRequestToRESTRequest({
897
+ poolFilter: options?.poolFilter,
898
+ namespace: options?.namespace,
899
+ itemReference: options?.itemReference,
900
+ count: options?.count,
901
+ targetDate: options?.targetDate,
902
+ beneficiary: options?.beneficiary,
903
+ additionalData: options?.additionalData
904
+ });
905
+ const reqOpts = checkEligibilityByFilter(payload);
906
+ sideEffects?.onSiteCall?.();
907
+ try {
908
+ const result = await httpClient.request(reqOpts);
909
+ sideEffects?.onSuccess?.(result);
910
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
911
+ } catch (err) {
912
+ const transformedError = sdkTransformError(
913
+ err,
914
+ {
915
+ spreadPathsToArguments: {},
916
+ explicitPathsToArguments: {
917
+ poolFilter: "$[0].poolFilter",
918
+ namespace: "$[0].namespace",
919
+ itemReference: "$[0].itemReference",
920
+ count: "$[0].count",
921
+ targetDate: "$[0].targetDate",
922
+ beneficiary: "$[0].beneficiary",
923
+ additionalData: "$[0].additionalData"
924
+ },
925
+ singleArgumentUnchanged: false
926
+ },
927
+ ["options"]
928
+ );
929
+ sideEffects?.onError?.(err);
930
+ throw transformedError;
931
+ }
932
+ }
867
933
  export {
868
934
  EligibilityCheckResultType,
869
935
  IdentityType,
@@ -882,6 +948,7 @@ export {
882
948
  bulkCheckBenefitEligibility2 as bulkCheckBenefitEligibility,
883
949
  bulkUpdatePools2 as bulkUpdatePools,
884
950
  checkBenefitEligibility2 as checkBenefitEligibility,
951
+ checkEligibilityByFilter2 as checkEligibilityByFilter,
885
952
  getEligibleBenefits2 as getEligibleBenefits,
886
953
  getPool2 as getPool,
887
954
  queryPools2 as queryPools,