@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,104 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.listAvailableIndexes = exports.listIndexes = exports.dropIndex = exports.createIndex = void 0;
27
+ const ambassadorWixDataV2Index = __importStar(require("./data-v2-index-indexes.http.js"));
28
+ function createIndex() {
29
+ const payload = {};
30
+ const getRequestOptions = ambassadorWixDataV2Index.createIndex(payload);
31
+ const getUrl = (context) => {
32
+ const { url } = getRequestOptions(context);
33
+ return url;
34
+ };
35
+ return {
36
+ getUrl,
37
+ httpMethod: 'POST',
38
+ path: '/v2/indexes',
39
+ pathParams: {},
40
+ __requestType: null,
41
+ __originalRequestType: null,
42
+ __responseType: null,
43
+ __originalResponseType: null,
44
+ };
45
+ }
46
+ exports.createIndex = createIndex;
47
+ function dropIndex() {
48
+ const payload = {};
49
+ const getRequestOptions = ambassadorWixDataV2Index.dropIndex(payload);
50
+ const getUrl = (context) => {
51
+ const { url } = getRequestOptions(context);
52
+ return url;
53
+ };
54
+ return {
55
+ getUrl,
56
+ httpMethod: 'DELETE',
57
+ path: '/v2/indexes',
58
+ pathParams: {},
59
+ __requestType: null,
60
+ __originalRequestType: null,
61
+ __responseType: null,
62
+ __originalResponseType: null,
63
+ };
64
+ }
65
+ exports.dropIndex = dropIndex;
66
+ function listIndexes() {
67
+ const payload = {};
68
+ const getRequestOptions = ambassadorWixDataV2Index.listIndexes(payload);
69
+ const getUrl = (context) => {
70
+ const { url } = getRequestOptions(context);
71
+ return url;
72
+ };
73
+ return {
74
+ getUrl,
75
+ httpMethod: 'GET',
76
+ path: '/v2/indexes',
77
+ pathParams: {},
78
+ __requestType: null,
79
+ __originalRequestType: null,
80
+ __responseType: null,
81
+ __originalResponseType: null,
82
+ };
83
+ }
84
+ exports.listIndexes = listIndexes;
85
+ function listAvailableIndexes() {
86
+ const payload = {};
87
+ const getRequestOptions = ambassadorWixDataV2Index.listAvailableIndexes(payload);
88
+ const getUrl = (context) => {
89
+ const { url } = getRequestOptions(context);
90
+ return url;
91
+ };
92
+ return {
93
+ getUrl,
94
+ httpMethod: 'GET',
95
+ path: '/v2/indexes/available',
96
+ pathParams: {},
97
+ __requestType: null,
98
+ __originalRequestType: null,
99
+ __responseType: null,
100
+ __originalResponseType: null,
101
+ };
102
+ }
103
+ exports.listAvailableIndexes = listAvailableIndexes;
104
+ //# sourceMappingURL=data-v2-index-indexes.meta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-v2-index-indexes.meta.js","sourceRoot":"","sources":["../../../src/data-v2-index-indexes.meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0FAA4E;AAsB5E,SAAgB,WAAW;IAUzB,MAAM,OAAO,GAAG,EAAS,CAAC;IAE1B,MAAM,iBAAiB,GAAG,wBAAwB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAExE,MAAM,MAAM,GAAG,CAAC,OAAY,EAAU,EAAE;QACtC,MAAM,EAAE,GAAG,EAAE,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAC3C,OAAO,GAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO;QACL,MAAM;QACN,UAAU,EAAE,MAAM;QAClB,IAAI,EAAE,aAAa;QACnB,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,IAAW;QAC1B,qBAAqB,EAAE,IAAW;QAClC,cAAc,EAAE,IAAW;QAC3B,sBAAsB,EAAE,IAAW;KACpC,CAAC;AACJ,CAAC;AA7BD,kCA6BC;AAED,SAAgB,SAAS;IAQvB,MAAM,OAAO,GAAG,EAAS,CAAC;IAE1B,MAAM,iBAAiB,GAAG,wBAAwB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAEtE,MAAM,MAAM,GAAG,CAAC,OAAY,EAAU,EAAE;QACtC,MAAM,EAAE,GAAG,EAAE,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAC3C,OAAO,GAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO;QACL,MAAM;QACN,UAAU,EAAE,QAAQ;QACpB,IAAI,EAAE,aAAa;QACnB,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,IAAW;QAC1B,qBAAqB,EAAE,IAAW;QAClC,cAAc,EAAE,IAAW;QAC3B,sBAAsB,EAAE,IAAW;KACpC,CAAC;AACJ,CAAC;AA3BD,8BA2BC;AAED,SAAgB,WAAW;IAUzB,MAAM,OAAO,GAAG,EAAS,CAAC;IAE1B,MAAM,iBAAiB,GAAG,wBAAwB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAExE,MAAM,MAAM,GAAG,CAAC,OAAY,EAAU,EAAE;QACtC,MAAM,EAAE,GAAG,EAAE,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAC3C,OAAO,GAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO;QACL,MAAM;QACN,UAAU,EAAE,KAAK;QACjB,IAAI,EAAE,aAAa;QACnB,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,IAAW;QAC1B,qBAAqB,EAAE,IAAW;QAClC,cAAc,EAAE,IAAW;QAC3B,sBAAsB,EAAE,IAAW;KACpC,CAAC;AACJ,CAAC;AA7BD,kCA6BC;AAED,SAAgB,oBAAoB;IAUlC,MAAM,OAAO,GAAG,EAAS,CAAC;IAE1B,MAAM,iBAAiB,GACrB,wBAAwB,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAEzD,MAAM,MAAM,GAAG,CAAC,OAAY,EAAU,EAAE;QACtC,MAAM,EAAE,GAAG,EAAE,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAC3C,OAAO,GAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO;QACL,MAAM;QACN,UAAU,EAAE,KAAK;QACjB,IAAI,EAAE,uBAAuB;QAC7B,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,IAAW;QAC1B,qBAAqB,EAAE,IAAW;QAClC,cAAc,EAAE,IAAW;QAC3B,sBAAsB,EAAE,IAAW;KACpC,CAAC;AACJ,CAAC;AA9BD,oDA8BC"}
@@ -0,0 +1,51 @@
1
+ import { HttpClient } from '@wix/sdk-types';
2
+ import { Index, IndexNonNullableFields, ListIndexesOptions, ListIndexesResponse, ListIndexesResponseNonNullableFields } from './data-v2-index-indexes.universal.js';
3
+ export declare const __metadata: {
4
+ PACKAGE_NAME: string;
5
+ };
6
+ export declare function createIndex(httpClient: HttpClient): CreateIndexSignature;
7
+ interface CreateIndexSignature {
8
+ /**
9
+ * Creates an index for a data collection.
10
+ *
11
+ * The index can't be used immediately, as the process of generating the index takes time.
12
+ * You can check whether an index is ready by calling List Indexes.
13
+ *
14
+ * Note that when an index fails to create, the failed index still occupies a slot.
15
+ * To remove the failed index and free up the slot for a new index, call Drop Index.
16
+ * @param - ID of the data collection for which to generate the index.
17
+ * @param - Details of the index to be created.
18
+ * @param - Options for creating an index.
19
+ * @returns Details of the index being generated.
20
+ */
21
+ (dataCollectionId: string, index: Index): Promise<Index & IndexNonNullableFields>;
22
+ }
23
+ export declare function dropIndex(httpClient: HttpClient): DropIndexSignature;
24
+ interface DropIndexSignature {
25
+ /**
26
+ * Removes an index from a data collection.
27
+ *
28
+ * The process of dropping an index from a collection takes time.
29
+ * You can check whether an index has been dropped by calling List Indexes.
30
+ * @param - ID of the data collection for which the index to be dropped is defined.
31
+ * @param - Name of the index to drop.
32
+ * @param - Options for dropping an index.
33
+ */
34
+ (dataCollectionId: string, indexName: string): Promise<void>;
35
+ }
36
+ export declare function listIndexes(httpClient: HttpClient): ListIndexesSignature;
37
+ interface ListIndexesSignature {
38
+ /**
39
+ * Lists all indexes defined for a data collection.
40
+ *
41
+ * When an index's status is `ACTIVE`, it is ready to use.
42
+ * While it is still being created, its status is `BUILDING`.
43
+ *
44
+ * When an index's status is `DROPPED`, it has been dropped successfully.
45
+ * While it is still in the process of being removed, its status is `DROPPING`.
46
+ * @param - ID of the data collection for which to list indexes.
47
+ * @param - Options for retrieving a list of indexes.
48
+ */
49
+ (dataCollectionId: string, options?: ListIndexesOptions | undefined): Promise<ListIndexesResponse & ListIndexesResponseNonNullableFields>;
50
+ }
51
+ export { CreateIndexRequest, CreateIndexResponse, CreateIndexResponseNonNullableFields, DropIndexRequest, DropIndexResponse, Environment, Failure, Field, Index, IndexNonNullableFields, ListAvailableIndexesRequest, ListAvailableIndexesResponse, ListAvailableIndexesResponseNonNullableFields, ListIndexesOptions, ListIndexesRequest, ListIndexesResponse, ListIndexesResponseNonNullableFields, Order, Paging, PagingMetadata, Status, } from './data-v2-index-indexes.universal.js';
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Status = exports.Order = exports.Environment = exports.listAvailableIndexes = exports.listIndexes = exports.dropIndex = exports.createIndex = exports.__metadata = void 0;
4
+ const data_v2_index_indexes_universal_js_1 = require("./data-v2-index-indexes.universal.js");
5
+ exports.__metadata = { PACKAGE_NAME: '@wix/data' };
6
+ function createIndex(httpClient) {
7
+ return (dataCollectionId, index) => (0, data_v2_index_indexes_universal_js_1.createIndex)(dataCollectionId, index,
8
+ // @ts-ignore
9
+ { httpClient });
10
+ }
11
+ exports.createIndex = createIndex;
12
+ function dropIndex(httpClient) {
13
+ return (dataCollectionId, indexName) => (0, data_v2_index_indexes_universal_js_1.dropIndex)(dataCollectionId, indexName,
14
+ // @ts-ignore
15
+ { httpClient });
16
+ }
17
+ exports.dropIndex = dropIndex;
18
+ function listIndexes(httpClient) {
19
+ return (dataCollectionId, options) => (0, data_v2_index_indexes_universal_js_1.listIndexes)(dataCollectionId, options,
20
+ // @ts-ignore
21
+ { httpClient });
22
+ }
23
+ exports.listIndexes = listIndexes;
24
+ /** @internal */
25
+ function listAvailableIndexes(httpClient) {
26
+ return (dataCollectionId) => (0, data_v2_index_indexes_universal_js_1.listAvailableIndexes)(dataCollectionId,
27
+ // @ts-ignore
28
+ { httpClient });
29
+ }
30
+ exports.listAvailableIndexes = listAvailableIndexes;
31
+ var data_v2_index_indexes_universal_js_2 = require("./data-v2-index-indexes.universal.js");
32
+ Object.defineProperty(exports, "Environment", { enumerable: true, get: function () { return data_v2_index_indexes_universal_js_2.Environment; } });
33
+ Object.defineProperty(exports, "Order", { enumerable: true, get: function () { return data_v2_index_indexes_universal_js_2.Order; } });
34
+ Object.defineProperty(exports, "Status", { enumerable: true, get: function () { return data_v2_index_indexes_universal_js_2.Status; } });
35
+ //# sourceMappingURL=data-v2-index-indexes.public.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-v2-index-indexes.public.js","sourceRoot":"","sources":["../../../src/data-v2-index-indexes.public.ts"],"names":[],"mappings":";;;AACA,6FAY8C;AAEjC,QAAA,UAAU,GAAG,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC;AAExD,SAAgB,WAAW,CAAC,UAAsB;IAChD,OAAO,CAAC,gBAAwB,EAAE,KAAY,EAAE,EAAE,CAChD,IAAA,gDAAoB,EAClB,gBAAgB,EAChB,KAAK;IACL,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AARD,kCAQC;AAqBD,SAAgB,SAAS,CAAC,UAAsB;IAC9C,OAAO,CAAC,gBAAwB,EAAE,SAAiB,EAAE,EAAE,CACrD,IAAA,8CAAkB,EAChB,gBAAgB,EAChB,SAAS;IACT,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AARD,8BAQC;AAeD,SAAgB,WAAW,CAAC,UAAsB;IAChD,OAAO,CAAC,gBAAwB,EAAE,OAA4B,EAAE,EAAE,CAChE,IAAA,gDAAoB,EAClB,gBAAgB,EAChB,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AARD,kCAQC;AAmBD,gBAAgB;AAChB,SAAgB,oBAAoB,CAClC,UAAsB;IAEtB,OAAO,CAAC,gBAAwB,EAAE,EAAE,CAClC,IAAA,yDAA6B,EAC3B,gBAAgB;IAChB,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AATD,oDASC;AAYD,2FAsB8C;AAhB5C,iIAAA,WAAW,OAAA;AAYX,2HAAA,KAAK,OAAA;AAGL,4HAAA,MAAM,OAAA"}
@@ -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,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Environment = exports.Status = exports.Order = void 0;
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
+ var Order;
9
+ (function (Order) {
10
+ Order["ASC"] = "ASC";
11
+ Order["DESC"] = "DESC";
12
+ })(Order || (exports.Order = Order = {}));
13
+ 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 || (exports.Status = Status = {}));
30
+ var Environment;
31
+ (function (Environment) {
32
+ Environment["LIVE"] = "LIVE";
33
+ Environment["SANDBOX"] = "SANDBOX";
34
+ Environment["SANDBOX_PREFERRED"] = "SANDBOX_PREFERRED";
35
+ })(Environment || (exports.Environment = Environment = {}));
36
+ //# 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,IAAY,KAGX;AAHD,WAAY,KAAK;IACf,oBAAW,CAAA;IACX,sBAAa,CAAA;AACf,CAAC,EAHW,KAAK,qBAAL,KAAK,QAGhB;AAaD,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,sBAAN,MAAM,QAejB;AA0BD,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,4BAAa,CAAA;IACb,kCAAmB,CAAA;IACnB,sDAAuC,CAAA;AACzC,CAAC,EAJW,WAAW,2BAAX,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 {};