@wix/auto_sdk_rich-content_ricos-documents 1.0.54 → 1.0.55

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, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
- import { ValidateDocumentOptions, ValidateDocumentResponse, ConvertToRicosDocumentOptions, ConvertToRicosDocumentResponse, RichContent, TargetFormatWithLiterals, ConvertFromRicosDocumentOptions, ConvertFromRicosDocumentResponse, GenerateFileDownloadUrlResponse, GenerateFileDownloadUrlApplicationErrors } from './index.typings.js';
3
- export { Alignment, AlignmentWithLiterals, AnchorData, Animation, AppEmbedData, AppEmbedDataAppDataOneOf, AppType, AppTypeWithLiterals, AspectRatio, AspectRatioWithLiterals, AudioData, Backdrop, BackdropType, BackdropTypeWithLiterals, Background, BackgroundGradient, BackgroundImage, BackgroundType, BackgroundTypeWithLiterals, Banner, BannerOriginPresenceOneOf, BannerPosition, BannerPositionWithLiterals, BlockquoteData, BookingData, Border, BorderColors, BorderWidths, BulletedListData, ButtonData, ButtonDataType, ButtonDataTypeWithLiterals, ButtonStyles, CaptionData, CardData, CardDataBackground, CardDataBackgroundType, CardDataBackgroundTypeWithLiterals, CardStyles, CardStylesType, CardStylesTypeWithLiterals, CellStyle, CheckboxListData, CodeBlockData, CollapsibleListData, ColorData, ColorDataBackground, ColorDataBackgroundType, ColorDataBackgroundTypeWithLiterals, Colors, ColumnSize, ColumnSizeWithLiterals, ConvertFromRicosDocumentOptionsOptionsOneOf, ConvertFromRicosDocumentRequest, ConvertFromRicosDocumentRequestOptionsOneOf, ConvertFromRicosDocumentResponseResultOneOf, ConvertToRicosDocumentOptionsSourceOneOf, ConvertToRicosDocumentRequest, ConvertToRicosDocumentRequestSourceOneOf, Crop, CropWithLiterals, Decoration, DecorationDataOneOf, DecorationType, DecorationTypeWithLiterals, Design, DesignTarget, DesignTargetWithLiterals, Dimensions, Direction, DirectionWithLiterals, DividerData, DividerDataAlignment, DividerDataAlignmentWithLiterals, DividerDataStyles, DocumentStyle, EmbedData, EntranceAnimation, EntranceEffect, EntranceEffectType, EntranceEffectTypeWithLiterals, EventData, FileData, FileDownloadUrl, FileSource, FileSourceDataOneOf, FontFamilyData, FontSizeData, FontType, FontTypeWithLiterals, GIF, GIFData, GIFType, GIFTypeWithLiterals, GalleryData, GalleryOptions, GalleryOptionsLayout, GenerateFileDownloadUrlRequest, Gradient, GradientType, GradientTypeWithLiterals, HTMLData, HTMLDataDataOneOf, HeadingData, Height, Image, ImageData, ImageDataCrop, ImageDataStyles, ImagePosition, ImagePositionPosition, ImagePositionPositionWithLiterals, ImagePositionWithLiterals, ImageScalingScaling, ImageScalingScalingWithLiterals, ImageStyles, Indentation, IndentationWithLiterals, InitialExpandedItems, InitialExpandedItemsWithLiterals, Item, ItemDataOneOf, ItemStyle, LayerEffect, LayerEffectWithLiterals, Layers, Layout, LayoutCellData, LayoutData, LayoutDataBackground, LayoutDataBackgroundImage, LayoutDataBackgroundType, LayoutDataBackgroundTypeWithLiterals, LayoutType, LayoutTypeWithLiterals, LayoutWithLiterals, LineCap, LineCapWithLiterals, LineStyle, LineStyleWithLiterals, Link, LinkData, LinkDataOneOf, LinkPreviewData, LinkPreviewDataStyles, ListItemNodeData, ListStyle, ListStyleWithLiterals, ListValue, LoopAnimation, LoopEffect, LoopEffectType, LoopEffectTypeWithLiterals, MapData, MapSettings, MapType, MapTypeWithLiterals, Media, MentionData, Metadata, Node, NodeDataOneOf, NodeStyle, NodeType, NodeTypeWithLiterals, NullValue, NullValueWithLiterals, Oembed, Option, OptionDesign, OptionLayout, OrderedListData, Orientation, OrientationWithLiterals, Origin, OriginWithLiterals, PDFSettings, ParagraphData, Permissions, Placement, PlacementWithLiterals, PlainTextOptions, PlaybackOptions, Plugin, PluginContainerData, PluginContainerDataAlignment, PluginContainerDataAlignmentWithLiterals, PluginContainerDataWidth, PluginContainerDataWidthDataOneOf, PluginWithLiterals, PointerEffect, PointerEffectType, PointerEffectTypeWithLiterals, Poll, PollData, PollDataLayout, PollDesign, PollDesignBackground, PollDesignBackgroundBackgroundOneOf, PollDesignBackgroundType, PollDesignBackgroundTypeWithLiterals, PollLayout, PollLayoutDirection, PollLayoutDirectionWithLiterals, PollLayoutType, PollLayoutTypeWithLiterals, Position, PositionWithLiterals, PricingData, Rel, Resizing, ResizingWithLiterals, ResponsivenessBehaviour, ResponsivenessBehaviourWithLiterals, RibbonStyles, RicosDocumentOptions, RicosDocumentPlaceholder, RicosDocumentViolation, Scaling, ScalingWithLiterals, SectionDivider, Settings, Shape, ShapeData, ShapeDataStyles, ShapeWithLiterals, SketchData, SlotData, SlotDesign, SmartBlockCellData, SmartBlockData, SmartBlockDataType, SmartBlockDataTypeWithLiterals, Source, SourceWithLiterals, Spoiler, SpoilerData, Stop, Styles, StylesBorder, StylesPosition, StylesPositionWithLiterals, TableCellData, TableData, Target, TargetFormat, TargetWithLiterals, TextAlignment, TextAlignmentWithLiterals, TextData, TextNodeStyle, TextStyle, Thumbnails, ThumbnailsAlignment, ThumbnailsAlignmentWithLiterals, TocData, Type, TypeWithLiterals, ValidateDocumentRequest, Variant, VariantWithLiterals, VerticalAlignment, VerticalAlignmentAlignment, VerticalAlignmentAlignmentWithLiterals, VerticalAlignmentWithLiterals, Video, VideoData, ViewMode, ViewModeWithLiterals, ViewRole, ViewRoleWithLiterals, VoteRole, VoteRoleWithLiterals, Width, WidthType, WidthTypeWithLiterals, WidthWithLiterals } from './index.typings.js';
2
+ import { ValidateDocumentOptions, ValidateDocumentResponse, ConvertToRicosDocumentOptions, ConvertToRicosDocumentResponse, RichContent, TargetFormatWithLiterals, ConvertFromRicosDocumentOptions, ConvertFromRicosDocumentResponse, GenerateFileDownloadUrlResponse, GenerateFileDownloadUrlApplicationErrors, GenerateFileUploadUrlOptions, GenerateFileUploadUrlResponse } from './index.typings.js';
3
+ export { Alignment, AlignmentWithLiterals, AnchorData, Animation, AppEmbedData, AppEmbedDataAppDataOneOf, AppType, AppTypeWithLiterals, AspectRatio, AspectRatioWithLiterals, AudioData, Backdrop, BackdropType, BackdropTypeWithLiterals, Background, BackgroundGradient, BackgroundImage, BackgroundType, BackgroundTypeWithLiterals, Banner, BannerOriginPresenceOneOf, BannerPosition, BannerPositionWithLiterals, BlockquoteData, BookingData, Border, BorderColors, BorderWidths, BulletedListData, ButtonData, ButtonDataType, ButtonDataTypeWithLiterals, ButtonStyles, CaptionData, CardData, CardDataBackground, CardDataBackgroundType, CardDataBackgroundTypeWithLiterals, CardStyles, CardStylesType, CardStylesTypeWithLiterals, CellStyle, CheckboxListData, CodeBlockData, CollapsibleListData, ColorData, ColorDataBackground, ColorDataBackgroundType, ColorDataBackgroundTypeWithLiterals, Colors, ColumnSize, ColumnSizeWithLiterals, ConvertFromRicosDocumentOptionsOptionsOneOf, ConvertFromRicosDocumentRequest, ConvertFromRicosDocumentRequestOptionsOneOf, ConvertFromRicosDocumentResponseResultOneOf, ConvertToRicosDocumentOptionsSourceOneOf, ConvertToRicosDocumentRequest, ConvertToRicosDocumentRequestSourceOneOf, Crop, CropWithLiterals, Decoration, DecorationDataOneOf, DecorationType, DecorationTypeWithLiterals, Design, DesignTarget, DesignTargetWithLiterals, Dimensions, Direction, DirectionWithLiterals, DividerData, DividerDataAlignment, DividerDataAlignmentWithLiterals, DividerDataStyles, DocumentStyle, EmbedData, EntranceAnimation, EntranceEffect, EntranceEffectType, EntranceEffectTypeWithLiterals, EventData, FileData, FileDownloadUrl, FileSource, FileSourceDataOneOf, FontFamilyData, FontSizeData, FontType, FontTypeWithLiterals, GIF, GIFData, GIFType, GIFTypeWithLiterals, GalleryData, GalleryOptions, GalleryOptionsLayout, GenerateFileDownloadUrlRequest, GenerateFileUploadUrlRequest, Gradient, GradientType, GradientTypeWithLiterals, HTMLData, HTMLDataDataOneOf, HeadingData, Height, Image, ImageData, ImageDataCrop, ImageDataStyles, ImagePosition, ImagePositionPosition, ImagePositionPositionWithLiterals, ImagePositionWithLiterals, ImageScalingScaling, ImageScalingScalingWithLiterals, ImageStyles, Indentation, IndentationWithLiterals, InitialExpandedItems, InitialExpandedItemsWithLiterals, Item, ItemDataOneOf, ItemStyle, LayerEffect, LayerEffectWithLiterals, Layers, Layout, LayoutCellData, LayoutData, LayoutDataBackground, LayoutDataBackgroundImage, LayoutDataBackgroundType, LayoutDataBackgroundTypeWithLiterals, LayoutType, LayoutTypeWithLiterals, LayoutWithLiterals, LineCap, LineCapWithLiterals, LineStyle, LineStyleWithLiterals, Link, LinkData, LinkDataOneOf, LinkPreviewData, LinkPreviewDataStyles, ListItemNodeData, ListStyle, ListStyleWithLiterals, ListValue, LoopAnimation, LoopEffect, LoopEffectType, LoopEffectTypeWithLiterals, MapData, MapSettings, MapType, MapTypeWithLiterals, Media, MentionData, Metadata, Node, NodeDataOneOf, NodeStyle, NodeType, NodeTypeWithLiterals, NullValue, NullValueWithLiterals, Oembed, Option, OptionDesign, OptionLayout, OrderedListData, Orientation, OrientationWithLiterals, Origin, OriginWithLiterals, PDFSettings, ParagraphData, Permissions, Placement, PlacementWithLiterals, PlainTextOptions, PlaybackOptions, Plugin, PluginContainerData, PluginContainerDataAlignment, PluginContainerDataAlignmentWithLiterals, PluginContainerDataWidth, PluginContainerDataWidthDataOneOf, PluginWithLiterals, PointerEffect, PointerEffectType, PointerEffectTypeWithLiterals, Poll, PollData, PollDataLayout, PollDesign, PollDesignBackground, PollDesignBackgroundBackgroundOneOf, PollDesignBackgroundType, PollDesignBackgroundTypeWithLiterals, PollLayout, PollLayoutDirection, PollLayoutDirectionWithLiterals, PollLayoutType, PollLayoutTypeWithLiterals, Position, PositionWithLiterals, PricingData, Rel, Resizing, ResizingWithLiterals, ResponsivenessBehaviour, ResponsivenessBehaviourWithLiterals, RibbonStyles, RicosDocumentOptions, RicosDocumentPlaceholder, RicosDocumentViolation, Scaling, ScalingWithLiterals, SectionDivider, Settings, Shape, ShapeData, ShapeDataStyles, ShapeWithLiterals, SketchData, SlotData, SlotDesign, SmartBlockCellData, SmartBlockData, SmartBlockDataType, SmartBlockDataTypeWithLiterals, Source, SourceWithLiterals, Spoiler, SpoilerData, Stop, Styles, StylesBorder, StylesPosition, StylesPositionWithLiterals, TableCellData, TableData, Target, TargetFormat, TargetWithLiterals, TextAlignment, TextAlignmentWithLiterals, TextData, TextNodeStyle, TextStyle, Thumbnails, ThumbnailsAlignment, ThumbnailsAlignmentWithLiterals, TocData, Type, TypeWithLiterals, ValidateDocumentRequest, Variant, VariantWithLiterals, VerticalAlignment, VerticalAlignmentAlignment, VerticalAlignmentAlignmentWithLiterals, VerticalAlignmentWithLiterals, Video, VideoData, ViewMode, ViewModeWithLiterals, ViewRole, ViewRoleWithLiterals, VoteRole, VoteRoleWithLiterals, Width, WidthType, WidthTypeWithLiterals, WidthWithLiterals } from './index.typings.js';
4
4
 
