@wix/auto_sdk_pricing-plans_plans 1.0.84 → 1.0.85

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.js';
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.js';
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.js';
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.js';
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 };
@@ -587,6 +587,29 @@ function queryPublicPlans2() {
587
587
  transformationPaths: {}
588
588
  });
589
589
  }
590
+ async function typedQueryPublicPlans(query) {
591
+ const { httpClient, sideEffects } = arguments[1];
592
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ query });
593
+ const reqOpts = queryPublicPlans(payload);
594
+ sideEffects?.onSiteCall?.();
595
+ try {
596
+ const result = await httpClient.request(reqOpts);
597
+ sideEffects?.onSuccess?.(result);
598
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
599
+ } catch (err) {
600
+ const transformedError = (0, import_transform_error.transformError)(
601
+ err,
602
+ {
603
+ spreadPathsToArguments: {},
604
+ explicitPathsToArguments: { query: "$[0]" },
605
+ singleArgumentUnchanged: false
606
+ },
607
+ ["query"]
608
+ );
609
+ sideEffects?.onError?.(err);
610
+ throw transformedError;
611
+ }
612
+ }
590
613
  async function getPlan2(_id) {
591
614
  const { httpClient, sideEffects } = arguments[1];
592
615
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
@@ -826,6 +849,13 @@ function queryPublicPlans3(httpClient) {
826
849
  { httpClient }
827
850
  );
828
851
  }
852
+ function typedQueryPublicPlans2(httpClient) {
853
+ return (query) => typedQueryPublicPlans(
854
+ query,
855
+ // @ts-ignore
856
+ { httpClient }
857
+ );
858
+ }
829
859
  function getPlan3(httpClient) {
830
860
  return (_id) => getPlan2(
831
861
  _id,
@@ -957,8 +987,19 @@ var onPlanUpdated = (0, import_sdk_types.EventDefinition)(
957
987
  // src/pricing-plans-v2-plan-plans.context.ts
958
988
  var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
959
989
  var import_event_definition_modules = require("@wix/sdk-runtime/event-definition-modules");
990
+ var import_query_method_router = require("@wix/sdk-runtime/query-method-router");
991
+ function customQueryPublicPlans(httpClient) {
992
+ const router = (0, import_query_method_router.createQueryOverloadRouter)({
993
+ builderQueryFunction: () => queryPublicPlans3(httpClient)(),
994
+ typedQueryFunction: (query) => typedQueryPublicPlans2(httpClient)(query),
995
+ hasOptionsParameter: false
996
+ });
997
+ function overloadedQuery(query) {
998
+ return router(...arguments);
999
+ }
1000
+ return overloadedQuery;
1001
+ }
960
1002
  var listPublicPlans4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(listPublicPlans3);
961
- var queryPublicPlans4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(queryPublicPlans3);
962
1003
  var getPlan4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getPlan3);
963
1004
  var listPlans4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(listPlans3);
964
1005
  var getPlanStats4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getPlanStats3);
@@ -968,6 +1009,7 @@ var setPlanVisibility4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModu
968
1009
  var makePlanPrimary4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(makePlanPrimary3);
969
1010
  var clearPrimary4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(clearPrimary3);
970
1011
  var archivePlan4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(archivePlan3);
1012
+ var queryPublicPlans4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(customQueryPublicPlans);
971
1013
  var onPlanBuyerCanCancelUpdated2 = (0, import_event_definition_modules.createEventModule)(
972
1014
  onPlanBuyerCanCancelUpdated
973
1015
  );