@wix/auto_sdk_papyrus_documents 1.0.1 → 1.0.3

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 (49) hide show
  1. package/build/cjs/index.d.ts +17 -17
  2. package/build/cjs/index.js +138 -138
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +524 -524
  5. package/build/cjs/index.typings.js +122 -122
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +529 -529
  8. package/build/cjs/meta.js +112 -112
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/cjs/schemas.d.ts +22 -22
  11. package/build/cjs/schemas.js +298 -260
  12. package/build/cjs/schemas.js.map +1 -1
  13. package/build/es/index.d.mts +17 -17
  14. package/build/es/index.mjs +138 -138
  15. package/build/es/index.mjs.map +1 -1
  16. package/build/es/index.typings.d.mts +524 -524
  17. package/build/es/index.typings.mjs +122 -122
  18. package/build/es/index.typings.mjs.map +1 -1
  19. package/build/es/meta.d.mts +529 -529
  20. package/build/es/meta.mjs +112 -112
  21. package/build/es/meta.mjs.map +1 -1
  22. package/build/es/schemas.d.mts +22 -22
  23. package/build/es/schemas.mjs +298 -260
  24. package/build/es/schemas.mjs.map +1 -1
  25. package/build/internal/cjs/index.d.ts +17 -17
  26. package/build/internal/cjs/index.typings.d.ts +550 -550
  27. package/build/internal/cjs/meta.d.ts +560 -560
  28. package/build/internal/cjs/schemas.d.ts +22 -22
  29. package/build/internal/es/index.d.mts +17 -17
  30. package/build/internal/es/index.typings.d.mts +550 -550
  31. package/build/internal/es/meta.d.mts +560 -560
  32. package/build/internal/es/schemas.d.mts +22 -22
  33. package/package.json +2 -2
  34. package/build/internal/cjs/index.js +0 -1118
  35. package/build/internal/cjs/index.js.map +0 -1
  36. package/build/internal/cjs/index.typings.js +0 -872
  37. package/build/internal/cjs/index.typings.js.map +0 -1
  38. package/build/internal/cjs/meta.js +0 -716
  39. package/build/internal/cjs/meta.js.map +0 -1
  40. package/build/internal/cjs/schemas.js +0 -666
  41. package/build/internal/cjs/schemas.js.map +0 -1
  42. package/build/internal/es/index.mjs +0 -1067
  43. package/build/internal/es/index.mjs.map +0 -1
  44. package/build/internal/es/index.typings.mjs +0 -826
  45. package/build/internal/es/index.typings.mjs.map +0 -1
  46. package/build/internal/es/meta.mjs +0 -669
  47. package/build/internal/es/meta.mjs.map +0 -1
  48. package/build/internal/es/schemas.mjs +0 -610
  49. package/build/internal/es/schemas.mjs.map +0 -1
@@ -14,7 +14,7 @@ import { transformSDKTimestampToRESTTimestamp } from "@wix/sdk-runtime/transform
14
14
  import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
15
15
  import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
16
16
  import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
