@wix/auto_sdk_loyalty_programs 1.0.22 → 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.
@@ -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 SiteUnpublished as $, type ActivateLoyaltyProgramResponse as A, type BulkGetLoyaltyProgramResponse as B, type GetLoyaltyProgramPremiumFeaturesRequest as C, type DisablePointsExpirationResponse as D, type EnablePointsExpirationResponse as E, FeaturePeriod as F, type GetLoyaltyProgramResponse as G, type EnablePointsExpirationRequest as H, type PointsExpirationEnabled as I, type DisablePointsExpirationRequest as J, type PointsExpirationDisabled as K, type LoyaltyProgram as L, type MetaSiteSpecialEvent as M, Namespace as N, type MetaSiteSpecialEventPayloadOneOf as O, type PauseLoyaltyProgramResponse as P, type Asset as Q, type SiteCreated as R, Status as S, Type as T, type UpdateLoyaltyProgramResponse as U, type SiteTransferred as V, WebhookIdentityType as W, type SiteDeleted as X, type DeleteContext as Y, type SiteUndeleted as Z, type SitePublished as _, type GetLoyaltyProgramPremiumFeaturesResponse as a, type SiteMarkedAsTemplate as a0, type SiteMarkedAsWixSite as a1, type ServiceProvisioned as a2, type ServiceRemoved as a3, type SiteRenamed as a4, type SiteHardDeleted as a5, type NamespaceChanged as a6, type StudioAssigned as a7, type StudioUnassigned as a8, type SiteUrlChanged as a9, type ReplacedByAnotherSubscriptionReason as aA, type ReassignedToAnotherSiteReason as aB, type FeatureUpdated as aC, type FeatureUpdatedPreviousQuantityInfoOneOf as aD, type FeatureUpdatedReasonOneOf as aE, type FeatureCancelled as aF, type FeatureCancelledReasonOneOf as aG, type TransferredToAnotherAccountReason as aH, type CancelRequestedReason as aI, type DomainEvent as aJ, type DomainEventBodyOneOf as aK, type EntityCreatedEvent as aL, type RestoreInfo as aM, type EntityUpdatedEvent as aN, type EntityDeletedEvent as aO, type ActionEvent as aP, type MessageEnvelope as aQ, type IdentificationData as aR, type IdentificationDataIdOneOf as aS, type BaseEventMetadata as aT, type EventMetadata as aU, type SitePurgedExternally as aa, type OdeditorAssigned as ab, type OdeditorUnassigned as ac, type PicassoAssigned as ad, type PicassoUnassigned as ae, type Empty as af, type FeatureEvent as ag, type FeatureEventEventOneOf as ah, type FeatureEnabled as ai, type FeatureEnabledReasonOneOf as aj, type Feature as ak, type FeatureQuantityInfoOneOf as al, type FeatureContext as am, type BooleanFeature as an, type QuotaFeature as ao, type QuotaInfo as ap, type TransferredFromAnotherAccountReason as aq, type ReassignedFromSiteReason as ar, type AssignedFromFloatingReason as as, type NewFeatureReason as at, type ContractSwitchedReason as au, type ManualFeatureCreationReason as av, type MigratedFromLegacyReason as aw, type FeatureDisabled as ax, type FeatureDisabledReasonOneOf as ay, type UnAssingedToFloatingReason as az, type ProgramUpdatedEnvelope as b, ProgramStatus as c, State as d, SiteCreatedContext as e, DeleteStatus as f, type PointDefinition as g, type FocalPoint as h, type PointsExpiration as i, type PremiumFeatures as j, type SocialMediaSettings as k, type SocialMediaChannel as l, type GetLoyaltyProgramRequest as m, type BulkGetLoyaltyProgramRequest as n, type ProgramInSite as o, type UpdateLoyaltyProgramRequest as p, type PointsExpirationConfigurationChanged as q, type PointsExpirationChanges as r, type ActivateLoyaltyProgramRequest as s, type LoyaltyProgramActivated as t, type PauseLoyaltyProgramRequest as u, type GetLoyaltyProgramDescriptionRequest as v, type GetLoyaltyProgramDescriptionResponse as w, type UpdateLoyaltyProgramDescriptionRequest as x, type UpdateLoyaltyProgramDescriptionResponse as y, type LoyaltyProgramDescriptionUpdated as z };
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 };