kuzzle-sdk 7.10.7 → 7.11.0-beta.1

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.
@@ -1 +1 @@
1
- /*! Kuzzle Javascript SDK version 7.10.7 */
1
+ /*! Kuzzle Javascript SDK version 7.11.0-beta.1 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kuzzle-sdk",
3
- "version": "7.10.7",
3
+ "version": "7.11.0-beta.1",
4
4
  "description": "Official Javascript SDK for Kuzzle",
5
5
  "author": "The Kuzzle Team <support@kuzzle.io>",
6
6
  "repository": {
@@ -38,21 +38,30 @@
38
38
  "license": "Apache-2.0",
39
39
  "dependencies": {
40
40
  "min-req-promise": "^1.0.1",
41
- "ws": "^8.8.1"
41
+ "ws": "^8.13.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@babel/core": "^7.18.13",
45
- "@babel/preset-env": "^7.18.10",
46
- "@types/node": "^18.7.14",
47
- "babel-loader": "^8.2.5",
44
+ "@commitlint/cli": "^17.6.7",
45
+ "@commitlint/config-conventional": "^17.6.7",
46
+ "@semantic-release/changelog": "^6.0.3",
47
+ "@semantic-release/commit-analyzer": "^10.0.1",
48
+ "@semantic-release/git": "^10.0.1",
49
+ "@semantic-release/release-notes-generator": "^11.0.4",
50
+ "@babel/core": "^7.21.4",
51
+ "@babel/preset-env": "^7.21.4",
52
+ "@types/node": "^18.15.11",
53
+ "babel-loader": "^8.3.0",
48
54
  "buffer": "^6.0.3",
49
55
  "codecov": "^3.8.3",
50
56
  "cucumber": "^6.0.5",
57
+ "semantic-release-config-kuzzle": "^1.0.0",
58
+ "semantic-release-slack-bot": "^4.0.2",
59
+ "cz-conventional-changelog": "^3.3.0",
51
60
  "eslint-plugin-kuzzle": "^0.0.6",
52
61
  "https-browserify": "^1.0.0",
53
62
  "lodash": "^4.17.21",
54
63
  "lolex": "^6.0.0",
55
- "mocha": "10.0.0",
64
+ "mocha": "10.2.0",
56
65
  "mock-require": "^3.0.3",
57
66
  "nyc": "^15.1.0",
58
67
  "proxyquire": "^2.1.3",
@@ -60,13 +69,13 @@
60
69
  "rewire": "^6.0.0",
61
70
  "should": "13.2.3",
62
71
  "should-sinon": "0.0.6",
63
- "sinon": "^14.0.0",
72
+ "sinon": "^14.0.2",
64
73
  "stream-http": "^3.2.0",
65
74
  "ts-morph": "^15.1.0",
66
75
  "ts-node": "^10.9.1",
67
- "typescript": "^4.8.2",
76
+ "typescript": "^4.9.5",
68
77
  "url": "^0.11.0",
69
- "webpack": "^5.74.0",
78
+ "webpack": "^5.79.0",
70
79
  "webpack-cli": "^4.10.0"
71
80
  },
72
81
  "engines": {
@@ -320,7 +320,7 @@ export interface ArgsAuthControllerCreateApiKey extends ArgsDefault {
320
320
  expiresIn?: number;
321
321
  refresh?: "wait_for" | "false";
322
322
  }
323
- export declare type ArgsAuthControllerCheckRights = ArgsDefault;
323
+ export type ArgsAuthControllerCheckRights = ArgsDefault;
324
324
  export interface ArgsAuthControllerDeleteApiKey extends ArgsDefault {
325
325
  refresh?: "wait_for" | "false";
326
326
  }
@@ -329,17 +329,17 @@ export interface ArgsAuthControllerSearchApiKeys extends ArgsDefault {
329
329
  size?: number;
330
330
  lang?: string;
331
331
  }
332
- export declare type ArgsAuthControllerCheckToken = ArgsDefault;
333
- export declare type ArgsAuthControllerCreateMyCredentials = ArgsDefault;
334
- export declare type ArgsAuthControllerCredentialsExist = ArgsDefault;
335
- export declare type ArgsAuthControllerDeleteMyCredentials = ArgsDefault;
336
- export declare type ArgsAuthControllerGetCurrentUser = ArgsDefault;
337
- export declare type ArgsAuthControllerGetMyCredentials = ArgsDefault;
338
- export declare type ArgsAuthControllerGetMyRights = ArgsDefault;
339
- export declare type ArgsAuthControllerGetStrategies = ArgsDefault;
340
- export declare type ArgsAuthControllerUpdateMyCredentials = ArgsDefault;
341
- export declare type ArgsAuthControllerUpdateSelf = ArgsDefault;
342
- export declare type ArgsAuthControllerValidateMyCredentials = ArgsDefault;
332
+ export type ArgsAuthControllerCheckToken = ArgsDefault;
333
+ export type ArgsAuthControllerCreateMyCredentials = ArgsDefault;
334
+ export type ArgsAuthControllerCredentialsExist = ArgsDefault;
335
+ export type ArgsAuthControllerDeleteMyCredentials = ArgsDefault;
336
+ export type ArgsAuthControllerGetCurrentUser = ArgsDefault;
337
+ export type ArgsAuthControllerGetMyCredentials = ArgsDefault;
338
+ export type ArgsAuthControllerGetMyRights = ArgsDefault;
339
+ export type ArgsAuthControllerGetStrategies = ArgsDefault;
340
+ export type ArgsAuthControllerUpdateMyCredentials = ArgsDefault;
341
+ export type ArgsAuthControllerUpdateSelf = ArgsDefault;
342
+ export type ArgsAuthControllerValidateMyCredentials = ArgsDefault;
343
343
  export interface ArgsAuthControllerRefreshToken extends ArgsDefault {
344
344
  expiresIn?: number | string;
345
345
  }
@@ -167,7 +167,7 @@ export declare class BulkController extends BaseController {
167
167
  export interface ArgsBulkControllerDeleteByQuery extends ArgsDefault {
168
168
  refresh?: "wait_for" | "false";
169
169
  }
170
- export declare type ArgsBulkControllerImport = ArgsDefault;
170
+ export type ArgsBulkControllerImport = ArgsDefault;
171
171
  export interface ArgsBulkControllerUpdateByQuery extends ArgsDefault {
172
172
  refresh?: "wait_for" | "false";
173
173
  }
@@ -225,14 +225,14 @@ export declare class CollectionController extends BaseController {
225
225
  */
