@wix/auto_sdk_multilingual_translation-published-contents 1.0.40 → 1.0.41

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,38 +1,16 @@
1
- import { HttpClient, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
- import { PublishedContentQueryBuilder, PublishedContentCreatedEnvelope, PublishedContentDeletedEnvelope, PublishedContentUpdatedEnvelope } from './index.typings.js';
3
- export { ActionEvent, Alignment, AlignmentWithLiterals, AnchorData, AppEmbedData, AppEmbedDataAppDataOneOf, AppType, AppTypeWithLiterals, ApplicationError, AspectRatio, AspectRatioWithLiterals, AudioData, Background, BackgroundBackgroundOneOf, BackgroundImage, BackgroundType, BackgroundTypeWithLiterals, BaseEventMetadata, BlockquoteData, BookingData, Border, BorderColors, BulkActionMetadata, BulkContentResult, BulkDeletePublishedContentRequest, BulkDeletePublishedContentResponse, BulletedListData, ButtonData, ButtonDataType, ButtonDataTypeWithLiterals, ButtonStyles, CaptionData, CardStyles, CellStyle, CodeBlockData, CollapsibleListData, ColorData, Colors, Crop, CropWithLiterals, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, Decoration, DecorationDataOneOf, DecorationType, DecorationTypeWithLiterals, DeletePublishedContentByFilterRequest, DeletePublishedContentByFilterResponse, DeletePublishedContentRequest, DeletePublishedContentResponse, Design, Dimensions, Direction, DirectionWithLiterals, DividerData, DividerDataAlignment, DividerDataAlignmentWithLiterals, DocumentStyle, DomainEvent, DomainEventBodyOneOf, EmbedData, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventData, EventMetadata, ExtendedFields, FileData, FileSource, FileSourceDataOneOf, FocalPoint, FontSizeData, FontType, FontTypeWithLiterals, GIF, GIFData, GIFType, GIFTypeWithLiterals, GalleryData, GalleryOptions, GalleryOptionsLayout, GetPublishedContentRequest, GetPublishedContentResponse, Gradient, HTMLData, HTMLDataDataOneOf, HeadingData, Height, IdentificationData, IdentificationDataIdOneOf, Image, ImageData, ImageDataStyles, ImagePosition, ImagePositionWithLiterals, ImageStyles, InitialExpandedItems, InitialExpandedItemsWithLiterals, Item, ItemDataOneOf, ItemMetadata, ItemStyle, Layout, LayoutCellData, LayoutData, LayoutType, LayoutTypeWithLiterals, LayoutWithLiterals, LineStyle, LineStyleWithLiterals, Link, LinkData, LinkDataOneOf, LinkPreviewData, LinkPreviewDataStyles, ListValue, MapData, MapSettings, MapType, MapTypeWithLiterals, Media, MentionData, MessageEnvelope, Metadata, Node, NodeDataOneOf, NodeStyle, NodeType, NodeTypeWithLiterals, NullValue, NullValueWithLiterals, Oembed, Option, OptionDesign, OptionLayout, OrderedListData, Orientation, OrientationWithLiterals, PDFSettings, ParagraphData, Permissions, Placement, PlacementWithLiterals, PlaybackOptions, PluginContainerData, PluginContainerDataAlignment, PluginContainerDataAlignmentWithLiterals, PluginContainerDataWidth, PluginContainerDataWidthDataOneOf, Poll, PollData, PollDataLayout, PollDesign, PollLayout, PollLayoutDirection, PollLayoutDirectionWithLiterals, PollLayoutType, PollLayoutTypeWithLiterals, Position, PositionWithLiterals, PricingData, PublishedContent, PublishedContentField, PublishedContentFieldValueOneOf, PublishedContentQueryResult, QueryPublishedContentRequest, QueryPublishedContentResponse, Rel, Resizing, ResizingWithLiterals, ResponsivenessBehaviour, ResponsivenessBehaviourWithLiterals, RestoreInfo, RibbonStyles, RichContent, Scaling, ScalingWithLiterals, SchemaKey, SchemaScope, SchemaScopeWithLiterals, Settings, SortOrder, SortOrderWithLiterals, Sorting, Source, SourceWithLiterals, Spoiler, SpoilerData, Styles, StylesBorder, StylesPosition, StylesPositionWithLiterals, TableCellData, TableData, Target, TargetWithLiterals, TextAlignment, TextAlignmentWithLiterals, TextData, TextNodeStyle, TextStyle, Thumbnails, ThumbnailsAlignment, ThumbnailsAlignmentWithLiterals, Type, TypeWithLiterals, VerticalAlignment, VerticalAlignmentAlignment, VerticalAlignmentAlignmentWithLiterals, VerticalAlignmentWithLiterals, Video, VideoData, VideoResolution, ViewMode, ViewModeWithLiterals, ViewRole, ViewRoleWithLiterals, VoteRole, VoteRoleWithLiterals, WebhookIdentityType, WebhookIdentityTypeWithLiterals, Width, WidthType, WidthTypeWithLiterals, WidthWithLiterals } from './index.typings.js';
1
+ import { EventDefinition, MaybeContext, BuildRESTFunction, HttpClient, BuildEventDefinition } from '@wix/sdk-types';
2
+ import { PublishedContentCreatedEnvelope, PublishedContentDeletedEnvelope, PublishedContentUpdatedEnvelope, PublishedContentQueryBuilder, CursorQuery, typedQueryPublishedContent } from './index.typings.js';
3
+ export { ActionEvent, Alignment, AlignmentWithLiterals, AnchorData, AppEmbedData, AppEmbedDataAppDataOneOf, AppType, AppTypeWithLiterals, ApplicationError, AspectRatio, AspectRatioWithLiterals, AudioData, Background, BackgroundBackgroundOneOf, BackgroundImage, BackgroundType, BackgroundTypeWithLiterals, BaseEventMetadata, BlockquoteData, BookingData, Border, BorderColors, BulkActionMetadata, BulkContentResult, BulkDeletePublishedContentRequest, BulkDeletePublishedContentResponse, BulletedListData, ButtonData, ButtonDataType, ButtonDataTypeWithLiterals, ButtonStyles, CaptionData, CardStyles, CellStyle, CodeBlockData, CollapsibleListData, ColorData, Colors, Crop, CropWithLiterals, CursorPaging, CursorPagingMetadata, CursorQueryPagingMethodOneOf, Cursors, Decoration, DecorationDataOneOf, DecorationType, DecorationTypeWithLiterals, DeletePublishedContentByFilterRequest, DeletePublishedContentByFilterResponse, DeletePublishedContentRequest, DeletePublishedContentResponse, Design, Dimensions, Direction, DirectionWithLiterals, DividerData, DividerDataAlignment, DividerDataAlignmentWithLiterals, DocumentStyle, DomainEvent, DomainEventBodyOneOf, EmbedData, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventData, EventMetadata, ExtendedFields, FileData, FileSource, FileSourceDataOneOf, FocalPoint, FontSizeData, FontType, FontTypeWithLiterals, GIF, GIFData, GIFType, GIFTypeWithLiterals, GalleryData, GalleryOptions, GalleryOptionsLayout, GetPublishedContentRequest, GetPublishedContentResponse, Gradient, HTMLData, HTMLDataDataOneOf, HeadingData, Height, IdentificationData, IdentificationDataIdOneOf, Image, ImageData, ImageDataStyles, ImagePosition, ImagePositionWithLiterals, ImageStyles, InitialExpandedItems, InitialExpandedItemsWithLiterals, Item, ItemDataOneOf, ItemMetadata, ItemStyle, Layout, LayoutCellData, LayoutData, LayoutType, LayoutTypeWithLiterals, LayoutWithLiterals, LineStyle, LineStyleWithLiterals, Link, LinkData, LinkDataOneOf, LinkPreviewData, LinkPreviewDataStyles, ListValue, MapData, MapSettings, MapType, MapTypeWithLiterals, Media, MentionData, MessageEnvelope, Metadata, Node, NodeDataOneOf, NodeStyle, NodeType, NodeTypeWithLiterals, NullValue, NullValueWithLiterals, Oembed, Option, OptionDesign, OptionLayout, OrderedListData, Orientation, OrientationWithLiterals, PDFSettings, ParagraphData, Permissions, Placement, PlacementWithLiterals, PlaybackOptions, PluginContainerData, PluginContainerDataAlignment, PluginContainerDataAlignmentWithLiterals, PluginContainerDataWidth, PluginContainerDataWidthDataOneOf, Poll, PollData, PollDataLayout, PollDesign, PollLayout, PollLayoutDirection, PollLayoutDirectionWithLiterals, PollLayoutType, PollLayoutTypeWithLiterals, Position, PositionWithLiterals, PricingData, PublishedContent, PublishedContentField, PublishedContentFieldValueOneOf, PublishedContentQueryResult, QueryPublishedContentRequest, QueryPublishedContentResponse, Rel, Resizing, ResizingWithLiterals, ResponsivenessBehaviour, ResponsivenessBehaviourWithLiterals, RestoreInfo, RibbonStyles, RichContent, Scaling, ScalingWithLiterals, SchemaKey, SchemaScope, SchemaScopeWithLiterals, Settings, SortOrder, SortOrderWithLiterals, Sorting, Source, SourceWithLiterals, Spoiler, SpoilerData, Styles, StylesBorder, StylesPosition, StylesPositionWithLiterals, TableCellData, TableData, Target, TargetWithLiterals, TextAlignment, TextAlignmentWithLiterals, TextData, TextNodeStyle, TextStyle, Thumbnails, ThumbnailsAlignment, ThumbnailsAlignmentWithLiterals, Type, TypeWithLiterals, VerticalAlignment, VerticalAlignmentAlignment, VerticalAlignmentAlignmentWithLiterals, VerticalAlignmentWithLiterals, Video, VideoData, VideoResolution, ViewMode, ViewModeWithLiterals, ViewRole, ViewRoleWithLiterals, VoteRole, VoteRoleWithLiterals, WebhookIdentityType, WebhookIdentityTypeWithLiterals, Width, WidthType, WidthTypeWithLiterals, WidthWithLiterals } from './index.typings.js';
4
4
 
5
- declare function queryPublishedContent$1(httpClient: HttpClient): QueryPublishedContentSignature;
6
- interface QueryPublishedContentSignature {
7
- /**
8
- * Creates a query to retrieve a list of translation content items.
9
- *
10
- * The `queryPublishedContent()` function builds a query to retrieve a list of translation content items and returns a `PublishedContentQueryBuilder` object.
11
- *
12
- * The returned object contains the query definition, which is used to run the query using the [`find()`](https://dev.wix.com/docs/sdk/backend-modules/multilingual/translation/translation-published-content/published-content-query-builder/find) function.
13
- *
14
- * You can refine the query by chaining `PublishedContentQueryBuilder` functions onto the query. `PublishedContentQueryBuilder` functions enable you to filter, sort, and control the results that `queryPublishedContent()` returns.
15
- *
16
- * `queryPublishedContent()` runs with the following `PublishedContentQueryBuilder` defaults which you can override:
17
- *
18
- * + [`limit(100)`](https://dev.wix.com/docs/sdk/backend-modules/multilingual/translation/translation-published-content/published-content-query-builder/limit)
19
- * + [`ascending('_id')`](https://dev.wix.com/docs/sdk/backend-modules/multilingual/translation/translation-published-content/published-content-query-builder/ascending)
20
- *
21
- * The following query filter fields are required:
22
- *
23
- * + `schemaKey.appId`
24
- * + `schemaKey.entityType`
25
- * + `schemaKey.scope`
26
- *
27
- * The following `PublishedContentQueryBuilder` functions are supported for `queryPublishedContent()`. For a full description of the operations object, see the object returned for the [`items`](https://dev.wix.com/docs/sdk/backend-modules/multilingual/translation/translation-published-content/published-content-query-result/items) property in `PublishedContentQueryResult`.
28
- */
29
- (): PublishedContentQueryBuilder;
30
- }
31
5
  declare const onPublishedContentCreated$1: EventDefinition<PublishedContentCreatedEnvelope, "wix.multilingual.localization_public.v3.published_content_created">;
32
6
  declare const onPublishedContentDeleted$1: EventDefinition<PublishedContentDeletedEnvelope, "wix.multilingual.localization_public.v3.published_content_deleted">;
33
7
  declare const onPublishedContentUpdated$1: EventDefinition<PublishedContentUpdatedEnvelope, "wix.multilingual.localization_public.v3.published_content_updated">;
34
8
 
35
- declare const queryPublishedContent: MaybeContext<BuildRESTFunction<typeof queryPublishedContent$1> & typeof queryPublishedContent$1>;
9
+ declare function customQueryPublishedContent(httpClient: HttpClient): {
10
+ (): PublishedContentQueryBuilder;
11
+ (query: CursorQuery): ReturnType<typeof typedQueryPublishedContent>;
12
+ };
13
+ declare const queryPublishedContent: MaybeContext<BuildRESTFunction<typeof customQueryPublishedContent> & typeof customQueryPublishedContent>;
36
14
  /**
37
15
  * Triggered when published content is created.
38
16
  */
@@ -46,4 +24,4 @@ declare const onPublishedContentDeleted: BuildEventDefinition<typeof onPublished
46
24
  */
47
25
  declare const onPublishedContentUpdated: BuildEventDefinition<typeof onPublishedContentUpdated$1> & typeof onPublishedContentUpdated$1;
48
26
 
49
- export { PublishedContentCreatedEnvelope, PublishedContentDeletedEnvelope, PublishedContentQueryBuilder, PublishedContentUpdatedEnvelope, onPublishedContentCreated, onPublishedContentDeleted, onPublishedContentUpdated, queryPublishedContent };
27
+ export { CursorQuery, PublishedContentCreatedEnvelope, PublishedContentDeletedEnvelope, PublishedContentQueryBuilder, PublishedContentUpdatedEnvelope, onPublishedContentCreated, onPublishedContentDeleted, onPublishedContentUpdated, queryPublishedContent };
@@ -659,6 +659,47 @@ function queryPublishedContent2() {
659
659
  transformationPaths: {}
660
660
  });
