@wix/auto_sdk_multilingual_translation-schemas 1.0.28 → 1.0.29

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, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
- import { S as Schema, G as GetSchemaByKeyIdentifiers, a as GetSchemaByKeyResponse, U as UpdateSchema, b as SchemasQueryBuilder, L as ListSiteSchemasOptions, c as ListSiteSchemasResponse, d as SchemaCreatedEnvelope, e as SchemaDeletedEnvelope, f as SchemaUpdatedEnvelope } from './multilingual-translation-v1-schema-translation-schemas.universal-9n5YslSa.js';
3
- export { ah as ActionEvent, H as Asset, al as BaseEventMetadata, C as CreateSchemaRequest, m as CreateSchemaResponse, x as CursorPaging, z as CursorPagingMetadata, u as CursorQuery, v as CursorQueryPagingMethodOneOf, A as Cursors, O as DeleteContext, s as DeleteSchemaRequest, t as DeleteSchemaResponse, D as DeleteStatus, ab as DomainEvent, ac as DomainEventBodyOneOf, aa as Empty, ad as EntityCreatedEvent, ag as EntityDeletedEvent, af as EntityUpdatedEvent, am as EventMetadata, F as FieldType, p as GetSchemaByKeyRequest, n as GetSchemaRequest, o as GetSchemaResponse, aj as IdentificationData, ak as IdentificationDataIdOneOf, B as ListSiteSchemasRequest, ai as MessageEnvelope, M as MetaSiteSpecialEvent, E as MetaSiteSpecialEventPayloadOneOf, N as Namespace, a1 as NamespaceChanged, a6 as OdeditorAssigned, a7 as OdeditorUnassigned, a8 as PicassoAssigned, a9 as PicassoUnassigned, P as PreviewFields, Q as QuerySchemasRequest, y as QuerySchemasResponse, ae as RestoreInfo, l as SchemaField, k as SchemaKey, g as SchemaScope, an as SchemasQueryResult, Z as ServiceProvisioned, _ as ServiceRemoved, I as SiteCreated, j as SiteCreatedContext, K as SiteDeleted, a0 as SiteHardDeleted, X as SiteMarkedAsTemplate, Y as SiteMarkedAsWixSite, T as SitePublished, a5 as SitePurgedExternally, $ as SiteRenamed, J as SiteTransferred, R as SiteUndeleted, V as SiteUnpublished, a4 as SiteUrlChanged, h as SortOrder, w as Sorting, i as State, a2 as StudioAssigned, a3 as StudioUnassigned, q as UpdateSchemaRequest, r as UpdateSchemaResponse, W as WebhookIdentityType } from './multilingual-translation-v1-schema-translation-schemas.universal-9n5YslSa.js';
2
+ import { Schema, GetSchemaByKeyIdentifiers, GetSchemaByKeyResponse, UpdateSchema, SchemasQueryBuilder, ListSiteSchemasOptions, ListSiteSchemasResponse, SchemaCreatedEnvelope, SchemaDeletedEnvelope, SchemaUpdatedEnvelope } from './index.typings.js';
3
+ export { ActionEvent, Asset, BaseEventMetadata, CreateSchemaRequest, CreateSchemaResponse, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DeleteContext, DeleteSchemaRequest, DeleteSchemaResponse, DeleteStatus, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, FieldType, GetSchemaByKeyRequest, GetSchemaRequest, GetSchemaResponse, IdentificationData, IdentificationDataIdOneOf, ListSiteSchemasRequest, MessageEnvelope, MetaSiteSpecialEvent, MetaSiteSpecialEventPayloadOneOf, Namespace, NamespaceChanged, OdeditorAssigned, OdeditorUnassigned, PicassoAssigned, PicassoUnassigned, PreviewFields, QuerySchemasRequest, QuerySchemasResponse, RestoreInfo, SchemaField, SchemaKey, SchemaScope, SchemasQueryResult, ServiceProvisioned, ServiceRemoved, SiteCreated, SiteCreatedContext, SiteDeleted, SiteHardDeleted, SiteMarkedAsTemplate, SiteMarkedAsWixSite, SitePublished, SitePurgedExternally, SiteRenamed, SiteTransferred, SiteUndeleted, SiteUnpublished, SiteUrlChanged, SortOrder, Sorting, State, StudioAssigned, StudioUnassigned, UpdateSchemaRequest, UpdateSchemaResponse, WebhookIdentityType } from './index.typings.js';
4
4
 
