@wix/auto_sdk_data_indexes 1.0.0

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.
Files changed (111) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +18 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +18 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +18 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/src/data-v2-index-indexes.context.d.ts +7 -0
  11. package/build/cjs/src/data-v2-index-indexes.context.js +15 -0
  12. package/build/cjs/src/data-v2-index-indexes.context.js.map +1 -0
  13. package/build/cjs/src/data-v2-index-indexes.http.d.ts +30 -0
  14. package/build/cjs/src/data-v2-index-indexes.http.js +433 -0
  15. package/build/cjs/src/data-v2-index-indexes.http.js.map +1 -0
  16. package/build/cjs/src/data-v2-index-indexes.meta.d.ts +16 -0
  17. package/build/cjs/src/data-v2-index-indexes.meta.js +104 -0
  18. package/build/cjs/src/data-v2-index-indexes.meta.js.map +1 -0
  19. package/build/cjs/src/data-v2-index-indexes.public.d.ts +51 -0
  20. package/build/cjs/src/data-v2-index-indexes.public.js +35 -0
  21. package/build/cjs/src/data-v2-index-indexes.public.js.map +1 -0
  22. package/build/cjs/src/data-v2-index-indexes.types.d.ts +181 -0
  23. package/build/cjs/src/data-v2-index-indexes.types.js +36 -0
  24. package/build/cjs/src/data-v2-index-indexes.types.js.map +1 -0
  25. package/build/cjs/src/data-v2-index-indexes.universal.d.ts +247 -0
  26. package/build/cjs/src/data-v2-index-indexes.universal.js +237 -0
  27. package/build/cjs/src/data-v2-index-indexes.universal.js.map +1 -0
  28. package/build/es/index.d.ts +1 -0
  29. package/build/es/index.js +2 -0
  30. package/build/es/index.js.map +1 -0
  31. package/build/es/index.typings.d.ts +1 -0
  32. package/build/es/index.typings.js +2 -0
  33. package/build/es/index.typings.js.map +1 -0
  34. package/build/es/meta.d.ts +1 -0
  35. package/build/es/meta.js +2 -0
  36. package/build/es/meta.js.map +1 -0
  37. package/build/es/package.json +3 -0
  38. package/build/es/src/data-v2-index-indexes.context.d.ts +7 -0
  39. package/build/es/src/data-v2-index-indexes.context.js +9 -0
  40. package/build/es/src/data-v2-index-indexes.context.js.map +1 -0
  41. package/build/es/src/data-v2-index-indexes.http.d.ts +30 -0
  42. package/build/es/src/data-v2-index-indexes.http.js +426 -0
  43. package/build/es/src/data-v2-index-indexes.http.js.map +1 -0
  44. package/build/es/src/data-v2-index-indexes.meta.d.ts +16 -0
  45. package/build/es/src/data-v2-index-indexes.meta.js +74 -0
  46. package/build/es/src/data-v2-index-indexes.meta.js.map +1 -0
  47. package/build/es/src/data-v2-index-indexes.public.d.ts +51 -0
  48. package/build/es/src/data-v2-index-indexes.public.js +25 -0
  49. package/build/es/src/data-v2-index-indexes.public.js.map +1 -0
  50. package/build/es/src/data-v2-index-indexes.types.d.ts +181 -0
  51. package/build/es/src/data-v2-index-indexes.types.js +33 -0
  52. package/build/es/src/data-v2-index-indexes.types.js.map +1 -0
  53. package/build/es/src/data-v2-index-indexes.universal.d.ts +247 -0
  54. package/build/es/src/data-v2-index-indexes.universal.js +207 -0
  55. package/build/es/src/data-v2-index-indexes.universal.js.map +1 -0
  56. package/build/internal/cjs/index.d.ts +1 -0
  57. package/build/internal/cjs/index.js +18 -0
  58. package/build/internal/cjs/index.js.map +1 -0
  59. package/build/internal/cjs/index.typings.d.ts +1 -0
  60. package/build/internal/cjs/index.typings.js +18 -0
  61. package/build/internal/cjs/index.typings.js.map +1 -0
  62. package/build/internal/cjs/meta.d.ts +1 -0
  63. package/build/internal/cjs/meta.js +18 -0
  64. package/build/internal/cjs/meta.js.map +1 -0
  65. package/build/internal/cjs/src/data-v2-index-indexes.context.d.ts +9 -0
  66. package/build/internal/cjs/src/data-v2-index-indexes.context.js +15 -0
  67. package/build/internal/cjs/src/data-v2-index-indexes.context.js.map +1 -0
  68. package/build/internal/cjs/src/data-v2-index-indexes.http.d.ts +30 -0
  69. package/build/internal/cjs/src/data-v2-index-indexes.http.js +433 -0
  70. package/build/internal/cjs/src/data-v2-index-indexes.http.js.map +1 -0
  71. package/build/internal/cjs/src/data-v2-index-indexes.meta.d.ts +16 -0
  72. package/build/internal/cjs/src/data-v2-index-indexes.meta.js +104 -0
  73. package/build/internal/cjs/src/data-v2-index-indexes.meta.js.map +1 -0
  74. package/build/internal/cjs/src/data-v2-index-indexes.public.d.ts +60 -0
  75. package/build/internal/cjs/src/data-v2-index-indexes.public.js +35 -0
  76. package/build/internal/cjs/src/data-v2-index-indexes.public.js.map +1 -0
  77. package/build/internal/cjs/src/data-v2-index-indexes.types.d.ts +181 -0
  78. package/build/internal/cjs/src/data-v2-index-indexes.types.js +36 -0
  79. package/build/internal/cjs/src/data-v2-index-indexes.types.js.map +1 -0
  80. package/build/internal/cjs/src/data-v2-index-indexes.universal.d.ts +260 -0
  81. package/build/internal/cjs/src/data-v2-index-indexes.universal.js +237 -0
  82. package/build/internal/cjs/src/data-v2-index-indexes.universal.js.map +1 -0
  83. package/build/internal/es/index.d.ts +1 -0
  84. package/build/internal/es/index.js +2 -0
  85. package/build/internal/es/index.js.map +1 -0
  86. package/build/internal/es/index.typings.d.ts +1 -0
  87. package/build/internal/es/index.typings.js +2 -0
  88. package/build/internal/es/index.typings.js.map +1 -0
  89. package/build/internal/es/meta.d.ts +1 -0
  90. package/build/internal/es/meta.js +2 -0
  91. package/build/internal/es/meta.js.map +1 -0
  92. package/build/internal/es/src/data-v2-index-indexes.context.d.ts +9 -0
  93. package/build/internal/es/src/data-v2-index-indexes.context.js +9 -0
  94. package/build/internal/es/src/data-v2-index-indexes.context.js.map +1 -0
  95. package/build/internal/es/src/data-v2-index-indexes.http.d.ts +30 -0
  96. package/build/internal/es/src/data-v2-index-indexes.http.js +426 -0
  97. package/build/internal/es/src/data-v2-index-indexes.http.js.map +1 -0
  98. package/build/internal/es/src/data-v2-index-indexes.meta.d.ts +16 -0
  99. package/build/internal/es/src/data-v2-index-indexes.meta.js +74 -0
  100. package/build/internal/es/src/data-v2-index-indexes.meta.js.map +1 -0
  101. package/build/internal/es/src/data-v2-index-indexes.public.d.ts +60 -0
  102. package/build/internal/es/src/data-v2-index-indexes.public.js +25 -0
  103. package/build/internal/es/src/data-v2-index-indexes.public.js.map +1 -0
  104. package/build/internal/es/src/data-v2-index-indexes.types.d.ts +181 -0
  105. package/build/internal/es/src/data-v2-index-indexes.types.js +33 -0
  106. package/build/internal/es/src/data-v2-index-indexes.types.js.map +1 -0
  107. package/build/internal/es/src/data-v2-index-indexes.universal.d.ts +260 -0
  108. package/build/internal/es/src/data-v2-index-indexes.universal.js +207 -0
  109. package/build/internal/es/src/data-v2-index-indexes.universal.js.map +1 -0
  110. package/meta/package.json +3 -0
  111. package/package.json +52 -0
