@wix/auto_sdk_papyrus_documents 1.0.12 → 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.
@@ -1,7 +1,21 @@
1
1
  import { HttpClient, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
- import { CreateDocumentOptions, Document, GetDocumentOptions, DeleteDocumentResponse, UpdateDocumentOptions, UpdateDocumentResponse, DownloadDocumentOptions, DownloadDocumentResponse, DownloadDocumentApplicationErrors, GetDownloadUrlOptions, GetDownloadUrlResponse, DownloadDocumentSourceOptions, DownloadDocumentSourceResponse, DownloadDocumentSourceApplicationErrors, RawHttpResponse, DocumentCreatedEnvelope, DocumentDeletedEnvelope, DocumentRenderDelayedEnvelope, DocumentRenderFailedEnvelope, DocumentRenderedEnvelope, DocumentUpdatedEnvelope, DocumentQuery, QueryDocumentOptions, typedQueryDocument, DocumentsQueryBuilder } from './index.typings.js';
2
+ import { RawHttpResponse, CreateDocumentOptions, Document, GetDocumentOptions, DeleteDocumentResponse, UpdateDocumentOptions, UpdateDocumentResponse, DownloadDocumentOptions, DownloadDocumentResponse, DownloadDocumentApplicationErrors, GetDownloadUrlOptions, GetDownloadUrlResponse, DownloadDocumentSourceOptions, DownloadDocumentSourceResponse, DownloadDocumentSourceApplicationErrors, DocumentCreatedEnvelope, DocumentDeletedEnvelope, DocumentRenderDelayedEnvelope, DocumentRenderFailedEnvelope, DocumentRenderedEnvelope, DocumentUpdatedEnvelope, DocumentQuery, QueryDocumentOptions, typedQueryDocument, DocumentsQueryBuilder } from './index.typings.js';
3
3
  export { AccountInfo, AccountInfoMetadata, ActionEvent, AddressLocation, BackgroundSetting, BaseEventMetadata, CommonQueryWithEntityContext, ContentDisposition, ContentDispositionWithLiterals, CreateDocumentRequest, CreateDocumentResponse, CursorPaging, Cursors, DebugOptions, DeleteDocumentByExternalIdRequest, DeleteDocumentByExternalIdResponse, DeleteDocumentRequest, DocumentContent, DocumentFile, DocumentQuerySpec, DocumentRenderDelayed, DocumentRenderFailed, DocumentRendered, DocumentsQueryResult, DomainEvent, DomainEventBodyOneOf, DownloadDocumentRequest, DownloadDocumentSourceRequest, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, FocalPoint, Format, FormatWithLiterals, GetCachedHtmlRequest, GetDocumentRequest, GetDocumentResponse, GetDownloadPageRequest, GetDownloadUrlOptionsDocumentOneOf, GetDownloadUrlRequest, GetDownloadUrlRequestDocumentOneOf, GetRendererInfoRequest, GetRendererInfoResponse, HeadersEntry, IdentificationData, IdentificationDataIdOneOf, ImageSetting, MessageEnvelope, PageOverflow, PageOverflowWithLiterals, PageSettings, Paging, PagingMetadataV2, PaperSize, PaperSizeWithLiterals, QueryDocumentRequest, QueryDocumentResponse, QueryV2, QueryV2PagingMethodOneOf, RedirectToDocumentRequest, RenderDelayedEventConfig, RenderDocumentByIdRequest, RenderDocumentRequest, RenderFormat, RenderFormatWithLiterals, RenderStatus, RenderStatusWithLiterals, RequestedFields, RequestedFieldsWithLiterals, ResizeOption, ResizeOptionWithLiterals, RestoreInfo, SelectSetting, SettingsGroup, SortOrder, SortOrderWithLiterals, Sorting, TemplateSettings, TemplateSettingsOverride, TextContent, TextSetting, UpdateDocumentRequest, WebhookIdentityType, WebhookIdentityTypeWithLiterals, WixMpClientVersion, WixMpClientVersionWithLiterals, utils } from './index.typings.js';
4
4
 
5
+ declare function getDownloadPage$1(httpClient: HttpClient): GetDownloadPageSignature;
6
+ interface GetDownloadPageSignature {
7
+ /**
8
+ * Get Document.
9
+ */
10
+ (file: string | null): Promise<RawHttpResponse>;
11
+ }
12
+ declare function redirectToDocument$1(httpClient: HttpClient): RedirectToDocumentSignature;
13
+ interface RedirectToDocumentSignature {
14
+ /**
15
+ * Get Document.
16
+ */
17
+ (file: string | null): Promise<RawHttpResponse>;
18
+ }
5
19
  declare function createDocument$1(httpClient: HttpClient): CreateDocumentSignature;
6
20
  interface CreateDocumentSignature {
7
21
  /**
@@ -62,20 +76,6 @@ interface DownloadDocumentSourceSignature {
62
76
  __applicationErrorsType?: DownloadDocumentSourceApplicationErrors;
63
77
  }>;
64
78
  }
65
- declare function getDownloadPage$1(httpClient: HttpClient): GetDownloadPageSignature;
66
- interface GetDownloadPageSignature {
67
- /**
68
- * Get Document.
69
- */
70
- (file: string | null): Promise<RawHttpResponse>;
71
- }
72
- declare function redirectToDocument$1(httpClient: HttpClient): RedirectToDocumentSignature;
73
- interface RedirectToDocumentSignature {
74
- /**
75
- * Get Document.
76
- */
77
- (file: string | null): Promise<RawHttpResponse>;
78
- }
79
79
  declare const onDocumentCreated$1: EventDefinition<DocumentCreatedEnvelope, "wix.papyrus.v1.document_created">;
80
80
  declare const onDocumentDeleted$1: EventDefinition<DocumentDeletedEnvelope, "wix.papyrus.v1.document_deleted">;
81
81
  declare const onDocumentRenderDelayed$1: EventDefinition<DocumentRenderDelayedEnvelope, "wix.papyrus.v1.document_document_render_delayed">;
@@ -87,6 +87,8 @@ declare function customQueryDocument(httpClient: HttpClient): {
87
87
  (query: DocumentQuery, options?: QueryDocumentOptions): ReturnType<typeof typedQueryDocument>;
88
88
  (options?: QueryDocumentOptions): DocumentsQueryBuilder;
89
89
  };
90
+ declare const getDownloadPage: MaybeContext<BuildRESTFunction<typeof getDownloadPage$1> & typeof getDownloadPage$1>;
91
+ declare const redirectToDocument: MaybeContext<BuildRESTFunction<typeof redirectToDocument$1> & typeof redirectToDocument$1>;
90
92
  declare const createDocument: MaybeContext<BuildRESTFunction<typeof createDocument$1> & typeof createDocument$1>;
91
93
  declare const getDocument: MaybeContext<BuildRESTFunction<typeof getDocument$1> & typeof getDocument$1>;
92
94
  declare const deleteDocument: MaybeContext<BuildRESTFunction<typeof deleteDocument$1> & typeof deleteDocument$1>;
@@ -94,8 +96,6 @@ declare const updateDocument: MaybeContext<BuildRESTFunction<typeof updateDocume
94
96
  declare const downloadDocument: MaybeContext<BuildRESTFunction<typeof downloadDocument$1> & typeof downloadDocument$1>;
95
97
  declare const getDownloadUrl: MaybeContext<BuildRESTFunction<typeof getDownloadUrl$1> & typeof getDownloadUrl$1>;
96
98
  declare const downloadDocumentSource: MaybeContext<BuildRESTFunction<typeof downloadDocumentSource$1> & typeof downloadDocumentSource$1>;
97
- declare const getDownloadPage: MaybeContext<BuildRESTFunction<typeof getDownloadPage$1> & typeof getDownloadPage$1>;
98
- declare const redirectToDocument: MaybeContext<BuildRESTFunction<typeof redirectToDocument$1> & typeof redirectToDocument$1>;
99
99
  declare const queryDocument: MaybeContext<BuildRESTFunction<typeof customQueryDocument> & typeof customQueryDocument>;
100
100
  /** */
101
101
  declare const onDocumentCreated: BuildEventDefinition<typeof onDocumentCreated$1> & typeof onDocumentCreated$1;
@@ -70,23 +70,23 @@ var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
70
70
  var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
71
71
  var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
72
72
  var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
73
- var TRANSFORM_PATHS_0 = [
73
+ var TRANSFORM_PATHS_0 = [{ path: "body" }];
74
+ var TRANSFORM_PATHS_1 = [
74
75
  { path: "document.createdDate" },
75
76
  { path: "document.updatedDate" },
76
77
  { path: "document.expirationDate" }
77
78
  ];
78
- var TRANSFORM_PATHS_1 = [
79
+ var TRANSFORM_PATHS_2 = [
79
80
  { path: "query.sort.origin.latitude" },
80
81
  { path: "query.sort.origin.longitude" }
81
82
  ];
82
- var TRANSFORM_PATHS_2 = [
83
+ var TRANSFORM_PATHS_3 = [
83
84
  { path: "documents.createdDate" },
84
85
  { path: "documents.updatedDate" },
85
86
  { path: "documents.expirationDate" }
86
87
  ];
87
- var TRANSFORM_PATHS_3 = [{ path: "expirationDate" }];
88
- var TRANSFORM_PATHS_4 = [{ path: "body" }];
89
- function resolveWixPapyrusV1DownloadPageControllerUrl(opts) {
88
+ var TRANSFORM_PATHS_4 = [{ path: "expirationDate" }];
89
+ function resolveWixPapyrusV1DocumentServiceUrl(opts) {
90
90
  const domainToMappings = {
91
91
  "api._base_domain_": [
92
92
  {
@@ -129,7 +129,7 @@ function resolveWixPapyrusV1DownloadPageControllerUrl(opts) {
129
129
  };
130
130
  return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
131
131
  }
132
- function resolveWixPapyrusV1DocumentServiceUrl(opts) {
132
+ function resolveWixPapyrusV1DownloadPageControllerUrl(opts) {
133
133
  const domainToMappings = {
134
134
  "api._base_domain_": [
135
135
  {
@@ -173,12 +173,66 @@ function resolveWixPapyrusV1DocumentServiceUrl(opts) {
173
173
  return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
174
174
  }
175
175
  var PACKAGE_NAME = "@wix/auto_sdk_papyrus_documents";
176
+ function getDownloadPage(payload) {
177
+ function __getDownloadPage({ host }) {
178
+ const metadata = {
179
+ entityFqdn: "wix.papyrus.v1.document",
180
+ method: "GET",
181
+ methodFqn: "wix.papyrus.v1.DownloadPageController.GetDownloadPage",
182
+ packageName: PACKAGE_NAME,
183
+ migrationOptions: {
184
+ optInTransformResponse: true
185
+ },
186
+ url: resolveWixPapyrusV1DownloadPageControllerUrl({
187
+ protoPath: "/download",
188
+ data: payload,
189
+ host
190
+ }),
191
+ params: (0, import_rest_modules.toURLSearchParams)(payload),
192
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
193
+ {
194
+ transformFn: import_bytes.transformRESTBytesToSDKBytes,
195
+ paths: TRANSFORM_PATHS_0
196
+ }
197
+ ])
198
+ };
199
+ return metadata;
200
+ }
201
+ return __getDownloadPage;
202
+ }
203
+ function redirectToDocument(payload) {
204
+ function __redirectToDocument({ host }) {
205
+ const metadata = {
206
+ entityFqdn: "wix.papyrus.v1.document",
207
+ method: "GET",
208
+ methodFqn: "wix.papyrus.v1.DownloadPageController.RedirectToDocument",
209
+ packageName: PACKAGE_NAME,
210
+ migrationOptions: {
211
+ optInTransformResponse: true
212
+ },
213
+ url: resolveWixPapyrusV1DownloadPageControllerUrl({
214
+ protoPath: "/view",
215
+ data: payload,
216
+ host
217
+ }),
218
+ params: (0, import_rest_modules.toURLSearchParams)(payload),
219
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
220
+ {
221
+ transformFn: import_bytes.transformRESTBytesToSDKBytes,
222
+ paths: TRANSFORM_PATHS_0
223
+ }
224
+ ])
225
+ };
226
+ return metadata;
227
+ }
228
+ return __redirectToDocument;
229
+ }
176
230
  function createDocument(payload) {
177
231
  function __createDocument({ host }) {
178
232
  const serializedData = (0, import_transform_paths.transformPaths)(payload, [
179
233
  {
180
234
  transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
181
- paths: TRANSFORM_PATHS_0
235
+ paths: TRANSFORM_PATHS_1
182
236
  }
183
237
  ]);
184
238
  const metadata = {
@@ -198,7 +252,7 @@ function createDocument(payload) {
198
252
  transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
199
253
  {
200
254
  transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
201
- paths: TRANSFORM_PATHS_0
255
+ paths: TRANSFORM_PATHS_1
202
256
  }
203
257
  ])
204
258
  };
@@ -225,7 +279,7 @@ function getDocument(payload) {
225
279
  transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
226
280
  {
227
281
  transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
228
- paths: TRANSFORM_PATHS_0
282
+ paths: TRANSFORM_PATHS_1
229
283
  }
230
284
  ])
231
285
  };
@@ -252,7 +306,7 @@ function deleteDocument(payload) {
252
306
  transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
253
307
  {
254
308
  transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
255
- paths: TRANSFORM_PATHS_0
309
+ paths: TRANSFORM_PATHS_1
256
310
  }
257
311
  ])
258
312
  };
@@ -265,7 +319,7 @@ function queryDocument(payload) {
265
319
  const serializedData = (0, import_transform_paths.transformPaths)(payload, [
266
320
  {
267
321
  transformFn: import_float.transformSDKFloatToRESTFloat,
268
- paths: TRANSFORM_PATHS_1
322
+ paths: TRANSFORM_PATHS_2
269
323
  }
270
324
  ]);
271
325
  const metadata = {
@@ -285,7 +339,7 @@ function queryDocument(payload) {
285
339
  transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
286
340
  {
287
341
  transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
288
- paths: TRANSFORM_PATHS_2
342
+ paths: TRANSFORM_PATHS_3
289
343
  }
290
344
  ])
291
345
  };
@@ -312,7 +366,7 @@ function updateDocument(payload) {
312
366
  transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
313
367
  {
314
368
  transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
315
- paths: TRANSFORM_PATHS_0
369
+ paths: TRANSFORM_PATHS_1
316
370
  }
317
371
  ])
318
372
  };
@@ -339,7 +393,7 @@ function downloadDocument(payload) {
339
393
  transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
340
394
  {
341
395
  transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
342
- paths: TRANSFORM_PATHS_3
396
+ paths: TRANSFORM_PATHS_4
343
397
  }
344
398
  ])
345
399
  };
@@ -366,7 +420,7 @@ function getDownloadUrl(payload) {
366
420
  transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
367
421
  {
368
422
  transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
369
- paths: TRANSFORM_PATHS_3
423
+ paths: TRANSFORM_PATHS_4
370
424
  }
371
425
  ])
372
426
  };
