@wix/auto_sdk_papyrus_documents 1.0.11 → 1.0.13

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.
@@ -59,7 +59,23 @@ var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
59
59
  var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
60
60
  var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
61
61
  var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
62
- function resolveWixPapyrusV1DownloadPageControllerUrl(opts) {
62
+ var TRANSFORM_PATHS_0 = [{ path: "body" }];
63
+ var TRANSFORM_PATHS_1 = [
64
+ { path: "document.createdDate" },
65
+ { path: "document.updatedDate" },
66
+ { path: "document.expirationDate" }
67
+ ];
68
+ var TRANSFORM_PATHS_2 = [
69
+ { path: "query.sort.origin.latitude" },
70
+ { path: "query.sort.origin.longitude" }
71
+ ];
72
+ var TRANSFORM_PATHS_3 = [
73
+ { path: "documents.createdDate" },
74
+ { path: "documents.updatedDate" },
75
+ { path: "documents.expirationDate" }
76
+ ];
77
+ var TRANSFORM_PATHS_4 = [{ path: "expirationDate" }];
78
+ function resolveWixPapyrusV1DocumentServiceUrl(opts) {
63
79
  const domainToMappings = {
64
80
  "api._base_domain_": [
65
81
  {
@@ -102,7 +118,7 @@ function resolveWixPapyrusV1DownloadPageControllerUrl(opts) {
102
118
  };
103
119
  return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
104
120
  }
105
- function resolveWixPapyrusV1DocumentServiceUrl(opts) {
121
+ function resolveWixPapyrusV1DownloadPageControllerUrl(opts) {
106
122
  const domainToMappings = {
107
123
  "api._base_domain_": [
108
124
  {
@@ -146,16 +162,66 @@ function resolveWixPapyrusV1DocumentServiceUrl(opts) {
146
162
  return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
147
163
  }
148
164
  var PACKAGE_NAME = "@wix/auto_sdk_papyrus_documents";
165
+ function getDownloadPage(payload) {
166
+ function __getDownloadPage({ host }) {
167
+ const metadata = {
168
+ entityFqdn: "wix.papyrus.v1.document",
169
+ method: "GET",
170
+ methodFqn: "wix.papyrus.v1.DownloadPageController.GetDownloadPage",
171
+ packageName: PACKAGE_NAME,
172
+ migrationOptions: {
173
+ optInTransformResponse: true
174
+ },
175
+ url: resolveWixPapyrusV1DownloadPageControllerUrl({
176
+ protoPath: "/download",
177
+ data: payload,
178
+ host
179
+ }),
180
+ params: (0, import_rest_modules.toURLSearchParams)(payload),
181
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
182
+ {
183
+ transformFn: import_bytes.transformRESTBytesToSDKBytes,
184
+ paths: TRANSFORM_PATHS_0
185
+ }
186
+ ])
187
+ };
188
+ return metadata;
189
+ }
190
+ return __getDownloadPage;
191
+ }
192
+ function redirectToDocument(payload) {
193
+ function __redirectToDocument({ host }) {
194
+ const metadata = {
195
+ entityFqdn: "wix.papyrus.v1.document",
196
+ method: "GET",
197
+ methodFqn: "wix.papyrus.v1.DownloadPageController.RedirectToDocument",
198
+ packageName: PACKAGE_NAME,
199
+ migrationOptions: {
200
+ optInTransformResponse: true
201
+ },
202
+ url: resolveWixPapyrusV1DownloadPageControllerUrl({
203
+ protoPath: "/view",
204
+ data: payload,
205
+ host
206
+ }),
207
+ params: (0, import_rest_modules.toURLSearchParams)(payload),
208
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
209
+ {
210
+ transformFn: import_bytes.transformRESTBytesToSDKBytes,
211
+ paths: TRANSFORM_PATHS_0
212
+ }
213
+ ])
214
+ };
215
+ return metadata;
216
+ }
217
+ return __redirectToDocument;
218
+ }
149
219
  function createDocument(payload) {
150
220
  function __createDocument({ host }) {
151
221
  const serializedData = (0, import_transform_paths.transformPaths)(payload, [
152
222
  {
153
223
  transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
154
- paths: [
155
- { path: "document.createdDate" },
156
- { path: "document.updatedDate" },
157
- { path: "document.expirationDate" }
158
- ]
224
+ paths: TRANSFORM_PATHS_1
159
225
  }
160
226
  ]);
161
227
  const metadata = {
@@ -175,11 +241,7 @@ function createDocument(payload) {
175
241
  transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
176
242
  {
177
243
  transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
178
- paths: [
179
- { path: "document.createdDate" },
180
- { path: "document.updatedDate" },
181
- { path: "document.expirationDate" }
182
- ]
244
+ paths: TRANSFORM_PATHS_1
183
245
  }
184
246
  ])
185
247
  };
@@ -206,11 +268,7 @@ function getDocument(payload) {
206
268
  transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
207
269
  {
208
270
  transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
209
- paths: [
210
- { path: "document.createdDate" },
211
- { path: "document.updatedDate" },
212
- { path: "document.expirationDate" }
213
- ]
271
+ paths: TRANSFORM_PATHS_1
214
272
  }
215
273
  ])
216
274
  };
@@ -237,11 +295,7 @@ function deleteDocument(payload) {
237
295
  transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
238
296
  {
239
297
  transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
240
- paths: [
241
- { path: "document.createdDate" },
242
- { path: "document.updatedDate" },
243
- { path: "document.expirationDate" }
244
- ]
298
+ paths: TRANSFORM_PATHS_1
245
299
  }
246
300
  ])
247
301
  };
@@ -254,10 +308,7 @@ function queryDocument(payload) {
254
308
  const serializedData = (0, import_transform_paths.transformPaths)(payload, [
255
309
  {
256
310
  transformFn: import_float.transformSDKFloatToRESTFloat,
257
- paths: [
258
- { path: "query.sort.origin.latitude" },
259
- { path: "query.sort.origin.longitude" }
260
- ]
311
+ paths: TRANSFORM_PATHS_2
261
312
  }
262
313
  ]);
263
314
  const metadata = {
@@ -277,11 +328,7 @@ function queryDocument(payload) {
277
328
  transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
278
329
  {
279
330
  transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
280
- paths: [
281
- { path: "documents.createdDate" },
282
- { path: "documents.updatedDate" },
283
- { path: "documents.expirationDate" }
284
- ]
331
+ paths: TRANSFORM_PATHS_3
285
332
  }
286
333
  ])
287
334
  };
@@ -308,11 +355,7 @@ function updateDocument(payload) {
308
355
  transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
309
356
  {
310
357
  transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
311
- paths: [
312
- { path: "document.createdDate" },
313
- { path: "document.updatedDate" },
314
- { path: "document.expirationDate" }
315
- ]
358
+ paths: TRANSFORM_PATHS_1
316
359
  }
317
360
  ])
318
361
  };
