@wix/data 1.0.89 → 1.0.91

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 (169) hide show
  1. package/build/cjs/context.d.ts +4 -4
  2. package/build/cjs/context.js +4 -4
  3. package/build/cjs/context.js.map +1 -1
  4. package/build/cjs/index.d.ts +4 -4
  5. package/build/cjs/index.js +4 -4
  6. package/build/cjs/index.js.map +1 -1
  7. package/build/cjs/meta.d.ts +4 -4
  8. package/build/cjs/meta.js +4 -4
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/context.d.ts +4 -4
  11. package/build/es/context.js +4 -4
  12. package/build/es/context.js.map +1 -1
  13. package/build/es/index.d.ts +4 -4
  14. package/build/es/index.js +4 -4
  15. package/build/es/index.js.map +1 -1
  16. package/build/es/meta.d.ts +4 -4
  17. package/build/es/meta.js +4 -4
  18. package/build/es/meta.js.map +1 -1
  19. package/package.json +14 -9
  20. package/build/cjs/index.typings.d.ts +0 -4
  21. package/build/cjs/index.typings.js +0 -31
  22. package/build/cjs/index.typings.js.map +0 -1
  23. package/build/cjs/src/data-v1-external-database-connection.context.d.ts +0 -7
  24. package/build/cjs/src/data-v1-external-database-connection.context.js +0 -90
  25. package/build/cjs/src/data-v1-external-database-connection.context.js.map +0 -1
  26. package/build/cjs/src/data-v1-external-database-connection.http.d.ts +0 -28
  27. package/build/cjs/src/data-v1-external-database-connection.http.js +0 -393
  28. package/build/cjs/src/data-v1-external-database-connection.http.js.map +0 -1
  29. package/build/cjs/src/data-v1-external-database-connection.meta.d.ts +0 -23
  30. package/build/cjs/src/data-v1-external-database-connection.meta.js +0 -127
  31. package/build/cjs/src/data-v1-external-database-connection.meta.js.map +0 -1
  32. package/build/cjs/src/data-v1-external-database-connection.public.d.ts +0 -46
  33. package/build/cjs/src/data-v1-external-database-connection.public.js +0 -46
  34. package/build/cjs/src/data-v1-external-database-connection.public.js.map +0 -1
  35. package/build/cjs/src/data-v1-external-database-connection.types.d.ts +0 -321
  36. package/build/cjs/src/data-v1-external-database-connection.types.js +0 -88
  37. package/build/cjs/src/data-v1-external-database-connection.types.js.map +0 -1
  38. package/build/cjs/src/data-v1-external-database-connection.universal.d.ts +0 -433
  39. package/build/cjs/src/data-v1-external-database-connection.universal.js +0 -442
  40. package/build/cjs/src/data-v1-external-database-connection.universal.js.map +0 -1
  41. package/build/cjs/src/data-v2-data-collection.context.d.ts +0 -7
  42. package/build/cjs/src/data-v2-data-collection.context.js +0 -90
  43. package/build/cjs/src/data-v2-data-collection.context.js.map +0 -1
  44. package/build/cjs/src/data-v2-data-collection.http.d.ts +0 -36
  45. package/build/cjs/src/data-v2-data-collection.http.js +0 -494
  46. package/build/cjs/src/data-v2-data-collection.http.js.map +0 -1
  47. package/build/cjs/src/data-v2-data-collection.meta.d.ts +0 -21
  48. package/build/cjs/src/data-v2-data-collection.meta.js +0 -123
  49. package/build/cjs/src/data-v2-data-collection.meta.js.map +0 -1
  50. package/build/cjs/src/data-v2-data-collection.public.d.ts +0 -313
  51. package/build/cjs/src/data-v2-data-collection.public.js +0 -58
  52. package/build/cjs/src/data-v2-data-collection.public.js.map +0 -1
  53. package/build/cjs/src/data-v2-data-collection.types.d.ts +0 -1460
  54. package/build/cjs/src/data-v2-data-collection.types.js +0 -197
  55. package/build/cjs/src/data-v2-data-collection.types.js.map +0 -1
  56. package/build/cjs/src/data-v2-data-collection.universal.d.ts +0 -1626
  57. package/build/cjs/src/data-v2-data-collection.universal.js +0 -622
  58. package/build/cjs/src/data-v2-data-collection.universal.js.map +0 -1
  59. package/build/cjs/src/data-v2-data-item.context.d.ts +0 -23
  60. package/build/cjs/src/data-v2-data-item.context.js +0 -362
  61. package/build/cjs/src/data-v2-data-item.context.js.map +0 -1
  62. package/build/cjs/src/data-v2-data-item.http.d.ts +0 -225
  63. package/build/cjs/src/data-v2-data-item.http.js +0 -936
  64. package/build/cjs/src/data-v2-data-item.http.js.map +0 -1
  65. package/build/cjs/src/data-v2-data-item.meta.d.ts +0 -39
  66. package/build/cjs/src/data-v2-data-item.meta.js +0 -427
  67. package/build/cjs/src/data-v2-data-item.meta.js.map +0 -1
  68. package/build/cjs/src/data-v2-data-item.public.d.ts +0 -31
  69. package/build/cjs/src/data-v2-data-item.public.js +0 -137
  70. package/build/cjs/src/data-v2-data-item.public.js.map +0 -1
  71. package/build/cjs/src/data-v2-data-item.types.d.ts +0 -913
  72. package/build/cjs/src/data-v2-data-item.types.js +0 -27
  73. package/build/cjs/src/data-v2-data-item.types.js.map +0 -1
  74. package/build/cjs/src/data-v2-data-item.universal.d.ts +0 -1748
  75. package/build/cjs/src/data-v2-data-item.universal.js +0 -1639
  76. package/build/cjs/src/data-v2-data-item.universal.js.map +0 -1
  77. package/build/cjs/src/data-v2-index.context.d.ts +0 -5
  78. package/build/cjs/src/data-v2-index.context.js +0 -56
  79. package/build/cjs/src/data-v2-index.context.js.map +0 -1
  80. package/build/cjs/src/data-v2-index.http.d.ts +0 -28
  81. package/build/cjs/src/data-v2-index.http.js +0 -367
  82. package/build/cjs/src/data-v2-index.http.js.map +0 -1
  83. package/build/cjs/src/data-v2-index.meta.d.ts +0 -15
  84. package/build/cjs/src/data-v2-index.meta.js +0 -85
  85. package/build/cjs/src/data-v2-index.meta.js.map +0 -1
  86. package/build/cjs/src/data-v2-index.public.d.ts +0 -23
  87. package/build/cjs/src/data-v2-index.public.js +0 -28
  88. package/build/cjs/src/data-v2-index.public.js.map +0 -1
  89. package/build/cjs/src/data-v2-index.types.d.ts +0 -174
  90. package/build/cjs/src/data-v2-index.types.js +0 -35
  91. package/build/cjs/src/data-v2-index.types.js.map +0 -1
  92. package/build/cjs/src/data-v2-index.universal.d.ts +0 -237
  93. package/build/cjs/src/data-v2-index.universal.js +0 -274
  94. package/build/cjs/src/data-v2-index.universal.js.map +0 -1
  95. package/build/es/index.typings.d.ts +0 -4
  96. package/build/es/index.typings.js +0 -5
  97. package/build/es/index.typings.js.map +0 -1
  98. package/build/es/src/data-v1-external-database-connection.context.d.ts +0 -7
  99. package/build/es/src/data-v1-external-database-connection.context.js +0 -82
  100. package/build/es/src/data-v1-external-database-connection.context.js.map +0 -1
  101. package/build/es/src/data-v1-external-database-connection.http.d.ts +0 -28
  102. package/build/es/src/data-v1-external-database-connection.http.js +0 -385
  103. package/build/es/src/data-v1-external-database-connection.http.js.map +0 -1
  104. package/build/es/src/data-v1-external-database-connection.meta.d.ts +0 -23
  105. package/build/es/src/data-v1-external-database-connection.meta.js +0 -96
  106. package/build/es/src/data-v1-external-database-connection.meta.js.map +0 -1
  107. package/build/es/src/data-v1-external-database-connection.public.d.ts +0 -46
  108. package/build/es/src/data-v1-external-database-connection.public.js +0 -30
  109. package/build/es/src/data-v1-external-database-connection.public.js.map +0 -1
  110. package/build/es/src/data-v1-external-database-connection.types.d.ts +0 -321
  111. package/build/es/src/data-v1-external-database-connection.types.js +0 -85
  112. package/build/es/src/data-v1-external-database-connection.types.js.map +0 -1
  113. package/build/es/src/data-v1-external-database-connection.universal.d.ts +0 -433
  114. package/build/es/src/data-v1-external-database-connection.universal.js +0 -411
  115. package/build/es/src/data-v1-external-database-connection.universal.js.map +0 -1
  116. package/build/es/src/data-v2-data-collection.context.d.ts +0 -7
  117. package/build/es/src/data-v2-data-collection.context.js +0 -82
  118. package/build/es/src/data-v2-data-collection.context.js.map +0 -1
  119. package/build/es/src/data-v2-data-collection.http.d.ts +0 -36
  120. package/build/es/src/data-v2-data-collection.http.js +0 -486
  121. package/build/es/src/data-v2-data-collection.http.js.map +0 -1
  122. package/build/es/src/data-v2-data-collection.meta.d.ts +0 -21
  123. package/build/es/src/data-v2-data-collection.meta.js +0 -92
  124. package/build/es/src/data-v2-data-collection.meta.js.map +0 -1
  125. package/build/es/src/data-v2-data-collection.public.d.ts +0 -313
  126. package/build/es/src/data-v2-data-collection.public.js +0 -30
  127. package/build/es/src/data-v2-data-collection.public.js.map +0 -1
  128. package/build/es/src/data-v2-data-collection.types.d.ts +0 -1460
  129. package/build/es/src/data-v2-data-collection.types.js +0 -194
  130. package/build/es/src/data-v2-data-collection.types.js.map +0 -1
  131. package/build/es/src/data-v2-data-collection.universal.d.ts +0 -1626
  132. package/build/es/src/data-v2-data-collection.universal.js +0 -591
  133. package/build/es/src/data-v2-data-collection.universal.js.map +0 -1
  134. package/build/es/src/data-v2-data-item.context.d.ts +0 -23
  135. package/build/es/src/data-v2-data-item.context.js +0 -338
  136. package/build/es/src/data-v2-data-item.context.js.map +0 -1
  137. package/build/es/src/data-v2-data-item.http.d.ts +0 -225
  138. package/build/es/src/data-v2-data-item.http.js +0 -912
  139. package/build/es/src/data-v2-data-item.http.js.map +0 -1
  140. package/build/es/src/data-v2-data-item.meta.d.ts +0 -39
  141. package/build/es/src/data-v2-data-item.meta.js +0 -380
  142. package/build/es/src/data-v2-data-item.meta.js.map +0 -1
  143. package/build/es/src/data-v2-data-item.public.d.ts +0 -31
  144. package/build/es/src/data-v2-data-item.public.js +0 -109
  145. package/build/es/src/data-v2-data-item.public.js.map +0 -1
  146. package/build/es/src/data-v2-data-item.types.d.ts +0 -913
  147. package/build/es/src/data-v2-data-item.types.js +0 -24
  148. package/build/es/src/data-v2-data-item.types.js.map +0 -1
  149. package/build/es/src/data-v2-data-item.universal.d.ts +0 -1748
  150. package/build/es/src/data-v2-data-item.universal.js +0 -1592
  151. package/build/es/src/data-v2-data-item.universal.js.map +0 -1
  152. package/build/es/src/data-v2-index.context.d.ts +0 -5
  153. package/build/es/src/data-v2-index.context.js +0 -50
  154. package/build/es/src/data-v2-index.context.js.map +0 -1
  155. package/build/es/src/data-v2-index.http.d.ts +0 -28
  156. package/build/es/src/data-v2-index.http.js +0 -361
  157. package/build/es/src/data-v2-index.http.js.map +0 -1
  158. package/build/es/src/data-v2-index.meta.d.ts +0 -15
  159. package/build/es/src/data-v2-index.meta.js +0 -56
  160. package/build/es/src/data-v2-index.meta.js.map +0 -1
  161. package/build/es/src/data-v2-index.public.d.ts +0 -23
  162. package/build/es/src/data-v2-index.public.js +0 -19
  163. package/build/es/src/data-v2-index.public.js.map +0 -1
  164. package/build/es/src/data-v2-index.types.d.ts +0 -174
  165. package/build/es/src/data-v2-index.types.js +0 -32
  166. package/build/es/src/data-v2-index.types.js.map +0 -1
  167. package/build/es/src/data-v2-index.universal.d.ts +0 -237
  168. package/build/es/src/data-v2-index.universal.js +0 -245
  169. package/build/es/src/data-v2-index.universal.js.map +0 -1
