@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.
@@ -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,7 +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
- function resolveWixPapyrusV1DownloadPageControllerUrl(opts) {
73
+ var TRANSFORM_PATHS_0 = [{ path: "body" }];
74
+ var TRANSFORM_PATHS_1 = [
75
+ { path: "document.createdDate" },
76
+ { path: "document.updatedDate" },
77
+ { path: "document.expirationDate" }
78
+ ];
79
+ var TRANSFORM_PATHS_2 = [
80
+ { path: "query.sort.origin.latitude" },
81
+ { path: "query.sort.origin.longitude" }
82
+ ];
83
+ var TRANSFORM_PATHS_3 = [
84
+ { path: "documents.createdDate" },
85
+ { path: "documents.updatedDate" },
86
+ { path: "documents.expirationDate" }
87
+ ];
88
+ var TRANSFORM_PATHS_4 = [{ path: "expirationDate" }];
89
+ function resolveWixPapyrusV1DocumentServiceUrl(opts) {
74
90
  const domainToMappings = {
75
91
  "api._base_domain_": [
76
92
  {
@@ -113,7 +129,7 @@ function resolveWixPapyrusV1DownloadPageControllerUrl(opts) {
113
129
  };
114
130
  return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
115
131
  }
116
- function resolveWixPapyrusV1DocumentServiceUrl(opts) {
132
+ function resolveWixPapyrusV1DownloadPageControllerUrl(opts) {
117
133
  const domainToMappings = {
118
134
  "api._base_domain_": [
119
135
  {
@@ -157,16 +173,66 @@ function resolveWixPapyrusV1DocumentServiceUrl(opts) {
157
173
  return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
158
174
  }
159
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
+ }
160
230
  function createDocument(payload) {
161
231
  function __createDocument({ host }) {
162
232
  const serializedData = (0, import_transform_paths.transformPaths)(payload, [
163
233
  {
164
234
  transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
165
- paths: [
166
- { path: "document.createdDate" },
167
- { path: "document.updatedDate" },
168
- { path: "document.expirationDate" }
169
- ]
235
+ paths: TRANSFORM_PATHS_1
170
236
  }
171
237
  ]);
172
238
  const metadata = {
@@ -186,11 +252,7 @@ function createDocument(payload) {
186
252
  transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
187
253
  {
188
254
  transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
189
- paths: [
190
- { path: "document.createdDate" },
191
- { path: "document.updatedDate" },
192
- { path: "document.expirationDate" }
193
- ]
255
+ paths: TRANSFORM_PATHS_1
194
256
  }
195
257
  ])
196
258
  };
@@ -217,11 +279,7 @@ function getDocument(payload) {
217
279
  transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
218
280
  {
219
281
  transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
220
- paths: [
221
- { path: "document.createdDate" },
222
- { path: "document.updatedDate" },
223
- { path: "document.expirationDate" }
224
- ]
282
+ paths: TRANSFORM_PATHS_1
225
283
  }
226
284
  ])
227
285
  };
@@ -248,11 +306,7 @@ function deleteDocument(payload) {
248
306
  transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
249
307
  {
250
308
  transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
251
- paths: [
252
- { path: "document.createdDate" },
253
- { path: "document.updatedDate" },
254
- { path: "document.expirationDate" }
255
- ]
309
+ paths: TRANSFORM_PATHS_1
256
310
  }
257
311
  ])
258
312
  };
@@ -265,10 +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: [
269
- { path: "query.sort.origin.latitude" },
270
- { path: "query.sort.origin.longitude" }
271
- ]
322
+ paths: TRANSFORM_PATHS_2
272
323
  }
273
324
  ]);
274
325
  const metadata = {
@@ -288,11 +339,7 @@ function queryDocument(payload) {
288
339
  transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
289
340
  {
290
341
  transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
291
- paths: [
292
- { path: "documents.createdDate" },
293
- { path: "documents.updatedDate" },
294
- { path: "documents.expirationDate" }
295
- ]
342
+ paths: TRANSFORM_PATHS_3
296
343
  }
297
344
  ])
298
345
  };
@@ -319,11 +366,7 @@ function updateDocument(payload) {
319
366
  transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
320
367
  {
321
368
  transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
322
- paths: [
323
- { path: "document.createdDate" },
324
- { path: "document.updatedDate" },
325
- { path: "document.expirationDate" }
326
- ]
369
+ paths: TRANSFORM_PATHS_1
327
370
  }
328
371
  ])