5
5
  declare function validateDocument$1(httpClient: HttpClient): ValidateDocumentSignature;
6
6
  interface ValidateDocumentSignature {
@@ -54,10 +54,25 @@ interface GenerateFileDownloadUrlSignature {
54
54
  __applicationErrorsType?: GenerateFileDownloadUrlApplicationErrors;
55
55
  }>;
56
56
  }
57
+ declare function generateFileUploadUrl$1(httpClient: HttpClient): GenerateFileUploadUrlSignature;
58
+ interface GenerateFileUploadUrlSignature {
59
+ /**
60
+ * Generates a URL for uploading a file to the site's Media Manager, so the file can be added to a Ricos document.
61
+ *
62
+ * Upload the file to the returned `uploadUrl` with a `PUT` request. The response of the upload request
63
+ * contains the uploaded file's descriptor, including its ID. Specify `private` as `true` to upload a file
64
+ * that can't be accessed from its file URL. Use [Generate File Download URL](https://dev.wix.com/docs/api-reference/assets/rich-content/ricos-documents/generate-file-download-url) to download private files.
65
+ *
66
+ * Site visitors and members can call this method.
67
+ * @param - MIME type of the file to upload. For example, `application/pdf`.
68
+ */
69
+ (mimeType: string, options?: GenerateFileUploadUrlOptions): Promise<GenerateFileUploadUrlResponse>;
70
+ }
57
71
 
