@wix/auto_sdk_papyrus_documents 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,21 @@
1
1
  import { HttpClient, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
- import { CreateDocumentOptions, GetDocumentOptions, DeleteDocumentResponse, UpdateDocumentOptions, UpdateDocumentResponse, DownloadDocumentOptions, DownloadDocumentResponse, DownloadDocumentApplicationErrors, GetDownloadUrlOptions, GetDownloadUrlResponse, DownloadDocumentSourceOptions, DownloadDocumentSourceResponse, DownloadDocumentSourceApplicationErrors, RawHttpResponse, DocumentCreatedEnvelope, DocumentDeletedEnvelope, DocumentRenderDelayedEnvelope, DocumentRenderFailedEnvelope, DocumentRenderedEnvelope, DocumentUpdatedEnvelope, DocumentQuery, QueryDocumentOptions, typedQueryDocument, DocumentsQueryBuilder } from './index.typings.mjs';
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.mjs';
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.mjs';
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;
@@ -20,7 +20,7 @@ import { transformSDKTimestampToRESTTimestamp } from "@wix/sdk-runtime/transform
20
20
  import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
21
21
  import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
22
22
  import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
23
- function resolveWixPapyrusV1DownloadPageControllerUrl(opts) {
23
+ function resolveWixPapyrusV1DocumentServiceUrl(opts) {
24
24
  const domainToMappings = {
25
25
  "api._base_domain_": [
26
26
  {
@@ -63,7 +63,7 @@ function resolveWixPapyrusV1DownloadPageControllerUrl(opts) {
63
63
  };
64
64
  return resolveUrl(Object.assign(opts, { domainToMappings }));
65
65
  }
66
- function resolveWixPapyrusV1DocumentServiceUrl(opts) {
66
+ function resolveWixPapyrusV1DownloadPageControllerUrl(opts) {
67
67
  const domainToMappings = {
68
68
  "api._base_domain_": [
69
69
  {
@@ -107,6 +107,60 @@ function resolveWixPapyrusV1DocumentServiceUrl(opts) {
107
107
  return resolveUrl(Object.assign(opts, { domainToMappings }));
108
108
  }
109
109
  var PACKAGE_NAME = "@wix/auto_sdk_papyrus_documents";
110
+ function getDownloadPage(payload) {
111
+ function __getDownloadPage({ host }) {
112
+ const metadata = {
113
+ entityFqdn: "wix.papyrus.v1.document",
114
+ method: "GET",
115
+ methodFqn: "wix.papyrus.v1.DownloadPageController.GetDownloadPage",
116
+ packageName: PACKAGE_NAME,
117
+ migrationOptions: {
118
+ optInTransformResponse: true
119
+ },
120
+ url: resolveWixPapyrusV1DownloadPageControllerUrl({
121
+ protoPath: "/download",
122
+ data: payload,
123
+ host
124
+ }),
125
+ params: toURLSearchParams(payload),
126
+ transformResponse: (payload2) => transformPaths(payload2, [
127
+ {
128
+ transformFn: transformRESTBytesToSDKBytes,
129
+ paths: [{ path: "body" }]
130
+ }
131
+ ])
132
+ };
133
+ return metadata;
134
+ }
135
+ return __getDownloadPage;
136
+ }
137
+ function redirectToDocument(payload) {
138
+ function __redirectToDocument({ host }) {
139
+ const metadata = {
140
+ entityFqdn: "wix.papyrus.v1.document",
141
+ method: "GET",
142
+ methodFqn: "wix.papyrus.v1.DownloadPageController.RedirectToDocument",
143
+ packageName: PACKAGE_NAME,
144
+ migrationOptions: {
145
+ optInTransformResponse: true
146
+ },
147
+ url: resolveWixPapyrusV1DownloadPageControllerUrl({
148
+ protoPath: "/view",
149
+ data: payload,
150
+ host
151
+ }),
152
+ params: toURLSearchParams(payload),
153
+ transformResponse: (payload2) => transformPaths(payload2, [
154
+ {
155
+ transformFn: transformRESTBytesToSDKBytes,
156
+ paths: [{ path: "body" }]
157
+ }
158
+ ])
159
+ };
160
+ return metadata;
161
+ }
162
+ return __redirectToDocument;
163
+ }
110
164
  function createDocument(payload) {
111
165
  function __createDocument({ host }) {
112
166
  const serializedData = transformPaths(payload, [
@@ -356,60 +410,6 @@ function downloadDocumentSource(payload) {
356
410
  }
357
411
  return __downloadDocumentSource;
358
412
  }
359
- function getDownloadPage(payload) {
360
- function __getDownloadPage({ host }) {
361
- const metadata = {
362
- entityFqdn: "wix.papyrus.v1.document",
363
- method: "GET",
364
- methodFqn: "wix.papyrus.v1.DownloadPageController.GetDownloadPage",
365
- packageName: PACKAGE_NAME,
366
- migrationOptions: {
367
- optInTransformResponse: true
368
- },
369
- url: resolveWixPapyrusV1DownloadPageControllerUrl({
370
- protoPath: "/download",
371
- data: payload,
372
- host
373
- }),
374
- params: toURLSearchParams(payload),
375
- transformResponse: (payload2) => transformPaths(payload2, [
376
- {
377
- transformFn: transformRESTBytesToSDKBytes,
378
- paths: [{ path: "body" }]
379
- }
380
- ])
381
- };
382
- return metadata;
383
- }
384
- return __getDownloadPage;
385
- }
386
- function redirectToDocument(payload) {
387
- function __redirectToDocument({ host }) {
388
- const metadata = {
389
- entityFqdn: "wix.papyrus.v1.document",
390
- method: "GET",
391
- methodFqn: "wix.papyrus.v1.DownloadPageController.RedirectToDocument",
392
- packageName: PACKAGE_NAME,
393
- migrationOptions: {
394
- optInTransformResponse: true
395
- },
396
- url: resolveWixPapyrusV1DownloadPageControllerUrl({
397
- protoPath: "/view",
398
- data: payload,
399
- host
400
- }),
401
- params: toURLSearchParams(payload),
402
- transformResponse: (payload2) => transformPaths(payload2, [
403
- {
404
- transformFn: transformRESTBytesToSDKBytes,
405
- paths: [{ path: "body" }]
406
- }
407
- ])
408
- };
409
- return metadata;
410
- }
411
- return __redirectToDocument;
412
- }
413
413
 
414
414
  // src/papyrus-v1-document-documents.universal.ts
415
415
  import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
@@ -434,6 +434,26 @@ var WixMpClientVersion = /* @__PURE__ */ ((WixMpClientVersion2) => {
434
434
  WixMpClientVersion2["MP_V2"] = "MP_V2";
435
435
  return WixMpClientVersion2;
436
436
  })(WixMpClientVersion || {});
437
+ var ResizeOption = /* @__PURE__ */ ((ResizeOption2) => {
438
+ ResizeOption2["FIT"] = "FIT";
439
+ ResizeOption2["CROP"] = "CROP";
440
+ return ResizeOption2;
441
+ })(ResizeOption || {});
442
+ var PaperSize = /* @__PURE__ */ ((PaperSize2) => {
443
+ PaperSize2["A4_PORTRAIT"] = "A4_PORTRAIT";
444
+ PaperSize2["A4_LANDSCAPE"] = "A4_LANDSCAPE";
445
+ return PaperSize2;
446
+ })(PaperSize || {});
447
+ var PageOverflow = /* @__PURE__ */ ((PageOverflow2) => {
448
+ PageOverflow2["CONTENT_HIDDEN"] = "CONTENT_HIDDEN";
449
+ PageOverflow2["CONTENT_BREAK"] = "CONTENT_BREAK";
450
+ return PageOverflow2;
451
+ })(PageOverflow || {});
452
+ var RenderFormat = /* @__PURE__ */ ((RenderFormat2) => {
453
+ RenderFormat2["PDF"] = "PDF";
454
+ RenderFormat2["HTML"] = "HTML";
455
+ return RenderFormat2;
456
+ })(RenderFormat || {});
437
457
  var RequestedFields = /* @__PURE__ */ ((RequestedFields2) => {
438
458
  RequestedFields2["DOCUMENT_CONTENT"] = "DOCUMENT_CONTENT";
439
459
  return RequestedFields2;
@@ -457,26 +477,52 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
457
477
  WebhookIdentityType2["APP"] = "APP";
458
478
  return WebhookIdentityType2;
459
479
  })(WebhookIdentityType || {});
460
- var ResizeOption = /* @__PURE__ */ ((ResizeOption2) => {
461
- ResizeOption2["FIT"] = "FIT";
462
- ResizeOption2["CROP"] = "CROP";
463
- return ResizeOption2;
464
- })(ResizeOption || {});
465
- var PaperSize = /* @__PURE__ */ ((PaperSize2) => {
466
- PaperSize2["A4_PORTRAIT"] = "A4_PORTRAIT";
467
- PaperSize2["A4_LANDSCAPE"] = "A4_LANDSCAPE";
468
- return PaperSize2;
469
- })(PaperSize || {});
470
- var PageOverflow = /* @__PURE__ */ ((PageOverflow2) => {
471
- PageOverflow2["CONTENT_HIDDEN"] = "CONTENT_HIDDEN";
472
- PageOverflow2["CONTENT_BREAK"] = "CONTENT_BREAK";
473
- return PageOverflow2;
474
- })(PageOverflow || {});
475
- var RenderFormat = /* @__PURE__ */ ((RenderFormat2) => {
476
- RenderFormat2["PDF"] = "PDF";
477
- RenderFormat2["HTML"] = "HTML";
478
- return RenderFormat2;
479
- })(RenderFormat || {});
480
+ async function getDownloadPage2(file) {
481
+ const { httpClient, sideEffects } = arguments[1];
482
+ const payload = renameKeysFromSDKRequestToRESTRequest({ file });
483
+ const reqOpts = getDownloadPage(payload);
484
+ sideEffects?.onSiteCall?.();
485
+ try {
486
+ const result = await httpClient.request(reqOpts);
487
+ sideEffects?.onSuccess?.(result);
488
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
489
+ } catch (err) {
490
+ const transformedError = sdkTransformError(
491
+ err,
492
+ {
493
+ spreadPathsToArguments: {},
494
+ explicitPathsToArguments: { file: "$[0]" },
495
+ singleArgumentUnchanged: false
496
+ },
497
+ ["file"]
498
+ );
499
+ sideEffects?.onError?.(err);
500
+ throw transformedError;
501
+ }
502
+ }
503
+ async function redirectToDocument2(file) {
504
+ const { httpClient, sideEffects } = arguments[1];
505
+ const payload = renameKeysFromSDKRequestToRESTRequest({ file });
506
+ const reqOpts = redirectToDocument(payload);
507
+ sideEffects?.onSiteCall?.();
508
+ try {
509
+ const result = await httpClient.request(reqOpts);
510
+ sideEffects?.onSuccess?.(result);
511
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
512
+ } catch (err) {
513
+ const transformedError = sdkTransformError(
514
+ err,
515
+ {
516
+ spreadPathsToArguments: {},
517
+ explicitPathsToArguments: { file: "$[0]" },
518
+ singleArgumentUnchanged: false
519
+ },
520
+ ["file"]
521
+ );
522
+ sideEffects?.onError?.(err);
523
+ throw transformedError;
524
+ }
525
+ }
480
526
  async function createDocument2(options) {
481
527
  const { httpClient, sideEffects } = arguments[1];
482
528
  const payload = renameKeysFromSDKRequestToRESTRequest({
@@ -758,54 +804,22 @@ async function downloadDocumentSource2(documentId, options) {
758
804
  throw transformedError;
759
805
  }
760
806
  }
761
- async function getDownloadPage2(file) {
762
- const { httpClient, sideEffects } = arguments[1];
763
- const payload = renameKeysFromSDKRequestToRESTRequest({ file });
764
- const reqOpts = getDownloadPage(payload);
765
- sideEffects?.onSiteCall?.();
766
- try {
767
- const result = await httpClient.request(reqOpts);
768
- sideEffects?.onSuccess?.(result);
769
- return renameKeysFromRESTResponseToSDKResponse(result.data);
770
- } catch (err) {
771
- const transformedError = sdkTransformError(
772
- err,
773
- {
774
- spreadPathsToArguments: {},
775
- explicitPathsToArguments: { file: "$[0]" },
776
- singleArgumentUnchanged: false
777
- },
778
- ["file"]
779
- );
780
- sideEffects?.onError?.(err);
781
- throw transformedError;
782
- }
783
- }
784
- async function redirectToDocument2(file) {
785
- const { httpClient, sideEffects } = arguments[1];
786
- const payload = renameKeysFromSDKRequestToRESTRequest({ file });
787
- const reqOpts = redirectToDocument(payload);
788
- sideEffects?.onSiteCall?.();
789
- try {
790
- const result = await httpClient.request(reqOpts);
791
- sideEffects?.onSuccess?.(result);
792
- return renameKeysFromRESTResponseToSDKResponse(result.data);
793
- } catch (err) {
794
- const transformedError = sdkTransformError(
795
- err,
796
- {
797
- spreadPathsToArguments: {},
798
- explicitPathsToArguments: { file: "$[0]" },
799
- singleArgumentUnchanged: false
800
- },
801
- ["file"]
802
- );
803
- sideEffects?.onError?.(err);
804
- throw transformedError;
805
- }
806
- }
807
807
 
808
808
  // src/papyrus-v1-document-documents.public.ts
809
+ function getDownloadPage3(httpClient) {
810
+ return (file) => getDownloadPage2(
811
+ file,
812
+ // @ts-ignore
813
+ { httpClient }
814
+ );
815
+ }
816
+ function redirectToDocument3(httpClient) {
817
+ return (file) => redirectToDocument2(
818
+ file,
819
+ // @ts-ignore
820
+ { httpClient }
821
+ );
822
+ }
809
823
  function createDocument3(httpClient) {
810
824
  return (options) => createDocument2(
811
825
  options,
@@ -874,20 +888,6 @@ function downloadDocumentSource3(httpClient) {
874
888
  { httpClient }
875
889
  );
876
890
  }
877
- function getDownloadPage3(httpClient) {
878
- return (file) => getDownloadPage2(
879
- file,
880
- // @ts-ignore
881
- { httpClient }
882
- );
883
- }
884
- function redirectToDocument3(httpClient) {
885
- return (file) => redirectToDocument2(
886
- file,
887
- // @ts-ignore
888
- { httpClient }
889
- );
890
- }
891
891
  var onDocumentCreated = /* @__PURE__ */ EventDefinition(
892
892
  "wix.papyrus.v1.document_created",
893
893
  true,
@@ -1006,6 +1006,8 @@ function customQueryDocument(httpClient) {
1006
1006
  }
1007
1007
  return overloadedQuery;
1008
1008
  }
1009
+ var getDownloadPage4 = /* @__PURE__ */ createRESTModule(getDownloadPage3);
1010
+ var redirectToDocument4 = /* @__PURE__ */ createRESTModule(redirectToDocument3);
1009
1011
  var createDocument4 = /* @__PURE__ */ createRESTModule(createDocument3);
1010
1012
  var getDocument4 = /* @__PURE__ */ createRESTModule(getDocument3);
1011
1013
  var deleteDocument4 = /* @__PURE__ */ createRESTModule(deleteDocument3);
@@ -1013,8 +1015,6 @@ var updateDocument4 = /* @__PURE__ */ createRESTModule(updateDocument3);
1013
1015
  var downloadDocument4 = /* @__PURE__ */ createRESTModule(downloadDocument3);
1014
1016
  var getDownloadUrl4 = /* @__PURE__ */ createRESTModule(getDownloadUrl3);
1015
1017
  var downloadDocumentSource4 = /* @__PURE__ */ createRESTModule(downloadDocumentSource3);
1016
- var getDownloadPage4 = /* @__PURE__ */ createRESTModule(getDownloadPage3);
1017
- var redirectToDocument4 = /* @__PURE__ */ createRESTModule(redirectToDocument3);
1018
1018
  var queryDocument4 = /* @__PURE__ */ createRESTModule(customQueryDocument);
1019
1019
  var onDocumentCreated2 = /* @__PURE__ */ createEventModule(
1020
1020
  onDocumentCreated