@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,1465 @@
1
+ import * as _wix_sdk_types from '@wix/sdk-types';
2
+ import { QuerySpec, Query } from '@wix/sdk-types';
3
+
4
+ /** Document is the main entity of DocumentService. */
5
+ interface Document {
6
+ /**
7
+ * Document ID.
8
+ * @format GUID
9
+ * @readonly
10
+ */
11
+ _id?: string | null;
12
+ /**
13
+ * Represents the time this Document was created.
14
+ * @readonly
15
+ */
16
+ _createdDate?: Date | null;
17
+ /**
18
+ * Represents the time this Document was last updated.
19
+ * @readonly
20
+ */
21
+ _updatedDate?: Date | null;
22
+ /**
23
+ * Document render status.
24
+ * @readonly
25
+ */
26
+ renderStatus?: RenderStatusWithLiterals;
27
+ /**
28
+ * URL to download document. Returned only when Document is in `READY` state.
29
+ * @format WEB_URL
30
+ * @readonly
31
+ */
32
+ downloadUrl?: string | null;
33
+ /**
34
+ * Template ID. When this parameter used the document will be rendered with this template default settings
35
+ * @minLength 1
36
+ * @maxLength 20
37
+ * @immutable
38
+ */
39
+ templateId?: string | null;
40
+ /**
41
+ * Unique per tenant external ID, for example order number. Used to retrieve Document later.
42
+ * @minLength 1
43
+ * @maxLength 100
44
+ * @immutable
45
+ */
46
+ externalId?: string | null;
47
+ /**
48
+ * Unique per tenant template external ID, for example ticket definition ID. Used to lookup corresponding template & template settings.
49
+ * @maxLength 100
50
+ * @immutable
51
+ */
52
+ templateSettingsExternalId?: string | null;
53
+ /**
54
+ * Template settings ID.
55
+ * @format GUID
56
+ * @immutable
57
+ */
58
+ templateSettingsId?: string | null;
59
+ /**
60
+ * The app slug of the template
61
+ * @minLength 1
62
+ * @maxLength 20
63
+ * @immutable
64
+ */
65
+ appSlug?: string | null;
66
+ /**
67
+ * The type of the template.
68
+ * @minLength 1
69
+ * @maxLength 20
70
+ * @immutable
71
+ */
72
+ templateType?: string | null;
73
+ /**
74
+ * Document content that is injected into template.
75
+ * @immutable
76
+ */
77
+ content?: DocumentContent;
78
+ /**
79
+ * Number of hours after which document will be eventually expired and its content erased.
80
+ * @min 1
81
+ * @max 43800
82
+ * @immutable
83
+ */
84
+ expiresInHours?: number;
85
+ /**
86
+ * Represents the time this document becomes expired.
87
+ * @readonly
88
+ */
89
+ expirationDate?: Date | null;
90
+ /**
91
+ * Document format. Defaults to `PDF`.
92
+ * @immutable
93
+ */
94
+ format?: FormatWithLiterals;
95
+ /**
96
+ * Whether the link to the uploaded document is public or private.
97
+ * For public document static URL will be returned.
98
+ * For private document temporary URL will be generated by DocumentService.DownloadDocument.
99
+ * @immutable
100
+ */
101
+ public?: boolean | null;
102
+ /**
103
+ * Optional filename (without extension) to be used for the downloadable document.
104
+ * @minLength 1
105
+ * @maxLength 50
106
+ */
107
+ fileName?: string | null;
108
+ /**
109
+ * Client defined content checksum. Can be used for content comparison.
110
+ * @minLength 1
111
+ * @maxLength 64
112
+ * @immutable
113
+ */
114
+ contentChecksum?: string | null;
115
+ /** Rendering notification config. */
116
+ renderDelayedEventConfig?: RenderDelayedEventConfig;
117
+ /**
118
+ * Size in bytes of a rendered document. Returned only when Document is in `READY` state.
119
+ * @readonly
120
+ */
121
+ sizeInBytes?: number | null;
122
+ }
123
+ declare enum RenderStatus {
124
+ UNKNOWN = "UNKNOWN",
125
+ /** Document was accepted and is waiting to be rendered. */
126
+ ACCEPTED = "ACCEPTED",
127
+ /** Rendering is in progress. */
128
+ RENDERING = "RENDERING",
129
+ /** Rendering finished successfully and document is ready to download. */
130
+ READY = "READY",
131
+ /** Rendering failed. */
132
+ FAILED = "FAILED",
133
+ /** Rendered document expired and is no longer available for download. */
134
+ EXPIRED = "EXPIRED"
135
+ }
136
+ /** @enumType */
137
+ type RenderStatusWithLiterals = RenderStatus | 'UNKNOWN' | 'ACCEPTED' | 'RENDERING' | 'READY' | 'FAILED' | 'EXPIRED';
138
+ interface DocumentContent {
139
+ /**
140
+ * Document pages. Each page is reference as $page.
141
+ * @minSize 1
142
+ * @maxSize 100
143
+ */
144
+ pages?: Record<string, any>[] | null;
145
+ /** Other document content referenced by $content variable */
146
+ content?: Record<string, any> | null;
147
+ /**
148
+ * ISO 639-1 language code of content (used in translations).
149
+ * @format LANGUAGE
150
+ */
151
+ language?: string;
152
+ /**
153
+ * e.g. en-US.
154
+ * @minLength 2
155
+ * @maxLength 35
156
+ */
157
+ locale?: string | null;
158
+ }
159
+ declare enum Format {
160
+ UNKNOWN = "UNKNOWN",
161
+ PDF = "PDF"
162
+ }
163
+ /** @enumType */
164
+ type FormatWithLiterals = Format | 'UNKNOWN' | 'PDF';
165
+ interface TemplateSettingsOverride {
166
+ /**
167
+ * Indices (0-based) of pages with template settings override.
168
+ * @max 99
169
+ */
170
+ pageIndices?: number[];
171
+ /**
172
+ * Template settings ID.
173
+ * @format GUID
174
+ */
175
+ templateSettingsId?: string | null;
176
+ /**
177
+ * Unique per tenant template external ID, for example ticket definition ID. Used to lookup corresponding template & template settings.
178
+ * @maxLength 100
179
+ */
180
+ templateSettingsExternalId?: string | null;
181
+ /**
182
+ * Template ID. When this parameter used the page will be rendered with this template default settings
183
+ * @minLength 1
184
+ * @maxLength 20
185
+ * @immutable
186
+ */
187
+ templateId?: string | null;
188
+ }
189
+ interface PageSettings {
190
+ /**
191
+ * Indices (0-based) of pages with template settings override.
192
+ * @max 99
193
+ */
194
+ pageIndices?: number[];
195
+ /**
196
+ * Template settings ID.
197
+ * @format GUID
198
+ */
199
+ templateSettingsId?: string | null;
200
+ /**
201
+ * Unique per tenant template external ID, for example ticket definition ID. Used to lookup corresponding template & template settings.
202
+ * @maxLength 100
203
+ */
204
+ templateSettingsExternalId?: string | null;
205
+ /**
206
+ * Template ID. When this parameter used the page will be rendered with this template default settings
207
+ * @minLength 1
208
+ * @maxLength 20
209
+ * @immutable
210
+ */
211
+ templateId?: string | null;
212
+ }
213
+ declare enum WixMpClientVersion {
214
+ UNKNOWN = "UNKNOWN",
215
+ MP_V1 = "MP_V1",
216
+ MP_V2 = "MP_V2"
217
+ }
218
+ /** @enumType */
219
+ type WixMpClientVersionWithLiterals = WixMpClientVersion | 'UNKNOWN' | 'MP_V1' | 'MP_V2';
220
+ interface RenderDelayedEventConfig {
221
+ /**
222
+ * Controls DocumentRenderDelayed action event sending.
223
+ * Event will be sent after time_in_queue_minutes if document render status is ACCEPTED/RENDERING.
224
+ * @min 5
225
+ * @max 120
226
+ * @immutable
227
+ */
228
+ timeInQueueMinutes?: number;
229
+ }
230
+ interface DebugOptions {
231
+ /**
232
+ * Overrides statics for this document during the rendering
233
+ * @maxLength 60
234
+ * @immutable
235
+ */
236
+ staticsVersionOverride?: string | null;
237
+ }
238
+ interface RenderDocumentRequest {
239
+ /** Template settings. */
240
+ templateSettings?: TemplateSettings;
241
+ /** Document content. */
242
+ content?: DocumentContent;
243
+ /** Output format, defaults to PDF. */
244
+ outputFormat?: RenderFormatWithLiterals;
245
+ /**
246
+ * Overrides papyrusTemplatesStaticsUrl: "//static.parastorage.com/services/papyrus-templates-statics/${version_override}/"
247
+ * @maxLength 100
248
+ */
249
+ versionOverride?: string | null;
250
+ /**
251
+ * Overrides static versions for the statics config.
252
+ * @maxSize 10
253
+ */
254
+ staticOverrides?: Record<string, string>;
255
+ }
256
+ interface TemplateSettings {
257
+ /**
258
+ * Auto generated ID.
259
+ * @format GUID
260
+ * @readonly
261
+ */
262
+ _id?: string | null;
263
+ /**
264
+ * Wix app definition ID.
265
+ * @minLength 1
266
+ * @maxLength 20
267
+ */
268
+ appSlug?: string | null;
269
+ /**
270
+ * The type of the template.
271
+ * @minLength 1
272
+ * @maxLength 20
273
+ */
274
+ templateType?: string | null;
275
+ /**
276
+ * The id of the template.
277
+ * @minLength 1
278
+ * @maxLength 20
279
+ */
280
+ templateId?: string | null;
281
+ /**
282
+ * Template settings external ID. For example ticket definition ID.
283
+ * Must be unique per tenant where tenant is taken from authorization (wix_app_id + meta_site_id)
284
+ * @minLength 1
285
+ * @maxLength 100
286
+ */
287
+ externalId?: string | null;
288
+ /**
289
+ * Date settings were created.
290
+ * @readonly
291
+ */
292
+ _createdDate?: Date | null;
293
+ /**
294
+ * Date settings were updated.
295
+ * @readonly
296
+ */
297
+ _updatedDate?: Date | null;
298
+ /** @maxSize 10 */
299
+ settingGroups?: SettingsGroup[];
300
+ /** Paper size */
301
+ paperSize?: PaperSizeWithLiterals;
302
+ pageOverflow?: PageOverflowWithLiterals;
303
+ }
304
+ interface TextSetting {
305
+ /**
306
+ * Font family class name
307
+ * @maxLength 20
308
+ */
309
+ fontFamily?: string | null;
310
+ /**
311
+ * Font style class names
312
+ * @maxSize 10
313
+ * @maxLength 20
314
+ */
315
+ fontStyle?: string[];
316
+ /**
317
+ * Text alignment class name
318
+ * @maxLength 20
319
+ */
320
+ textAlignment?: string | null;
321
+ /**
322
+ * Text color hex code
323
+ * @minLength 7
324
+ * @maxLength 7
325
+ */
326
+ textColor?: string | null;
327
+ /**
328
+ * Font size
329
+ * @min 1
330
+ */
331
+ fontSize?: number | null;
332
+ /** Text content setting */
333
+ textContent?: TextContent[];
334
+ }
335
+ interface TextContent {
336
+ /**
337
+ * @minLength 3
338
+ * @maxLength 50
339
+ */
340
+ _id?: string;
341
+ /** @maxLength 500 */
342
+ value?: string | null;
343
+ visible?: boolean;
344
+ }
345
+ interface ImageSetting {
346
+ /** Wix media Image */
347
+ image?: string;
348
+ /** Image resizing mode */
349
+ resize?: ResizeOptionWithLiterals;
350
+ }
351
+ interface FocalPoint {
352
+ /** X-coordinate of the focal point. */
353
+ x?: number;
354
+ /** Y-coordinate of the focal point. */
355
+ y?: number;
356
+ /** crop by height */
357
+ height?: number | null;
358
+ /** crop by width */
359
+ width?: number | null;
360
+ }
361
+ declare enum ResizeOption {
362
+ /** Automatically resizes full image to fit image field */
363
+ FIT = "FIT",
364
+ /** Enables user to manually crop image to fit image field */
365
+ CROP = "CROP"
366
+ }
367
+ /** @enumType */
368
+ type ResizeOptionWithLiterals = ResizeOption | 'FIT' | 'CROP';
369
+ interface SelectSetting {
370
+ /** Selected value */
371
+ value?: string | null;
372
+ /**
373
+ * Color hex code
374
+ * @minLength 7
375
+ * @maxLength 7
376
+ */
377
+ primaryColor?: string | null;
378
+ /**
379
+ * Color hex code
380
+ * @minLength 7
381
+ * @maxLength 7
382
+ */
383
+ secondaryColor?: string | null;
384
+ /** Size */
385
+ size?: number | null;
386
+ }
387
+ interface BackgroundSetting {
388
+ /**
389
+ * Color of the background hex code
390
+ * @minLength 7
391
+ * @maxLength 9
392
+ */
393
+ color?: string | null;
394
+ /** Wix media Image */
395
+ image?: string;
396
+ }
397
+ interface SettingsGroup {
398
+ /**
399
+ * Id of the control group
400
+ * @minLength 5
401
+ * @maxLength 50
402
+ */
403
+ groupId?: string;
404
+ /**
405
+ * Display settings.
406
+ * @maxSize 20
407
+ */
408
+ display?: Record<string, boolean>;
409
+ /**
410
+ * Texts settings.
411
+ * @maxSize 20
412
+ */
413
+ texts?: Record<string, TextSetting>;
414
+ /**
415
+ * Images settings.
416
+ * @maxSize 10
417
+ */
418
+ images?: Record<string, ImageSetting>;
419
+ /**
420
+ * Select option settings.
421
+ * @maxSize 20
422
+ */
423
+ selects?: Record<string, SelectSetting>;
424
+ /**
425
+ * Backgrounds settings.
426
+ * @maxSize 20
427
+ */
428
+ backgrounds?: Record<string, BackgroundSetting>;
429
+ }
430
+ declare enum PaperSize {
431
+ A4_PORTRAIT = "A4_PORTRAIT",
432
+ A4_LANDSCAPE = "A4_LANDSCAPE"
433
+ }
434
+ /** @enumType */
435
+ type PaperSizeWithLiterals = PaperSize | 'A4_PORTRAIT' | 'A4_LANDSCAPE';
436
+ declare enum PageOverflow {
437
+ CONTENT_HIDDEN = "CONTENT_HIDDEN",
438
+ CONTENT_BREAK = "CONTENT_BREAK"
439
+ }
440
+ /** @enumType */
441
+ type PageOverflowWithLiterals = PageOverflow | 'CONTENT_HIDDEN' | 'CONTENT_BREAK';
442
+ declare enum RenderFormat {
443
+ /** content-type: application/pdf */
444
+ PDF = "PDF",
445
+ /** content-type: text/html */
446
+ HTML = "HTML"
447
+ }
448
+ /** @enumType */
449
+ type RenderFormatWithLiterals = RenderFormat | 'PDF' | 'HTML';
450
+ interface RawHttpResponse {
451
+ body?: Uint8Array;
452
+ statusCode?: number | null;
453
+ headers?: HeadersEntry[];
454
+ }
455
+ interface HeadersEntry {
456
+ key?: string;
457
+ value?: string;
458
+ }
459
+ interface RenderDocumentByIdRequest {
460
+ /**
461
+ * Document ID.
462
+ * @format GUID
463
+ */
464
+ documentId?: string | null;
465
+ /** Output format, defaults to PDF. */
466
+ outputFormat?: RenderFormatWithLiterals;
467
+ }
468
+ interface DomainEvent extends DomainEventBodyOneOf {
469
+ createdEvent?: EntityCreatedEvent;
470
+ updatedEvent?: EntityUpdatedEvent;
471
+ deletedEvent?: EntityDeletedEvent;
472
+ actionEvent?: ActionEvent;
473
+ /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
474
+ _id?: string;
475
+ /**
476
+ * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
477
+ * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
478
+ */
479
+ entityFqdn?: string;
480
+ /**
481
+ * Event action name, placed at the top level to make it easier for users to dispatch messages.
482
+ * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
483
+ */
484
+ slug?: string;
485
+ /** ID of the entity associated with the event. */
486
+ entityId?: string;
487
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
488
+ eventTime?: Date | null;
489
+ /**
490
+ * Whether the event was triggered as a result of a privacy regulation application
491
+ * (for example, GDPR).
492
+ */
493
+ triggeredByAnonymizeRequest?: boolean | null;
494
+ /** If present, indicates the action that triggered the event. */
495
+ originatedFrom?: string | null;
496
+ /**
497
+ * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.
498
+ * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.
499
+ */
500
+ entityEventSequence?: string | null;
501
+ }
502
+ /** @oneof */
503
+ interface DomainEventBodyOneOf {
504
+ createdEvent?: EntityCreatedEvent;
505
+ updatedEvent?: EntityUpdatedEvent;
506
+ deletedEvent?: EntityDeletedEvent;
507
+ actionEvent?: ActionEvent;
508
+ }
509
+ interface EntityCreatedEvent {
510
+ entity?: string;
511
+ }
512
+ interface RestoreInfo {
513
+ deletedDate?: Date | null;
514
+ }
515
+ interface EntityUpdatedEvent {
516
+ /**
517
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
518
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
519
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
520
+ */
521
+ currentEntity?: string;
522
+ }
523
+ interface EntityDeletedEvent {
524
+ /** Entity that was deleted. */
525
+ deletedEntity?: string | null;
526
+ }
527
+ interface ActionEvent {
528
+ body?: string;
529
+ }
530
+ interface Empty {
531
+ }
532
+ interface GetRendererInfoRequest {
533
+ }
534
+ interface GetRendererInfoResponse {
535
+ /** Renderer info */
536
+ info?: Record<string, string>;
537
+ }
538
+ interface GetCachedHtmlRequest {
539
+ /**
540
+ * Html Access Key.
541
+ * @maxLength 100
542
+ */
543
+ htmlAccessKey?: string;
544
+ /**
545
+ * Meta Site Id.
546
+ * @format GUID
547
+ */
548
+ metaSiteId?: string | null;
549
+ }
550
+ interface GetDownloadPageRequest {
551
+ /** @maxLength 1000 */
552
+ file: string | null;
553
+ }
554
+ interface RedirectToDocumentRequest {
555
+ /** @maxLength 1000 */
556
+ file: string | null;
557
+ }
558
+ interface DocumentRenderDelayed {
559
+ /** Document that is being rendered. */
560
+ document?: Document;
561
+ }
562
+ interface CreateDocumentRequest {
563
+ /** Document to be created */
564
+ document?: Document;
565
+ }
566
+ interface CreateDocumentResponse {
567
+ /** The created Document */
568
+ document?: Document;
569
+ }
570
+ interface GetDocumentRequest {
571
+ /**
572
+ * ID of the Document to retrieve
573
+ * @format GUID
574
+ */
575
+ documentId: string;
576
+ /** @maxSize 1 */
577
+ fields?: RequestedFieldsWithLiterals[];
578
+ }
579
+ declare enum RequestedFields {
580
+ /** Include `documentContent` in the response. */
581
+ DOCUMENT_CONTENT = "DOCUMENT_CONTENT"
582
+ }
583
+ /** @enumType */
584
+ type RequestedFieldsWithLiterals = RequestedFields | 'DOCUMENT_CONTENT';
585
+ interface GetDocumentResponse {
586
+ /** The retrieved Document */
587
+ document?: Document;
588
+ }
589
+ interface DeleteDocumentRequest {
590
+ /**
591
+ * ID of the Document to delete
592
+ * @format GUID
593
+ */
594
+ documentId: string;
595
+ }
596
+ interface DeleteDocumentResponse {
597
+ /** Deleted document. */
598
+ document?: Document;
599
+ }
600
+ interface DeleteDocumentByExternalIdRequest {
601
+ /**
602
+ * External ID of the Document to delete
603
+ * @minLength 1
604
+ * @maxLength 100
605
+ */
606
+ externalId?: string;
607
+ }
608
+ interface DeleteDocumentByExternalIdResponse {
609
+ /** Deleted document. */
610
+ document?: Document;
611
+ }
612
+ interface QueryDocumentRequest {
613
+ /** WQL expression */
614
+ query: QueryV2;
615
+ /** @maxSize 1 */
616
+ fields?: RequestedFieldsWithLiterals[];
617
+ }
618
+ interface QueryV2 extends QueryV2PagingMethodOneOf {
619
+ /** Paging options to limit and offset the number of items. */
620
+ paging?: Paging;
621
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
622
+ cursorPaging?: CursorPaging;
623
+ /**
624
+ * Filter object.
625
+ *
626
+ * Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters).
627
+ */
628
+ filter?: Record<string, any> | null;
629
+ /**
630
+ * Sort object.
631
+ *
632
+ * Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#sorting).
633
+ */
634
+ sort?: Sorting[];
635
+ /** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */
636
+ fields?: string[];
637
+ /** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */
638
+ fieldsets?: string[];
639
+ }
640
+ /** @oneof */
641
+ interface QueryV2PagingMethodOneOf {
642
+ /** Paging options to limit and offset the number of items. */
643
+ paging?: Paging;
644
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
645
+ cursorPaging?: CursorPaging;
646
+ }
647
+ interface Sorting {
648
+ /**
649
+ * Name of the field to sort by.
650
+ * @maxLength 512
651
+ */
652
+ fieldName?: string;
653
+ /** Sort order. */
654
+ order?: SortOrderWithLiterals;
655
+ }
656
+ declare enum SortOrder {
657
+ ASC = "ASC",
658
+ DESC = "DESC"
659
+ }
660
+ /** @enumType */
661
+ type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';
662
+ interface Paging {
663
+ /** Number of items to load. */
664
+ limit?: number | null;
665
+ /** Number of items to skip in the current sort order. */
666
+ offset?: number | null;
667
+ }
668
+ interface CursorPaging {
669
+ /**
670
+ * Maximum number of items to return in the results.
671
+ * @max 100
672
+ */
673
+ limit?: number | null;
674
+ /**
675
+ * Pointer to the next or previous page in the list of results.
676
+ *
677
+ * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
678
+ * Not relevant for the first request.
679
+ * @maxLength 16000
680
+ */
681
+ cursor?: string | null;
682
+ }
683
+ interface QueryDocumentResponse {
684
+ /** The retrieved Documents */
685
+ documents?: Document[];
686
+ /** Query results' metadata */
687
+ metadata?: PagingMetadataV2;
688
+ }
689
+ interface PagingMetadataV2 {
690
+ /** Number of items returned in the response. */
691
+ count?: number | null;
692
+ /** Offset that was requested. */
693
+ offset?: number | null;
694
+ /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
695
+ total?: number | null;
696
+ /** Flag that indicates the server failed to calculate the `total` field. */
697
+ tooManyToCount?: boolean | null;
698
+ /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
699
+ cursors?: Cursors;
700
+ }
701
+ interface Cursors {
702
+ /**
703
+ * Cursor string pointing to the next page in the list of results.
704
+ * @maxLength 16000
705
+ */
706
+ next?: string | null;
707
+ /**
708
+ * Cursor pointing to the previous page in the list of results.
709
+ * @maxLength 16000
710
+ */
711
+ prev?: string | null;
712
+ }
713
+ interface UpdateDocumentRequest {
714
+ /**
715
+ * Document ID.
716
+ * @format GUID
717
+ * @readonly
718
+ */
719
+ _id: string | null;
720
+ /** Document render status. */
721
+ renderStatus?: RenderStatusWithLiterals;
722
+ /** Rendered document file. */
723
+ file?: DocumentFile;
724
+ /** Rendered document source HTML file. */
725
+ sourceFile?: DocumentFile;
726
+ }
727
+ interface DocumentFile {
728
+ /** File ID. */
729
+ fileId?: string | null;
730
+ /** File URL. Defined only for public documents. */
731
+ staticUrl?: string | null;
732
+ /** File path. */
733
+ filePath?: string | null;
734
+ /** Size in bytes. */
735
+ sizeInBytes?: number | null;
736
+ }
737
+ interface UpdateDocumentResponse {
738
+ /** The created Document */
739
+ document?: Document;
740
+ }
741
+ interface DocumentRendered {
742
+ /** Rendered document */
743
+ document?: Document;
744
+ }
745
+ interface DocumentRenderFailed {
746
+ /** Document that failed to render */
747
+ document?: Document;
748
+ }
749
+ interface DownloadDocumentRequest {
750
+ /**
751
+ * ID of the Document to retrieve
752
+ * @format GUID
753
+ */
754
+ documentId: string;
755
+ /**
756
+ * URL expiration time. Only relevant for private documents.
757
+ * @min 600
758
+ * @max 86400
759
+ */
760
+ urlExpirationInSeconds?: number | null;
761
+ /**
762
+ * Whether the link downloads the file or opens the file in the browser.
763
+ * Default: `ATTACHMENT`
764
+ */
765
+ contentDisposition?: ContentDispositionWithLiterals;
766
+ }
767
+ declare enum ContentDisposition {
768
+ /** The link downloads the file. */
769
+ ATTACHMENT = "ATTACHMENT",
770
+ /** The link opens the file in the browser. */
771
+ INLINE = "INLINE"
772
+ }
773
+ /** @enumType */
774
+ type ContentDispositionWithLiterals = ContentDisposition | 'ATTACHMENT' | 'INLINE';
775
+ interface DownloadDocumentResponse {
776
+ /** Download URL. */
777
+ downloadUrl?: string;
778
+ /** URL expiration timestamp. Not provided for public documents because their links do not expire. */
779
+ expirationDate?: Date | null;
780
+ }
781
+ interface GetDownloadUrlRequest extends GetDownloadUrlRequestDocumentOneOf {
782
+ /**
783
+ * ID of the Document to retrieve
784
+ * @format GUID
785
+ */
786
+ documentId?: string | null;
787
+ /**
788
+ * ID of the Document to retrieve
789
+ * @minLength 1
790
+ * @maxLength 100
791
+ */
792
+ externalId?: string | null;
793
+ /**
794
+ * Signed file token
795
+ * @minLength 1
796
+ * @maxLength 500
797
+ */
798
+ fileToken?: string | null;
799
+ /**
800
+ * URL expiration time. Only relevant for private documents.
801
+ * @min 600
802
+ * @max 86400
803
+ */
804
+ urlExpirationInSeconds?: number | null;
805
+ /** @maxLength 100 */
806
+ downloadButtonText?: string | null;
807
+ /**
808
+ * Whether the link downloads the file or opens the file in the browser.
809
+ * Default: `ATTACHMENT`
810
+ */
811
+ contentDisposition?: ContentDispositionWithLiterals;
812
+ }
813
+ /** @oneof */
814
+ interface GetDownloadUrlRequestDocumentOneOf {
815
+ /**
816
+ * ID of the Document to retrieve
817
+ * @format GUID
818
+ */
819
+ documentId?: string | null;
820
+ /**
821
+ * ID of the Document to retrieve
822
+ * @minLength 1
823
+ * @maxLength 100
824
+ */
825
+ externalId?: string | null;
826
+ /**
827
+ * Signed file token
828
+ * @minLength 1
829
+ * @maxLength 500
830
+ */
831
+ fileToken?: string | null;
832
+ }
833
+ interface GetDownloadUrlResponse {
834
+ /** Download URL. */
835
+ downloadUrl?: string | null;
836
+ /** URL expiration timestamp. Not provided for public documents because their links do not expire. */
837
+ expirationDate?: Date | null;
838
+ /**
839
+ * Document ID.
840
+ * @format GUID
841
+ */
842
+ documentId?: string | null;
843
+ /** Document render status. */
844
+ renderStatus?: RenderStatusWithLiterals;
845
+ /** Download URL. */
846
+ downloadPageUrl?: string | null;
847
+ /**
848
+ * Client defined content checksum. Can be used for content comparison.
849
+ * @minLength 1
850
+ * @maxLength 64
851
+ */
852
+ contentChecksum?: string | null;
853
+ }
854
+ interface DownloadDocumentSourceRequest {
855
+ /**
856
+ * ID of the Document to retrieve
857
+ * @format GUID
858
+ */
859
+ documentId: string;
860
+ /**
861
+ * Whether the link downloads the file or opens the file in the browser.
862
+ * Default: `ATTACHMENT`
863
+ */
864
+ contentDisposition?: ContentDispositionWithLiterals;
865
+ }
866
+ interface DownloadDocumentSourceResponse {
867
+ /** Download URL. Expires after 10 minutes. */
868
+ downloadUrl?: string;
869
+ }
870
+ interface MessageEnvelope {
871
+ /**
872
+ * App instance ID.
873
+ * @format GUID
874
+ */
875
+ instanceId?: string | null;
876
+ /**
877
+ * Event type.
878
+ * @maxLength 150
879
+ */
880
+ eventType?: string;
881
+ /** The identification type and identity data. */
882
+ identity?: IdentificationData;
883
+ /** Stringify payload. */
884
+ data?: string;
885
+ /** Details related to the account */
886
+ accountInfo?: AccountInfo;
887
+ }
888
+ interface IdentificationData extends IdentificationDataIdOneOf {
889
+ /**
890
+ * ID of a site visitor that has not logged in to the site.
891
+ * @format GUID
892
+ */
893
+ anonymousVisitorId?: string;
894
+ /**
895
+ * ID of a site visitor that has logged in to the site.
896
+ * @format GUID
897
+ */
898
+ memberId?: string;
899
+ /**
900
+ * ID of a Wix user (site owner, contributor, etc.).
901
+ * @format GUID
902
+ */
903
+ wixUserId?: string;
904
+ /**
905
+ * ID of an app.
906
+ * @format GUID
907
+ */
908
+ appId?: string;
909
+ /** @readonly */
910
+ identityType?: WebhookIdentityTypeWithLiterals;
911
+ }
912
+ /** @oneof */
913
+ interface IdentificationDataIdOneOf {
914
+ /**
915
+ * ID of a site visitor that has not logged in to the site.
916
+ * @format GUID
917
+ */
918
+ anonymousVisitorId?: string;
919
+ /**
920
+ * ID of a site visitor that has logged in to the site.
921
+ * @format GUID
922
+ */
923
+ memberId?: string;
924
+ /**
925
+ * ID of a Wix user (site owner, contributor, etc.).
926
+ * @format GUID
927
+ */
928
+ wixUserId?: string;
929
+ /**
930
+ * ID of an app.
931
+ * @format GUID
932
+ */
933
+ appId?: string;
934
+ }
935
+ declare enum WebhookIdentityType {
936
+ UNKNOWN = "UNKNOWN",
937
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
938
+ MEMBER = "MEMBER",
939
+ WIX_USER = "WIX_USER",
940
+ APP = "APP"
941
+ }
942
+ /** @enumType */
943
+ type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
944
+ interface AccountInfo {
945
+ /**
946
+ * ID of the Wix account associated with the event.
947
+ * @format GUID
948
+ */
949
+ accountId?: string | null;
950
+ /**
951
+ * ID of the parent Wix account. Only included when accountId belongs to a child account.
952
+ * @format GUID
953
+ */
954
+ parentAccountId?: string | null;
955
+ /**
956
+ * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.
957
+ * @format GUID
958
+ */
959
+ siteId?: string | null;
960
+ }
961
+ /** @docsIgnore */
962
+ type DownloadDocumentApplicationErrors = {
963
+ code?: 'DOCUMENT_NOT_READY';
964
+ description?: string;
965
+ data?: Record<string, any>;
966
+ };
967
+ /** @docsIgnore */
968
+ type DownloadDocumentSourceApplicationErrors = {
969
+ code?: 'DOCUMENT_NOT_READY';
970
+ description?: string;
971
+ data?: Record<string, any>;
972
+ };
973
+ interface BaseEventMetadata {
974
+ /**
975
+ * App instance ID.
976
+ * @format GUID
977
+ */
978
+ instanceId?: string | null;
979
+ /**
980
+ * Event type.
981
+ * @maxLength 150
982
+ */
983
+ eventType?: string;
984
+ /** The identification type and identity data. */
985
+ identity?: IdentificationData;
986
+ /** Details related to the account */
987
+ accountInfo?: AccountInfo;
988
+ }
989
+ interface EventMetadata extends BaseEventMetadata {
990
+ /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
991
+ _id?: string;
992
+ /**
993
+ * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
994
+ * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
995
+ */
996
+ entityFqdn?: string;
997
+ /**
998
+ * Event action name, placed at the top level to make it easier for users to dispatch messages.
999
+ * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
1000
+ */
1001
+ slug?: string;
1002
+ /** ID of the entity associated with the event. */
1003
+ entityId?: string;
1004
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
1005
+ eventTime?: Date | null;
1006
+ /**
1007
+ * Whether the event was triggered as a result of a privacy regulation application
1008
+ * (for example, GDPR).
1009
+ */
1010
+ triggeredByAnonymizeRequest?: boolean | null;
1011
+ /** If present, indicates the action that triggered the event. */
1012
+ originatedFrom?: string | null;
1013
+ /**
1014
+ * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.
1015
+ * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.
1016
+ */
1017
+ entityEventSequence?: string | null;
1018
+ accountInfo?: AccountInfoMetadata;
1019
+ }
1020
+ interface AccountInfoMetadata {
1021
+ /** ID of the Wix account associated with the event */
1022
+ accountId: string;
1023
+ /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */
1024
+ siteId?: string;
1025
+ /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */
1026
+ parentAccountId?: string;
1027
+ }
1028
+ interface DocumentCreatedEnvelope {
1029
+ entity: Document;
1030
+ metadata: EventMetadata;
1031
+ }
1032
+ /** @permissionScope Manage Stores
1033
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1034
+ * @permissionScope Manage form submissions.
1035
+ * @permissionScopeId SCOPE.FORMS.MANAGE-SUBMISSIONS
1036
+ * @permissionScope Manage Events
1037
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1038
+ * @permissionScope Read Intake Form (PII)
1039
+ * @permissionScopeId SCOPE.INTAKE-FORM.READ_LIMITED
1040
+ * @permissionScope Read Intake Form
1041
+ * @permissionScopeId SCOPE.INTAKE-FORM.READ
1042
+ * @permissionScope Manage Intake Form
1043
+ * @permissionScopeId SCOPE.INTAKE-FORM.MANAGE
1044
+ * @permissionScope Manage Intake Form (PII)
1045
+ * @permissionScopeId SCOPE.INTAKE-FORM.MANAGE_LIMITED
1046
+ * @permissionScope Manage Restaurants - all permissions
1047
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1048
+ * @permissionId PAPYRUS.READ_DOCUMENT
1049
+ * @webhook
1050
+ * @eventType wix.papyrus.v1.document_created
1051
+ * @serviceIdentifier wix.papyrus.v1.DocumentService
1052
+ * @slug created
1053
+ */
1054
+ declare function onDocumentCreated(handler: (event: DocumentCreatedEnvelope) => void | Promise<void>): void;
1055
+ interface DocumentDeletedEnvelope {
1056
+ metadata: EventMetadata;
1057
+ }
1058
+ /** @permissionScope Manage Stores
1059
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1060
+ * @permissionScope Manage form submissions.
1061
+ * @permissionScopeId SCOPE.FORMS.MANAGE-SUBMISSIONS
1062
+ * @permissionScope Manage Events
1063
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1064
+ * @permissionScope Read Intake Form (PII)
1065
+ * @permissionScopeId SCOPE.INTAKE-FORM.READ_LIMITED
1066
+ * @permissionScope Read Intake Form
1067
+ * @permissionScopeId SCOPE.INTAKE-FORM.READ
1068
+ * @permissionScope Manage Intake Form
1069
+ * @permissionScopeId SCOPE.INTAKE-FORM.MANAGE
1070
+ * @permissionScope Manage Intake Form (PII)
1071
+ * @permissionScopeId SCOPE.INTAKE-FORM.MANAGE_LIMITED
1072
+ * @permissionScope Manage Restaurants - all permissions
1073
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1074
+ * @permissionId PAPYRUS.READ_DOCUMENT
1075
+ * @webhook
1076
+ * @eventType wix.papyrus.v1.document_deleted
1077
+ * @serviceIdentifier wix.papyrus.v1.DocumentService
1078
+ * @slug deleted
1079
+ */
1080
+ declare function onDocumentDeleted(handler: (event: DocumentDeletedEnvelope) => void | Promise<void>): void;
1081
+ interface DocumentRenderDelayedEnvelope {
1082
+ data: DocumentRenderDelayed;
1083
+ metadata: EventMetadata;
1084
+ }
1085
+ /**
1086
+ * Event is sent after specific time if configured and RenderStatus is ACCEPTED/RENDERING.
1087
+ * @permissionScope Manage Stores
1088
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1089
+ * @permissionScope Manage form submissions.
1090
+ * @permissionScopeId SCOPE.FORMS.MANAGE-SUBMISSIONS
1091
+ * @permissionScope Manage Events
1092
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1093
+ * @permissionScope Read Intake Form (PII)
1094
+ * @permissionScopeId SCOPE.INTAKE-FORM.READ_LIMITED
1095
+ * @permissionScope Read Intake Form
1096
+ * @permissionScopeId SCOPE.INTAKE-FORM.READ
1097
+ * @permissionScope Manage Intake Form
1098
+ * @permissionScopeId SCOPE.INTAKE-FORM.MANAGE
1099
+ * @permissionScope Manage Intake Form (PII)
1100
+ * @permissionScopeId SCOPE.INTAKE-FORM.MANAGE_LIMITED
1101
+ * @permissionScope Manage Restaurants - all permissions
1102
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1103
+ * @permissionId PAPYRUS.READ_DOCUMENT
1104
+ * @webhook
1105
+ * @eventType wix.papyrus.v1.document_document_render_delayed
1106
+ * @serviceIdentifier wix.papyrus.v1.DocumentService
1107
+ * @slug document_render_delayed
1108
+ */
1109
+ declare function onDocumentRenderDelayed(handler: (event: DocumentRenderDelayedEnvelope) => void | Promise<void>): void;
1110
+ interface DocumentRenderFailedEnvelope {
1111
+ data: DocumentRenderFailed;
1112
+ metadata: EventMetadata;
1113
+ }
1114
+ /** @permissionScope Manage Stores
1115
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1116
+ * @permissionScope Manage form submissions.
1117
+ * @permissionScopeId SCOPE.FORMS.MANAGE-SUBMISSIONS
1118
+ * @permissionScope Manage Events
1119
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1120
+ * @permissionScope Read Intake Form (PII)
1121
+ * @permissionScopeId SCOPE.INTAKE-FORM.READ_LIMITED
1122
+ * @permissionScope Read Intake Form
1123
+ * @permissionScopeId SCOPE.INTAKE-FORM.READ
1124
+ * @permissionScope Manage Intake Form
1125
+ * @permissionScopeId SCOPE.INTAKE-FORM.MANAGE
1126
+ * @permissionScope Manage Intake Form (PII)
1127
+ * @permissionScopeId SCOPE.INTAKE-FORM.MANAGE_LIMITED
1128
+ * @permissionScope Manage Restaurants - all permissions
1129
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1130
+ * @permissionId PAPYRUS.READ_DOCUMENT
1131
+ * @webhook
1132
+ * @eventType wix.papyrus.v1.document_document_render_failed
1133
+ * @serviceIdentifier wix.papyrus.v1.DocumentService
1134
+ * @slug document_render_failed
1135
+ */
1136
+ declare function onDocumentRenderFailed(handler: (event: DocumentRenderFailedEnvelope) => void | Promise<void>): void;
1137
+ interface DocumentRenderedEnvelope {
1138
+ data: DocumentRendered;
1139
+ metadata: EventMetadata;
1140
+ }
1141
+ /** @permissionScope Manage Stores
1142
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1143
+ * @permissionScope Manage form submissions.
1144
+ * @permissionScopeId SCOPE.FORMS.MANAGE-SUBMISSIONS
1145
+ * @permissionScope Manage Events
1146
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1147
+ * @permissionScope Read Intake Form (PII)
1148
+ * @permissionScopeId SCOPE.INTAKE-FORM.READ_LIMITED
1149
+ * @permissionScope Read Intake Form
1150
+ * @permissionScopeId SCOPE.INTAKE-FORM.READ
1151
+ * @permissionScope Manage Intake Form
1152
+ * @permissionScopeId SCOPE.INTAKE-FORM.MANAGE
1153
+ * @permissionScope Manage Intake Form (PII)
1154
+ * @permissionScopeId SCOPE.INTAKE-FORM.MANAGE_LIMITED
1155
+ * @permissionScope Manage Restaurants - all permissions
1156
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1157
+ * @permissionId PAPYRUS.READ_DOCUMENT
1158
+ * @webhook
1159
+ * @eventType wix.papyrus.v1.document_document_rendered
1160
+ * @serviceIdentifier wix.papyrus.v1.DocumentService
1161
+ * @slug document_rendered
1162
+ */
1163
+ declare function onDocumentRendered(handler: (event: DocumentRenderedEnvelope) => void | Promise<void>): void;
1164
+ interface DocumentUpdatedEnvelope {
1165
+ entity: Document;
1166
+ metadata: EventMetadata;
1167
+ }
1168
+ /** @permissionScope Manage Stores
1169
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
1170
+ * @permissionScope Manage form submissions.
1171
+ * @permissionScopeId SCOPE.FORMS.MANAGE-SUBMISSIONS
1172
+ * @permissionScope Manage Events
1173
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1174
+ * @permissionScope Read Intake Form (PII)
1175
+ * @permissionScopeId SCOPE.INTAKE-FORM.READ_LIMITED
1176
+ * @permissionScope Read Intake Form
1177
+ * @permissionScopeId SCOPE.INTAKE-FORM.READ
1178
+ * @permissionScope Manage Intake Form
1179
+ * @permissionScopeId SCOPE.INTAKE-FORM.MANAGE
1180
+ * @permissionScope Manage Intake Form (PII)
1181
+ * @permissionScopeId SCOPE.INTAKE-FORM.MANAGE_LIMITED
1182
+ * @permissionScope Manage Restaurants - all permissions
1183
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1184
+ * @permissionId PAPYRUS.READ_DOCUMENT
1185
+ * @webhook
1186
+ * @eventType wix.papyrus.v1.document_updated
1187
+ * @serviceIdentifier wix.papyrus.v1.DocumentService
1188
+ * @slug updated
1189
+ */
1190
+ declare function onDocumentUpdated(handler: (event: DocumentUpdatedEnvelope) => void | Promise<void>): void;
1191
+ /**
1192
+ * Get Document.
1193
+ * @public
1194
+ * @requiredField file
1195
+ * @permissionId PAPYRUS.DOWNLOAD_DOCUMENT
1196
+ * @fqn wix.papyrus.v1.DownloadPageController.GetDownloadPage
1197
+ */
1198
+ declare function getDownloadPage(file: string | null): Promise<RawHttpResponse>;
1199
+ /**
1200
+ * Get Document.
1201
+ * @public
1202
+ * @requiredField file
1203
+ * @permissionId PAPYRUS.DOWNLOAD_DOCUMENT
1204
+ * @fqn wix.papyrus.v1.DownloadPageController.RedirectToDocument
1205
+ */
1206
+ declare function redirectToDocument(file: string | null): Promise<RawHttpResponse>;
1207
+ /**
1208
+ * Creates a new Document
1209
+ * @public
1210
+ * @requiredField options.document.appSlug
1211
+ * @requiredField options.document.content
1212
+ * @requiredField options.document.externalId
1213
+ * @requiredField options.document.templateType
1214
+ * @permissionId PAPYRUS.CREATE_DOCUMENT
1215
+ * @applicableIdentity APP
1216
+ * @returns The created Document
1217
+ * @fqn wix.papyrus.v1.DocumentService.CreateDocument
1218
+ */
1219
+ declare function createDocument(options?: CreateDocumentOptions): Promise<Document>;
1220
+ interface CreateDocumentOptions {
1221
+ /** Document to be created */
1222
+ document?: Document;
1223
+ }
1224
+ /**
1225
+ * Get Document.
1226
+ * @param documentId - ID of the Document to retrieve
1227
+ * @public
1228
+ * @requiredField documentId
1229
+ * @permissionId PAPYRUS.READ_DOCUMENT
1230
+ * @applicableIdentity APP
1231
+ * @returns The retrieved Document
1232
+ * @fqn wix.papyrus.v1.DocumentService.GetDocument
1233
+ */
1234
+ declare function getDocument(documentId: string, options?: GetDocumentOptions): Promise<Document>;
1235
+ interface GetDocumentOptions {
1236
+ /** @maxSize 1 */
1237
+ fields?: RequestedFieldsWithLiterals[];
1238
+ }
1239
+ /**
1240
+ * Deletes Document.
1241
+ * @param documentId - ID of the Document to delete
1242
+ * @public
1243
+ * @requiredField documentId
1244
+ * @permissionId PAPYRUS.DELETE_DOCUMENT
1245
+ * @applicableIdentity APP
1246
+ * @fqn wix.papyrus.v1.DocumentService.DeleteDocument
1247
+ */
1248
+ declare function deleteDocument(documentId: string): Promise<DeleteDocumentResponse>;
1249
+ /**
1250
+ * Query Documents using [WQL - Wix Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language)
1251
+ * @public
1252
+ * @permissionId PAPYRUS.READ_DOCUMENT
1253
+ * @applicableIdentity APP
1254
+ * @fqn wix.papyrus.v1.DocumentService.QueryDocument
1255
+ */
1256
+ declare function queryDocument(options?: QueryDocumentOptions): DocumentsQueryBuilder;
1257
+ interface QueryDocumentOptions {
1258
+ /** @maxSize 1 */
1259
+ fields?: RequestedFieldsWithLiterals[] | undefined;
1260
+ }
1261
+ interface QueryCursorResult {
1262
+ cursors: Cursors;
1263
+ hasNext: () => boolean;
1264
+ hasPrev: () => boolean;
1265
+ length: number;
1266
+ pageSize: number;
1267
+ }
1268
+ interface DocumentsQueryResult extends QueryCursorResult {
1269
+ items: Document[];
1270
+ query: DocumentsQueryBuilder;
1271
+ next: () => Promise<DocumentsQueryResult>;
1272
+ prev: () => Promise<DocumentsQueryResult>;
1273
+ }
1274
+ interface DocumentsQueryBuilder {
1275
+ /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */
1276
+ limit: (limit: number) => DocumentsQueryBuilder;
1277
+ /** @param cursor - A pointer to specific record */
1278
+ skipTo: (cursor: string) => DocumentsQueryBuilder;
1279
+ find: () => Promise<DocumentsQueryResult>;
1280
+ }
1281
+ /**
1282
+ * @hidden
1283
+ * @fqn wix.papyrus.v1.DocumentService.QueryDocument
1284
+ * @requiredField query
1285
+ */
1286
+ declare function typedQueryDocument(query: DocumentQuery, options?: QueryDocumentOptions): Promise<QueryDocumentResponse>;
1287
+ interface DocumentQuerySpec extends QuerySpec {
1288
+ paging: 'cursor';
1289
+ wql: [];
1290
+ }
1291
+ type CommonQueryWithEntityContext = Query<Document, DocumentQuerySpec>;
1292
+ type DocumentQuery = {
1293
+ /**
1294
+ Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`.
1295
+ */
1296
+ cursorPaging?: {
1297
+ /**
1298
+ Maximum number of items to return in the results.
1299
+ @max: 100
1300
+ */
1301
+ limit?: NonNullable<CommonQueryWithEntityContext['cursorPaging']>['limit'] | null;
1302
+ /**
1303
+ Pointer to the next or previous page in the list of results.
1304
+
1305
+ Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
1306
+ Not relevant for the first request.
1307
+ @maxLength: 16000
1308
+ */
1309
+ cursor?: NonNullable<CommonQueryWithEntityContext['cursorPaging']>['cursor'] | null;
1310
+ };
1311
+ /**
1312
+ Filter object.
1313
+
1314
+ Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters).
1315
+ */
1316
+ filter?: CommonQueryWithEntityContext['filter'] | null;
1317
+ /**
1318
+ Sort object.
1319
+
1320
+ Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#sorting).
1321
+ */
1322
+ sort?: {
1323
+ /**
1324
+ Name of the field to sort by.
1325
+ @maxLength: 512
1326
+ */
1327
+ fieldName?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['fieldName'];
1328
+ /**
1329
+ Sort order.
1330
+ */
1331
+ order?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['order'];
1332
+ }[];
1333
+ };
1334
+ declare const utils: {
1335
+ query: {
1336
+ QueryBuilder: () => _wix_sdk_types.QueryBuilder<Document, DocumentQuerySpec, DocumentQuery>;
1337
+ Filter: _wix_sdk_types.FilterFactory<Document, DocumentQuerySpec>;
1338
+ Sort: _wix_sdk_types.SortFactory<DocumentQuerySpec>;
1339
+ };
1340
+ };
1341
+ /**
1342
+ * Updates Document. Currently supports only render_status, file_id and static_url updates.
1343
+ * @param _id - Document ID.
1344
+ * @public
1345
+ * @requiredField _id
1346
+ * @permissionId PAPYRUS.UPDATE_DOCUMENT
1347
+ * @applicableIdentity APP
1348
+ * @fqn wix.papyrus.v1.DocumentService.UpdateDocument
1349
+ */
1350
+ declare function updateDocument(_id: string | null, options?: UpdateDocumentOptions): Promise<UpdateDocumentResponse>;
1351
+ interface UpdateDocumentOptions {
1352
+ /** Document render status. */
1353
+ renderStatus?: RenderStatusWithLiterals;
1354
+ /** Rendered document file. */
1355
+ file?: DocumentFile;
1356
+ /** Rendered document source HTML file. */
1357
+ sourceFile?: DocumentFile;
1358
+ }
1359
+ /**
1360
+ * Downloads document.
1361
+ * @param documentId - ID of the Document to retrieve
1362
+ * @public
1363
+ * @requiredField documentId
1364
+ * @permissionId PAPYRUS.READ_DOCUMENT
1365
+ * @applicableIdentity APP
1366
+ * @fqn wix.papyrus.v1.DocumentService.DownloadDocument
1367
+ */
1368
+ declare function downloadDocument(documentId: string, options?: DownloadDocumentOptions): Promise<DownloadDocumentResponse & {
1369
+ __applicationErrorsType?: DownloadDocumentApplicationErrors;
1370
+ }>;
1371
+ interface DownloadDocumentOptions {
1372
+ /**
1373
+ * URL expiration time. Only relevant for private documents.
1374
+ * @min 600
1375
+ * @max 86400
1376
+ */
1377
+ urlExpirationInSeconds?: number | null;
1378
+ /**
1379
+ * Whether the link downloads the file or opens the file in the browser.
1380
+ * Default: `ATTACHMENT`
1381
+ */
1382
+ contentDisposition?: ContentDispositionWithLiterals;
1383
+ }
1384
+ /**
1385
+ * Resolves document download url.
1386
+ * @public
1387
+ * @requiredField options.document
1388
+ * @permissionId PAPYRUS.READ_DOCUMENT
1389
+ * @applicableIdentity APP
1390
+ * @fqn wix.papyrus.v1.DocumentService.GetDownloadUrl
1391
+ */
1392
+ declare function getDownloadUrl(options?: GetDownloadUrlOptions): Promise<GetDownloadUrlResponse>;
1393
+ interface GetDownloadUrlOptions extends GetDownloadUrlOptionsDocumentOneOf {
1394
+ /**
1395
+ * ID of the Document to retrieve
1396
+ * @format GUID
1397
+ */
1398
+ documentId?: string | null;
1399
+ /**
1400
+ * ID of the Document to retrieve
1401
+ * @minLength 1
1402
+ * @maxLength 100
1403
+ */
1404
+ externalId?: string | null;
1405
+ /**
1406
+ * Signed file token
1407
+ * @minLength 1
1408
+ * @maxLength 500
1409
+ */
1410
+ fileToken?: string | null;
1411
+ /**
1412
+ * URL expiration time. Only relevant for private documents.
1413
+ * @min 600
1414
+ * @max 86400
1415
+ */
1416
+ urlExpirationInSeconds?: number | null;
1417
+ /** @maxLength 100 */
1418
+ downloadButtonText?: string | null;
1419
+ /**
1420
+ * Whether the link downloads the file or opens the file in the browser.
1421
+ * Default: `ATTACHMENT`
1422
+ */
1423
+ contentDisposition?: ContentDispositionWithLiterals;
1424
+ }
1425
+ /** @oneof */
1426
+ interface GetDownloadUrlOptionsDocumentOneOf {
1427
+ /**
1428
+ * ID of the Document to retrieve
1429
+ * @format GUID
1430
+ */
1431
+ documentId?: string | null;
1432
+ /**
1433
+ * ID of the Document to retrieve
1434
+ * @minLength 1
1435
+ * @maxLength 100
1436
+ */
1437
+ externalId?: string | null;
1438
+ /**
1439
+ * Signed file token
1440
+ * @minLength 1
1441
+ * @maxLength 500
1442
+ */
1443
+ fileToken?: string | null;
1444
+ }
1445
+ /**
1446
+ * Downloads document.
1447
+ * @param documentId - ID of the Document to retrieve
1448
+ * @public
1449
+ * @requiredField documentId
1450
+ * @permissionId PAPYRUS.READ_DOCUMENT
1451
+ * @applicableIdentity APP
1452
+ * @fqn wix.papyrus.v1.DocumentService.DownloadDocumentSource
1453
+ */
1454
+ declare function downloadDocumentSource(documentId: string, options?: DownloadDocumentSourceOptions): Promise<DownloadDocumentSourceResponse & {
1455
+ __applicationErrorsType?: DownloadDocumentSourceApplicationErrors;
1456
+ }>;
1457
+ interface DownloadDocumentSourceOptions {
1458
+ /**
1459
+ * Whether the link downloads the file or opens the file in the browser.
1460
+ * Default: `ATTACHMENT`
1461
+ */
1462
+ contentDisposition?: ContentDispositionWithLiterals;
1463
+ }
1464
+
1465
+ export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type BackgroundSetting, type BaseEventMetadata, type CommonQueryWithEntityContext, ContentDisposition, type ContentDispositionWithLiterals, type CreateDocumentOptions, type CreateDocumentRequest, type CreateDocumentResponse, type CursorPaging, type Cursors, type DebugOptions, type DeleteDocumentByExternalIdRequest, type DeleteDocumentByExternalIdResponse, type DeleteDocumentRequest, type DeleteDocumentResponse, type Document, type DocumentContent, type DocumentCreatedEnvelope, type DocumentDeletedEnvelope, type DocumentFile, type DocumentQuery, type DocumentQuerySpec, type DocumentRenderDelayed, type DocumentRenderDelayedEnvelope, type DocumentRenderFailed, type DocumentRenderFailedEnvelope, type DocumentRendered, type DocumentRenderedEnvelope, type DocumentUpdatedEnvelope, type DocumentsQueryBuilder, type DocumentsQueryResult, type DomainEvent, type DomainEventBodyOneOf, type DownloadDocumentApplicationErrors, type DownloadDocumentOptions, type DownloadDocumentRequest, type DownloadDocumentResponse, type DownloadDocumentSourceApplicationErrors, type DownloadDocumentSourceOptions, type DownloadDocumentSourceRequest, type DownloadDocumentSourceResponse, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type FocalPoint, Format, type FormatWithLiterals, type GetCachedHtmlRequest, type GetDocumentOptions, type GetDocumentRequest, type GetDocumentResponse, type GetDownloadPageRequest, type GetDownloadUrlOptions, type GetDownloadUrlOptionsDocumentOneOf, type GetDownloadUrlRequest, type GetDownloadUrlRequestDocumentOneOf, type GetDownloadUrlResponse, type GetRendererInfoRequest, type GetRendererInfoResponse, type HeadersEntry, type IdentificationData, type IdentificationDataIdOneOf, type ImageSetting, type MessageEnvelope, PageOverflow, type PageOverflowWithLiterals, type PageSettings, type Paging, type PagingMetadataV2, PaperSize, type PaperSizeWithLiterals, type QueryDocumentOptions, type QueryDocumentRequest, type QueryDocumentResponse, type QueryV2, type QueryV2PagingMethodOneOf, type RawHttpResponse, type RedirectToDocumentRequest, type RenderDelayedEventConfig, type RenderDocumentByIdRequest, type RenderDocumentRequest, RenderFormat, type RenderFormatWithLiterals, RenderStatus, type RenderStatusWithLiterals, RequestedFields, type RequestedFieldsWithLiterals, ResizeOption, type ResizeOptionWithLiterals, type RestoreInfo, type SelectSetting, type SettingsGroup, SortOrder, type SortOrderWithLiterals, type Sorting, type TemplateSettings, type TemplateSettingsOverride, type TextContent, type TextSetting, type UpdateDocumentOptions, type UpdateDocumentRequest, type UpdateDocumentResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, WixMpClientVersion, type WixMpClientVersionWithLiterals, createDocument, deleteDocument, downloadDocument, downloadDocumentSource, getDocument, getDownloadPage, getDownloadUrl, onDocumentCreated, onDocumentDeleted, onDocumentRenderDelayed, onDocumentRenderFailed, onDocumentRendered, onDocumentUpdated, queryDocument, redirectToDocument, typedQueryDocument, updateDocument, utils };