329
372
  };
@@ -350,7 +393,7 @@ function downloadDocument(payload) {
350
393
  transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
351
394
  {
352
395
  transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
353
- paths: [{ path: "expirationDate" }]
396
+ paths: TRANSFORM_PATHS_4
354
397
  }
355
398
  ])
356
399
  };
@@ -377,7 +420,7 @@ function getDownloadUrl(payload) {
377
420
  transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
378
421
  {
379
422
  transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
380
- paths: [{ path: "expirationDate" }]
423
+ paths: TRANSFORM_PATHS_4
381
424
  }
382
425
  ])
383
426
  };
@@ -406,60 +449,6 @@ function downloadDocumentSource(payload) {
406
449
  }
407
450
  return __downloadDocumentSource;
408
451
  }
409
- function getDownloadPage(payload) {
410
- function __getDownloadPage({ host }) {
411
- const metadata = {
412
- entityFqdn: "wix.papyrus.v1.document",
413
- method: "GET",
414
- methodFqn: "wix.papyrus.v1.DownloadPageController.GetDownloadPage",
415
- packageName: PACKAGE_NAME,
416
- migrationOptions: {
417
- optInTransformResponse: true
418
- },
419
- url: resolveWixPapyrusV1DownloadPageControllerUrl({
420
- protoPath: "/download",
421
- data: payload,
422
- host
423
- }),
424
- params: (0, import_rest_modules.toURLSearchParams)(payload),
425
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
426
- {
427
- transformFn: import_bytes.transformRESTBytesToSDKBytes,
428
- paths: [{ path: "body" }]
429
- }
430
- ])
431
- };
432
- return metadata;
433
- }
434
- return __getDownloadPage;
435
- }
436
- function redirectToDocument(payload) {
437
- function __redirectToDocument({ host }) {
438
- const metadata = {
439
- entityFqdn: "wix.papyrus.v1.document",
440
- method: "GET",
441
- methodFqn: "wix.papyrus.v1.DownloadPageController.RedirectToDocument",
442
- packageName: PACKAGE_NAME,
443
- migrationOptions: {
444
- optInTransformResponse: true
445
- },
446
- url: resolveWixPapyrusV1DownloadPageControllerUrl({
447
- protoPath: "/view",
448
- data: payload,
449
- host
450
- }),
451
- params: (0, import_rest_modules.toURLSearchParams)(payload),
452
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
453
- {
454
- transformFn: import_bytes.transformRESTBytesToSDKBytes,
455
- paths: [{ path: "body" }]
456
- }
457
- ])
458
- };
459
- return metadata;
460
- }
461
- return __redirectToDocument;
462
- }
463
452
 
464
453
  // src/papyrus-v1-document-documents.universal.ts
465
454
  var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
