@wix/auto_sdk_multilingual_translation-schemas 1.0.42 → 1.0.44

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, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
- import { Schema, GetSchemaByKeyIdentifiers, GetSchemaByKeyResponse, UpdateSchema, SchemasQueryBuilder, ListSiteSchemasOptions, ListSiteSchemasResponse } from './index.typings.js';
3
- export { ActionEvent, Asset, CreateSchemaRequest, CreateSchemaResponse, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DeleteContext, DeleteSchemaRequest, DeleteSchemaResponse, DeleteStatus, DeleteStatusWithLiterals, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, FieldType, FieldTypeWithLiterals, GetSchemaByKeyRequest, GetSchemaRequest, GetSchemaResponse, IdentificationData, IdentificationDataIdOneOf, ListSiteSchemasRequest, MessageEnvelope, MetaSiteSpecialEvent, MetaSiteSpecialEventPayloadOneOf, Namespace, NamespaceChanged, NamespaceWithLiterals, OdeditorAssigned, OdeditorUnassigned, PicassoAssigned, PicassoUnassigned, PreviewFields, QuerySchemasRequest, QuerySchemasResponse, RestoreInfo, SchemaField, SchemaKey, SchemaScope, SchemaScopeWithLiterals, SchemasQueryResult, ServiceProvisioned, ServiceRemoved, SiteCreated, SiteCreatedContext, SiteCreatedContextWithLiterals, SiteDeleted, SiteHardDeleted, SiteMarkedAsTemplate, SiteMarkedAsWixSite, SitePublished, SitePurgedExternally, SiteRenamed, SiteTransferred, SiteUndeleted, SiteUnpublished, SiteUrlChanged, SortOrder, SortOrderWithLiterals, Sorting, State, StateWithLiterals, StudioAssigned, StudioTwoAssigned, StudioTwoUnassigned, StudioUnassigned, UpdateSchemaRequest, UpdateSchemaResponse, ValidateSchemaRequest, ValidateSchemaResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals, WixelAssigned, WixelUnassigned } from './index.typings.js';
2
+ import { Schema, GetSchemaByKeyIdentifiers, GetSchemaByKeyResponse, UpdateSchema, ListSiteSchemasOptions, ListSiteSchemasResponse, CursorQuery, QuerySchemasOptions, typedQuerySchemas, SchemasQueryBuilder } from './index.typings.js';
3
+ export { ActionEvent, Asset, CreateSchemaRequest, CreateSchemaResponse, CursorPaging, CursorPagingMetadata, CursorQueryPagingMethodOneOf, Cursors, DeleteContext, DeleteSchemaRequest, DeleteSchemaResponse, DeleteStatus, DeleteStatusWithLiterals, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, FieldType, FieldTypeWithLiterals, GetSchemaByKeyRequest, GetSchemaRequest, GetSchemaResponse, IdentificationData, IdentificationDataIdOneOf, ListSiteSchemasRequest, MessageEnvelope, MetaSiteSpecialEvent, MetaSiteSpecialEventPayloadOneOf, Namespace, NamespaceChanged, NamespaceWithLiterals, OdeditorAssigned, OdeditorUnassigned, PicassoAssigned, PicassoUnassigned, PreviewFields, QuerySchemasRequest, QuerySchemasResponse, RestoreInfo, SchemaField, SchemaKey, SchemaScope, SchemaScopeWithLiterals, SchemasQueryResult, ServiceProvisioned, ServiceRemoved, SiteCreated, SiteCreatedContext, SiteCreatedContextWithLiterals, SiteDeleted, SiteHardDeleted, SiteMarkedAsTemplate, SiteMarkedAsWixSite, SitePublished, SitePurgedExternally, SiteRenamed, SiteTransferred, SiteUndeleted, SiteUnpublished, SiteUrlChanged, SortOrder, SortOrderWithLiterals, Sorting, State, StateWithLiterals, StudioAssigned, StudioTwoAssigned, StudioTwoUnassigned, StudioUnassigned, UpdateSchemaRequest, UpdateSchemaResponse, ValidateSchemaRequest, ValidateSchemaResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals, WixelAssigned, WixelUnassigned } from './index.typings.js';
4
4
 