@@ -395,60 +449,6 @@ function downloadDocumentSource(payload) {
395
449
  }
396
450
  return __downloadDocumentSource;
397
451
  }
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: TRANSFORM_PATHS_4
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: TRANSFORM_PATHS_4
445
- }
446
- ])
447
- };
448
- return metadata;
449
- }
450
- return __redirectToDocument;
451
- }
452
452
 
453
453
  // src/papyrus-v1-document-documents.universal.ts
454
454
  var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
@@ -473,6 +473,26 @@ var WixMpClientVersion = /* @__PURE__ */ ((WixMpClientVersion2) => {
473
473
  WixMpClientVersion2["MP_V2"] = "MP_V2";
474
474
  return WixMpClientVersion2;
475
475
  })(WixMpClientVersion || {});
476
+ var ResizeOption = /* @__PURE__ */ ((ResizeOption2) => {
477
+ ResizeOption2["FIT"] = "FIT";
478
+ ResizeOption2["CROP"] = "CROP";
479
+ return ResizeOption2;
480
+ })(ResizeOption || {});
481
+ var PaperSize = /* @__PURE__ */ ((PaperSize2) => {
482
+ PaperSize2["A4_PORTRAIT"] = "A4_PORTRAIT";
483
+ PaperSize2["A4_LANDSCAPE"] = "A4_LANDSCAPE";
484
+ return PaperSize2;
485
+ })(PaperSize || {});
486
+ var PageOverflow = /* @__PURE__ */ ((PageOverflow2) => {
487
+ PageOverflow2["CONTENT_HIDDEN"] = "CONTENT_HIDDEN";
488
+ PageOverflow2["CONTENT_BREAK"] = "CONTENT_BREAK";
489
+ return PageOverflow2;
490
+ })(PageOverflow || {});
491
+ var RenderFormat = /* @__PURE__ */ ((RenderFormat2) => {
492
+ RenderFormat2["PDF"] = "PDF";
493
+ RenderFormat2["HTML"] = "HTML";
494
+ return RenderFormat2;
495
+ })(RenderFormat || {});
476
496
  var RequestedFields = /* @__PURE__ */ ((RequestedFields2) => {
477
497
  RequestedFields2["DOCUMENT_CONTENT"] = "DOCUMENT_CONTENT";
478
498
  return RequestedFields2;
@@ -496,26 +516,52 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
496
516
  WebhookIdentityType2["APP"] = "APP";
497
517
  return WebhookIdentityType2;
498
518
  })(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 || {});
