@wix/auto_sdk_pricing-plans_plans 1.0.63 → 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.
Files changed (29) hide show
  1. package/build/cjs/index.d.ts +45 -13
  2. package/build/cjs/index.js +1 -0
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/{pricing-plans-v2-plan-plans.universal-DwvmTikd.d.ts → index.typings.d.ts} +430 -1
  5. package/build/cjs/index.typings.js +791 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +2 -1
  8. package/build/es/index.d.mts +45 -13
  9. package/build/es/index.mjs +1 -0
  10. package/build/es/index.mjs.map +1 -1
  11. package/build/es/{pricing-plans-v2-plan-plans.universal-DwvmTikd.d.mts → index.typings.d.mts} +430 -1
  12. package/build/es/index.typings.mjs +751 -0
  13. package/build/es/index.typings.mjs.map +1 -0
  14. package/build/es/meta.d.mts +2 -1
  15. package/build/internal/cjs/index.d.ts +45 -13
  16. package/build/internal/cjs/index.js +1 -0
  17. package/build/internal/cjs/index.js.map +1 -1
  18. package/build/internal/cjs/{pricing-plans-v2-plan-plans.universal-DwvmTikd.d.ts → index.typings.d.ts} +430 -1
  19. package/build/internal/cjs/index.typings.js +791 -0
  20. package/build/internal/cjs/index.typings.js.map +1 -0
  21. package/build/internal/cjs/meta.d.ts +2 -1
  22. package/build/internal/es/index.d.mts +45 -13
  23. package/build/internal/es/index.mjs +1 -0
  24. package/build/internal/es/index.mjs.map +1 -1
  25. package/build/internal/es/{pricing-plans-v2-plan-plans.universal-DwvmTikd.d.mts → index.typings.d.mts} +430 -1
  26. package/build/internal/es/index.typings.mjs +751 -0
  27. package/build/internal/es/index.typings.mjs.map +1 -0
  28. package/build/internal/es/meta.d.mts +2 -1
  29. package/package.json +2 -2
@@ -1,14 +1,17 @@
1
- import { HttpClient, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
- import { L as ListPublicPlansOptions, a as ListPublicPlansResponse, P as PlansQueryBuilder, b as Plan, c as ListPlansOptions, d as ListPlansResponse, G as GetPlanStatsResponse, U as UpdatePlan, S as SetPlanVisibilityResponse, M as MakePlanPrimaryResponse, A as ArchivePlanResponse, e as PlanBuyerCanCancelUpdatedEnvelope, f as PlanCreatedEnvelope, g as PlanArchivedEnvelope, h as PlanUpdatedEnvelope } from './pricing-plans-v2-plan-plans.universal-DwvmTikd.js';
3
- export { aj as ActionEvent, a3 as ApplicationError, j as AppliedAt, Z as ArchivePlanRequest, l as ArchivedFilter, a5 as ArrangePlansRequest, a6 as ArrangePlansResponse, an as BaseEventMetadata, a4 as BulkActionMetadata, $ as BulkArchivePlanRequest, a0 as BulkArchivePlanResponse, a1 as BulkPlanResult, O as BuyerCanCancelUpdated, X as ClearPrimaryRequest, Y as ClearPrimaryResponse, a7 as CountPlansRequest, a8 as CountPlansResponse, I as CreatePlanRequest, J as CreatePlanResponse, C as Cursors, ad as DomainEvent, ae as DomainEventBodyOneOf, D as Duration, af as EntityCreatedEvent, ai as EntityDeletedEvent, ah as EntityUpdatedEvent, ao as EventMetadata, r as Fee, F as FeeConfig, z as GetPlanRequest, B as GetPlanResponse, H as GetPlanStatsRequest, a9 as GetPlansPremiumStatusRequest, aa as GetPlansPremiumStatusResponse, al as IdentificationData, am as IdentificationDataIdOneOf, a2 as ItemMetadata, E as ListPlansRequest, s as ListPublicPlansRequest, V as MakePlanPrimaryRequest, ak as MessageEnvelope, q as Money, x as Paging, u as PagingMetadataV2, i as PeriodUnit, _ as PlanArchived, ap as PlansQueryResult, o as Pricing, p as PricingPricingModelOneOf, m as PublicFilter, t as PublicPlan, Q as QueryPublicPlansRequest, y as QueryPublicPlansResponse, v as QueryV2, R as Recurrence, ag as RestoreInfo, ab as SearchPlansRequest, ac as SearchPlansResponse, T as SetPlanVisibilityRequest, k as SortOrder, w as Sorting, n as StringList, K as UpdatePlanRequest, N as UpdatePlanResponse, W as WebhookIdentityType } from './pricing-plans-v2-plan-plans.universal-DwvmTikd.js';
1
+ import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
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
+ 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
+ (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;
14
+ }>;
12
15
  }