5
5
  declare function createSchema$1(httpClient: HttpClient): CreateSchemaSignature;
6
6
  interface CreateSchemaSignature {
@@ -60,30 +60,6 @@ interface DeleteSchemaSignature {
60
60
  */
61
61
  (schemaId: string): Promise<void>;
62
62
  }
63
- declare function querySchemas$1(httpClient: HttpClient): QuerySchemasSignature;
64
- interface QuerySchemasSignature {
65
- /**
66
- * Creates a query to retrieve a list of schemas.
67
- *
68
- * > **Note:**
69
- * >
70
- * > 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.
71
- *
72
- * The `querySchemas()` function builds a query to retrieve a list of translation schemas and returns a `SchemasQueryBuilder` object.
73
- *
74
- * 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.
75
- *
76
- * 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.
77
- *
78
- * `querySchemas()` runs with the following `SchemasQueryBuilder` defaults which you can override:
79
- *
80
- * + [`limit(100)`](https://dev.wix.com/docs/sdk/backend-modules/multilingual/translation/translation-schema/schemas-query-builder/limit)
81
- * + [`ascending('_id')`](https://dev.wix.com/docs/sdk/backend-modules/multilingual/translation/translation-schema/schemas-query-builder/ascending)
82
- *
83
- * 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`.
84
- */
85
- (): SchemasQueryBuilder;
86
- }
87
63
  declare function listSiteSchemas$1(httpClient: HttpClient): ListSiteSchemasSignature;
88
64
  interface ListSiteSchemasSignature {
89
65
  /**
@@ -92,12 +68,16 @@ interface ListSiteSchemasSignature {
92
68
  (options?: ListSiteSchemasOptions): Promise<NonNullablePaths<ListSiteSchemasResponse, `schemas` | `schemas.${number}.key.appId` | `schemas.${number}.key.entityType` | `schemas.${number}.key.scope`, 5>>;
93
69
  }
94
70
 
71
+ declare function customQuerySchemas(httpClient: HttpClient): {
72
+ (query: CursorQuery, options?: QuerySchemasOptions): ReturnType<typeof typedQuerySchemas>;
73
+ (options?: QuerySchemasOptions): SchemasQueryBuilder;
74
+ };
95
75
  declare const createSchema: MaybeContext<BuildRESTFunction<typeof createSchema$1> & typeof createSchema$1>;
96
76
  declare const getSchema: MaybeContext<BuildRESTFunction<typeof getSchema$1> & typeof getSchema$1>;
97
77
  declare const getSchemaByKey: MaybeContext<BuildRESTFunction<typeof getSchemaByKey$1> & typeof getSchemaByKey$1>;
98
78
  declare const updateSchema: MaybeContext<BuildRESTFunction<typeof updateSchema$1> & typeof updateSchema$1>;
99
79
  declare const deleteSchema: MaybeContext<BuildRESTFunction<typeof deleteSchema$1> & typeof deleteSchema$1>;
100
- declare const querySchemas: MaybeContext<BuildRESTFunction<typeof querySchemas$1> & typeof querySchemas$1>;
101
80
  declare const listSiteSchemas: MaybeContext<BuildRESTFunction<typeof listSiteSchemas$1> & typeof listSiteSchemas$1>;
81
+ declare const querySchemas: MaybeContext<BuildRESTFunction<typeof customQuerySchemas> & typeof customQuerySchemas>;
102
82
 
103
- export { GetSchemaByKeyIdentifiers, GetSchemaByKeyResponse, ListSiteSchemasOptions, ListSiteSchemasResponse, Schema, SchemasQueryBuilder, UpdateSchema, createSchema, deleteSchema, getSchema, getSchemaByKey, listSiteSchemas, querySchemas, updateSchema };
83
+ export { CursorQuery, GetSchemaByKeyIdentifiers, GetSchemaByKeyResponse, ListSiteSchemasOptions, ListSiteSchemasResponse, QuerySchemasOptions, Schema, SchemasQueryBuilder, UpdateSchema, createSchema, deleteSchema, getSchema, getSchemaByKey, listSiteSchemas, querySchemas, updateSchema };
@@ -569,11 +569,13 @@ async function deleteSchema2(schemaId) {
569
569
  throw transformedError;
570
570
  }
571
571
  }
572
- function querySchemas2() {
573
- const { httpClient, sideEffects } = arguments[0];
572
+ function querySchemas2(options) {
573
+ const { httpClient, sideEffects } = arguments[1];
574
574
  return (0, import_query_builder.queryBuilder)({
575
575
  func: async (payload) => {
576
- const reqOpts = querySchemas(payload);
576
+ const reqOpts = querySchemas(
577
+ { ...payload, ...options ?? {} }
578
+ );
577
579
  sideEffects?.onSiteCall?.();
578
580
  try {
579
581
  const result = await httpClient.request(reqOpts);
@@ -585,7 +587,7 @@ function querySchemas2() {
585
587
  }
586
588
  },
587
589
  requestTransformer: (query) => {
588
- const args = [query, {}];
590
+ const args = [query, options];
589
591
  return (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
590
592
  ...args?.[1],
591
593
  query: args?.[0]
@@ -612,6 +614,32 @@ function querySchemas2() {
612
614
  transformationPaths: {}
613
615
  });
614
616
  }
617
+ async function typedQuerySchemas(query, options) {
618
+ const { httpClient, sideEffects } = arguments[2];
619
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
620
+ query,
621
+ ...options
622
+ });
623
+ const reqOpts = querySchemas(payload);
624
+ sideEffects?.onSiteCall?.();
625
+ try {
626
+ const result = await httpClient.request(reqOpts);
627
+ sideEffects?.onSuccess?.(result);
628
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
629
+ } catch (err) {
630
+ const transformedError = (0, import_transform_error.transformError)(
631
+ err,
632
+ {
633
+ spreadPathsToArguments: {},
634
+ explicitPathsToArguments: { query: "$[0]" },
635
+ singleArgumentUnchanged: false
636
+ },
637
+ ["query", "options"]
638
+ );
639
+ sideEffects?.onError?.(err);
640
+ throw transformedError;
641
+ }
642
+ }
615
643
  async function listSiteSchemas2(options) {
616
644
  const { httpClient, sideEffects } = arguments[1];
617
645
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
@@ -684,7 +712,16 @@ function deleteSchema3(httpClient) {
684
712
  );
685
713
  }
686
714
  function querySchemas3(httpClient) {
687
- return () => querySchemas2(
715
+ return (options) => querySchemas2(
716
+ options,
717
+ // @ts-ignore
718
+ { httpClient }
719
+ );
720
+ }
721
+ function typedQuerySchemas2(httpClient) {
722
+ return (query, options) => typedQuerySchemas(
723
+ query,
724
+ options,
688
725
  // @ts-ignore
689
726
  { httpClient }
690
727
  );
@@ -699,13 +736,25 @@ function listSiteSchemas3(httpClient) {
699
736
 
700
737
  // src/multilingual-translation-v1-schema-translation-schemas.context.ts
701
738
  var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
739
+ var import_query_method_router = require("@wix/sdk-runtime/query-method-router");
740
+ function customQuerySchemas(httpClient) {
741
+ const router = (0, import_query_method_router.createQueryOverloadRouter)({
742
+ builderQueryFunction: (options) => querySchemas3(httpClient)(options),
743
+ typedQueryFunction: (query, options) => typedQuerySchemas2(httpClient)(query, options),
744
+ hasOptionsParameter: true
745
+ });
746
+ function overloadedQuery(queryOrOptions, options) {
747
+ return router(...arguments);
748
+ }
749
+ return overloadedQuery;
750
+ }
702
751
  var createSchema4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createSchema3);
703
752
  var getSchema4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getSchema3);
704
753
  var getSchemaByKey4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getSchemaByKey3);
705
754
  var updateSchema4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateSchema3);
706
755
  var deleteSchema4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deleteSchema3);
707
- var querySchemas4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(querySchemas3);
708
756
  var listSiteSchemas4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(listSiteSchemas3);
757
+ var querySchemas4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(customQuerySchemas);
709
758
  // Annotate the CommonJS export names for ESM import in node:
710
759
  0 && (module.exports = {
711
760
  DeleteStatus,