kuzzle 2.17.3 → 2.17.6
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.
- package/README.md +1 -1
- package/index.js +5 -1
- package/lib/api/controllers/adminController.js +4 -3
- package/lib/api/openapi/components/index.js +5 -1
- package/lib/api/openapi/index.js +5 -1
- package/lib/api/request/index.js +5 -1
- package/lib/api/request/kuzzleRequest.js +5 -1
- package/lib/api/request/requestContext.js +5 -1
- package/lib/api/request/requestInput.js +5 -1
- package/lib/api/request/requestResponse.js +5 -1
- package/lib/cluster/state.js +5 -1
- package/lib/core/backend/backend.js +5 -1
- package/lib/core/backend/backendConfig.js +5 -1
- package/lib/core/backend/backendController.js +5 -1
- package/lib/core/backend/backendErrors.d.ts +11 -8
- package/lib/core/backend/backendErrors.js +31 -23
- package/lib/core/backend/backendHook.js +5 -1
- package/lib/core/backend/backendImport.js +5 -1
- package/lib/core/backend/backendPipe.js +5 -1
- package/lib/core/backend/backendPlugin.js +5 -1
- package/lib/core/backend/backendVault.js +5 -1
- package/lib/core/backend/index.js +5 -1
- package/lib/core/plugin/pluginContext.js +5 -1
- package/lib/core/realtime/channel.js +5 -1
- package/lib/core/realtime/hotelClerk.js +5 -1
- package/lib/core/security/profileRepository.js +5 -1
- package/lib/core/shared/sdk/embeddedSdk.js +5 -1
- package/lib/core/storage/clientAdapter.js +4 -4
- package/lib/core/storage/indexCache.js +5 -1
- package/lib/kerror/errors/index.js +5 -1
- package/lib/kerror/errors/kuzzleError.d.ts +4 -0
- package/lib/kerror/errors/kuzzleError.js +9 -2
- package/lib/kerror/index.js +6 -1
- package/lib/kuzzle/kuzzle.js +5 -1
- package/lib/model/security/profile.js +5 -1
- package/lib/model/security/role.js +5 -1
- package/lib/model/security/user.js +5 -1
- package/lib/service/storage/elasticsearch.js +5 -4
- package/lib/types/Plugin.js +5 -1
- package/lib/types/index.js +5 -1
- package/lib/util/dump-collection.js +5 -1
- package/lib/util/mutex.js +5 -1
- package/package-lock.json +518 -717
- package/package.json +23 -23
package/README.md
CHANGED
|
@@ -148,4 +148,4 @@ Run the following command to install all the dependencies in your container:
|
|
|
148
148
|
npm run docker:install
|
|
149
149
|
```
|
|
150
150
|
|
|
151
|
-
finally run the command `docker-compose up` to launch your kuzzle stack.
|
|
151
|
+
finally run the command `docker-compose up` to launch your kuzzle stack.
|
package/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -154,10 +154,11 @@ class AdminController extends NativeController {
|
|
|
154
154
|
|
|
155
155
|
loadFixtures (request) {
|
|
156
156
|
const fixtures = request.getBody();
|
|
157
|
+
const refresh = request.getRefresh('wait_for');
|
|
157
158
|
|
|
158
|
-
return
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
return global.kuzzle.ask('core:storage:public:document:import', fixtures, {
|
|
160
|
+
refresh
|
|
161
|
+
});
|
|
161
162
|
}
|
|
162
163
|
|
|
163
164
|
loadMappings (request) {
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/lib/api/openapi/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/lib/api/request/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -21,7 +21,11 @@
|
|
|
21
21
|
*/
|
|
22
22
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
23
23
|
if (k2 === undefined) k2 = k;
|
|
24
|
-
Object.
|
|
24
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
25
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
26
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
27
|
+
}
|
|
28
|
+
Object.defineProperty(o, k2, desc);
|
|
25
29
|
}) : (function(o, m, k, k2) {
|
|
26
30
|
if (k2 === undefined) k2 = k;
|
|
27
31
|
o[k2] = m[k];
|
|
@@ -21,7 +21,11 @@
|
|
|
21
21
|
*/
|
|
22
22
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
23
23
|
if (k2 === undefined) k2 = k;
|
|
24
|
-
Object.
|
|
24
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
25
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
26
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
27
|
+
}
|
|
28
|
+
Object.defineProperty(o, k2, desc);
|
|
25
29
|
}) : (function(o, m, k, k2) {
|
|
26
30
|
if (k2 === undefined) k2 = k;
|
|
27
31
|
o[k2] = m[k];
|
|
@@ -21,7 +21,11 @@
|
|
|
21
21
|
*/
|
|
22
22
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
23
23
|
if (k2 === undefined) k2 = k;
|
|
24
|
-
Object.
|
|
24
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
25
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
26
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
27
|
+
}
|
|
28
|
+
Object.defineProperty(o, k2, desc);
|
|
25
29
|
}) : (function(o, m, k, k2) {
|
|
26
30
|
if (k2 === undefined) k2 = k;
|
|
27
31
|
o[k2] = m[k];
|
|
@@ -21,7 +21,11 @@
|
|
|
21
21
|
*/
|
|
22
22
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
23
23
|
if (k2 === undefined) k2 = k;
|
|
24
|
-
Object.
|
|
24
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
25
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
26
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
27
|
+
}
|
|
28
|
+
Object.defineProperty(o, k2, desc);
|
|
25
29
|
}) : (function(o, m, k, k2) {
|
|
26
30
|
if (k2 === undefined) k2 = k;
|
|
27
31
|
o[k2] = m[k];
|
package/lib/cluster/state.js
CHANGED
|
@@ -21,7 +21,11 @@
|
|
|
21
21
|
*/
|
|
22
22
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
23
23
|
if (k2 === undefined) k2 = k;
|
|
24
|
-
Object.
|
|
24
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
25
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
26
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
27
|
+
}
|
|
28
|
+
Object.defineProperty(o, k2, desc);
|
|
25
29
|
}) : (function(o, m, k, k2) {
|
|
26
30
|
if (k2 === undefined) k2 = k;
|
|
27
31
|
o[k2] = m[k];
|
|
@@ -21,7 +21,11 @@
|
|
|
21
21
|
*/
|
|
22
22
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
23
23
|
if (k2 === undefined) k2 = k;
|
|
24
|
-
Object.
|
|
24
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
25
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
26
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
27
|
+
}
|
|
28
|
+
Object.defineProperty(o, k2, desc);
|
|
25
29
|
}) : (function(o, m, k, k2) {
|
|
26
30
|
if (k2 === undefined) k2 = k;
|
|
27
31
|
o[k2] = m[k];
|
|
@@ -21,7 +21,11 @@
|
|
|
21
21
|
*/
|
|
22
22
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
23
23
|
if (k2 === undefined) k2 = k;
|
|
24
|
-
Object.
|
|
24
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
25
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
26
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
27
|
+
}
|
|
28
|
+
Object.defineProperty(o, k2, desc);
|
|
25
29
|
}) : (function(o, m, k, k2) {
|
|
26
30
|
if (k2 === undefined) k2 = k;
|
|
27
31
|
o[k2] = m[k];
|
|
@@ -21,7 +21,11 @@
|
|
|
21
21
|
*/
|
|
22
22
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
23
23
|
if (k2 === undefined) k2 = k;
|
|
24
|
-
Object.
|
|
24
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
25
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
26
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
27
|
+
}
|
|
28
|
+
Object.defineProperty(o, k2, desc);
|
|
25
29
|
}) : (function(o, m, k, k2) {
|
|
26
30
|
if (k2 === undefined) k2 = k;
|
|
27
31
|
o[k2] = m[k];
|
|
@@ -3,54 +3,57 @@ import { ApplicationManager, Backend } from './index';
|
|
|
3
3
|
import { CustomErrorDefinition } from '../../types';
|
|
4
4
|
export declare class BackendErrors extends ApplicationManager {
|
|
5
5
|
private domains;
|
|
6
|
-
private subDomains;
|
|
7
6
|
constructor(application: Backend);
|
|
8
7
|
/**
|
|
9
8
|
* Register a new standard KuzzleError
|
|
10
9
|
*
|
|
10
|
+
* @param domain Domain name
|
|
11
11
|
* @param subDomain Subdomain name
|
|
12
12
|
* @param name Standard error name
|
|
13
13
|
* @param definition Standard error definition
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
16
16
|
* ```
|
|
17
|
-
* app.errors.register('api', 'custom', {
|
|
17
|
+
* app.errors.register('app', 'api', 'custom', {
|
|
18
18
|
* class: 'BadRequestError',
|
|
19
19
|
* description: 'This is a custom error from API subdomain',
|
|
20
20
|
* message: 'Custom API error: %s',
|
|
21
21
|
* });
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
24
|
-
register(subDomain: string, name: string, definition: CustomErrorDefinition): void;
|
|
24
|
+
register(domain: string, subDomain: string, name: string, definition: CustomErrorDefinition): void;
|
|
25
25
|
/**
|
|
26
26
|
* Get a standardized KuzzleError
|
|
27
27
|
*
|
|
28
|
+
* @param domain Domain name
|
|
28
29
|
* @param subDomain Subdomain name
|
|
29
30
|
* @param name Standard error name
|
|
30
31
|
* @param placeholders Other placeholder arguments
|
|
31
32
|
*
|
|
32
|
-
* @example throw app.errors.get('api', 'custom', 'Tbilisi');
|
|
33
|
+
* @example throw app.errors.get('app', 'api', 'custom', 'Tbilisi');
|
|
33
34
|
*
|
|
34
35
|
* @returns Standardized KuzzleError
|
|
35
36
|
*/
|
|
36
|
-
get(subDomain: string, name: string, ...placeholders: any[]): KuzzleError;
|
|
37
|
+
get(domain: string, subDomain: string, name: string, ...placeholders: any[]): KuzzleError;
|
|
37
38
|
/**
|
|
38
39
|
* Get a standardized KuzzleError from an existing error to keep the stacktrace
|
|
39
40
|
*
|
|
40
41
|
* @param source Original error
|
|
42
|
+
* @param domain Domain name
|
|
41
43
|
* @param subDomain Subdomain name
|
|
42
44
|
* @param name Standard error name
|
|
43
45
|
* @param placeholders Other placeholder arguments
|
|
44
46
|
*
|
|
45
47
|
* @returns Standardized KuzzleError
|
|
46
48
|
*/
|
|
47
|
-
getFrom(source: Error, subDomain: string, name: string, ...placeholders: any[]): KuzzleError;
|
|
49
|
+
getFrom(source: Error, domain: string, subDomain: string, name: string, ...placeholders: any[]): KuzzleError;
|
|
48
50
|
/**
|
|
49
|
-
* Wrap an error manager on the subDomain
|
|
51
|
+
* Wrap an error manager on the domain and subDomain
|
|
50
52
|
*
|
|
53
|
+
* @param domain Domain name
|
|
51
54
|
* @param subDomain Subdomain to wrap to
|
|
52
55
|
*/
|
|
53
|
-
wrap(subDomain: string): {
|
|
56
|
+
wrap(domain: string, subDomain: string): {
|
|
54
57
|
get: (error: any, ...placeholders: any[]) => KuzzleError;
|
|
55
58
|
getFrom: (source: any, error: any, ...placeholders: any[]) => KuzzleError;
|
|
56
59
|
reject: (error: any, ...placeholders: any[]) => Promise<any>;
|
|
@@ -21,7 +21,11 @@
|
|
|
21
21
|
*/
|
|
22
22
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
23
23
|
if (k2 === undefined) k2 = k;
|
|
24
|
-
Object.
|
|
24
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
25
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
26
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
27
|
+
}
|
|
28
|
+
Object.defineProperty(o, k2, desc);
|
|
25
29
|
}) : (function(o, m, k, k2) {
|
|
26
30
|
if (k2 === undefined) k2 = k;
|
|
27
31
|
o[k2] = m[k];
|
|
@@ -45,76 +49,80 @@ const index_1 = require("./index");
|
|
|
45
49
|
class BackendErrors extends index_1.ApplicationManager {
|
|
46
50
|
constructor(application) {
|
|
47
51
|
super(application);
|
|
48
|
-
this.domains = {
|
|
49
|
-
app: {
|
|
50
|
-
code: 9,
|
|
51
|
-
subDomains: {},
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
this.subDomains = 0;
|
|
52
|
+
this.domains = {};
|
|
55
53
|
}
|
|
56
54
|
/**
|
|
57
55
|
* Register a new standard KuzzleError
|
|
58
56
|
*
|
|
57
|
+
* @param domain Domain name
|
|
59
58
|
* @param subDomain Subdomain name
|
|
60
59
|
* @param name Standard error name
|
|
61
60
|
* @param definition Standard error definition
|
|
62
61
|
*
|
|
63
62
|
* @example
|
|
64
63
|
* ```
|
|
65
|
-
* app.errors.register('api', 'custom', {
|
|
64
|
+
* app.errors.register('app', 'api', 'custom', {
|
|
66
65
|
* class: 'BadRequestError',
|
|
67
66
|
* description: 'This is a custom error from API subdomain',
|
|
68
67
|
* message: 'Custom API error: %s',
|
|
69
68
|
* });
|
|
70
69
|
* ```
|
|
71
70
|
*/
|
|
72
|
-
register(subDomain, name, definition) {
|
|
73
|
-
if (!this.domains
|
|
74
|
-
this.domains
|
|
75
|
-
code: this.
|
|
71
|
+
register(domain, subDomain, name, definition) {
|
|
72
|
+
if (!this.domains[domain]) {
|
|
73
|
+
this.domains[domain] = {
|
|
74
|
+
code: Object.keys(this.domains).length,
|
|
75
|
+
subDomains: {},
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
if (!this.domains[domain].subDomains[subDomain]) {
|
|
79
|
+
this.domains[domain].subDomains[subDomain] = {
|
|
80
|
+
code: Object.keys(this.domains[domain].subDomains).length,
|
|
76
81
|
errors: {},
|
|
77
82
|
};
|
|
78
83
|
}
|
|
79
|
-
this.domains.
|
|
80
|
-
code: Object.keys(this.domains.
|
|
84
|
+
this.domains[domain].subDomains[subDomain].errors[name] = {
|
|
85
|
+
code: Object.keys(this.domains[domain].subDomains[subDomain].errors).length,
|
|
81
86
|
...definition,
|
|
82
87
|
};
|
|
83
88
|
}
|
|
84
89
|
/**
|
|
85
90
|
* Get a standardized KuzzleError
|
|
86
91
|
*
|
|
92
|
+
* @param domain Domain name
|
|
87
93
|
* @param subDomain Subdomain name
|
|
88
94
|
* @param name Standard error name
|
|
89
95
|
* @param placeholders Other placeholder arguments
|
|
90
96
|
*
|
|
91
|
-
* @example throw app.errors.get('api', 'custom', 'Tbilisi');
|
|
97
|
+
* @example throw app.errors.get('app', 'api', 'custom', 'Tbilisi');
|
|
92
98
|
*
|
|
93
99
|
* @returns Standardized KuzzleError
|
|
94
100
|
*/
|
|
95
|
-
get(subDomain, name, ...placeholders) {
|
|
96
|
-
return kerror.rawGet(this.domains,
|
|
101
|
+
get(domain, subDomain, name, ...placeholders) {
|
|
102
|
+
return kerror.rawGet(this.domains, domain, subDomain, name, ...placeholders);
|
|
97
103
|
}
|
|
98
104
|
/**
|
|
99
105
|
* Get a standardized KuzzleError from an existing error to keep the stacktrace
|
|
100
106
|
*
|
|
101
107
|
* @param source Original error
|
|
108
|
+
* @param domain Domain name
|
|
102
109
|
* @param subDomain Subdomain name
|
|
103
110
|
* @param name Standard error name
|
|
104
111
|
* @param placeholders Other placeholder arguments
|
|
105
112
|
*
|
|
106
113
|
* @returns Standardized KuzzleError
|
|
107
114
|
*/
|
|
108
|
-
getFrom(source, subDomain, name, ...placeholders) {
|
|
109
|
-
return kerror.rawGetFrom(this.domains, source,
|
|
115
|
+
getFrom(source, domain, subDomain, name, ...placeholders) {
|
|
116
|
+
return kerror.rawGetFrom(this.domains, source, domain, subDomain, name, ...placeholders);
|
|
110
117
|
}
|
|
111
118
|
/**
|
|
112
|
-
* Wrap an error manager on the subDomain
|
|
119
|
+
* Wrap an error manager on the domain and subDomain
|
|
113
120
|
*
|
|
121
|
+
* @param domain Domain name
|
|
114
122
|
* @param subDomain Subdomain to wrap to
|
|
115
123
|
*/
|
|
116
|
-
wrap(subDomain) {
|
|
117
|
-
return kerror.rawWrap(this.domains,
|
|
124
|
+
wrap(domain, subDomain) {
|
|
125
|
+
return kerror.rawWrap(this.domains, domain, subDomain);
|
|
118
126
|
}
|
|
119
127
|
}
|
|
120
128
|
exports.BackendErrors = BackendErrors;
|
|
@@ -21,7 +21,11 @@
|
|
|
21
21
|
*/
|
|
22
22
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
23
23
|
if (k2 === undefined) k2 = k;
|
|
24
|
-
Object.
|
|
24
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
25
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
26
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
27
|
+
}
|
|
28
|
+
Object.defineProperty(o, k2, desc);
|
|
25
29
|
}) : (function(o, m, k, k2) {
|
|
26
30
|
if (k2 === undefined) k2 = k;
|
|
27
31
|
o[k2] = m[k];
|
|
@@ -21,7 +21,11 @@
|
|
|
21
21
|
*/
|
|
22
22
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
23
23
|
if (k2 === undefined) k2 = k;
|
|
24
|
-
Object.
|
|
24
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
25
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
26
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
27
|
+
}
|
|
28
|
+
Object.defineProperty(o, k2, desc);
|
|
25
29
|
}) : (function(o, m, k, k2) {
|
|
26
30
|
if (k2 === undefined) k2 = k;
|
|
27
31
|
o[k2] = m[k];
|
|
@@ -21,7 +21,11 @@
|
|
|
21
21
|
*/
|
|
22
22
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
23
23
|
if (k2 === undefined) k2 = k;
|
|
24
|
-
Object.
|
|
24
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
25
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
26
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
27
|
+
}
|
|
28
|
+
Object.defineProperty(o, k2, desc);
|
|
25
29
|
}) : (function(o, m, k, k2) {
|
|
26
30
|
if (k2 === undefined) k2 = k;
|
|
27
31
|
o[k2] = m[k];
|
|
@@ -21,7 +21,11 @@
|
|
|
21
21
|
*/
|
|
22
22
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
23
23
|
if (k2 === undefined) k2 = k;
|
|
24
|
-
Object.
|
|
24
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
25
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
26
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
27
|
+
}
|
|
28
|
+
Object.defineProperty(o, k2, desc);
|
|
25
29
|
}) : (function(o, m, k, k2) {
|
|
26
30
|
if (k2 === undefined) k2 = k;
|
|
27
31
|
o[k2] = m[k];
|
|
@@ -21,7 +21,11 @@
|
|
|
21
21
|
*/
|
|
22
22
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
23
23
|
if (k2 === undefined) k2 = k;
|
|
24
|
-
Object.
|
|
24
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
25
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
26
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
27
|
+
}
|
|
28
|
+
Object.defineProperty(o, k2, desc);
|
|
25
29
|
}) : (function(o, m, k, k2) {
|
|
26
30
|
if (k2 === undefined) k2 = k;
|
|
27
31
|
o[k2] = m[k];
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -21,7 +21,11 @@
|
|
|
21
21
|
*/
|
|
22
22
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
23
23
|
if (k2 === undefined) k2 = k;
|
|
24
|
-
Object.
|
|
24
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
25
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
26
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
27
|
+
}
|
|
28
|
+
Object.defineProperty(o, k2, desc);
|
|
25
29
|
}) : (function(o, m, k, k2) {
|
|
26
30
|
if (k2 === undefined) k2 = k;
|
|
27
31
|
o[k2] = m[k];
|
|
@@ -21,7 +21,11 @@
|
|
|
21
21
|
*/
|
|
22
22
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
23
23
|
if (k2 === undefined) k2 = k;
|
|
24
|
-
Object.
|
|
24
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
25
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
26
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
27
|
+
}
|
|
28
|
+
Object.defineProperty(o, k2, desc);
|
|
25
29
|
}) : (function(o, m, k, k2) {
|
|
26
30
|
if (k2 === undefined) k2 = k;
|
|
27
31
|
o[k2] = m[k];
|
|
@@ -21,7 +21,11 @@
|
|
|
21
21
|
*/
|
|
22
22
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
23
23
|
if (k2 === undefined) k2 = k;
|
|
24
|
-
Object.
|
|
24
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
25
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
26
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
27
|
+
}
|
|
28
|
+
Object.defineProperty(o, k2, desc);
|
|
25
29
|
}) : (function(o, m, k, k2) {
|
|
26
30
|
if (k2 === undefined) k2 = k;
|
|
27
31
|
o[k2] = m[k];
|
|
@@ -21,7 +21,11 @@
|
|
|
21
21
|
*/
|
|
22
22
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
23
23
|
if (k2 === undefined) k2 = k;
|
|
24
|
-
Object.
|
|
24
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
25
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
26
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
27
|
+
}
|
|
28
|
+
Object.defineProperty(o, k2, desc);
|
|
25
29
|
}) : (function(o, m, k, k2) {
|
|
26
30
|
if (k2 === undefined) k2 = k;
|
|
27
31
|
o[k2] = m[k];
|
|
@@ -21,7 +21,11 @@
|
|
|
21
21
|
*/
|
|
22
22
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
23
23
|
if (k2 === undefined) k2 = k;
|
|
24
|
-
Object.
|
|
24
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
25
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
26
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
27
|
+
}
|
|
28
|
+
Object.defineProperty(o, k2, desc);
|
|
25
29
|
}) : (function(o, m, k, k2) {
|
|
26
30
|
if (k2 === undefined) k2 = k;
|
|
27
31
|
o[k2] = m[k];
|
|
@@ -499,7 +499,7 @@ class ClientAdapter {
|
|
|
499
499
|
*/
|
|
500
500
|
global.kuzzle.onAsk(
|
|
501
501
|
`core:storage:${this.scope}:document:import`,
|
|
502
|
-
fixtures => this.loadFixtures(fixtures));
|
|
502
|
+
(fixtures, options) => this.loadFixtures(fixtures, options));
|
|
503
503
|
|
|
504
504
|
/**
|
|
505
505
|
* Create multiple documents
|
|
@@ -690,7 +690,7 @@ class ClientAdapter {
|
|
|
690
690
|
this.cache.assertCollectionExists(target.index, collection);
|
|
691
691
|
}
|
|
692
692
|
}
|
|
693
|
-
|
|
693
|
+
|
|
694
694
|
return this.client.search({ searchBody, targets }, opts);
|
|
695
695
|
});
|
|
696
696
|
|
|
@@ -861,7 +861,7 @@ class ClientAdapter {
|
|
|
861
861
|
* @param {String} fixturesId
|
|
862
862
|
* @returns {Promise}
|
|
863
863
|
*/
|
|
864
|
-
async loadFixtures (fixtures = {}) {
|
|
864
|
+
async loadFixtures (fixtures = {}, { refresh = 'wait_for' } = { }) {
|
|
865
865
|
if (! isPlainObject(fixtures)) {
|
|
866
866
|
throw kerror.get('api', 'assert', 'invalid_argument', fixtures, 'object');
|
|
867
867
|
}
|
|
@@ -878,7 +878,7 @@ class ClientAdapter {
|
|
|
878
878
|
index,
|
|
879
879
|
collection,
|
|
880
880
|
payload,
|
|
881
|
-
{ refresh
|
|
881
|
+
{ refresh });
|
|
882
882
|
|
|
883
883
|
if (errors.length > 0) {
|
|
884
884
|
throw servicesError.get('import_failed', errors);
|
|
@@ -21,7 +21,11 @@
|
|
|
21
21
|
*/
|
|
22
22
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
23
23
|
if (k2 === undefined) k2 = k;
|
|
24
|
-
Object.
|
|
24
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
25
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
26
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
27
|
+
}
|
|
28
|
+
Object.defineProperty(o, k2, desc);
|
|
25
29
|
}) : (function(o, m, k, k2) {
|
|
26
30
|
if (k2 === undefined) k2 = k;
|
|
27
31
|
o[k2] = m[k];
|
|
@@ -21,7 +21,11 @@
|
|
|
21
21
|
*/
|
|
22
22
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
23
23
|
if (k2 === undefined) k2 = k;
|
|
24
|
-
Object.
|
|
24
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
25
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
26
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
27
|
+
}
|
|
28
|
+
Object.defineProperty(o, k2, desc);
|
|
25
29
|
}) : (function(o, m, k, k2) {
|
|
26
30
|
if (k2 === undefined) k2 = k;
|
|
27
31
|
o[k2] = m[k];
|
|
@@ -17,6 +17,10 @@ export declare class KuzzleError extends Error {
|
|
|
17
17
|
* Error unique identifier
|
|
18
18
|
*/
|
|
19
19
|
id: string;
|
|
20
|
+
/**
|
|
21
|
+
* Placeholders used to construct the error message.
|
|
22
|
+
*/
|
|
23
|
+
props: string[];
|
|
20
24
|
constructor(message: string, status: number, id?: string, code?: number);
|
|
21
25
|
/**
|
|
22
26
|
* Error class name (e.g: 'NotFoundError')
|
|
@@ -21,7 +21,11 @@
|
|
|
21
21
|
*/
|
|
22
22
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
23
23
|
if (k2 === undefined) k2 = k;
|
|
24
|
-
Object.
|
|
24
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
25
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
26
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
27
|
+
}
|
|
28
|
+
Object.defineProperty(o, k2, desc);
|
|
25
29
|
}) : (function(o, m, k, k2) {
|
|
26
30
|
if (k2 === undefined) k2 = k;
|
|
27
31
|
o[k2] = m[k];
|
|
@@ -51,7 +55,9 @@ class KuzzleError extends Error {
|
|
|
51
55
|
this.status = status;
|
|
52
56
|
this.code = code;
|
|
53
57
|
this.id = id;
|
|
54
|
-
|
|
58
|
+
this.props = undefined;
|
|
59
|
+
this.stack = undefined;
|
|
60
|
+
if (util.types.isNativeError(message)) {
|
|
55
61
|
this.message = message.message;
|
|
56
62
|
this.stack = message.stack;
|
|
57
63
|
}
|
|
@@ -71,6 +77,7 @@ class KuzzleError extends Error {
|
|
|
71
77
|
code: this.code,
|
|
72
78
|
id: this.id,
|
|
73
79
|
message: this.message,
|
|
80
|
+
props: this.props,
|
|
74
81
|
stack: this.stack,
|
|
75
82
|
status: this.status,
|
|
76
83
|
};
|