@wix/auto_sdk_multilingual_locale-settings 1.0.3 → 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.
package/build/index.d.mts CHANGED
@@ -1,64 +1,67 @@
1
- /**
2
- * Settings is a 'single entity per tenant' entity with META-SITE tenancy.
3
- * This means that Settings is active for every site, not only sites that have multilingual functionality installed.
4
- */
5
1
  interface LocaleSettings {
6
2
  /**
7
- * Settings lifecycle begins at site creation and cannot be manually created or deleted.
8
- * It's created automatically for each site.
9
- * Revision number, used for optimistic locking
3
+ * Revision number, which increments by 1 each time the locale settings object is updated. To prevent conflicting changes, the existing revision must be passed when updating the locale settings object.
10
4
  * @readonly
11
5
  */
12
6
  revision?: string | null;
13
7
  /**
14
- * Timestamp of when the Settings entity was created
8
+ * Date and time the locale settings were created.
15
9
  * @readonly
16
10
  */
17
11
  _createdDate?: Date | null;
18
12
  /**
19
- * Timestamp of the last update to the Settings entity
13
+ * Date and time the locale settings were last updated.
20
14
  * @readonly
21
15
  */
22
16
  _updatedDate?: Date | null;
23
17
  /**
24
18
  * Indicates whether multilingual mode is enabled for the site.
25
- * When false, the user can change the main language.
26
- * When true, the main language cannot be changed.
27
- * Changing this value may have significant implications for the site's content and structure.
19
+ *
20
+ * When set to `true`, you can create secondary locales.
28
21
  * @readonly
29
22
  */
30
23
  multilingualModeEnabled?: boolean | null;
31
24
  /**
32
- * When true, the live site will automatically open in a secondary language
33
- * if it detects that the user's browser is set to that language.
25
+ * Indicates whether the live site will automatically open in a secondary locale if the
26
+ * site visitor's browser is set to that locale.
27
+ *
28
+ * Default: `false`
29
+ *
30
+ * <blockquote class="caution">
31
+ *
32
+ * __Caution:__
33
+ * Auto-switch can harm SEO by causing duplicate content issues and restricting search engine indexing of different language versions, which limits visibility in search results.
34
+ *
35
+ * </blockquote>
34
36
  */
35
37
  autoSwitch?: boolean | null;
36
38
  /**
37
- * Defines how secondary languages will be resolved in the URL of the live site by default.
38
- * This can be overridden per locale.
39
+ * Defines the default method for how secondary languages appear in the live site's URL.
40
+ * The URL structure can be overridden per locale, using the Locale API.
41
+ *
42
+ * Default: `"SUBDIRECTORY"`
39
43
  */
40
44
  urlStructure?: UrlStructure;
41
45
  /**
42
- * The primary locale of the site, materialized from the locales service.
46
+ * The site's primary locale.
43
47
  * @readonly
44
48
  */
45
49
  primaryLocale?: Locale;
46
50
  }
47
51
  /** Enum representing the method for resolving locales in URLs. */
48
52
  declare enum UrlStructure {
49
- /** Value not specified */
53
+ /** Undefined resolution method. */
50
54
  UNDEFINED_RESOLUTION_METHOD = "UNDEFINED_RESOLUTION_METHOD",
51
- /** www.mysite.com/fr */
55
+ /** Subdirectory resolution method for the URL structure. For example, `"www.mysite.com/fr"`. */
52
56
  SUBDIRECTORY = "SUBDIRECTORY",
53
- /** fr.mysite.com */
57
+ /** Subdomain resolution method for the URL structure. For example, `"fr.mysite.com"`. */
54
58
  SUBDOMAIN = "SUBDOMAIN",
55
- /** www.mysite.com?lang=fr */
59
+ /** Query parameter resolution method for the URL structure. For example, `"www.mysite.com?lang=fr"`. */
56
60
  QUERY_PARAM = "QUERY_PARAM"
57
61
  }
