@wix/auto_sdk_papyrus_documents 1.0.0

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 (52) hide show
  1. package/build/cjs/index.d.ts +115 -0
  2. package/build/cjs/index.js +1101 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1465 -0
  5. package/build/cjs/index.typings.js +863 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1030 -0
  8. package/build/cjs/meta.js +705 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/schemas.d.ts +411 -0
  11. package/build/cjs/schemas.js +658 -0
  12. package/build/cjs/schemas.js.map +1 -0
  13. package/build/es/index.d.mts +115 -0
  14. package/build/es/index.mjs +1050 -0
  15. package/build/es/index.mjs.map +1 -0
  16. package/build/es/index.typings.d.mts +1465 -0
  17. package/build/es/index.typings.mjs +817 -0
  18. package/build/es/index.typings.mjs.map +1 -0
  19. package/build/es/meta.d.mts +1030 -0
  20. package/build/es/meta.mjs +658 -0
  21. package/build/es/meta.mjs.map +1 -0
  22. package/build/es/package.json +3 -0
  23. package/build/es/schemas.d.mts +411 -0
  24. package/build/es/schemas.mjs +602 -0
  25. package/build/es/schemas.mjs.map +1 -0
  26. package/build/internal/cjs/index.d.ts +115 -0
  27. package/build/internal/cjs/index.js +1101 -0
  28. package/build/internal/cjs/index.js.map +1 -0
  29. package/build/internal/cjs/index.typings.d.ts +1465 -0
  30. package/build/internal/cjs/index.typings.js +863 -0
  31. package/build/internal/cjs/index.typings.js.map +1 -0
  32. package/build/internal/cjs/meta.d.ts +1030 -0
  33. package/build/internal/cjs/meta.js +705 -0
  34. package/build/internal/cjs/meta.js.map +1 -0
  35. package/build/internal/cjs/schemas.d.ts +411 -0
  36. package/build/internal/cjs/schemas.js +658 -0
  37. package/build/internal/cjs/schemas.js.map +1 -0
  38. package/build/internal/es/index.d.mts +115 -0
  39. package/build/internal/es/index.mjs +1050 -0
  40. package/build/internal/es/index.mjs.map +1 -0
  41. package/build/internal/es/index.typings.d.mts +1465 -0
  42. package/build/internal/es/index.typings.mjs +817 -0
  43. package/build/internal/es/index.typings.mjs.map +1 -0
  44. package/build/internal/es/meta.d.mts +1030 -0
  45. package/build/internal/es/meta.mjs +658 -0
  46. package/build/internal/es/meta.mjs.map +1 -0
  47. package/build/internal/es/schemas.d.mts +411 -0
  48. package/build/internal/es/schemas.mjs +602 -0
  49. package/build/internal/es/schemas.mjs.map +1 -0
  50. package/meta/package.json +3 -0
  51. package/package.json +61 -0
  52. package/schemas/package.json +3 -0
