@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.
- package/build/cjs/index.d.ts +115 -0
- package/build/cjs/index.js +1101 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +1465 -0
- package/build/cjs/index.typings.js +863 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +1030 -0
- package/build/cjs/meta.js +705 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/cjs/schemas.d.ts +411 -0
- package/build/cjs/schemas.js +658 -0
- package/build/cjs/schemas.js.map +1 -0
- package/build/es/index.d.mts +115 -0
- package/build/es/index.mjs +1050 -0
- package/build/es/index.mjs.map +1 -0
- package/build/es/index.typings.d.mts +1465 -0
- package/build/es/index.typings.mjs +817 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +1030 -0
- package/build/es/meta.mjs +658 -0
- package/build/es/meta.mjs.map +1 -0
- package/build/es/package.json +3 -0
- package/build/es/schemas.d.mts +411 -0
- package/build/es/schemas.mjs +602 -0
- package/build/es/schemas.mjs.map +1 -0
- package/build/internal/cjs/index.d.ts +115 -0
- package/build/internal/cjs/index.js +1101 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +1465 -0
- package/build/internal/cjs/index.typings.js +863 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +1030 -0
- package/build/internal/cjs/meta.js +705 -0
- package/build/internal/cjs/meta.js.map +1 -0
- package/build/internal/cjs/schemas.d.ts +411 -0
- package/build/internal/cjs/schemas.js +658 -0
- package/build/internal/cjs/schemas.js.map +1 -0
- package/build/internal/es/index.d.mts +115 -0
- package/build/internal/es/index.mjs +1050 -0
- package/build/internal/es/index.mjs.map +1 -0
- package/build/internal/es/index.typings.d.mts +1465 -0
- package/build/internal/es/index.typings.mjs +817 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +1030 -0
- package/build/internal/es/meta.mjs +658 -0
- package/build/internal/es/meta.mjs.map +1 -0
- package/build/internal/es/schemas.d.mts +411 -0
- package/build/internal/es/schemas.mjs +602 -0
- package/build/internal/es/schemas.mjs.map +1 -0
- package/meta/package.json +3 -0
- package/package.json +61 -0
- package/schemas/package.json +3 -0
|
@@ -0,0 +1,1101 @@
|
|
|
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.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_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: () => createDocument4,
|
|
35
|
+
deleteDocument: () => deleteDocument4,
|
|
36
|
+
downloadDocument: () => downloadDocument4,
|
|
37
|
+
downloadDocumentSource: () => downloadDocumentSource4,
|
|
38
|
+
getDocument: () => getDocument4,
|
|
39
|
+
getDownloadPage: () => getDownloadPage4,
|
|
40
|
+
getDownloadUrl: () => getDownloadUrl4,
|
|
41
|
+
onDocumentCreated: () => onDocumentCreated2,
|
|
42
|
+
onDocumentDeleted: () => onDocumentDeleted2,
|
|
43
|
+
onDocumentRenderDelayed: () => onDocumentRenderDelayed2,
|
|
44
|
+
onDocumentRenderFailed: () => onDocumentRenderFailed2,
|
|
45
|
+
onDocumentRendered: () => onDocumentRendered2,
|
|
46
|
+
onDocumentUpdated: () => onDocumentUpdated2,
|
|
47
|
+
queryDocument: () => queryDocument4,
|
|
48
|
+
redirectToDocument: () => redirectToDocument4,
|
|
49
|
+
updateDocument: () => updateDocument4,
|
|
50
|
+
utils: () => utils
|
|
51
|
+
});
|
|
52
|
+
module.exports = __toCommonJS(index_exports);
|
|
53
|
+
|
|
54
|
+
// src/papyrus-v1-document-documents.public.ts
|
|
55
|
+
var import_rename_all_nested_keys2 = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
56
|
+
var import_timestamp3 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
57
|
+
var import_transform_paths3 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
58
|
+
var import_sdk_types = require("@wix/sdk-types");
|
|
59
|
+
|
|
60
|
+
// src/papyrus-v1-document-documents.universal.ts
|
|
61
|
+
var import_transform_error = require("@wix/sdk-runtime/transform-error");
|
|
62
|
+
var import_query_builder = require("@wix/sdk-runtime/query-builder");
|
|
63
|
+
var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
64
|
+
|
|
65
|
+
// src/papyrus-v1-document-documents.http.ts
|
|
66
|
+
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
67
|
+
var import_bytes = require("@wix/sdk-runtime/transformations/bytes");
|
|
68
|
+
var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
|
|
69
|
+
var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
70
|
+
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
71
|
+
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
72
|
+
function resolveWixPapyrusV1DocumentServiceUrl(opts) {
|
|
73
|
+
const domainToMappings = {
|
|
74
|
+
"api._base_domain_": [
|
|
75
|
+
{
|
|
76
|
+
srcPath: "/papyrus-document",
|
|
77
|
+
destPath: ""
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"www.wixapis.com": [
|
|
81
|
+
{
|
|
82
|
+
srcPath: "/papyrus-document/v1/documents",
|
|
83
|
+
destPath: "/v1/documents"
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
"papyrus.wixapps.net": [
|
|
87
|
+
{
|
|
88
|
+
srcPath: "/download",
|
|
89
|
+
destPath: "/download"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
srcPath: "/papyrus-document",
|
|
93
|
+
destPath: ""
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
srcPath: "/view",
|
|
97
|
+
destPath: "/view"
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
"manage._base_domain_": [
|
|
101
|
+
{
|
|
102
|
+
srcPath: "/papyrus-document",
|
|
103
|
+
destPath: ""
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
"api._api_base_domain_": [
|
|
107
|
+
{
|
|
108
|
+
srcPath: "/papyrus-document",
|
|
109
|
+
destPath: ""
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
};
|
|
113
|
+
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
114
|
+
}
|
|
115
|
+
function resolveWixPapyrusV1DownloadPageControllerUrl(opts) {
|
|
116
|
+
const domainToMappings = {
|
|
117
|
+
"api._base_domain_": [
|
|
118
|
+
{
|
|
119
|
+
srcPath: "/papyrus-document",
|
|
120
|
+
destPath: ""
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
"www.wixapis.com": [
|
|
124
|
+
{
|
|
125
|
+
srcPath: "/papyrus-document/v1/documents",
|
|
126
|
+
destPath: "/v1/documents"
|
|
127
|
+
}
|
|
128
|
+
],
|
|
129
|
+
"papyrus.wixapps.net": [
|
|
130
|
+
{
|
|
131
|
+
srcPath: "/download",
|
|
132
|
+
destPath: "/download"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
srcPath: "/papyrus-document",
|
|
136
|
+
destPath: ""
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
srcPath: "/view",
|
|
140
|
+
destPath: "/view"
|
|
141
|
+
}
|
|
142
|
+
],
|
|
143
|
+
"manage._base_domain_": [
|
|
144
|
+
{
|
|
145
|
+
srcPath: "/papyrus-document",
|
|
146
|
+
destPath: ""
|
|
147
|
+
}
|
|
148
|
+
],
|
|
149
|
+
"api._api_base_domain_": [
|
|
150
|
+
{
|
|
151
|
+
srcPath: "/papyrus-document",
|
|
152
|
+
destPath: ""
|
|
153
|
+
}
|
|
154
|
+
]
|
|
155
|
+
};
|
|
156
|
+
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
157
|
+
}
|
|
158
|
+
var PACKAGE_NAME = "@wix/auto_sdk_papyrus_documents";
|
|
159
|
+
function getDownloadPage(payload) {
|
|
160
|
+
function __getDownloadPage({ host }) {
|
|
161
|
+
const metadata = {
|
|
162
|
+
entityFqdn: "wix.papyrus.v1.document",
|
|
163
|
+
method: "GET",
|
|
164
|
+
methodFqn: "wix.papyrus.v1.DownloadPageController.GetDownloadPage",
|
|
165
|
+
packageName: PACKAGE_NAME,
|
|
166
|
+
migrationOptions: {
|
|
167
|
+
optInTransformResponse: true
|
|
168
|
+
},
|
|
169
|
+
url: resolveWixPapyrusV1DownloadPageControllerUrl({
|
|
170
|
+
protoPath: "/download",
|
|
171
|
+
data: payload,
|
|
172
|
+
host
|
|
173
|
+
}),
|
|
174
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
175
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
176
|
+
{
|
|
177
|
+
transformFn: import_bytes.transformRESTBytesToSDKBytes,
|
|
178
|
+
paths: [{ path: "body" }]
|
|
179
|
+
}
|
|
180
|
+
])
|
|
181
|
+
};
|
|
182
|
+
return metadata;
|
|
183
|
+
}
|
|
184
|
+
return __getDownloadPage;
|
|
185
|
+
}
|
|
186
|
+
function redirectToDocument(payload) {
|
|
187
|
+
function __redirectToDocument({ host }) {
|
|
188
|
+
const metadata = {
|
|
189
|
+
entityFqdn: "wix.papyrus.v1.document",
|
|
190
|
+
method: "GET",
|
|
191
|
+
methodFqn: "wix.papyrus.v1.DownloadPageController.RedirectToDocument",
|
|
192
|
+
packageName: PACKAGE_NAME,
|
|
193
|
+
migrationOptions: {
|
|
194
|
+
optInTransformResponse: true
|
|
195
|
+
},
|
|
196
|
+
url: resolveWixPapyrusV1DownloadPageControllerUrl({
|
|
197
|
+
protoPath: "/view",
|
|
198
|
+
data: payload,
|
|
199
|
+
host
|
|
200
|
+
}),
|
|
201
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
202
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
203
|
+
{
|
|
204
|
+
transformFn: import_bytes.transformRESTBytesToSDKBytes,
|
|
205
|
+
paths: [{ path: "body" }]
|
|
206
|
+
}
|
|
207
|
+
])
|
|
208
|
+
};
|
|
209
|
+
return metadata;
|
|
210
|
+
}
|
|
211
|
+
return __redirectToDocument;
|
|
212
|
+
}
|
|
213
|
+
function createDocument(payload) {
|
|
214
|
+
function __createDocument({ host }) {
|
|
215
|
+
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
216
|
+
{
|
|
217
|
+
transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
|
|
218
|
+
paths: [
|
|
219
|
+
{ path: "document.createdDate" },
|
|
220
|
+
{ path: "document.updatedDate" },
|
|
221
|
+
{ path: "document.expirationDate" }
|
|
222
|
+
]
|
|
223
|
+
}
|
|
224
|
+
]);
|
|
225
|
+
const metadata = {
|
|
226
|
+
entityFqdn: "wix.papyrus.v1.document",
|
|
227
|
+
method: "POST",
|
|
228
|
+
methodFqn: "wix.papyrus.v1.DocumentService.CreateDocument",
|
|
229
|
+
packageName: PACKAGE_NAME,
|
|
230
|
+
migrationOptions: {
|
|
231
|
+
optInTransformResponse: true
|
|
232
|
+
},
|
|
233
|
+
url: resolveWixPapyrusV1DocumentServiceUrl({
|
|
234
|
+
protoPath: "/v1/documents",
|
|
235
|
+
data: serializedData,
|
|
236
|
+
host
|
|
237
|
+
}),
|
|
238
|
+
data: serializedData,
|
|
239
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
240
|
+
{
|
|
241
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
242
|
+
paths: [
|
|
243
|
+
{ path: "document.createdDate" },
|
|
244
|
+
{ path: "document.updatedDate" },
|
|
245
|
+
{ path: "document.expirationDate" }
|
|
246
|
+
]
|
|
247
|
+
}
|
|
248
|
+
])
|
|
249
|
+
};
|
|
250
|
+
return metadata;
|
|
251
|
+
}
|
|
252
|
+
return __createDocument;
|
|
253
|
+
}
|
|
254
|
+
function getDocument(payload) {
|
|
255
|
+
function __getDocument({ host }) {
|
|
256
|
+
const metadata = {
|
|
257
|
+
entityFqdn: "wix.papyrus.v1.document",
|
|
258
|
+
method: "GET",
|
|
259
|
+
methodFqn: "wix.papyrus.v1.DocumentService.GetDocument",
|
|
260
|
+
packageName: PACKAGE_NAME,
|
|
261
|
+
migrationOptions: {
|
|
262
|
+
optInTransformResponse: true
|
|
263
|
+
},
|
|
264
|
+
url: resolveWixPapyrusV1DocumentServiceUrl({
|
|
265
|
+
protoPath: "/v1/documents/{documentId}",
|
|
266
|
+
data: payload,
|
|
267
|
+
host
|
|
268
|
+
}),
|
|
269
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
270
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
271
|
+
{
|
|
272
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
273
|
+
paths: [
|
|
274
|
+
{ path: "document.createdDate" },
|
|
275
|
+
{ path: "document.updatedDate" },
|
|
276
|
+
{ path: "document.expirationDate" }
|
|
277
|
+
]
|
|
278
|
+
}
|
|
279
|
+
])
|
|
280
|
+
};
|
|
281
|
+
return metadata;
|
|
282
|
+
}
|
|
283
|
+
return __getDocument;
|
|
284
|
+
}
|
|
285
|
+
function deleteDocument(payload) {
|
|
286
|
+
function __deleteDocument({ host }) {
|
|
287
|
+
const metadata = {
|
|
288
|
+
entityFqdn: "wix.papyrus.v1.document",
|
|
289
|
+
method: "DELETE",
|
|
290
|
+
methodFqn: "wix.papyrus.v1.DocumentService.DeleteDocument",
|
|
291
|
+
packageName: PACKAGE_NAME,
|
|
292
|
+
migrationOptions: {
|
|
293
|
+
optInTransformResponse: true
|
|
294
|
+
},
|
|
295
|
+
url: resolveWixPapyrusV1DocumentServiceUrl({
|
|
296
|
+
protoPath: "/v1/documents/{documentId}",
|
|
297
|
+
data: payload,
|
|
298
|
+
host
|
|
299
|
+
}),
|
|
300
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
301
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
302
|
+
{
|
|
303
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
304
|
+
paths: [
|
|
305
|
+
{ path: "document.createdDate" },
|
|
306
|
+
{ path: "document.updatedDate" },
|
|
307
|
+
{ path: "document.expirationDate" }
|
|
308
|
+
]
|
|
309
|
+
}
|
|
310
|
+
])
|
|
311
|
+
};
|
|
312
|
+
return metadata;
|
|
313
|
+
}
|
|
314
|
+
return __deleteDocument;
|
|
315
|
+
}
|
|
316
|
+
function queryDocument(payload) {
|
|
317
|
+
function __queryDocument({ host }) {
|
|
318
|
+
const metadata = {
|
|
319
|
+
entityFqdn: "wix.papyrus.v1.document",
|
|
320
|
+
method: "POST",
|
|
321
|
+
methodFqn: "wix.papyrus.v1.DocumentService.QueryDocument",
|
|
322
|
+
packageName: PACKAGE_NAME,
|
|
323
|
+
migrationOptions: {
|
|
324
|
+
optInTransformResponse: true
|
|
325
|
+
},
|
|
326
|
+
url: resolveWixPapyrusV1DocumentServiceUrl({
|
|
327
|
+
protoPath: "/v1/documents/query",
|
|
328
|
+
data: payload,
|
|
329
|
+
host
|
|
330
|
+
}),
|
|
331
|
+
data: payload,
|
|
332
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
333
|
+
{
|
|
334
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
335
|
+
paths: [
|
|
336
|
+
{ path: "documents.createdDate" },
|
|
337
|
+
{ path: "documents.updatedDate" },
|
|
338
|
+
{ path: "documents.expirationDate" }
|
|
339
|
+
]
|
|
340
|
+
}
|
|
341
|
+
])
|
|
342
|
+
};
|
|
343
|
+
return metadata;
|
|
344
|
+
}
|
|
345
|
+
return __queryDocument;
|
|
346
|
+
}
|
|
347
|
+
function updateDocument(payload) {
|
|
348
|
+
function __updateDocument({ host }) {
|
|
349
|
+
const metadata = {
|
|
350
|
+
entityFqdn: "wix.papyrus.v1.document",
|
|
351
|
+
method: "PATCH",
|
|
352
|
+
methodFqn: "wix.papyrus.v1.DocumentService.UpdateDocument",
|
|
353
|
+
packageName: PACKAGE_NAME,
|
|
354
|
+
migrationOptions: {
|
|
355
|
+
optInTransformResponse: true
|
|
356
|
+
},
|
|
357
|
+
url: resolveWixPapyrusV1DocumentServiceUrl({
|
|
358
|
+
protoPath: "/v1/documents/{id}",
|
|
359
|
+
data: payload,
|
|
360
|
+
host
|
|
361
|
+
}),
|
|
362
|
+
data: payload,
|
|
363
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
364
|
+
{
|
|
365
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
366
|
+
paths: [
|
|
367
|
+
{ path: "document.createdDate" },
|
|
368
|
+
{ path: "document.updatedDate" },
|
|
369
|
+
{ path: "document.expirationDate" }
|
|
370
|
+
]
|
|
371
|
+
}
|
|
372
|
+
])
|
|
373
|
+
};
|
|
374
|
+
return metadata;
|
|
375
|
+
}
|
|
376
|
+
return __updateDocument;
|
|
377
|
+
}
|
|
378
|
+
function downloadDocument(payload) {
|
|
379
|
+
function __downloadDocument({ host }) {
|
|
380
|
+
const metadata = {
|
|
381
|
+
entityFqdn: "wix.papyrus.v1.document",
|
|
382
|
+
method: "GET",
|
|
383
|
+
methodFqn: "wix.papyrus.v1.DocumentService.DownloadDocument",
|
|
384
|
+
packageName: PACKAGE_NAME,
|
|
385
|
+
migrationOptions: {
|
|
386
|
+
optInTransformResponse: true
|
|
387
|
+
},
|
|
388
|
+
url: resolveWixPapyrusV1DocumentServiceUrl({
|
|
389
|
+
protoPath: "/v1/documents/download/{documentId}",
|
|
390
|
+
data: payload,
|
|
391
|
+
host
|
|
392
|
+
}),
|
|
393
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
394
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
395
|
+
{
|
|
396
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
397
|
+
paths: [{ path: "expirationDate" }]
|
|
398
|
+
}
|
|
399
|
+
])
|
|
400
|
+
};
|
|
401
|
+
return metadata;
|
|
402
|
+
}
|
|
403
|
+
return __downloadDocument;
|
|
404
|
+
}
|
|
405
|
+
function getDownloadUrl(payload) {
|
|
406
|
+
function __getDownloadUrl({ host }) {
|
|
407
|
+
const metadata = {
|
|
408
|
+
entityFqdn: "wix.papyrus.v1.document",
|
|
409
|
+
method: "GET",
|
|
410
|
+
methodFqn: "wix.papyrus.v1.DocumentService.GetDownloadUrl",
|
|
411
|
+
packageName: PACKAGE_NAME,
|
|
412
|
+
migrationOptions: {
|
|
413
|
+
optInTransformResponse: true
|
|
414
|
+
},
|
|
415
|
+
url: resolveWixPapyrusV1DocumentServiceUrl({
|
|
416
|
+
protoPath: "/v1/documents/download-url",
|
|
417
|
+
data: payload,
|
|
418
|
+
host
|
|
419
|
+
}),
|
|
420
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
421
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
422
|
+
{
|
|
423
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
424
|
+
paths: [{ path: "expirationDate" }]
|
|
425
|
+
}
|
|
426
|
+
])
|
|
427
|
+
};
|
|
428
|
+
return metadata;
|
|
429
|
+
}
|
|
430
|
+
return __getDownloadUrl;
|
|
431
|
+
}
|
|
432
|
+
function downloadDocumentSource(payload) {
|
|
433
|
+
function __downloadDocumentSource({ host }) {
|
|
434
|
+
const metadata = {
|
|
435
|
+
entityFqdn: "wix.papyrus.v1.document",
|
|
436
|
+
method: "GET",
|
|
437
|
+
methodFqn: "wix.papyrus.v1.DocumentService.DownloadDocumentSource",
|
|
438
|
+
packageName: PACKAGE_NAME,
|
|
439
|
+
migrationOptions: {
|
|
440
|
+
optInTransformResponse: true
|
|
441
|
+
},
|
|
442
|
+
url: resolveWixPapyrusV1DocumentServiceUrl({
|
|
443
|
+
protoPath: "/v1/documents/download/{documentId}/source",
|
|
444
|
+
data: payload,
|
|
445
|
+
host
|
|
446
|
+
}),
|
|
447
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
448
|
+
};
|
|
449
|
+
return metadata;
|
|
450
|
+
}
|
|
451
|
+
return __downloadDocumentSource;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
// src/papyrus-v1-document-documents.universal.ts
|
|
455
|
+
var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
456
|
+
var import_query_builder_utils = require("@wix/sdk-runtime/query-builder-utils");
|
|
457
|
+
var RenderStatus = /* @__PURE__ */ ((RenderStatus2) => {
|
|
458
|
+
RenderStatus2["UNKNOWN"] = "UNKNOWN";
|
|
459
|
+
RenderStatus2["ACCEPTED"] = "ACCEPTED";
|
|
460
|
+
RenderStatus2["RENDERING"] = "RENDERING";
|
|
461
|
+
RenderStatus2["READY"] = "READY";
|
|
462
|
+
RenderStatus2["FAILED"] = "FAILED";
|
|
463
|
+
RenderStatus2["EXPIRED"] = "EXPIRED";
|
|
464
|
+
return RenderStatus2;
|
|
465
|
+
})(RenderStatus || {});
|
|
466
|
+
var Format = /* @__PURE__ */ ((Format2) => {
|
|
467
|
+
Format2["UNKNOWN"] = "UNKNOWN";
|
|
468
|
+
Format2["PDF"] = "PDF";
|
|
469
|
+
return Format2;
|
|
470
|
+
})(Format || {});
|
|
471
|
+
var WixMpClientVersion = /* @__PURE__ */ ((WixMpClientVersion2) => {
|
|
472
|
+
WixMpClientVersion2["UNKNOWN"] = "UNKNOWN";
|
|
473
|
+
WixMpClientVersion2["MP_V1"] = "MP_V1";
|
|
474
|
+
WixMpClientVersion2["MP_V2"] = "MP_V2";
|
|
475
|
+
return WixMpClientVersion2;
|
|
476
|
+
})(WixMpClientVersion || {});
|
|
477
|
+
var ResizeOption = /* @__PURE__ */ ((ResizeOption2) => {
|
|
478
|
+
ResizeOption2["FIT"] = "FIT";
|
|
479
|
+
ResizeOption2["CROP"] = "CROP";
|
|
480
|
+
return ResizeOption2;
|
|
481
|
+
})(ResizeOption || {});
|
|
482
|
+
var PaperSize = /* @__PURE__ */ ((PaperSize2) => {
|
|
483
|
+
PaperSize2["A4_PORTRAIT"] = "A4_PORTRAIT";
|
|
484
|
+
PaperSize2["A4_LANDSCAPE"] = "A4_LANDSCAPE";
|
|
485
|
+
return PaperSize2;
|
|
486
|
+
})(PaperSize || {});
|
|
487
|
+
var PageOverflow = /* @__PURE__ */ ((PageOverflow2) => {
|
|
488
|
+
PageOverflow2["CONTENT_HIDDEN"] = "CONTENT_HIDDEN";
|
|
489
|
+
PageOverflow2["CONTENT_BREAK"] = "CONTENT_BREAK";
|
|
490
|
+
return PageOverflow2;
|
|
491
|
+
})(PageOverflow || {});
|
|
492
|
+
var RenderFormat = /* @__PURE__ */ ((RenderFormat2) => {
|
|
493
|
+
RenderFormat2["PDF"] = "PDF";
|
|
494
|
+
RenderFormat2["HTML"] = "HTML";
|
|
495
|
+
return RenderFormat2;
|
|
496
|
+
})(RenderFormat || {});
|
|
497
|
+
var RequestedFields = /* @__PURE__ */ ((RequestedFields2) => {
|
|
498
|
+
RequestedFields2["DOCUMENT_CONTENT"] = "DOCUMENT_CONTENT";
|
|
499
|
+
return RequestedFields2;
|
|
500
|
+
})(RequestedFields || {});
|
|
501
|
+
var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
|
|
502
|
+
SortOrder2["ASC"] = "ASC";
|
|
503
|
+
SortOrder2["DESC"] = "DESC";
|
|
504
|
+
return SortOrder2;
|
|
505
|
+
})(SortOrder || {});
|
|
506
|
+
var ContentDisposition = /* @__PURE__ */ ((ContentDisposition2) => {
|
|
507
|
+
ContentDisposition2["ATTACHMENT"] = "ATTACHMENT";
|
|
508
|
+
ContentDisposition2["INLINE"] = "INLINE";
|
|
509
|
+
return ContentDisposition2;
|
|
510
|
+
})(ContentDisposition || {});
|
|
511
|
+
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
512
|
+
WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
513
|
+
WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
514
|
+
WebhookIdentityType2["MEMBER"] = "MEMBER";
|
|
515
|
+
WebhookIdentityType2["WIX_USER"] = "WIX_USER";
|
|
516
|
+
WebhookIdentityType2["APP"] = "APP";
|
|
517
|
+
return WebhookIdentityType2;
|
|
518
|
+
})(WebhookIdentityType || {});
|
|
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
|
+
}
|
|
565
|
+
async function createDocument2(options) {
|
|
566
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
567
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
568
|
+
document: options?.document
|
|
569
|
+
});
|
|
570
|
+
const reqOpts = createDocument(payload);
|
|
571
|
+
sideEffects?.onSiteCall?.();
|
|
572
|
+
try {
|
|
573
|
+
const result = await httpClient.request(reqOpts);
|
|
574
|
+
sideEffects?.onSuccess?.(result);
|
|
575
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.document;
|
|
576
|
+
} catch (err) {
|
|
577
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
578
|
+
err,
|
|
579
|
+
{
|
|
580
|
+
spreadPathsToArguments: {},
|
|
581
|
+
explicitPathsToArguments: { document: "$[0].document" },
|
|
582
|
+
singleArgumentUnchanged: false
|
|
583
|
+
},
|
|
584
|
+
["options"]
|
|
585
|
+
);
|
|
586
|
+
sideEffects?.onError?.(err);
|
|
587
|
+
throw transformedError;
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
async function getDocument2(documentId, options) {
|
|
591
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
592
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
593
|
+
documentId,
|
|
594
|
+
fields: options?.fields
|
|
595
|
+
});
|
|
596
|
+
const reqOpts = getDocument(payload);
|
|
597
|
+
sideEffects?.onSiteCall?.();
|
|
598
|
+
try {
|
|
599
|
+
const result = await httpClient.request(reqOpts);
|
|
600
|
+
sideEffects?.onSuccess?.(result);
|
|
601
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.document;
|
|
602
|
+
} catch (err) {
|
|
603
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
604
|
+
err,
|
|
605
|
+
{
|
|
606
|
+
spreadPathsToArguments: {},
|
|
607
|
+
explicitPathsToArguments: { documentId: "$[0]", fields: "$[1].fields" },
|
|
608
|
+
singleArgumentUnchanged: false
|
|
609
|
+
},
|
|
610
|
+
["documentId", "options"]
|
|
611
|
+
);
|
|
612
|
+
sideEffects?.onError?.(err);
|
|
613
|
+
throw transformedError;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
async function deleteDocument2(documentId) {
|
|
617
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
618
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
619
|
+
documentId
|
|
620
|
+
});
|
|
621
|
+
const reqOpts = deleteDocument(payload);
|
|
622
|
+
sideEffects?.onSiteCall?.();
|
|
623
|
+
try {
|
|
624
|
+
const result = await httpClient.request(reqOpts);
|
|
625
|
+
sideEffects?.onSuccess?.(result);
|
|
626
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
627
|
+
} catch (err) {
|
|
628
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
629
|
+
err,
|
|
630
|
+
{
|
|
631
|
+
spreadPathsToArguments: {},
|
|
632
|
+
explicitPathsToArguments: { documentId: "$[0]" },
|
|
633
|
+
singleArgumentUnchanged: false
|
|
634
|
+
},
|
|
635
|
+
["documentId"]
|
|
636
|
+
);
|
|
637
|
+
sideEffects?.onError?.(err);
|
|
638
|
+
throw transformedError;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
function queryDocument2(options) {
|
|
642
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
643
|
+
return (0, import_query_builder.queryBuilder)({
|
|
644
|
+
func: async (payload) => {
|
|
645
|
+
const reqOpts = queryDocument({
|
|
646
|
+
...payload,
|
|
647
|
+
...options ?? {}
|
|
648
|
+
});
|
|
649
|
+
sideEffects?.onSiteCall?.();
|
|
650
|
+
try {
|
|
651
|
+
const result = await httpClient.request(reqOpts);
|
|
652
|
+
sideEffects?.onSuccess?.(result);
|
|
653
|
+
return result;
|
|
654
|
+
} catch (err) {
|
|
655
|
+
sideEffects?.onError?.(err);
|
|
656
|
+
throw err;
|
|
657
|
+
}
|
|
658
|
+
},
|
|
659
|
+
requestTransformer: (query) => {
|
|
660
|
+
const args = [query, options];
|
|
661
|
+
return (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
662
|
+
...args?.[1],
|
|
663
|
+
query: args?.[0]
|
|
664
|
+
});
|
|
665
|
+
},
|
|
666
|
+
responseTransformer: ({ data }) => {
|
|
667
|
+
const transformedData = (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
|
|
668
|
+
(0, import_transform_paths2.transformPaths)(data, [])
|
|
669
|
+
);
|
|
670
|
+
return {
|
|
671
|
+
items: transformedData?.documents,
|
|
672
|
+
pagingMetadata: transformedData?.metadata
|
|
673
|
+
};
|
|
674
|
+
},
|
|
675
|
+
errorTransformer: (err) => {
|
|
676
|
+
const transformedError = (0, import_transform_error.transformError)(err, {
|
|
677
|
+
spreadPathsToArguments: {},
|
|
678
|
+
explicitPathsToArguments: { query: "$[0]" },
|
|
679
|
+
singleArgumentUnchanged: false
|
|
680
|
+
});
|
|
681
|
+
throw transformedError;
|
|
682
|
+
},
|
|
683
|
+
pagingMethod: "CURSOR",
|
|
684
|
+
transformationPaths: {}
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
async function typedQueryDocument(query, options) {
|
|
688
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
689
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
690
|
+
query,
|
|
691
|
+
...options
|
|
692
|
+
});
|
|
693
|
+
const reqOpts = queryDocument(payload);
|
|
694
|
+
sideEffects?.onSiteCall?.();
|
|
695
|
+
try {
|
|
696
|
+
const result = await httpClient.request(reqOpts);
|
|
697
|
+
sideEffects?.onSuccess?.(result);
|
|
698
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
699
|
+
} catch (err) {
|
|
700
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
701
|
+
err,
|
|
702
|
+
{
|
|
703
|
+
spreadPathsToArguments: {},
|
|
704
|
+
explicitPathsToArguments: { query: "$[0]" },
|
|
705
|
+
singleArgumentUnchanged: false
|
|
706
|
+
},
|
|
707
|
+
["query", "options"]
|
|
708
|
+
);
|
|
709
|
+
sideEffects?.onError?.(err);
|
|
710
|
+
throw transformedError;
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
var utils = {
|
|
714
|
+
query: {
|
|
715
|
+
...(0, import_query_builder_utils.createQueryUtils)()
|
|
716
|
+
}
|
|
717
|
+
};
|
|
718
|
+
async function updateDocument2(_id, options) {
|
|
719
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
720
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
721
|
+
id: _id,
|
|
722
|
+
renderStatus: options?.renderStatus,
|
|
723
|
+
file: options?.file,
|
|
724
|
+
sourceFile: options?.sourceFile
|
|
725
|
+
});
|
|
726
|
+
const reqOpts = updateDocument(payload);
|
|
727
|
+
sideEffects?.onSiteCall?.();
|
|
728
|
+
try {
|
|
729
|
+
const result = await httpClient.request(reqOpts);
|
|
730
|
+
sideEffects?.onSuccess?.(result);
|
|
731
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
732
|
+
} catch (err) {
|
|
733
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
734
|
+
err,
|
|
735
|
+
{
|
|
736
|
+
spreadPathsToArguments: {},
|
|
737
|
+
explicitPathsToArguments: {
|
|
738
|
+
id: "$[0]",
|
|
739
|
+
renderStatus: "$[1].renderStatus",
|
|
740
|
+
file: "$[1].file",
|
|
741
|
+
sourceFile: "$[1].sourceFile"
|
|
742
|
+
},
|
|
743
|
+
singleArgumentUnchanged: false
|
|
744
|
+
},
|
|
745
|
+
["_id", "options"]
|
|
746
|
+
);
|
|
747
|
+
sideEffects?.onError?.(err);
|
|
748
|
+
throw transformedError;
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
async function downloadDocument2(documentId, options) {
|
|
752
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
753
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
754
|
+
documentId,
|
|
755
|
+
urlExpirationInSeconds: options?.urlExpirationInSeconds,
|
|
756
|
+
contentDisposition: options?.contentDisposition
|
|
757
|
+
});
|
|
758
|
+
const reqOpts = downloadDocument(payload);
|
|
759
|
+
sideEffects?.onSiteCall?.();
|
|
760
|
+
try {
|
|
761
|
+
const result = await httpClient.request(reqOpts);
|
|
762
|
+
sideEffects?.onSuccess?.(result);
|
|
763
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
764
|
+
} catch (err) {
|
|
765
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
766
|
+
err,
|
|
767
|
+
{
|
|
768
|
+
spreadPathsToArguments: {},
|
|
769
|
+
explicitPathsToArguments: {
|
|
770
|
+
documentId: "$[0]",
|
|
771
|
+
urlExpirationInSeconds: "$[1].urlExpirationInSeconds",
|
|
772
|
+
contentDisposition: "$[1].contentDisposition"
|
|
773
|
+
},
|
|
774
|
+
singleArgumentUnchanged: false
|
|
775
|
+
},
|
|
776
|
+
["documentId", "options"]
|
|
777
|
+
);
|
|
778
|
+
sideEffects?.onError?.(err);
|
|
779
|
+
throw transformedError;
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
async function getDownloadUrl2(options) {
|
|
783
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
784
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
785
|
+
documentId: options?.documentId,
|
|
786
|
+
externalId: options?.externalId,
|
|
787
|
+
fileToken: options?.fileToken,
|
|
788
|
+
urlExpirationInSeconds: options?.urlExpirationInSeconds,
|
|
789
|
+
downloadButtonText: options?.downloadButtonText,
|
|
790
|
+
contentDisposition: options?.contentDisposition
|
|
791
|
+
});
|
|
792
|
+
const reqOpts = getDownloadUrl(payload);
|
|
793
|
+
sideEffects?.onSiteCall?.();
|
|
794
|
+
try {
|
|
795
|
+
const result = await httpClient.request(reqOpts);
|
|
796
|
+
sideEffects?.onSuccess?.(result);
|
|
797
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
798
|
+
} catch (err) {
|
|
799
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
800
|
+
err,
|
|
801
|
+
{
|
|
802
|
+
spreadPathsToArguments: {},
|
|
803
|
+
explicitPathsToArguments: {
|
|
804
|
+
documentId: "$[0].documentId",
|
|
805
|
+
externalId: "$[0].externalId",
|
|
806
|
+
fileToken: "$[0].fileToken",
|
|
807
|
+
urlExpirationInSeconds: "$[0].urlExpirationInSeconds",
|
|
808
|
+
downloadButtonText: "$[0].downloadButtonText",
|
|
809
|
+
contentDisposition: "$[0].contentDisposition"
|
|
810
|
+
},
|
|
811
|
+
singleArgumentUnchanged: false
|
|
812
|
+
},
|
|
813
|
+
["options"]
|
|
814
|
+
);
|
|
815
|
+
sideEffects?.onError?.(err);
|
|
816
|
+
throw transformedError;
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
async function downloadDocumentSource2(documentId, options) {
|
|
820
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
821
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
822
|
+
documentId,
|
|
823
|
+
contentDisposition: options?.contentDisposition
|
|
824
|
+
});
|
|
825
|
+
const reqOpts = downloadDocumentSource(payload);
|
|
826
|
+
sideEffects?.onSiteCall?.();
|
|
827
|
+
try {
|
|
828
|
+
const result = await httpClient.request(reqOpts);
|
|
829
|
+
sideEffects?.onSuccess?.(result);
|
|
830
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
831
|
+
} catch (err) {
|
|
832
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
833
|
+
err,
|
|
834
|
+
{
|
|
835
|
+
spreadPathsToArguments: {},
|
|
836
|
+
explicitPathsToArguments: {
|
|
837
|
+
documentId: "$[0]",
|
|
838
|
+
contentDisposition: "$[1].contentDisposition"
|
|
839
|
+
},
|
|
840
|
+
singleArgumentUnchanged: false
|
|
841
|
+
},
|
|
842
|
+
["documentId", "options"]
|
|
843
|
+
);
|
|
844
|
+
sideEffects?.onError?.(err);
|
|
845
|
+
throw transformedError;
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
// src/papyrus-v1-document-documents.public.ts
|
|
850
|
+
function getDownloadPage3(httpClient) {
|
|
851
|
+
return (file) => getDownloadPage2(
|
|
852
|
+
file,
|
|
853
|
+
// @ts-ignore
|
|
854
|
+
{ httpClient }
|
|
855
|
+
);
|
|
856
|
+
}
|
|
857
|
+
function redirectToDocument3(httpClient) {
|
|
858
|
+
return (file) => redirectToDocument2(
|
|
859
|
+
file,
|
|
860
|
+
// @ts-ignore
|
|
861
|
+
{ httpClient }
|
|
862
|
+
);
|
|
863
|
+
}
|
|
864
|
+
function createDocument3(httpClient) {
|
|
865
|
+
return (options) => createDocument2(
|
|
866
|
+
options,
|
|
867
|
+
// @ts-ignore
|
|
868
|
+
{ httpClient }
|
|
869
|
+
);
|
|
870
|
+
}
|
|
871
|
+
function getDocument3(httpClient) {
|
|
872
|
+
return (documentId, options) => getDocument2(
|
|
873
|
+
documentId,
|
|
874
|
+
options,
|
|
875
|
+
// @ts-ignore
|
|
876
|
+
{ httpClient }
|
|
877
|
+
);
|
|
878
|
+
}
|
|
879
|
+
function deleteDocument3(httpClient) {
|
|
880
|
+
return (documentId) => deleteDocument2(
|
|
881
|
+
documentId,
|
|
882
|
+
// @ts-ignore
|
|
883
|
+
{ httpClient }
|
|
884
|
+
);
|
|
885
|
+
}
|
|
886
|
+
function queryDocument3(httpClient) {
|
|
887
|
+
return (options) => queryDocument2(
|
|
888
|
+
options,
|
|
889
|
+
// @ts-ignore
|
|
890
|
+
{ httpClient }
|
|
891
|
+
);
|
|
892
|
+
}
|
|
893
|
+
function typedQueryDocument2(httpClient) {
|
|
894
|
+
return (query, options) => typedQueryDocument(
|
|
895
|
+
query,
|
|
896
|
+
options,
|
|
897
|
+
// @ts-ignore
|
|
898
|
+
{ httpClient }
|
|
899
|
+
);
|
|
900
|
+
}
|
|
901
|
+
function updateDocument3(httpClient) {
|
|
902
|
+
return (_id, options) => updateDocument2(
|
|
903
|
+
_id,
|
|
904
|
+
options,
|
|
905
|
+
// @ts-ignore
|
|
906
|
+
{ httpClient }
|
|
907
|
+
);
|
|
908
|
+
}
|
|
909
|
+
function downloadDocument3(httpClient) {
|
|
910
|
+
return (documentId, options) => downloadDocument2(
|
|
911
|
+
documentId,
|
|
912
|
+
options,
|
|
913
|
+
// @ts-ignore
|
|
914
|
+
{ httpClient }
|
|
915
|
+
);
|
|
916
|
+
}
|
|
917
|
+
function getDownloadUrl3(httpClient) {
|
|
918
|
+
return (options) => getDownloadUrl2(
|
|
919
|
+
options,
|
|
920
|
+
// @ts-ignore
|
|
921
|
+
{ httpClient }
|
|
922
|
+
);
|
|
923
|
+
}
|
|
924
|
+
function downloadDocumentSource3(httpClient) {
|
|
925
|
+
return (documentId, options) => downloadDocumentSource2(
|
|
926
|
+
documentId,
|
|
927
|
+
options,
|
|
928
|
+
// @ts-ignore
|
|
929
|
+
{ httpClient }
|
|
930
|
+
);
|
|
931
|
+
}
|
|
932
|
+
var onDocumentCreated = (0, import_sdk_types.EventDefinition)(
|
|
933
|
+
"wix.papyrus.v1.document_created",
|
|
934
|
+
true,
|
|
935
|
+
(event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
|
|
936
|
+
(0, import_transform_paths3.transformPaths)(event, [
|
|
937
|
+
{
|
|
938
|
+
transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
|
|
939
|
+
paths: [
|
|
940
|
+
{ path: "entity.createdDate" },
|
|
941
|
+
{ path: "entity.updatedDate" },
|
|
942
|
+
{ path: "entity.expirationDate" },
|
|
943
|
+
{ path: "metadata.eventTime" }
|
|
944
|
+
]
|
|
945
|
+
}
|
|
946
|
+
])
|
|
947
|
+
)
|
|
948
|
+
)();
|
|
949
|
+
var onDocumentDeleted = (0, import_sdk_types.EventDefinition)(
|
|
950
|
+
"wix.papyrus.v1.document_deleted",
|
|
951
|
+
true,
|
|
952
|
+
(event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
|
|
953
|
+
(0, import_transform_paths3.transformPaths)(event, [
|
|
954
|
+
{
|
|
955
|
+
transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
|
|
956
|
+
paths: [
|
|
957
|
+
{ path: "undefined.createdDate" },
|
|
958
|
+
{ path: "undefined.updatedDate" },
|
|
959
|
+
{ path: "undefined.expirationDate" },
|
|
960
|
+
{ path: "metadata.eventTime" }
|
|
961
|
+
]
|
|
962
|
+
}
|
|
963
|
+
])
|
|
964
|
+
)
|
|
965
|
+
)();
|
|
966
|
+
var onDocumentRenderDelayed = (0, import_sdk_types.EventDefinition)(
|
|
967
|
+
"wix.papyrus.v1.document_document_render_delayed",
|
|
968
|
+
true,
|
|
969
|
+
(event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
|
|
970
|
+
(0, import_transform_paths3.transformPaths)(event, [
|
|
971
|
+
{
|
|
972
|
+
transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
|
|
973
|
+
paths: [
|
|
974
|
+
{ path: "data.document.createdDate" },
|
|
975
|
+
{ path: "data.document.updatedDate" },
|
|
976
|
+
{ path: "data.document.expirationDate" },
|
|
977
|
+
{ path: "metadata.eventTime" }
|
|
978
|
+
]
|
|
979
|
+
}
|
|
980
|
+
])
|
|
981
|
+
)
|
|
982
|
+
)();
|
|
983
|
+
var onDocumentRenderFailed = (0, import_sdk_types.EventDefinition)(
|
|
984
|
+
"wix.papyrus.v1.document_document_render_failed",
|
|
985
|
+
true,
|
|
986
|
+
(event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
|
|
987
|
+
(0, import_transform_paths3.transformPaths)(event, [
|
|
988
|
+
{
|
|
989
|
+
transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
|
|
990
|
+
paths: [
|
|
991
|
+
{ path: "data.document.createdDate" },
|
|
992
|
+
{ path: "data.document.updatedDate" },
|
|
993
|
+
{ path: "data.document.expirationDate" },
|
|
994
|
+
{ path: "metadata.eventTime" }
|
|
995
|
+
]
|
|
996
|
+
}
|
|
997
|
+
])
|
|
998
|
+
)
|
|
999
|
+
)();
|
|
1000
|
+
var onDocumentRendered = (0, import_sdk_types.EventDefinition)(
|
|
1001
|
+
"wix.papyrus.v1.document_document_rendered",
|
|
1002
|
+
true,
|
|
1003
|
+
(event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
|
|
1004
|
+
(0, import_transform_paths3.transformPaths)(event, [
|
|
1005
|
+
{
|
|
1006
|
+
transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
|
|
1007
|
+
paths: [
|
|
1008
|
+
{ path: "data.document.createdDate" },
|
|
1009
|
+
{ path: "data.document.updatedDate" },
|
|
1010
|
+
{ path: "data.document.expirationDate" },
|
|
1011
|
+
{ path: "metadata.eventTime" }
|
|
1012
|
+
]
|
|
1013
|
+
}
|
|
1014
|
+
])
|
|
1015
|
+
)
|
|
1016
|
+
)();
|
|
1017
|
+
var onDocumentUpdated = (0, import_sdk_types.EventDefinition)(
|
|
1018
|
+
"wix.papyrus.v1.document_updated",
|
|
1019
|
+
true,
|
|
1020
|
+
(event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
|
|
1021
|
+
(0, import_transform_paths3.transformPaths)(event, [
|
|
1022
|
+
{
|
|
1023
|
+
transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
|
|
1024
|
+
paths: [
|
|
1025
|
+
{ path: "entity.createdDate" },
|
|
1026
|
+
{ path: "entity.updatedDate" },
|
|
1027
|
+
{ path: "entity.expirationDate" },
|
|
1028
|
+
{ path: "metadata.eventTime" }
|
|
1029
|
+
]
|
|
1030
|
+
}
|
|
1031
|
+
])
|
|
1032
|
+
)
|
|
1033
|
+
)();
|
|
1034
|
+
|
|
1035
|
+
// src/papyrus-v1-document-documents.context.ts
|
|
1036
|
+
var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
|
|
1037
|
+
var import_event_definition_modules = require("@wix/sdk-runtime/event-definition-modules");
|
|
1038
|
+
var import_query_method_router = require("@wix/sdk-runtime/query-method-router");
|
|
1039
|
+
function customQueryDocument(httpClient) {
|
|
1040
|
+
const router = (0, import_query_method_router.createQueryOverloadRouter)({
|
|
1041
|
+
builderQueryFunction: (options) => queryDocument3(httpClient)(options),
|
|
1042
|
+
typedQueryFunction: (query, options) => typedQueryDocument2(httpClient)(query, options),
|
|
1043
|
+
hasOptionsParameter: true
|
|
1044
|
+
});
|
|
1045
|
+
function overloadedQuery(queryOrOptions, options) {
|
|
1046
|
+
return router(...arguments);
|
|
1047
|
+
}
|
|
1048
|
+
return overloadedQuery;
|
|
1049
|
+
}
|
|
1050
|
+
var getDownloadPage4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getDownloadPage3);
|
|
1051
|
+
var redirectToDocument4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(redirectToDocument3);
|
|
1052
|
+
var createDocument4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createDocument3);
|
|
1053
|
+
var getDocument4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getDocument3);
|
|
1054
|
+
var deleteDocument4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deleteDocument3);
|
|
1055
|
+
var updateDocument4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateDocument3);
|
|
1056
|
+
var downloadDocument4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(downloadDocument3);
|
|
1057
|
+
var getDownloadUrl4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getDownloadUrl3);
|
|
1058
|
+
var downloadDocumentSource4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(downloadDocumentSource3);
|
|
1059
|
+
var queryDocument4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(customQueryDocument);
|
|
1060
|
+
var onDocumentCreated2 = (0, import_event_definition_modules.createEventModule)(onDocumentCreated);
|
|
1061
|
+
var onDocumentDeleted2 = (0, import_event_definition_modules.createEventModule)(onDocumentDeleted);
|
|
1062
|
+
var onDocumentRenderDelayed2 = (0, import_event_definition_modules.createEventModule)(
|
|
1063
|
+
onDocumentRenderDelayed
|
|
1064
|
+
);
|
|
1065
|
+
var onDocumentRenderFailed2 = (0, import_event_definition_modules.createEventModule)(
|
|
1066
|
+
onDocumentRenderFailed
|
|
1067
|
+
);
|
|
1068
|
+
var onDocumentRendered2 = (0, import_event_definition_modules.createEventModule)(onDocumentRendered);
|
|
1069
|
+
var onDocumentUpdated2 = (0, import_event_definition_modules.createEventModule)(onDocumentUpdated);
|
|
1070
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1071
|
+
0 && (module.exports = {
|
|
1072
|
+
ContentDisposition,
|
|
1073
|
+
Format,
|
|
1074
|
+
PageOverflow,
|
|
1075
|
+
PaperSize,
|
|
1076
|
+
RenderFormat,
|
|
1077
|
+
RenderStatus,
|
|
1078
|
+
RequestedFields,
|
|
1079
|
+
ResizeOption,
|
|
1080
|
+
SortOrder,
|
|
1081
|
+
WebhookIdentityType,
|
|
1082
|
+
WixMpClientVersion,
|
|
1083
|
+
createDocument,
|
|
1084
|
+
deleteDocument,
|
|
1085
|
+
downloadDocument,
|
|
1086
|
+
downloadDocumentSource,
|
|
1087
|
+
getDocument,
|
|
1088
|
+
getDownloadPage,
|
|
1089
|
+
getDownloadUrl,
|
|
1090
|
+
onDocumentCreated,
|
|
1091
|
+
onDocumentDeleted,
|
|
1092
|
+
onDocumentRenderDelayed,
|
|
1093
|
+
onDocumentRenderFailed,
|
|
1094
|
+
onDocumentRendered,
|
|
1095
|
+
onDocumentUpdated,
|
|
1096
|
+
queryDocument,
|
|
1097
|
+
redirectToDocument,
|
|
1098
|
+
updateDocument,
|
|
1099
|
+
utils
|
|
1100
|
+
});
|
|
1101
|
+
//# sourceMappingURL=index.js.map
|