@wix/auto_sdk_loyalty_programs 1.0.24 → 1.0.26

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,15 +1,16 @@
1
- import { HttpClient, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
1
+ import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
2
  import { GetLoyaltyProgramResponse, BulkGetLoyaltyProgramResponse, LoyaltyProgram, UpdateLoyaltyProgramResponse, ActivateLoyaltyProgramResponse, PauseLoyaltyProgramResponse, GetLoyaltyProgramPremiumFeaturesResponse, EnablePointsExpirationResponse, DisablePointsExpirationResponse, ProgramUpdatedEnvelope } from './index.typings.js';
3
3
  export { ActionEvent, ActivateLoyaltyProgramRequest, Asset, AssignedFromFloatingReason, BaseEventMetadata, BooleanFeature, BulkGetLoyaltyProgramRequest, CancelRequestedReason, ContractSwitchedReason, DeleteContext, DeleteStatus, DisablePointsExpirationRequest, DomainEvent, DomainEventBodyOneOf, Empty, EnablePointsExpirationRequest, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, Feature, FeatureCancelled, FeatureCancelledReasonOneOf, FeatureContext, FeatureDisabled, FeatureDisabledReasonOneOf, FeatureEnabled, FeatureEnabledReasonOneOf, FeatureEvent, FeatureEventEventOneOf, FeaturePeriod, FeatureQuantityInfoOneOf, FeatureUpdated, FeatureUpdatedPreviousQuantityInfoOneOf, FeatureUpdatedReasonOneOf, FocalPoint, GetLoyaltyProgramDescriptionRequest, GetLoyaltyProgramDescriptionResponse, GetLoyaltyProgramPremiumFeaturesRequest, GetLoyaltyProgramRequest, IdentificationData, IdentificationDataIdOneOf, LoyaltyProgramActivated, LoyaltyProgramDescriptionUpdated, ManualFeatureCreationReason, MessageEnvelope, MetaSiteSpecialEvent, MetaSiteSpecialEventPayloadOneOf, MigratedFromLegacyReason, Namespace, NamespaceChanged, NewFeatureReason, OdeditorAssigned, OdeditorUnassigned, PauseLoyaltyProgramRequest, PicassoAssigned, PicassoUnassigned, PointDefinition, PointsExpiration, PointsExpirationChanges, PointsExpirationConfigurationChanged, PointsExpirationDisabled, PointsExpirationEnabled, PremiumFeatures, ProgramInSite, ProgramStatus, QuotaFeature, QuotaInfo, ReassignedFromSiteReason, ReassignedToAnotherSiteReason, ReplacedByAnotherSubscriptionReason, RestoreInfo, ServiceProvisioned, ServiceRemoved, SiteCreated, SiteCreatedContext, SiteDeleted, SiteHardDeleted, SiteMarkedAsTemplate, SiteMarkedAsWixSite, SitePublished, SitePurgedExternally, SiteRenamed, SiteTransferred, SiteUndeleted, SiteUnpublished, SiteUrlChanged, SocialMediaChannel, SocialMediaSettings, State, Status, StudioAssigned, StudioUnassigned, TransferredFromAnotherAccountReason, TransferredToAnotherAccountReason, Type, UnAssingedToFloatingReason, UpdateLoyaltyProgramDescriptionRequest, UpdateLoyaltyProgramDescriptionResponse, UpdateLoyaltyProgramRequest, WebhookIdentityType } from './index.typings.js';
4
4
 
5
+ type ProgramNonNullablePaths = `status` | `pointsExpiration.status` | `pointsExpiration.monthsOfInactivity` | `pointsExpiration.expiringPointsPercentage` | `premiumFeatures.loyaltyProgram` | `premiumFeatures.tiers` | `premiumFeatures.pointsExpiration`;
5
6
  declare function getLoyaltyProgram$1(httpClient: HttpClient): GetLoyaltyProgramSignature;
6
7
  interface GetLoyaltyProgramSignature {
7
8
  /**
8
- * Retrieves the site's loyalty program.
9
- *
10
- * The `getLoyaltyProgram()` function returns a Promise that resolves to the site's loyalty program.
9
+ * Retrieves the loyalty program.
11
10
  */
12
- (): Promise<GetLoyaltyProgramResponse>;
11
+ (): Promise<NonNullablePaths<GetLoyaltyProgramResponse, {
12
+ [P in ProgramNonNullablePaths]: `loyaltyProgram.${P}`;
13
+ }[ProgramNonNullablePaths]>>;
13
14
  }
14
15
  declare function bulkGetLoyaltyProgram$1(httpClient: HttpClient): BulkGetLoyaltyProgramSignature;
15
16
  interface BulkGetLoyaltyProgramSignature {
@@ -18,70 +19,66 @@ interface BulkGetLoyaltyProgramSignature {
18
19
  *
19
20
  * Must be called with user identity.
20
21
  */
21
- (): Promise<BulkGetLoyaltyProgramResponse>;
22
+ (): Promise<NonNullablePaths<BulkGetLoyaltyProgramResponse, `programInSites` | `programInSites.${number}.metaSiteId` | {
23
+ [P in ProgramNonNullablePaths]: `programInSites.${number}.loyaltyProgram.${P}`;
24
+ }[ProgramNonNullablePaths]>>;
22
25
  }
23
26
  declare function updateLoyaltyProgram$1(httpClient: HttpClient): UpdateLoyaltyProgramSignature;
24
27
  interface UpdateLoyaltyProgramSignature {
25
28
  /**
26
- * Updates the site's loyalty program.
27
- *
28
- * The `updateLoyaltyProgram()` function returns a Promise that resolves when the loyalty program is updated.
29
+ * Updates the loyalty program.
29
30
  *
30
- * 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.
31
- *
32
- * >**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.
31
+ * You cannot activate the loyalty program using this endpoint. To do so, use the [Activate Loyalty Program endpoint](https://dev.wix.com/api/rest/wix-loyalty-program/program/activate-loyalty-program).
33
32
  * @param - Loyalty program fields to update.
34
33
  */
35
- (loyaltyProgram: LoyaltyProgram): Promise<UpdateLoyaltyProgramResponse>;
34
+ (loyaltyProgram: LoyaltyProgram): Promise<NonNullablePaths<UpdateLoyaltyProgramResponse, {
35
+ [P in ProgramNonNullablePaths]: `loyaltyProgram.${P}`;
36
+ }[ProgramNonNullablePaths]>>;
36
37
  }
37
38
  declare function activateLoyaltyProgram$1(httpClient: HttpClient): ActivateLoyaltyProgramSignature;
38
39
  interface ActivateLoyaltyProgramSignature {
39
40
  /**
40
41
  * Activates a loyalty program.
41
42
  *
42
- * The `activateLoyaltyProgram()` function returns a Promise that resolves when the status of the loyalty program is successfully changed to `"ACTIVE"`.
43
- *
44
- * 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"`.
45
- *
46
- * 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.
47
- *
48
- * To temporarily pause your loyalty program you must follow three steps:
49
- * 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/).
50
- * 1. Hide the loyalty page from your site.
51
- * 1. Delete the My Rewards page from the Member pages.
52
- * See [Pausing Your Loyalty Program](https://support.wix.com/en/article/wix-loyalty-program-pausing-your-loyalty-program) for more information.
53
- *
54
- * >**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.
43
+ * When a loyalty program is installed it starts in `DRAFT` status. Customers cannot earn or redeem points while the program is not `ACTIVE`.
55
44
  */
56
- (): Promise<ActivateLoyaltyProgramResponse>;
45
+ (): Promise<NonNullablePaths<ActivateLoyaltyProgramResponse, {
46
+ [P in ProgramNonNullablePaths]: `loyaltyProgram.${P}`;
47
+ }[ProgramNonNullablePaths]>>;
57
48
  }
58
49
  declare function pauseLoyaltyProgram$1(httpClient: HttpClient): PauseLoyaltyProgramSignature;
59
50
  interface PauseLoyaltyProgramSignature {
60
51
  /**
61
52
  * Changes the program status to `PAUSED`.
62
53
  */
63
- (): Promise<PauseLoyaltyProgramResponse>;
54
+ (): Promise<NonNullablePaths<PauseLoyaltyProgramResponse, {
55
+ [P in ProgramNonNullablePaths]: `loyaltyProgram.${P}`;
56
+ }[ProgramNonNullablePaths]>>;
64
57
  }
65
58
  declare function getLoyaltyProgramPremiumFeatures$1(httpClient: HttpClient): GetLoyaltyProgramPremiumFeaturesSignature;
66
59
  interface GetLoyaltyProgramPremiumFeaturesSignature {
67
60
  /**
68
61
  * Retrieves information about the available loyalty program premium features.
69
62
  */
70
- (): Promise<GetLoyaltyProgramPremiumFeaturesResponse>;
63
+ (): Promise<NonNullablePaths<GetLoyaltyProgramPremiumFeaturesResponse, `loyaltyProgram` | `tiers` | `pointsExpiration`>>;
71
64
  }
72
65
  declare function enablePointsExpiration$1(httpClient: HttpClient): EnablePointsExpirationSignature;
73
66
  interface EnablePointsExpirationSignature {
74
67
  /**
75
68
  * Updates the `pointsExpiration` status to `ENABLED`.
76
69
  */
77
- (): Promise<EnablePointsExpirationResponse>;
70
+ (): Promise<NonNullablePaths<EnablePointsExpirationResponse, {
71
+ [P in ProgramNonNullablePaths]: `loyaltyProgram.${P}`;
72
+ }[ProgramNonNullablePaths]>>;
78
73
  }
79
74
  declare function disablePointsExpiration$1(httpClient: HttpClient): DisablePointsExpirationSignature;
80
75
  interface DisablePointsExpirationSignature {
81
76
  /**
82
77
  * Updates the `pointsExpiration` status to `DISABLED`.
83
78
  */
84
- (): Promise<DisablePointsExpirationResponse>;
79
+ (): Promise<NonNullablePaths<DisablePointsExpirationResponse, {
80
+ [P in ProgramNonNullablePaths]: `loyaltyProgram.${P}`;
81
+ }[ProgramNonNullablePaths]>>;
85
82
  }
86
83
  declare const onProgramUpdated$1: EventDefinition<ProgramUpdatedEnvelope, "wix.loyalty.v1.program_updated">;
87
84