@wix/auto_sdk_benefit-programs_pools 1.0.77 → 1.0.79
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 +1 -1
- package/build/cjs/index.js +84 -2
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +170 -1
- package/build/cjs/index.typings.js +75 -2
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +154 -2
- package/build/cjs/meta.js +54 -0
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +1 -1
- package/build/es/index.mjs +82 -2
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +170 -1
- package/build/es/index.typings.mjs +73 -2
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +154 -2
- package/build/es/meta.mjs +52 -0
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +20 -3
- package/build/internal/cjs/index.js +84 -2
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +203 -1
- package/build/internal/cjs/index.typings.js +75 -2
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +161 -2
- package/build/internal/cjs/meta.js +54 -0
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +20 -3
- package/build/internal/es/index.mjs +82 -2
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +203 -1
- package/build/internal/es/index.typings.mjs +73 -2
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +161 -2
- package/build/internal/es/meta.mjs +52 -0
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -653,6 +653,42 @@ interface ItemReference {
|
|
|
653
653
|
*/
|
|
654
654
|
providerAppId?: string;
|
|
655
655
|
}
|
|
656
|
+
interface BenefitReallocated {
|
|
657
|
+
/** Pool which the reallocated benefit belongs to */
|
|
658
|
+
pool?: Pool;
|
|
659
|
+
/** Details of the reallocation */
|
|
660
|
+
reallocationDetails?: ReallocationDetails;
|
|
661
|
+
}
|
|
662
|
+
interface ReallocationDetails {
|
|
663
|
+
/**
|
|
664
|
+
* Id of the reallocation transaction. This is the new latest transaction in the chain
|
|
665
|
+
* @format GUID
|
|
666
|
+
*/
|
|
667
|
+
transactionId?: string;
|
|
668
|
+
/**
|
|
669
|
+
* Id of the transaction superseded by the reallocation
|
|
670
|
+
* @format GUID
|
|
671
|
+
*/
|
|
672
|
+
previousTransactionId?: string;
|
|
673
|
+
/** Reference of the item that is being reallocated */
|
|
674
|
+
itemReference?: ItemReference;
|
|
675
|
+
/**
|
|
676
|
+
* Number of items that were redeemed
|
|
677
|
+
* @min 1
|
|
678
|
+
*/
|
|
679
|
+
itemCount?: number;
|
|
680
|
+
/** New date at which the item will be used */
|
|
681
|
+
targetDate?: Date | null;
|
|
682
|
+
/** Date at which the item would have been used before this reallocation */
|
|
683
|
+
previousTargetDate?: Date | null;
|
|
684
|
+
/**
|
|
685
|
+
* Idempotency key of the reallocation request
|
|
686
|
+
* @maxLength 200
|
|
687
|
+
*/
|
|
688
|
+
idempotencyKey?: string;
|
|
689
|
+
/** Beneficiary of the entitlement */
|
|
690
|
+
beneficiary?: CommonIdentificationData;
|
|
691
|
+
}
|
|
656
692
|
interface PoolPaused {
|
|
657
693
|
/** Pool which has been paused */
|
|
658
694
|
pool?: Pool;
|
|
@@ -1191,6 +1227,72 @@ interface BenefitNotFound {
|
|
|
1191
1227
|
*/
|
|
1192
1228
|
programInfo?: PoolProgramInfo;
|
|
1193
1229
|
}
|
|
1230
|
+
interface ReallocateBenefitRequest {
|
|
1231
|
+
/**
|
|
1232
|
+
* ID of the latest transaction in the redemption's transaction chain.
|
|
1233
|
+
* For a redemption that has never been reallocated, this is the redemption transaction ID.
|
|
1234
|
+
* @format GUID
|
|
1235
|
+
*/
|
|
1236
|
+
transactionId: string;
|
|
1237
|
+
/** New date that the item will be provided to the beneficiary. */
|
|
1238
|
+
targetDate: Date | null;
|
|
1239
|
+
/**
|
|
1240
|
+
* Unique identifier, generated by the client.
|
|
1241
|
+
* Used to recognize repeated attempts to make the same request.
|
|
1242
|
+
* @maxLength 200
|
|
1243
|
+
*/
|
|
1244
|
+
idempotencyKey: string;
|
|
1245
|
+
/** Beneficiary of the pool containing the benefit to reallocate. Must match the beneficiary of the original redemption. */
|
|
1246
|
+
beneficiary?: CommonIdentificationData;
|
|
1247
|
+
/**
|
|
1248
|
+
* 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.
|
|
1249
|
+
* @minLength 1
|
|
1250
|
+
* @maxLength 20
|
|
1251
|
+
*/
|
|
1252
|
+
namespace: string;
|
|
1253
|
+
}
|
|
1254
|
+
interface ReallocateBenefitResponse {
|
|
1255
|
+
/**
|
|
1256
|
+
* ID of the reallocation transaction. This is the new latest transaction in the chain.
|
|
1257
|
+
* @format GUID
|
|
1258
|
+
*/
|
|
1259
|
+
transactionId?: string;
|
|
1260
|
+
}
|
|
1261
|
+
interface TransactionNotFound {
|
|
1262
|
+
/**
|
|
1263
|
+
* ID of the transaction that wasn't found.
|
|
1264
|
+
* @format GUID
|
|
1265
|
+
*/
|
|
1266
|
+
transactionId?: string;
|
|
1267
|
+
}
|
|
1268
|
+
interface NotLatestTransaction {
|
|
1269
|
+
/**
|
|
1270
|
+
* ID of the latest transaction in the chain.
|
|
1271
|
+
* @format GUID
|
|
1272
|
+
*/
|
|
1273
|
+
latestTransactionId?: string;
|
|
1274
|
+
}
|
|
1275
|
+
interface RedemptionAlreadyCanceled {
|
|
1276
|
+
/**
|
|
1277
|
+
* ID of the transaction that canceled the redemption.
|
|
1278
|
+
* @format GUID
|
|
1279
|
+
*/
|
|
1280
|
+
cancellationTransactionId?: string;
|
|
1281
|
+
}
|
|
1282
|
+
interface ChainOperationInProgress {
|
|
1283
|
+
/**
|
|
1284
|
+
* ID of the pending transaction that hasn't settled yet.
|
|
1285
|
+
* @format GUID
|
|
1286
|
+
*/
|
|
1287
|
+
pendingTransactionId?: string;
|
|
1288
|
+
}
|
|
1289
|
+
interface AlreadyExecuted {
|
|
1290
|
+
/**
|
|
1291
|
+
* Idempotency key of the original request.
|
|
1292
|
+
* @maxLength 200
|
|
1293
|
+
*/
|
|
1294
|
+
idempotencyKey?: string;
|
|
1295
|
+
}
|
|
1194
1296
|
interface ReserveBenefitRequest {
|
|
1195
1297
|
/**
|
|
1196
1298
|
* Id of the pool that is being redeemed from
|
|
@@ -1312,7 +1414,25 @@ interface CheckBenefitEligibilityRequest {
|
|
|
1312
1414
|
* @maxLength 20
|
|
1313
1415
|
*/
|
|
1314
1416
|
namespace: string;
|
|
1417
|
+
/**
|
|
1418
|
+
* Intent of the eligibility check.
|
|
1419
|
+
*
|
|
1420
|
+
* If not provided, `REDEMPTION` is used by default.
|
|
1421
|
+
* @internal
|
|
1422
|
+
*/
|
|
1423
|
+
intent?: IntentWithLiterals;
|
|
1315
1424
|
}
|
|
1425
|
+
declare enum Intent {
|
|
1426
|
+
/** Check whether the benefit can be redeemed. */
|
|
1427
|
+
REDEMPTION = "REDEMPTION",
|
|
1428
|
+
/**
|
|
1429
|
+
* Check whether an already redeemed benefit can be reallocated to the target date.
|
|
1430
|
+
* The redeemed credits are kept, so the balance check is skipped.
|
|
1431
|
+
*/
|
|
1432
|
+
REALLOCATION = "REALLOCATION"
|
|
1433
|
+
}
|
|
1434
|
+
/** @enumType */
|
|
1435
|
+
type IntentWithLiterals = Intent | 'REDEMPTION' | 'REALLOCATION';
|
|
1316
1436
|
interface CheckBenefitEligibilityResponse {
|
|
1317
1437
|
/** Result of the eligibility check. */
|
|
1318
1438
|
result?: EligibilityCheckResult;
|
|
@@ -2001,6 +2121,44 @@ type RedeemBenefitApplicationErrors = {
|
|
|
2001
2121
|
data?: BenefitNotFound;
|
|
2002
2122
|
};
|
|
2003
2123
|
/** @docsIgnore */
|
|
2124
|
+
type ReallocateBenefitApplicationErrors = {
|
|
2125
|
+
code?: 'TRANSACTION_NOT_FOUND';
|
|
2126
|
+
description?: string;
|
|
2127
|
+
data?: TransactionNotFound;
|
|
2128
|
+
} | {
|
|
2129
|
+
code?: 'POOL_NOT_FOUND';
|
|
2130
|
+
description?: string;
|
|
2131
|
+
data?: PoolNotFound;
|
|
2132
|
+
} | {
|
|
2133
|
+
code?: 'NOT_LATEST_TRANSACTION';
|
|
2134
|
+
description?: string;
|
|
2135
|
+
data?: NotLatestTransaction;
|
|
2136
|
+
} | {
|
|
2137
|
+
code?: 'REDEMPTION_ALREADY_CANCELED';
|
|
2138
|
+
description?: string;
|
|
2139
|
+
data?: RedemptionAlreadyCanceled;
|
|
2140
|
+
} | {
|
|
2141
|
+
code?: 'TRANSACTION_NOT_REALLOCATABLE';
|
|
2142
|
+
description?: string;
|
|
2143
|
+
data?: Record<string, any>;
|
|
2144
|
+
} | {
|
|
2145
|
+
code?: 'POOL_NOT_ACTIVE';
|
|
2146
|
+
description?: string;
|
|
2147
|
+
data?: PoolNotActive;
|
|
2148
|
+
} | {
|
|
2149
|
+
code?: 'POLICY_EXPRESSION_EVALUATED_TO_FALSE';
|
|
2150
|
+
description?: string;
|
|
2151
|
+
data?: PolicyExpressionEvaluatedToFalse;
|
|
2152
|
+
} | {
|
|
2153
|
+
code?: 'CHAIN_OPERATION_IN_PROGRESS';
|
|
2154
|
+
description?: string;
|
|
2155
|
+
data?: ChainOperationInProgress;
|
|
2156
|
+
} | {
|
|
2157
|
+
code?: 'ALREADY_EXECUTED';
|
|
2158
|
+
description?: string;
|
|
2159
|
+
data?: AlreadyExecuted;
|
|
2160
|
+
};
|
|
2161
|
+
/** @docsIgnore */
|
|
2004
2162
|
type GetEligibleBenefitsApplicationErrors = {
|
|
2005
2163
|
code?: 'INVALID_ITEM_REFERENCE';
|
|
2006
2164
|
description?: string;
|
|
@@ -2407,6 +2565,43 @@ interface RedeemBenefitOptions {
|
|
|
2407
2565
|
*/
|
|
2408
2566
|
namespace: string;
|
|
2409
2567
|
}
|
|
2568
|
+
/**
|
|
2569
|
+
* Reallocates a redeemed benefit to a new target date.
|
|
2570
|
+
*
|
|
2571
|
+
* The reallocation is recorded as a new zero-amount transaction that supersedes the specified transaction in the redemption's transaction chain.
|
|
2572
|
+
* The specified transaction must be the latest transaction in the chain. The item, count and benefit key are carried over from the original redemption; only the target date changes.
|
|
2573
|
+
* @param transactionId - ID of the latest transaction in the redemption's transaction chain.
|
|
2574
|
+
* For a redemption that has never been reallocated, this is the redemption transaction ID.
|
|
2575
|
+
* @internal
|
|
2576
|
+
* @documentationMaturity preview
|
|
2577
|
+
* @requiredField options.idempotencyKey
|
|
2578
|
+
* @requiredField options.namespace
|
|
2579
|
+
* @requiredField options.targetDate
|
|
2580
|
+
* @requiredField transactionId
|
|
2581
|
+
* @permissionId benefit_programs:v1:pool:reallocate_benefit
|
|
2582
|
+
* @fqn wix.benefit_programs.v1.pool.PoolService.ReallocateBenefit
|
|
2583
|
+
*/
|
|
2584
|
+
declare function reallocateBenefit(transactionId: string, options?: NonNullablePaths<ReallocateBenefitOptions, `idempotencyKey` | `namespace` | `targetDate`, 2>): Promise<NonNullablePaths<ReallocateBenefitResponse, `transactionId`, 2> & {
|
|
2585
|
+
__applicationErrorsType?: ReallocateBenefitApplicationErrors;
|
|
2586
|
+
}>;
|
|
2587
|
+
interface ReallocateBenefitOptions {
|
|
2588
|
+
/** New date that the item will be provided to the beneficiary. */
|
|
2589
|
+
targetDate: Date | null;
|
|
2590
|
+
/**
|
|
2591
|
+
* Unique identifier, generated by the client.
|
|
2592
|
+
* Used to recognize repeated attempts to make the same request.
|
|
2593
|
+
* @maxLength 200
|
|
2594
|
+
*/
|
|
2595
|
+
idempotencyKey: string;
|
|
2596
|
+
/** Beneficiary of the pool containing the benefit to reallocate. Must match the beneficiary of the original redemption. */
|
|
2597
|
+
beneficiary?: CommonIdentificationData;
|
|
2598
|
+
/**
|
|
2599
|
+
* 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.
|
|
2600
|
+
* @minLength 1
|
|
2601
|
+
* @maxLength 20
|
|
2602
|
+
*/
|
|
2603
|
+
namespace: string;
|
|
2604
|
+
}
|
|
2410
2605
|
/**
|
|
2411
2606
|
* Checks if a benefit can currently be redeemed.
|
|
2412
2607
|
*
|
|
@@ -2454,6 +2649,13 @@ interface CheckBenefitEligibilityOptions {
|
|
|
2454
2649
|
* @maxLength 20
|
|
2455
2650
|
*/
|
|
2456
2651
|
namespace: string;
|
|
2652
|
+
/**
|
|
2653
|
+
* Intent of the eligibility check.
|
|
2654
|
+
*
|
|
2655
|
+
* If not provided, `REDEMPTION` is used by default.
|
|
2656
|
+
* @internal
|
|
2657
|
+
*/
|
|
2658
|
+
intent?: IntentWithLiterals;
|
|
2457
2659
|
}
|
|
2458
2660
|
/**
|
|
2459
2661
|
* Checks if benefits can currently be redeemed.
|
|
@@ -2629,4 +2831,4 @@ interface CheckBenefitEligibilityByFilterOptions {
|
|
|
2629
2831
|
poolSelector?: PoolSelector;
|
|
2630
2832
|
}
|
|
2631
2833
|
|
|
2632
|
-
export { type AccountInfo, 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 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 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, type InvalidPoolDefinitionReference, type ItemMetadata, type ItemReference, 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 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 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, TimePeriod, type TimePeriodWithLiterals, 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 };
|
|
2834
|
+
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, reallocateBenefit, redeemBenefit, typedQueryPools, updatePool, utils };
|
|
@@ -336,6 +336,33 @@ function redeemBenefit(payload) {
|
|
|
336
336
|
}
|
|
337
337
|
return __redeemBenefit;
|
|
338
338
|
}
|
|
339
|
+
function reallocateBenefit(payload) {
|
|
340
|
+
function __reallocateBenefit({ host }) {
|
|
341
|
+
const serializedData = transformPaths(payload, [
|
|
342
|
+
{
|
|
343
|
+
transformFn: transformSDKTimestampToRESTTimestamp,
|
|
344
|
+
paths: [{ path: "targetDate" }]
|
|
345
|
+
}
|
|
346
|
+
]);
|
|
347
|
+
const metadata = {
|
|
348
|
+
entityFqdn: "wix.benefit_programs.v1.pool",
|
|
349
|
+
method: "POST",
|
|
350
|
+
methodFqn: "wix.benefit_programs.v1.pool.PoolService.ReallocateBenefit",
|
|
351
|
+
packageName: PACKAGE_NAME,
|
|
352
|
+
migrationOptions: {
|
|
353
|
+
optInTransformResponse: true
|
|
354
|
+
},
|
|
355
|
+
url: resolveWixBenefitProgramsV1PoolPoolServiceUrl({
|
|
356
|
+
protoPath: "/v1/benefits/reallocate",
|
|
357
|
+
data: serializedData,
|
|
358
|
+
host
|
|
359
|
+
}),
|
|
360
|
+
data: serializedData
|
|
361
|
+
};
|
|
362
|
+
return metadata;
|
|
363
|
+
}
|
|
364
|
+
return __reallocateBenefit;
|
|
365
|
+
}
|
|
339
366
|
function checkBenefitEligibility(payload) {
|
|
340
367
|
function __checkBenefitEligibility({ host }) {
|
|
341
368
|
const serializedData = transformPaths(payload, [
|
|
@@ -557,6 +584,11 @@ var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
|
|
|
557
584
|
SortOrder2["DESC"] = "DESC";
|
|
558
585
|
return SortOrder2;
|
|
559
586
|
})(SortOrder || {});
|
|
587
|
+
var Intent = /* @__PURE__ */ ((Intent2) => {
|
|
588
|
+
Intent2["REDEMPTION"] = "REDEMPTION";
|
|
589
|
+
Intent2["REALLOCATION"] = "REALLOCATION";
|
|
590
|
+
return Intent2;
|
|
591
|
+
})(Intent || {});
|
|
560
592
|
var BenefitResultType = /* @__PURE__ */ ((BenefitResultType2) => {
|
|
561
593
|
BenefitResultType2["ELIGIBLE_BENEFIT"] = "ELIGIBLE_BENEFIT";
|
|
562
594
|
BenefitResultType2["NOT_ENOUGH_BALANCE"] = "NOT_ENOUGH_BALANCE";
|
|
@@ -750,6 +782,41 @@ async function redeemBenefit2(poolId, options) {
|
|
|
750
782
|
throw transformedError;
|
|
751
783
|
}
|
|
752
784
|
}
|
|
785
|
+
async function reallocateBenefit2(transactionId, options) {
|
|
786
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
787
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
788
|
+
transactionId,
|
|
789
|
+
targetDate: options?.targetDate,
|
|
790
|
+
idempotencyKey: options?.idempotencyKey,
|
|
791
|
+
beneficiary: options?.beneficiary,
|
|
792
|
+
namespace: options?.namespace
|
|
793
|
+
});
|
|
794
|
+
const reqOpts = reallocateBenefit(payload);
|
|
795
|
+
sideEffects?.onSiteCall?.();
|
|
796
|
+
try {
|
|
797
|
+
const result = await httpClient.request(reqOpts);
|
|
798
|
+
sideEffects?.onSuccess?.(result);
|
|
799
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
800
|
+
} catch (err) {
|
|
801
|
+
const transformedError = sdkTransformError(
|
|
802
|
+
err,
|
|
803
|
+
{
|
|
804
|
+
spreadPathsToArguments: {},
|
|
805
|
+
explicitPathsToArguments: {
|
|
806
|
+
transactionId: "$[0]",
|
|
807
|
+
targetDate: "$[1].targetDate",
|
|
808
|
+
idempotencyKey: "$[1].idempotencyKey",
|
|
809
|
+
beneficiary: "$[1].beneficiary",
|
|
810
|
+
namespace: "$[1].namespace"
|
|
811
|
+
},
|
|
812
|
+
singleArgumentUnchanged: false
|
|
813
|
+
},
|
|
814
|
+
["transactionId", "options"]
|
|
815
|
+
);
|
|
816
|
+
sideEffects?.onError?.(err);
|
|
817
|
+
throw transformedError;
|
|
818
|
+
}
|
|
819
|
+
}
|
|
753
820
|
async function checkBenefitEligibility2(poolId, options) {
|
|
754
821
|
const { httpClient, sideEffects } = arguments[2];
|
|
755
822
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
@@ -760,7 +827,8 @@ async function checkBenefitEligibility2(poolId, options) {
|
|
|
760
827
|
targetDate: options?.targetDate,
|
|
761
828
|
additionalData: options?.additionalData,
|
|
762
829
|
beneficiary: options?.beneficiary,
|
|
763
|
-
namespace: options?.namespace
|
|
830
|
+
namespace: options?.namespace,
|
|
831
|
+
intent: options?.intent
|
|
764
832
|
});
|
|
765
833
|
const reqOpts = checkBenefitEligibility(payload);
|
|
766
834
|
sideEffects?.onSiteCall?.();
|
|
@@ -781,7 +849,8 @@ async function checkBenefitEligibility2(poolId, options) {
|
|
|
781
849
|
targetDate: "$[1].targetDate",
|
|
782
850
|
additionalData: "$[1].additionalData",
|
|
783
851
|
beneficiary: "$[1].beneficiary",
|
|
784
|
-
namespace: "$[1].namespace"
|
|
852
|
+
namespace: "$[1].namespace",
|
|
853
|
+
intent: "$[1].intent"
|
|
785
854
|
},
|
|
786
855
|
singleArgumentUnchanged: false
|
|
787
856
|
},
|
|
@@ -932,6 +1001,7 @@ async function checkBenefitEligibilityByFilter2(options) {
|
|
|
932
1001
|
export {
|
|
933
1002
|
BenefitResultType,
|
|
934
1003
|
IdentityType,
|
|
1004
|
+
Intent,
|
|
935
1005
|
PolicyExpressionType,
|
|
936
1006
|
PoolOrigin,
|
|
937
1007
|
PoolRenewalActionType,
|
|
@@ -950,6 +1020,7 @@ export {
|
|
|
950
1020
|
getEligibleBenefits2 as getEligibleBenefits,
|
|
951
1021
|
getPool2 as getPool,
|
|
952
1022
|
queryPools2 as queryPools,
|
|
1023
|
+
reallocateBenefit2 as reallocateBenefit,
|
|
953
1024
|
redeemBenefit2 as redeemBenefit,
|
|
954
1025
|
typedQueryPools,
|
|
955
1026
|
updatePool2 as updatePool,
|