226
226
  delete(index: string, collection: string, options?: ArgsCollectionControllerDelete): Promise<void>;
227
227
  }
228
- export declare type ArgsCollectionControllerCreate = ArgsDefault;
229
- export declare type ArgsCollectionControllerDeleteSpecifications = ArgsDefault;
230
- export declare type ArgsCollectionControllerExists = ArgsDefault;
231
- export declare type ArgsCollectionControllerRefresh = ArgsDefault;
228
+ export type ArgsCollectionControllerCreate = ArgsDefault;
229
+ export type ArgsCollectionControllerDeleteSpecifications = ArgsDefault;
230
+ export type ArgsCollectionControllerExists = ArgsDefault;
231
+ export type ArgsCollectionControllerRefresh = ArgsDefault;
232
232
  export interface ArgsCollectionControllerGetMapping extends ArgsDefault {
233
233
  includeKuzzleMeta?: boolean;
234
234
  }
235
- export declare type ArgsCollectionControllerGetSpecifications = ArgsDefault;
235
+ export type ArgsCollectionControllerGetSpecifications = ArgsDefault;
236
236
  export interface ArgsCollectionControllerList extends ArgsDefault {
237
237
  from?: number;
238
238
  size?: number;
@@ -242,9 +242,9 @@ export interface ArgsCollectionControllerSearchSpecifications extends ArgsDefaul
242
242
  size?: number;
243
243
  scroll?: string;
244
244
  }
245
- export declare type ArgsCollectionControllerTruncate = ArgsDefault;
246
- export declare type ArgsCollectionControllerUpdate = ArgsDefault;
247
- export declare type ArgsCollectionControllerUpdateMapping = ArgsDefault;
248
- export declare type ArgsCollectionControllerUpdateSpecifications = ArgsDefault;
249
- export declare type ArgsCollectionControllerValidateSpecifications = ArgsDefault;
250
- export declare type ArgsCollectionControllerDelete = ArgsDefault;
245
+ export type ArgsCollectionControllerTruncate = ArgsDefault;
246
+ export type ArgsCollectionControllerUpdate = ArgsDefault;
247
+ export type ArgsCollectionControllerUpdateMapping = ArgsDefault;
248
+ export type ArgsCollectionControllerUpdateSpecifications = ArgsDefault;
249
+ export type ArgsCollectionControllerValidateSpecifications = ArgsDefault;
250
+ export type ArgsCollectionControllerDelete = ArgsDefault;
@@ -413,7 +413,7 @@ export declare class DocumentController extends BaseController {
413
413
  */
414
414
  validate<TKDocumentContent extends KDocumentContentGeneric>(index: string, collection: string, content: TKDocumentContent, options?: ArgsDocumentControllerValidate): Promise<boolean>;
415
415
  }