58
72
  declare const validateDocument: MaybeContext<BuildRESTFunction<typeof validateDocument$1> & typeof validateDocument$1>;
59
73
  declare const convertToRicosDocument: MaybeContext<BuildRESTFunction<typeof convertToRicosDocument$1> & typeof convertToRicosDocument$1>;
60
74
  declare const convertFromRicosDocument: MaybeContext<BuildRESTFunction<typeof convertFromRicosDocument$1> & typeof convertFromRicosDocument$1>;
61
75
  declare const generateFileDownloadUrl: MaybeContext<BuildRESTFunction<typeof generateFileDownloadUrl$1> & typeof generateFileDownloadUrl$1>;
76
+ declare const generateFileUploadUrl: MaybeContext<BuildRESTFunction<typeof generateFileUploadUrl$1> & typeof generateFileUploadUrl$1>;
62
77
 
63
- export { ConvertFromRicosDocumentOptions, ConvertFromRicosDocumentResponse, ConvertToRicosDocumentOptions, ConvertToRicosDocumentResponse, GenerateFileDownloadUrlApplicationErrors, GenerateFileDownloadUrlResponse, RichContent, TargetFormatWithLiterals, ValidateDocumentOptions, ValidateDocumentResponse, convertFromRicosDocument, convertToRicosDocument, generateFileDownloadUrl, validateDocument };
78
+ export { ConvertFromRicosDocumentOptions, ConvertFromRicosDocumentResponse, ConvertToRicosDocumentOptions, ConvertToRicosDocumentResponse, GenerateFileDownloadUrlApplicationErrors, GenerateFileDownloadUrlResponse, GenerateFileUploadUrlOptions, GenerateFileUploadUrlResponse, RichContent, TargetFormatWithLiterals, ValidateDocumentOptions, ValidateDocumentResponse, convertFromRicosDocument, convertToRicosDocument, generateFileDownloadUrl, generateFileUploadUrl, validateDocument };
@@ -89,6 +89,7 @@ __export(index_exports, {
89
89
  convertFromRicosDocument: () => convertFromRicosDocument4,
90
90
  convertToRicosDocument: () => convertToRicosDocument4,
91
91
  generateFileDownloadUrl: () => generateFileDownloadUrl4,
92
+ generateFileUploadUrl: () => generateFileUploadUrl4,
92
93
  validateDocument: () => validateDocument4
93
94
  });
