@wix/auto_sdk_pricing-plans_plans 1.0.84 → 1.0.86

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,6 +1,6 @@
1
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.mjs';
3
- export { ActionEvent, ApplicationError, AppliedAt, AppliedAtWithLiterals, ArchivePlanRequest, ArchivedFilter, ArchivedFilterWithLiterals, 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, PeriodUnitWithLiterals, PlanArchived, PlansQueryResult, Pricing, PricingPricingModelOneOf, PublicFilter, PublicFilterWithLiterals, PublicPlan, QueryPublicPlansApplicationErrors, QueryPublicPlansRequest, QueryPublicPlansResponse, QueryPublicPlansValidationErrors, QueryV2, Recurrence, RestoreInfo, SearchPlansRequest, SearchPlansResponse, SetPlanVisibilityRequest, SortOrder, SortOrderWithLiterals, Sorting, StringList, UpdatePlanRequest, UpdatePlanResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.mjs';
2
+ import { ListPublicPlansOptions, ListPublicPlansResponse, ListPublicPlansApplicationErrors, Plan, GetPlanApplicationErrors, ListPlansOptions, ListPlansResponse, ListPlansApplicationErrors, ListPlansValidationErrors, GetPlanStatsResponse, GetPlanStatsApplicationErrors, CreatePlanApplicationErrors, CreatePlanValidationErrors, UpdatePlan, UpdatePlanApplicationErrors, UpdatePlanValidationErrors, SetPlanVisibilityResponse, SetPlanVisibilityApplicationErrors, MakePlanPrimaryResponse, MakePlanPrimaryApplicationErrors, ClearPrimaryApplicationErrors, ArchivePlanResponse, ArchivePlanApplicationErrors, PlanBuyerCanCancelUpdatedEnvelope, PlanCreatedEnvelope, PlanArchivedEnvelope, PlanUpdatedEnvelope, PlansQueryBuilder, QueryV2, typedQueryPublicPlans } from './index.typings.mjs';
3
+ export { ActionEvent, ApplicationError, AppliedAt, AppliedAtWithLiterals, ArchivePlanRequest, ArchivedFilter, ArchivedFilterWithLiterals, 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, PeriodUnitWithLiterals, PlanArchived, PlansQueryResult, Pricing, PricingPricingModelOneOf, PublicFilter, PublicFilterWithLiterals, PublicPlan, QueryPublicPlansApplicationErrors, QueryPublicPlansRequest, QueryPublicPlansResponse, QueryPublicPlansValidationErrors, Recurrence, RestoreInfo, SearchPlansRequest, SearchPlansResponse, SetPlanVisibilityRequest, SortOrder, SortOrderWithLiterals, Sorting, StringList, UpdatePlanRequest, UpdatePlanResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.mjs';
4
4
 
5
5
  declare function listPublicPlans$1(httpClient: HttpClient): ListPublicPlansSignature;
6
6
  interface ListPublicPlansSignature {
@@ -13,29 +13,6 @@ interface ListPublicPlansSignature {
13
13
  __applicationErrorsType?: ListPublicPlansApplicationErrors;
14
14
  }>;
15
15
  }
16
- declare function queryPublicPlans$1(httpClient: HttpClient): QueryPublicPlansSignature;
17
- interface QueryPublicPlansSignature {
18
- /**
19
- * Creates a query to retrieve a list of public pricing plans.
20
- *
21
- *
22
- * The `queryPublicPlans()` method builds a query to retrieve a list of up to 1,000 public plans and returns a [`PublicPlansQueryBuilder`](#plansquerybuilder) object.
23
- *
24
- * The returned object contains the query definition which is typically used to run the query using the [`find()`](#plansquerybuilder/find) method.
25
- *
26
- * You can refine the query by chaining `PublicPlansQueryBuilder` methods onto the query. `PublicPlansQueryBuilder` methods enable you to sort, filter, and control the results that `queryPublicPlans()` returns.
27
- *
28
- * `queryPublicPlans()` runs with the following `PublicPlansQueryBuilder` defaults that you can override:
29
- * - [`skip`](#plansquerybuilder/skip): `0`
30
- * - [`limit`](#plansquerybuilder/limit): `50`
31
- *
32
- * 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.
33
- *
34
- * 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).
35
- * @deprecated
36
- */
37
- (): PlansQueryBuilder;
38
- }
39
16
  declare function getPlan$1(httpClient: HttpClient): GetPlanSignature;
40
17
  interface GetPlanSignature {
41
18
  /**
@@ -161,8 +138,11 @@ declare const onPlanCreated$1: EventDefinition<PlanCreatedEnvelope, "wix.pricing
161
138
  declare const onPlanArchived$1: EventDefinition<PlanArchivedEnvelope, "wix.pricing_plans.plan_plan_archived">;
162
139
  declare const onPlanUpdated$1: EventDefinition<PlanUpdatedEnvelope, "wix.pricing_plans.plan_updated">;
163
140
 
141
+ declare function customQueryPublicPlans(httpClient: HttpClient): {
142
+ (): PlansQueryBuilder;
143
+ (query: QueryV2): ReturnType<typeof typedQueryPublicPlans>;
144
+ };
164
145
  declare const listPublicPlans: MaybeContext<BuildRESTFunction<typeof listPublicPlans$1> & typeof listPublicPlans$1>;
165
- declare const queryPublicPlans: MaybeContext<BuildRESTFunction<typeof queryPublicPlans$1> & typeof queryPublicPlans$1>;
166
146
  declare const getPlan: MaybeContext<BuildRESTFunction<typeof getPlan$1> & typeof getPlan$1>;
167
147
  declare const listPlans: MaybeContext<BuildRESTFunction<typeof listPlans$1> & typeof listPlans$1>;
168
148
  declare const getPlanStats: MaybeContext<BuildRESTFunction<typeof getPlanStats$1> & typeof getPlanStats$1>;
@@ -172,6 +152,7 @@ declare const setPlanVisibility: MaybeContext<BuildRESTFunction<typeof setPlanVi
172
152
  declare const makePlanPrimary: MaybeContext<BuildRESTFunction<typeof makePlanPrimary$1> & typeof makePlanPrimary$1>;
173
153
  declare const clearPrimary: MaybeContext<BuildRESTFunction<typeof clearPrimary$1> & typeof clearPrimary$1>;
174
154
  declare const archivePlan: MaybeContext<BuildRESTFunction<typeof archivePlan$1> & typeof archivePlan$1>;
155
+ declare const queryPublicPlans: MaybeContext<BuildRESTFunction<typeof customQueryPublicPlans> & typeof customQueryPublicPlans>;
175
156
  /**
176
157
  * Triggered when a plan's `buyerCanCancel` field is updated.
177
158
  * @deprecated
@@ -192,4 +173,4 @@ declare const onPlanArchived: BuildEventDefinition<typeof onPlanArchived$1> & ty
192
173
  */
193
174
  declare const onPlanUpdated: BuildEventDefinition<typeof onPlanUpdated$1> & typeof onPlanUpdated$1;
194
175
 
195
- export { ArchivePlanApplicationErrors, ArchivePlanResponse, ClearPrimaryApplicationErrors, CreatePlanApplicationErrors, CreatePlanValidationErrors, GetPlanApplicationErrors, GetPlanStatsApplicationErrors, GetPlanStatsResponse, ListPlansApplicationErrors, ListPlansOptions, ListPlansResponse, ListPlansValidationErrors, ListPublicPlansApplicationErrors, ListPublicPlansOptions, ListPublicPlansResponse, MakePlanPrimaryApplicationErrors, MakePlanPrimaryResponse, Plan, PlanArchivedEnvelope, PlanBuyerCanCancelUpdatedEnvelope, PlanCreatedEnvelope, PlanUpdatedEnvelope, PlansQueryBuilder, SetPlanVisibilityApplicationErrors, SetPlanVisibilityResponse, UpdatePlan, UpdatePlanApplicationErrors, UpdatePlanValidationErrors, archivePlan, clearPrimary, createPlan, getPlan, getPlanStats, listPlans, listPublicPlans, makePlanPrimary, onPlanArchived, onPlanBuyerCanCancelUpdated, onPlanCreated, onPlanUpdated, queryPublicPlans, setPlanVisibility, updatePlan };
176
+ export { ArchivePlanApplicationErrors, ArchivePlanResponse, ClearPrimaryApplicationErrors, CreatePlanApplicationErrors, CreatePlanValidationErrors, GetPlanApplicationErrors, GetPlanStatsApplicationErrors, GetPlanStatsResponse, ListPlansApplicationErrors, ListPlansOptions, ListPlansResponse, ListPlansValidationErrors, ListPublicPlansApplicationErrors, ListPublicPlansOptions, ListPublicPlansResponse, MakePlanPrimaryApplicationErrors, MakePlanPrimaryResponse, Plan, PlanArchivedEnvelope, PlanBuyerCanCancelUpdatedEnvelope, PlanCreatedEnvelope, PlanUpdatedEnvelope, PlansQueryBuilder, QueryV2, SetPlanVisibilityApplicationErrors, SetPlanVisibilityResponse, UpdatePlan, UpdatePlanApplicationErrors, UpdatePlanValidationErrors, archivePlan, clearPrimary, createPlan, getPlan, getPlanStats, listPlans, listPublicPlans, makePlanPrimary, onPlanArchived, onPlanBuyerCanCancelUpdated, onPlanCreated, onPlanUpdated, queryPublicPlans, setPlanVisibility, updatePlan };
@@ -544,6 +544,29 @@ function queryPublicPlans2() {
544
544
  transformationPaths: {}
545
545
  });
546
546
  }
547
+ async function typedQueryPublicPlans(query) {
548
+ const { httpClient, sideEffects } = arguments[1];
549
+ const payload = renameKeysFromSDKRequestToRESTRequest({ query });
550
+ const reqOpts = queryPublicPlans(payload);
551
+ sideEffects?.onSiteCall?.();
552
+ try {
553
+ const result = await httpClient.request(reqOpts);
554
+ sideEffects?.onSuccess?.(result);
555
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
556
+ } catch (err) {
557
+ const transformedError = sdkTransformError(
558
+ err,
559
+ {
560
+ spreadPathsToArguments: {},
561
+ explicitPathsToArguments: { query: "$[0]" },
562
+ singleArgumentUnchanged: false
563
+ },
564
+ ["query"]
565
+ );
566
+ sideEffects?.onError?.(err);
567
+ throw transformedError;
568
+ }
569
+ }
547
570
  async function getPlan2(_id) {
548
571
  const { httpClient, sideEffects } = arguments[1];
549
572
  const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
@@ -783,6 +806,13 @@ function queryPublicPlans3(httpClient) {
783
806
  { httpClient }
784
807
  );
785
808
  }
809
+ function typedQueryPublicPlans2(httpClient) {
810
+ return (query) => typedQueryPublicPlans(
811
+ query,
812
+ // @ts-ignore
813
+ { httpClient }
814
+ );
815
+ }
786
816
  function getPlan3(httpClient) {
787
817
  return (_id) => getPlan2(
788
818
  _id,
@@ -914,8 +944,19 @@ var onPlanUpdated = EventDefinition(
914
944
  // src/pricing-plans-v2-plan-plans.context.ts
915
945
  import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
916
946
  import { createEventModule } from "@wix/sdk-runtime/event-definition-modules";
947
+ import { createQueryOverloadRouter } from "@wix/sdk-runtime/query-method-router";
948
+ function customQueryPublicPlans(httpClient) {
949
+ const router = createQueryOverloadRouter({
950
+ builderQueryFunction: () => queryPublicPlans3(httpClient)(),
951
+ typedQueryFunction: (query) => typedQueryPublicPlans2(httpClient)(query),
952
+ hasOptionsParameter: false
953
+ });
954
+ function overloadedQuery(query) {
955
+ return router(...arguments);
956
+ }
957
+ return overloadedQuery;
958
+ }
917
959
  var listPublicPlans4 = /* @__PURE__ */ createRESTModule(listPublicPlans3);
918
- var queryPublicPlans4 = /* @__PURE__ */ createRESTModule(queryPublicPlans3);
919
960
  var getPlan4 = /* @__PURE__ */ createRESTModule(getPlan3);
920
961
  var listPlans4 = /* @__PURE__ */ createRESTModule(listPlans3);
921
962
  var getPlanStats4 = /* @__PURE__ */ createRESTModule(getPlanStats3);
@@ -925,6 +966,7 @@ var setPlanVisibility4 = /* @__PURE__ */ createRESTModule(setPlanVisibility3);
925
966
  var makePlanPrimary4 = /* @__PURE__ */ createRESTModule(makePlanPrimary3);
926
967
  var clearPrimary4 = /* @__PURE__ */ createRESTModule(clearPrimary3);
927
968
  var archivePlan4 = /* @__PURE__ */ createRESTModule(archivePlan3);
969
+ var queryPublicPlans4 = /* @__PURE__ */ createRESTModule(customQueryPublicPlans);
928
970
  var onPlanBuyerCanCancelUpdated2 = createEventModule(
929
971
  onPlanBuyerCanCancelUpdated
930
972
  );