416
- export declare type ArgsDocumentControllerCount = ArgsDefault;
416
+ export type ArgsDocumentControllerCount = ArgsDefault;
417
417
  export interface ArgsDocumentControllerCreate extends ArgsDefault {
418
418
  refresh?: "wait_for" | "false";
419
419
  silent?: boolean;
@@ -509,4 +509,4 @@ export interface ArgsDocumentControllerUpsert<TKDocumentContent> extends ArgsDef
509
509
  retryOnConflict?: boolean;
510
510
  source?: boolean;
511
511
  }
512
- export declare type ArgsDocumentControllerValidate = ArgsDefault;
512
+ export type ArgsDocumentControllerValidate = ArgsDefault;
@@ -69,9 +69,9 @@ export declare class IndexController extends BaseController {
69
69
  */
70
70
  stats(options?: ArgsIndexControllerStats): Promise<JSONObject>;
71
71
  }
72
- export declare type ArgsIndexControllerCreate = ArgsDefault;
73
- export declare type ArgsIndexControllerDelete = ArgsDefault;
74
- export declare type ArgsIndexControllerExists = ArgsDefault;
75
- export declare type ArgsIndexControllerList = ArgsDefault;
76
- export declare type ArgsIndexControllerMDelete = ArgsDefault;
77
- export declare type ArgsIndexControllerStats = ArgsDefault;
72
+ export type ArgsIndexControllerCreate = ArgsDefault;
73
+ export type ArgsIndexControllerDelete = ArgsDefault;
74
+ export type ArgsIndexControllerExists = ArgsDefault;
75
+ export type ArgsIndexControllerList = ArgsDefault;
76
+ export type ArgsIndexControllerMDelete = ArgsDefault;
77
+ export type ArgsIndexControllerStats = ArgsDefault;
@@ -120,7 +120,7 @@ export declare class RealtimeController extends BaseController {
120
120
  */
121
121
  private removeSubscriptions;
122
122
  }
123
- export declare type ArgsRealtimeControllerCount = ArgsDefault;
123
+ export type ArgsRealtimeControllerCount = ArgsDefault;
124
124
  export interface ArgsRealtimeControllerPublish extends ArgsDefault {
125
125
  _id?: string;
126
126
  }
@@ -130,4 +130,4 @@ export interface ArgsRealtimeControllerSubscribe extends ArgsDefault {
130
130
  subscribeToSelf?: boolean;
131
131
  volatile?: JSONObject;
132
132
  }
133
- export declare type ArgsRealtimeControllerUnsubscribe = ArgsDefault;
133
+ export type ArgsRealtimeControllerUnsubscribe = ArgsDefault;
@@ -99,7 +99,7 @@ export interface ArgsSecurityControllerCreateApiKey extends ArgsDefault {
99
99
  _id?: string;
100
100
  refresh?: "wait_for" | "false";
101
101
  }
102
- export declare type ArgsSecurityControllerCheckRights = ArgsDefault;
102
+ export type ArgsSecurityControllerCheckRights = ArgsDefault;
103
103
  export interface ArgsSecurityControllerDeleteApiKey extends ArgsDefault {
104
104
  refresh?: "wait_for" | "false";
105
105
  }
@@ -108,55 +108,55 @@ export interface ArgsSecurityControllerSearchApiKeys extends ArgsDefault {
108
108
  size?: number;
109
109
  lang?: string;
110
110
  }
111
- export declare type ArgsSecurityControllerCreateCredentials = ArgsDefault;
111
+ export type ArgsSecurityControllerCreateCredentials = ArgsDefault;
112
112
  export interface ArgsSecurityControllerCreateFirstAdmin extends ArgsDefault {
113
113
  reset?: boolean;
114
114
  }
115
- export declare type ArgsSecurityControllerCreateOrReplaceProfile = ArgsDefault;
115
+ export type ArgsSecurityControllerCreateOrReplaceProfile = ArgsDefault;
116
116
  export interface ArgsSecurityControllerCreateOrReplaceRole extends ArgsDefault {
117
117
  force?: boolean;
118
118
  }