58
- /** Every locale created will be validated using the IETF BCP 47 standard using framework validation. */
59
62
  interface Locale {
60
63
  /**
61
- * Locale ID. The ID is calculated from the language + region (+ script for future use).
64
+ * Locale ID. The ID is made up of the language and region codes. For example, `"en-US"`.
62
65
  * @maxLength 20
63
66
  * @format LANGUAGE_TAG
64
67
  * @readonly
@@ -66,108 +69,108 @@ interface Locale {
66
69
  */
67
70
  _id?: string | null;
68
71
  /**
69
- * Revision number for optimistic locking.
72
+ * Revision number, which increments by 1 each time the locale is updated. To prevent conflicting changes, the existing revision must be passed when updating the locale object.
70
73
  * @readonly
71
74
  */
72
75
  revision?: string | null;
73
76
  /**
74
- * Date and time the Locale was created.
77
+ * Date and time the locale was created.
75
78
  * @readonly
76
79
  */
77
80
  _createdDate?: Date | null;
78
81
  /**
79
- * Date and time the Locale was last updated.
82
+ * Date and time the locale was last updated.
80
83
  * @readonly
81
84
  */
82
85
  _updatedDate?: Date | null;
83
86
  /**
84
- * Language code (e.g., "en" for English).
87
+ * Language code. For example, `"en"` for English.
85
88
  * @immutable
86
89
  * @format LANGUAGE
87
90
  */
88
91
  languageCode?: string | null;
89
92
  /**
90
- * Region code (e.g., "US" for United States).
93
+ * Region code. For example, `"UK"` for United Kingdom.
91
94
  * @immutable
92
95
  * @format COUNTRY
93
96
  */
94
97
  regionCode?: string | null;
95
- /**
96
- * HIDDEN - locale will be available for the user to see it in editor and preview but won't be available for UoU
97
- * VISIBLE - locale will be available for the user to see it in editor and preview and be available for UoU to view the site in the specific locale, the URL of the page will indicate the locale according to the `effective_resolution_method` (e.g. www.mysite.com/es)
98
- */
98
+ /** Locale visibility status. */
99
99
  visibility?: LocaleVisibility;
100
100
  /**
101
- * Indicates if the language is the primary user-facing language in the Business Manager.
101
+ * Indicates whether the locale is the site's primary locale.
102
102
  * @readonly
103
103
  */
104
104
  primaryLocale?: boolean | null;
105
105
  /**
106
- * Indicates if the language is the primary visitor-facing language in the live site.
106
+ * Indicates whether the locale is treated as the default for site visitors when no language is specified in the URL of the site.
107
107
  * @readonly
108
108
  */
109
109
  visitorPrimaryLocale?: boolean | null;
110
110
  /**
111
- * Flag code (e.g., "US" for United States flag).
111
+ * Flag as a 3-letter language code based on Wix's supported locales. For example, `"USA"` for the United States flag.
112
112
  * @maxLength 3
113
113
  */
114
114
  flag?: string | null;
115
115
  /**
116
- * Date and number format (e.g., "en-US" for US English formatting).
116
+ * Regional format for determining how to display data types such as dates, times, numbers, and currencies. For example, `"en-US"` for US English formatting.
117
117
  * @format LANGUAGE_TAG
118
118
  */
119
119
  regionalFormat?: string | null;
120
120
  /**
121
- * The final and calculated specific locale resolution method.
122
- * This is taken by default from the settings unless there is an active override.
121
+ * Default URL structure for the locale's live site URL,
122
+ * based on the locale's settings, unless overridden.
123
123
  * @readonly
124
124
  */
125
125
  effectiveUrlStructure?: UrlStructure;
126
- /** Override for the default resolution method, if needed. */
126
+ /** Optional override for the locale's default URL structure. */
127
127
  urlStructureOverride?: UrlStructureOverride;
128
128
  /**
129
- * Machine translation code, can be overridden. By default, it has the value of language_code.
130
- * Add example for override needs (ZH_TW | ZH_CN)
129
+ * Language code based on Wix's supported locales, used to specify the target language when
130
+ * translatable content is sent for machine translation. For example, `"ES"` for Spanish
131
+ * or `"ZH_TW"` for Traditional Chinese.
132
+ *
133
+ * Default: The locale's `languageCode` value.
131
134
  * @format LANGUAGE_TAG
132
135
  */
133
136
  machineTranslationCode?: string | null;
134
137
  /**
135
- * Calculated display name. This will equal override_name if it exists, or localized_name as default.
138
+ * The locale's `displayName`, unless overridden.
136
139
  * @readonly
137
140
  * @maxLength 30
138
141
  */
139
142
  effectiveDisplayName?: string | null;
140
143
  /**
141
- * Localized name inferred from the ID using the locale data set.
144
+ * Default display name for the locale, inferred from the locale ID and region code.
142
145
  * @readonly
143
146
  * @maxLength 30
144
147
  */
145
148
  displayName?: string | null;
146
149
  /**
147
- * User-defined override name for the locale.
150
+ * Optional override for the locale's display name.
148
151
  * @maxLength 30
149
152
  */
150
153
  overrideDisplayName?: string | null;
151
154
  }