519
+ async function getDownloadPage2(file) {
520
+ const { httpClient, sideEffects } = arguments[1];
521
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ file });
522
+ const reqOpts = getDownloadPage(payload);
523
+ sideEffects?.onSiteCall?.();
524
+ try {
525
+ const result = await httpClient.request(reqOpts);
526
+ sideEffects?.onSuccess?.(result);
527
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
528
+ } catch (err) {
529
+ const transformedError = (0, import_transform_error.transformError)(
530
+ err,
531
+ {
532
+ spreadPathsToArguments: {},
533
+ explicitPathsToArguments: { file: "$[0]" },
534
+ singleArgumentUnchanged: false
535
+ },
536
+ ["file"]
537
+ );
538
+ sideEffects?.onError?.(err);
539
+ throw transformedError;
540
+ }
541
+ }
542
+ async function redirectToDocument2(file) {
543
+ const { httpClient, sideEffects } = arguments[1];
544
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ file });
545
+ const reqOpts = redirectToDocument(payload);
546
+ sideEffects?.onSiteCall?.();
547
+ try {
548
+ const result = await httpClient.request(reqOpts);
549
+ sideEffects?.onSuccess?.(result);
550
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
551
+ } catch (err) {
552
+ const transformedError = (0, import_transform_error.transformError)(
553
+ err,
554
+ {
555
+ spreadPathsToArguments: {},
556
+ explicitPathsToArguments: { file: "$[0]" },
557
+ singleArgumentUnchanged: false
558
+ },
559
+ ["file"]
560
+ );
561
+ sideEffects?.onError?.(err);
562
+ throw transformedError;
563
+ }
564
+ }
519
565
  async function createDocument2(options) {
520
566
  const { httpClient, sideEffects } = arguments[1];
521
567
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
@@ -797,52 +843,6 @@ async function downloadDocumentSource2(documentId, options) {
797
843
  throw transformedError;
798
844
  }
799
845
  }
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
846
 