119
- export declare type ArgsSecurityControllerCreateProfile = ArgsDefault;
120
- export declare type ArgsSecurityControllerCreateRestrictedUser = ArgsDefault;
119
+ export type ArgsSecurityControllerCreateProfile = ArgsDefault;
120
+ export type ArgsSecurityControllerCreateRestrictedUser = ArgsDefault;
121
121
  export interface ArgsSecurityControllerCreateRole extends ArgsDefault {
122
122
  force?: boolean;
123
123
  }
124
- export declare type ArgsSecurityControllerCreateUser = ArgsDefault;
125
- export declare type ArgsSecurityControllerDeleteCredentials = ArgsDefault;
126
- export declare type ArgsSecurityControllerDeleteProfile = ArgsDefault;
127
- export declare type ArgsSecurityControllerDeleteRole = ArgsDefault;
128
- export declare type ArgsSecurityControllerDeleteUser = ArgsDefault;
129
- export declare type ArgsSecurityControllerGetAllCredentialFields = ArgsDefault;
130
- export declare type ArgsSecurityControllerGetCredentialFields = ArgsDefault;
131
- export declare type ArgsSecurityControllerGetCredentials = ArgsDefault;
132
- export declare type ArgsSecurityControllerGetCredentialsById = ArgsDefault;
133
- export declare type ArgsSecurityControllerGetProfile = ArgsDefault;
134
- export declare type ArgsSecurityControllerGetProfileMapping = ArgsDefault;
135
- export declare type ArgsSecurityControllerGetProfileRights = ArgsDefault;
136
- export declare type ArgsSecurityControllerGetRole = ArgsDefault;
137
- export declare type ArgsSecurityControllerGetRoleMapping = ArgsDefault;
138
- export declare type ArgsSecurityControllerGetUser = ArgsDefault;
139
- export declare type ArgsSecurityControllerGetUserMapping = ArgsDefault;
140
- export declare type ArgsSecurityControllerGetUserRights = ArgsDefault;
141
- export declare type ArgsSecurityControllerGetUserStrategies = ArgsDefault;
142
- export declare type ArgsSecurityControllerHasCredentials = ArgsDefault;
143
- export declare type ArgsSecurityControllerMDeleteProfiles = ArgsDefault;
144
- export declare type ArgsSecurityControllerMDeleteRoles = ArgsDefault;
145
- export declare type ArgsSecurityControllerMDeleteUsers = ArgsDefault;
146
- export declare type ArgsSecurityControllerMGetProfiles = ArgsDefault;
147
- export declare type ArgsSecurityControllerMGetUsers = ArgsDefault;
148
- export declare type ArgsSecurityControllerMGetRoles = ArgsDefault;
149
- export declare type ArgsSecurityControllerReplaceUser = ArgsDefault;
150
- export declare type ArgsSecurityControllerSearchProfiles = ArgsDefault;
151
- export declare type ArgsSecurityControllerSearchRoles = ArgsDefault;
152
- export declare type ArgsSecurityControllerSearchUsers = ArgsDefault;
153
- export declare type ArgsSecurityControllerUpdateCredentials = ArgsDefault;
154
- export declare type ArgsSecurityControllerUpdateProfile = ArgsDefault;
155
- export declare type ArgsSecurityControllerUpdateProfileMapping = ArgsDefault;
124
+ export type ArgsSecurityControllerCreateUser = ArgsDefault;
125
+ export type ArgsSecurityControllerDeleteCredentials = ArgsDefault;
126
+ export type ArgsSecurityControllerDeleteProfile = ArgsDefault;
127
+ export type ArgsSecurityControllerDeleteRole = ArgsDefault;
128
+ export type ArgsSecurityControllerDeleteUser = ArgsDefault;
129
+ export type ArgsSecurityControllerGetAllCredentialFields = ArgsDefault;
130
+ export type ArgsSecurityControllerGetCredentialFields = ArgsDefault;
131
+ export type ArgsSecurityControllerGetCredentials = ArgsDefault;
132
+ export type ArgsSecurityControllerGetCredentialsById = ArgsDefault;
133
+ export type ArgsSecurityControllerGetProfile = ArgsDefault;
134
+ export type ArgsSecurityControllerGetProfileMapping = ArgsDefault;
135
+ export type ArgsSecurityControllerGetProfileRights = ArgsDefault;
136
+ export type ArgsSecurityControllerGetRole = ArgsDefault;
137
+ export type ArgsSecurityControllerGetRoleMapping = ArgsDefault;
138
+ export type ArgsSecurityControllerGetUser = ArgsDefault;
139
+ export type ArgsSecurityControllerGetUserMapping = ArgsDefault;
140
+ export type ArgsSecurityControllerGetUserRights = ArgsDefault;
141
+ export type ArgsSecurityControllerGetUserStrategies = ArgsDefault;
142
+ export type ArgsSecurityControllerHasCredentials = ArgsDefault;
143
+ export type ArgsSecurityControllerMDeleteProfiles = ArgsDefault;
144
+ export type ArgsSecurityControllerMDeleteRoles = ArgsDefault;
145
+ export type ArgsSecurityControllerMDeleteUsers = ArgsDefault;
146
+ export type ArgsSecurityControllerMGetProfiles = ArgsDefault;
147
+ export type ArgsSecurityControllerMGetUsers = ArgsDefault;
148
+ export type ArgsSecurityControllerMGetRoles = ArgsDefault;
149
+ export type ArgsSecurityControllerReplaceUser = ArgsDefault;
150
+ export type ArgsSecurityControllerSearchProfiles = ArgsDefault;
151
+ export type ArgsSecurityControllerSearchRoles = ArgsDefault;
152
+ export type ArgsSecurityControllerSearchUsers = ArgsDefault;
153
+ export type ArgsSecurityControllerUpdateCredentials = ArgsDefault;
154
+ export type ArgsSecurityControllerUpdateProfile = ArgsDefault;
155
+ export type ArgsSecurityControllerUpdateProfileMapping = ArgsDefault;
156
156
  export interface ArgsSecurityControllerUpdateRole extends ArgsDefault {
157
157
  force?: boolean;
158
158
  }