@@ -339,7 +382,7 @@ function downloadDocument(payload) {
339
382
  transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
340
383
  {
341
384
  transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
342
- paths: [{ path: "expirationDate" }]
385
+ paths: TRANSFORM_PATHS_4
343
386
  }
344
387
  ])
345
388
  };
@@ -366,7 +409,7 @@ function getDownloadUrl(payload) {
366
409
  transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
367
410
  {
368
411
  transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
369
- paths: [{ path: "expirationDate" }]
412
+ paths: TRANSFORM_PATHS_4
370
413
  }
371
414
  ])
372
415
  };
@@ -395,60 +438,6 @@ function downloadDocumentSource(payload) {
395
438
  }
396
439
  return __downloadDocumentSource;
397
440
  }
398
- function getDownloadPage(payload) {
399
- function __getDownloadPage({ host }) {
400
- const metadata = {
401
- entityFqdn: "wix.papyrus.v1.document",
402
- method: "GET",
403
- methodFqn: "wix.papyrus.v1.DownloadPageController.GetDownloadPage",
404
- packageName: PACKAGE_NAME,
405
- migrationOptions: {
406
- optInTransformResponse: true
407
- },
408
- url: resolveWixPapyrusV1DownloadPageControllerUrl({
409
- protoPath: "/download",
410
- data: payload,
411
- host
412
- }),
413
- params: (0, import_rest_modules.toURLSearchParams)(payload),
414
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
415
- {
416
- transformFn: import_bytes.transformRESTBytesToSDKBytes,
417
- paths: [{ path: "body" }]
418
- }
419
- ])
420
- };
421
- return metadata;
422
- }
423
- return __getDownloadPage;
424
- }
425
- function redirectToDocument(payload) {
426
- function __redirectToDocument({ host }) {
427
- const metadata = {
428
- entityFqdn: "wix.papyrus.v1.document",
429
- method: "GET",
430
- methodFqn: "wix.papyrus.v1.DownloadPageController.RedirectToDocument",
431
- packageName: PACKAGE_NAME,
432
- migrationOptions: {
433
- optInTransformResponse: true
434
- },
435
- url: resolveWixPapyrusV1DownloadPageControllerUrl({
436
- protoPath: "/view",
437
- data: payload,
438
- host
439
- }),
440
- params: (0, import_rest_modules.toURLSearchParams)(payload),
441
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
442
- {
443
- transformFn: import_bytes.transformRESTBytesToSDKBytes,
444
- paths: [{ path: "body" }]
445
- }
446
- ])
447
- };
448
- return metadata;
449
- }
450
- return __redirectToDocument;
451
- }
452
441
 
