@wix/auto_sdk_benefit-programs_pools 1.0.37 → 1.0.38
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.
- package/build/cjs/index.d.ts +8 -21
- package/build/cjs/index.js +43 -1
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +52 -46
- package/build/cjs/index.typings.js +25 -0
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +45 -45
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +8 -21
- package/build/es/index.mjs +43 -1
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +52 -46
- package/build/es/index.typings.mjs +24 -0
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +45 -45
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +8 -21
- package/build/internal/cjs/index.js +43 -1
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +52 -46
- package/build/internal/cjs/index.typings.js +25 -0
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +45 -45
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +8 -21
- package/build/internal/es/index.mjs +43 -1
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +52 -46
- package/build/internal/es/index.typings.mjs +24 -0
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +45 -45
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +3 -3
package/build/cjs/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
-
import { Pool, UpdatePool,
|
|
3
|
-
export { ActionEvent, ApplicationError, AsyncResult, BalanceAmount, Benefit, BenefitAlreadyRedeemed, BenefitInfo, BenefitNotFound, BenefitRedeemed, BenefitReservationCanceled, BenefitReservationReleased, BenefitReserved, BenefitSelector, BulkActionMetadata, BulkCheckBenefitEligibilityRequest, BulkEligibilityCheckResult, BulkPoolResult, BulkUpdatePoolsRequest, ByItemReference, ByItemReferenceFilter, ByPoolDefinitionIdAndProgramDefinitionIdOptions, ByProgramIdOptions, CancelBenefitReservationRequest, CancelBenefitReservationResponse, CheckBenefitEligibilityRequest, CommonIdentificationData, CommonIdentificationDataIdOneOf, CountNumberOfPoolsInProvisioningStatusRequest, CountNumberOfPoolsInProvisioningStatusResponse, CreatePoolRequest, CreatePoolResponse, CreditConfiguration, CursorPaging, CursorPagingMetadata,
|
|
2
|
+
import { Pool, UpdatePool, RedeemBenefitOptions, RedeemBenefitResponse, RedeemBenefitApplicationErrors, CheckBenefitEligibilityOptions, CheckBenefitEligibilityResponse, BulkCheckBenefitEligibilityOptions, BulkCheckBenefitEligibilityResponse, ItemReference, GetEligibleBenefitsOptions, GetEligibleBenefitsResponse, GetEligibleBenefitsApplicationErrors, BulkUpdatePoolsOptions, BulkUpdatePoolsResponse, PoolsQueryBuilder, CursorQuery, typedQueryPools } from './index.typings.js';
|
|
3
|
+
export { ActionEvent, ApplicationError, AsyncResult, BalanceAmount, Benefit, BenefitAlreadyRedeemed, BenefitInfo, BenefitNotFound, BenefitRedeemed, BenefitReservationCanceled, BenefitReservationReleased, BenefitReserved, BenefitSelector, BulkActionMetadata, BulkCheckBenefitEligibilityRequest, BulkEligibilityCheckResult, BulkPoolResult, BulkUpdatePoolsRequest, ByItemReference, ByItemReferenceFilter, ByPoolDefinitionIdAndProgramDefinitionIdOptions, ByProgramIdOptions, CancelBenefitReservationRequest, CancelBenefitReservationResponse, CheckBenefitEligibilityRequest, CommonIdentificationData, CommonIdentificationDataIdOneOf, CountNumberOfPoolsInProvisioningStatusRequest, CountNumberOfPoolsInProvisioningStatusResponse, CreatePoolRequest, CreatePoolResponse, CreditConfiguration, CursorPaging, CursorPagingMetadata, CursorQueryPagingMethodOneOf, Cursors, CustomPolicy, DeletePoolRequest, DeletePoolResponse, Details, DomainEvent, DomainEventBodyOneOf, EligibilityCheckResult, EligibilityCheckResultResultOneOf, EligibilityCheckResultType, EligibilityCheckResultTypeWithLiterals, Eligible, EligibleBenefit, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, ExtendedFields, FailureDetails, Filter, FilterFilterOneOf, FixedIntervalPolicy, GetEligibleBenefitsRequest, GetPoolRequest, GetPoolResponse, IdentificationData, IdentificationDataIdOneOf, IdentityType, IdentityTypeWithLiterals, InvalidPoolDefinitionReference, ItemMetadata, ListPoolsRequest, ListPoolsRequestType, ListPoolsRequestTypeWithLiterals, ListPoolsResponse, MaskedPool, MessageEnvelope, NotEnoughBalance, Policy, PolicyExpression, PolicyExpressionAnd, PolicyExpressionEvaluatedToFalse, PolicyExpressionExpressionOneOf, PolicyExpressionNot, PolicyExpressionOr, PolicyExpressionType, PolicyExpressionTypeWithLiterals, PolicyPolicyOneOf, PoolDefinitionAndProgramDefinition, PoolDefinitionLookupId, PoolDefinitionLookupIdIdOneOf, PoolEnded, PoolInfo, PoolNotActive, PoolNotFound, PoolOrigin, PoolOriginWithLiterals, PoolPaused, PoolProgramInfo, PoolProvisionJobFinished, PoolProvisioned, PoolRenewalAction, PoolRenewalActionActionOneOf, PoolRenewalActionType, PoolRenewalActionTypeWithLiterals, PoolRenewed, PoolResumed, PoolSelectorType, PoolSelectorTypeWithLiterals, PoolStatus, PoolStatusUpdateJobFinished, PoolStatusUpdateJobFinishedContextOneOf, PoolStatusUpdateParamsPoolInfo, PoolStatusWithLiterals, PoolWithItems, PoolsQueryResult, ProgramDefinitionInfo, ProgramInfo, ProvisionPoolsForProgramRequest, ProvisionPoolsForProgramResponse, ProvisionPoolsForProgramResponseResultOneOf, ProvisionPoolsForProgramResponseType, ProvisionPoolsForProgramResponseTypeWithLiterals, QueryPoolsRequest, QueryPoolsResponse, RateLimitedPolicy, RateLimitedPolicyPeriodOneOf, RateLimitedPolicyType, RateLimitedPolicyTypeWithLiterals, RedeemBenefitRequest, RedemptionDetails, ReleaseBenefitReservationRequest, ReleaseBenefitReservationResponse, RenewPoolsForProgramRequest, RenewPoolsForProgramResponse, ReserveBenefitRequest, ReserveBenefitResponse, RestoreInfo, RolloverConfiguration, SortOrder, SortOrderWithLiterals, Sorting, SyncResult, Type, TypeWithLiterals, Update, UpdatePoolRequest, UpdatePoolResponse, UpdatePoolStatusRequest, UpdatePoolStatusRequestPoolSelectorOneOf, UpdatePoolStatusResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals, WeekDay, WeekDayWithLiterals } from './index.typings.js';
|
|
4
4
|
|
|
5
5
|
declare function getPool$1(httpClient: HttpClient): GetPoolSignature;
|
|
6
6
|
interface GetPoolSignature {
|
|
@@ -26,23 +26,6 @@ interface UpdatePoolSignature {
|
|
|
26
26
|
*/
|
|
27
27
|
(_id: string, pool: NonNullablePaths<UpdatePool, `revision`, 2>): Promise<NonNullablePaths<Pool, `status` | `beneficiary.anonymousVisitorId` | `beneficiary.memberId` | `beneficiary.wixUserId` | `details.benefits` | `details.benefits.${number}.benefitKey` | `details.creditConfiguration.amount` | `displayName` | `programDefinition._id` | `program._id`, 5>>;
|
|
28
28
|
}
|
|
29
|
-
declare function queryPools$1(httpClient: HttpClient): QueryPoolsSignature;
|
|
30
|
-
interface QueryPoolsSignature {
|
|
31
|
-
/**
|
|
32
|
-
* Creates a query to retrieve a list of pools.
|
|
33
|
-
*
|
|
34
|
-
* The Query Pools method builds a query to retrieve a list of pools and returns a `PoolsQueryBuilder` object.
|
|
35
|
-
*
|
|
36
|
-
* The returned object contains the query definition, which is used to run the query using the `find()` method.
|
|
37
|
-
*
|
|
38
|
-
* You can refine the query by chaining `PoolsQueryBuilder` methods onto the query. `PoolsQueryBuilder` methods enable you to filter, sort, and control the results that Query Pools returns.
|
|
39
|
-
*
|
|
40
|
-
* Query Pools has a default paging limit of 50, which you can override.
|
|
41
|
-
*
|
|
42
|
-
* For a full description of the item object, see the object returned for the `items` property in `PoolsQueryResult`.
|
|
43
|
-
*/
|
|
44
|
-
(): PoolsQueryBuilder;
|
|
45
|
-
}
|
|
46
29
|
declare function redeemBenefit$1(httpClient: HttpClient): RedeemBenefitSignature;
|
|
47
30
|
interface RedeemBenefitSignature {
|
|
48
31
|
/**
|
|
@@ -97,13 +80,17 @@ interface BulkUpdatePoolsSignature {
|
|
|
97
80
|
(options?: NonNullablePaths<BulkUpdatePoolsOptions, `pools.${number}.pool` | `pools.${number}.pool._id` | `pools.${number}.pool.revision`, 5>): Promise<NonNullablePaths<BulkUpdatePoolsResponse, `results` | `results.${number}.poolMetadata.originalIndex` | `results.${number}.poolMetadata.success` | `results.${number}.poolMetadata.error.code` | `results.${number}.poolMetadata.error.description` | `results.${number}.pool.status` | `results.${number}.pool.beneficiary.anonymousVisitorId` | `results.${number}.pool.beneficiary.memberId` | `results.${number}.pool.beneficiary.wixUserId` | `results.${number}.pool.displayName` | `results.${number}.pool.programDefinition._id` | `results.${number}.pool.program._id` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`, 6>>;
|
|
98
81
|
}
|
|
99
82
|
|
|
83
|
+
declare function customQueryPools(httpClient: HttpClient): {
|
|
84
|
+
(): PoolsQueryBuilder;
|
|
85
|
+
(query: CursorQuery): ReturnType<typeof typedQueryPools>;
|
|
86
|
+
};
|
|
100
87
|
declare const getPool: MaybeContext<BuildRESTFunction<typeof getPool$1> & typeof getPool$1>;
|
|
101
88
|
declare const updatePool: MaybeContext<BuildRESTFunction<typeof updatePool$1> & typeof updatePool$1>;
|
|
102
|
-
declare const queryPools: MaybeContext<BuildRESTFunction<typeof queryPools$1> & typeof queryPools$1>;
|
|
103
89
|
declare const redeemBenefit: MaybeContext<BuildRESTFunction<typeof redeemBenefit$1> & typeof redeemBenefit$1>;
|
|
104
90
|
declare const checkBenefitEligibility: MaybeContext<BuildRESTFunction<typeof checkBenefitEligibility$1> & typeof checkBenefitEligibility$1>;
|
|
105
91
|
declare const bulkCheckBenefitEligibility: MaybeContext<BuildRESTFunction<typeof bulkCheckBenefitEligibility$1> & typeof bulkCheckBenefitEligibility$1>;
|
|
106
92
|
declare const getEligibleBenefits: MaybeContext<BuildRESTFunction<typeof getEligibleBenefits$1> & typeof getEligibleBenefits$1>;
|
|
107
93
|
declare const bulkUpdatePools: MaybeContext<BuildRESTFunction<typeof bulkUpdatePools$1> & typeof bulkUpdatePools$1>;
|
|
94
|
+
declare const queryPools: MaybeContext<BuildRESTFunction<typeof customQueryPools> & typeof customQueryPools>;
|
|
108
95
|
|
|
109
|
-
export { BulkCheckBenefitEligibilityOptions, BulkCheckBenefitEligibilityResponse, BulkUpdatePoolsOptions, BulkUpdatePoolsResponse, CheckBenefitEligibilityOptions, CheckBenefitEligibilityResponse, GetEligibleBenefitsApplicationErrors, GetEligibleBenefitsOptions, GetEligibleBenefitsResponse, ItemReference, Pool, PoolsQueryBuilder, RedeemBenefitApplicationErrors, RedeemBenefitOptions, RedeemBenefitResponse, UpdatePool, bulkCheckBenefitEligibility, bulkUpdatePools, checkBenefitEligibility, getEligibleBenefits, getPool, queryPools, redeemBenefit, updatePool };
|
|
96
|
+
export { BulkCheckBenefitEligibilityOptions, BulkCheckBenefitEligibilityResponse, BulkUpdatePoolsOptions, BulkUpdatePoolsResponse, CheckBenefitEligibilityOptions, CheckBenefitEligibilityResponse, CursorQuery, GetEligibleBenefitsApplicationErrors, GetEligibleBenefitsOptions, GetEligibleBenefitsResponse, ItemReference, Pool, PoolsQueryBuilder, RedeemBenefitApplicationErrors, RedeemBenefitOptions, RedeemBenefitResponse, UpdatePool, bulkCheckBenefitEligibility, bulkUpdatePools, checkBenefitEligibility, getEligibleBenefits, getPool, queryPools, redeemBenefit, updatePool };
|
package/build/cjs/index.js
CHANGED
|
@@ -704,6 +704,29 @@ function queryPools2() {
|
|
|
704
704
|
transformationPaths: {}
|
|
705
705
|
});
|
|
706
706
|
}
|
|
707
|
+
async function typedQueryPools(query) {
|
|
708
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
709
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ query });
|
|
710
|
+
const reqOpts = queryPools(payload);
|
|
711
|
+
sideEffects?.onSiteCall?.();
|
|
712
|
+
try {
|
|
713
|
+
const result = await httpClient.request(reqOpts);
|
|
714
|
+
sideEffects?.onSuccess?.(result);
|
|
715
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
716
|
+
} catch (err) {
|
|
717
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
718
|
+
err,
|
|
719
|
+
{
|
|
720
|
+
spreadPathsToArguments: {},
|
|
721
|
+
explicitPathsToArguments: { query: "$[0]" },
|
|
722
|
+
singleArgumentUnchanged: false
|
|
723
|
+
},
|
|
724
|
+
["query"]
|
|
725
|
+
);
|
|
726
|
+
sideEffects?.onError?.(err);
|
|
727
|
+
throw transformedError;
|
|
728
|
+
}
|
|
729
|
+
}
|
|
707
730
|
async function redeemBenefit2(poolId, options) {
|
|
708
731
|
const { httpClient, sideEffects } = arguments[2];
|
|
709
732
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
@@ -908,6 +931,13 @@ function queryPools3(httpClient) {
|
|
|
908
931
|
{ httpClient }
|
|
909
932
|
);
|
|
910
933
|
}
|
|
934
|
+
function typedQueryPools2(httpClient) {
|
|
935
|
+
return (query) => typedQueryPools(
|
|
936
|
+
query,
|
|
937
|
+
// @ts-ignore
|
|
938
|
+
{ httpClient }
|
|
939
|
+
);
|
|
940
|
+
}
|
|
911
941
|
function redeemBenefit3(httpClient) {
|
|
912
942
|
return (poolId, options) => redeemBenefit2(
|
|
913
943
|
poolId,
|
|
@@ -949,14 +979,26 @@ function bulkUpdatePools3(httpClient) {
|
|
|
949
979
|
|
|
950
980
|
// src/benefit-programs-v1-pool-pools.context.ts
|
|
951
981
|
var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
|
|
982
|
+
var import_query_method_router = require("@wix/sdk-runtime/query-method-router");
|
|
983
|
+
function customQueryPools(httpClient) {
|
|
984
|
+
const router = (0, import_query_method_router.createQueryOverloadRouter)({
|
|
985
|
+
builderQueryFunction: () => queryPools3(httpClient)(),
|
|
986
|
+
typedQueryFunction: (query) => typedQueryPools2(httpClient)(query),
|
|
987
|
+
hasOptionsParameter: false
|
|
988
|
+
});
|
|
989
|
+
function overloadedQuery(query) {
|
|
990
|
+
return router(...arguments);
|
|
991
|
+
}
|
|
992
|
+
return overloadedQuery;
|
|
993
|
+
}
|
|
952
994
|
var getPool4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getPool3);
|
|
953
995
|
var updatePool4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updatePool3);
|
|
954
|
-
var queryPools4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(queryPools3);
|
|
955
996
|
var redeemBenefit4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(redeemBenefit3);
|
|
956
997
|
var checkBenefitEligibility4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(checkBenefitEligibility3);
|
|
957
998
|
var bulkCheckBenefitEligibility4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkCheckBenefitEligibility3);
|
|
958
999
|
var getEligibleBenefits4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getEligibleBenefits3);
|
|
959
1000
|
var bulkUpdatePools4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkUpdatePools3);
|
|
1001
|
+
var queryPools4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(customQueryPools);
|
|
960
1002
|
// Annotate the CommonJS export names for ESM import in node:
|
|
961
1003
|
0 && (module.exports = {
|
|
962
1004
|
EligibilityCheckResultType,
|