159
- export declare type ArgsSecurityControllerUpdateRoleMapping = ArgsDefault;
160
- export declare type ArgsSecurityControllerUpdateUser = ArgsDefault;
161
- export declare type ArgsSecurityControllerUpdateUserMapping = ArgsDefault;
162
- export declare type ArgsSecurityControllerValidateCredentials = ArgsDefault;
159
+ export type ArgsSecurityControllerUpdateRoleMapping = ArgsDefault;
160
+ export type ArgsSecurityControllerUpdateUser = ArgsDefault;
161
+ export type ArgsSecurityControllerUpdateUserMapping = ArgsDefault;
162
+ export type ArgsSecurityControllerValidateCredentials = ArgsDefault;
@@ -68,10 +68,10 @@ export declare class ServerController extends BaseController {
68
68
  */
69
69
  now(options: ArgsServerControllerNow): Promise<any>;
70
70
  }
71
- export declare type ArgsServerControllerAdminExists = ArgsDefault;
72
- export declare type ArgsServerControllerGetAllStats = ArgsDefault;
73
- export declare type ArgsServerControllerGetConfig = ArgsDefault;
74
- export declare type ArgsServerControllerGetLastStats = ArgsDefault;
75
- export declare type ArgsServerControllerGetStats = ArgsDefault;
76
- export declare type ArgsServerControllerInfo = ArgsDefault;
77
- export declare type ArgsServerControllerNow = ArgsDefault;
71
+ export type ArgsServerControllerAdminExists = ArgsDefault;
72
+ export type ArgsServerControllerGetAllStats = ArgsDefault;
73
+ export type ArgsServerControllerGetConfig = ArgsDefault;
74
+ export type ArgsServerControllerGetLastStats = ArgsDefault;
75
+ export type ArgsServerControllerGetStats = ArgsDefault;
76
+ export type ArgsServerControllerInfo = ArgsDefault;
77
+ export type ArgsServerControllerNow = ArgsDefault;
@@ -1,10 +1,10 @@
1
- declare type ListenerFunction = (...args: unknown[]) => unknown;
2
- export declare type PublicKuzzleEvents = "callbackError" | "connected" | "discarded" | "disconnected" | "loginAttempt" | "logoutAttempt" | "networkError" | "offlineQueuePush" | "offlineQueuePop" | "queryError" | "reAuthenticated" | "reconnected" | "reconnectionError" | "tokenExpired";
3
- declare type PrivateKuzzleEvents = "connect" | "reconnect" | "disconnect" | "offlineQueuePush" | "websocketRenewalStart" | "websocketRenewalDone";
1
+ type ListenerFunction = (...args: unknown[]) => unknown;
2
+ export type PublicKuzzleEvents = "callbackError" | "connected" | "discarded" | "disconnected" | "loginAttempt" | "logoutAttempt" | "networkError" | "offlineQueuePush" | "offlineQueuePop" | "queryError" | "reAuthenticated" | "reconnected" | "reconnectionError" | "tokenExpired";
3
+ type PrivateKuzzleEvents = "connect" | "reconnect" | "disconnect" | "offlineQueuePush" | "websocketRenewalStart" | "websocketRenewalDone";
4
4
  /**
5
5
  * For internal use only
6
6
  */
