@wix/auto_sdk_loyalty_programs 1.0.23 → 1.0.24
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 +2 -2
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/{loyalty-v1-program-programs.universal-CEkDSoxz.d.ts → index.typings.d.ts} +124 -1
- package/build/cjs/index.typings.js +781 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +2 -1
- package/build/es/index.d.mts +2 -2
- package/build/es/index.mjs.map +1 -1
- package/build/es/{loyalty-v1-program-programs.universal-CEkDSoxz.d.mts → index.typings.d.mts} +124 -1
- package/build/es/index.typings.mjs +741 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +2 -1
- package/build/internal/cjs/index.d.ts +2 -2
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/{loyalty-v1-program-programs.universal-CEkDSoxz.d.ts → index.typings.d.ts} +124 -1
- package/build/internal/cjs/index.typings.js +781 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +2 -1
- package/build/internal/es/index.d.mts +2 -2
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/{loyalty-v1-program-programs.universal-CEkDSoxz.d.mts → index.typings.d.mts} +124 -1
- package/build/internal/es/index.typings.mjs +741 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +2 -1
- package/package.json +2 -2
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { NonNullablePaths } from '@wix/sdk-types';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* A loyalty program allows sites to maintain customer reward accounts. Site owners can create a
|
|
3
5
|
* loyalty program to increase customer retention. Read more about the loyalty program in
|
|
@@ -1352,5 +1354,126 @@ interface ProgramUpdatedEnvelope {
|
|
|
1352
1354
|
entity: LoyaltyProgram;
|
|
1353
1355
|
metadata: EventMetadata;
|
|
1354
1356
|
}
|
|
1357
|
+
/**
|
|
1358
|
+
* Triggered when a loyalty program is updated.
|
|
1359
|
+
* @permissionScope Read Loyalty
|
|
1360
|
+
* @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY
|
|
1361
|
+
* @permissionScope Manage Loyalty
|
|
1362
|
+
* @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
|
|
1363
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
1364
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1365
|
+
* @permissionId LOYALTY.READ_PROGRAM
|
|
1366
|
+
* @webhook
|
|
1367
|
+
* @eventType wix.loyalty.v1.program_updated
|
|
1368
|
+
* @serviceIdentifier com.wixpress.loyalty.program.LoyaltyPrograms
|
|
1369
|
+
* @slug updated
|
|
1370
|
+
*/
|
|
1371
|
+
declare function onProgramUpdated(handler: (event: ProgramUpdatedEnvelope) => void | Promise<void>): void;
|
|
1372
|
+
type ProgramNonNullablePaths = `status` | `pointsExpiration.status` | `pointsExpiration.monthsOfInactivity` | `pointsExpiration.expiringPointsPercentage` | `premiumFeatures.loyaltyProgram` | `premiumFeatures.tiers` | `premiumFeatures.pointsExpiration`;
|
|
1373
|
+
/**
|
|
1374
|
+
* Retrieves the site's loyalty program.
|
|
1375
|
+
*
|
|
1376
|
+
* The `getLoyaltyProgram()` function returns a Promise that resolves to the site's loyalty program.
|
|
1377
|
+
* @public
|
|
1378
|
+
* @permissionId LOYALTY.READ_PROGRAM
|
|
1379
|
+
* @applicableIdentity APP
|
|
1380
|
+
* @applicableIdentity VISITOR
|
|
1381
|
+
* @fqn com.wixpress.loyalty.program.LoyaltyPrograms.GetLoyaltyProgram
|
|
1382
|
+
*/
|
|
1383
|
+
declare function getLoyaltyProgram(): Promise<NonNullablePaths<GetLoyaltyProgramResponse, {
|
|
1384
|
+
[P in ProgramNonNullablePaths]: `loyaltyProgram.${P}`;
|
|
1385
|
+
}[ProgramNonNullablePaths]>>;
|
|
1386
|
+
/**
|
|
1387
|
+
* Retrieves loyalty programs for all metasites that the caller is a member of.
|
|
1388
|
+
*
|
|
1389
|
+
* Must be called with user identity.
|
|
1390
|
+
* @public
|
|
1391
|
+
* @permissionId LOYALTY.PROGRAM_BULK_READ
|
|
1392
|
+
* @fqn com.wixpress.loyalty.program.LoyaltyPrograms.BulkGetLoyaltyProgram
|
|
1393
|
+
*/
|
|
1394
|
+
declare function bulkGetLoyaltyProgram(): Promise<NonNullablePaths<BulkGetLoyaltyProgramResponse, `programInSites` | `programInSites.${number}.metaSiteId` | {
|
|
1395
|
+
[P in ProgramNonNullablePaths]: `programInSites.${number}.loyaltyProgram.${P}`;
|
|
1396
|
+
}[ProgramNonNullablePaths]>>;
|
|
1397
|
+
/**
|
|
1398
|
+
* Updates the site's loyalty program.
|
|
1399
|
+
*
|
|
1400
|
+
* The `updateLoyaltyProgram()` function returns a Promise that resolves when the loyalty program is updated.
|
|
1401
|
+
*
|
|
1402
|
+
* With the `updateLoyaltyProgram()` function you can update the name of the loyalty program and the details of the collectible points unit. To activate the loyalty program use the [`activateLoyaltyProgram()`](https://dev.wix.com/docs/sdk/backend-modules/loyalty/programs/activate-loyalty-program) function.
|
|
1403
|
+
*
|
|
1404
|
+
* >**Note:** Only visitors with **Manage Loyalty** [permissions](https://support.wix.com/en/article/roles-permissions-accessing-roles-permissions) can update a loyalty program. You can override the permissions with the `wix-auth` [`elevate()`](wix-auth/elevate) function.
|
|
1405
|
+
* @param loyaltyProgram - Loyalty program fields to update.
|
|
1406
|
+
* @public
|
|
1407
|
+
* @requiredField loyaltyProgram
|
|
1408
|
+
* @permissionId LOYALTY.MANAGE_PROGRAM
|
|
1409
|
+
* @applicableIdentity APP
|
|
1410
|
+
* @fqn com.wixpress.loyalty.program.LoyaltyPrograms.UpdateLoyaltyProgram
|
|
1411
|
+
*/
|
|
1412
|
+
declare function updateLoyaltyProgram(loyaltyProgram: LoyaltyProgram): Promise<NonNullablePaths<UpdateLoyaltyProgramResponse, {
|
|
1413
|
+
[P in ProgramNonNullablePaths]: `loyaltyProgram.${P}`;
|
|
1414
|
+
}[ProgramNonNullablePaths]>>;
|
|
1415
|
+
/**
|
|
1416
|
+
* Activates a loyalty program.
|
|
1417
|
+
*
|
|
1418
|
+
* The `activateLoyaltyProgram()` function returns a Promise that resolves when the status of the loyalty program is successfully changed to `"ACTIVE"`.
|
|
1419
|
+
*
|
|
1420
|
+
* Before you begin, a Wix Loyalty Program must first be installed through your [dashboard](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Floyalty-accounts/wizard/) or through the [Wix App Market](https://www.wix.com/app-market/loyalty). Initially when a loyalty program is installed, the status is set to `"DRAFT"`. You can change the program's status to `"ACTIVE"` with this function or through your [dashboard](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Floyalty-accounts/wizard/). A site's customers can only earn or redeem points while the program status is `"ACTIVE"`.
|
|
1421
|
+
*
|
|
1422
|
+
* This function updates only the status of a loyalty program, to make other updates to the program, use the [`updateLoyaltyProgram()`](https://dev.wix.com/docs/sdk/backend-modules/loyalty/programs/update-loyalty-program) function.
|
|
1423
|
+
*
|
|
1424
|
+
* To temporarily pause your loyalty program you must follow three steps:
|
|
1425
|
+
* 1. Remove all [`earnPoints()`](https://dev.wix.com/docs/sdk/backend-modules/loyalty/accounts/earn-points) functions and switch off all the "Earn Points" and "Rewards" toggles in the [Loyalty Program dashboard](https://www.wix.com/my-account/site-selector/?buttonText=Open%20Loyalty%20Program&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https://www.wix.com/dashboard/{{metaSiteId}}/loyalty-accounts/).
|
|
1426
|
+
* 1. Hide the loyalty page from your site.
|
|
1427
|
+
* 1. Delete the My Rewards page from the Member pages.
|
|
1428
|
+
* See [Pausing Your Loyalty Program](https://support.wix.com/en/article/wix-loyalty-program-pausing-your-loyalty-program) for more information.
|
|
1429
|
+
*
|
|
1430
|
+
* >**Note:** Only visitors with **Manage Loyalty** [permissions](https://support.wix.com/en/article/roles-permissions-accessing-roles-permissions) can activate a loyalty program. You can override the permissions with the `wix-auth` [`elevate()`](wix-auth/elevate) function.
|
|
1431
|
+
* @public
|
|
1432
|
+
* @permissionId LOYALTY.MANAGE_PROGRAM
|
|
1433
|
+
* @applicableIdentity APP
|
|
1434
|
+
* @fqn com.wixpress.loyalty.program.LoyaltyPrograms.ActivateLoyaltyProgram
|
|
1435
|
+
*/
|
|
1436
|
+
declare function activateLoyaltyProgram(): Promise<NonNullablePaths<ActivateLoyaltyProgramResponse, {
|
|
1437
|
+
[P in ProgramNonNullablePaths]: `loyaltyProgram.${P}`;
|
|
1438
|
+
}[ProgramNonNullablePaths]>>;
|
|
1439
|
+
/**
|
|
1440
|
+
* Changes the program status to `PAUSED`.
|
|
1441
|
+
* @public
|
|
1442
|
+
* @permissionId LOYALTY.MANAGE_PROGRAM
|
|
1443
|
+
* @applicableIdentity APP
|
|
1444
|
+
* @fqn com.wixpress.loyalty.program.LoyaltyPrograms.PauseLoyaltyProgram
|
|
1445
|
+
*/
|
|
1446
|
+
declare function pauseLoyaltyProgram(): Promise<NonNullablePaths<PauseLoyaltyProgramResponse, {
|
|
1447
|
+
[P in ProgramNonNullablePaths]: `loyaltyProgram.${P}`;
|
|
1448
|
+
}[ProgramNonNullablePaths]>>;
|
|
1449
|
+
/**
|
|
1450
|
+
* Retrieves information about the available loyalty program premium features.
|
|
1451
|
+
* @public
|
|
1452
|
+
* @permissionId LOYALTY.READ_PROGRAM
|
|
1453
|
+
* @applicableIdentity APP
|
|
1454
|
+
* @applicableIdentity VISITOR
|
|
1455
|
+
* @fqn com.wixpress.loyalty.program.LoyaltyPrograms.GetLoyaltyProgramPremiumFeatures
|
|
1456
|
+
*/
|
|
1457
|
+
declare function getLoyaltyProgramPremiumFeatures(): Promise<NonNullablePaths<GetLoyaltyProgramPremiumFeaturesResponse, `loyaltyProgram` | `tiers` | `pointsExpiration`>>;
|
|
1458
|
+
/**
|
|
1459
|
+
* Updates the `pointsExpiration` status to `ENABLED`.
|
|
1460
|
+
* @public
|
|
1461
|
+
* @permissionId LOYALTY.MANAGE_PROGRAM
|
|
1462
|
+
* @applicableIdentity APP
|
|
1463
|
+
* @fqn com.wixpress.loyalty.program.LoyaltyPrograms.EnablePointsExpiration
|
|
1464
|
+
*/
|
|
1465
|
+
declare function enablePointsExpiration(): Promise<NonNullablePaths<EnablePointsExpirationResponse, {
|
|
1466
|
+
[P in ProgramNonNullablePaths]: `loyaltyProgram.${P}`;
|
|
1467
|
+
}[ProgramNonNullablePaths]>>;
|
|
1468
|
+
/**
|
|
1469
|
+
* Updates the `pointsExpiration` status to `DISABLED`.
|
|
1470
|
+
* @public
|
|
1471
|
+
* @permissionId LOYALTY.MANAGE_PROGRAM
|
|
1472
|
+
* @applicableIdentity APP
|
|
1473
|
+
* @fqn com.wixpress.loyalty.program.LoyaltyPrograms.DisablePointsExpiration
|
|
1474
|
+
*/
|
|
1475
|
+
declare function disablePointsExpiration(): Promise<NonNullablePaths<DisablePointsExpirationResponse, {
|
|
1476
|
+
[P in ProgramNonNullablePaths]: `loyaltyProgram.${P}`;
|
|
1477
|
+
}[ProgramNonNullablePaths]>>;
|
|
1355
1478
|
|
|
1356
|
-
export { type
|
|
1479
|
+
export { type ActionEvent, type ActivateLoyaltyProgramRequest, type ActivateLoyaltyProgramResponse, type Asset, type AssignedFromFloatingReason, type BaseEventMetadata, type BooleanFeature, type BulkGetLoyaltyProgramRequest, type BulkGetLoyaltyProgramResponse, type CancelRequestedReason, type ContractSwitchedReason, type DeleteContext, DeleteStatus, type DeleteStatusWithLiterals, type DisablePointsExpirationRequest, type DisablePointsExpirationResponse, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EnablePointsExpirationRequest, type EnablePointsExpirationResponse, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type Feature, type FeatureCancelled, type FeatureCancelledReasonOneOf, type FeatureContext, type FeatureDisabled, type FeatureDisabledReasonOneOf, type FeatureEnabled, type FeatureEnabledReasonOneOf, type FeatureEvent, type FeatureEventEventOneOf, FeaturePeriod, type FeaturePeriodWithLiterals, type FeatureQuantityInfoOneOf, type FeatureUpdated, type FeatureUpdatedPreviousQuantityInfoOneOf, type FeatureUpdatedReasonOneOf, type FocalPoint, type GetLoyaltyProgramDescriptionRequest, type GetLoyaltyProgramDescriptionResponse, type GetLoyaltyProgramPremiumFeaturesRequest, type GetLoyaltyProgramPremiumFeaturesResponse, type GetLoyaltyProgramRequest, type GetLoyaltyProgramResponse, type IdentificationData, type IdentificationDataIdOneOf, type LoyaltyProgram, type LoyaltyProgramActivated, type LoyaltyProgramDescriptionUpdated, type ManualFeatureCreationReason, type MessageEnvelope, type MetaSiteSpecialEvent, type MetaSiteSpecialEventPayloadOneOf, type MigratedFromLegacyReason, Namespace, type NamespaceChanged, type NamespaceWithLiterals, type NewFeatureReason, type OdeditorAssigned, type OdeditorUnassigned, type PauseLoyaltyProgramRequest, type PauseLoyaltyProgramResponse, type PicassoAssigned, type PicassoUnassigned, type PointDefinition, type PointsExpiration, type PointsExpirationChanges, type PointsExpirationConfigurationChanged, type PointsExpirationDisabled, type PointsExpirationEnabled, type PremiumFeatures, type ProgramInSite, ProgramStatus, type ProgramStatusWithLiterals, type ProgramUpdatedEnvelope, type QuotaFeature, type QuotaInfo, type ReassignedFromSiteReason, type ReassignedToAnotherSiteReason, type ReplacedByAnotherSubscriptionReason, type RestoreInfo, type ServiceProvisioned, type ServiceRemoved, type SiteCreated, SiteCreatedContext, type SiteCreatedContextWithLiterals, type SiteDeleted, type SiteHardDeleted, type SiteMarkedAsTemplate, type SiteMarkedAsWixSite, type SitePublished, type SitePurgedExternally, type SiteRenamed, type SiteTransferred, type SiteUndeleted, type SiteUnpublished, type SiteUrlChanged, type SocialMediaChannel, type SocialMediaSettings, State, type StateWithLiterals, Status, type StatusWithLiterals, type StudioAssigned, type StudioUnassigned, type TransferredFromAnotherAccountReason, type TransferredToAnotherAccountReason, Type, type TypeWithLiterals, type UnAssingedToFloatingReason, type UpdateLoyaltyProgramDescriptionRequest, type UpdateLoyaltyProgramDescriptionResponse, type UpdateLoyaltyProgramRequest, type UpdateLoyaltyProgramResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, activateLoyaltyProgram, bulkGetLoyaltyProgram, disablePointsExpiration, enablePointsExpiration, getLoyaltyProgram, getLoyaltyProgramPremiumFeatures, onProgramUpdated, pauseLoyaltyProgram, updateLoyaltyProgram };
|