@wix/auto_sdk_pricing-plans_plans 1.0.83 → 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.
Files changed (37) hide show
  1. package/build/cjs/index.d.ts +8 -27
  2. package/build/cjs/index.js +92 -56
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +16 -6
  5. package/build/cjs/index.typings.js +74 -55
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +3 -3
  8. package/build/cjs/meta.js +49 -55
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +8 -27
  11. package/build/es/index.mjs +92 -56
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +16 -6
  14. package/build/es/index.typings.mjs +73 -55
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +3 -3
  17. package/build/es/meta.mjs +49 -55
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +8 -27
  20. package/build/internal/cjs/index.js +92 -56
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +16 -6
  23. package/build/internal/cjs/index.typings.js +74 -55
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +3 -3
  26. package/build/internal/cjs/meta.js +49 -55
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +8 -27
  29. package/build/internal/es/index.mjs +92 -56
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +16 -6
  32. package/build/internal/es/index.typings.mjs +73 -55
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +3 -3
  35. package/build/internal/es/meta.mjs +49 -55
  36. package/build/internal/es/meta.mjs.map +1 -1
  37. package/package.json +3 -3
@@ -197,12 +197,12 @@ declare enum AppliedAt {
197
197
  type AppliedAtWithLiterals = AppliedAt | 'UNKNOWN_CHARGE_EVENT' | 'FIRST_PAYMENT';
198
198
  interface ListPublicPlansRequest {
199
199
  /**
200
- * Number of items to list. Defaults to `75`. See limits ([SDK](https://dev.wix.com/docs/sdk/backend-modules/pricing-plans/plans/list-public-plans) | [REST](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#paging)).
200
+ * Number of items to list. Defaults to `75`. See [limits](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language#paging).
201
201
  * @min 1
202
202
  * @max 100
203
203
  */
204
204
  limit?: number | null;
205
- /** Number of items to skip. Defaults to `0`. See paging ([SDK](https://dev.wix.com/docs/sdk/backend-modules/pricing-plans/plans/list-public-plans) |[REST](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#paging)). */
205
+ /** Number of items to skip. Defaults to `0`. See [paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language#paging). */
206
206
  offset?: number | null;
207
207
  /**
208
208
  * IDs of plans to list. Non-existent IDs are ignored and don't cause errors. You can specify a maximum of 100 IDs.
@@ -295,7 +295,7 @@ interface QueryPublicPlansRequest {
295
295
  query?: QueryV2;
296
296
  }
297
297
  interface QueryV2 {
298
- /** A filter object. See supported fields and operators ([SDK](https://dev.wix.com/docs/sdk/backend-modules/pricing-plans/plans/query-public-plans) | [REST](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/plans/filter-and-sort#wix-pricing-plans_pricing-plans_plans_filter-and-sort_query-public-plans)). */
298
+ /** A filter object. See [supported fields and operators](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/plans/filter-and-sort#wix-pricing-plans_pricing-plans_plans_filter-and-sort_query-public-plans). */
299
299
  filter?: Record<string, any> | null;
300
300
  /** Sort object in the form [{"fieldName":"sortField1"},{"fieldName":"sortField2","direction":"DESC"}]. */
301
301
  sort?: Sorting[];
@@ -1016,12 +1016,12 @@ declare function listPublicPlans(options?: ListPublicPlansOptions): Promise<NonN
1016
1016
  }>;
1017
1017
  interface ListPublicPlansOptions {
1018
1018
  /**
1019
- * Number of items to list. Defaults to `75`. See limits ([SDK](https://dev.wix.com/docs/sdk/backend-modules/pricing-plans/plans/list-public-plans) | [REST](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#paging)).
1019
+ * Number of items to list. Defaults to `75`. See [limits](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language#paging).
1020
1020
  * @min 1
1021
1021
  * @max 100
1022
1022
  */
1023
1023
  limit?: number | null;
1024
- /** Number of items to skip. Defaults to `0`. See paging ([SDK](https://dev.wix.com/docs/sdk/backend-modules/pricing-plans/plans/list-public-plans) |[REST](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#paging)). */
1024
+ /** Number of items to skip. Defaults to `0`. See [paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language#paging). */
1025
1025
  offset?: number | null;
1026
1026
  /**
1027
1027
  * IDs of plans to list. Non-existent IDs are ignored and don't cause errors. You can specify a maximum of 100 IDs.
@@ -1116,6 +1116,16 @@ interface PlansQueryBuilder {
1116
1116
  skip: (skip: number) => PlansQueryBuilder;
1117
1117
  find: () => Promise<PlansQueryResult>;
1118
1118
  }
1119
+ /**
1120
+ * @hidden
1121
+ * @fqn com.wixpress.membership.v2.plans.PlansServiceV2.QueryPublicPlans
1122
+ * @requiredField query
1123
+ * @returns Fulfilled - The query definition used to run the query using the [`find()`](#find) method.
1124
+ */
1125
+ declare function typedQueryPublicPlans(query: QueryV2): Promise<NonNullablePaths<QueryPublicPlansResponse, `plans` | `plans.${number}._id` | `plans.${number}.pricing.singlePaymentForDuration.unit` | `plans.${number}.pricing.price.value` | `plans.${number}.pricing.price.currency` | `plans.${number}.primary`, 6> & {
1126
+ __applicationErrorsType?: QueryPublicPlansApplicationErrors;
1127
+ __validationErrorsType?: QueryPublicPlansValidationErrors;
1128
+ }>;
1119
1129
  /**
1120
1130
  * Retrieves a pricing plan by ID.
1121
1131
  * @param _id - Plan ID.
@@ -1382,4 +1392,4 @@ declare function archivePlan(_id: string): Promise<NonNullablePaths<ArchivePlanR
1382
1392
  __applicationErrorsType?: ArchivePlanApplicationErrors;
1383
1393
  }>;
1384
1394
 
1385
- export { type ActionEvent, type ApplicationError, AppliedAt, type AppliedAtWithLiterals, type ArchivePlanApplicationErrors, type ArchivePlanRequest, type ArchivePlanResponse, ArchivedFilter, type ArchivedFilterWithLiterals, type ArrangePlansRequest, type ArrangePlansResponse, type BaseEventMetadata, type BulkActionMetadata, type BulkArchivePlanRequest, type BulkArchivePlanResponse, type BulkPlanResult, type BuyerCanCancelUpdated, type ClearPrimaryApplicationErrors, type ClearPrimaryRequest, type ClearPrimaryResponse, type CountPlansRequest, type CountPlansResponse, type CreatePlanApplicationErrors, type CreatePlanRequest, type CreatePlanResponse, type CreatePlanValidationErrors, type Cursors, type DomainEvent, type DomainEventBodyOneOf, type Duration, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type Fee, type FeeConfig, type GetPlanApplicationErrors, type GetPlanRequest, type GetPlanResponse, type GetPlanStatsApplicationErrors, type GetPlanStatsRequest, type GetPlanStatsResponse, type GetPlansPremiumStatusRequest, type GetPlansPremiumStatusResponse, type IdentificationData, type IdentificationDataIdOneOf, type ItemMetadata, type ListPlansApplicationErrors, type ListPlansOptions, type ListPlansRequest, type ListPlansResponse, type ListPlansValidationErrors, type ListPublicPlansApplicationErrors, type ListPublicPlansOptions, type ListPublicPlansRequest, type ListPublicPlansResponse, type MakePlanPrimaryApplicationErrors, type MakePlanPrimaryRequest, type MakePlanPrimaryResponse, type MessageEnvelope, type Money, type Paging, type PagingMetadataV2, PeriodUnit, type PeriodUnitWithLiterals, type Plan, type PlanArchived, type PlanArchivedEnvelope, type PlanBuyerCanCancelUpdatedEnvelope, type PlanCreatedEnvelope, type PlanUpdatedEnvelope, type PlansQueryBuilder, type PlansQueryResult, type Pricing, type PricingPricingModelOneOf, PublicFilter, type PublicFilterWithLiterals, type PublicPlan, type QueryPublicPlansApplicationErrors, type QueryPublicPlansRequest, type QueryPublicPlansResponse, type QueryPublicPlansValidationErrors, type QueryV2, type Recurrence, type RestoreInfo, type SearchPlansRequest, type SearchPlansResponse, type SetPlanVisibilityApplicationErrors, type SetPlanVisibilityRequest, type SetPlanVisibilityResponse, SortOrder, type SortOrderWithLiterals, type Sorting, type StringList, type UpdatePlan, type UpdatePlanApplicationErrors, type UpdatePlanRequest, type UpdatePlanResponse, type UpdatePlanValidationErrors, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, archivePlan, clearPrimary, createPlan, getPlan, getPlanStats, listPlans, listPublicPlans, makePlanPrimary, onPlanArchived, onPlanBuyerCanCancelUpdated, onPlanCreated, onPlanUpdated, queryPublicPlans, setPlanVisibility, updatePlan };
1395
+ export { type ActionEvent, type ApplicationError, AppliedAt, type AppliedAtWithLiterals, type ArchivePlanApplicationErrors, type ArchivePlanRequest, type ArchivePlanResponse, ArchivedFilter, type ArchivedFilterWithLiterals, type ArrangePlansRequest, type ArrangePlansResponse, type BaseEventMetadata, type BulkActionMetadata, type BulkArchivePlanRequest, type BulkArchivePlanResponse, type BulkPlanResult, type BuyerCanCancelUpdated, type ClearPrimaryApplicationErrors, type ClearPrimaryRequest, type ClearPrimaryResponse, type CountPlansRequest, type CountPlansResponse, type CreatePlanApplicationErrors, type CreatePlanRequest, type CreatePlanResponse, type CreatePlanValidationErrors, type Cursors, type DomainEvent, type DomainEventBodyOneOf, type Duration, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type Fee, type FeeConfig, type GetPlanApplicationErrors, type GetPlanRequest, type GetPlanResponse, type GetPlanStatsApplicationErrors, type GetPlanStatsRequest, type GetPlanStatsResponse, type GetPlansPremiumStatusRequest, type GetPlansPremiumStatusResponse, type IdentificationData, type IdentificationDataIdOneOf, type ItemMetadata, type ListPlansApplicationErrors, type ListPlansOptions, type ListPlansRequest, type ListPlansResponse, type ListPlansValidationErrors, type ListPublicPlansApplicationErrors, type ListPublicPlansOptions, type ListPublicPlansRequest, type ListPublicPlansResponse, type MakePlanPrimaryApplicationErrors, type MakePlanPrimaryRequest, type MakePlanPrimaryResponse, type MessageEnvelope, type Money, type Paging, type PagingMetadataV2, PeriodUnit, type PeriodUnitWithLiterals, type Plan, type PlanArchived, type PlanArchivedEnvelope, type PlanBuyerCanCancelUpdatedEnvelope, type PlanCreatedEnvelope, type PlanUpdatedEnvelope, type PlansQueryBuilder, type PlansQueryResult, type Pricing, type PricingPricingModelOneOf, PublicFilter, type PublicFilterWithLiterals, type PublicPlan, type QueryPublicPlansApplicationErrors, type QueryPublicPlansRequest, type QueryPublicPlansResponse, type QueryPublicPlansValidationErrors, type QueryV2, type Recurrence, type RestoreInfo, type SearchPlansRequest, type SearchPlansResponse, type SetPlanVisibilityApplicationErrors, type SetPlanVisibilityRequest, type SetPlanVisibilityResponse, SortOrder, type SortOrderWithLiterals, type Sorting, type StringList, type UpdatePlan, type UpdatePlanApplicationErrors, type UpdatePlanRequest, type UpdatePlanResponse, type UpdatePlanValidationErrors, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, archivePlan, clearPrimary, createPlan, getPlan, getPlanStats, listPlans, listPublicPlans, makePlanPrimary, onPlanArchived, onPlanBuyerCanCancelUpdated, onPlanCreated, onPlanUpdated, queryPublicPlans, setPlanVisibility, typedQueryPublicPlans, updatePlan };
@@ -36,6 +36,7 @@ __export(index_typings_exports, {
36
36
  makePlanPrimary: () => makePlanPrimary2,
37
37
  queryPublicPlans: () => queryPublicPlans2,
38
38
  setPlanVisibility: () => setPlanVisibility2,
39
+ typedQueryPublicPlans: () => typedQueryPublicPlans,
39
40
  updatePlan: () => updatePlan2
40
41
  });
41
42
  module.exports = __toCommonJS(index_typings_exports);
@@ -54,104 +55,98 @@ var import_transform_paths = require("@wix/sdk-runtime/transformations/transform
54
55
  var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
55
56
  function resolveComWixpressMembershipV2PlansPlansServiceV2Url(opts) {
56
57
  const domainToMappings = {
57
- "www._base_domain_": [
58
+ "api._api_base_domain_": [
58
59
  {
59
- srcPath: "/_api/paid-plans",
60
+ srcPath: "/plan-proxy",
60
61
  destPath: ""
61
62
  }
62
63
  ],
63
- "forums.wixapps.net": [
64
+ "*.dev.wix-code.com": [
64
65
  {
65
- srcPath: "/_api/paid-plans",
66
- destPath: ""
66
+ srcPath: "/_api/paid-plans/v2/plans",
67
+ destPath: "/v2/plans"
67
68
  }
68
69
  ],
69
- "editor._base_domain_": [
70
+ "*.pub.wix-code.com": [
70
71
  {
71
- srcPath: "/_api/paid-plans",
72
- destPath: ""
72
+ srcPath: "/_api/paid-plans/v2/plans",
73
+ destPath: "/v2/plans"
73
74
  }
74
75
  ],
75
- "blocks._base_domain_": [
76
+ "*.wixapps.net": [
76
77
  {
77
- srcPath: "/_api/paid-plans",
78
- destPath: ""
78
+ srcPath: "/_api/paid-plans/v2/plans",
79
+ destPath: "/v2/plans"
79
80
  }
80
81
  ],
81
- "create.editorx": [
82
+ _: [
82
83
  {
83
- srcPath: "/_api/paid-plans",
84
- destPath: ""
84
+ srcPath: "/_api/paid-plans/v2/plans",
85
+ destPath: "/v2/plans"
85
86
  }
86
87
  ],
87
- _: [
88
- {
89
- srcPath: "/_api/paid-plans",
90
- destPath: ""
91
- },
88
+ "editor-flow.wixapps.net": [
92
89
  {
93
- srcPath: "/paid-plans/v1/orders",
94
- destPath: "/v1/orders"
90
+ srcPath: "/_api/paid-plans/v2/plans",
91
+ destPath: "/v2/plans"
95
92
  }
96
93
  ],
97
- "*.wixapps.net": [
94
+ "editor._base_domain_": [
98
95
  {
99
- srcPath: "/_api/paid-plans",
100
- destPath: ""
96
+ srcPath: "/_api/paid-plans/v2/plans",
97
+ destPath: "/v2/plans"
101
98
  }
102
99
  ],
103
- "*.pub.wix-code.com": [
100
+ "blocks._base_domain_": [
104
101
  {
105
- srcPath: "/_api/paid-plans",
106
- destPath: ""
102
+ srcPath: "/_api/paid-plans/v2/plans",
103
+ destPath: "/v2/plans"
107
104
  }
108
105
  ],
109
- "*.dev.wix-code.com": [
106
+ "create.editorx": [
110
107
  {
111
- srcPath: "/_api/paid-plans",
112
- destPath: ""
108
+ srcPath: "/_api/paid-plans/v2/plans",
109
+ destPath: "/v2/plans"
113
110
  }
114
111
  ],
115
- "manage._base_domain_": [
116
- {
117
- srcPath: "/_api/paid-plans",
118
- destPath: ""
119
- },
112
+ "editor.wixapps.net": [
120
113
  {
121
- srcPath: "/_api/pricing-plans",
122
- destPath: ""
114
+ srcPath: "/_api/paid-plans/v2/plans",
115
+ destPath: "/v2/plans"
123
116
  }
124
117
  ],
125
118
  "forums._base_domain_": [
126
119
  {
127
- srcPath: "/_api/paid-plans",
128
- destPath: ""
120
+ srcPath: "/_api/paid-plans/v2/plans",
121
+ destPath: "/v2/plans"
129
122
  }
130
123
  ],
131
- "editor-flow.wixapps.net": [
124
+ "forums.wixapps.net": [
132
125
  {
133
- srcPath: "/_api/paid-plans",
134
- destPath: ""
126
+ srcPath: "/_api/paid-plans/v2/plans",
127
+ destPath: "/v2/plans"
135
128
  }
136
129
  ],
137
- "editor.wixapps.net": [
130
+ "manage._base_domain_": [
138
131
  {
139
- srcPath: "/_api/paid-plans",
140
- destPath: ""
132
+ srcPath: "/_api/paid-plans/v2/plans",
133
+ destPath: "/v2/plans"
134
+ },
135
+ {
136
+ srcPath: "/_api/pricing-plans/v2/plans",
137
+ destPath: "/v2/plans"
141
138
  }
142
139
  ],
143
- "api._api_base_domain_": [
144
- {
145
- srcPath: "/membership-api",
146
- destPath: ""
147
- },
140
+ "www._base_domain_": [
148
141
  {
149
- srcPath: "/paid-plans",
150
- destPath: ""
151
- },
142
+ srcPath: "/_api/paid-plans/v2/plans",
143
+ destPath: "/v2/plans"
144
+ }
145
+ ],
146
+ "www.wixapis.com": [
152
147
  {
153
- srcPath: "/_api/paid-plans",
154
- destPath: ""
148
+ srcPath: "/pricing-plans/v2/plans",
149
+ destPath: "/v2/plans"
155
150
  }
156
151
  ]
157
152
  };
@@ -583,6 +578,29 @@ function queryPublicPlans2() {
583
578
  transformationPaths: {}
584
579
  });
585
580
  }
581
+ async function typedQueryPublicPlans(query) {
582
+ const { httpClient, sideEffects } = arguments[1];
583
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ query });
584
+ const reqOpts = queryPublicPlans(payload);
585
+ sideEffects?.onSiteCall?.();
586
+ try {
587
+ const result = await httpClient.request(reqOpts);
588
+ sideEffects?.onSuccess?.(result);
589
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
590
+ } catch (err) {
591
+ const transformedError = (0, import_transform_error.transformError)(
592
+ err,
593
+ {
594
+ spreadPathsToArguments: {},
595
+ explicitPathsToArguments: { query: "$[0]" },
596
+ singleArgumentUnchanged: false
597
+ },
598
+ ["query"]
599
+ );
600
+ sideEffects?.onError?.(err);
601
+ throw transformedError;
602
+ }
603
+ }
586
604
  async function getPlan2(_id) {
587
605
  const { httpClient, sideEffects } = arguments[1];
588
606
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
@@ -825,6 +843,7 @@ async function archivePlan2(_id) {
825
843
  makePlanPrimary,
826
844
  queryPublicPlans,
827
845
  setPlanVisibility,
846
+ typedQueryPublicPlans,
828
847
  updatePlan
829
848
  });
830
849
  //# sourceMappingURL=index.typings.js.map