94
95
  module.exports = __toCommonJS(index_exports);
@@ -780,6 +781,27 @@ function generateFileDownloadUrl(payload) {
780
781
  }
781
782
  return __generateFileDownloadUrl;
782
783
  }
784
+ function generateFileUploadUrl(payload) {
785
+ function __generateFileUploadUrl({ host }) {
786
+ const metadata = {
787
+ entityFqdn: "wix.ricos.v1.document",
788
+ method: "POST",
789
+ methodFqn: "wix.ricos.v1.RicosDocument.GenerateFileUploadUrl",
790
+ packageName: PACKAGE_NAME,
791
+ migrationOptions: {
792
+ optInTransformResponse: true
793
+ },
794
+ url: resolveWixRicosV1RicosDocumentUrl({
795
+ protoPath: "/v1/ricos-document/generate-file-upload-url",
796
+ data: payload,
797
+ host
798
+ }),
799
+ data: payload
800
+ };
801
+ return metadata;
802
+ }
803
+ return __generateFileUploadUrl;
804
+ }
783
805
 
784
806
  // src/ricos-v1-document-ricos-documents.universal.ts
785
807
  var Plugin = /* @__PURE__ */ ((Plugin2) => {
@@ -1457,6 +1479,39 @@ async function generateFileDownloadUrl2(fileId) {
1457
1479
  throw transformedError;
1458
1480
  }
1459
1481
  }
1482
+ async function generateFileUploadUrl2(mimeType, options) {
1483
+ const { httpClient, sideEffects } = arguments[2];
1484
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1485
+ mimeType,
1486
+ fileName: options?.fileName,
1487
+ parentFolderId: options?.parentFolderId,
1488
+ private: options?.private
1489
+ });
1490
+ const reqOpts = generateFileUploadUrl(payload);
1491
+ sideEffects?.onSiteCall?.();
1492
+ try {
1493
+ const result = await httpClient.request(reqOpts);
1494
+ sideEffects?.onSuccess?.(result);
1495
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
1496
+ } catch (err) {
1497
+ const transformedError = (0, import_transform_error.transformError)(
1498
+ err,
1499
+ {
1500
+ spreadPathsToArguments: {},
1501
+ explicitPathsToArguments: {
1502
+ mimeType: "$[0]",
1503
+ fileName: "$[1].fileName",
1504
+ parentFolderId: "$[1].parentFolderId",
1505
+ private: "$[1].private"
1506
+ },
1507
+ singleArgumentUnchanged: false
1508
+ },
1509
+ ["mimeType", "options"]
1510
+ );
1511
+ sideEffects?.onError?.(err);
1512
+ throw transformedError;
1513
+ }
1514
+ }
1460
1515
 
