@wix/auto_sdk_pricing-plans_plans 1.0.64 → 1.0.65

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 { 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.
9
10
  * @param - Options for filtering and paging the list of public plans.
10
11
  */
11
- (options?: ListPublicPlansOptions | undefined): Promise<ListPublicPlansResponse & {
12
- __applicationErrorsType?: ListPublicPlansApplicationErrors | undefined;
12
+ (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`> & {
13
+ __applicationErrorsType?: ListPublicPlansApplicationErrors;
13
14
  }>;
14
15
  }
15
16
  declare function queryPublicPlans$1(httpClient: HttpClient): QueryPublicPlansSignature;
@@ -41,8 +42,8 @@ interface GetPlanSignature {
41
42
  * @param - Plan ID.
42
43
  * @returns Pricing plan.
43
44
  */
44
- (_id: string): Promise<Plan & {
45
- __applicationErrorsType?: GetPlanApplicationErrors | undefined;
45
+ (_id: string): Promise<NonNullablePaths<Plan, PlanNonNullablePaths> & {
46
+ __applicationErrorsType?: GetPlanApplicationErrors;
46
47
  }>;
47
48
  }
48
49
  declare function listPlans$1(httpClient: HttpClient): ListPlansSignature;
@@ -51,9 +52,11 @@ interface ListPlansSignature {
51
52
  * Retrieves a list of up to 100 pricing plans (including public, hidden, and archived plans).
52
53
  * @param - Options for filtering and paging the list of plans.
53
54
  */
54
- (options?: ListPlansOptions | undefined): Promise<ListPlansResponse & {
55
- __applicationErrorsType?: ListPlansApplicationErrors | undefined;
56
- __validationErrorsType?: ListPlansValidationErrors | undefined;
55
+ (options?: ListPlansOptions): Promise<NonNullablePaths<ListPlansResponse, {
56
+ [P in PlanNonNullablePaths]: `plans.${number}.${P}`;
57
+ }[PlanNonNullablePaths]> & {
58
+ __applicationErrorsType?: ListPlansApplicationErrors;
59
+ __validationErrorsType?: ListPlansValidationErrors;
57
60
  }>;
58
61
  }
59
62
  declare function getPlanStats$1(httpClient: HttpClient): GetPlanStatsSignature;
@@ -61,8 +64,8 @@ interface GetPlanStatsSignature {
61
64
  /**
62
65
  * Gets statistics about the pricing plans. Currently provides only the total number of pricing plans, including archived plans.
63
66
  */
64
- (): Promise<GetPlanStatsResponse & {
65
- __applicationErrorsType?: GetPlanStatsApplicationErrors | undefined;
67
+ (): Promise<NonNullablePaths<GetPlanStatsResponse, `totalPlans`> & {
68
+ __applicationErrorsType?: GetPlanStatsApplicationErrors;
66
69
  }>;
67
70
  }
68
71
  declare function createPlan$1(httpClient: HttpClient): CreatePlanSignature;
@@ -76,9 +79,9 @@ interface CreatePlanSignature {
76
79
  * @param - Information for the plan being created.
77
80
  * @returns Created plan.
78
81
  */
79
- (plan: Plan): Promise<Plan & {
80
- __applicationErrorsType?: CreatePlanApplicationErrors | undefined;
81
- __validationErrorsType?: CreatePlanValidationErrors | undefined;
82
+ (plan: NonNullablePaths<Plan, `name` | `pricing` | `pricing.singlePaymentForDuration.count` | `pricing.subscription.cycleCount` | `pricing.subscription.cycleDuration` | `pricing.subscription.cycleDuration.count`>): Promise<NonNullablePaths<Plan, PlanNonNullablePaths> & {
83
+ __applicationErrorsType?: CreatePlanApplicationErrors;
84
+ __validationErrorsType?: CreatePlanValidationErrors;
82
85
  }>;
83
86
  }
84
87
  declare function updatePlan$1(httpClient: HttpClient): UpdatePlanSignature;
@@ -90,9 +93,9 @@ interface UpdatePlanSignature {
90
93
  * @param - Options for updating the plan.
91
94
  * @returns Updated plan.
92
95
  */
93
- (_id: string, plan: UpdatePlan): Promise<Plan & {
94
- __applicationErrorsType?: UpdatePlanApplicationErrors | undefined;
95
- __validationErrorsType?: UpdatePlanValidationErrors | undefined;
96
+ (_id: string, plan: UpdatePlan): Promise<NonNullablePaths<Plan, PlanNonNullablePaths> & {
97
+ __applicationErrorsType?: UpdatePlanApplicationErrors;
98
+ __validationErrorsType?: UpdatePlanValidationErrors;
96
99
  }>;
97
100
  }
98
101
  declare function setPlanVisibility$1(httpClient: HttpClient): SetPlanVisibilitySignature;
@@ -106,8 +109,10 @@ interface SetPlanVisibilitySignature {
106
109
  * @param - The ID of the plan to either display or hide on the site page.
107
110
  * @param - Plan visibility options.
108
111
  */
109
- (_id: string, visible: boolean): Promise<SetPlanVisibilityResponse & {
110
- __applicationErrorsType?: SetPlanVisibilityApplicationErrors | undefined;
112
+ (_id: string, visible: boolean): Promise<NonNullablePaths<SetPlanVisibilityResponse, {
113
+ [P in PlanNonNullablePaths]: `plan.${P}`;
114
+ }[PlanNonNullablePaths]> & {
115
+ __applicationErrorsType?: SetPlanVisibilityApplicationErrors;
111
116
  }>;
112
117
  }
113
118
  declare function makePlanPrimary$1(httpClient: HttpClient): MakePlanPrimarySignature;
@@ -116,8 +121,10 @@ interface MakePlanPrimarySignature {
116
121
  * 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.
117
122
  * @param - ID of the pricing plan to set as the primary plan.
118
123
  */
119
- (_id: string): Promise<MakePlanPrimaryResponse & {
120
- __applicationErrorsType?: MakePlanPrimaryApplicationErrors | undefined;
124
+ (_id: string): Promise<NonNullablePaths<MakePlanPrimaryResponse, {
125
+ [P in PlanNonNullablePaths]: `plan.${P}`;
126
+ }[PlanNonNullablePaths]> & {
127
+ __applicationErrorsType?: MakePlanPrimaryApplicationErrors;
121
128
  }>;
122
129
  }
123
130
  declare function clearPrimary$1(httpClient: HttpClient): ClearPrimarySignature;
@@ -126,7 +133,7 @@ interface ClearPrimarySignature {
126
133
  * Sets all pricing plans as not primary. When viewing pricing plans on a site, no plan is highlighted with a customizable ribbon.
127
134
  */
128
135
  (): Promise<void & {
129
- __applicationErrorsType?: ClearPrimaryApplicationErrors | undefined;
136
+ __applicationErrorsType?: ClearPrimaryApplicationErrors;
130
137
  }>;
131
138
  }
132
139
  declare function archivePlan$1(httpClient: HttpClient): ArchivePlanSignature;
@@ -141,8 +148,10 @@ interface ArchivePlanSignature {
141
148
  * > **Note:** An attempt to archive an already-archived plan throws an error.
142
149
  * @param - ID of the active plan to archive.
143
150
  */
144
- (_id: string): Promise<ArchivePlanResponse & {
145
- __applicationErrorsType?: ArchivePlanApplicationErrors | undefined;
151
+ (_id: string): Promise<NonNullablePaths<ArchivePlanResponse, {
152
+ [P in PlanNonNullablePaths]: `plan.${P}`;
153
+ }[PlanNonNullablePaths]> & {
154
+ __applicationErrorsType?: ArchivePlanApplicationErrors;
146
155
  }>;
147
156
  }
148
157
  declare const onPlanBuyerCanCancelUpdated$1: EventDefinition<PlanBuyerCanCancelUpdatedEnvelope, "wix.pricing_plans.plan_buyer_can_cancel_updated">;