13
16
  declare function queryPublicPlans$1(httpClient: HttpClient): QueryPublicPlansSignature;
14
17
  interface QueryPublicPlansSignature {
@@ -39,7 +42,9 @@ interface GetPlanSignature {
39
42
  * @param - Plan ID.
40
43
  * @returns Pricing plan.
41
44
  */
42
- (_id: string): Promise<Plan>;
45
+ (_id: string): Promise<NonNullablePaths<Plan, PlanNonNullablePaths> & {
46
+ __applicationErrorsType?: GetPlanApplicationErrors;
47
+ }>;
43
48
  }
44
49
  declare function listPlans$1(httpClient: HttpClient): ListPlansSignature;
45
50
  interface ListPlansSignature {
@@ -47,14 +52,21 @@ interface ListPlansSignature {
47
52
  * Retrieves a list of up to 100 pricing plans (including public, hidden, and archived plans).
48
53
  * @param - Options for filtering and paging the list of plans.
49
54
  */
50
- (options?: ListPlansOptions | undefined): Promise<ListPlansResponse>;
55
+ (options?: ListPlansOptions): Promise<NonNullablePaths<ListPlansResponse, {
56
+ [P in PlanNonNullablePaths]: `plans.${number}.${P}`;
57
+ }[PlanNonNullablePaths]> & {
58
+ __applicationErrorsType?: ListPlansApplicationErrors;
59
+ __validationErrorsType?: ListPlansValidationErrors;
60
+ }>;
51
61
  }
52
62
  declare function getPlanStats$1(httpClient: HttpClient): GetPlanStatsSignature;
53
63
  interface GetPlanStatsSignature {
54
64
  /**
55
65
  * Gets statistics about the pricing plans. Currently provides only the total number of pricing plans, including archived plans.
56
66
  */
57
- (): Promise<GetPlanStatsResponse>;
67
+ (): Promise<NonNullablePaths<GetPlanStatsResponse, `totalPlans`> & {
68
+ __applicationErrorsType?: GetPlanStatsApplicationErrors;
69
+ }>;
58
70
  }
59
71
  declare function createPlan$1(httpClient: HttpClient): CreatePlanSignature;
60
72
  interface CreatePlanSignature {
@@ -67,7 +79,10 @@ interface CreatePlanSignature {
67
79
  * @param - Information for the plan being created.
68
80
  * @returns Created plan.
69
81
  */
70
- (plan: Plan): Promise<Plan>;
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;
85
+ }>;
71
86
  }
72
87
  declare function updatePlan$1(httpClient: HttpClient): UpdatePlanSignature;
73
88
  interface UpdatePlanSignature {
@@ -78,7 +93,10 @@ interface UpdatePlanSignature {
78
93
  * @param - Options for updating the plan.
79
94
  * @returns Updated plan.
80
95
  */
81
- (_id: string, plan: UpdatePlan): Promise<Plan>;
96
+ (_id: string, plan: UpdatePlan): Promise<NonNullablePaths<Plan, PlanNonNullablePaths> & {
97
+ __applicationErrorsType?: UpdatePlanApplicationErrors;
98
+ __validationErrorsType?: UpdatePlanValidationErrors;
99
+ }>;
82
100
  }
83
101
  declare function setPlanVisibility$1(httpClient: HttpClient): SetPlanVisibilitySignature;
84
102
  interface SetPlanVisibilitySignature {
@@ -91,7 +109,11 @@ interface SetPlanVisibilitySignature {
91
109
  * @param - The ID of the plan to either display or hide on the site page.
92
110
  * @param - Plan visibility options.
93
111
  */
94
- (_id: string, visible: boolean): Promise<SetPlanVisibilityResponse>;
112
+ (_id: string, visible: boolean): Promise<NonNullablePaths<SetPlanVisibilityResponse, {
113
+ [P in PlanNonNullablePaths]: `plan.${P}`;
114
+ }[PlanNonNullablePaths]> & {
115
+ __applicationErrorsType?: SetPlanVisibilityApplicationErrors;
116
+ }>;
95
117
  }
96
118
  declare function makePlanPrimary$1(httpClient: HttpClient): MakePlanPrimarySignature;
97
119
  interface MakePlanPrimarySignature {
@@ -99,14 +121,20 @@ interface MakePlanPrimarySignature {
99
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.
100
122
  * @param - ID of the pricing plan to set as the primary plan.
101
123
  */
102
- (_id: string): Promise<MakePlanPrimaryResponse>;
124
+ (_id: string): Promise<NonNullablePaths<MakePlanPrimaryResponse, {
125
+ [P in PlanNonNullablePaths]: `plan.${P}`;
126
+ }[PlanNonNullablePaths]> & {
127
+ __applicationErrorsType?: MakePlanPrimaryApplicationErrors;
128
+ }>;
103
129
  }
104
130
  declare function clearPrimary$1(httpClient: HttpClient): ClearPrimarySignature;
105
131
  interface ClearPrimarySignature {
106
132
  /**
107
133
  * Sets all pricing plans as not primary. When viewing pricing plans on a site, no plan is highlighted with a customizable ribbon.
108
134
  */
109
- (): Promise<void>;
135
+ (): Promise<void & {
136
+ __applicationErrorsType?: ClearPrimaryApplicationErrors;
137
+ }>;
110
138
  }
111
139
  declare function archivePlan$1(httpClient: HttpClient): ArchivePlanSignature;
112
140
  interface ArchivePlanSignature {
@@ -120,7 +148,11 @@ interface ArchivePlanSignature {
120
148
  * > **Note:** An attempt to archive an already-archived plan throws an error.
121
149
  * @param - ID of the active plan to archive.
122
150
  */
123
- (_id: string): Promise<ArchivePlanResponse>;
151
+ (_id: string): Promise<NonNullablePaths<ArchivePlanResponse, {
152
+ [P in PlanNonNullablePaths]: `plan.${P}`;
153
+ }[PlanNonNullablePaths]> & {
154
+ __applicationErrorsType?: ArchivePlanApplicationErrors;
155
+ }>;
124
156
  }
125
157
  declare const onPlanBuyerCanCancelUpdated$1: EventDefinition<PlanBuyerCanCancelUpdatedEnvelope, "wix.pricing_plans.plan_buyer_can_cancel_updated">;
126
158
  declare const onPlanCreated$1: EventDefinition<PlanCreatedEnvelope, "wix.pricing_plans.plan_created">;
@@ -740,6 +740,7 @@ async function clearPrimary2() {
740
740
  try {
741
741
  const result = await httpClient.request(reqOpts);
742
742
  sideEffects?.onSuccess?.(result);
743
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
743
744
  } catch (err) {
744
745
  const transformedError = (0, import_transform_error.transformError)(
745
746
  err,