@wix/auto_sdk_rich-content_ricos-documents 1.0.2 → 1.0.4

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,6 +1,6 @@
1
1
  import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
- import { ValidateDocumentOptions, ValidateDocumentResponse, ConvertToRicosDocumentOptions, ConvertToRicosDocumentResponse, RichContent, ConvertFromRicosDocumentOptions, ConvertFromRicosDocumentResponse } from './index.typings.js';
3
- export { Alignment, AnchorData, AppEmbedData, AppEmbedDataAppDataOneOf, AppType, AudioData, Background, BackgroundBackgroundOneOf, BackgroundType, BlockquoteData, BookingData, Border, BorderColors, BulletedListData, ButtonData, CaptionData, CellStyle, CodeBlockData, CollapsibleListData, ColorData, Colors, ConvertFromRicosDocumentOptionsOptionsOneOf, ConvertFromRicosDocumentRequest, ConvertFromRicosDocumentRequestOptionsOneOf, ConvertFromRicosDocumentResponseResultOneOf, ConvertToRicosDocumentOptionsSourceOneOf, ConvertToRicosDocumentRequest, ConvertToRicosDocumentRequestSourceOneOf, Crop, Decoration, DecorationDataOneOf, DecorationType, Design, Dimensions, Direction, DividerData, DocumentStyle, EmbedData, EventData, FileData, FileSource, FileSourceDataOneOf, FontSizeData, FontType, GIF, GIFData, GIFType, GalleryData, GalleryOptions, Gradient, HTMLData, HTMLDataDataOneOf, HeadingData, Height, Image, ImageData, ImageDataStyles, InitialExpandedItems, Item, ItemDataOneOf, ItemStyle, Layout, LayoutCellData, LayoutType, LineStyle, Link, LinkData, LinkDataOneOf, LinkPreviewData, LinkPreviewDataStyles, ListValue, MapData, MapSettings, MapType, Media, MentionData, Metadata, Node, NodeDataOneOf, NodeStyle, NodeType, NullValue, Oembed, Option, OptionDesign, OptionLayout, OrderedListData, Orientation, PDFSettings, ParagraphData, Permissions, PlainTextOptions, PlaybackOptions, Plugin, PluginContainerData, PluginContainerDataAlignment, PluginContainerDataWidth, PluginContainerDataWidthDataOneOf, Poll, PollData, PollDataLayout, PollDesign, PollLayout, PollLayoutDirection, PollLayoutType, Position, Rel, RicosDocumentOptions, RicosDocumentPlaceholder, RicosDocumentViolation, Settings, Source, Spoiler, SpoilerData, Styles, StylesBorder, TableCellData, TableData, Target, TargetFormat, TextAlignment, TextData, TextNodeStyle, TextStyle, Thumbnails, ThumbnailsAlignment, Type, ValidateDocumentRequest, VerticalAlignment, Video, VideoData, ViewMode, ViewRole, VoteRole, Width, WidthType } from './index.typings.js';
2
+ import { ValidateDocumentOptions, ValidateDocumentResponse, ConvertToRicosDocumentOptions, ConvertToRicosDocumentResponse, TargetFormatWithLiterals, ConvertFromRicosDocumentOptions, ConvertFromRicosDocumentResponse } from './index.typings.js';
3
+ export { Alignment, AnchorData, AppEmbedData, AppEmbedDataAppDataOneOf, AppType, AspectRatio, AudioData, Background, BackgroundBackgroundOneOf, BackgroundType, BlockquoteData, BookingData, Border, BorderColors, BulletedListData, ButtonData, ButtonDataType, ButtonStyles, CaptionData, CardStyles, CellStyle, CodeBlockData, CollapsibleListData, ColorData, Colors, ConvertFromRicosDocumentOptionsOptionsOneOf, ConvertFromRicosDocumentRequest, ConvertFromRicosDocumentRequestOptionsOneOf, ConvertFromRicosDocumentResponseResultOneOf, ConvertToRicosDocumentOptionsSourceOneOf, ConvertToRicosDocumentRequest, ConvertToRicosDocumentRequestSourceOneOf, Crop, Decoration, DecorationDataOneOf, DecorationType, Design, Dimensions, Direction, DividerData, DividerDataAlignment, DocumentStyle, EmbedData, EventData, FileData, FileSource, FileSourceDataOneOf, FontSizeData, FontType, GIF, GIFData, GIFType, GalleryData, GalleryOptions, GalleryOptionsLayout, Gradient, HTMLData, HTMLDataDataOneOf, HeadingData, Height, Image, ImageData, ImageDataStyles, ImageStyles, InitialExpandedItems, Item, ItemDataOneOf, ItemStyle, Layout, LayoutCellData, LayoutType, LineStyle, Link, LinkData, LinkDataOneOf, LinkPreviewData, LinkPreviewDataStyles, ListValue, MapData, MapSettings, MapType, Media, MentionData, Metadata, Node, NodeDataOneOf, NodeStyle, NodeType, NullValue, Oembed, Option, OptionDesign, OptionLayout, OrderedListData, Orientation, PDFSettings, ParagraphData, Permissions, Placement, PlainTextOptions, PlaybackOptions, Plugin, PluginContainerData, PluginContainerDataAlignment, PluginContainerDataWidth, PluginContainerDataWidthDataOneOf, Poll, PollData, PollDataLayout, PollDesign, PollLayout, PollLayoutDirection, PollLayoutType, Position, Rel, Resizing, RibbonStyles, RichContent, RicosDocumentOptions, RicosDocumentPlaceholder, RicosDocumentViolation, Settings, Source, Spoiler, SpoilerData, Styles, StylesBorder, StylesPosition, TableCellData, TableData, Target, TargetFormat, TextAlignment, TextData, TextNodeStyle, TextStyle, Thumbnails, ThumbnailsAlignment, Type, ValidateDocumentRequest, VerticalAlignment, Video, VideoData, ViewMode, ViewRole, VoteRole, Width, WidthType } from './index.typings.js';
4
4
 
