@wix/auto_sdk_pricing-plans_plans 1.0.64 → 1.0.66

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,18 @@
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 { ListPublicPlansOptions, ListPublicPlansResponse, ListPublicPlansApplicationErrors, PlansQueryBuilder, Plan, GetPlanApplicationErrors, ListPlansOptions, ListPlansResponse, ListPlansApplicationErrors, ListPlansValidationErrors, GetPlanStatsResponse, GetPlanStatsApplicationErrors, CreatePlanApplicationErrors, CreatePlanValidationErrors, UpdatePlan, UpdatePlanApplicationErrors, UpdatePlanValidationErrors, SetPlanVisibilityResponse, SetPlanVisibilityApplicationErrors, MakePlanPrimaryResponse, MakePlanPrimaryApplicationErrors, ClearPrimaryApplicationErrors, ArchivePlanResponse, ArchivePlanApplicationErrors, PlanBuyerCanCancelUpdatedEnvelope, PlanCreatedEnvelope, PlanArchivedEnvelope, PlanUpdatedEnvelope } from './index.typings.js';
3
3
  export { ActionEvent, ApplicationError, AppliedAt, ArchivePlanRequest, ArchivedFilter, ArrangePlansRequest, ArrangePlansResponse, BaseEventMetadata, BulkActionMetadata, BulkArchivePlanRequest, BulkArchivePlanResponse, BulkPlanResult, BuyerCanCancelUpdated, ClearPrimaryRequest, ClearPrimaryResponse, CountPlansRequest, CountPlansResponse, CreatePlanRequest, CreatePlanResponse, Cursors, DomainEvent, DomainEventBodyOneOf, Duration, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, Fee, FeeConfig, GetPlanRequest, GetPlanResponse, GetPlanStatsRequest, GetPlansPremiumStatusRequest, GetPlansPremiumStatusResponse, IdentificationData, IdentificationDataIdOneOf, ItemMetadata, ListPlansRequest, ListPublicPlansRequest, MakePlanPrimaryRequest, MessageEnvelope, Money, Paging, PagingMetadataV2, PeriodUnit, PlanArchived, PlansQueryResult, Pricing, PricingPricingModelOneOf, PublicFilter, PublicPlan, QueryPublicPlansRequest, QueryPublicPlansResponse, QueryV2, Recurrence, RestoreInfo, SearchPlansRequest, SearchPlansResponse, SetPlanVisibilityRequest, SortOrder, Sorting, StringList, UpdatePlanRequest, UpdatePlanResponse, WebhookIdentityType } from './index.typings.js';
4
4
 
5
+ type PlanNonNullablePaths = `_id` | `perks.values` | `pricing.subscription.cycleDuration.unit` | `pricing.price.value` | `pricing.price.currency` | `archived` | `primary` | `hasOrders`;
5
6
  declare function listPublicPlans$1(httpClient: HttpClient): ListPublicPlansSignature;