453
442
  // src/papyrus-v1-document-documents.universal.ts
454
443
  var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
@@ -473,6 +462,26 @@ var WixMpClientVersion = /* @__PURE__ */ ((WixMpClientVersion2) => {
473
462
  WixMpClientVersion2["MP_V2"] = "MP_V2";
474
463
  return WixMpClientVersion2;
475
464
  })(WixMpClientVersion || {});
465
+ var ResizeOption = /* @__PURE__ */ ((ResizeOption2) => {
466
+ ResizeOption2["FIT"] = "FIT";
467
+ ResizeOption2["CROP"] = "CROP";
468
+ return ResizeOption2;
469
+ })(ResizeOption || {});
470
+ var PaperSize = /* @__PURE__ */ ((PaperSize2) => {
471
+ PaperSize2["A4_PORTRAIT"] = "A4_PORTRAIT";
472
+ PaperSize2["A4_LANDSCAPE"] = "A4_LANDSCAPE";
473
+ return PaperSize2;
474
+ })(PaperSize || {});
475
+ var PageOverflow = /* @__PURE__ */ ((PageOverflow2) => {
476
+ PageOverflow2["CONTENT_HIDDEN"] = "CONTENT_HIDDEN";
477
+ PageOverflow2["CONTENT_BREAK"] = "CONTENT_BREAK";
478
+ return PageOverflow2;
479
+ })(PageOverflow || {});
480
+ var RenderFormat = /* @__PURE__ */ ((RenderFormat2) => {
481
+ RenderFormat2["PDF"] = "PDF";
482
+ RenderFormat2["HTML"] = "HTML";
483
+ return RenderFormat2;
484
+ })(RenderFormat || {});
476
485
  var RequestedFields = /* @__PURE__ */ ((RequestedFields2) => {
477
486
  RequestedFields2["DOCUMENT_CONTENT"] = "DOCUMENT_CONTENT";
478
487
  return RequestedFields2;
@@ -496,26 +505,52 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
496
505
  WebhookIdentityType2["APP"] = "APP";
497
506
  return WebhookIdentityType2;
498
507
  })(WebhookIdentityType || {});