152
155
  /** Enum representing the visibility status of a locale. */
153
156
  declare enum LocaleVisibility {
154
- /** Value not specified */
157
+ /** Undefined visibility status. */
155
158
  UNDEFINED_LOCALE_STATUS = "UNDEFINED_LOCALE_STATUS",
156
- /** Locale was added to site but was not activated */
159
+ /** Locale is hidden from site visitors. */
157
160
  HIDDEN = "HIDDEN",
158
- /** Locale was added to site and activated */
161
+ /** Locale is visible to site visitors. A site can only have up to 100 visible locales. */
159
162
  VISIBLE = "VISIBLE"
160
163
  }
161
164
  /** Message for overriding the default resolution method. */
162
165
  interface UrlStructureOverride {
163
- /** The specific resolution method to use instead of the default. */
166
+ /** Resolution method that defines the URL structure to use instead of the default. */
164
167
  urlStructure?: UrlStructure;
165
168
  }
166
169
  /** Payload for the event triggered when the multilingual_mode value changes */
167
170
  interface MultilingualModeUpdated {
168
- /** The primary locale when multilingual mode is enabled or disabled */
171
+ /** The primary locale when `multilingualModeEnabled` is updated. */
169
172
  primaryLocale?: Locale;
170
- /** Indicates whether multilingual mode is enabled or disabled */
173
+ /** Indicates whether the multilingual mode is enabled on the site. */
171
174
  multilingualModeEnabled?: boolean;
172
175
  }
173
176
  /** Request message for retrieving multilingual settings */
@@ -175,27 +178,31 @@ interface GetLocaleSettingsRequest {
175
178
  }
176
179
  /** Response message containing the requested multilingual settings */
177
180
  interface GetLocaleSettingsResponse {
178
- /** The requested Settings entity */
181
+ /** Retrieved locale settings. */
179
182
  localeSettings?: LocaleSettings;
180
183
  }
181
184
  /** Request message for updating multilingual settings */
182
185
  interface UpdateLocaleSettingsRequest {
183
- /** Settings to be updated, may be partial */
186
+ /** Locale settings to update. */
184
187
  localeSettings: LocaleSettings;
185
188
  }
186
189
  /** Response message containing the updated multilingual settings */
187
190
  interface UpdateLocaleSettingsResponse {
188
- /** The updated Settings entity */
191
+ /** Updated locale settings. */
189
192
  localeSettings?: LocaleSettings;
190
193
  }
191
194
  /** Request message for setting the multilingual mode */
192
195
  interface SetMultilingualModeRequest {
193
- /** The new value of multilingual_mode to be set */
196
+ /**
197
+ * Whether to enable multilingual mode for the site.
198
+ *
199
+ * Default: `false`
200
+ */
194
201
  multilingualModeEnabled: boolean;
195
202
  }
196
203
  /** Response message containing the updated settings after changing the multilingual mode */
197
204
  interface SetMultilingualModeResponse {
198
- /** The current Settings entity after the change */
205
+ /** Updated locale settings. */
199
206
  localeSettings?: LocaleSettings;
200
207
  }