661
661
  }
662
+ async function typedQueryPublishedContent(query) {
663
+ const { httpClient, sideEffects } = arguments[1];
664
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ query }, []);
665
+ const reqOpts = queryPublishedContent(
666
+ payload
667
+ );
668
+ sideEffects?.onSiteCall?.();
669
+ try {
670
+ const result = await httpClient.request(reqOpts);
671
+ sideEffects?.onSuccess?.(result);
672
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
673
+ (0, import_transform_paths2.transformPaths)(result.data, [
674
+ {
675
+ transformFn: import_image.transformRESTImageToSDKImage,
676
+ paths: [{ path: "publishedContent.fields.image" }]
677
+ },
678
+ {
679
+ transformFn: import_video_v2.transformRESTVideoV2ToSDKVideoV2,
680
+ paths: [{ path: "publishedContent.fields.video" }]
681
+ },
682
+ {
683
+ transformFn: import_document.transformRESTDocumentToSDKDocument,
684
+ paths: [{ path: "publishedContent.fields.document" }]
685
+ }
686
+ ]),
687
+ ["publishedContent.fields.richContent"]
688
+ );
689
+ } catch (err) {
690
+ const transformedError = (0, import_transform_error.transformError)(
691
+ err,
692
+ {
693
+ spreadPathsToArguments: {},
694
+ explicitPathsToArguments: { query: "$[0]" },
695
+ singleArgumentUnchanged: false
696
+ },
697
+ ["query"]
698
+ );
699
+ sideEffects?.onError?.(err);
700
+ throw transformedError;
701
+ }
702
+ }
662
703
 