5
5
  declare function validateDocument$1(httpClient: HttpClient): ValidateDocumentSignature;
6
6
  interface ValidateDocumentSignature {
@@ -23,13 +23,13 @@ declare function convertFromRicosDocument$1(httpClient: HttpClient): ConvertFrom
23
23
  interface ConvertFromRicosDocumentSignature {
24
24
  /**
25
25
  * Converts a Ricos document to the specified format.
26
- * @param - Ricos document to convert.
26
+ * @param - Format to convert the document to.
27
27
  */
28
- (document: RichContent, options?: NonNullablePaths<ConvertFromRicosDocumentOptions, `targetFormat`>): Promise<NonNullablePaths<ConvertFromRicosDocumentResponse, `markdown` | `html` | `plainText`>>;
28
+ (targetFormat: TargetFormatWithLiterals, options?: NonNullablePaths<ConvertFromRicosDocumentOptions, `document`>): Promise<NonNullablePaths<ConvertFromRicosDocumentResponse, `markdown` | `html` | `plainText`>>;
29
29
  }
30
30
 
31
31
  declare const validateDocument: MaybeContext<BuildRESTFunction<typeof validateDocument$1> & typeof validateDocument$1>;
32
32
  declare const convertToRicosDocument: MaybeContext<BuildRESTFunction<typeof convertToRicosDocument$1> & typeof convertToRicosDocument$1>;
33
33
  declare const convertFromRicosDocument: MaybeContext<BuildRESTFunction<typeof convertFromRicosDocument$1> & typeof convertFromRicosDocument$1>;
34
34
 
35
- export { ConvertFromRicosDocumentOptions, ConvertFromRicosDocumentResponse, ConvertToRicosDocumentOptions, ConvertToRicosDocumentResponse, RichContent, ValidateDocumentOptions, ValidateDocumentResponse, convertFromRicosDocument, convertToRicosDocument, validateDocument };
35
+ export { ConvertFromRicosDocumentOptions, ConvertFromRicosDocumentResponse, ConvertToRicosDocumentOptions, ConvertToRicosDocumentResponse, ValidateDocumentOptions, ValidateDocumentResponse, convertFromRicosDocument, convertToRicosDocument, validateDocument };
@@ -22,25 +22,32 @@ var index_exports = {};
22
22
  __export(index_exports, {
23
23
  Alignment: () => Alignment,
24
24
  AppType: () => AppType,
25
+ AspectRatio: () => AspectRatio,
25
26
  BackgroundType: () => BackgroundType,
27
+ ButtonDataType: () => ButtonDataType,
26
28
  Crop: () => Crop,
27
29
  DecorationType: () => DecorationType,
28
30
  Direction: () => Direction,
31
+ DividerDataAlignment: () => DividerDataAlignment,
29
32
  FontType: () => FontType,
30
33
  GIFType: () => GIFType,
31
34
  InitialExpandedItems: () => InitialExpandedItems,
35
+ Layout: () => Layout,
32
36
  LayoutType: () => LayoutType,
33
37
  LineStyle: () => LineStyle,
34
38
  MapType: () => MapType,
35
39
  NodeType: () => NodeType,
36
40
  NullValue: () => NullValue,
37
41
  Orientation: () => Orientation,
42
+ Placement: () => Placement,
38
43
  Plugin: () => Plugin,
39
44
  PluginContainerDataAlignment: () => PluginContainerDataAlignment,
40
45
  PollLayoutDirection: () => PollLayoutDirection,
41
46
  PollLayoutType: () => PollLayoutType,
42
47
  Position: () => Position,
48
+ Resizing: () => Resizing,
43
49
  Source: () => Source,
50
+ StylesPosition: () => StylesPosition,
44
51
  Target: () => Target,
45
52
  TargetFormat: () => TargetFormat,
46
53
  TextAlignment: () => TextAlignment,
@@ -332,11 +339,11 @@ var PluginContainerDataAlignment = /* @__PURE__ */ ((PluginContainerDataAlignmen
332
339
  PluginContainerDataAlignment2["RIGHT"] = "RIGHT";
333
340
  return PluginContainerDataAlignment2;
334
341
  })(PluginContainerDataAlignment || {});
335
- var Type = /* @__PURE__ */ ((Type2) => {
336
- Type2["LINK"] = "LINK";
337
- Type2["ACTION"] = "ACTION";
338
- return Type2;
339
- })(Type || {});
342
+ var ButtonDataType = /* @__PURE__ */ ((ButtonDataType2) => {
343
+ ButtonDataType2["LINK"] = "LINK";
344
+ ButtonDataType2["ACTION"] = "ACTION";
345
+ return ButtonDataType2;
346
+ })(ButtonDataType || {});
340
347
  var Target = /* @__PURE__ */ ((Target2) => {
341
348
  Target2["SELF"] = "SELF";
342
349
  Target2["BLANK"] = "BLANK";
@@ -365,12 +372,12 @@ var Width = /* @__PURE__ */ ((Width2) => {
365
372
  Width2["SMALL"] = "SMALL";
366
373
  return Width2;
367
374
  })(Width || {});
368
- var Alignment = /* @__PURE__ */ ((Alignment2) => {
369
- Alignment2["CENTER"] = "CENTER";
370
- Alignment2["LEFT"] = "LEFT";
371
- Alignment2["RIGHT"] = "RIGHT";
372
- return Alignment2;
373
- })(Alignment || {});
375
+ var DividerDataAlignment = /* @__PURE__ */ ((DividerDataAlignment2) => {
376
+ DividerDataAlignment2["CENTER"] = "CENTER";
377
+ DividerDataAlignment2["LEFT"] = "LEFT";
378
+ DividerDataAlignment2["RIGHT"] = "RIGHT";
379
+ return DividerDataAlignment2;
380
+ })(DividerDataAlignment || {});
374
381
  var ViewMode = /* @__PURE__ */ ((ViewMode2) => {
375
382
  ViewMode2["NONE"] = "NONE";
376
383
  ViewMode2["FULL"] = "FULL";
@@ -418,13 +425,13 @@ var Source = /* @__PURE__ */ ((Source2) => {
418
425
  Source2["ADSENSE"] = "ADSENSE";
419
426
  return Source2;
420
427
  })(Source || {});
421
- var Position = /* @__PURE__ */ ((Position2) => {
422
- Position2["START"] = "START";
423
- Position2["END"] = "END";
424
- Position2["TOP"] = "TOP";
425
- Position2["HIDDEN"] = "HIDDEN";
426
- return Position2;
427
- })(Position || {});
428
+ var StylesPosition = /* @__PURE__ */ ((StylesPosition2) => {
429
+ StylesPosition2["START"] = "START";
430
+ StylesPosition2["END"] = "END";
431
+ StylesPosition2["TOP"] = "TOP";
432
+ StylesPosition2["HIDDEN"] = "HIDDEN";
433
+ return StylesPosition2;
434
+ })(StylesPosition || {});
428
435
  var MapType = /* @__PURE__ */ ((MapType2) => {
429
436
  MapType2["ROADMAP"] = "ROADMAP";
430
437
  MapType2["SATELITE"] = "SATELITE";
@@ -480,6 +487,43 @@ var FontType = /* @__PURE__ */ ((FontType2) => {
480
487
  FontType2["EM"] = "EM";
481
488
  return FontType2;
482
489
  })(FontType || {});
490
+ var Position = /* @__PURE__ */ ((Position2) => {
491
+ Position2["START"] = "START";
492
+ Position2["END"] = "END";
493
+ Position2["TOP"] = "TOP";
494
+ return Position2;
495
+ })(Position || {});
496
+ var AspectRatio = /* @__PURE__ */ ((AspectRatio2) => {
497
+ AspectRatio2["SQUARE"] = "SQUARE";
498
+ AspectRatio2["RECTANGLE"] = "RECTANGLE";
499
+ return AspectRatio2;
500
+ })(AspectRatio || {});
501
+ var Resizing = /* @__PURE__ */ ((Resizing2) => {
502
+ Resizing2["FILL"] = "FILL";
503
+ Resizing2["FIT"] = "FIT";
504
+ return Resizing2;
505
+ })(Resizing || {});
506
+ var Placement = /* @__PURE__ */ ((Placement2) => {
507
+ Placement2["IMAGE"] = "IMAGE";
508
+ Placement2["PRODUCT_INFO"] = "PRODUCT_INFO";
509
+ return Placement2;
510
+ })(Placement || {});
511
+ var Type = /* @__PURE__ */ ((Type2) => {
512
+ Type2["CONTAINED"] = "CONTAINED";
513
+ Type2["FRAMELESS"] = "FRAMELESS";
514
+ return Type2;
515
+ })(Type || {});
516
+ var Alignment = /* @__PURE__ */ ((Alignment2) => {
517
+ Alignment2["START"] = "START";
518
+ Alignment2["CENTER"] = "CENTER";
519
+ Alignment2["END"] = "END";
520
+ return Alignment2;
521
+ })(Alignment || {});
522
+ var Layout = /* @__PURE__ */ ((Layout2) => {
523
+ Layout2["STACKED"] = "STACKED";
524
+ Layout2["SIDE_BY_SIDE"] = "SIDE_BY_SIDE";
525
+ return Layout2;
526
+ })(Layout || {});
483
527
  var AppType = /* @__PURE__ */ ((AppType2) => {
484
528
  AppType2["PRODUCT"] = "PRODUCT";
485
529
  AppType2["EVENT"] = "EVENT";
@@ -578,11 +622,11 @@ async function convertToRicosDocument2(options) {
578
622
  throw transformedError;
579
623
  }
580
624
  }
581
- async function convertFromRicosDocument2(document, options) {
625
+ async function convertFromRicosDocument2(targetFormat, options) {
582
626
  const { httpClient, sideEffects } = arguments[2];
583
627
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
584
- document,
585
- targetFormat: options?.targetFormat,
628
+ targetFormat,
629
+ document: options?.document,
586
630
  plainTextOptions: options?.plainTextOptions
587
631
  });
588
632
  const reqOpts = convertFromRicosDocument(payload);
@@ -597,13 +641,13 @@ async function convertFromRicosDocument2(document, options) {
597
641
  {
598
642
  spreadPathsToArguments: {},
599
643
  explicitPathsToArguments: {
600
- document: "$[0]",
601
- targetFormat: "$[1].targetFormat",
644
+ targetFormat: "$[0]",
645
+ document: "$[1].document",
602
646
  plainTextOptions: "$[1].plainTextOptions"
603
647
  },
604
648
  singleArgumentUnchanged: false
605
649
  },
606
- ["document", "options"]
650
+ ["targetFormat", "options"]
607
651
  );
608
652
  sideEffects?.onError?.(err);
609
653
  throw transformedError;
@@ -627,8 +671,8 @@ function convertToRicosDocument3(httpClient) {
627
671
  );
628
672
  }
629
673
  function convertFromRicosDocument3(httpClient) {
630
- return (document, options) => convertFromRicosDocument2(
631
- document,
674
+ return (targetFormat, options) => convertFromRicosDocument2(
675
+ targetFormat,
632
676
  options,
633
677
  // @ts-ignore
634
678
  { httpClient }
@@ -644,25 +688,32 @@ var convertFromRicosDocument4 = /* @__PURE__ */ (0, import_rest_modules2.createR
644
688
  0 && (module.exports = {
645
689
  Alignment,
646
690
  AppType,
691
+ AspectRatio,
647
692
  BackgroundType,
693
+ ButtonDataType,
648
694
  Crop,
649
695
  DecorationType,
650
696
  Direction,
697
+ DividerDataAlignment,
651
698
  FontType,
652
699
  GIFType,
653
700
  InitialExpandedItems,
701
+ Layout,
654
702
  LayoutType,
655
703
  LineStyle,
656
704
  MapType,
657
705
  NodeType,
658
706
  NullValue,
659
707
  Orientation,
708
+ Placement,
660
709
  Plugin,
661
710
  PluginContainerDataAlignment,
662
711
  PollLayoutDirection,
663
712
  PollLayoutType,
664
713
  Position,
714
+ Resizing,
665
715
  Source,
716
+ StylesPosition,
666
717
  Target,
667
718
  TargetFormat,
668
719
  TextAlignment,