6
7
  interface ListPublicPlansSignature {
7
8
  /**
8
9
  * Retrieves a list of up to 100 public pricing plans. Public plans are visible plans that are available to site visitors and can be purchased.
10
+ * Deprecated: use QueryPlans or SearchPlans with visibility set to PUBLIC and archived set to false in the filter.
9
11
  * @param - Options for filtering and paging the list of public plans.
12
+ * @deprecated
10
13
  */
11
- (options?: ListPublicPlansOptions | undefined): Promise<ListPublicPlansResponse & {
12
- __applicationErrorsType?: ListPublicPlansApplicationErrors | undefined;
14
+ (options?: ListPublicPlansOptions): Promise<NonNullablePaths<ListPublicPlansResponse, `plans` | `plans.${number}._id` | `plans.${number}.pricing.subscription.cycleDuration.unit` | `plans.${number}.pricing.price.value` | `plans.${number}.pricing.price.currency` | `plans.${number}.primary`> & {
15
+ __applicationErrorsType?: ListPublicPlansApplicationErrors;
13
16
  }>;
14
17
  }
15
18
  declare function queryPublicPlans$1(httpClient: HttpClient): QueryPublicPlansSignature;
@@ -31,6 +34,7 @@ interface QueryPublicPlansSignature {
31
34
  * The methods that are chained to `queryPublicPlans()` are applied in the order they are called. For example, if you sort on the `_createdDate` property in ascending order and then on the `_id` property in ascending order, the results are sorted first by the created date of the items and then, if there are multiple results with the same date, the items are sorted by `_id` in ascending order, per created date value.
32
35
  *
33
36
  * The following `PublicPlansQueryBuilder` methods are supported for the `queryPublicPlans()` method. For a full description of the Plans object, see the object returned for the [`items`](#plansqueryresult/items) property in [`PublicPlansQueryResult`](#plansqueryresult).
37
+ * @deprecated
34
38
  */
35
39
  (): PlansQueryBuilder;
36
40
  }
@@ -40,29 +44,36 @@ interface GetPlanSignature {
40
44
  * Retrieves a pricing plan by ID.
41
45
  * @param - Plan ID.
42
46
  * @returns Pricing plan.
47
+ * @deprecated
43
48
  */
44
- (_id: string): Promise<Plan & {
45
- __applicationErrorsType?: GetPlanApplicationErrors | undefined;
49
+ (_id: string): Promise<NonNullablePaths<Plan, PlanNonNullablePaths> & {
50
+ __applicationErrorsType?: GetPlanApplicationErrors;
46
51
  }>;
47
52
  }
48
53
  declare function listPlans$1(httpClient: HttpClient): ListPlansSignature;
49
54
  interface ListPlansSignature {
50
55
  /**
51
56
  * Retrieves a list of up to 100 pricing plans (including public, hidden, and archived plans).
57
+ * Deprecated: use QueryPlans or SearchPlans instead.
52
58
  * @param - Options for filtering and paging the list of plans.
59
+ * @deprecated
53
60
  */
54
- (options?: ListPlansOptions | undefined): Promise<ListPlansResponse & {
55
- __applicationErrorsType?: ListPlansApplicationErrors | undefined;
56
- __validationErrorsType?: ListPlansValidationErrors | undefined;
61
+ (options?: ListPlansOptions): Promise<NonNullablePaths<ListPlansResponse, {
62
+ [P in PlanNonNullablePaths]: `plans.${number}.${P}`;
63
+ }[PlanNonNullablePaths]> & {
64
+ __applicationErrorsType?: ListPlansApplicationErrors;
65
+ __validationErrorsType?: ListPlansValidationErrors;
57
66
  }>;
58
67
  }
59
68
  declare function getPlanStats$1(httpClient: HttpClient): GetPlanStatsSignature;
60
69
  interface GetPlanStatsSignature {
61
70
  /**
62
71
  * Gets statistics about the pricing plans. Currently provides only the total number of pricing plans, including archived plans.
72
+ * Deprecated: use CountPlans instead in order to retrieve the total number of pricing plans.
73
+ * @deprecated
63
74
  */
64
- (): Promise<GetPlanStatsResponse & {
65
- __applicationErrorsType?: GetPlanStatsApplicationErrors | undefined;
75
+ (): Promise<NonNullablePaths<GetPlanStatsResponse, `totalPlans`> & {
76
+ __applicationErrorsType?: GetPlanStatsApplicationErrors;
66
77
  }>;
67
78
  }
68
79
  declare function createPlan$1(httpClient: HttpClient): CreatePlanSignature;
@@ -75,10 +86,11 @@ interface CreatePlanSignature {
75
86
  * Pricing plans are available to the Wix user in the Pricing Plans section in a site's dashboard.
76
87
  * @param - Information for the plan being created.
77
88
  * @returns Created plan.
89
+ * @deprecated
78
90
  */
79
- (plan: Plan): Promise<Plan & {
80
- __applicationErrorsType?: CreatePlanApplicationErrors | undefined;
81
- __validationErrorsType?: CreatePlanValidationErrors | undefined;
91
+ (plan: NonNullablePaths<Plan, `name` | `pricing` | `pricing.singlePaymentForDuration.count` | `pricing.subscription.cycleCount` | `pricing.subscription.cycleDuration` | `pricing.subscription.cycleDuration.count`>): Promise<NonNullablePaths<Plan, PlanNonNullablePaths> & {
92
+ __applicationErrorsType?: CreatePlanApplicationErrors;
93
+ __validationErrorsType?: CreatePlanValidationErrors;
82
94
  }>;
83
95
  }
84
96
  declare function updatePlan$1(httpClient: HttpClient): UpdatePlanSignature;
@@ -89,10 +101,11 @@ interface UpdatePlanSignature {
89
101
  * @param - ID of the plan to update.
90
102
  * @param - Options for updating the plan.
91
103
  * @returns Updated plan.
104
+ * @deprecated
92
105
  */
93
- (_id: string, plan: UpdatePlan): Promise<Plan & {
94
- __applicationErrorsType?: UpdatePlanApplicationErrors | undefined;
95
- __validationErrorsType?: UpdatePlanValidationErrors | undefined;
106
+ (_id: string, plan: UpdatePlan): Promise<NonNullablePaths<Plan, PlanNonNullablePaths> & {
107
+ __applicationErrorsType?: UpdatePlanApplicationErrors;
108
+ __validationErrorsType?: UpdatePlanValidationErrors;
96
109
  }>;
97
110
  }
98
111
  declare function setPlanVisibility$1(httpClient: HttpClient): SetPlanVisibilitySignature;
@@ -102,47 +115,58 @@ interface SetPlanVisibilitySignature {
102
115
  * By default, pricing plans are public, meaning they are visible. Plans can be hidden so that site members and visitors can't choose them.
103
116
  * As opposed to archiving, setting visibility can be reversed. This means that a public plan can be hidden, and a hidden plan can be made public (visible). (An archived plan always remains archived and can't be made active again.)
104
117
  * Changing a plan’s visibility doesn't impact existing orders for the plan. All orders for hidden plans are still active and keep their perks.
118
+ * Deprecated: use UpdatePlan with visibility parameter in the request instead.
105
119
  * @param - Whether a plan is visible to members and site visitors. Updates the `public` field.
106
120
  * @param - The ID of the plan to either display or hide on the site page.
107
121
  * @param - Plan visibility options.
122
+ * @deprecated
108
123
  */
109
- (_id: string, visible: boolean): Promise<SetPlanVisibilityResponse & {
110
- __applicationErrorsType?: SetPlanVisibilityApplicationErrors | undefined;
124
+ (_id: string, visible: boolean): Promise<NonNullablePaths<SetPlanVisibilityResponse, {
125
+ [P in PlanNonNullablePaths]: `plan.${P}`;
126
+ }[PlanNonNullablePaths]> & {
127
+ __applicationErrorsType?: SetPlanVisibilityApplicationErrors;
111
128
  }>;
112
129
  }
113
130
  declare function makePlanPrimary$1(httpClient: HttpClient): MakePlanPrimarySignature;
114
131
  interface MakePlanPrimarySignature {
115
132
  /**
116
133
  * Marks a pricing plan as the primary pricing plan. When viewing pricing plans on a site, the primary plan is highlighted with a customizable ribbon. Only a single plan can be marked as a primary plan at any given time. If there is an existing plan marked as primary, calling Make Plan Primary causes the existing primary plan to lose its primary status.
134
+ * Deprecated: Use QueryPlans along with BulkUpdatePlans instead.
135
+ * First, use QueryPlans with the primary set to true in the filter to retrieve existing plans and identify the primary ones.
136
+ * Then, use BulkUpdatePlans to set the new plan as primary and remove the primary setting from the existing one.
117
137
  * @param - ID of the pricing plan to set as the primary plan.
138
+ * @deprecated
118
139
  */
119
- (_id: string): Promise<MakePlanPrimaryResponse & {
120
- __applicationErrorsType?: MakePlanPrimaryApplicationErrors | undefined;
140
+ (_id: string): Promise<NonNullablePaths<MakePlanPrimaryResponse, {
141
+ [P in PlanNonNullablePaths]: `plan.${P}`;
142
+ }[PlanNonNullablePaths]> & {
143
+ __applicationErrorsType?: MakePlanPrimaryApplicationErrors;
121
144
  }>;
122
145
  }
123
146
  declare function clearPrimary$1(httpClient: HttpClient): ClearPrimarySignature;
124
147
  interface ClearPrimarySignature {
125
148
  /**
126
149
  * Sets all pricing plans as not primary. When viewing pricing plans on a site, no plan is highlighted with a customizable ribbon.
150
+ * Deprecated: Use QueryPlans along with BulkUpdatePlans instead.
151
+ * First, use QueryPlans with the primary set to true in the filter to retrieve existing plans and identify the primary ones.
152
+ * Then, use BulkUpdatePlans to remove the primary setting from all primary plans.
153
+ * @deprecated
127
154
  */
128
155
  (): Promise<void & {
129
- __applicationErrorsType?: ClearPrimaryApplicationErrors | undefined;
156
+ __applicationErrorsType?: ClearPrimaryApplicationErrors;
130
157
  }>;
131
158
  }
132
159
  declare function archivePlan$1(httpClient: HttpClient): ArchivePlanSignature;
133
160
  interface ArchivePlanSignature {
134
161
  /**
135
- * Archives a single plan.
136
- * When a plan is archived, it's no longer visible as a public plan that can be chosen by site members or visitors.
137
- * This is because the plan's `public` property is automatically set to `false`.
138
- * Archived plans can't be purchased or reactivated.
139
- * Plan archiving doesn't impact existing orders made for the plan. All orders for the plan are still active and keep their perks, payment options, and terms.
140
- * Wix users can see archived plans in a site's dashboard under **Pricing Plans -> Archived Plans**.
141
- * > **Note:** An attempt to archive an already-archived plan throws an error.
162
+ * Deprecated: Use UpdatePlan with archived set to true instead.
142
163
  * @param - ID of the active plan to archive.
164
+ * @deprecated
143
165
  */
144
- (_id: string): Promise<ArchivePlanResponse & {
145
- __applicationErrorsType?: ArchivePlanApplicationErrors | undefined;
166
+ (_id: string): Promise<NonNullablePaths<ArchivePlanResponse, {
167
+ [P in PlanNonNullablePaths]: `plan.${P}`;
168
+ }[PlanNonNullablePaths]> & {
169
+ __applicationErrorsType?: ArchivePlanApplicationErrors;
146
170
  }>;
147
171
  }
148
172
  declare const onPlanBuyerCanCancelUpdated$1: EventDefinition<PlanBuyerCanCancelUpdatedEnvelope, "wix.pricing_plans.plan_buyer_can_cancel_updated">;
@@ -163,6 +187,7 @@ declare const clearPrimary: MaybeContext<BuildRESTFunction<typeof clearPrimary$1
163
187
  declare const archivePlan: MaybeContext<BuildRESTFunction<typeof archivePlan$1> & typeof archivePlan$1>;
164
188
  /**
165
189
  * Triggered when a plan's `buyerCanCancel` field is updated.
190
+ * @deprecated
166
191
  */
167
192
  declare const onPlanBuyerCanCancelUpdated: BuildEventDefinition<typeof onPlanBuyerCanCancelUpdated$1>;
168
193
  /**
@@ -171,6 +196,7 @@ declare const onPlanBuyerCanCancelUpdated: BuildEventDefinition<typeof onPlanBuy
171
196
  declare const onPlanCreated: BuildEventDefinition<typeof onPlanCreated$1>;
172
197
  /**
173
198
  * Triggered when a pricing plan is archived.
199
+ * @deprecated
174
200
  */
175
201
  declare const onPlanArchived: BuildEventDefinition<typeof onPlanArchived$1>;
176
202
  /**