@@ -0,0 +1,863 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // index.typings.ts
21
+ var index_typings_exports = {};
22
+ __export(index_typings_exports, {
23
+ ContentDisposition: () => ContentDisposition,
24
+ Format: () => Format,
25
+ PageOverflow: () => PageOverflow,
26
+ PaperSize: () => PaperSize,
27
+ RenderFormat: () => RenderFormat,
28
+ RenderStatus: () => RenderStatus,
29
+ RequestedFields: () => RequestedFields,
30
+ ResizeOption: () => ResizeOption,
31
+ SortOrder: () => SortOrder,
32
+ WebhookIdentityType: () => WebhookIdentityType,
33
+ WixMpClientVersion: () => WixMpClientVersion,
34
+ createDocument: () => createDocument2,
35
+ deleteDocument: () => deleteDocument2,
36
+ downloadDocument: () => downloadDocument2,
37
+ downloadDocumentSource: () => downloadDocumentSource2,
38
+ getDocument: () => getDocument2,
39
+ getDownloadPage: () => getDownloadPage2,
40
+ getDownloadUrl: () => getDownloadUrl2,
41
+ queryDocument: () => queryDocument2,
42
+ redirectToDocument: () => redirectToDocument2,
43
+ typedQueryDocument: () => typedQueryDocument,
44
+ updateDocument: () => updateDocument2,
45
+ utils: () => utils
46
+ });
47
+ module.exports = __toCommonJS(index_typings_exports);
48
+
49
+ // src/papyrus-v1-document-documents.universal.ts
50
+ var import_transform_error = require("@wix/sdk-runtime/transform-error");
51
+ var import_query_builder = require("@wix/sdk-runtime/query-builder");
52
+ var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
53
+
54
+ // src/papyrus-v1-document-documents.http.ts
55
+ var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
56
+ var import_bytes = require("@wix/sdk-runtime/transformations/bytes");
57
+ var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
58
+ var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
59
+ var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
60
+ var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
61
+ function resolveWixPapyrusV1DocumentServiceUrl(opts) {
62
+ const domainToMappings = {
63
+ "api._base_domain_": [
64
+ {
65
+ srcPath: "/papyrus-document",
66
+ destPath: ""
67
+ }
68
+ ],
69
+ "www.wixapis.com": [
70
+ {
71
+ srcPath: "/papyrus-document/v1/documents",
72
+ destPath: "/v1/documents"
73
+ }
74
+ ],
75
+ "papyrus.wixapps.net": [
76
+ {
77
+ srcPath: "/download",
78
+ destPath: "/download"
79
+ },
80
+ {
81
+ srcPath: "/papyrus-document",
82
+ destPath: ""
83
+ },
84
+ {
85
+ srcPath: "/view",
86
+ destPath: "/view"
87
+ }
88
+ ],
89
+ "manage._base_domain_": [
90
+ {
91
+ srcPath: "/papyrus-document",
92
+ destPath: ""
93
+ }
94
+ ],
95
+ "api._api_base_domain_": [
96
+ {
97
+ srcPath: "/papyrus-document",
98
+ destPath: ""
99
+ }
100
+ ]
101
+ };
102
+ return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
103
+ }
104
+ function resolveWixPapyrusV1DownloadPageControllerUrl(opts) {
105
+ const domainToMappings = {
106
+ "api._base_domain_": [
107
+ {
108
+ srcPath: "/papyrus-document",
109
+ destPath: ""
110
+ }
111
+ ],
112
+ "www.wixapis.com": [
113
+ {
114
+ srcPath: "/papyrus-document/v1/documents",
115
+ destPath: "/v1/documents"
116
+ }
117
+ ],
118
+ "papyrus.wixapps.net": [
119
+ {
120
+ srcPath: "/download",
121
+ destPath: "/download"
122
+ },
123
+ {
124
+ srcPath: "/papyrus-document",
125
+ destPath: ""
126
+ },
127
+ {
128
+ srcPath: "/view",
129
+ destPath: "/view"
130
+ }
131
+ ],
132
+ "manage._base_domain_": [
133
+ {
134
+ srcPath: "/papyrus-document",
135
+ destPath: ""
136
+ }
137
+ ],
138
+ "api._api_base_domain_": [
139
+ {
140
+ srcPath: "/papyrus-document",
141
+ destPath: ""
142
+ }
143
+ ]
144
+ };
145
+ return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
146
+ }
147
+ var PACKAGE_NAME = "@wix/auto_sdk_papyrus_documents";
148
+ function getDownloadPage(payload) {
149
+ function __getDownloadPage({ host }) {
150
+ const metadata = {
151
+ entityFqdn: "wix.papyrus.v1.document",
152
+ method: "GET",
153
+ methodFqn: "wix.papyrus.v1.DownloadPageController.GetDownloadPage",
154
+ packageName: PACKAGE_NAME,
155
+ migrationOptions: {
156
+ optInTransformResponse: true
157
+ },
158
+ url: resolveWixPapyrusV1DownloadPageControllerUrl({
159
+ protoPath: "/download",
160
+ data: payload,
161
+ host
162
+ }),
163
+ params: (0, import_rest_modules.toURLSearchParams)(payload),
164
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
165
+ {
166
+ transformFn: import_bytes.transformRESTBytesToSDKBytes,
167
+ paths: [{ path: "body" }]
168
+ }
169
+ ])
170
+ };
171
+ return metadata;
172
+ }
173
+ return __getDownloadPage;
174
+ }
175
+ function redirectToDocument(payload) {
176
+ function __redirectToDocument({ host }) {
177
+ const metadata = {
178
+ entityFqdn: "wix.papyrus.v1.document",
179
+ method: "GET",
180
+ methodFqn: "wix.papyrus.v1.DownloadPageController.RedirectToDocument",
181
+ packageName: PACKAGE_NAME,
182
+ migrationOptions: {
183
+ optInTransformResponse: true
184
+ },
185
+ url: resolveWixPapyrusV1DownloadPageControllerUrl({
186
+ protoPath: "/view",
187
+ data: payload,
188
+ host
189
+ }),
190
+ params: (0, import_rest_modules.toURLSearchParams)(payload),
191
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
192
+ {
193
+ transformFn: import_bytes.transformRESTBytesToSDKBytes,
194
+ paths: [{ path: "body" }]
195
+ }
196
+ ])
197
+ };
198
+ return metadata;
199
+ }
200
+ return __redirectToDocument;
201
+ }
202
+ function createDocument(payload) {
203
+ function __createDocument({ host }) {
204
+ const serializedData = (0, import_transform_paths.transformPaths)(payload, [
205
+ {
206
+ transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
207
+ paths: [
208
+ { path: "document.createdDate" },
209
+ { path: "document.updatedDate" },
210
+ { path: "document.expirationDate" }
211
+ ]
212
+ }
213
+ ]);
214
+ const metadata = {
215
+ entityFqdn: "wix.papyrus.v1.document",
216
+ method: "POST",
217
+ methodFqn: "wix.papyrus.v1.DocumentService.CreateDocument",
218
+ packageName: PACKAGE_NAME,
219
+ migrationOptions: {
220
+ optInTransformResponse: true
221
+ },
222
+ url: resolveWixPapyrusV1DocumentServiceUrl({
223
+ protoPath: "/v1/documents",
224
+ data: serializedData,
225
+ host
226
+ }),
227
+ data: serializedData,
228
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
229
+ {
230
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
231
+ paths: [
232
+ { path: "document.createdDate" },
233
+ { path: "document.updatedDate" },
234
+ { path: "document.expirationDate" }
235
+ ]
236
+ }
237
+ ])
238
+ };
239
+ return metadata;
240
+ }
241
+ return __createDocument;
242
+ }
243
+ function getDocument(payload) {
244
+ function __getDocument({ host }) {
245
+ const metadata = {
246
+ entityFqdn: "wix.papyrus.v1.document",
247
+ method: "GET",
248
+ methodFqn: "wix.papyrus.v1.DocumentService.GetDocument",
249
+ packageName: PACKAGE_NAME,
250
+ migrationOptions: {
251
+ optInTransformResponse: true
252
+ },
253
+ url: resolveWixPapyrusV1DocumentServiceUrl({
254
+ protoPath: "/v1/documents/{documentId}",
255
+ data: payload,
256
+ host
257
+ }),
258
+ params: (0, import_rest_modules.toURLSearchParams)(payload),
259
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
260
+ {
261
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
262
+ paths: [
263
+ { path: "document.createdDate" },
264
+ { path: "document.updatedDate" },
265
+ { path: "document.expirationDate" }
266
+ ]
267
+ }
268
+ ])
269
+ };
270
+ return metadata;
271
+ }
272
+ return __getDocument;
273
+ }
274
+ function deleteDocument(payload) {
275
+ function __deleteDocument({ host }) {
276
+ const metadata = {
277
+ entityFqdn: "wix.papyrus.v1.document",
278
+ method: "DELETE",
279
+ methodFqn: "wix.papyrus.v1.DocumentService.DeleteDocument",
280
+ packageName: PACKAGE_NAME,
281
+ migrationOptions: {
282
+ optInTransformResponse: true
283
+ },
284
+ url: resolveWixPapyrusV1DocumentServiceUrl({
285
+ protoPath: "/v1/documents/{documentId}",
286
+ data: payload,
287
+ host
288
+ }),
289
+ params: (0, import_rest_modules.toURLSearchParams)(payload),
290
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
291
+ {
292
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
293
+ paths: [
294
+ { path: "document.createdDate" },
295
+ { path: "document.updatedDate" },
296
+ { path: "document.expirationDate" }
297
+ ]
298
+ }
299
+ ])
300
+ };
301
+ return metadata;
302
+ }
303
+ return __deleteDocument;
304
+ }
305
+ function queryDocument(payload) {
306
+ function __queryDocument({ host }) {
307
+ const metadata = {
308
+ entityFqdn: "wix.papyrus.v1.document",
309
+ method: "POST",
310
+ methodFqn: "wix.papyrus.v1.DocumentService.QueryDocument",
311
+ packageName: PACKAGE_NAME,
312
+ migrationOptions: {
313
+ optInTransformResponse: true
314
+ },
315
+ url: resolveWixPapyrusV1DocumentServiceUrl({
316
+ protoPath: "/v1/documents/query",
317
+ data: payload,
318
+ host
319
+ }),
320
+ data: payload,
321
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
322
+ {
323
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
324
+ paths: [
325
+ { path: "documents.createdDate" },
326
+ { path: "documents.updatedDate" },
327
+ { path: "documents.expirationDate" }
328
+ ]
329
+ }
330
+ ])
331
+ };
332
+ return metadata;
333
+ }
334
+ return __queryDocument;
335
+ }
336
+ function updateDocument(payload) {
337
+ function __updateDocument({ host }) {
338
+ const metadata = {
339
+ entityFqdn: "wix.papyrus.v1.document",
340
+ method: "PATCH",
341
+ methodFqn: "wix.papyrus.v1.DocumentService.UpdateDocument",
342
+ packageName: PACKAGE_NAME,
343
+ migrationOptions: {
344
+ optInTransformResponse: true
345
+ },
346
+ url: resolveWixPapyrusV1DocumentServiceUrl({
347
+ protoPath: "/v1/documents/{id}",
348
+ data: payload,
349
+ host
350
+ }),
351
+ data: payload,
352
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
353
+ {
354
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
355
+ paths: [
356
+ { path: "document.createdDate" },
357
+ { path: "document.updatedDate" },
358
+ { path: "document.expirationDate" }
359
+ ]
360
+ }
361
+ ])
362
+ };
363
+ return metadata;
364
+ }
365
+ return __updateDocument;
366
+ }
367
+ function downloadDocument(payload) {
368
+ function __downloadDocument({ host }) {
369
+ const metadata = {
370
+ entityFqdn: "wix.papyrus.v1.document",
371
+ method: "GET",
372
+ methodFqn: "wix.papyrus.v1.DocumentService.DownloadDocument",
373
+ packageName: PACKAGE_NAME,
374
+ migrationOptions: {
375
+ optInTransformResponse: true
376
+ },
377
+ url: resolveWixPapyrusV1DocumentServiceUrl({
378
+ protoPath: "/v1/documents/download/{documentId}",
379
+ data: payload,
380
+ host
381
+ }),
382
+ params: (0, import_rest_modules.toURLSearchParams)(payload),
383
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
384
+ {
385
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
386
+ paths: [{ path: "expirationDate" }]
387
+ }
388
+ ])
389
+ };
390
+ return metadata;
391
+ }
392
+ return __downloadDocument;
393
+ }
394
+ function getDownloadUrl(payload) {
395
+ function __getDownloadUrl({ host }) {
396
+ const metadata = {
397
+ entityFqdn: "wix.papyrus.v1.document",
398
+ method: "GET",
399
+ methodFqn: "wix.papyrus.v1.DocumentService.GetDownloadUrl",
400
+ packageName: PACKAGE_NAME,
401
+ migrationOptions: {
402
+ optInTransformResponse: true
403
+ },
404
+ url: resolveWixPapyrusV1DocumentServiceUrl({
405
+ protoPath: "/v1/documents/download-url",
406
+ data: payload,
407
+ host
408
+ }),
409
+ params: (0, import_rest_modules.toURLSearchParams)(payload),
410
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
411
+ {
412
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
413
+ paths: [{ path: "expirationDate" }]
414
+ }
415
+ ])
416
+ };
417
+ return metadata;
418
+ }
419
+ return __getDownloadUrl;
420
+ }
421
+ function downloadDocumentSource(payload) {
422
+ function __downloadDocumentSource({ host }) {
423
+ const metadata = {
424
+ entityFqdn: "wix.papyrus.v1.document",
425
+ method: "GET",
426
+ methodFqn: "wix.papyrus.v1.DocumentService.DownloadDocumentSource",
427
+ packageName: PACKAGE_NAME,
428
+ migrationOptions: {
429
+ optInTransformResponse: true
430
+ },
431
+ url: resolveWixPapyrusV1DocumentServiceUrl({
432
+ protoPath: "/v1/documents/download/{documentId}/source",
433
+ data: payload,
434
+ host
435
+ }),
436
+ params: (0, import_rest_modules.toURLSearchParams)(payload)
437
+ };
438
+ return metadata;
439
+ }
440
+ return __downloadDocumentSource;
441
+ }
442
+
443
+ // src/papyrus-v1-document-documents.universal.ts
444
+ var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
445
+ var import_query_builder_utils = require("@wix/sdk-runtime/query-builder-utils");
446
+ var RenderStatus = /* @__PURE__ */ ((RenderStatus2) => {
447
+ RenderStatus2["UNKNOWN"] = "UNKNOWN";
448
+ RenderStatus2["ACCEPTED"] = "ACCEPTED";
449
+ RenderStatus2["RENDERING"] = "RENDERING";
450
+ RenderStatus2["READY"] = "READY";
451
+ RenderStatus2["FAILED"] = "FAILED";
452
+ RenderStatus2["EXPIRED"] = "EXPIRED";
453
+ return RenderStatus2;
454
+ })(RenderStatus || {});
455
+ var Format = /* @__PURE__ */ ((Format2) => {
456
+ Format2["UNKNOWN"] = "UNKNOWN";
457
+ Format2["PDF"] = "PDF";
458
+ return Format2;
459
+ })(Format || {});
460
+ var WixMpClientVersion = /* @__PURE__ */ ((WixMpClientVersion2) => {
461
+ WixMpClientVersion2["UNKNOWN"] = "UNKNOWN";
462
+ WixMpClientVersion2["MP_V1"] = "MP_V1";
463
+ WixMpClientVersion2["MP_V2"] = "MP_V2";
464
+ return WixMpClientVersion2;
465
+ })(WixMpClientVersion || {});
466
+ var ResizeOption = /* @__PURE__ */ ((ResizeOption2) => {
467
+ ResizeOption2["FIT"] = "FIT";
468
+ ResizeOption2["CROP"] = "CROP";
469
+ return ResizeOption2;
470
+ })(ResizeOption || {});
471
+ var PaperSize = /* @__PURE__ */ ((PaperSize2) => {
472
+ PaperSize2["A4_PORTRAIT"] = "A4_PORTRAIT";
473
+ PaperSize2["A4_LANDSCAPE"] = "A4_LANDSCAPE";
474
+ return PaperSize2;
475
+ })(PaperSize || {});
476
+ var PageOverflow = /* @__PURE__ */ ((PageOverflow2) => {
477
+ PageOverflow2["CONTENT_HIDDEN"] = "CONTENT_HIDDEN";
478
+ PageOverflow2["CONTENT_BREAK"] = "CONTENT_BREAK";
479
+ return PageOverflow2;
480
+ })(PageOverflow || {});
481
+ var RenderFormat = /* @__PURE__ */ ((RenderFormat2) => {
482
+ RenderFormat2["PDF"] = "PDF";
483
+ RenderFormat2["HTML"] = "HTML";
484
+ return RenderFormat2;
485
+ })(RenderFormat || {});
486
+ var RequestedFields = /* @__PURE__ */ ((RequestedFields2) => {
487
+ RequestedFields2["DOCUMENT_CONTENT"] = "DOCUMENT_CONTENT";
488
+ return RequestedFields2;
489
+ })(RequestedFields || {});
490
+ var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
491
+ SortOrder2["ASC"] = "ASC";
492
+ SortOrder2["DESC"] = "DESC";
493
+ return SortOrder2;
494
+ })(SortOrder || {});
495
+ var ContentDisposition = /* @__PURE__ */ ((ContentDisposition2) => {
496
+ ContentDisposition2["ATTACHMENT"] = "ATTACHMENT";
497
+ ContentDisposition2["INLINE"] = "INLINE";
498
+ return ContentDisposition2;
499
+ })(ContentDisposition || {});
500
+ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
501
+ WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
502
+ WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
503
+ WebhookIdentityType2["MEMBER"] = "MEMBER";
504
+ WebhookIdentityType2["WIX_USER"] = "WIX_USER";
505
+ WebhookIdentityType2["APP"] = "APP";
506
+ return WebhookIdentityType2;
507
+ })(WebhookIdentityType || {});
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
+ }
554
+ async function createDocument2(options) {
555
+ const { httpClient, sideEffects } = arguments[1];
556
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
557
+ document: options?.document
558
+ });
559
+ const reqOpts = createDocument(payload);
560
+ sideEffects?.onSiteCall?.();
561
+ try {
562
+ const result = await httpClient.request(reqOpts);
563
+ sideEffects?.onSuccess?.(result);
564
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.document;
565
+ } catch (err) {
566
+ const transformedError = (0, import_transform_error.transformError)(
567
+ err,
568
+ {
569
+ spreadPathsToArguments: {},
570
+ explicitPathsToArguments: { document: "$[0].document" },
571
+ singleArgumentUnchanged: false
572
+ },
573
+ ["options"]
574
+ );
575
+ sideEffects?.onError?.(err);
576
+ throw transformedError;
577
+ }
578
+ }
579
+ async function getDocument2(documentId, options) {
580
+ const { httpClient, sideEffects } = arguments[2];
581
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
582
+ documentId,
583
+ fields: options?.fields
584
+ });
585
+ const reqOpts = getDocument(payload);
586
+ sideEffects?.onSiteCall?.();
587
+ try {
588
+ const result = await httpClient.request(reqOpts);
589
+ sideEffects?.onSuccess?.(result);
590
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.document;
591
+ } catch (err) {
592
+ const transformedError = (0, import_transform_error.transformError)(
593
+ err,
594
+ {
595
+ spreadPathsToArguments: {},
596
+ explicitPathsToArguments: { documentId: "$[0]", fields: "$[1].fields" },
597
+ singleArgumentUnchanged: false
598
+ },
599
+ ["documentId", "options"]
600
+ );
601
+ sideEffects?.onError?.(err);
602
+ throw transformedError;
603
+ }
604
+ }
605
+ async function deleteDocument2(documentId) {
606
+ const { httpClient, sideEffects } = arguments[1];
607
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
608
+ documentId
609
+ });
610
+ const reqOpts = deleteDocument(payload);
611
+ sideEffects?.onSiteCall?.();
612
+ try {
613
+ const result = await httpClient.request(reqOpts);
614
+ sideEffects?.onSuccess?.(result);
615
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
616
+ } catch (err) {
617
+ const transformedError = (0, import_transform_error.transformError)(
618
+ err,
619
+ {
620
+ spreadPathsToArguments: {},
621
+ explicitPathsToArguments: { documentId: "$[0]" },
622
+ singleArgumentUnchanged: false
623
+ },
624
+ ["documentId"]
625
+ );
626
+ sideEffects?.onError?.(err);
627
+ throw transformedError;
628
+ }
629
+ }
630
+ function queryDocument2(options) {
631
+ const { httpClient, sideEffects } = arguments[1];
632
+ return (0, import_query_builder.queryBuilder)({
633
+ func: async (payload) => {
634
+ const reqOpts = queryDocument({
635
+ ...payload,
636
+ ...options ?? {}
637
+ });
638
+ sideEffects?.onSiteCall?.();
639
+ try {
640
+ const result = await httpClient.request(reqOpts);
641
+ sideEffects?.onSuccess?.(result);
642
+ return result;
643
+ } catch (err) {
644
+ sideEffects?.onError?.(err);
645
+ throw err;
646
+ }
647
+ },
648
+ requestTransformer: (query) => {
649
+ const args = [query, options];
650
+ return (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
651
+ ...args?.[1],
652
+ query: args?.[0]
653
+ });
654
+ },
655
+ responseTransformer: ({ data }) => {
656
+ const transformedData = (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
657
+ (0, import_transform_paths2.transformPaths)(data, [])
658
+ );
659
+ return {
660
+ items: transformedData?.documents,
661
+ pagingMetadata: transformedData?.metadata
662
+ };
663
+ },
664
+ errorTransformer: (err) => {
665
+ const transformedError = (0, import_transform_error.transformError)(err, {
666
+ spreadPathsToArguments: {},
667
+ explicitPathsToArguments: { query: "$[0]" },
668
+ singleArgumentUnchanged: false
669
+ });
670
+ throw transformedError;
671
+ },
672
+ pagingMethod: "CURSOR",
673
+ transformationPaths: {}
674
+ });
675
+ }
676
+ async function typedQueryDocument(query, options) {
677
+ const { httpClient, sideEffects } = arguments[2];
678
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
679
+ query,
680
+ ...options
681
+ });
682
+ const reqOpts = queryDocument(payload);
683
+ sideEffects?.onSiteCall?.();
684
+ try {
685
+ const result = await httpClient.request(reqOpts);
686
+ sideEffects?.onSuccess?.(result);
687
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
688
+ } catch (err) {
689
+ const transformedError = (0, import_transform_error.transformError)(
690
+ err,
691
+ {
692
+ spreadPathsToArguments: {},
693
+ explicitPathsToArguments: { query: "$[0]" },
694
+ singleArgumentUnchanged: false
695
+ },
696
+ ["query", "options"]
697
+ );
698
+ sideEffects?.onError?.(err);
699
+ throw transformedError;
700
+ }
701
+ }
702
+ var utils = {
703
+ query: {
704
+ ...(0, import_query_builder_utils.createQueryUtils)()
705
+ }
706
+ };
707
+ async function updateDocument2(_id, options) {
708
+ const { httpClient, sideEffects } = arguments[2];
709
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
710
+ id: _id,
711
+ renderStatus: options?.renderStatus,
712
+ file: options?.file,
713
+ sourceFile: options?.sourceFile
714
+ });
715
+ const reqOpts = updateDocument(payload);
716
+ sideEffects?.onSiteCall?.();
717
+ try {
718
+ const result = await httpClient.request(reqOpts);
719
+ sideEffects?.onSuccess?.(result);
720
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
721
+ } catch (err) {
722
+ const transformedError = (0, import_transform_error.transformError)(
723
+ err,
724
+ {
725
+ spreadPathsToArguments: {},
726
+ explicitPathsToArguments: {
727
+ id: "$[0]",
728
+ renderStatus: "$[1].renderStatus",
729
+ file: "$[1].file",
730
+ sourceFile: "$[1].sourceFile"
731
+ },
732
+ singleArgumentUnchanged: false
733
+ },
734
+ ["_id", "options"]
735
+ );
736
+ sideEffects?.onError?.(err);
737
+ throw transformedError;
738
+ }
739
+ }
740
+ async function downloadDocument2(documentId, options) {
741
+ const { httpClient, sideEffects } = arguments[2];
742
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
743
+ documentId,
744
+ urlExpirationInSeconds: options?.urlExpirationInSeconds,
745
+ contentDisposition: options?.contentDisposition
746
+ });
747
+ const reqOpts = downloadDocument(payload);
748
+ sideEffects?.onSiteCall?.();
749
+ try {
750
+ const result = await httpClient.request(reqOpts);
751
+ sideEffects?.onSuccess?.(result);
752
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
753
+ } catch (err) {
754
+ const transformedError = (0, import_transform_error.transformError)(
755
+ err,
756
+ {
757
+ spreadPathsToArguments: {},
758
+ explicitPathsToArguments: {
759
+ documentId: "$[0]",
760
+ urlExpirationInSeconds: "$[1].urlExpirationInSeconds",
761
+ contentDisposition: "$[1].contentDisposition"
762
+ },
763
+ singleArgumentUnchanged: false
764
+ },
765
+ ["documentId", "options"]
766
+ );
767
+ sideEffects?.onError?.(err);
768
+ throw transformedError;
769
+ }
770
+ }
771
+ async function getDownloadUrl2(options) {
772
+ const { httpClient, sideEffects } = arguments[1];
773
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
774
+ documentId: options?.documentId,
775
+ externalId: options?.externalId,
776
+ fileToken: options?.fileToken,
777
+ urlExpirationInSeconds: options?.urlExpirationInSeconds,
778
+ downloadButtonText: options?.downloadButtonText,
779
+ contentDisposition: options?.contentDisposition
780
+ });
781
+ const reqOpts = getDownloadUrl(payload);
782
+ sideEffects?.onSiteCall?.();
783
+ try {
784
+ const result = await httpClient.request(reqOpts);
785
+ sideEffects?.onSuccess?.(result);
786
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
787
+ } catch (err) {
788
+ const transformedError = (0, import_transform_error.transformError)(
789
+ err,
790
+ {
791
+ spreadPathsToArguments: {},
792
+ explicitPathsToArguments: {
793
+ documentId: "$[0].documentId",
794
+ externalId: "$[0].externalId",
795
+ fileToken: "$[0].fileToken",
796
+ urlExpirationInSeconds: "$[0].urlExpirationInSeconds",
797
+ downloadButtonText: "$[0].downloadButtonText",
798
+ contentDisposition: "$[0].contentDisposition"
799
+ },
800
+ singleArgumentUnchanged: false
801
+ },
802
+ ["options"]
803
+ );
804
+ sideEffects?.onError?.(err);
805
+ throw transformedError;
806
+ }
807
+ }
808
+ async function downloadDocumentSource2(documentId, options) {
809
+ const { httpClient, sideEffects } = arguments[2];
810
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
811
+ documentId,
812
+ contentDisposition: options?.contentDisposition
813
+ });
814
+ const reqOpts = downloadDocumentSource(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: {
826
+ documentId: "$[0]",
827
+ contentDisposition: "$[1].contentDisposition"
828
+ },
829
+ singleArgumentUnchanged: false
830
+ },
831
+ ["documentId", "options"]
832
+ );
833
+ sideEffects?.onError?.(err);
834
+ throw transformedError;
835
+ }
836
+ }
837
+ // Annotate the CommonJS export names for ESM import in node:
838
+ 0 && (module.exports = {
839
+ ContentDisposition,
840
+ Format,
841
+ PageOverflow,
842
+ PaperSize,
843
+ RenderFormat,
844
+ RenderStatus,
845
+ RequestedFields,
846
+ ResizeOption,
847
+ SortOrder,
848
+ WebhookIdentityType,
849
+ WixMpClientVersion,
850
+ createDocument,
851
+ deleteDocument,
852
+ downloadDocument,
853
+ downloadDocumentSource,
854
+ getDocument,
855
+ getDownloadPage,
856
+ getDownloadUrl,
857
+ queryDocument,
858
+ redirectToDocument,
859
+ typedQueryDocument,
860
+ updateDocument,
861
+ utils
862
+ });
863
+ //# sourceMappingURL=index.typings.js.map