@@ -484,6 +473,26 @@ var WixMpClientVersion = /* @__PURE__ */ ((WixMpClientVersion2) => {
484
473
  WixMpClientVersion2["MP_V2"] = "MP_V2";
485
474
  return WixMpClientVersion2;
486
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 || {});
487
496
  var RequestedFields = /* @__PURE__ */ ((RequestedFields2) => {
488
497
  RequestedFields2["DOCUMENT_CONTENT"] = "DOCUMENT_CONTENT";
489
498
  return RequestedFields2;
@@ -507,26 +516,52 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
507
516
  WebhookIdentityType2["APP"] = "APP";
508
517
  return WebhookIdentityType2;
509
518
  })(WebhookIdentityType || {});
510
- var ResizeOption = /* @__PURE__ */ ((ResizeOption2) => {
511
- ResizeOption2["FIT"] = "FIT";
512
- ResizeOption2["CROP"] = "CROP";
513
- return ResizeOption2;
514
- })(ResizeOption || {});
515
- var PaperSize = /* @__PURE__ */ ((PaperSize2) => {
516
- PaperSize2["A4_PORTRAIT"] = "A4_PORTRAIT";
517
- PaperSize2["A4_LANDSCAPE"] = "A4_LANDSCAPE";
518
- return PaperSize2;
519
- })(PaperSize || {});
520
- var PageOverflow = /* @__PURE__ */ ((PageOverflow2) => {
521
- PageOverflow2["CONTENT_HIDDEN"] = "CONTENT_HIDDEN";
522
- PageOverflow2["CONTENT_BREAK"] = "CONTENT_BREAK";
523
- return PageOverflow2;
524
- })(PageOverflow || {});
525
- var RenderFormat = /* @__PURE__ */ ((RenderFormat2) => {
526
- RenderFormat2["PDF"] = "PDF";
527
- RenderFormat2["HTML"] = "HTML";
528
- return RenderFormat2;
529
- })(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
+ }
530
565
  async function createDocument2(options) {
531
566
  const { httpClient, sideEffects } = arguments[1];
532
567
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
@@ -808,54 +843,40 @@ async function downloadDocumentSource2(documentId, options) {
808
843
  throw transformedError;
809
844
  }
810
845
  }
811
- async function getDownloadPage2(file) {
812
- const { httpClient, sideEffects } = arguments[1];
813
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ file });
814
- const reqOpts = getDownloadPage(payload);
815
- sideEffects?.onSiteCall?.();
816
- try {
817
- const result = await httpClient.request(reqOpts);
818
- sideEffects?.onSuccess?.(result);
819
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
820
- } catch (err) {
821
- const transformedError = (0, import_transform_error.transformError)(
822
- err,
823
- {
824
- spreadPathsToArguments: {},
825
- explicitPathsToArguments: { file: "$[0]" },
826
- singleArgumentUnchanged: false
827
- },
828
- ["file"]
829
- );
830
- sideEffects?.onError?.(err);
831
- throw transformedError;
832
- }
833
- }
834
- async function redirectToDocument2(file) {
835
- const { httpClient, sideEffects } = arguments[1];
836
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ file });
837
- const reqOpts = redirectToDocument(payload);
838
- sideEffects?.onSiteCall?.();
839
- try {
840
- const result = await httpClient.request(reqOpts);
841
- sideEffects?.onSuccess?.(result);
842
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
843
- } catch (err) {
844
- const transformedError = (0, import_transform_error.transformError)(
845
- err,
846
- {
847
- spreadPathsToArguments: {},
848
- explicitPathsToArguments: { file: "$[0]" },
849
- singleArgumentUnchanged: false
850
- },
851
- ["file"]
852
- );
853
- sideEffects?.onError?.(err);
854
- throw transformedError;
855
- }
856
- }
857
846
 
858
847
  // src/papyrus-v1-document-documents.public.ts
