@wix/auto_sdk_papyrus_documents 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.d.ts +17 -17
- package/build/cjs/index.js +138 -138
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +524 -524
- package/build/cjs/index.typings.js +122 -122
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +529 -529
- package/build/cjs/meta.js +112 -112
- package/build/cjs/meta.js.map +1 -1
- package/build/cjs/schemas.d.ts +22 -22
- package/build/cjs/schemas.js +26 -26
- package/build/cjs/schemas.js.map +1 -1
- package/build/es/index.d.mts +17 -17
- package/build/es/index.mjs +138 -138
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +524 -524
- package/build/es/index.typings.mjs +122 -122
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +529 -529
- package/build/es/meta.mjs +112 -112
- package/build/es/meta.mjs.map +1 -1
- package/build/es/schemas.d.mts +22 -22
- package/build/es/schemas.mjs +26 -26
- package/build/es/schemas.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +17 -17
- package/build/internal/cjs/index.typings.d.ts +550 -550
- package/build/internal/cjs/meta.d.ts +560 -560
- package/build/internal/cjs/schemas.d.ts +22 -22
- package/build/internal/es/index.d.mts +17 -17
- package/build/internal/es/index.typings.d.mts +550 -550
- package/build/internal/es/meta.d.mts +560 -560
- package/build/internal/es/schemas.d.mts +22 -22
- package/package.json +2 -2
package/build/cjs/index.d.ts
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
import { HttpClient, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
|
|
2
|
-
import { CreateDocumentOptions, GetDocumentOptions, DeleteDocumentResponse, UpdateDocumentOptions, UpdateDocumentResponse, DownloadDocumentOptions, DownloadDocumentResponse, DownloadDocumentApplicationErrors, GetDownloadUrlOptions, GetDownloadUrlResponse, DownloadDocumentSourceOptions, DownloadDocumentSourceResponse, DownloadDocumentSourceApplicationErrors,
|
|
2
|
+
import { RawHttpResponse, CreateDocumentOptions, 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, Document, 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;
|
package/build/cjs/index.js
CHANGED
|
@@ -70,7 +70,7 @@ 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
|
|
73
|
+
function resolveWixPapyrusV1DocumentServiceUrl(opts) {
|
|
74
74
|
const domainToMappings = {
|
|
75
75
|
"api._base_domain_": [
|
|
76
76
|
{
|
|
@@ -113,7 +113,7 @@ function resolveWixPapyrusV1DownloadPageControllerUrl(opts) {
|
|
|
113
113
|
};
|
|
114
114
|
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function resolveWixPapyrusV1DownloadPageControllerUrl(opts) {
|
|
117
117
|
const domainToMappings = {
|
|
118
118
|
"api._base_domain_": [
|
|
119
119
|
{
|
|
@@ -157,6 +157,60 @@ function resolveWixPapyrusV1DocumentServiceUrl(opts) {
|
|
|
157
157
|
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
158
158
|
}
|
|
159
159
|
var PACKAGE_NAME = "@wix/auto_sdk_papyrus_documents";
|
|
160
|
+
function getDownloadPage(payload) {
|
|
161
|
+
function __getDownloadPage({ host }) {
|
|
162
|
+
const metadata = {
|
|
163
|
+
entityFqdn: "wix.papyrus.v1.document",
|
|
164
|
+
method: "GET",
|
|
165
|
+
methodFqn: "wix.papyrus.v1.DownloadPageController.GetDownloadPage",
|
|
166
|
+
packageName: PACKAGE_NAME,
|
|
167
|
+
migrationOptions: {
|
|
168
|
+
optInTransformResponse: true
|
|
169
|
+
},
|
|
170
|
+
url: resolveWixPapyrusV1DownloadPageControllerUrl({
|
|
171
|
+
protoPath: "/download",
|
|
172
|
+
data: payload,
|
|
173
|
+
host
|
|
174
|
+
}),
|
|
175
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
176
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
177
|
+
{
|
|
178
|
+
transformFn: import_bytes.transformRESTBytesToSDKBytes,
|
|
179
|
+
paths: [{ path: "body" }]
|
|
180
|
+
}
|
|
181
|
+
])
|
|
182
|
+
};
|
|
183
|
+
return metadata;
|
|
184
|
+
}
|
|
185
|
+
return __getDownloadPage;
|
|
186
|
+
}
|
|
187
|
+
function redirectToDocument(payload) {
|
|
188
|
+
function __redirectToDocument({ host }) {
|
|
189
|
+
const metadata = {
|
|
190
|
+
entityFqdn: "wix.papyrus.v1.document",
|
|
191
|
+
method: "GET",
|
|
192
|
+
methodFqn: "wix.papyrus.v1.DownloadPageController.RedirectToDocument",
|
|
193
|
+
packageName: PACKAGE_NAME,
|
|
194
|
+
migrationOptions: {
|
|
195
|
+
optInTransformResponse: true
|
|
196
|
+
},
|
|
197
|
+
url: resolveWixPapyrusV1DownloadPageControllerUrl({
|
|
198
|
+
protoPath: "/view",
|
|
199
|
+
data: payload,
|
|
200
|
+
host
|
|
201
|
+
}),
|
|
202
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
203
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
204
|
+
{
|
|
205
|
+
transformFn: import_bytes.transformRESTBytesToSDKBytes,
|
|
206
|
+
paths: [{ path: "body" }]
|
|
207
|
+
}
|
|
208
|
+
])
|
|
209
|
+
};
|
|
210
|
+
return metadata;
|
|
211
|
+
}
|
|
212
|
+
return __redirectToDocument;
|
|
213
|
+
}
|
|
160
214
|
function createDocument(payload) {
|
|
161
215
|
function __createDocument({ host }) {
|
|
162
216
|
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
@@ -406,60 +460,6 @@ function downloadDocumentSource(payload) {
|
|
|
406
460
|
}
|
|
407
461
|
return __downloadDocumentSource;
|
|
408
462
|
}
|
|
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
463
|
|
|
464
464
|
// src/papyrus-v1-document-documents.universal.ts
|
|
465
465
|
var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
@@ -484,6 +484,26 @@ var WixMpClientVersion = /* @__PURE__ */ ((WixMpClientVersion2) => {
|
|
|
484
484
|
WixMpClientVersion2["MP_V2"] = "MP_V2";
|
|
485
485
|
return WixMpClientVersion2;
|
|
486
486
|
})(WixMpClientVersion || {});
|
|
487
|
+
var ResizeOption = /* @__PURE__ */ ((ResizeOption2) => {
|
|
488
|
+
ResizeOption2["FIT"] = "FIT";
|
|
489
|
+
ResizeOption2["CROP"] = "CROP";
|
|
490
|
+
return ResizeOption2;
|
|
491
|
+
})(ResizeOption || {});
|
|
492
|
+
var PaperSize = /* @__PURE__ */ ((PaperSize2) => {
|
|
493
|
+
PaperSize2["A4_PORTRAIT"] = "A4_PORTRAIT";
|
|
494
|
+
PaperSize2["A4_LANDSCAPE"] = "A4_LANDSCAPE";
|
|
495
|
+
return PaperSize2;
|
|
496
|
+
})(PaperSize || {});
|
|
497
|
+
var PageOverflow = /* @__PURE__ */ ((PageOverflow2) => {
|
|
498
|
+
PageOverflow2["CONTENT_HIDDEN"] = "CONTENT_HIDDEN";
|
|
499
|
+
PageOverflow2["CONTENT_BREAK"] = "CONTENT_BREAK";
|
|
500
|
+
return PageOverflow2;
|
|
501
|
+
})(PageOverflow || {});
|
|
502
|
+
var RenderFormat = /* @__PURE__ */ ((RenderFormat2) => {
|
|
503
|
+
RenderFormat2["PDF"] = "PDF";
|
|
504
|
+
RenderFormat2["HTML"] = "HTML";
|
|
505
|
+
return RenderFormat2;
|
|
506
|
+
})(RenderFormat || {});
|
|
487
507
|
var RequestedFields = /* @__PURE__ */ ((RequestedFields2) => {
|
|
488
508
|
RequestedFields2["DOCUMENT_CONTENT"] = "DOCUMENT_CONTENT";
|
|
489
509
|
return RequestedFields2;
|
|
@@ -507,26 +527,52 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
|
507
527
|
WebhookIdentityType2["APP"] = "APP";
|
|
508
528
|
return WebhookIdentityType2;
|
|
509
529
|
})(WebhookIdentityType || {});
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
})
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
+
async function getDownloadPage2(file) {
|
|
531
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
532
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ file });
|
|
533
|
+
const reqOpts = getDownloadPage(payload);
|
|
534
|
+
sideEffects?.onSiteCall?.();
|
|
535
|
+
try {
|
|
536
|
+
const result = await httpClient.request(reqOpts);
|
|
537
|
+
sideEffects?.onSuccess?.(result);
|
|
538
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
539
|
+
} catch (err) {
|
|
540
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
541
|
+
err,
|
|
542
|
+
{
|
|
543
|
+
spreadPathsToArguments: {},
|
|
544
|
+
explicitPathsToArguments: { file: "$[0]" },
|
|
545
|
+
singleArgumentUnchanged: false
|
|
546
|
+
},
|
|
547
|
+
["file"]
|
|
548
|
+
);
|
|
549
|
+
sideEffects?.onError?.(err);
|
|
550
|
+
throw transformedError;
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
async function redirectToDocument2(file) {
|
|
554
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
555
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ file });
|
|
556
|
+
const reqOpts = redirectToDocument(payload);
|
|
557
|
+
sideEffects?.onSiteCall?.();
|
|
558
|
+
try {
|
|
559
|
+
const result = await httpClient.request(reqOpts);
|
|
560
|
+
sideEffects?.onSuccess?.(result);
|
|
561
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
562
|
+
} catch (err) {
|
|
563
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
564
|
+
err,
|
|
565
|
+
{
|
|
566
|
+
spreadPathsToArguments: {},
|
|
567
|
+
explicitPathsToArguments: { file: "$[0]" },
|
|
568
|
+
singleArgumentUnchanged: false
|
|
569
|
+
},
|
|
570
|
+
["file"]
|
|
571
|
+
);
|
|
572
|
+
sideEffects?.onError?.(err);
|
|
573
|
+
throw transformedError;
|
|
574
|
+
}
|
|
575
|
+
}
|
|
530
576
|
async function createDocument2(options) {
|
|
531
577
|
const { httpClient, sideEffects } = arguments[1];
|
|
532
578
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
@@ -808,54 +854,22 @@ async function downloadDocumentSource2(documentId, options) {
|
|
|
808
854
|
throw transformedError;
|
|
809
855
|
}
|
|
810
856
|
}
|
|
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
857
|
|
|
858
858
|
// src/papyrus-v1-document-documents.public.ts
|
|
859
|
+
function getDownloadPage3(httpClient) {
|
|
860
|
+
return (file) => getDownloadPage2(
|
|
861
|
+
file,
|
|
862
|
+
// @ts-ignore
|
|
863
|
+
{ httpClient }
|
|
864
|
+
);
|
|
865
|
+
}
|
|
866
|
+
function redirectToDocument3(httpClient) {
|
|
867
|
+
return (file) => redirectToDocument2(
|
|
868
|
+
file,
|
|
869
|
+
// @ts-ignore
|
|
870
|
+
{ httpClient }
|
|
871
|
+
);
|
|
872
|
+
}
|
|
859
873
|
function createDocument3(httpClient) {
|
|
860
874
|
return (options) => createDocument2(
|
|
861
875
|
options,
|
|
@@ -924,20 +938,6 @@ function downloadDocumentSource3(httpClient) {
|
|
|
924
938
|
{ httpClient }
|
|
925
939
|
);
|
|
926
940
|
}
|
|
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
941
|
var onDocumentCreated = /* @__PURE__ */ (0, import_sdk_types.EventDefinition)(
|
|
942
942
|
"wix.papyrus.v1.document_created",
|
|
943
943
|
true,
|
|
@@ -1056,6 +1056,8 @@ function customQueryDocument(httpClient) {
|
|
|
1056
1056
|
}
|
|
1057
1057
|
return overloadedQuery;
|
|
1058
1058
|
}
|
|
1059
|
+
var getDownloadPage4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getDownloadPage3);
|
|
1060
|
+
var redirectToDocument4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(redirectToDocument3);
|
|
1059
1061
|
var createDocument4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createDocument3);
|
|
1060
1062
|
var getDocument4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getDocument3);
|
|
1061
1063
|
var deleteDocument4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deleteDocument3);
|
|
@@ -1063,8 +1065,6 @@ var updateDocument4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)
|
|
|
1063
1065
|
var downloadDocument4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(downloadDocument3);
|
|
1064
1066
|
var getDownloadUrl4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getDownloadUrl3);
|
|
1065
1067
|
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
1068
|
var queryDocument4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(customQueryDocument);
|
|
1069
1069
|
var onDocumentCreated2 = /* @__PURE__ */ (0, import_event_definition_modules.createEventModule)(
|
|
1070
1070
|
onDocumentCreated
|