847
847
  // src/papyrus-v1-document-documents.public.ts
848
848
  var TRANSFORM_PATHS_02 = [
@@ -863,6 +863,20 @@ var TRANSFORM_PATHS_22 = [
863
863
  { path: "data.document.expirationDate" },
864
864
  { path: "metadata.eventTime" }
865
865
  ];
866
+ function getDownloadPage3(httpClient) {
867
+ return (file) => getDownloadPage2(
868
+ file,
869
+ // @ts-ignore
870
+ { httpClient }
871
+ );
872
+ }
873
+ function redirectToDocument3(httpClient) {
874
+ return (file) => redirectToDocument2(
875
+ file,
876
+ // @ts-ignore
877
+ { httpClient }
878
+ );
879
+ }
866
880
  function createDocument3(httpClient) {
867
881
  return (options) => createDocument2(
868
882
  options,
@@ -931,20 +945,6 @@ function downloadDocumentSource3(httpClient) {
931
945
  { httpClient }
932
946
  );
933
947
  }
934
- function getDownloadPage3(httpClient) {
935
- return (file) => getDownloadPage2(
936
- file,
937
- // @ts-ignore
938
- { httpClient }
939
- );
940
- }
941
- function redirectToDocument3(httpClient) {
942
- return (file) => redirectToDocument2(
943
- file,
944
- // @ts-ignore
945
- { httpClient }
946
- );
947
- }
948
948
  var onDocumentCreated = /* @__PURE__ */ (0, import_sdk_types.EventDefinition)(
949
949
  "wix.papyrus.v1.document_created",
950
950
  true,
@@ -1033,6 +1033,8 @@ function customQueryDocument(httpClient) {
1033
1033
  }
1034
1034
  return overloadedQuery;
1035
1035
  }
1036
+ var getDownloadPage4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getDownloadPage3);
1037
+ var redirectToDocument4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(redirectToDocument3);
1036
1038
  var createDocument4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createDocument3);
1037
1039
  var getDocument4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getDocument3);
1038
1040
  var deleteDocument4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deleteDocument3);
@@ -1040,8 +1042,6 @@ var updateDocument4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)
1040
1042
  var downloadDocument4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(downloadDocument3);
1041
1043
  var getDownloadUrl4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getDownloadUrl3);
1042
1044
  var downloadDocumentSource4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(downloadDocumentSource3);
1043
- var getDownloadPage4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getDownloadPage3);
1044
- var redirectToDocument4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(redirectToDocument3);
1045
1045
  var queryDocument4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(customQueryDocument);
1046
1046
  var onDocumentCreated2 = /* @__PURE__ */ (0, import_event_definition_modules.createEventModule)(
1047
1047
  onDocumentCreated