17
- function resolveWixPapyrusV1DownloadPageControllerUrl(opts) {
17
+ function resolveWixPapyrusV1DocumentServiceUrl(opts) {
18
18
  const domainToMappings = {
19
19
  "api._base_domain_": [
20
20
  {
@@ -57,7 +57,7 @@ function resolveWixPapyrusV1DownloadPageControllerUrl(opts) {
57
57
  };
58
58
  return resolveUrl(Object.assign(opts, { domainToMappings }));
59
59
  }
60
- function resolveWixPapyrusV1DocumentServiceUrl(opts) {
60
+ function resolveWixPapyrusV1DownloadPageControllerUrl(opts) {
61
61
  const domainToMappings = {
62
62
  "api._base_domain_": [
63
63
  {
@@ -101,6 +101,60 @@ function resolveWixPapyrusV1DocumentServiceUrl(opts) {
101
101
  return resolveUrl(Object.assign(opts, { domainToMappings }));
102
102
  }
103
103
  var PACKAGE_NAME = "@wix/auto_sdk_papyrus_documents";
104
+ function getDownloadPage(payload) {
105
+ function __getDownloadPage({ host }) {
106
+ const metadata = {
107
+ entityFqdn: "wix.papyrus.v1.document",
108
+ method: "GET",
109
+ methodFqn: "wix.papyrus.v1.DownloadPageController.GetDownloadPage",
110
+ packageName: PACKAGE_NAME,
111
+ migrationOptions: {
112
+ optInTransformResponse: true
113
+ },
114
+ url: resolveWixPapyrusV1DownloadPageControllerUrl({
115
+ protoPath: "/download",
116
+ data: payload,
117
+ host
118
+ }),
119
+ params: toURLSearchParams(payload),
120
+ transformResponse: (payload2) => transformPaths(payload2, [
121
+ {
122
+ transformFn: transformRESTBytesToSDKBytes,
123
+ paths: [{ path: "body" }]
124
+ }
125
+ ])
126
+ };
127
+ return metadata;
128
+ }
129
+ return __getDownloadPage;
130
+ }
131
+ function redirectToDocument(payload) {
132
+ function __redirectToDocument({ host }) {
133
+ const metadata = {
134
+ entityFqdn: "wix.papyrus.v1.document",
135
+ method: "GET",
136
+ methodFqn: "wix.papyrus.v1.DownloadPageController.RedirectToDocument",
137
+ packageName: PACKAGE_NAME,
138
+ migrationOptions: {
139
+ optInTransformResponse: true
140
+ },
141
+ url: resolveWixPapyrusV1DownloadPageControllerUrl({
142
+ protoPath: "/view",
143
+ data: payload,
144
+ host
145
+ }),
146
+ params: toURLSearchParams(payload),
147
+ transformResponse: (payload2) => transformPaths(payload2, [
148
+ {
149
+ transformFn: transformRESTBytesToSDKBytes,
150
+ paths: [{ path: "body" }]
151
+ }
152
+ ])
153
+ };
154
+ return metadata;
155
+ }
156
+ return __redirectToDocument;
157
+ }
104
158
  function createDocument(payload) {
105
159
  function __createDocument({ host }) {
106
160
  const serializedData = transformPaths(payload, [
@@ -350,60 +404,6 @@ function downloadDocumentSource(payload) {
350
404
  }
351
405
  return __downloadDocumentSource;
352
406
  }
353
- function getDownloadPage(payload) {
354
- function __getDownloadPage({ host }) {
355
- const metadata = {
356
- entityFqdn: "wix.papyrus.v1.document",
357
- method: "GET",
358
- methodFqn: "wix.papyrus.v1.DownloadPageController.GetDownloadPage",
359
- packageName: PACKAGE_NAME,
360
- migrationOptions: {
361
- optInTransformResponse: true
362
- },
363
- url: resolveWixPapyrusV1DownloadPageControllerUrl({
364
- protoPath: "/download",
365
- data: payload,
366
- host
367
- }),
368
- params: toURLSearchParams(payload),
369
- transformResponse: (payload2) => transformPaths(payload2, [
370
- {
371
- transformFn: transformRESTBytesToSDKBytes,
372
- paths: [{ path: "body" }]
373
- }
374
- ])
375
- };
376
- return metadata;
377
- }
378
- return __getDownloadPage;
379
- }
380
- function redirectToDocument(payload) {
381
- function __redirectToDocument({ host }) {
382
- const metadata = {
383
- entityFqdn: "wix.papyrus.v1.document",
384
- method: "GET",
385
- methodFqn: "wix.papyrus.v1.DownloadPageController.RedirectToDocument",
386
- packageName: PACKAGE_NAME,
387
- migrationOptions: {
388
- optInTransformResponse: true
389
- },
390
- url: resolveWixPapyrusV1DownloadPageControllerUrl({
391
- protoPath: "/view",
392
- data: payload,
393
- host
394
- }),
395
- params: toURLSearchParams(payload),
396
- transformResponse: (payload2) => transformPaths(payload2, [
397
- {
398
- transformFn: transformRESTBytesToSDKBytes,
399
- paths: [{ path: "body" }]
400
- }
401
- ])
402
- };
403
- return metadata;
404
- }
405
- return __redirectToDocument;
406
- }
407
407
 
408
408
  // src/papyrus-v1-document-documents.universal.ts
409
409
  import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
@@ -428,6 +428,26 @@ var WixMpClientVersion = /* @__PURE__ */ ((WixMpClientVersion2) => {
428
428
  WixMpClientVersion2["MP_V2"] = "MP_V2";
429
429
  return WixMpClientVersion2;
430
430
  })(WixMpClientVersion || {});
431
+ var ResizeOption = /* @__PURE__ */ ((ResizeOption2) => {
432
+ ResizeOption2["FIT"] = "FIT";
433
+ ResizeOption2["CROP"] = "CROP";
434
+ return ResizeOption2;
435
+ })(ResizeOption || {});
436
+ var PaperSize = /* @__PURE__ */ ((PaperSize2) => {
437
+ PaperSize2["A4_PORTRAIT"] = "A4_PORTRAIT";
438
+ PaperSize2["A4_LANDSCAPE"] = "A4_LANDSCAPE";
439
+ return PaperSize2;
440
+ })(PaperSize || {});
441
+ var PageOverflow = /* @__PURE__ */ ((PageOverflow2) => {
442
+ PageOverflow2["CONTENT_HIDDEN"] = "CONTENT_HIDDEN";
443
+ PageOverflow2["CONTENT_BREAK"] = "CONTENT_BREAK";
444
+ return PageOverflow2;
445
+ })(PageOverflow || {});
446
+ var RenderFormat = /* @__PURE__ */ ((RenderFormat2) => {
447
+ RenderFormat2["PDF"] = "PDF";
448
+ RenderFormat2["HTML"] = "HTML";
449
+ return RenderFormat2;
450
+ })(RenderFormat || {});
431
451
  var RequestedFields = /* @__PURE__ */ ((RequestedFields2) => {
432
452
  RequestedFields2["DOCUMENT_CONTENT"] = "DOCUMENT_CONTENT";
433
453
  return RequestedFields2;
@@ -451,26 +471,52 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
451
471
  WebhookIdentityType2["APP"] = "APP";
452
472
  return WebhookIdentityType2;
453
473
  })(WebhookIdentityType || {});
454
- var ResizeOption = /* @__PURE__ */ ((ResizeOption2) => {
455
- ResizeOption2["FIT"] = "FIT";
456
- ResizeOption2["CROP"] = "CROP";
457
- return ResizeOption2;
458
- })(ResizeOption || {});
459
- var PaperSize = /* @__PURE__ */ ((PaperSize2) => {
460
- PaperSize2["A4_PORTRAIT"] = "A4_PORTRAIT";
461
- PaperSize2["A4_LANDSCAPE"] = "A4_LANDSCAPE";
462
- return PaperSize2;
463
- })(PaperSize || {});
464
- var PageOverflow = /* @__PURE__ */ ((PageOverflow2) => {
465
- PageOverflow2["CONTENT_HIDDEN"] = "CONTENT_HIDDEN";
466
- PageOverflow2["CONTENT_BREAK"] = "CONTENT_BREAK";
467
- return PageOverflow2;
468
- })(PageOverflow || {});
469
- var RenderFormat = /* @__PURE__ */ ((RenderFormat2) => {
470
- RenderFormat2["PDF"] = "PDF";
471
- RenderFormat2["HTML"] = "HTML";
472
- return RenderFormat2;
473
- })(RenderFormat || {});
474
+ async function getDownloadPage2(file) {
475
+ const { httpClient, sideEffects } = arguments[1];
476
+ const payload = renameKeysFromSDKRequestToRESTRequest({ file });
477
+ const reqOpts = getDownloadPage(payload);
478
+ sideEffects?.onSiteCall?.();
479
+ try {
480
+ const result = await httpClient.request(reqOpts);
481
+ sideEffects?.onSuccess?.(result);
482
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
483
+ } catch (err) {
484
+ const transformedError = sdkTransformError(
485
+ err,
486
+ {
487
+ spreadPathsToArguments: {},
488
+ explicitPathsToArguments: { file: "$[0]" },
489
+ singleArgumentUnchanged: false
490
+ },
491
+ ["file"]
492
+ );
493
+ sideEffects?.onError?.(err);
494
+ throw transformedError;
495
+ }
496
+ }
497
+ async function redirectToDocument2(file) {
498
+ const { httpClient, sideEffects } = arguments[1];
499
+ const payload = renameKeysFromSDKRequestToRESTRequest({ file });
500
+ const reqOpts = redirectToDocument(payload);
501
+ sideEffects?.onSiteCall?.();
502
+ try {
503
+ const result = await httpClient.request(reqOpts);
504
+ sideEffects?.onSuccess?.(result);
505
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
506
+ } catch (err) {
507
+ const transformedError = sdkTransformError(
508
+ err,
509
+ {
510
+ spreadPathsToArguments: {},
511
+ explicitPathsToArguments: { file: "$[0]" },
512
+ singleArgumentUnchanged: false
513
+ },
514
+ ["file"]
515
+ );
516
+ sideEffects?.onError?.(err);
517
+ throw transformedError;
518
+ }
519
+ }
474
520
  async function createDocument2(options) {
475
521
  const { httpClient, sideEffects } = arguments[1];
476
522
  const payload = renameKeysFromSDKRequestToRESTRequest({
@@ -752,52 +798,6 @@ async function downloadDocumentSource2(documentId, options) {
752
798
  throw transformedError;
753
799
  }
754
800
  }
755
- async function getDownloadPage2(file) {
756
- const { httpClient, sideEffects } = arguments[1];
757
- const payload = renameKeysFromSDKRequestToRESTRequest({ file });
758
- const reqOpts = getDownloadPage(payload);
759
- sideEffects?.onSiteCall?.();
760
- try {
761
- const result = await httpClient.request(reqOpts);
762
- sideEffects?.onSuccess?.(result);
763
- return renameKeysFromRESTResponseToSDKResponse(result.data);
764
- } catch (err) {
765
- const transformedError = sdkTransformError(
766
- err,
767
- {
768
- spreadPathsToArguments: {},
769
- explicitPathsToArguments: { file: "$[0]" },
770
- singleArgumentUnchanged: false
771
- },
772
- ["file"]
773
- );
774
- sideEffects?.onError?.(err);
775
- throw transformedError;
776
- }
777
- }
778
- async function redirectToDocument2(file) {
779
- const { httpClient, sideEffects } = arguments[1];
780
- const payload = renameKeysFromSDKRequestToRESTRequest({ file });
781
- const reqOpts = redirectToDocument(payload);
782
- sideEffects?.onSiteCall?.();
783
- try {
784
- const result = await httpClient.request(reqOpts);
785
- sideEffects?.onSuccess?.(result);
786
- return renameKeysFromRESTResponseToSDKResponse(result.data);
787
- } catch (err) {
788
- const transformedError = sdkTransformError(
789
- err,
790
- {
791
- spreadPathsToArguments: {},
792
- explicitPathsToArguments: { file: "$[0]" },
793
- singleArgumentUnchanged: false
794
- },
795
- ["file"]
796
- );
797
- sideEffects?.onError?.(err);
798
- throw transformedError;
799
- }
800
- }
801
801
  export {
802
802
  ContentDisposition,
803
803
  Format,