@wix/auto_sdk_data_indexes 1.0.51 → 1.0.52

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.
@@ -2,9 +2,7 @@ import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTF
2
2
  import { Index, ListIndexesOptions, ListIndexesResponse, IndexCreatedEnvelope, IndexDeletedEnvelope, IndexUpdatedEnvelope } from './index.typings.js';
3
3
  export { AccountInfo, AccountInfoMetadata, ActionEvent, BaseEventMetadata, CreateIndexRequest, CreateIndexResponse, DomainEvent, DomainEventBodyOneOf, DropIndexRequest, DropIndexResponse, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, Environment, EnvironmentWithLiterals, EventMetadata, Failure, Field, IdentificationData, IdentificationDataIdOneOf, IndexSource, IndexSourceWithLiterals, ListAvailableIndexesRequest, ListAvailableIndexesResponse, ListIndexesRequest, MessageEnvelope, Order, OrderWithLiterals, Paging, PagingMetadata, RestoreInfo, Status, StatusWithLiterals, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.js';
4
4
 
5
- declare function createIndex$1(httpClient: HttpClient, __options?: {
6
- validateRequestSchema?: boolean;
7
- }): CreateIndexSignature;
5
+ declare function createIndex$1(httpClient: HttpClient): CreateIndexSignature;
8
6
  interface CreateIndexSignature {
9
7
  /**
10
8
  * Creates an index for a data collection.
@@ -21,9 +19,7 @@ interface CreateIndexSignature {
21
19
  */
22
20
  (dataCollectionId: string, index: NonNullablePaths<Index, `fields` | `fields.${number}.path` | `name`, 4>): Promise<NonNullablePaths<Index, `_id` | `name` | `fields` | `fields.${number}.path` | `fields.${number}.order` | `status` | `failure.code` | `failure.description` | `unique` | `caseInsensitive` | `source`, 4>>;
23
21
  }
24
- declare function dropIndex$1(httpClient: HttpClient, __options?: {
25
- validateRequestSchema?: boolean;
26
- }): DropIndexSignature;
22
+ declare function dropIndex$1(httpClient: HttpClient): DropIndexSignature;
27
23
  interface DropIndexSignature {
28
24
  /**
29
25
  * Removes an index from a data collection.
@@ -36,9 +32,7 @@ interface DropIndexSignature {
36
32
  */
37
33
  (dataCollectionId: string, indexName: string): Promise<void>;
38
34
  }
39
- declare function listIndexes$1(httpClient: HttpClient, __options?: {
40
- validateRequestSchema?: boolean;
41
- }): ListIndexesSignature;
35
+ declare function listIndexes$1(httpClient: HttpClient): ListIndexesSignature;
42
36
  interface ListIndexesSignature {
43
37
  /**
44
38
  * Lists all indexes defined for a data collection.
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
6
  var __export = (target, all) => {
9
7
  for (var name in all)
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
17
15
  }
18
16
  return to;
19
17
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
19
 
30
20
  // index.ts
@@ -501,168 +491,6 @@ function listAvailableIndexes(payload) {
501
491
  return __listAvailableIndexes;
502
492
  }
503
493
 
504
- // src/data-v2-index-indexes.schemas.ts
505
- var z = __toESM(require("zod"));
506
- var CreateIndexRequest = z.object({
507
- dataCollectionId: z.string().describe("ID of the data collection for which to generate the index.").max(256),
508
- index: z.object({
509
- _id: z.string().describe("ID of the index.").regex(
510
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
511
- "Must be a valid GUID"
512
- ).optional(),
513
- name: z.string().describe("Name of the index.").min(1).max(128),
514
- fields: z.array(
515
- z.object({
516
- path: z.string().describe(
517
- "Path of the field to index. For example: `title` or `options.price`."
518
- ).min(1).max(128),
519
- order: z.enum(["ASC", "DESC"]).optional()
520
- })
521
- ).min(1).max(3),
522
- status: z.enum([
523
- "UNKNOWN",
524
- "BUILDING",
525
- "ACTIVE",
526
- "DROPPING",
527
- "DROPPED",
528
- "FAILED",
529
- "INVALID"
530
- ]).optional(),
531
- failure: z.object({
532
- code: z.string().describe(
533
- "Error code.\n- `WDE0112`: Unknown error while building collection index.\n- `WDE0113`: Duplicate key error while building collection index.\n- `WDE0114`: Document too large while building collection index."
534
- ).max(7).optional(),
535
- description: z.string().describe("Description of the failure.").max(1024).optional(),
536
- itemId: z.string().describe(
537
- "ID of the data item that caused the failure.\nFor example, if `unique` is `true`, the ID of an item containing a duplicate value."
538
- ).max(16e3).optional().nullable()
539
- }).describe(
540
- "Contains details about the reasons for failure when `status` is `FAILED`."
541
- ).optional(),
542
- unique: z.boolean().describe(
543
- "Whether the index enforces uniqueness of values in the field for which it's defined.\nIf `true`, the index can have only 1 field.\n\nDefault: `false`"
544
- ).optional(),
545
- caseInsensitive: z.boolean().describe("Whether the index ignores case.\n\nDefault: `false`").optional(),
546
- source: z.enum(["SYSTEM", "USER", "AUTO"]).optional()
547
- }).describe("Details of the index to be created.")
548
- });
549
- var CreateIndexResponse = z.object({
550
- _id: z.string().describe("ID of the index.").regex(
551
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
552
- "Must be a valid GUID"
553
- ).optional(),
554
- name: z.string().describe("Name of the index.").min(1).max(128).optional(),
555
- fields: z.array(
556
- z.object({
557
- path: z.string().describe(
558
- "Path of the field to index. For example: `title` or `options.price`."
559
- ).min(1).max(128).optional(),
560
- order: z.enum(["ASC", "DESC"]).describe(
561
- "Sort order for the index. Base on how the data is regularly queried.\n\nDefault: `ASC`"
562
- ).optional()
563
- })
564
- ).min(1).max(3).optional(),
565
- status: z.enum([
566
- "UNKNOWN",
567
- "BUILDING",
568
- "ACTIVE",
569
- "DROPPING",
570
- "DROPPED",
571
- "FAILED",
572
- "INVALID"
573
- ]).describe("Current status of the index.").optional(),
574
- failure: z.object({
575
- code: z.string().describe(
576
- "Error code.\n- `WDE0112`: Unknown error while building collection index.\n- `WDE0113`: Duplicate key error while building collection index.\n- `WDE0114`: Document too large while building collection index."
577
- ).max(7).optional(),
578
- description: z.string().describe("Description of the failure.").max(1024).optional(),
579
- itemId: z.string().describe(
580
- "ID of the data item that caused the failure.\nFor example, if `unique` is `true`, the ID of an item containing a duplicate value."
581
- ).max(16e3).optional().nullable()
582
- }).describe(
583
- "Contains details about the reasons for failure when `status` is `FAILED`."
584
- ).optional(),
585
- unique: z.boolean().describe(
586
- "Whether the index enforces uniqueness of values in the field for which it's defined.\nIf `true`, the index can have only 1 field.\n\nDefault: `false`"
587
- ).optional(),
588
- caseInsensitive: z.boolean().describe("Whether the index ignores case.\n\nDefault: `false`").optional(),
589
- source: z.enum(["SYSTEM", "USER", "AUTO"]).describe(
590
- "Source of the index. See index sources in [Index Types](https://dev.wix.com/docs/api-reference/business-solutions/cms/indexes/index-types#index-sources).\n\nDefault: `USER`"
591
- ).optional()
592
- });
593
- var DropIndexRequest = z.object({
594
- dataCollectionId: z.string().describe(
595
- "ID of the data collection for which the index to be dropped is defined."
596
- ).max(1024),
597
- indexName: z.string().describe("Name of the index to drop.").min(1).max(128)
598
- });
599
- var DropIndexResponse = z.object({});
600
- var ListIndexesRequest = z.object({
601
- dataCollectionId: z.string().describe("ID of the data collection for which to list indexes.").max(1024),
602
- options: z.object({
603
- paging: z.object({
604
- limit: z.number().int().describe("Number of items to load.").min(0).optional().nullable(),
605
- offset: z.number().int().describe("Number of items to skip in the current sort order.").min(0).optional().nullable()
606
- }).describe("Paging options to limit and skip the number of items.").optional()
607
- }).describe("Options for retrieving a list of indexes.").optional()
608
- });
609
- var ListIndexesResponse = z.object({
610
- indexes: z.array(
611
- z.object({
612
- _id: z.string().describe("ID of the index.").regex(
613
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
614
- "Must be a valid GUID"
615
- ).optional(),
616
- name: z.string().describe("Name of the index.").min(1).max(128).optional(),
617
- fields: z.array(
618
- z.object({
619
- path: z.string().describe(
620
- "Path of the field to index. For example: `title` or `options.price`."
621
- ).min(1).max(128).optional(),
622
- order: z.enum(["ASC", "DESC"]).describe(
623
- "Sort order for the index. Base on how the data is regularly queried.\n\nDefault: `ASC`"
624
- ).optional()
625
- })
626
- ).min(1).max(3).optional(),
627
- status: z.enum([
628
- "UNKNOWN",
629
- "BUILDING",
630
- "ACTIVE",
631
- "DROPPING",
632
- "DROPPED",
633
- "FAILED",
634
- "INVALID"
635
- ]).describe("Current status of the index.").optional(),
636
- failure: z.object({
637
- code: z.string().describe(
638
- "Error code.\n- `WDE0112`: Unknown error while building collection index.\n- `WDE0113`: Duplicate key error while building collection index.\n- `WDE0114`: Document too large while building collection index."
639
- ).max(7).optional(),
640
- description: z.string().describe("Description of the failure.").max(1024).optional(),
641
- itemId: z.string().describe(
642
- "ID of the data item that caused the failure.\nFor example, if `unique` is `true`, the ID of an item containing a duplicate value."
643
- ).max(16e3).optional().nullable()
644
- }).describe(
645
- "Contains details about the reasons for failure when `status` is `FAILED`."
646
- ).optional(),
647
- unique: z.boolean().describe(
648
- "Whether the index enforces uniqueness of values in the field for which it's defined.\nIf `true`, the index can have only 1 field.\n\nDefault: `false`"
649
- ).optional(),
650
- caseInsensitive: z.boolean().describe("Whether the index ignores case.\n\nDefault: `false`").optional(),
651
- source: z.enum(["SYSTEM", "USER", "AUTO"]).describe(
652
- "Source of the index. See index sources in [Index Types](https://dev.wix.com/docs/api-reference/business-solutions/cms/indexes/index-types#index-sources).\n\nDefault: `USER`"
653
- ).optional()
654
- })
655
- ).optional(),
656
- pagingMetadata: z.object({
657
- count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
658
- offset: z.number().int().describe("Offset that was requested.").optional().nullable(),
659
- total: z.number().int().describe("Total number of items that match the query.").optional().nullable(),
660
- tooManyToCount: z.boolean().describe(
661
- "Flag that indicates the server failed to calculate the `total` field."
662
- ).optional().nullable()
663
- }).describe("Paging metadata.").optional()
664
- });
665
-
666
494
  // src/data-v2-index-indexes.universal.ts
667
495
  var Order = /* @__PURE__ */ ((Order2) => {
668
496
  Order2["ASC"] = "ASC";
@@ -700,10 +528,7 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
700
528
  return WebhookIdentityType2;
701
529
  })(WebhookIdentityType || {});
702
530
  async function createIndex2(dataCollectionId, index) {
703
- const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
704
- if (validateRequestSchema) {
705
- CreateIndexRequest.parse({ dataCollectionId, index });
706
- }
531
+ const { httpClient, sideEffects } = arguments[2];
707
532
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
708
533
  dataCollectionId,
709
534
  index
@@ -729,10 +554,7 @@ async function createIndex2(dataCollectionId, index) {
729
554
  }
730
555
  }
731
556
  async function dropIndex2(dataCollectionId, indexName) {
732
- const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
733
- if (validateRequestSchema) {
734
- DropIndexRequest.parse({ dataCollectionId, indexName });
735
- }
557
+ const { httpClient, sideEffects } = arguments[2];
736
558
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
737
559
  dataCollectionId,
738
560
  indexName
@@ -760,10 +582,7 @@ async function dropIndex2(dataCollectionId, indexName) {
760
582
  }
761
583
  }
762
584
  async function listIndexes2(dataCollectionId, options) {
763
- const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
764
- if (validateRequestSchema) {
765
- ListIndexesRequest.parse({ dataCollectionId, options });
766
- }
585
+ const { httpClient, sideEffects } = arguments[2];
767
586
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
768
587
  dataCollectionId,
769
588
  paging: options?.paging
@@ -818,35 +637,35 @@ async function listAvailableIndexes2(dataCollectionId) {
818
637
  }
819
638
 
820
639
  // src/data-v2-index-indexes.public.ts
821
- function createIndex3(httpClient, __options) {
640
+ function createIndex3(httpClient) {
822
641
  return (dataCollectionId, index) => createIndex2(
823
642
  dataCollectionId,
824
643
  index,
825
644
  // @ts-ignore
826
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
645
+ { httpClient }
827
646
  );
828
647
  }
829
- function dropIndex3(httpClient, __options) {
648
+ function dropIndex3(httpClient) {
830
649
  return (dataCollectionId, indexName) => dropIndex2(
831
650
  dataCollectionId,
832
651
  indexName,
833
652
  // @ts-ignore
834
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
653
+ { httpClient }
835
654
  );
836
655
  }
837
- function listIndexes3(httpClient, __options) {
656
+ function listIndexes3(httpClient) {
838
657
  return (dataCollectionId, options) => listIndexes2(
839
658
  dataCollectionId,
840
659
  options,
841
660
  // @ts-ignore
842
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
661
+ { httpClient }
843
662
  );
844
663
  }
845
- function listAvailableIndexes3(httpClient, __options) {
664
+ function listAvailableIndexes3(httpClient) {
846
665
  return (dataCollectionId) => listAvailableIndexes2(
847
666
  dataCollectionId,
848
667
  // @ts-ignore
849
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
668
+ { httpClient }
850
669
  );
851
670
  }
852
671
  var onIndexCreated = (0, import_sdk_types.EventDefinition)(