499
- var ResizeOption = /* @__PURE__ */ ((ResizeOption2) => {
500
- ResizeOption2["FIT"] = "FIT";
501
- ResizeOption2["CROP"] = "CROP";
502
- return ResizeOption2;
503
- })(ResizeOption || {});
504
- var PaperSize = /* @__PURE__ */ ((PaperSize2) => {
505
- PaperSize2["A4_PORTRAIT"] = "A4_PORTRAIT";
506
- PaperSize2["A4_LANDSCAPE"] = "A4_LANDSCAPE";
507
- return PaperSize2;
508
- })(PaperSize || {});
509
- var PageOverflow = /* @__PURE__ */ ((PageOverflow2) => {
510
- PageOverflow2["CONTENT_HIDDEN"] = "CONTENT_HIDDEN";
511
- PageOverflow2["CONTENT_BREAK"] = "CONTENT_BREAK";
512
- return PageOverflow2;
513
- })(PageOverflow || {});
514
- var RenderFormat = /* @__PURE__ */ ((RenderFormat2) => {
515
- RenderFormat2["PDF"] = "PDF";
516
- RenderFormat2["HTML"] = "HTML";
517
- return RenderFormat2;
518
- })(RenderFormat || {});
508
+ async function getDownloadPage2(file) {
509
+ const { httpClient, sideEffects } = arguments[1];
510
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ file });
511
+ const reqOpts = getDownloadPage(payload);
512
+ sideEffects?.onSiteCall?.();
513
+ try {
514
+ const result = await httpClient.request(reqOpts);
515
+ sideEffects?.onSuccess?.(result);
516
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
517
+ } catch (err) {
518
+ const transformedError = (0, import_transform_error.transformError)(
519
+ err,
520
+ {
521
+ spreadPathsToArguments: {},
522
+ explicitPathsToArguments: { file: "$[0]" },
523
+ singleArgumentUnchanged: false
524
+ },
525
+ ["file"]
526
+ );
527
+ sideEffects?.onError?.(err);
528
+ throw transformedError;
529
+ }
530
+ }
531
+ async function redirectToDocument2(file) {
532
+ const { httpClient, sideEffects } = arguments[1];
533
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ file });
534
+ const reqOpts = redirectToDocument(payload);
535
+ sideEffects?.onSiteCall?.();
536
+ try {
537
+ const result = await httpClient.request(reqOpts);
538
+ sideEffects?.onSuccess?.(result);
539
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
540
+ } catch (err) {
541
+ const transformedError = (0, import_transform_error.transformError)(
542
+ err,
543
+ {
544
+ spreadPathsToArguments: {},
545
+ explicitPathsToArguments: { file: "$[0]" },
546
+ singleArgumentUnchanged: false
547
+ },
548
+ ["file"]
549
+ );
550
+ sideEffects?.onError?.(err);
551
+ throw transformedError;
552
+ }
553
+ }
519
554
  async function createDocument2(options) {
520
555
  const { httpClient, sideEffects } = arguments[1];
521
556
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
@@ -797,52 +832,6 @@ async function downloadDocumentSource2(documentId, options) {
797
832
  throw transformedError;
798
833
  }
799
834
  }
800
- async function getDownloadPage2(file) {
801
- const { httpClient, sideEffects } = arguments[1];
802
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ file });
803
- const reqOpts = getDownloadPage(payload);
804
- sideEffects?.onSiteCall?.();
805
- try {
806
- const result = await httpClient.request(reqOpts);
807
- sideEffects?.onSuccess?.(result);
808
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
809
- } catch (err) {
810
- const transformedError = (0, import_transform_error.transformError)(
811
- err,
812
- {
813
- spreadPathsToArguments: {},
814
- explicitPathsToArguments: { file: "$[0]" },
815
- singleArgumentUnchanged: false
816
- },
817
- ["file"]
818
- );
819
- sideEffects?.onError?.(err);
820
- throw transformedError;
821
- }
822
- }
823
- async function redirectToDocument2(file) {
824
- const { httpClient, sideEffects } = arguments[1];
825
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ file });
826
- const reqOpts = redirectToDocument(payload);
827
- sideEffects?.onSiteCall?.();
828
- try {
829
- const result = await httpClient.request(reqOpts);
830
- sideEffects?.onSuccess?.(result);
831
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
832
- } catch (err) {
833
- const transformedError = (0, import_transform_error.transformError)(
834
- err,
835
- {
836
- spreadPathsToArguments: {},
837
- explicitPathsToArguments: { file: "$[0]" },
838
- singleArgumentUnchanged: false
839
- },
840
- ["file"]
841
- );
842
- sideEffects?.onError?.(err);
843
- throw transformedError;
844
- }
845
- }
846
835
  // Annotate the CommonJS export names for ESM import in node:
847
836
  0 && (module.exports = {
848
837
  ContentDisposition,