5
5
  declare function createSchema$1(httpClient: HttpClient): CreateSchemaSignature;
6
6
  interface CreateSchemaSignature {
@@ -1,3 +1,5 @@
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+
1
3
  interface Schema {
2
4
  /**
3
5
  * Translation schema ID.
@@ -970,13 +972,84 @@ interface SchemaCreatedEnvelope {
970
972
  entity: Schema;
971
973
  metadata: EventMetadata;
972
974
  }
975
+ /**
976
+ * Triggered when translation schema is created.
977
+ * @permissionScope Wix Multilingual - Translation Schema Read
978
+ * @permissionScopeId SCOPE.DC-MULTILINGUAL.READ_TRANSLATION_SCHEMA
979
+ * @permissionId WIX_MULTILINGUAL.SCHEMA_READ_ORGANIZATION
980
+ * @webhook
981
+ * @eventType wix.multilingual.translation.v1.schema_created
982
+ * @slug created
983
+ */
984
+ declare function onSchemaCreated(handler: (event: SchemaCreatedEnvelope) => void | Promise<void>): void;
973
985
  interface SchemaDeletedEnvelope {
974
986
  metadata: EventMetadata;
975
987
  }
988
+ /**
989
+ * Triggered when translation schema is deleted.
990
+ * @permissionScope Wix Multilingual - Translation Schema Read
991
+ * @permissionScopeId SCOPE.DC-MULTILINGUAL.READ_TRANSLATION_SCHEMA
992
+ * @permissionId WIX_MULTILINGUAL.SCHEMA_READ_ORGANIZATION
993
+ * @webhook
994
+ * @eventType wix.multilingual.translation.v1.schema_deleted
995
+ * @slug deleted
996
+ */
997
+ declare function onSchemaDeleted(handler: (event: SchemaDeletedEnvelope) => void | Promise<void>): void;
976
998
  interface SchemaUpdatedEnvelope {
977
999
  entity: Schema;
978
1000
  metadata: EventMetadata;
979
1001
  }
1002
+ /**
1003
+ * Triggered when translation schema is updated.
1004
+ * @permissionScope Wix Multilingual - Translation Schema Read
1005
+ * @permissionScopeId SCOPE.DC-MULTILINGUAL.READ_TRANSLATION_SCHEMA
1006
+ * @permissionId WIX_MULTILINGUAL.SCHEMA_READ_ORGANIZATION
1007
+ * @webhook
1008
+ * @eventType wix.multilingual.translation.v1.schema_updated
1009
+ * @slug updated
1010
+ */
1011
+ declare function onSchemaUpdated(handler: (event: SchemaUpdatedEnvelope) => void | Promise<void>): void;
1012
+ type SchemaNonNullablePaths = `key.appId` | `key.entityType` | `key.scope`;
1013
+ /**
1014
+ * Creates a translation schema.
1015
+ * @param schema - Translation schema to create.
1016
+ * @public
1017
+ * @requiredField schema
1018
+ * @requiredField schema.fields
1019
+ * @requiredField schema.key
1020
+ * @requiredField schema.key.entityType
1021
+ * @permissionId WIX_MULTILINGUAL.SCHEMA_CREATE_ORGANIZATION
1022
+ * @applicableIdentity APP
1023
+ * @returns Newly created translation schema.
1024
+ * @fqn wix.multilingual.translation.schema.v1.TranslationSchema.CreateSchema
1025
+ */
1026
+ declare function createSchema(schema: NonNullablePaths<Schema, `fields` | `key` | `key.entityType`>): Promise<NonNullablePaths<Schema, SchemaNonNullablePaths>>;
1027
+ /**
1028
+ * Retrieves a translation schema by ID.
1029
+ * @param schemaId - ID of the translation schema to retrieve.
1030
+ * @public
1031
+ * @requiredField schemaId
1032
+ * @permissionId WIX_MULTILINGUAL.SCHEMA_READ_ORGANIZATION
1033
+ * @applicableIdentity APP
1034
+ * @returns The requested translation schema.
1035
+ * @fqn wix.multilingual.translation.schema.v1.TranslationSchema.GetSchema
1036
+ */
1037
+ declare function getSchema(schemaId: string): Promise<NonNullablePaths<Schema, SchemaNonNullablePaths>>;
1038
+ /**
1039
+ * Retrieves a translation schema by key.
1040
+ * @public
1041
+ * @requiredField identifiers
1042
+ * @requiredField identifiers.keyAppId
1043
+ * @requiredField identifiers.keyEntityType
1044
+ * @requiredField identifiers.keyScope
1045
+ * @requiredField key
1046
+ * @permissionId WIX_MULTILINGUAL.SCHEMA_READ_ORGANIZATION
1047
+ * @applicableIdentity APP
1048
+ * @fqn wix.multilingual.translation.schema.v1.TranslationSchema.GetSchemaByKey
1049
+ */
1050
+ declare function getSchemaByKey(identifiers: NonNullablePaths<GetSchemaByKeyIdentifiers, `keyAppId` | `keyEntityType` | `keyScope`>): Promise<NonNullablePaths<GetSchemaByKeyResponse, {
1051
+ [P in SchemaNonNullablePaths]: `schema.${P}`;
1052
+ }[SchemaNonNullablePaths]>>;
980
1053
  interface GetSchemaByKeyIdentifiers {
981
1054
  /**
982
1055
  * ID of the app that created the schema.
@@ -1000,6 +1073,35 @@ interface GetSchemaByKeyIdentifiers {
1000
1073
  */
1001
1074
  keyScope?: SchemaScopeWithLiterals;
1002
1075
  }
1076
+ /**
1077
+ * Updates a translation schema.
1078
+ *
1079
+ * To remove a field, pass the field key with an empty object as the value. For example:
1080
+ *
1081
+ * ```json
1082
+ * {
1083
+ * "fields": {
1084
+ * "title": {}
1085
+ * }
1086
+ * }
1087
+ * ```
1088
+ *
1089
+ * <blockquote class="caution">
1090
+ * <strong>Caution:</strong>
1091
+ *
1092
+ * Removing a schema field makes the corresponding content field unavailable.
1093
+ * </blockquote>
1094
+ * @param _id - Translation schema ID.
1095
+ * @public
1096
+ * @requiredField _id
1097
+ * @requiredField schema
1098
+ * @requiredField schema.revision
1099
+ * @permissionId WIX_MULTILINGUAL.SCHEMA_UPDATE_ORGANIZATION
1100
+ * @applicableIdentity APP
1101
+ * @returns Updated Schema.
1102
+ * @fqn wix.multilingual.translation.schema.v1.TranslationSchema.UpdateSchema
1103
+ */
1104
+ declare function updateSchema(_id: string, schema: NonNullablePaths<UpdateSchema, `revision`>): Promise<NonNullablePaths<Schema, SchemaNonNullablePaths>>;
1003
1105
  interface UpdateSchema {
1004
1106
  /**
1005
1107
  * Translation schema ID.
@@ -1055,6 +1157,41 @@ interface UpdateSchema {
1055
1157
  */
1056
1158
  duplicateContent?: boolean | null;
1057
1159
  }
1160
+ /**
1161
+ * Deletes a translation schema.
1162
+ * @param schemaId - ID of the translation schema to delete.
1163
+ * @public
1164
+ * @requiredField schemaId
1165
+ * @permissionId WIX_MULTILINGUAL.SCHEMA_DELETE_ORGANIZATION
1166
+ * @applicableIdentity APP
1167
+ * @fqn wix.multilingual.translation.schema.v1.TranslationSchema.DeleteSchema
1168
+ */
1169
+ declare function deleteSchema(schemaId: string): Promise<void>;
1170
+ /**
1171
+ * Creates a query to retrieve a list of schemas.
1172
+ *
1173
+ * > **Note:**
1174
+ * >
1175
+ * > This method can retrieve all schemas with a `GLOBAL` scope and schemas with a `SITE` scope for the site the API request is authorized to access.
1176
+ *
1177
+ * The `querySchemas()` function builds a query to retrieve a list of translation schemas and returns a `SchemasQueryBuilder` object.
1178
+ *
1179
+ * 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-schema/schemas-query-builder/find) function.
1180
+ *
1181
+ * You can refine the query by chaining `SchemasQueryBuilder` functions onto the query. `SchemasQueryBuilder` functions enable you to filter, sort, and control the results that `querySchemas()` returns.
1182
+ *
1183
+ * `querySchemas()` runs with the following `SchemasQueryBuilder` defaults which you can override:
1184
+ *
1185
+ * + [`limit(100)`](https://dev.wix.com/docs/sdk/backend-modules/multilingual/translation/translation-schema/schemas-query-builder/limit)
1186
+ * + [`ascending('_id')`](https://dev.wix.com/docs/sdk/backend-modules/multilingual/translation/translation-schema/schemas-query-builder/ascending)
1187
+ *
1188
+ * The following `SchemasQueryBuilder` functions are supported for `querySchemas()`. 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-schema/schemas-query-result/items) property in `SchemasQueryResult`.
1189
+ * @public
1190
+ * @permissionId WIX_MULTILINGUAL.SCHEMA_READ_ORGANIZATION
1191
+ * @applicableIdentity APP
1192
+ * @fqn wix.multilingual.translation.schema.v1.TranslationSchema.QuerySchemas
1193
+ */
1194
+ declare function querySchemas(): SchemasQueryBuilder;
1058
1195
  interface QueryCursorResult {
1059
1196
  cursors: Cursors;
1060
1197
  hasNext: () => boolean;
@@ -1113,6 +1250,16 @@ interface SchemasQueryBuilder {
1113
1250
  skipTo: (cursor: string) => SchemasQueryBuilder;
1114
1251
  find: () => Promise<SchemasQueryResult>;
1115
1252
  }
1253
+ /**
1254
+ * Retrieves a list of all translation schemas associated with a site, regardless of which app created them.
1255
+ * @public
1256
+ * @permissionId WIX_MULTILINGUAL.SCHEMA_READ
1257
+ * @applicableIdentity APP
1258
+ * @fqn wix.multilingual.translation.schema.v1.TranslationSchema.ListSiteSchemas
1259
+ */
1260
+ declare function listSiteSchemas(options?: ListSiteSchemasOptions): Promise<NonNullablePaths<ListSiteSchemasResponse, {
1261
+ [P in SchemaNonNullablePaths]: `schemas.${number}.${P}`;
1262
+ }[SchemaNonNullablePaths]>>;
1116
1263
  interface ListSiteSchemasOptions {
1117
1264
  /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
1118
1265
  paging?: CursorPaging;
@@ -1136,4 +1283,4 @@ interface ListSiteSchemasOptions {
1136
1283
  scope?: SchemaScopeWithLiterals;
1137
1284
  }
1138
1285
 
1139
- export { type SiteRenamed as $, type Cursors as A, type ListSiteSchemasRequest as B, type CreateSchemaRequest as C, DeleteStatus as D, type MetaSiteSpecialEventPayloadOneOf as E, FieldType as F, type GetSchemaByKeyIdentifiers as G, type Asset as H, type SiteCreated as I, type SiteTransferred as J, type SiteDeleted as K, type ListSiteSchemasOptions as L, type MetaSiteSpecialEvent as M, Namespace as N, type DeleteContext as O, type PreviewFields as P, type QuerySchemasRequest as Q, type SiteUndeleted as R, type Schema as S, type SitePublished as T, type UpdateSchema as U, type SiteUnpublished as V, WebhookIdentityType as W, type SiteMarkedAsTemplate as X, type SiteMarkedAsWixSite as Y, type ServiceProvisioned as Z, type ServiceRemoved as _, type GetSchemaByKeyResponse as a, type SiteHardDeleted as a0, type NamespaceChanged as a1, type StudioAssigned as a2, type StudioUnassigned as a3, type SiteUrlChanged as a4, type SitePurgedExternally as a5, type OdeditorAssigned as a6, type OdeditorUnassigned as a7, type PicassoAssigned as a8, type PicassoUnassigned as a9, type Empty as aa, type DomainEvent as ab, type DomainEventBodyOneOf as ac, type EntityCreatedEvent as ad, type RestoreInfo as ae, type EntityUpdatedEvent as af, type EntityDeletedEvent as ag, type ActionEvent as ah, type MessageEnvelope as ai, type IdentificationData as aj, type IdentificationDataIdOneOf as ak, type BaseEventMetadata as al, type EventMetadata as am, type SchemasQueryResult as an, type SchemasQueryBuilder as b, type ListSiteSchemasResponse as c, type SchemaCreatedEnvelope as d, type SchemaDeletedEnvelope as e, type SchemaUpdatedEnvelope as f, SchemaScope as g, SortOrder as h, State as i, SiteCreatedContext as j, type SchemaKey as k, type SchemaField as l, type CreateSchemaResponse as m, type GetSchemaRequest as n, type GetSchemaResponse as o, type GetSchemaByKeyRequest as p, type UpdateSchemaRequest as q, type UpdateSchemaResponse as r, type DeleteSchemaRequest as s, type DeleteSchemaResponse as t, type CursorQuery as u, type CursorQueryPagingMethodOneOf as v, type Sorting as w, type CursorPaging as x, type QuerySchemasResponse as y, type CursorPagingMetadata as z };
1286
+ export { type ActionEvent, type Asset, type BaseEventMetadata, type CreateSchemaRequest, type CreateSchemaResponse, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DeleteContext, type DeleteSchemaRequest, type DeleteSchemaResponse, DeleteStatus, type DeleteStatusWithLiterals, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, FieldType, type FieldTypeWithLiterals, type GetSchemaByKeyIdentifiers, type GetSchemaByKeyRequest, type GetSchemaByKeyResponse, type GetSchemaRequest, type GetSchemaResponse, type IdentificationData, type IdentificationDataIdOneOf, type ListSiteSchemasOptions, type ListSiteSchemasRequest, type ListSiteSchemasResponse, type MessageEnvelope, type MetaSiteSpecialEvent, type MetaSiteSpecialEventPayloadOneOf, Namespace, type NamespaceChanged, type NamespaceWithLiterals, type OdeditorAssigned, type OdeditorUnassigned, type PicassoAssigned, type PicassoUnassigned, type PreviewFields, type QuerySchemasRequest, type QuerySchemasResponse, type RestoreInfo, type Schema, type SchemaCreatedEnvelope, type SchemaDeletedEnvelope, type SchemaField, type SchemaKey, SchemaScope, type SchemaScopeWithLiterals, type SchemaUpdatedEnvelope, type SchemasQueryBuilder, type SchemasQueryResult, type ServiceProvisioned, type ServiceRemoved, type SiteCreated, SiteCreatedContext, type SiteCreatedContextWithLiterals, type SiteDeleted, type SiteHardDeleted, type SiteMarkedAsTemplate, type SiteMarkedAsWixSite, type SitePublished, type SitePurgedExternally, type SiteRenamed, type SiteTransferred, type SiteUndeleted, type SiteUnpublished, type SiteUrlChanged, SortOrder, type SortOrderWithLiterals, type Sorting, State, type StateWithLiterals, type StudioAssigned, type StudioUnassigned, type UpdateSchema, type UpdateSchemaRequest, type UpdateSchemaResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, createSchema, deleteSchema, getSchema, getSchemaByKey, listSiteSchemas, onSchemaCreated, onSchemaDeleted, onSchemaUpdated, querySchemas, updateSchema };