@@ -0,0 +1,181 @@
1
+ /** An index is a map of a collection's data, organized according to specific fields to increase query speed. */
2
+ export interface Index {
3
+ /** Name of the index. */
4
+ name?: string;
5
+ /**
6
+ * Fields for which the index is defined.
7
+ *
8
+ * Max: 3 fields (for a unique index: 1 field)
9
+ */
10
+ fields?: Field[];
11
+ /**
12
+ * Current status of the index.
13
+ * @readonly
14
+ */
15
+ status?: Status;
16
+ /**
17
+ * Contains details about the reasons for failure when `status` is `FAILED`.
18
+ * @readonly
19
+ */
20
+ failure?: Failure;
21
+ /**
22
+ * Whether the index enforces uniqueness of values in the field for which it is defined.
23
+ * If `true`, the index can have only one field.
24
+ *
25
+ * Default: `false`
26
+ */
27
+ unique?: boolean;
28
+ /**
29
+ * Whether the index ignores case.
30
+ *
31
+ * Default: `false`
32
+ */
33
+ caseInsensitive?: boolean;
34
+ }
35
+ /**
36
+ * Order determines how values are ordered in the index. This is important when
37
+ * ordering and/or range querying by indexed fields.
38
+ */
39
+ export declare enum Order {
40
+ ASC = "ASC",
41
+ DESC = "DESC"
42
+ }
43
+ export interface Field {
44
+ /** Path of the field to index. For example: `title` or `options.price`. */
45
+ path?: string;
46
+ /**
47
+ * Sort order for the index. Base on how the data is regularly queried.
48
+ *
49
+ * Default: `ASC`
50
+ */
51
+ order?: Order;
52
+ }
53
+ export declare enum Status {
54
+ /** Place holder. Never returned by the service. */
55
+ UNKNOWN = "UNKNOWN",
56
+ /** Index creation is in progress. */
57
+ BUILDING = "BUILDING",
58
+ /** Index has been successfully created and can be used in queries. */
59
+ ACTIVE = "ACTIVE",
60
+ /** Index is in the process of being dropped. */
61
+ DROPPING = "DROPPING",
62
+ /** Index has been dropped successfully. */
63
+ DROPPED = "DROPPED",
64
+ /** Index creation has failed. */
65
+ FAILED = "FAILED",
66
+ /** Index contains incorrectly indexed data. */
67
+ INVALID = "INVALID"
68
+ }
69
+ export interface Failure {
70
+ /**
71
+ * Error code.
72
+ * - `WDE0112`: Unknown error while building collection index.
73
+ * - `WDE0113`: Duplicate key error while building collection index.
74
+ * - `WDE0114`: Document too large while building collection index.
75
+ */
76
+ code?: string;
77
+ /** Description of the failure. */
78
+ description?: string;
79
+ /**
80
+ * ID of the data item that caused the failure.
81
+ * For example, if `unique` is `true`, the ID of an item containing a duplicate value.
82
+ */
83
+ itemId?: string | null;
84
+ }
85
+ export interface CreateIndexRequest {
86
+ /** Details of the index to be created. */
87
+ index: Index;
88
+ /** ID of the data collection for which to generate the index. */
89
+ dataCollectionId: string;
90
+ }
91
+ export declare enum Environment {
92
+ LIVE = "LIVE",
93
+ SANDBOX = "SANDBOX",
94
+ SANDBOX_PREFERRED = "SANDBOX_PREFERRED"
95
+ }
96
+ export interface CreateIndexResponse {
97
+ /** Details of the index being generated. */
98
+ index?: Index;
99
+ }
100
+ export interface DropIndexRequest {
101
+ /** Name of the index to drop. */
102
+ indexName: string;
103
+ /** ID of the data collection for which the index to be dropped is defined. */
104
+ dataCollectionId: string;
105
+ }
106
+ export interface DropIndexResponse {
107
+ }
108
+ export interface ListIndexesRequest {
109
+ /** ID of the data collection for which to list indexes. */
110
+ dataCollectionId: string;
111
+ /** Paging options to limit and skip the number of items. */
112
+ paging?: Paging;
113
+ }
114
+ export interface Paging {
115
+ /** Number of items to load. */
116
+ limit?: number | null;
117
+ /** Number of items to skip in the current sort order. */
118
+ offset?: number | null;
119
+ }
120
+ export interface ListIndexesResponse {
121
+ /** List of all indexes for the requested data collection. */
122
+ indexes?: Index[];
123
+ /** Paging metadata. */
124
+ pagingMetadata?: PagingMetadata;
125
+ }
126
+ export interface PagingMetadata {
127
+ /** Number of items returned in the response. */
128
+ count?: number | null;
129
+ /** Offset that was requested. */
130
+ offset?: number | null;
131
+ /** Total number of items that match the query. */
132
+ total?: number | null;
133
+ /** Flag that indicates the server failed to calculate the `total` field. */
134
+ tooManyToCount?: boolean | null;
135
+ }
136
+ export interface ListAvailableIndexesRequest {
137
+ /** Data collection to show available indexes for */
138
+ dataCollectionId: string;
139
+ }
140
+ export interface ListAvailableIndexesResponse {
141
+ /**
142
+ * limit of regular single-field indexes, even if 0 1-field indices may be created using
143
+ * 3-field quota (if available)
144
+ */
145
+ regular1Field?: number;
146
+ /** limit of regular indexes up to 3-fields (in addition to 1-field indexes quota) */
147
+ regular3Field?: number;
148
+ /** limit of unique indexes */
149
+ unique1Field?: number;
150
+ /** Overall index limit, missing value means there's no overall limit */
151
+ total?: number | null;
152
+ }
153
+ interface FieldNonNullableFields {
154
+ path: string;
155
+ order: Order;
156
+ }
157
+ interface FailureNonNullableFields {
158
+ code: string;
159
+ broadCode: string;
160
+ description: string;
161
+ }
162
+ interface IndexNonNullableFields {
163
+ name: string;
164
+ fields: FieldNonNullableFields[];
165
+ status: Status;
166
+ failure?: FailureNonNullableFields;
167
+ unique: boolean;
168
+ caseInsensitive: boolean;
169
+ }
170
+ export interface CreateIndexResponseNonNullableFields {
171
+ index?: IndexNonNullableFields;
172
+ }
173
+ export interface ListIndexesResponseNonNullableFields {
174
+ indexes: IndexNonNullableFields[];
175
+ }
176
+ export interface ListAvailableIndexesResponseNonNullableFields {
177
+ regular1Field: number;
178
+ regular3Field: number;
179
+ unique1Field: number;
180
+ }
181
+ export {};
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Order determines how values are ordered in the index. This is important when
3
+ * ordering and/or range querying by indexed fields.
4
+ */
5
+ export var Order;
6
+ (function (Order) {
7
+ Order["ASC"] = "ASC";
8
+ Order["DESC"] = "DESC";
9
+ })(Order || (Order = {}));
10
+ export var Status;
11
+ (function (Status) {
12
+ /** Place holder. Never returned by the service. */
13
+ Status["UNKNOWN"] = "UNKNOWN";
14
+ /** Index creation is in progress. */
15
+ Status["BUILDING"] = "BUILDING";
16
+ /** Index has been successfully created and can be used in queries. */
17
+ Status["ACTIVE"] = "ACTIVE";
18
+ /** Index is in the process of being dropped. */
19
+ Status["DROPPING"] = "DROPPING";
20
+ /** Index has been dropped successfully. */
21
+ Status["DROPPED"] = "DROPPED";
22
+ /** Index creation has failed. */
23
+ Status["FAILED"] = "FAILED";
24
+ /** Index contains incorrectly indexed data. */
25
+ Status["INVALID"] = "INVALID";
26
+ })(Status || (Status = {}));
27
+ export var Environment;
28
+ (function (Environment) {
29
+ Environment["LIVE"] = "LIVE";
30
+ Environment["SANDBOX"] = "SANDBOX";
31
+ Environment["SANDBOX_PREFERRED"] = "SANDBOX_PREFERRED";
32
+ })(Environment || (Environment = {}));
33
+ //# sourceMappingURL=data-v2-index-indexes.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-v2-index-indexes.types.js","sourceRoot":"","sources":["../../../src/data-v2-index-indexes.types.ts"],"names":[],"mappings":"AAmCA;;;GAGG;AACH,MAAM,CAAN,IAAY,KAGX;AAHD,WAAY,KAAK;IACf,oBAAW,CAAA;IACX,sBAAa,CAAA;AACf,CAAC,EAHW,KAAK,KAAL,KAAK,QAGhB;AAaD,MAAM,CAAN,IAAY,MAeX;AAfD,WAAY,MAAM;IAChB,mDAAmD;IACnD,6BAAmB,CAAA;IACnB,qCAAqC;IACrC,+BAAqB,CAAA;IACrB,sEAAsE;IACtE,2BAAiB,CAAA;IACjB,gDAAgD;IAChD,+BAAqB,CAAA;IACrB,2CAA2C;IAC3C,6BAAmB,CAAA;IACnB,iCAAiC;IACjC,2BAAiB,CAAA;IACjB,+CAA+C;IAC/C,6BAAmB,CAAA;AACrB,CAAC,EAfW,MAAM,KAAN,MAAM,QAejB;AA0BD,MAAM,CAAN,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,4BAAa,CAAA;IACb,kCAAmB,CAAA;IACnB,sDAAuC,CAAA;AACzC,CAAC,EAJW,WAAW,KAAX,WAAW,QAItB"}
@@ -0,0 +1,247 @@
1
+ /** An index is a map of a collection's data, organized according to specific fields to increase query speed. */
2
+ export interface Index {
3
+ /** Name of the index. */
4
+ name?: string;
5
+ /**
6
+ * Fields for which the index is defined.
7
+ *
8
+ * Max: 3 fields (for a unique index: 1 field)
9
+ */
10
+ fields?: Field[];
11
+ /**
12
+ * Current status of the index.
13
+ * @readonly
14
+ */
15
+ status?: Status;
16
+ /**
17
+ * Contains details about the reasons for failure when `status` is `FAILED`.
18
+ * @readonly
19
+ */
20
+ failure?: Failure;
21
+ /**
22
+ * Whether the index enforces uniqueness of values in the field for which it is defined.
23
+ * If `true`, the index can have only one field.
24
+ *
25
+ * Default: `false`
26
+ */
27
+ unique?: boolean;
28
+ /**
29
+ * Whether the index ignores case.
30
+ *
31
+ * Default: `false`
32
+ */
33
+ caseInsensitive?: boolean;
34
+ }
35
+ /**
36
+ * Order determines how values are ordered in the index. This is important when
37
+ * ordering and/or range querying by indexed fields.
38
+ */
39
+ export declare enum Order {
40
+ ASC = "ASC",
41
+ DESC = "DESC"
42
+ }
43
+ export interface Field {
44
+ /** Path of the field to index. For example: `title` or `options.price`. */
45
+ path?: string;
46
+ /**
47
+ * Sort order for the index. Base on how the data is regularly queried.
48
+ *
49
+ * Default: `ASC`
50
+ */
51
+ order?: Order;
52
+ }
53
+ export declare enum Status {
54
+ /** Place holder. Never returned by the service. */
55
+ UNKNOWN = "UNKNOWN",
56
+ /** Index creation is in progress. */
57
+ BUILDING = "BUILDING",
58
+ /** Index has been successfully created and can be used in queries. */
59
+ ACTIVE = "ACTIVE",
60
+ /** Index is in the process of being dropped. */
61
+ DROPPING = "DROPPING",
62
+ /** Index has been dropped successfully. */
63
+ DROPPED = "DROPPED",
64
+ /** Index creation has failed. */
65
+ FAILED = "FAILED",
66
+ /** Index contains incorrectly indexed data. */
67
+ INVALID = "INVALID"
68
+ }
69
+ export interface Failure {
70
+ /**
71
+ * Error code.
72
+ * - `WDE0112`: Unknown error while building collection index.
73
+ * - `WDE0113`: Duplicate key error while building collection index.
74
+ * - `WDE0114`: Document too large while building collection index.
75
+ */
76
+ code?: string;
77
+ /** Description of the failure. */
78
+ description?: string;
79
+ /**
80
+ * ID of the data item that caused the failure.
81
+ * For example, if `unique` is `true`, the ID of an item containing a duplicate value.
82
+ */
83
+ itemId?: string | null;
84
+ }
85
+ export interface CreateIndexRequest {
86
+ /** Details of the index to be created. */
87
+ index: Index;
88
+ /** ID of the data collection for which to generate the index. */
89
+ dataCollectionId: string;
90
+ }
91
+ export declare enum Environment {
92
+ LIVE = "LIVE",
93
+ SANDBOX = "SANDBOX",
94
+ SANDBOX_PREFERRED = "SANDBOX_PREFERRED"
95
+ }
96
+ export interface CreateIndexResponse {
97
+ /** Details of the index being generated. */
98
+ index?: Index;
99
+ }
100
+ export interface DropIndexRequest {
101
+ /** Name of the index to drop. */
102
+ indexName: string;
103
+ /** ID of the data collection for which the index to be dropped is defined. */
104
+ dataCollectionId: string;
105
+ }
106
+ export interface DropIndexResponse {
107
+ }
108
+ export interface ListIndexesRequest {
109
+ /** ID of the data collection for which to list indexes. */
110
+ dataCollectionId: string;
111
+ /** Paging options to limit and skip the number of items. */
112
+ paging?: Paging;
113
+ }
114
+ export interface Paging {
115
+ /** Number of items to load. */
116
+ limit?: number | null;
117
+ /** Number of items to skip in the current sort order. */
118
+ offset?: number | null;
119
+ }
120
+ export interface ListIndexesResponse {
121
+ /** List of all indexes for the requested data collection. */
122
+ indexes?: Index[];
123
+ /** Paging metadata. */
124
+ pagingMetadata?: PagingMetadata;
125
+ }
126
+ export interface PagingMetadata {
127
+ /** Number of items returned in the response. */
128
+ count?: number | null;
129
+ /** Offset that was requested. */
130
+ offset?: number | null;
131
+ /** Total number of items that match the query. */
132
+ total?: number | null;
133
+ /** Flag that indicates the server failed to calculate the `total` field. */
134
+ tooManyToCount?: boolean | null;
135
+ }
136
+ export interface ListAvailableIndexesRequest {
137
+ /** Data collection to show available indexes for */
138
+ dataCollectionId: string;
139
+ }
140
+ export interface ListAvailableIndexesResponse {
141
+ /**
142
+ * limit of regular single-field indexes, even if 0 1-field indices may be created using
143
+ * 3-field quota (if available)
144
+ */
145
+ regular1Field?: number;
146
+ /** limit of regular indexes up to 3-fields (in addition to 1-field indexes quota) */
147
+ regular3Field?: number;
148
+ /** limit of unique indexes */
149
+ unique1Field?: number;
150
+ /** Overall index limit, missing value means there's no overall limit */
151
+ total?: number | null;
152
+ }
153
+ interface FieldNonNullableFields {
154
+ path: string;
155
+ order: Order;
156
+ }
157
+ interface FailureNonNullableFields {
158
+ code: string;
159
+ broadCode: string;
160
+ description: string;
161
+ }
162
+ export interface IndexNonNullableFields {
163
+ name: string;
164
+ fields: FieldNonNullableFields[];
165
+ status: Status;
166
+ failure?: FailureNonNullableFields;
167
+ unique: boolean;
168
+ caseInsensitive: boolean;
169
+ }
170
+ export interface CreateIndexResponseNonNullableFields {
171
+ index?: IndexNonNullableFields;
172
+ }
173
+ export interface ListIndexesResponseNonNullableFields {
174
+ indexes: IndexNonNullableFields[];
175
+ }
176
+ export interface ListAvailableIndexesResponseNonNullableFields {
177
+ regular1Field: number;
178
+ regular3Field: number;
179
+ unique1Field: number;
180
+ }
181
+ /**
182
+ * Creates an index for a data collection.
183
+ *
184
+ * The index can't be used immediately, as the process of generating the index takes time.
185
+ * You can check whether an index is ready by calling List Indexes.
186
+ *
187
+ * Note that when an index fails to create, the failed index still occupies a slot.
188
+ * To remove the failed index and free up the slot for a new index, call Drop Index.
189
+ * @param dataCollectionId - ID of the data collection for which to generate the index.
190
+ * @param index - Details of the index to be created.
191
+ * @public
192
+ * @requiredField dataCollectionId
193
+ * @requiredField index
194
+ * @requiredField index.fields
195
+ * @requiredField index.fields.path
196
+ * @requiredField index.name
197
+ * @param options - Options for creating an index.
198
+ * @permissionId WIX_DATA.CREATE_INDEX
199
+ * @permissionScope Manage Data Indexes
200
+ * @permissionScopeId SCOPE.DC-DATA.INDEXES-MANAGE
201
+ * @applicableIdentity APP
202
+ * @returns Details of the index being generated.
203
+ * @fqn com.wixpress.cloud.data.api.index.IndexService.CreateIndex
204
+ */
205
+ export declare function createIndex(dataCollectionId: string, index: Index): Promise<Index & IndexNonNullableFields>;
206
+ /**
207
+ * Removes an index from a data collection.
208
+ *
209
+ * The process of dropping an index from a collection takes time.
210
+ * You can check whether an index has been dropped by calling List Indexes.
211
+ * @param dataCollectionId - ID of the data collection for which the index to be dropped is defined.
212
+ * @param indexName - Name of the index to drop.
213
+ * @public
214
+ * @requiredField dataCollectionId
215
+ * @requiredField indexName
216
+ * @param options - Options for dropping an index.
217
+ * @permissionId WIX_DATA.DROP_INDEX
218
+ * @permissionScope Manage Data Indexes
219
+ * @permissionScopeId SCOPE.DC-DATA.INDEXES-MANAGE
220
+ * @applicableIdentity APP
221
+ * @fqn com.wixpress.cloud.data.api.index.IndexService.DropIndex
222
+ */
223
+ export declare function dropIndex(dataCollectionId: string, indexName: string): Promise<void>;
224
+ /**
225
+ * Lists all indexes defined for a data collection.
226
+ *
227
+ * When an index's status is `ACTIVE`, it is ready to use.
228
+ * While it is still being created, its status is `BUILDING`.
229
+ *
230
+ * When an index's status is `DROPPED`, it has been dropped successfully.
231
+ * While it is still in the process of being removed, its status is `DROPPING`.
232
+ * @param dataCollectionId - ID of the data collection for which to list indexes.
233
+ * @public
234
+ * @requiredField dataCollectionId
235
+ * @param options - Options for retrieving a list of indexes.
236
+ * @permissionId WIX_DATA.LIST_INDEXES
237
+ * @permissionScope Manage Data Indexes
238
+ * @permissionScopeId SCOPE.DC-DATA.INDEXES-MANAGE
239
+ * @applicableIdentity APP
240
+ * @fqn com.wixpress.cloud.data.api.index.IndexService.ListIndexes
241
+ */
242
+ export declare function listIndexes(dataCollectionId: string, options?: ListIndexesOptions): Promise<ListIndexesResponse & ListIndexesResponseNonNullableFields>;
243
+ export interface ListIndexesOptions {
244
+ /** Paging options to limit and skip the number of items. */
245
+ paging?: Paging;
246
+ }
247
+ export {};
@@ -0,0 +1,207 @@
1
+ import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
2
+ import { renameKeysFromSDKRequestToRESTRequest, renameKeysFromRESTResponseToSDKResponse, } from '@wix/sdk-runtime/rename-all-nested-keys';
3
+ import * as ambassadorWixDataV2Index from './data-v2-index-indexes.http.js';
4
+ /**
5
+ * Order determines how values are ordered in the index. This is important when
6
+ * ordering and/or range querying by indexed fields.
7
+ */
8
+ export var Order;
9
+ (function (Order) {
10
+ Order["ASC"] = "ASC";
11
+ Order["DESC"] = "DESC";
12
+ })(Order || (Order = {}));
13
+ export var Status;
14
+ (function (Status) {
15
+ /** Place holder. Never returned by the service. */
16
+ Status["UNKNOWN"] = "UNKNOWN";
17
+ /** Index creation is in progress. */
18
+ Status["BUILDING"] = "BUILDING";
19
+ /** Index has been successfully created and can be used in queries. */
20
+ Status["ACTIVE"] = "ACTIVE";
21
+ /** Index is in the process of being dropped. */
22
+ Status["DROPPING"] = "DROPPING";
23
+ /** Index has been dropped successfully. */
24
+ Status["DROPPED"] = "DROPPED";
25
+ /** Index creation has failed. */
26
+ Status["FAILED"] = "FAILED";
27
+ /** Index contains incorrectly indexed data. */
28
+ Status["INVALID"] = "INVALID";
29
+ })(Status || (Status = {}));
30
+ export var Environment;
31
+ (function (Environment) {
32
+ Environment["LIVE"] = "LIVE";
33
+ Environment["SANDBOX"] = "SANDBOX";
34
+ Environment["SANDBOX_PREFERRED"] = "SANDBOX_PREFERRED";
35
+ })(Environment || (Environment = {}));
36
+ /**
37
+ * Creates an index for a data collection.
38
+ *
39
+ * The index can't be used immediately, as the process of generating the index takes time.
40
+ * You can check whether an index is ready by calling List Indexes.
41
+ *
42
+ * Note that when an index fails to create, the failed index still occupies a slot.
43
+ * To remove the failed index and free up the slot for a new index, call Drop Index.
44
+ * @param dataCollectionId - ID of the data collection for which to generate the index.
45
+ * @param index - Details of the index to be created.
46
+ * @public
47
+ * @requiredField dataCollectionId
48
+ * @requiredField index
49
+ * @requiredField index.fields
50
+ * @requiredField index.fields.path
51
+ * @requiredField index.name
52
+ * @param options - Options for creating an index.
53
+ * @permissionId WIX_DATA.CREATE_INDEX
54
+ * @permissionScope Manage Data Indexes
55
+ * @permissionScopeId SCOPE.DC-DATA.INDEXES-MANAGE
56
+ * @applicableIdentity APP
57
+ * @returns Details of the index being generated.
58
+ * @fqn com.wixpress.cloud.data.api.index.IndexService.CreateIndex
59
+ */
60
+ export async function createIndex(dataCollectionId, index) {
61
+ // @ts-ignore
62
+ const { httpClient, sideEffects } = arguments[2];
63
+ const payload = renameKeysFromSDKRequestToRESTRequest({
64
+ dataCollectionId: dataCollectionId,
65
+ index: index,
66
+ });
67
+ const reqOpts = ambassadorWixDataV2Index.createIndex(payload);
68
+ sideEffects?.onSiteCall?.();
69
+ try {
70
+ const result = await httpClient.request(reqOpts);
71
+ sideEffects?.onSuccess?.(result);
72
+ return renameKeysFromRESTResponseToSDKResponse(result.data)?.index;
73
+ }
74
+ catch (err) {
75
+ const transformedError = sdkTransformError(err, {
76
+ spreadPathsToArguments: {},
77
+ explicitPathsToArguments: { dataCollectionId: '$[0]', index: '$[1]' },
78
+ singleArgumentUnchanged: false,
79
+ }, ['dataCollectionId', 'index']);
80
+ sideEffects?.onError?.(err);
81
+ throw transformedError;
82
+ }
83
+ }
84
+ /**
85
+ * Removes an index from a data collection.
86
+ *
87
+ * The process of dropping an index from a collection takes time.
88
+ * You can check whether an index has been dropped by calling List Indexes.
89
+ * @param dataCollectionId - ID of the data collection for which the index to be dropped is defined.
90
+ * @param indexName - Name of the index to drop.
91
+ * @public
92
+ * @requiredField dataCollectionId
93
+ * @requiredField indexName
94
+ * @param options - Options for dropping an index.
95
+ * @permissionId WIX_DATA.DROP_INDEX
96
+ * @permissionScope Manage Data Indexes
97
+ * @permissionScopeId SCOPE.DC-DATA.INDEXES-MANAGE
98
+ * @applicableIdentity APP
99
+ * @fqn com.wixpress.cloud.data.api.index.IndexService.DropIndex
100
+ */
101
+ export async function dropIndex(dataCollectionId, indexName) {
102
+ // @ts-ignore
103
+ const { httpClient, sideEffects } = arguments[2];
104
+ const payload = renameKeysFromSDKRequestToRESTRequest({
105
+ dataCollectionId: dataCollectionId,
106
+ indexName: indexName,
107
+ });
108
+ const reqOpts = ambassadorWixDataV2Index.dropIndex(payload);
109
+ sideEffects?.onSiteCall?.();
110
+ try {
111
+ const result = await httpClient.request(reqOpts);
112
+ sideEffects?.onSuccess?.(result);
113
+ }
114
+ catch (err) {
115
+ const transformedError = sdkTransformError(err, {
116
+ spreadPathsToArguments: {},
117
+ explicitPathsToArguments: {
118
+ dataCollectionId: '$[0]',
119
+ indexName: '$[1]',
120
+ },
121
+ singleArgumentUnchanged: false,
122
+ }, ['dataCollectionId', 'indexName']);
123
+ sideEffects?.onError?.(err);
124
+ throw transformedError;
125
+ }
126
+ }
127
+ /**
128
+ * Lists all indexes defined for a data collection.
129
+ *
130
+ * When an index's status is `ACTIVE`, it is ready to use.
131
+ * While it is still being created, its status is `BUILDING`.
132
+ *
133
+ * When an index's status is `DROPPED`, it has been dropped successfully.
134
+ * While it is still in the process of being removed, its status is `DROPPING`.
135
+ * @param dataCollectionId - ID of the data collection for which to list indexes.
136
+ * @public
137
+ * @requiredField dataCollectionId
138
+ * @param options - Options for retrieving a list of indexes.
139
+ * @permissionId WIX_DATA.LIST_INDEXES
140
+ * @permissionScope Manage Data Indexes
141
+ * @permissionScopeId SCOPE.DC-DATA.INDEXES-MANAGE
142
+ * @applicableIdentity APP
143
+ * @fqn com.wixpress.cloud.data.api.index.IndexService.ListIndexes
144
+ */
145
+ export async function listIndexes(dataCollectionId, options) {
146
+ // @ts-ignore
147
+ const { httpClient, sideEffects } = arguments[2];
148
+ const payload = renameKeysFromSDKRequestToRESTRequest({
149
+ dataCollectionId: dataCollectionId,
150
+ paging: options?.paging,
151
+ });
152
+ const reqOpts = ambassadorWixDataV2Index.listIndexes(payload);
153
+ sideEffects?.onSiteCall?.();
154
+ try {
155
+ const result = await httpClient.request(reqOpts);
156
+ sideEffects?.onSuccess?.(result);
157
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
158
+ }
159
+ catch (err) {
160
+ const transformedError = sdkTransformError(err, {
161
+ spreadPathsToArguments: {},
162
+ explicitPathsToArguments: {
163
+ dataCollectionId: '$[0]',
164
+ paging: '$[1].paging',
165
+ },
166
+ singleArgumentUnchanged: false,
167
+ }, ['dataCollectionId', 'options']);
168
+ sideEffects?.onError?.(err);
169
+ throw transformedError;
170
+ }
171
+ }
172
+ /**
173
+ * Lists available indexes limits
174
+ * @param dataCollectionId - Data collection to show available indexes for
175
+ * @internal
176
+ * @documentationMaturity preview
177
+ * @requiredField dataCollectionId
178
+ * @permissionId WIX_DATA.LIST_INDEXES
179
+ * @permissionScope Manage Data Indexes
180
+ * @permissionScopeId SCOPE.DC-DATA.INDEXES-MANAGE
181
+ * @applicableIdentity APP
182
+ * @fqn com.wixpress.cloud.data.api.index.IndexService.ListAvailableIndexes
183
+ */
184
+ export async function listAvailableIndexes(dataCollectionId) {
185
+ // @ts-ignore
186
+ const { httpClient, sideEffects } = arguments[1];
187
+ const payload = renameKeysFromSDKRequestToRESTRequest({
188
+ dataCollectionId: dataCollectionId,
189
+ });
190
+ const reqOpts = ambassadorWixDataV2Index.listAvailableIndexes(payload);
191
+ sideEffects?.onSiteCall?.();
192
+ try {
193
+ const result = await httpClient.request(reqOpts);
194
+ sideEffects?.onSuccess?.(result);
195
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
196
+ }
197
+ catch (err) {
198
+ const transformedError = sdkTransformError(err, {
199
+ spreadPathsToArguments: {},
200
+ explicitPathsToArguments: { dataCollectionId: '$[0]' },
201
+ singleArgumentUnchanged: false,
202
+ }, ['dataCollectionId']);
203
+ sideEffects?.onError?.(err);
204
+ throw transformedError;
205
+ }
206
+ }
207
+ //# sourceMappingURL=data-v2-index-indexes.universal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-v2-index-indexes.universal.js","sourceRoot":"","sources":["../../../src/data-v2-index-indexes.universal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EACL,qCAAqC,EACrC,uCAAuC,GACxC,MAAM,yCAAyC,CAAC;AAEjD,OAAO,KAAK,wBAAwB,MAAM,iCAAiC,CAAC;AAqC5E;;;GAGG;AACH,MAAM,CAAN,IAAY,KAGX;AAHD,WAAY,KAAK;IACf,oBAAW,CAAA;IACX,sBAAa,CAAA;AACf,CAAC,EAHW,KAAK,KAAL,KAAK,QAGhB;AAaD,MAAM,CAAN,IAAY,MAeX;AAfD,WAAY,MAAM;IAChB,mDAAmD;IACnD,6BAAmB,CAAA;IACnB,qCAAqC;IACrC,+BAAqB,CAAA;IACrB,sEAAsE;IACtE,2BAAiB,CAAA;IACjB,gDAAgD;IAChD,+BAAqB,CAAA;IACrB,2CAA2C;IAC3C,6BAAmB,CAAA;IACnB,iCAAiC;IACjC,2BAAiB,CAAA;IACjB,+CAA+C;IAC/C,6BAAmB,CAAA;AACrB,CAAC,EAfW,MAAM,KAAN,MAAM,QAejB;AA0BD,MAAM,CAAN,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,4BAAa,CAAA;IACb,kCAAmB,CAAA;IACnB,sDAAuC,CAAA;AACzC,CAAC,EAJW,WAAW,KAAX,WAAW,QAItB;AAqGD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,KAAK,U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