848
+ var TRANSFORM_PATHS_02 = [
849
+ { path: "entity.createdDate" },
850
+ { path: "entity.updatedDate" },
851
+ { path: "entity.expirationDate" },
852
+ { path: "metadata.eventTime" }
853
+ ];
854
+ var TRANSFORM_PATHS_12 = [
855
+ { path: "undefined.createdDate" },
856
+ { path: "undefined.updatedDate" },
857
+ { path: "undefined.expirationDate" },
858
+ { path: "metadata.eventTime" }
859
+ ];
860
+ var TRANSFORM_PATHS_22 = [
861
+ { path: "data.document.createdDate" },
862
+ { path: "data.document.updatedDate" },
863
+ { path: "data.document.expirationDate" },
864
+ { path: "metadata.eventTime" }
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
+ }
859
880
  function createDocument3(httpClient) {
860
881
  return (options) => createDocument2(
861
882
  options,
@@ -924,20 +945,6 @@ function downloadDocumentSource3(httpClient) {
924
945
  { httpClient }
925
946
  );
926
947
  }
927
- function getDownloadPage3(httpClient) {
928
- return (file) => getDownloadPage2(
929
- file,
930
- // @ts-ignore
931
- { httpClient }
932
- );
933
- }
934
- function redirectToDocument3(httpClient) {
935
- return (file) => redirectToDocument2(
936
- file,
937
- // @ts-ignore
938
- { httpClient }
939
- );
940
- }
941
948
  var onDocumentCreated = /* @__PURE__ */ (0, import_sdk_types.EventDefinition)(
942
949
  "wix.papyrus.v1.document_created",
943
950
  true,
@@ -945,12 +952,7 @@ var onDocumentCreated = /* @__PURE__ */ (0, import_sdk_types.EventDefinition)(
945
952
  (0, import_transform_paths3.transformPaths)(event, [
946
953
  {
947
954
  transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
948
- paths: [
949
- { path: "entity.createdDate" },
950
- { path: "entity.updatedDate" },
951
- { path: "entity.expirationDate" },
952
- { path: "metadata.eventTime" }
953
- ]
955
+ paths: TRANSFORM_PATHS_02
954
956
  }
955
957
  ])
956
958
  )
@@ -962,12 +964,7 @@ var onDocumentDeleted = /* @__PURE__ */ (0, import_sdk_types.EventDefinition)(
962
964
  (0, import_transform_paths3.transformPaths)(event, [
963
965
  {
964
966
  transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
965
- paths: [
966
- { path: "undefined.createdDate" },
967
- { path: "undefined.updatedDate" },
968
- { path: "undefined.expirationDate" },
969
- { path: "metadata.eventTime" }
970
- ]
967
+ paths: TRANSFORM_PATHS_12
971
968
  }
972
969
  ])
973
970
  )
@@ -979,12 +976,7 @@ var onDocumentRenderDelayed = /* @__PURE__ */ (0, import_sdk_types.EventDefiniti
979
976
  (0, import_transform_paths3.transformPaths)(event, [
980
977
  {
981
978
  transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
982
- paths: [
983
- { path: "data.document.createdDate" },
984
- { path: "data.document.updatedDate" },
985
- { path: "data.document.expirationDate" },
986
- { path: "metadata.eventTime" }
987
- ]
979
+ paths: TRANSFORM_PATHS_22
988
980
  }
989
981
  ])
990
982
  )
@@ -996,12 +988,7 @@ var onDocumentRenderFailed = /* @__PURE__ */ (0, import_sdk_types.EventDefinitio
996
988
  (0, import_transform_paths3.transformPaths)(event, [
997
989
  {
998
990
  transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
999
- paths: [
1000
- { path: "data.document.createdDate" },
1001
- { path: "data.document.updatedDate" },
1002
- { path: "data.document.expirationDate" },
1003
- { path: "metadata.eventTime" }
1004
- ]
991
+ paths: TRANSFORM_PATHS_22
1005
992
  }
1006
993
  ])
1007
994
  )
@@ -1013,12 +1000,7 @@ var onDocumentRendered = /* @__PURE__ */ (0, import_sdk_types.EventDefinition)(
1013
1000
  (0, import_transform_paths3.transformPaths)(event, [
1014
1001
  {
1015
1002
  transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
1016
- paths: [
1017
- { path: "data.document.createdDate" },
1018
- { path: "data.document.updatedDate" },
1019
- { path: "data.document.expirationDate" },
1020
- { path: "metadata.eventTime" }
1021
- ]
1003
+ paths: TRANSFORM_PATHS_22
1022
1004
  }
1023
1005
  ])
1024
1006
  )
@@ -1030,12 +1012,7 @@ var onDocumentUpdated = /* @__PURE__ */ (0, import_sdk_types.EventDefinition)(
1030
1012
  (0, import_transform_paths3.transformPaths)(event, [
1031
1013
  {
1032
1014
  transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
1033
- paths: [
1034
- { path: "entity.createdDate" },
1035
- { path: "entity.updatedDate" },
1036
- { path: "entity.expirationDate" },
1037
- { path: "metadata.eventTime" }
1038
- ]
1015
+ paths: TRANSFORM_PATHS_02
1039
1016
  }
1040
1017
  ])
1041
1018
  )
@@ -1056,6 +1033,8 @@ function customQueryDocument(httpClient) {
1056
1033
  }
1057
1034
  return overloadedQuery;
1058
1035
  }
1036
+ var getDownloadPage4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getDownloadPage3);
1037
+ var redirectToDocument4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(redirectToDocument3);
1059
1038
  var createDocument4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createDocument3);
1060
1039
  var getDocument4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getDocument3);
1061
1040
  var deleteDocument4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deleteDocument3);
@@ -1063,8 +1042,6 @@ var updateDocument4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)
1063
1042
  var downloadDocument4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(downloadDocument3);
1064
1043
  var getDownloadUrl4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getDownloadUrl3);
1065
1044
  var downloadDocumentSource4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(downloadDocumentSource3);
1066
- var getDownloadPage4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getDownloadPage3);
1067
- var redirectToDocument4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(redirectToDocument3);
1068
1045
  var queryDocument4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(customQueryDocument);
1069
1046
  var onDocumentCreated2 = /* @__PURE__ */ (0, import_event_definition_modules.createEventModule)(
1070
1047
  onDocumentCreated