201
208
  interface DomainEvent extends DomainEventBodyOneOf {
@@ -301,6 +308,16 @@ interface MetaSiteSpecialEvent extends MetaSiteSpecialEventPayloadOneOf {
301
308
  studioAssigned?: StudioAssigned;
302
309
  /** Emitted when Studio is detached. */
303
310
  studioUnassigned?: StudioUnassigned;
311
+ /**
312
+ * Emitted when one of the URLs is changed. After this event you may call `urls-server` to fetch
313
+ * the actual URL.
314
+ *
315
+ * See: https://wix.slack.com/archives/C0UHEBPFT/p1732520791210559?thread_ts=1732027914.294059&cid=C0UHEBPFT
316
+ * See: https://wix.slack.com/archives/C0UHEBPFT/p1744115197619459
317
+ */
318
+ urlChanged?: SiteUrlChanged;
319
+ /** Site is marked as PurgedExternally */
320
+ sitePurgedExternally?: SitePurgedExternally;
304
321
  /**
305
322
  * A meta site id.
306
323
  * @format GUID
@@ -349,6 +366,16 @@ interface MetaSiteSpecialEventPayloadOneOf {
349
366
  studioAssigned?: StudioAssigned;
350
367
  /** Emitted when Studio is detached. */
351
368
  studioUnassigned?: StudioUnassigned;
369
+ /**
370
+ * Emitted when one of the URLs is changed. After this event you may call `urls-server` to fetch
371
+ * the actual URL.
372
+ *
373
+ * See: https://wix.slack.com/archives/C0UHEBPFT/p1732520791210559?thread_ts=1732027914.294059&cid=C0UHEBPFT
374
+ * See: https://wix.slack.com/archives/C0UHEBPFT/p1744115197619459
375
+ */
376
+ urlChanged?: SiteUrlChanged;
377
+ /** Site is marked as PurgedExternally */
378
+ sitePurgedExternally?: SitePurgedExternally;
352
379
  }
353
380
  interface Asset {
354
381
  /**
@@ -481,7 +508,20 @@ declare enum Namespace {
481
508
  */
482
509
  UGC_TEMPLATE = "UGC_TEMPLATE",
483
510
  /** Codux Headless Sites */
484
- CODUX = "CODUX"
511
+ CODUX = "CODUX",
512
+ /** Bobb - AI Design Creator. */
513
+ MEDIA_DESIGN_CREATOR = "MEDIA_DESIGN_CREATOR",
514
+ /**
515
+ * Shared Blog Site is a unique single site across Enterprise account,
516
+ * This site will hold all Blog posts related to the Marketing product.
517
+ */
518
+ SHARED_BLOG_ENTERPRISE = "SHARED_BLOG_ENTERPRISE",
519
+ /** Standalone forms (siteless). MetaSites with this namespace will *not* be shown in a user's site list by default. */
520
+ STANDALONE_FORMS = "STANDALONE_FORMS",
521
+ /** Standalone events (siteless). MetaSites with this namespace will *not* be shown in a user's site list by default. */
522
+ STANDALONE_EVENTS = "STANDALONE_EVENTS",
523
+ /** MIMIR - Siteless account for MIMIR Ai Job runner. */
524
+ MIMIR = "MIMIR"
485
525
  }
486
526
  /** Site transferred to another user. */
487
527
  interface SiteTransferred {
@@ -521,7 +561,8 @@ declare enum DeleteStatus {
521
561
  UNKNOWN = "UNKNOWN",
522
562
  TRASH = "TRASH",
523
563
  DELETED = "DELETED",
524
- PENDING_PURGE = "PENDING_PURGE"
564
+ PENDING_PURGE = "PENDING_PURGE",
565
+ PURGED_EXTERNALLY = "PURGED_EXTERNALLY"
525
566
  }
526
567
  /** Restoration of the meta site. */
527
568
  interface SiteUndeleted {
@@ -541,6 +582,21 @@ interface SiteMarkedAsTemplate {
541
582
  }
542
583
  interface SiteMarkedAsWixSite {
543
584
  }
585
+ /**
586
+ * Represents a service provisioned a site.
587
+ *
588
+ * Note on `origin_instance_id`:
589
+ * There is no guarantee that you will be able to find a meta site using `origin_instance_id`.
590
+ * This is because of the following scenario:
591
+ *
592
+ * Imagine you have a template where a third-party application (TPA) includes some stub data,
593
+ * such as a product catalog. When you create a site from this template, you inherit this
594
+ * default product catalog. However, if the template's product catalog is modified,
595
+ * your site will retain the catalog as it was at the time of site creation. This ensures that
596
+ * your site remains consistent with what you initially received and does not include any
597
+ * changes made to the original template afterward.
598
+ * To ensure this, the TPA on the template gets a new instance_id.
599
+ */
544
600
  interface ServiceProvisioned {
545
601
  /**
546
602
  * Either UUID or EmbeddedServiceType.
@@ -619,6 +675,29 @@ interface StudioAssigned {
619
675
  /** Unassigned Studio editor */
620
676
  interface StudioUnassigned {
621
677
  }
678
+ /**
679
+ * Fired in case site URLs were changed in any way: new secondary domain, published, account slug rename, site rename etc.
680
+ *
681
+ * This is an internal event, it's not propagated in special events, because it's non-actionable. If you need to keep up
682
+ * with sites and its urls, you need to listen to another topic/event. Read about it:
683
+ *
684
+ * https://bo.wix.com/wix-docs/rest/meta-site/meta-site---urls-service
685
+ */
686
+ interface SiteUrlChanged {
687
+ }
688
+ /**
689
+ * Used at the end of the deletion flow for both draft sites and when a user deletes a site.
690
+ * Consumed by other teams to remove relevant data.
691
+ */
692
+ interface SitePurgedExternally {
693
+ /**
694
+ * @maxLength 2048
695
+ * @maxSize 100
696
+ * @deprecated
697
+ * @targetRemovalDate 2025-04-15
698
+ */
699
+ appDefId?: string[];
700
+ }
622
701
  interface MessageEnvelope {
623
702
  /**
624
703
  * App instance ID.
@@ -690,4 +769,4 @@ declare enum WebhookIdentityType {
690
769
  APP = "APP"
691
770
  }
692
771
 
693
- export { type ActionEvent, type Asset, type DeleteContext, DeleteStatus, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type GetLocaleSettingsRequest, type GetLocaleSettingsResponse, type IdentificationData, type IdentificationDataIdOneOf, type Locale, type LocaleSettings, LocaleVisibility, type MessageEnvelope, type MetaSiteSpecialEvent, type MetaSiteSpecialEventPayloadOneOf, type MultilingualModeUpdated, Namespace, type NamespaceChanged, type RestoreInfo, type ServiceProvisioned, type ServiceRemoved, type SetMultilingualModeRequest, type SetMultilingualModeResponse, type SiteCreated, SiteCreatedContext, type SiteDeleted, type SiteHardDeleted, type SiteMarkedAsTemplate, type SiteMarkedAsWixSite, type SitePublished, type SiteRenamed, type SiteTransferred, type SiteUndeleted, type SiteUnpublished, State, type StudioAssigned, type StudioUnassigned, type UpdateLocaleSettingsRequest, type UpdateLocaleSettingsResponse, UrlStructure, type UrlStructureOverride, WebhookIdentityType };
772
+ export { type ActionEvent, type Asset, type DeleteContext, DeleteStatus, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type GetLocaleSettingsRequest, type GetLocaleSettingsResponse, type IdentificationData, type IdentificationDataIdOneOf, type Locale, type LocaleSettings, LocaleVisibility, type MessageEnvelope, type MetaSiteSpecialEvent, type MetaSiteSpecialEventPayloadOneOf, type MultilingualModeUpdated, Namespace, type NamespaceChanged, type RestoreInfo, type ServiceProvisioned, type ServiceRemoved, type SetMultilingualModeRequest, type SetMultilingualModeResponse, type SiteCreated, SiteCreatedContext, type SiteDeleted, type SiteHardDeleted, type SiteMarkedAsTemplate, type SiteMarkedAsWixSite, type SitePublished, type SitePurgedExternally, type SiteRenamed, type SiteTransferred, type SiteUndeleted, type SiteUnpublished, type SiteUrlChanged, State, type StudioAssigned, type StudioUnassigned, type UpdateLocaleSettingsRequest, type UpdateLocaleSettingsResponse, UrlStructure, type UrlStructureOverride, WebhookIdentityType };