@wix/auto_sdk_data_indexes 1.0.48 → 1.0.49

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.
@@ -0,0 +1,125 @@
1
+ import * as z from 'zod';
2
+
3
+ declare const CreateIndexRequest: z.ZodObject<{
4
+ dataCollectionId: z.ZodString;
5
+ index: z.ZodObject<{
6
+ _id: z.ZodOptional<z.ZodString>;
7
+ name: z.ZodString;
8
+ fields: z.ZodArray<z.ZodObject<{
9
+ path: z.ZodString;
10
+ order: z.ZodOptional<z.ZodEnum<{
11
+ ASC: "ASC";
12
+ DESC: "DESC";
13
+ }>>;
14
+ }, z.core.$strip>>;
15
+ status: z.ZodOptional<z.ZodEnum<{
16
+ UNKNOWN: "UNKNOWN";
17
+ BUILDING: "BUILDING";
18
+ ACTIVE: "ACTIVE";
19
+ DROPPING: "DROPPING";
20
+ DROPPED: "DROPPED";
21
+ FAILED: "FAILED";
22
+ INVALID: "INVALID";
23
+ }>>;
24
+ failure: z.ZodOptional<z.ZodObject<{
25
+ code: z.ZodOptional<z.ZodString>;
26
+ description: z.ZodOptional<z.ZodString>;
27
+ itemId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
28
+ }, z.core.$strip>>;
29
+ unique: z.ZodOptional<z.ZodBoolean>;
30
+ caseInsensitive: z.ZodOptional<z.ZodBoolean>;
31
+ source: z.ZodOptional<z.ZodEnum<{
32
+ SYSTEM: "SYSTEM";
33
+ USER: "USER";
34
+ AUTO: "AUTO";
35
+ }>>;
36
+ }, z.core.$strip>;
37
+ }, z.core.$strip>;
38
+ declare const CreateIndexResponse: z.ZodObject<{
39
+ _id: z.ZodOptional<z.ZodString>;
40
+ name: z.ZodOptional<z.ZodString>;
41
+ fields: z.ZodOptional<z.ZodArray<z.ZodObject<{
42
+ path: z.ZodOptional<z.ZodString>;
43
+ order: z.ZodOptional<z.ZodEnum<{
44
+ ASC: "ASC";
45
+ DESC: "DESC";
46
+ }>>;
47
+ }, z.core.$strip>>>;
48
+ status: z.ZodOptional<z.ZodEnum<{
49
+ UNKNOWN: "UNKNOWN";
50
+ BUILDING: "BUILDING";
51
+ ACTIVE: "ACTIVE";
52
+ DROPPING: "DROPPING";
53
+ DROPPED: "DROPPED";
54
+ FAILED: "FAILED";
55
+ INVALID: "INVALID";
56
+ }>>;
57
+ failure: z.ZodOptional<z.ZodObject<{
58
+ code: z.ZodOptional<z.ZodString>;
59
+ description: z.ZodOptional<z.ZodString>;
60
+ itemId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
61
+ }, z.core.$strip>>;
62
+ unique: z.ZodOptional<z.ZodBoolean>;
63
+ caseInsensitive: z.ZodOptional<z.ZodBoolean>;
64
+ source: z.ZodOptional<z.ZodEnum<{
65
+ SYSTEM: "SYSTEM";
66
+ USER: "USER";
67
+ AUTO: "AUTO";
68
+ }>>;
69
+ }, z.core.$strip>;
70
+ declare const DropIndexRequest: z.ZodObject<{
71
+ dataCollectionId: z.ZodString;
72
+ indexName: z.ZodString;
73
+ }, z.core.$strip>;
74
+ declare const DropIndexResponse: z.ZodObject<{}, z.core.$strip>;
75
+ declare const ListIndexesRequest: z.ZodObject<{
76
+ dataCollectionId: z.ZodString;
77
+ options: z.ZodOptional<z.ZodObject<{
78
+ paging: z.ZodOptional<z.ZodObject<{
79
+ limit: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
80
+ offset: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
81
+ }, z.core.$strip>>;
82
+ }, z.core.$strip>>;
83
+ }, z.core.$strip>;
84
+ declare const ListIndexesResponse: z.ZodObject<{
85
+ indexes: z.ZodOptional<z.ZodArray<z.ZodObject<{
86
+ _id: z.ZodOptional<z.ZodString>;
87
+ name: z.ZodOptional<z.ZodString>;
88
+ fields: z.ZodOptional<z.ZodArray<z.ZodObject<{
89
+ path: z.ZodOptional<z.ZodString>;
90
+ order: z.ZodOptional<z.ZodEnum<{
91
+ ASC: "ASC";
92
+ DESC: "DESC";
93
+ }>>;
94
+ }, z.core.$strip>>>;
95
+ status: z.ZodOptional<z.ZodEnum<{
96
+ UNKNOWN: "UNKNOWN";
97
+ BUILDING: "BUILDING";
98
+ ACTIVE: "ACTIVE";
99
+ DROPPING: "DROPPING";
100
+ DROPPED: "DROPPED";
101
+ FAILED: "FAILED";
102
+ INVALID: "INVALID";
103
+ }>>;
104
+ failure: z.ZodOptional<z.ZodObject<{
105
+ code: z.ZodOptional<z.ZodString>;
106
+ description: z.ZodOptional<z.ZodString>;
107
+ itemId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
108
+ }, z.core.$strip>>;
109
+ unique: z.ZodOptional<z.ZodBoolean>;
110
+ caseInsensitive: z.ZodOptional<z.ZodBoolean>;
111
+ source: z.ZodOptional<z.ZodEnum<{
112
+ SYSTEM: "SYSTEM";
113
+ USER: "USER";
114
+ AUTO: "AUTO";
115
+ }>>;
116
+ }, z.core.$strip>>>;
117
+ pagingMetadata: z.ZodOptional<z.ZodObject<{
118
+ count: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
119
+ offset: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
120
+ total: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
121
+ tooManyToCount: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
122
+ }, z.core.$strip>>;
123
+ }, z.core.$strip>;
124
+
125
+ export { CreateIndexRequest, CreateIndexResponse, DropIndexRequest, DropIndexResponse, ListIndexesRequest, ListIndexesResponse };
@@ -0,0 +1,212 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
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
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // schemas.ts
31
+ var schemas_exports = {};
32
+ __export(schemas_exports, {
33
+ CreateIndexRequest: () => CreateIndexRequest,
34
+ CreateIndexResponse: () => CreateIndexResponse,
35
+ DropIndexRequest: () => DropIndexRequest,
36
+ DropIndexResponse: () => DropIndexResponse,
37
+ ListIndexesRequest: () => ListIndexesRequest,
38
+ ListIndexesResponse: () => ListIndexesResponse
39
+ });
40
+ module.exports = __toCommonJS(schemas_exports);
41
+
42
+ // src/data-v2-index-indexes.schemas.ts
43
+ var z = __toESM(require("zod"));
44
+ var CreateIndexRequest = z.object({
45
+ dataCollectionId: z.string().describe("ID of the data collection for which to generate the index.").max(256),
46
+ index: z.object({
47
+ _id: z.string().describe("ID of the index.").regex(
48
+ /^[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}$/,
49
+ "Must be a valid GUID"
50
+ ).optional(),
51
+ name: z.string().describe("Name of the index.").min(1).max(128),
52
+ fields: z.array(
53
+ z.object({
54
+ path: z.string().describe(
55
+ "Path of the field to index. For example: `title` or `options.price`."
56
+ ).min(1).max(128),
57
+ order: z.enum(["ASC", "DESC"]).optional()
58
+ })
59
+ ).min(1).max(3),
60
+ status: z.enum([
61
+ "UNKNOWN",
62
+ "BUILDING",
63
+ "ACTIVE",
64
+ "DROPPING",
65
+ "DROPPED",
66
+ "FAILED",
67
+ "INVALID"
68
+ ]).optional(),
69
+ failure: z.object({
70
+ code: z.string().describe(
71
+ "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."
72
+ ).max(7).optional(),
73
+ description: z.string().describe("Description of the failure.").max(1024).optional(),
74
+ itemId: z.string().describe(
75
+ "ID of the data item that caused the failure.\nFor example, if `unique` is `true`, the ID of an item containing a duplicate value."
76
+ ).max(16e3).optional().nullable()
77
+ }).describe(
78
+ "Contains details about the reasons for failure when `status` is `FAILED`."
79
+ ).optional(),
80
+ unique: z.boolean().describe(
81
+ "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`"
82
+ ).optional(),
83
+ caseInsensitive: z.boolean().describe("Whether the index ignores case.\n\nDefault: `false`").optional(),
84
+ source: z.enum(["SYSTEM", "USER", "AUTO"]).optional()
85
+ }).describe("Details of the index to be created.")
86
+ });
87
+ var CreateIndexResponse = z.object({
88
+ _id: z.string().describe("ID of the index.").regex(
89
+ /^[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}$/,
90
+ "Must be a valid GUID"
91
+ ).optional(),
92
+ name: z.string().describe("Name of the index.").min(1).max(128).optional(),
93
+ fields: z.array(
94
+ z.object({
95
+ path: z.string().describe(
96
+ "Path of the field to index. For example: `title` or `options.price`."
97
+ ).min(1).max(128).optional(),
98
+ order: z.enum(["ASC", "DESC"]).describe(
99
+ "Sort order for the index. Base on how the data is regularly queried.\n\nDefault: `ASC`"
100
+ ).optional()
101
+ })
102
+ ).min(1).max(3).optional(),
103
+ status: z.enum([
104
+ "UNKNOWN",
105
+ "BUILDING",
106
+ "ACTIVE",
107
+ "DROPPING",
108
+ "DROPPED",
109
+ "FAILED",
110
+ "INVALID"
111
+ ]).describe("Current status of the index.").optional(),
112
+ failure: z.object({
113
+ code: z.string().describe(
114
+ "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."
115
+ ).max(7).optional(),
116
+ description: z.string().describe("Description of the failure.").max(1024).optional(),
117
+ itemId: z.string().describe(
118
+ "ID of the data item that caused the failure.\nFor example, if `unique` is `true`, the ID of an item containing a duplicate value."
119
+ ).max(16e3).optional().nullable()
120
+ }).describe(
121
+ "Contains details about the reasons for failure when `status` is `FAILED`."
122
+ ).optional(),
123
+ unique: z.boolean().describe(
124
+ "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`"
125
+ ).optional(),
126
+ caseInsensitive: z.boolean().describe("Whether the index ignores case.\n\nDefault: `false`").optional(),
127
+ source: z.enum(["SYSTEM", "USER", "AUTO"]).describe(
128
+ "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`"
129
+ ).optional()
130
+ });
131
+ var DropIndexRequest = z.object({
132
+ dataCollectionId: z.string().describe(
133
+ "ID of the data collection for which the index to be dropped is defined."
134
+ ).max(1024),
135
+ indexName: z.string().describe("Name of the index to drop.").min(1).max(128)
136
+ });
137
+ var DropIndexResponse = z.object({});
138
+ var ListIndexesRequest = z.object({
139
+ dataCollectionId: z.string().describe("ID of the data collection for which to list indexes.").max(1024),
140
+ options: z.object({
141
+ paging: z.object({
142
+ limit: z.number().int().describe("Number of items to load.").min(0).optional().nullable(),
143
+ offset: z.number().int().describe("Number of items to skip in the current sort order.").min(0).optional().nullable()
144
+ }).describe("Paging options to limit and skip the number of items.").optional()
145
+ }).describe("Options for retrieving a list of indexes.").optional()
146
+ });
147
+ var ListIndexesResponse = z.object({
148
+ indexes: z.array(
149
+ z.object({
150
+ _id: z.string().describe("ID of the index.").regex(
151
+ /^[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}$/,
152
+ "Must be a valid GUID"
153
+ ).optional(),
154
+ name: z.string().describe("Name of the index.").min(1).max(128).optional(),
155
+ fields: z.array(
156
+ z.object({
157
+ path: z.string().describe(
158
+ "Path of the field to index. For example: `title` or `options.price`."
159
+ ).min(1).max(128).optional(),
160
+ order: z.enum(["ASC", "DESC"]).describe(
161
+ "Sort order for the index. Base on how the data is regularly queried.\n\nDefault: `ASC`"
162
+ ).optional()
163
+ })
164
+ ).min(1).max(3).optional(),
165
+ status: z.enum([
166
+ "UNKNOWN",
167
+ "BUILDING",
168
+ "ACTIVE",
169
+ "DROPPING",
170
+ "DROPPED",
171
+ "FAILED",
172
+ "INVALID"
173
+ ]).describe("Current status of the index.").optional(),
174
+ failure: z.object({
175
+ code: z.string().describe(
176
+ "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."
177
+ ).max(7).optional(),
178
+ description: z.string().describe("Description of the failure.").max(1024).optional(),
179
+ itemId: z.string().describe(
180
+ "ID of the data item that caused the failure.\nFor example, if `unique` is `true`, the ID of an item containing a duplicate value."
181
+ ).max(16e3).optional().nullable()
182
+ }).describe(
183
+ "Contains details about the reasons for failure when `status` is `FAILED`."
184
+ ).optional(),
185
+ unique: z.boolean().describe(
186
+ "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`"
187
+ ).optional(),
188
+ caseInsensitive: z.boolean().describe("Whether the index ignores case.\n\nDefault: `false`").optional(),
189
+ source: z.enum(["SYSTEM", "USER", "AUTO"]).describe(
190
+ "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`"
191
+ ).optional()
192
+ })
193
+ ).optional(),
194
+ pagingMetadata: z.object({
195
+ count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
196
+ offset: z.number().int().describe("Offset that was requested.").optional().nullable(),
197
+ total: z.number().int().describe("Total number of items that match the query.").optional().nullable(),
198
+ tooManyToCount: z.boolean().describe(
199
+ "Flag that indicates the server failed to calculate the `total` field."
200
+ ).optional().nullable()
201
+ }).describe("Paging metadata.").optional()
202
+ });
203
+ // Annotate the CommonJS export names for ESM import in node:
204
+ 0 && (module.exports = {
205
+ CreateIndexRequest,
206
+ CreateIndexResponse,
207
+ DropIndexRequest,
208
+ DropIndexResponse,
209
+ ListIndexesRequest,
210
+ ListIndexesResponse
211
+ });
212
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../schemas.ts","../../src/data-v2-index-indexes.schemas.ts"],"sourcesContent":["export * from './src/data-v2-index-indexes.schemas.js';\n","import * as z from 'zod';\n\nexport const CreateIndexRequest = z.object({\n dataCollectionId: z\n .string()\n .describe('ID of the data collection for which to generate the index.')\n .max(256),\n index: z\n .object({\n _id: z\n .string()\n .describe('ID of the index.')\n .regex(\n /^[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}$/,\n 'Must be a valid GUID'\n )\n .optional(),\n name: z.string().describe('Name of the index.').min(1).max(128),\n fields: z\n .array(\n z.object({\n path: z\n .string()\n .describe(\n 'Path of the field to index. For example: `title` or `options.price`.'\n )\n .min(1)\n .max(128),\n order: z.enum(['ASC', 'DESC']).optional(),\n })\n )\n .min(1)\n .max(3),\n status: z\n .enum([\n 'UNKNOWN',\n 'BUILDING',\n 'ACTIVE',\n 'DROPPING',\n 'DROPPED',\n 'FAILED',\n 'INVALID',\n ])\n .optional(),\n failure: z\n .object({\n code: z\n .string()\n .describe(\n '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.'\n )\n .max(7)\n .optional(),\n description: z\n .string()\n .describe('Description of the failure.')\n .max(1024)\n .optional(),\n itemId: z\n .string()\n .describe(\n 'ID of the data item that caused the failure.\\nFor example, if `unique` is `true`, the ID of an item containing a duplicate value.'\n )\n .max(16000)\n .optional()\n .nullable(),\n })\n .describe(\n 'Contains details about the reasons for failure when `status` is `FAILED`.'\n )\n .optional(),\n unique: z\n .boolean()\n .describe(\n \"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`\"\n )\n .optional(),\n caseInsensitive: z\n .boolean()\n .describe('Whether the index ignores case.\\n\\nDefault: `false`')\n .optional(),\n source: z.enum(['SYSTEM', 'USER', 'AUTO']).optional(),\n })\n .describe('Details of the index to be created.'),\n});\nexport const CreateIndexResponse = z.object({\n _id: z\n .string()\n .describe('ID of the index.')\n .regex(\n /^[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}$/,\n 'Must be a valid GUID'\n )\n .optional(),\n name: z.string().describe('Name of the index.').min(1).max(128).optional(),\n fields: z\n .array(\n z.object({\n path: z\n .string()\n .describe(\n 'Path of the field to index. For example: `title` or `options.price`.'\n )\n .min(1)\n .max(128)\n .optional(),\n order: z\n .enum(['ASC', 'DESC'])\n .describe(\n 'Sort order for the index. Base on how the data is regularly queried.\\n\\nDefault: `ASC`'\n )\n .optional(),\n })\n )\n .min(1)\n .max(3)\n .optional(),\n status: z\n .enum([\n 'UNKNOWN',\n 'BUILDING',\n 'ACTIVE',\n 'DROPPING',\n 'DROPPED',\n 'FAILED',\n 'INVALID',\n ])\n .describe('Current status of the index.')\n .optional(),\n failure: z\n .object({\n code: z\n .string()\n .describe(\n '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.'\n )\n .max(7)\n .optional(),\n description: z\n .string()\n .describe('Description of the failure.')\n .max(1024)\n .optional(),\n itemId: z\n .string()\n .describe(\n 'ID of the data item that caused the failure.\\nFor example, if `unique` is `true`, the ID of an item containing a duplicate value.'\n )\n .max(16000)\n .optional()\n .nullable(),\n })\n .describe(\n 'Contains details about the reasons for failure when `status` is `FAILED`.'\n )\n .optional(),\n unique: z\n .boolean()\n .describe(\n \"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`\"\n )\n .optional(),\n caseInsensitive: z\n .boolean()\n .describe('Whether the index ignores case.\\n\\nDefault: `false`')\n .optional(),\n source: z\n .enum(['SYSTEM', 'USER', 'AUTO'])\n .describe(\n '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`'\n )\n .optional(),\n});\nexport const DropIndexRequest = z.object({\n dataCollectionId: z\n .string()\n .describe(\n 'ID of the data collection for which the index to be dropped is defined.'\n )\n .max(1024),\n indexName: z.string().describe('Name of the index to drop.').min(1).max(128),\n});\nexport const DropIndexResponse = z.object({});\nexport const ListIndexesRequest = z.object({\n dataCollectionId: z\n .string()\n .describe('ID of the data collection for which to list indexes.')\n .max(1024),\n options: z\n .object({\n paging: z\n .object({\n limit: z\n .number()\n .int()\n .describe('Number of items to load.')\n .min(0)\n .optional()\n .nullable(),\n offset: z\n .number()\n .int()\n .describe('Number of items to skip in the current sort order.')\n .min(0)\n .optional()\n .nullable(),\n })\n .describe('Paging options to limit and skip the number of items.')\n .optional(),\n })\n .describe('Options for retrieving a list of indexes.')\n .optional(),\n});\nexport const ListIndexesResponse = z.object({\n indexes: z\n .array(\n z.object({\n _id: z\n .string()\n .describe('ID of the index.')\n .regex(\n /^[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}$/,\n 'Must be a valid GUID'\n )\n .optional(),\n name: z\n .string()\n .describe('Name of the index.')\n .min(1)\n .max(128)\n .optional(),\n fields: z\n .array(\n z.object({\n path: z\n .string()\n .describe(\n 'Path of the field to index. For example: `title` or `options.price`.'\n )\n .min(1)\n .max(128)\n .optional(),\n order: z\n .enum(['ASC', 'DESC'])\n .describe(\n 'Sort order for the index. Base on how the data is regularly queried.\\n\\nDefault: `ASC`'\n )\n .optional(),\n })\n )\n .min(1)\n .max(3)\n .optional(),\n status: z\n .enum([\n 'UNKNOWN',\n 'BUILDING',\n 'ACTIVE',\n 'DROPPING',\n 'DROPPED',\n 'FAILED',\n 'INVALID',\n ])\n .describe('Current status of the index.')\n .optional(),\n failure: z\n .object({\n code: z\n .string()\n .describe(\n '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.'\n )\n .max(7)\n .optional(),\n description: z\n .string()\n .describe('Description of the failure.')\n .max(1024)\n .optional(),\n itemId: z\n .string()\n .describe(\n 'ID of the data item that caused the failure.\\nFor example, if `unique` is `true`, the ID of an item containing a duplicate value.'\n )\n .max(16000)\n .optional()\n .nullable(),\n })\n .describe(\n 'Contains details about the reasons for failure when `status` is `FAILED`.'\n )\n .optional(),\n unique: z\n .boolean()\n .describe(\n \"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`\"\n )\n .optional(),\n caseInsensitive: z\n .boolean()\n .describe('Whether the index ignores case.\\n\\nDefault: `false`')\n .optional(),\n source: z\n .enum(['SYSTEM', 'USER', 'AUTO'])\n .describe(\n '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`'\n )\n .optional(),\n })\n )\n .optional(),\n pagingMetadata: z\n .object({\n count: z\n .number()\n .int()\n .describe('Number of items returned in the response.')\n .optional()\n .nullable(),\n offset: z\n .number()\n .int()\n .describe('Offset that was requested.')\n .optional()\n .nullable(),\n total: z\n .number()\n .int()\n .describe('Total number of items that match the query.')\n .optional()\n .nullable(),\n tooManyToCount: z\n .boolean()\n .describe(\n 'Flag that indicates the server failed to calculate the `total` field.'\n )\n .optional()\n .nullable(),\n })\n .describe('Paging metadata.')\n .optional(),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,QAAmB;AAEZ,IAAM,qBAAuB,SAAO;AAAA,EACzC,kBACG,SAAO,EACP,SAAS,4DAA4D,EACrE,IAAI,GAAG;AAAA,EACV,OACG,SAAO;AAAA,IACN,KACG,SAAO,EACP,SAAS,kBAAkB,EAC3B;AAAA,MACC;AAAA,MACA;AAAA,IACF,EACC,SAAS;AAAA,IACZ,MAAQ,SAAO,EAAE,SAAS,oBAAoB,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,IAC9D,QACG;AAAA,MACG,SAAO;AAAA,QACP,MACG,SAAO,EACP;AAAA,UACC;AAAA,QACF,EACC,IAAI,CAAC,EACL,IAAI,GAAG;AAAA,QACV,OAAS,OAAK,CAAC,OAAO,MAAM,CAAC,EAAE,SAAS;AAAA,MAC1C,CAAC;AAAA,IACH,EACC,IAAI,CAAC,EACL,IAAI,CAAC;AAAA,IACR,QACG,OAAK;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC,EACA,SAAS;AAAA,IACZ,SACG,SAAO;AAAA,MACN,MACG,SAAO,EACP;AAAA,QACC;AAAA,MACF,EACC,IAAI,CAAC,EACL,SAAS;AAAA,MACZ,aACG,SAAO,EACP,SAAS,6BAA6B,EACtC,IAAI,IAAI,EACR,SAAS;AAAA,MACZ,QACG,SAAO,EACP;AAAA,QACC;AAAA,MAC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,IACF,EACC,SAAS,EACT,SAAS;AAAA,EACd,CAAC,EACA,SAAS,kBAAkB,EAC3B,SAAS;AACd,CAAC;","names":[]}
@@ -0,0 +1,125 @@
1
+ import * as z from 'zod';
2
+
3
+ declare const CreateIndexRequest: z.ZodObject<{
4
+ dataCollectionId: z.ZodString;
5
+ index: z.ZodObject<{
6
+ _id: z.ZodOptional<z.ZodString>;
7
+ name: z.ZodString;
8
+ fields: z.ZodArray<z.ZodObject<{
9
+ path: z.ZodString;
10
+ order: z.ZodOptional<z.ZodEnum<{
11
+ ASC: "ASC";
12
+ DESC: "DESC";
13
+ }>>;
14
+ }, z.core.$strip>>;
15
+ status: z.ZodOptional<z.ZodEnum<{
16
+ UNKNOWN: "UNKNOWN";
17
+ BUILDING: "BUILDING";
18
+ ACTIVE: "ACTIVE";
19
+ DROPPING: "DROPPING";
20
+ DROPPED: "DROPPED";
21
+ FAILED: "FAILED";
22
+ INVALID: "INVALID";
23
+ }>>;
24
+ failure: z.ZodOptional<z.ZodObject<{
25
+ code: z.ZodOptional<z.ZodString>;
26
+ description: z.ZodOptional<z.ZodString>;
27
+ itemId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
28
+ }, z.core.$strip>>;
29
+ unique: z.ZodOptional<z.ZodBoolean>;
30
+ caseInsensitive: z.ZodOptional<z.ZodBoolean>;
31
+ source: z.ZodOptional<z.ZodEnum<{
32
+ SYSTEM: "SYSTEM";
33
+ USER: "USER";
34
+ AUTO: "AUTO";
35
+ }>>;
36
+ }, z.core.$strip>;
37
+ }, z.core.$strip>;
38
+ declare const CreateIndexResponse: z.ZodObject<{
39
+ _id: z.ZodOptional<z.ZodString>;
40
+ name: z.ZodOptional<z.ZodString>;
41
+ fields: z.ZodOptional<z.ZodArray<z.ZodObject<{
42
+ path: z.ZodOptional<z.ZodString>;
43
+ order: z.ZodOptional<z.ZodEnum<{
44
+ ASC: "ASC";
45
+ DESC: "DESC";
46
+ }>>;
47
+ }, z.core.$strip>>>;
48
+ status: z.ZodOptional<z.ZodEnum<{
49
+ UNKNOWN: "UNKNOWN";
50
+ BUILDING: "BUILDING";
51
+ ACTIVE: "ACTIVE";
52
+ DROPPING: "DROPPING";
53
+ DROPPED: "DROPPED";
54
+ FAILED: "FAILED";
55
+ INVALID: "INVALID";
56
+ }>>;
57
+ failure: z.ZodOptional<z.ZodObject<{
58
+ code: z.ZodOptional<z.ZodString>;
59
+ description: z.ZodOptional<z.ZodString>;
60
+ itemId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
61
+ }, z.core.$strip>>;
62
+ unique: z.ZodOptional<z.ZodBoolean>;
63
+ caseInsensitive: z.ZodOptional<z.ZodBoolean>;
64
+ source: z.ZodOptional<z.ZodEnum<{
65
+ SYSTEM: "SYSTEM";
66
+ USER: "USER";
67
+ AUTO: "AUTO";
68
+ }>>;
69
+ }, z.core.$strip>;
70
+ declare const DropIndexRequest: z.ZodObject<{
71
+ dataCollectionId: z.ZodString;
72
+ indexName: z.ZodString;
73
+ }, z.core.$strip>;
74
+ declare const DropIndexResponse: z.ZodObject<{}, z.core.$strip>;
75
+ declare const ListIndexesRequest: z.ZodObject<{
76
+ dataCollectionId: z.ZodString;
77
+ options: z.ZodOptional<z.ZodObject<{
78
+ paging: z.ZodOptional<z.ZodObject<{
79
+ limit: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
80
+ offset: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
81
+ }, z.core.$strip>>;
82
+ }, z.core.$strip>>;
83
+ }, z.core.$strip>;
84
+ declare const ListIndexesResponse: z.ZodObject<{
85
+ indexes: z.ZodOptional<z.ZodArray<z.ZodObject<{
86
+ _id: z.ZodOptional<z.ZodString>;
87
+ name: z.ZodOptional<z.ZodString>;
88
+ fields: z.ZodOptional<z.ZodArray<z.ZodObject<{
89
+ path: z.ZodOptional<z.ZodString>;
90
+ order: z.ZodOptional<z.ZodEnum<{
91
+ ASC: "ASC";
92
+ DESC: "DESC";
93
+ }>>;
94
+ }, z.core.$strip>>>;
95
+ status: z.ZodOptional<z.ZodEnum<{
96
+ UNKNOWN: "UNKNOWN";
97
+ BUILDING: "BUILDING";
98
+ ACTIVE: "ACTIVE";
99
+ DROPPING: "DROPPING";
100
+ DROPPED: "DROPPED";
101
+ FAILED: "FAILED";
102
+ INVALID: "INVALID";
103
+ }>>;
104
+ failure: z.ZodOptional<z.ZodObject<{
105
+ code: z.ZodOptional<z.ZodString>;
106
+ description: z.ZodOptional<z.ZodString>;
107
+ itemId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
108
+ }, z.core.$strip>>;
109
+ unique: z.ZodOptional<z.ZodBoolean>;
110
+ caseInsensitive: z.ZodOptional<z.ZodBoolean>;
111
+ source: z.ZodOptional<z.ZodEnum<{
112
+ SYSTEM: "SYSTEM";
113
+ USER: "USER";
114
+ AUTO: "AUTO";
115
+ }>>;
116
+ }, z.core.$strip>>>;
117
+ pagingMetadata: z.ZodOptional<z.ZodObject<{
118
+ count: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
119
+ offset: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
120
+ total: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
121
+ tooManyToCount: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
122
+ }, z.core.$strip>>;
123
+ }, z.core.$strip>;
124
+
125
+ export { CreateIndexRequest, CreateIndexResponse, DropIndexRequest, DropIndexResponse, ListIndexesRequest, ListIndexesResponse };
@@ -0,0 +1,170 @@
1
+ // src/data-v2-index-indexes.schemas.ts
2
+ import * as z from "zod";
3
+ var CreateIndexRequest = z.object({
4
+ dataCollectionId: z.string().describe("ID of the data collection for which to generate the index.").max(256),
5
+ index: z.object({
6
+ _id: z.string().describe("ID of the index.").regex(
7
+ /^[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}$/,
8
+ "Must be a valid GUID"
9
+ ).optional(),
10
+ name: z.string().describe("Name of the index.").min(1).max(128),
11
+ fields: z.array(
12
+ z.object({
13
+ path: z.string().describe(
14
+ "Path of the field to index. For example: `title` or `options.price`."
15
+ ).min(1).max(128),
16
+ order: z.enum(["ASC", "DESC"]).optional()
17
+ })
18
+ ).min(1).max(3),
19
+ status: z.enum([
20
+ "UNKNOWN",
21
+ "BUILDING",
22
+ "ACTIVE",
23
+ "DROPPING",
24
+ "DROPPED",
25
+ "FAILED",
26
+ "INVALID"
27
+ ]).optional(),
28
+ failure: z.object({
29
+ code: z.string().describe(
30
+ "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."
31
+ ).max(7).optional(),
32
+ description: z.string().describe("Description of the failure.").max(1024).optional(),
33
+ itemId: z.string().describe(
34
+ "ID of the data item that caused the failure.\nFor example, if `unique` is `true`, the ID of an item containing a duplicate value."
35
+ ).max(16e3).optional().nullable()
36
+ }).describe(
37
+ "Contains details about the reasons for failure when `status` is `FAILED`."
38
+ ).optional(),
39
+ unique: z.boolean().describe(
40
+ "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`"
41
+ ).optional(),
42
+ caseInsensitive: z.boolean().describe("Whether the index ignores case.\n\nDefault: `false`").optional(),
43
+ source: z.enum(["SYSTEM", "USER", "AUTO"]).optional()
44
+ }).describe("Details of the index to be created.")
45
+ });
46
+ var CreateIndexResponse = z.object({
47
+ _id: z.string().describe("ID of the index.").regex(
48
+ /^[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}$/,
49
+ "Must be a valid GUID"
50
+ ).optional(),
51
+ name: z.string().describe("Name of the index.").min(1).max(128).optional(),
52
+ fields: z.array(
53
+ z.object({
54
+ path: z.string().describe(
55
+ "Path of the field to index. For example: `title` or `options.price`."
56
+ ).min(1).max(128).optional(),
57
+ order: z.enum(["ASC", "DESC"]).describe(
58
+ "Sort order for the index. Base on how the data is regularly queried.\n\nDefault: `ASC`"
59
+ ).optional()
60
+ })
61
+ ).min(1).max(3).optional(),
62
+ status: z.enum([
63
+ "UNKNOWN",
64
+ "BUILDING",
65
+ "ACTIVE",
66
+ "DROPPING",
67
+ "DROPPED",
68
+ "FAILED",
69
+ "INVALID"
70
+ ]).describe("Current status of the index.").optional(),
71
+ failure: z.object({
72
+ code: z.string().describe(
73
+ "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."
74
+ ).max(7).optional(),
75
+ description: z.string().describe("Description of the failure.").max(1024).optional(),
76
+ itemId: z.string().describe(
77
+ "ID of the data item that caused the failure.\nFor example, if `unique` is `true`, the ID of an item containing a duplicate value."
78
+ ).max(16e3).optional().nullable()
79
+ }).describe(
80
+ "Contains details about the reasons for failure when `status` is `FAILED`."
81
+ ).optional(),
82
+ unique: z.boolean().describe(
83
+ "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`"
84
+ ).optional(),
85
+ caseInsensitive: z.boolean().describe("Whether the index ignores case.\n\nDefault: `false`").optional(),
86
+ source: z.enum(["SYSTEM", "USER", "AUTO"]).describe(
87
+ "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`"
88
+ ).optional()
89
+ });
90
+ var DropIndexRequest = z.object({
91
+ dataCollectionId: z.string().describe(
92
+ "ID of the data collection for which the index to be dropped is defined."
93
+ ).max(1024),
94
+ indexName: z.string().describe("Name of the index to drop.").min(1).max(128)
95
+ });
96
+ var DropIndexResponse = z.object({});
97
+ var ListIndexesRequest = z.object({
98
+ dataCollectionId: z.string().describe("ID of the data collection for which to list indexes.").max(1024),
99
+ options: z.object({
100
+ paging: z.object({
101
+ limit: z.number().int().describe("Number of items to load.").min(0).optional().nullable(),
102
+ offset: z.number().int().describe("Number of items to skip in the current sort order.").min(0).optional().nullable()
103
+ }).describe("Paging options to limit and skip the number of items.").optional()
104
+ }).describe("Options for retrieving a list of indexes.").optional()
105
+ });
106
+ var ListIndexesResponse = z.object({
107
+ indexes: z.array(
108
+ z.object({
109
+ _id: z.string().describe("ID of the index.").regex(
110
+ /^[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}$/,
111
+ "Must be a valid GUID"
112
+ ).optional(),
113
+ name: z.string().describe("Name of the index.").min(1).max(128).optional(),
114
+ fields: z.array(
115
+ z.object({
116
+ path: z.string().describe(
117
+ "Path of the field to index. For example: `title` or `options.price`."
118
+ ).min(1).max(128).optional(),
119
+ order: z.enum(["ASC", "DESC"]).describe(
120
+ "Sort order for the index. Base on how the data is regularly queried.\n\nDefault: `ASC`"
121
+ ).optional()
122
+ })
123
+ ).min(1).max(3).optional(),
124
+ status: z.enum([
125
+ "UNKNOWN",
126
+ "BUILDING",
127
+ "ACTIVE",
128
+ "DROPPING",
129
+ "DROPPED",
130
+ "FAILED",
131
+ "INVALID"
132
+ ]).describe("Current status of the index.").optional(),
133
+ failure: z.object({
134
+ code: z.string().describe(
135
+ "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."
136
+ ).max(7).optional(),
137
+ description: z.string().describe("Description of the failure.").max(1024).optional(),
138
+ itemId: z.string().describe(
139
+ "ID of the data item that caused the failure.\nFor example, if `unique` is `true`, the ID of an item containing a duplicate value."
140
+ ).max(16e3).optional().nullable()
141
+ }).describe(
142
+ "Contains details about the reasons for failure when `status` is `FAILED`."
143
+ ).optional(),
144
+ unique: z.boolean().describe(
145
+ "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`"
146
+ ).optional(),
147
+ caseInsensitive: z.boolean().describe("Whether the index ignores case.\n\nDefault: `false`").optional(),
148
+ source: z.enum(["SYSTEM", "USER", "AUTO"]).describe(
149
+ "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`"
150
+ ).optional()
151
+ })
152
+ ).optional(),
153
+ pagingMetadata: z.object({
154
+ count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
155
+ offset: z.number().int().describe("Offset that was requested.").optional().nullable(),
156
+ total: z.number().int().describe("Total number of items that match the query.").optional().nullable(),
157
+ tooManyToCount: z.boolean().describe(
158
+ "Flag that indicates the server failed to calculate the `total` field."
159
+ ).optional().nullable()
160
+ }).describe("Paging metadata.").optional()
161
+ });
162
+ export {
163
+ CreateIndexRequest,
164
+ CreateIndexResponse,
165
+ DropIndexRequest,
166
+ DropIndexResponse,
167
+ ListIndexesRequest,
168
+ ListIndexesResponse
169
+ };
170
+ //# sourceMappingURL=schemas.mjs.map