1461
1516
  // src/ricos-v1-document-ricos-documents.public.ts
1462
1517
  function validateDocument3(httpClient) {
@@ -1490,6 +1545,14 @@ function generateFileDownloadUrl3(httpClient) {
1490
1545
  { httpClient }
1491
1546
  );
1492
1547
  }
1548
+ function generateFileUploadUrl3(httpClient) {
1549
+ return (mimeType, options) => generateFileUploadUrl2(
1550
+ mimeType,
1551
+ options,
1552
+ // @ts-ignore
1553
+ { httpClient }
1554
+ );
1555
+ }
1493
1556
 
1494
1557
  // src/ricos-v1-document-ricos-documents.context.ts
1495
1558
  var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
@@ -1497,6 +1560,7 @@ var validateDocument4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModul
1497
1560
  var convertToRicosDocument4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(convertToRicosDocument3);
1498
1561
  var convertFromRicosDocument4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(convertFromRicosDocument3);
1499
1562
  var generateFileDownloadUrl4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(generateFileDownloadUrl3);
1563
+ var generateFileUploadUrl4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(generateFileUploadUrl3);
1500
1564
  // Annotate the CommonJS export names for ESM import in node:
1501
1565
  0 && (module.exports = {
1502
1566
  Alignment,
@@ -1568,6 +1632,7 @@ var generateFileDownloadUrl4 = /* @__PURE__ */ (0, import_rest_modules2.createRE
1568
1632
  convertFromRicosDocument,
1569
1633
  convertToRicosDocument,
1570
1634
  generateFileDownloadUrl,
1635
+ generateFileUploadUrl,
1571
1636
  validateDocument
1572
1637
  });
1573
1638
  //# sourceMappingURL=index.js.map