@@ -1,19 +0,0 @@
1
- import { createIndex as universalCreateIndex, dropIndex as universalDropIndex, listIndexes as universalListIndexes, } from './data-v2-index.universal';
2
- export const __metadata = { PACKAGE_NAME: '@wix/data' };
3
- export function createIndex(httpClient) {
4
- return (dataCollectionId, index) => universalCreateIndex(dataCollectionId, index,
5
- // @ts-ignore
6
- { httpClient });
7
- }
8
- export function dropIndex(httpClient) {
9
- return (dataCollectionId, indexName) => universalDropIndex(dataCollectionId, indexName,
10
- // @ts-ignore
11
- { httpClient });
12
- }
13
- export function listIndexes(httpClient) {
14
- return (dataCollectionId, options) => universalListIndexes(dataCollectionId, options,
15
- // @ts-ignore
16
- { httpClient });
17
- }
18
- export { Order, Status, Environment } from './data-v2-index.universal';
19
- //# sourceMappingURL=data-v2-index.public.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"data-v2-index.public.js","sourceRoot":"","sources":["../../../src/data-v2-index.public.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,IAAI,oBAAoB,EACnC,SAAS,IAAI,kBAAkB,EAC/B,WAAW,IAAI,oBAAoB,GAGpC,MAAM,2BAA2B,CAAC;AAEnC,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC;AAExD,MAAM,UAAU,WAAW,CAAC,UAAsB;IAChD,OAAO,CAAC,gBAAwB,EAAE,KAAY,EAAE,EAAE,CAChD,oBAAoB,CAClB,gBAAgB,EAChB,KAAK;IACL,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,UAAsB;IAC9C,OAAO,CAAC,gBAAwB,EAAE,SAAiB,EAAE,EAAE,CACrD,kBAAkB,CAChB,gBAAgB,EAChB,SAAS;IACT,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,UAAsB;IAChD,OAAO,CAAC,gBAAwB,EAAE,OAA4B,EAAE,EAAE,CAChE,oBAAoB,CAClB,gBAAgB,EAChB,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAED,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC"}
@@ -1,174 +0,0 @@
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
- * - `BUILDING`: Index creation is in progress.
14
- * - `ACTIVE`: Index has been successfully created and can be used in queries.
15
- * - `DROPPING`: Index is in the process of being dropped.
16
- * - `DROPPED`: Index has been dropped successfully.
17
- * - `FAILED`: Index creation has failed.
18
- * - `INVALID`: Index contains incorrectly indexed data.
19
- * @readonly
20
- */
21
- status?: Status;
22
- /**
23
- * Contains details about the reasons for failure when `status` is `FAILED`.
24
- * @readonly
25
- */
26
- failure?: Failure;
27
- /**
28
- * Whether the index enforces uniqueness of values in the field for which it is defined.
29
- * If `true`, the index can have only one field.
30
- *
31
- * Default: `false`
32
- */
33
- unique?: boolean;
34
- /**
35
- * Whether the index ignores case.
36
- *
37
- * Default: `false`
38
- */
39
- caseInsensitive?: boolean;
40
- }
41
- /**
42
- * Order determines how values are ordered in the index. This is important when
43
- * ordering and/or range querying by indexed fields.
44
- */
45
- export declare enum Order {
46
- ASC = "ASC",
47
- DESC = "DESC"
48
- }
49
- export interface Field {
50
- /** Path of the field to index. For example: `title` or `options.price`. */
51
- path?: string;
52
- /**
53
- * Sort order for the index. Base on how the data is regularly queried.
54
- *
55
- * Default: `ASC`
56
- */
57
- order?: Order;
58
- }
59
- export declare enum Status {
60
- /** Place holder. Never returned by the service. */
61
- UNKNOWN = "UNKNOWN",
62
- /** Index creation is in progress. */
63
- BUILDING = "BUILDING",
64
- /** Index has been successfully created and can be used in queries. */
65
- ACTIVE = "ACTIVE",
66
- /** Index is in the process of being dropped. */
67
- DROPPING = "DROPPING",
68
- /** Index has been dropped successfully. */
69
- DROPPED = "DROPPED",
70
- /** Index creation has failed. */
71
- FAILED = "FAILED",
72
- /** Index contains incorrectly indexed data. */
73
- INVALID = "INVALID"
74
- }
75
- export interface Failure {
76
- /**
77
- * Error code.
78
- * - `WDE0112`: Unknown error while building collection index.
79
- * - `WDE0113`: Duplicate key error while building collection index.
80
- * - `WDE0114`: Document too large while building collection index.
81
- */
82
- code?: string;
83
- /** Description of the failure. */
84
- description?: string;
85
- /**
86
- * ID of the data item that caused the failure.
87
- * For example, if `unique` is `true`, the ID of an item containing a duplicate value.
88
- */
89
- itemId?: string | null;
90
- }
91
- export interface CreateIndexRequest {
92
- /** Details of the index to be created. */
93
- index: Index;
94
- /** ID of the [data collection](https://dev.wix.com/api/rest/wix-data/wix-data/data-collections) for which to generate the index. */
95
- dataCollectionId: string;
96
- }
97
- export declare enum Environment {
98
- LIVE = "LIVE",
99
- SANDBOX = "SANDBOX"
100
- }
101
- export interface CreateIndexResponse {
102
- /** Details of the index being generated. */
103
- index?: Index;
104
- }
105
- export interface DropIndexRequest {
106
- /** Name of the index to drop. */
107
- indexName: string;
108
- /** ID of the [data collection](https://dev.wix.com/api/rest/wix-data/wix-data/data-collections) for which the index to be dropped is defined. */
109
- dataCollectionId: string;
110
- }
111
- export interface DropIndexResponse {
112
- }
113
- export interface ListIndexesRequest {
114
- /** ID of the [data collection](https://dev.wix.com/api/rest/wix-data/wix-data/data-collections) for which to list indexes. */
115
- dataCollectionId: string;
116
- /** paging */
117
- paging?: Paging;
118
- }
119
- export interface Paging {
120
- /** Number of items to load. */
121
- limit?: number | null;
122
- /** Number of items to skip in the current sort order. */
123
- offset?: number | null;
124
- }
125
- export interface ListIndexesResponse {
126
- /** List of all indexes for the requested data collection. */
127
- indexes?: Index[];
128
- /** Paging metadata */
129
- pagingMetadata?: PagingMetadata;
130
- }
131
- export interface PagingMetadata {
132
- /** Number of items returned in the response. */
133
- count?: number | null;
134
- /** Offset that was requested. */
135
- offset?: number | null;
136
- /** Total number of items that match the query. */
137
- total?: number | null;
138
- /** Flag that indicates the server failed to calculate the `total` field. */
139
- tooManyToCount?: boolean | null;
140
- }
141
- export interface CreateIndexResponseNonNullableFields {
142
- index?: {
143
- name: string;
144
- fields: {
145
- path: string;
146
- order: Order;
147
- }[];
148
- status: Status;
149
- failure?: {
150
- code: string;
151
- broadCode: string;
152
- description: string;
153
- };
154
- unique: boolean;
155
- caseInsensitive: boolean;
156
- };
157
- }
158
- export interface ListIndexesResponseNonNullableFields {
159
- indexes: {
160
- name: string;
161
- fields: {
162
- path: string;
163
- order: Order;
164
- }[];
165
- status: Status;
166
- failure?: {
167
- code: string;
168
- broadCode: string;
169
- description: string;
170
- };
171
- unique: boolean;
172
- caseInsensitive: boolean;
173
- }[];
174
- }
@@ -1,32 +0,0 @@
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 || (Environment = {}));
32
- //# sourceMappingURL=data-v2-index.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"data-v2-index.types.js","sourceRoot":"","sources":["../../../src/data-v2-index.types.ts"],"names":[],"mappings":"AAyCA;;;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,WAGX;AAHD,WAAY,WAAW;IACrB,4BAAa,CAAA;IACb,kCAAmB,CAAA;AACrB,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB"}
@@ -1,237 +0,0 @@
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
- * - `BUILDING`: Index creation is in progress.
14
- * - `ACTIVE`: Index has been successfully created and can be used in queries.
15
- * - `DROPPING`: Index is in the process of being dropped.
16
- * - `DROPPED`: Index has been dropped successfully.
17
- * - `FAILED`: Index creation has failed.
18
- * - `INVALID`: Index contains incorrectly indexed data.
19
- * @readonly
20
- */
21
- status?: Status;
22
- /**
23
- * Contains details about the reasons for failure when `status` is `FAILED`.
24
- * @readonly
25
- */
26
- failure?: Failure;
27
- /**
28
- * Whether the index enforces uniqueness of values in the field for which it is defined.
29
- * If `true`, the index can have only one field.
30
- *
31
- * Default: `false`
32
- */
33
- unique?: boolean;
34
- /**
35
- * Whether the index ignores case.
36
- *
37
- * Default: `false`
38
- */
39
- caseInsensitive?: boolean;
40
- }
41
- /**
42
- * Order determines how values are ordered in the index. This is important when
43
- * ordering and/or range querying by indexed fields.
44
- */
45
- export declare enum Order {
46
- ASC = "ASC",
47
- DESC = "DESC"
48
- }
49
- export interface Field {
50
- /** Path of the field to index. For example: `title` or `options.price`. */
51
- path?: string;
52
- /**
53
- * Sort order for the index. Base on how the data is regularly queried.
54
- *
55
- * Supported values: `ASC`, `DESC`.
56
- *
57
- * Default: `ASC`
58
- */
59
- order?: Order;
60
- }
61
- export declare enum Status {
62
- /** Place holder. Never returned by the service. */
63
- UNKNOWN = "UNKNOWN",
64
- /** Index creation is in progress. */
65
- BUILDING = "BUILDING",
66
- /** Index has been successfully created and can be used in queries. */
67
- ACTIVE = "ACTIVE",
68
- /** Index is in the process of being dropped. */
69
- DROPPING = "DROPPING",
70
- /** Index has been dropped successfully. */
71
- DROPPED = "DROPPED",
72
- /** Index creation has failed. */
73
- FAILED = "FAILED",
74
- /** Index contains incorrectly indexed data. */
75
- INVALID = "INVALID"
76
- }
77
- export interface Failure {
78
- /**
79
- * Error code.
80
- * - `WDE0112`: Unknown error while building collection index.
81
- * - `WDE0113`: Duplicate key error while building collection index.
82
- * - `WDE0114`: Document too large while building collection index.
83
- */
84
- code?: string;
85
- /** Description of the failure. */
86
- description?: string;
87
- /**
88
- * ID of the data item that caused the failure.
89
- * For example, if `unique` is `true`, the ID of an item containing a duplicate value.
90
- */
91
- itemId?: string | null;
92
- }
93
- export interface CreateIndexRequest {
94
- /** Details of the index to be created. */
95
- index: Index;
96
- /** ID of the data collection for which to generate the index. */
97
- dataCollectionId: string;
98
- }
99
- export declare enum Environment {
100
- LIVE = "LIVE",
101
- SANDBOX = "SANDBOX"
102
- }
103
- export interface CreateIndexResponse {
104
- /** Details of the index being generated. */
105
- index?: Index;
106
- }
107
- export interface DropIndexRequest {
108
- /** Name of the index to drop. */
109
- indexName: string;
110
- /** ID of the data collection for which the index to be dropped is defined. */
111
- dataCollectionId: string;
112
- }
113
- export interface DropIndexResponse {
114
- }
115
- export interface ListIndexesRequest {
116
- /**
117
- * ID of the data collection for which to list indexes.
118
- *
119
- */
120
- dataCollectionId: string;
121
- /** paging */
122
- paging?: Paging;
123
- }
124
- export interface Paging {
125
- /** Number of items to load. */
126
- limit?: number | null;
127
- /** Number of items to skip in the current sort order. */
128
- offset?: number | null;
129
- }
130
- export interface ListIndexesResponse {
131
- /** List of all indexes for the requested data collection. */
132
- indexes?: Index[];
133
- /** Paging metadata */
134
- pagingMetadata?: PagingMetadata;
135
- }
136
- export interface PagingMetadata {
137
- /** Number of items returned in the response. */
138
- count?: number | null;
139
- /** Offset that was requested. */
140
- offset?: number | null;
141
- /** Total number of items that match the query. */
142
- total?: number | null;
143
- /** Flag that indicates the server failed to calculate the `total` field. */
144
- tooManyToCount?: boolean | null;
145
- }
146
- export interface CreateIndexResponseNonNullableFields {
147
- index?: {
148
- name: string;
149
- fields: {
150
- path: string;
151
- order: Order;
152
- }[];
153
- status: Status;
154
- failure?: {
155
- code: string;
156
- description: string;
157
- };
158
- unique: boolean;
159
- caseInsensitive: boolean;
160
- };
161
- }
162
- export interface ListIndexesResponseNonNullableFields {
163
- indexes: {
164
- name: string;
165
- fields: {
166
- path: string;
167
- order: Order;
168
- }[];
169
- status: Status;
170
- failure?: {
171
- code: string;
172
- description: string;
173
- };
174
- unique: boolean;
175
- caseInsensitive: boolean;
176
- }[];
177
- }
178
- /**
179
- * Creates an index for a data collection.
180
- *
181
- * The index can't be used immediately, as the process of generating the index takes time.
182
- * You can check whether your index is ready using `listIndexes()`.
183
- *
184
- * Note that when an index fails to create, the failed index still occupies a slot.
185
- * To remove the failed index and free up the slot for a new index, use `dropIndex()`.
186
- * @param dataCollectionId - ID of the data collection for which to generate the index.
187
- * @param index - Details of the index to be created.
188
- * @public
189
- * @requiredField dataCollectionId
190
- * @requiredField index
191
- * @requiredField index.fields
192
- * @requiredField index.fields.path
193
- * @requiredField index.name
194
- * @param options - Options for creating an index.
195
- * @permissionScope Managa Data Indexes
196
- * @permissionScopeId SCOPE.DC-DATA.INDEXES-MANAGE
197
- * @applicableIdentity APP
198
- * @returns Details of the index being generated.
199
- */
200
- export declare function createIndex(dataCollectionId: string, index: Index): Promise<Index & NonNullable<CreateIndexResponseNonNullableFields>['index']>;
201
- /**
202
- * Removes an index from a data collection.
203
- *
204
- * The process of dropping an index from a collection takes time.
205
- * You can check whether your index has been dropped by calling `listIndexes()`.
206
- * @param dataCollectionId - ID of the data collection for which the index to be dropped is defined.
207
- * @param indexName - Name of the index to drop.
208
- * @public
209
- * @requiredField dataCollectionId
210
- * @requiredField indexName
211
- * @param options - Options for dropping an index.
212
- * @permissionScope Managa Data Indexes
213
- * @permissionScopeId SCOPE.DC-DATA.INDEXES-MANAGE
214
- * @applicableIdentity APP
215
- */
216
- export declare function dropIndex(dataCollectionId: string, indexName: string): Promise<void>;
217
- /**
218
- * Lists all indexes defined for a data collection.
219
- *
220
- * When an index's status is `ACTIVE`, it is ready to use.
221
- * While it is still being created, its status is `BUILDING`.
222
- *
223
- * When an index's status is `DROPPED`, it has been dropped successfully.
224
- * While it is still in the process of being removed, its status is `DROPPING`.
225
- * @param dataCollectionId - ID of the data collection for which to list indexes.
226
- * @public
227
- * @requiredField dataCollectionId
228
- * @param options - Options for retrieving a list of indexes.
229
- * @permissionScope Managa Data Indexes
230
- * @permissionScopeId SCOPE.DC-DATA.INDEXES-MANAGE
231
- * @applicableIdentity APP
232
- */
233
- export declare function listIndexes(dataCollectionId: string, options?: ListIndexesOptions): Promise<ListIndexesResponse & ListIndexesResponseNonNullableFields>;
234
- export interface ListIndexesOptions {
235
- /** paging */
236
- paging?: Paging;
237
- }