@wix/auto_sdk_standalone-forms_standalone-forms 1.0.0 → 1.0.1

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.
@@ -11,6 +11,14 @@ import { transformSDKTimestampToRESTTimestamp } from "@wix/sdk-runtime/transform
11
11
  import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
12
12
  import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
13
13
  import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
14
+ var TRANSFORM_PATHS_0 = [
15
+ { path: "standaloneForm.createdDate" },
16
+ { path: "standaloneForm.updatedDate" }
17
+ ];
18
+ var TRANSFORM_PATHS_1 = [
19
+ { path: "standaloneForms.createdDate" },
20
+ { path: "standaloneForms.updatedDate" }
21
+ ];
14
22
  function resolveWixFormsV1FormStandaloneServiceUrl(opts) {
15
23
  const domainToMappings = {
16
24
  "manage._base_domain_": [
@@ -81,36 +89,12 @@ function resolveWixFormsV1FormStandaloneServiceUrl(opts) {
81
89
  return resolveUrl(Object.assign(opts, { domainToMappings }));
82
90
  }
83
91
  var PACKAGE_NAME = "@wix/auto_sdk_standalone-forms_standalone-forms";
84
- function getOrCreateFormStandaloneMetaSite(payload) {
85
- function __getOrCreateFormStandaloneMetaSite({ host }) {
86
- const metadata = {
87
- entityFqdn: "wix.forms.v1.standalone_form",
88
- method: "GET",
89
- methodFqn: "wix.forms.v1.FormStandaloneService.GetOrCreateFormStandaloneMetaSite",
90
- packageName: PACKAGE_NAME,
91
- migrationOptions: {
92
- optInTransformResponse: true
93
- },
94
- url: resolveWixFormsV1FormStandaloneServiceUrl({
95
- protoPath: "/v4/standalone-forms/metasite",
96
- data: payload,
97
- host
98
- }),
99
- params: toURLSearchParams(payload)
100
- };
101
- return metadata;
102
- }
103
- return __getOrCreateFormStandaloneMetaSite;
104
- }
105
92
  function createStandaloneForm(payload) {
106
93
  function __createStandaloneForm({ host }) {
107
94
  const serializedData = transformPaths(payload, [
108
95
  {
109
96
  transformFn: transformSDKTimestampToRESTTimestamp,
110
- paths: [
111
- { path: "standaloneForm.createdDate" },
112
- { path: "standaloneForm.updatedDate" }
113
- ]
97
+ paths: TRANSFORM_PATHS_0
114
98
  }
115
99
  ]);
116
100
  const metadata = {
@@ -130,10 +114,7 @@ function createStandaloneForm(payload) {
130
114
  transformResponse: (payload2) => transformPaths(payload2, [
131
115
  {
132
116
  transformFn: transformRESTTimestampToSDKTimestamp,
133
- paths: [
134
- { path: "standaloneForm.createdDate" },
135
- { path: "standaloneForm.updatedDate" }
136
- ]
117
+ paths: TRANSFORM_PATHS_0
137
118
  }
138
119
  ])
139
120
  };
@@ -160,10 +141,7 @@ function getStandaloneForm(payload) {
160
141
  transformResponse: (payload2) => transformPaths(payload2, [
161
142
  {
162
143
  transformFn: transformRESTTimestampToSDKTimestamp,
163
- paths: [
164
- { path: "standaloneForm.createdDate" },
165
- { path: "standaloneForm.updatedDate" }
166
- ]
144
+ paths: TRANSFORM_PATHS_0
167
145
  }
168
146
  ])
169
147
  };
@@ -232,10 +210,7 @@ function restoreStandaloneFormFromTrashBin(payload) {
232
210
  transformResponse: (payload2) => transformPaths(payload2, [
233
211
  {
234
212
  transformFn: transformRESTTimestampToSDKTimestamp,
235
- paths: [
236
- { path: "standaloneForm.createdDate" },
237
- { path: "standaloneForm.updatedDate" }
238
- ]
213
+ paths: TRANSFORM_PATHS_0
239
214
  }
240
215
  ])
241
216
  };
@@ -262,10 +237,7 @@ function getDeletedStandaloneForm(payload) {
262
237
  transformResponse: (payload2) => transformPaths(payload2, [
263
238
  {
264
239
  transformFn: transformRESTTimestampToSDKTimestamp,
265
- paths: [
266
- { path: "standaloneForm.createdDate" },
267
- { path: "standaloneForm.updatedDate" }
268
- ]
240
+ paths: TRANSFORM_PATHS_0
269
241
  }
270
242
  ])
271
243
  };
@@ -292,10 +264,7 @@ function listDeletedStandaloneForms(payload) {
292
264
  transformResponse: (payload2) => transformPaths(payload2, [
293
265
  {
294
266
  transformFn: transformRESTTimestampToSDKTimestamp,
295
- paths: [
296
- { path: "standaloneForms.createdDate" },
297
- { path: "standaloneForms.updatedDate" }
298
- ]
267
+ paths: TRANSFORM_PATHS_1
299
268
  }
300
269
  ])
301
270
  };
@@ -322,10 +291,7 @@ function queryStandaloneForms(payload) {
322
291
  transformResponse: (payload2) => transformPaths(payload2, [
323
292
  {
324
293
  transformFn: transformRESTTimestampToSDKTimestamp,
325
- paths: [
326
- { path: "standaloneForms.createdDate" },
327
- { path: "standaloneForms.updatedDate" }
328
- ]
294
+ paths: TRANSFORM_PATHS_1
329
295
  }
330
296
  ])
331
297
  };
@@ -459,31 +425,6 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
459
425
  WebhookIdentityType2["APP"] = "APP";
460
426
  return WebhookIdentityType2;
461
427
  })(WebhookIdentityType || {});
462
- async function getOrCreateFormStandaloneMetaSite2() {
463
- const { httpClient, sideEffects } = arguments[0];
464
- const payload = renameKeysFromSDKRequestToRESTRequest({});
465
- const reqOpts = getOrCreateFormStandaloneMetaSite(
466
- payload
467
- );
468
- sideEffects?.onSiteCall?.();
469
- try {
470
- const result = await httpClient.request(reqOpts);
471
- sideEffects?.onSuccess?.(result);
472
- return renameKeysFromRESTResponseToSDKResponse(result.data);
473
- } catch (err) {
474
- const transformedError = sdkTransformError(
475
- err,
476
- {
477
- spreadPathsToArguments: {},
478
- explicitPathsToArguments: {},
479
- singleArgumentUnchanged: false
480
- },
481
- []
482
- );
483
- sideEffects?.onError?.(err);
484
- throw transformedError;
485
- }
486
- }
487
428
  async function createStandaloneForm2(standaloneForm) {
488
429
  const { httpClient, sideEffects } = arguments[1];
489
430
  const payload = renameKeysFromSDKRequestToRESTRequest({
@@ -717,12 +658,6 @@ async function getSiteProperties2() {
717
658
  }
718
659
 
719
660
  // src/forms-v1-standalone-form-standalone-forms.public.ts
720
- function getOrCreateFormStandaloneMetaSite3(httpClient) {
721
- return () => getOrCreateFormStandaloneMetaSite2(
722
- // @ts-ignore
723
- { httpClient }
724
- );
725
- }
726
661
  function createStandaloneForm3(httpClient) {
727
662
  return (standaloneForm) => createStandaloneForm2(
728
663
  standaloneForm,
@@ -789,7 +724,6 @@ function getSiteProperties3(httpClient) {
789
724
 
790
725
  // src/forms-v1-standalone-form-standalone-forms.context.ts
791
726
  import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
792
- var getOrCreateFormStandaloneMetaSite4 = /* @__PURE__ */ createRESTModule(getOrCreateFormStandaloneMetaSite3);
793
727
  var createStandaloneForm4 = /* @__PURE__ */ createRESTModule(createStandaloneForm3);
794
728
  var getStandaloneForm4 = /* @__PURE__ */ createRESTModule(getStandaloneForm3);
795
729
  var deleteStandaloneForm4 = /* @__PURE__ */ createRESTModule(deleteStandaloneForm3);
@@ -812,7 +746,6 @@ export {
812
746
  createStandaloneForm4 as createStandaloneForm,
813
747
  deleteStandaloneForm4 as deleteStandaloneForm,
814
748
  getDeletedStandaloneForm4 as getDeletedStandaloneForm,
815
- getOrCreateFormStandaloneMetaSite4 as getOrCreateFormStandaloneMetaSite,
816
749
  getSiteProperties4 as getSiteProperties,
817
750
  getStandaloneForm4 as getStandaloneForm,
818
751
  listDeletedStandaloneForms4 as listDeletedStandaloneForms,