663
704
  // src/multilingual-localization-public-v3-published-content-translation-published-contents.public.ts
664
705
  function queryPublishedContent3(httpClient) {
@@ -667,6 +708,13 @@ function queryPublishedContent3(httpClient) {
667
708
  { httpClient }
668
709
  );
669
710
  }
711
+ function typedQueryPublishedContent2(httpClient) {
712
+ return (query) => typedQueryPublishedContent(
713
+ query,
714
+ // @ts-ignore
715
+ { httpClient }
716
+ );
717
+ }
670
718
  var onPublishedContentCreated = (0, import_sdk_types.EventDefinition)(
671
719
  "wix.multilingual.localization_public.v3.published_content_created",
672
720
  true,
@@ -911,7 +959,19 @@ var onPublishedContentUpdated = (0, import_sdk_types.EventDefinition)(
911
959
  // src/multilingual-localization-public-v3-published-content-translation-published-contents.context.ts
912
960
  var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
913
961
  var import_event_definition_modules = require("@wix/sdk-runtime/event-definition-modules");
914
- var queryPublishedContent4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(queryPublishedContent3);
962
+ var import_query_method_router = require("@wix/sdk-runtime/query-method-router");
963
+ function customQueryPublishedContent(httpClient) {
964
+ const router = (0, import_query_method_router.createQueryOverloadRouter)({
965
+ builderQueryFunction: () => queryPublishedContent3(httpClient)(),
966
+ typedQueryFunction: (query) => typedQueryPublishedContent2(httpClient)(query),
967
+ hasOptionsParameter: false
968
+ });
969
+ function overloadedQuery(query) {
970
+ return router(...arguments);
971
+ }
972
+ return overloadedQuery;
973
+ }
974
+ var queryPublishedContent4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(customQueryPublishedContent);
915
975
  var onPublishedContentCreated2 = (0, import_event_definition_modules.createEventModule)(
916
976
  onPublishedContentCreated
917
977
  );