7
- export declare type PrivateAndPublicSDKEvents = PublicKuzzleEvents | PrivateKuzzleEvents;
7
+ export type PrivateAndPublicSDKEvents = PublicKuzzleEvents | PrivateKuzzleEvents;
8
8
  /**
9
9
  * @todo proper TS conversion
10
10
  */
@@ -3,7 +3,7 @@ import { RealtimeDocument } from "./RealtimeDocument";
3
3
  import { JSONObject, KDocument, KDocumentContentGeneric } from "../types";
4
4
  import { RealtimeDocumentSearchResult } from "./searchResult/RealtimeDocument";
5
5
  import { ArgsDocumentControllerGet, ArgsDocumentControllerMGet, ArgsDocumentControllerSearch } from "../controllers/Document";
6
- export declare type ObserverOptions = {
6
+ export type ObserverOptions = {
7
7
  /**
8
8
  * Refresh delay in ms when the SDK is using the HTTP protocol.
9
9
  *
@@ -10,15 +10,6 @@ const RealtimeDocument_2 = require("./searchResult/RealtimeDocument");
10
10
  * @internal
11
11
  */
12
12
  class ObservedDocuments extends Set {
13
- constructor(index, collection) {
14
- super();
15
- /**
16
- * Room ID for the realtime subscription on the collection of observed documents
17
- */
18
- this.roomId = null;
19
- this.index = index;
20
- this.collection = collection;
21
- }
22
13
  /**
23
14
  * Gets documents IDs
24
15
  */
@@ -33,6 +24,15 @@ class ObservedDocuments extends Set {
33
24
  ids: { values: Array.from(this.values()) },
34
25
  };
35
26
  }
27
+ constructor(index, collection) {
28
+ super();
29
+ /**
30
+ * Room ID for the realtime subscription on the collection of observed documents
31
+ */
32
+ this.roomId = null;
33
+ this.index = index;
34
+ this.collection = collection;
35
+ }
36
36
  }
37
37
  /**
38
38
  * Provide an Uniform Resource Locator given an index, a collection and a document
@@ -3,7 +3,7 @@ import { InstrumentablePromise } from "../InstrumentablePromise";
3
3
  /**
4
4
  * @internal
5
5
  */
6
- export declare type DocumentsBuffer = {
6
+ export type DocumentsBuffer = {
7
7
  documents: Array<{
8
8
  _id: string;
9
9
  body: JSONObject;
@@ -18,7 +18,7 @@ export declare type DocumentsBuffer = {
18
18
  *
19
19
  * @internal
20
20
  */
21
- export declare type IndexBuffer = Map<string, Map<string, DocumentsBuffer>>;
21
+ export type IndexBuffer = Map<string, Map<string, DocumentsBuffer>>;
22
22
  /**
23
23
  * @internal
24
24
  */
@@ -16,22 +16,6 @@ const BatchBuffer_1 = require("./BatchBuffer");
16
16
  * @internal
17
17
  */
18
18
  class BatchWriter {
19
- constructor(sdk, { interval = 10, maxWriteBufferSize = 200, maxReadBufferSize = 200 } = {}) {
20
- // Buffers
21
- this.buffers = {
22
- create: new BatchBuffer_1.BatchBuffer(),
23
- createOrReplace: new BatchBuffer_1.BatchBuffer(),
24
- delete: new BatchBuffer_1.BatchBuffer(),
25
- exists: new BatchBuffer_1.BatchBuffer(),
26
- get: new BatchBuffer_1.BatchBuffer(),
27
- replace: new BatchBuffer_1.BatchBuffer(),
28
- update: new BatchBuffer_1.BatchBuffer(),
29
- };
30
- this.sdk = sdk;
31
- this.interval = interval;
32
- this.maxWriteBufferSize = maxWriteBufferSize;
33
- this.maxReadBufferSize = maxReadBufferSize;
34
- }
35
19
  get addCreate() {
36
20
  // @todo implements the send of buffer if approaching the limit
37
21
  return this.buffers.create.add.bind(this.buffers.create);
@@ -54,6 +38,22 @@ class BatchWriter {
54
38
  get addCreateOrReplace() {
55
39
  return this.buffers.createOrReplace.add.bind(this.buffers.createOrReplace);
56
40
  }
41
+ constructor(sdk, { interval = 10, maxWriteBufferSize = 200, maxReadBufferSize = 200 } = {}) {
42
+ // Buffers
43
+ this.buffers = {
44
+ create: new BatchBuffer_1.BatchBuffer(),
45
+ createOrReplace: new BatchBuffer_1.BatchBuffer(),
46
+ delete: new BatchBuffer_1.BatchBuffer(),
47
+ exists: new BatchBuffer_1.BatchBuffer(),
48
+ get: new BatchBuffer_1.BatchBuffer(),
49
+ replace: new BatchBuffer_1.BatchBuffer(),
50
+ update: new BatchBuffer_1.BatchBuffer(),
51
+ };
52
+ this.sdk = sdk;
53
+ this.interval = interval;
54
+ this.maxWriteBufferSize = maxWriteBufferSize;
55
+ this.maxReadBufferSize = maxReadBufferSize;
56
+ }
57
57
  /**
58
58
  * Execute API actions with documents stored in the buffers.
59
59
  */
@@ -6,6 +6,9 @@ const uuidv4_1 = require("../../utils/uuidv4");
6
6
  const KuzzleEventEmitter_1 = require("../../core/KuzzleEventEmitter");
7
7
  const PendingRequest_1 = require("./PendingRequest");
8
8
  class KuzzleAbstractProtocol extends KuzzleEventEmitter_1.KuzzleEventEmitter {
9
+ get sslConnection() {
10
+ return this._ssl;
11
+ }
9
12
  constructor(host, options = {}, name = undefined) {
10
13
  super();
11
14
  this._pendingRequests = new Map();
@@ -38,9 +41,6 @@ class KuzzleAbstractProtocol extends KuzzleEventEmitter_1.KuzzleEventEmitter {
38
41
  }
39
42
  });
40
43
  }
41
- get sslConnection() {
42
- return this._ssl;
43
- }
44
44
  /**
45
45
  * Kuzzle server host or IP.
46
46
  */
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @see https://docs.kuzzle.io/core/2/guides/advanced/api-keys/
5
5
  */
6
- export declare type ApiKey = {
6
+ export type ApiKey = {
7
7
  /**
8
8
  * ApiKey unique ID
9
9
  */
@@ -17,7 +17,7 @@
17
17
  * }
18
18
  * }
19
19
  */
20
- export declare type HttpRoutes = {
20
+ export type HttpRoutes = {
21
21
  /**
22
22
  * Controller name
23
23
  */
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * An interface representing an object with string key and any value
3
3
  */
4
- export declare type JSONObject = Record<PropertyKey, any>;
4
+ export type JSONObject = Record<PropertyKey, any>;
@@ -56,4 +56,14 @@ export interface KHit<TKDocumentContent extends KDocumentContent> extends KDocum
56
56
  * Elasticsearch relevance score
57
57
  */
58
58
  _score: number;
59
+ /**
60
+ * Document index
61
+ * Present only in the case of a multi search
62
+ */
63
+ index?: string;
64
+ /**
65
+ * Document collection
66
+ * Present only in the case of a multi search
67
+ */
68
+ collection?: string;
59
69
  }
@@ -1,8 +1,8 @@
1
1
  import { JSONObject } from "./JSONObject";
2
- declare type PropertyObject = {
2
+ type PropertyObject = {
3
3
  properties?: MappingsProperties;
4
4
  };
5
- declare type PropertyDynamic = {
5
+ type PropertyDynamic = {
6
6
  /**
7
7
  * Dynamic mapping policy
8
8
  *
@@ -10,12 +10,12 @@ declare type PropertyDynamic = {
10
10
  */
11
11
  dynamic?: "true" | "false" | "strict";
12
12
  };
13
- declare type PropertyType = {
13
+ type PropertyType = {
14
14
  [name: string]: {
15
15
  type?: string;
16
16
  } | PropertyObject | JSONObject;
17
17
  };
18
- export declare type MappingsProperties = PropertyObject | PropertyDynamic | PropertyType;
18
+ export type MappingsProperties = PropertyObject | PropertyDynamic | PropertyType;
19
19
  /**
20
20
  * Collection mappings definition
21
21
  *
@@ -35,7 +35,7 @@ export declare type MappingsProperties = PropertyObject | PropertyDynamic | Prop
35
35
  * }
36
36
  * ```
37
37
  */
38
- export declare type CollectionMappings = {
38
+ export type CollectionMappings = {
39
39
  /**
40
40
  * Collection metadata
41
41
  *
@@ -3,7 +3,7 @@ import { KDocument, KDocumentContentGeneric } from ".";
3
3
  /**
4
4
  * Enum for notification types
5
5
  */
6
- export declare type NotificationType = "document" | "user" | "TokenExpired";
6
+ export type NotificationType = "document" | "user" | "TokenExpired";
7
7
  export interface BaseNotification {
8
8
  /**
9
9
  * Notification type
@@ -92,4 +92,4 @@ export interface ServerNotification extends BaseNotification {
92
92
  /**
93
93
  * Real-time notifications sent by Kuzzle.
94
94
  */
95
- export declare type Notification = DocumentNotification | UserNotification | ServerNotification;
95
+ export type Notification = DocumentNotification | UserNotification | ServerNotification;
@@ -15,7 +15,7 @@
15
15
  *
16
16
  * @see https://docs.kuzzle.io/core/2/guides/main-concepts/permissions/#policies
17
17
  */
18
- export declare type ProfilePolicy = {
18
+ export type ProfilePolicy = {
19
19
  /**
20
20
  * Role unique ID used by this policy
21
21
  */
@@ -21,7 +21,7 @@
21
21
  *
22
22
  * @see https://docs.kuzzle.io/core/2/guides/main-concepts/permissions/#roles
23
23
  */
24
- export declare type RoleRightsDefinition = {
24
+ export type RoleRightsDefinition = {
25
25
  /**
26
26
  * API controller name
27
27
  */
@@ -1,5 +1,5 @@
1
1
  import { KDocumentContentGeneric } from "./KDocument";
2
- export declare type mCreateRequest<TKDocumentContent extends KDocumentContentGeneric> = Array<{
2
+ export type mCreateRequest<TKDocumentContent extends KDocumentContentGeneric> = Array<{
3
3
  /**
4
4
  * Document unique identifier
5
5
  */
@@ -9,7 +9,7 @@ export declare type mCreateRequest<TKDocumentContent extends KDocumentContentGen
9
9
  */
10
10
  body: Partial<TKDocumentContent>;
11
11
  }>;
12
- export declare type mCreateOrReplaceRequest<TKDocumentContent extends KDocumentContentGeneric> = Array<{
12
+ export type mCreateOrReplaceRequest<TKDocumentContent extends KDocumentContentGeneric> = Array<{
13
13
  /**
14
14
  * Document unique identifier
15
15
  */
@@ -19,9 +19,9 @@ export declare type mCreateOrReplaceRequest<TKDocumentContent extends KDocumentC
19
19
  */
20
20
  body: Partial<TKDocumentContent>;
21
21
  }>;
22
- export declare type mReplaceRequest<TKDocumentContent extends KDocumentContentGeneric> = mCreateOrReplaceRequest<TKDocumentContent>;
23
- export declare type mUpdateRequest<TKDocumentContent extends KDocumentContentGeneric> = mCreateOrReplaceRequest<TKDocumentContent>;
24
- export declare type mUpsertRequest<TKDocumentContent extends KDocumentContentGeneric> = Array<{
22
+ export type mReplaceRequest<TKDocumentContent extends KDocumentContentGeneric> = mCreateOrReplaceRequest<TKDocumentContent>;
23
+ export type mUpdateRequest<TKDocumentContent extends KDocumentContentGeneric> = mCreateOrReplaceRequest<TKDocumentContent>;
24
+ export type mUpsertRequest<TKDocumentContent extends KDocumentContentGeneric> = Array<{
25
25
  /**
26
26
  * Document unique identifier
27
27
  */
@@ -35,4 +35,4 @@ export declare type mUpsertRequest<TKDocumentContent extends KDocumentContentGen
35
35
  */
36
36
  default?: Partial<TKDocumentContent>;
37
37
  }>;
38
- export declare type mDeleteRequest = string[];
38
+ export type mDeleteRequest = string[];