@wix/multilingual 1.0.13 → 1.0.14

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.
@@ -11,7 +11,7 @@ interface TranslatableContent extends TranslatableContentContentOneOf {
11
11
  htmlContent?: string;
12
12
  /** Rich content. */
13
13
  richContent?: RichContent$1;
14
- /** Translatable content ID. */
14
+ /** Translatable content ID. The ID should be unique to this content and doesn't need to match the ID used by any other service. */
15
15
  _id?: string | null;
16
16
  /** Format of the translatable content. */
17
17
  format?: Format;
@@ -1262,7 +1262,7 @@ interface TextNodeStyle$1 {
1262
1262
  interface MachineTranslateRequest {
1263
1263
  /** Language of the source text to translate. */
1264
1264
  sourceLanguage: SupportedLanguage;
1265
- /** Language which text should be translated into. */
1265
+ /** Language to translate text into. */
1266
1266
  targetLanguage: SupportedLanguage;
1267
1267
  /** The content to translate. */
1268
1268
  contentToTranslate: TranslatableContent;
@@ -1560,7 +1560,7 @@ interface UnknownFormatError {
1560
1560
  interface BulkMachineTranslateRequest {
1561
1561
  /** Language of the source text to translate. */
1562
1562
  sourceLanguage: SupportedLanguage;
1563
- /** Language which text should be translated into. */
1563
+ /** Language to translate text into. */
1564
1564
  targetLanguage: SupportedLanguage;
1565
1565
  /** The content to translate. */
1566
1566
  contentToTranslate?: TranslatableContent[];
@@ -2565,41 +2565,50 @@ interface BulkMachineTranslateResponseNonNullableFields {
2565
2565
  };
2566
2566
  }
2567
2567
  interface MachineTranslateOptions {
2568
- /** Language which text should be translated into. */
2568
+ /** Language to translate text into. */
2569
2569
  targetLanguage: SupportedLanguage;
2570
2570
  /** The content to translate. */
2571
2571
  contentToTranslate: TranslatableContent;
2572
2572
  }
2573
2573
  interface BulkMachineTranslateOptions {
2574
- /** Language which text should be translated into. */
2574
+ /** Language to translate text into. */
2575
2575
  targetLanguage: SupportedLanguage;
2576
2576
  /** The content to translate. */
2577
2577
  contentToTranslate?: TranslatableContent[];
2578
2578
  }
2579
2579
 
2580
- interface HttpClient$3 {
2581
- request<TResponse, TData = any>(req: RequestOptionsFactory$3<TResponse, TData>): Promise<HttpResponse$3<TResponse>>;
2582
- fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
2580
+ interface HttpClient {
2581
+ request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
2582
+ fetchWithAuth: typeof fetch;
2583
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
2583
2584
  }
2584
- type RequestOptionsFactory$3<TResponse = any, TData = any> = (context: any) => RequestOptions$3<TResponse, TData>;
2585
- type HttpResponse$3<T = any> = {
2585
+ type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
2586
+ type HttpResponse<T = any> = {
2586
2587
  data: T;
2587
2588
  status: number;
2588
2589
  statusText: string;
2589
2590
  headers: any;
2590
2591
  request?: any;
2591
2592
  };
2592
- type RequestOptions$3<_TResponse = any, Data = any> = {
2593
+ type RequestOptions<_TResponse = any, Data = any> = {
2593
2594
  method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
2594
2595
  url: string;
2595
2596
  data?: Data;
2596
2597
  params?: URLSearchParams;
2597
- } & APIMetadata$3;
2598
- type APIMetadata$3 = {
2598
+ } & APIMetadata;
2599
+ type APIMetadata = {
2599
2600
  methodFqn?: string;
2600
2601
  entityFqdn?: string;
2601
2602
  packageName?: string;
2602
2603
  };
2604
+ type EventDefinition<Payload = unknown, Type extends string = string> = {
2605
+ __type: 'event-definition';
2606
+ type: Type;
2607
+ isDomainEvent?: boolean;
2608
+ transformations?: (envelope: unknown) => Payload;
2609
+ __payload: Payload;
2610
+ };
2611
+ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
2603
2612
 
2604
2613
  declare global {
2605
2614
  // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
@@ -2611,8 +2620,8 @@ declare global {
2611
2620
  declare const __metadata$3: {
2612
2621
  PACKAGE_NAME: string;
2613
2622
  };
2614
- declare function machineTranslate(httpClient: HttpClient$3): (sourceLanguage: SupportedLanguage, options: MachineTranslateOptions) => Promise<MachineTranslateResponse & MachineTranslateResponseNonNullableFields>;
2615
- declare function bulkMachineTranslate(httpClient: HttpClient$3): (sourceLanguage: SupportedLanguage, options?: BulkMachineTranslateOptions) => Promise<BulkMachineTranslateResponse & BulkMachineTranslateResponseNonNullableFields>;
2623
+ declare function machineTranslate(httpClient: HttpClient): (sourceLanguage: SupportedLanguage, options: MachineTranslateOptions) => Promise<MachineTranslateResponse & MachineTranslateResponseNonNullableFields>;
2624
+ declare function bulkMachineTranslate(httpClient: HttpClient): (sourceLanguage: SupportedLanguage, options?: BulkMachineTranslateOptions) => Promise<BulkMachineTranslateResponse & BulkMachineTranslateResponseNonNullableFields>;
2616
2625
 
2617
2626
  type index_d$3_BulkMachineTranslateOptions = BulkMachineTranslateOptions;
2618
2627
  type index_d$3_BulkMachineTranslateRequest = BulkMachineTranslateRequest;
@@ -2957,42 +2966,11 @@ interface GetSiteTranslatablesPropertiesOptions {
2957
2966
  translatedLanguage?: Locale;
2958
2967
  }
2959
2968
 
2960
- interface HttpClient$2 {
2961
- request<TResponse, TData = any>(req: RequestOptionsFactory$2<TResponse, TData>): Promise<HttpResponse$2<TResponse>>;
2962
- fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
2963
- }
2964
- type RequestOptionsFactory$2<TResponse = any, TData = any> = (context: any) => RequestOptions$2<TResponse, TData>;
2965
- type HttpResponse$2<T = any> = {
2966
- data: T;
2967
- status: number;
2968
- statusText: string;
2969
- headers: any;
2970
- request?: any;
2971
- };
2972
- type RequestOptions$2<_TResponse = any, Data = any> = {
2973
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
2974
- url: string;
2975
- data?: Data;
2976
- params?: URLSearchParams;
2977
- } & APIMetadata$2;
2978
- type APIMetadata$2 = {
2979
- methodFqn?: string;
2980
- entityFqdn?: string;
2981
- packageName?: string;
2982
- };
2983
-
2984
- declare global {
2985
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
2986
- interface SymbolConstructor {
2987
- readonly observable: symbol;
2988
- }
2989
- }
2990
-
2991
2969
  declare const __metadata$2: {
2992
2970
  PACKAGE_NAME: string;
2993
2971
  };
2994
- declare function translateSite(httpClient: HttpClient$2): (mainLanguage: Locale, options: TranslateSiteOptions) => Promise<void>;
2995
- declare function getSiteTranslatablesProperties(httpClient: HttpClient$2): (mainLanguage: Locale, options?: GetSiteTranslatablesPropertiesOptions) => Promise<GetSiteTranslatablesPropertiesResponse & GetSiteTranslatablesPropertiesResponseNonNullableFields>;
2972
+ declare function translateSite(httpClient: HttpClient): (mainLanguage: Locale, options: TranslateSiteOptions) => Promise<void>;
2973
+ declare function getSiteTranslatablesProperties(httpClient: HttpClient): (mainLanguage: Locale, options?: GetSiteTranslatablesPropertiesOptions) => Promise<GetSiteTranslatablesPropertiesResponse & GetSiteTranslatablesPropertiesResponseNonNullableFields>;
2996
2974
 
2997
2975
  type index_d$2_ApplicationTranslatableProperties = ApplicationTranslatableProperties;
2998
2976
  type index_d$2_Flag = Flag;
@@ -8004,49 +7982,10 @@ interface BulkUpdateContentOptions {
8004
7982
  returnEntity?: boolean;
8005
7983
  }
8006
7984
 
8007
- interface HttpClient$1 {
8008
- request<TResponse, TData = any>(req: RequestOptionsFactory$1<TResponse, TData>): Promise<HttpResponse$1<TResponse>>;
8009
- fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
8010
- }
8011
- type RequestOptionsFactory$1<TResponse = any, TData = any> = (context: any) => RequestOptions$1<TResponse, TData>;
8012
- type HttpResponse$1<T = any> = {
8013
- data: T;
8014
- status: number;
8015
- statusText: string;
8016
- headers: any;
8017
- request?: any;
8018
- };
8019
- type RequestOptions$1<_TResponse = any, Data = any> = {
8020
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
8021
- url: string;
8022
- data?: Data;
8023
- params?: URLSearchParams;
8024
- } & APIMetadata$1;
8025
- type APIMetadata$1 = {
8026
- methodFqn?: string;
8027
- entityFqdn?: string;
8028
- packageName?: string;
8029
- };
8030
- type EventDefinition$1<Payload = unknown, Type extends string = string> = {
8031
- __type: 'event-definition';
8032
- type: Type;
8033
- isDomainEvent?: boolean;
8034
- transformations?: (envelope: unknown) => Payload;
8035
- __payload: Payload;
8036
- };
8037
- declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
8038
-
8039
- declare global {
8040
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
8041
- interface SymbolConstructor {
8042
- readonly observable: symbol;
8043
- }
8044
- }
8045
-
8046
7985
  declare const __metadata$1: {
8047
7986
  PACKAGE_NAME: string;
8048
7987
  };
8049
- declare function createContent(httpClient: HttpClient$1): (content: Content) => Promise<Content & {
7988
+ declare function createContent(httpClient: HttpClient): (content: Content) => Promise<Content & {
8050
7989
  schemaId: string;
8051
7990
  entityId: string;
8052
7991
  locale: string;
@@ -8529,7 +8468,7 @@ declare function createContent(httpClient: HttpClient$1): (content: Content) =>
8529
8468
  } | undefined;
8530
8469
  publishStatus: PublishStatus;
8531
8470
  }>;
8532
- declare function getContent(httpClient: HttpClient$1): (contentId: string) => Promise<Content & {
8471
+ declare function getContent(httpClient: HttpClient): (contentId: string) => Promise<Content & {
8533
8472
  schemaId: string;
8534
8473
  entityId: string;
8535
8474
  locale: string;
@@ -9012,7 +8951,7 @@ declare function getContent(httpClient: HttpClient$1): (contentId: string) => Pr
9012
8951
  } | undefined;
9013
8952
  publishStatus: PublishStatus;
9014
8953
  }>;
9015
- declare function updateContent(httpClient: HttpClient$1): (content: Content) => Promise<Content & {
8954
+ declare function updateContent(httpClient: HttpClient): (content: Content) => Promise<Content & {
9016
8955
  schemaId: string;
9017
8956
  entityId: string;
9018
8957
  locale: string;
@@ -9495,14 +9434,14 @@ declare function updateContent(httpClient: HttpClient$1): (content: Content) =>
9495
9434
  } | undefined;
9496
9435
  publishStatus: PublishStatus;
9497
9436
  }>;
9498
- declare function deleteContent(httpClient: HttpClient$1): (contentId: string) => Promise<void>;
9499
- declare function queryContents(httpClient: HttpClient$1): (options?: QueryContentsOptions) => Promise<QueryContentsResponse & QueryContentsResponseNonNullableFields>;
9500
- declare function bulkCreateContent(httpClient: HttpClient$1): (contents: Content[], options?: BulkCreateContentOptions) => Promise<BulkCreateContentResponse & BulkCreateContentResponseNonNullableFields>;
9501
- declare function bulkUpdateContent(httpClient: HttpClient$1): (contents: MaskedContent[], options?: BulkUpdateContentOptions) => Promise<BulkUpdateContentResponse & BulkUpdateContentResponseNonNullableFields>;
9502
- declare function bulkDeleteContent(httpClient: HttpClient$1): (contentIds: string[]) => Promise<BulkDeleteContentResponse & BulkDeleteContentResponseNonNullableFields>;
9503
- declare const onContentCreated: EventDefinition$1<ContentCreatedEnvelope, "wix.multilingual.translation.v1.content_created">;
9504
- declare const onContentUpdated: EventDefinition$1<ContentUpdatedEnvelope, "wix.multilingual.translation.v1.content_updated">;
9505
- declare const onContentDeleted: EventDefinition$1<ContentDeletedEnvelope, "wix.multilingual.translation.v1.content_deleted">;
9437
+ declare function deleteContent(httpClient: HttpClient): (contentId: string) => Promise<void>;
9438
+ declare function queryContents(httpClient: HttpClient): (options?: QueryContentsOptions) => Promise<QueryContentsResponse & QueryContentsResponseNonNullableFields>;
9439
+ declare function bulkCreateContent(httpClient: HttpClient): (contents: Content[], options?: BulkCreateContentOptions) => Promise<BulkCreateContentResponse & BulkCreateContentResponseNonNullableFields>;
9440
+ declare function bulkUpdateContent(httpClient: HttpClient): (contents: MaskedContent[], options?: BulkUpdateContentOptions) => Promise<BulkUpdateContentResponse & BulkUpdateContentResponseNonNullableFields>;
9441
+ declare function bulkDeleteContent(httpClient: HttpClient): (contentIds: string[]) => Promise<BulkDeleteContentResponse & BulkDeleteContentResponseNonNullableFields>;
9442
+ declare const onContentCreated: EventDefinition<ContentCreatedEnvelope, "wix.multilingual.translation.v1.content_created">;
9443
+ declare const onContentUpdated: EventDefinition<ContentUpdatedEnvelope, "wix.multilingual.translation.v1.content_updated">;
9444
+ declare const onContentDeleted: EventDefinition<ContentDeletedEnvelope, "wix.multilingual.translation.v1.content_deleted">;
9506
9445
 
9507
9446
  type index_d$1_Alignment = Alignment;
9508
9447
  declare const index_d$1_Alignment: typeof Alignment;
@@ -10507,45 +10446,6 @@ interface ListSiteSchemasOptions {
10507
10446
  paging?: CursorPaging;
10508
10447
  }
10509
10448
 
10510
- interface HttpClient {
10511
- request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
10512
- fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
10513
- }
10514
- type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
10515
- type HttpResponse<T = any> = {
10516
- data: T;
10517
- status: number;
10518
- statusText: string;
10519
- headers: any;
10520
- request?: any;
10521
- };
10522
- type RequestOptions<_TResponse = any, Data = any> = {
10523
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
10524
- url: string;
10525
- data?: Data;
10526
- params?: URLSearchParams;
10527
- } & APIMetadata;
10528
- type APIMetadata = {
10529
- methodFqn?: string;
10530
- entityFqdn?: string;
10531
- packageName?: string;
10532
- };
10533
- type EventDefinition<Payload = unknown, Type extends string = string> = {
10534
- __type: 'event-definition';
10535
- type: Type;
10536
- isDomainEvent?: boolean;
10537
- transformations?: (envelope: unknown) => Payload;
10538
- __payload: Payload;
10539
- };
10540
- declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
10541
-
10542
- declare global {
10543
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
10544
- interface SymbolConstructor {
10545
- readonly observable: symbol;
10546
- }
10547
- }
10548
-
10549
10449
  declare const __metadata: {
10550
10450
  PACKAGE_NAME: string;
10551
10451
  };
@@ -11,7 +11,7 @@ interface TranslatableContent$1 extends TranslatableContentContentOneOf$1 {
11
11
  htmlContent?: string;
12
12
  /** Rich content. */
13
13
  richContent?: RichContent$3;
14
- /** Translatable content ID. */
14
+ /** Translatable content ID. The ID should be unique to this content and doesn't need to match the ID used by any other service. */
15
15
  id?: string | null;
16
16
  /** Format of the translatable content. */
17
17
  format?: Format$1;
@@ -1243,7 +1243,7 @@ interface TextNodeStyle$3 {
1243
1243
  interface MachineTranslateRequest$1 {
1244
1244
  /** Language of the source text to translate. */
1245
1245
  sourceLanguage: SupportedLanguage$1;
1246
- /** Language which text should be translated into. */
1246
+ /** Language to translate text into. */
1247
1247
  targetLanguage: SupportedLanguage$1;
1248
1248
  /** The content to translate. */
1249
1249
  contentToTranslate: TranslatableContent$1;
@@ -1529,7 +1529,7 @@ interface MachineTranslateResponse$1 {
1529
1529
  interface BulkMachineTranslateRequest$1 {
1530
1530
  /** Language of the source text to translate. */
1531
1531
  sourceLanguage: SupportedLanguage$1;
1532
- /** Language which text should be translated into. */
1532
+ /** Language to translate text into. */
1533
1533
  targetLanguage: SupportedLanguage$1;
1534
1534
  /** The content to translate. */
1535
1535
  contentToTranslate?: TranslatableContent$1[];
@@ -2547,7 +2547,7 @@ interface TranslatableContent extends TranslatableContentContentOneOf {
2547
2547
  htmlContent?: string;
2548
2548
  /** Rich content. */
2549
2549
  richContent?: RichContent$2;
2550
- /** Translatable content ID. */
2550
+ /** Translatable content ID. The ID should be unique to this content and doesn't need to match the ID used by any other service. */
2551
2551
  _id?: string | null;
2552
2552
  /** Format of the translatable content. */
2553
2553
  format?: Format;
@@ -3779,7 +3779,7 @@ interface TextNodeStyle$2 {
3779
3779
  interface MachineTranslateRequest {
3780
3780
  /** Language of the source text to translate. */
3781
3781
  sourceLanguage: SupportedLanguage;
3782
- /** Language which text should be translated into. */
3782
+ /** Language to translate text into. */
3783
3783
  targetLanguage: SupportedLanguage;
3784
3784
  /** The content to translate. */
3785
3785
  contentToTranslate: TranslatableContent;
@@ -4065,7 +4065,7 @@ interface MachineTranslateResponse {
4065
4065
  interface BulkMachineTranslateRequest {
4066
4066
  /** Language of the source text to translate. */
4067
4067
  sourceLanguage: SupportedLanguage;
4068
- /** Language which text should be translated into. */
4068
+ /** Language to translate text into. */
4069
4069
  targetLanguage: SupportedLanguage;
4070
4070
  /** The content to translate. */
4071
4071
  contentToTranslate?: TranslatableContent[];