@forestadmin/datasource-customizer 1.46.1 → 1.47.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.
|
@@ -7,5 +7,26 @@ export default class AgentCustomizationContext<S extends TSchema = TSchema> {
|
|
|
7
7
|
get dataSource(): RelaxedDataSource<S>;
|
|
8
8
|
constructor(dataSource: DataSource, caller: Caller);
|
|
9
9
|
get caller(): Readonly<Caller>;
|
|
10
|
+
/**
|
|
11
|
+
* Stop hooks execution and send Validation error to the UI
|
|
12
|
+
* @param message the validation error message
|
|
13
|
+
* @example
|
|
14
|
+
* .throwValidationError('My validation error message');
|
|
15
|
+
*/
|
|
16
|
+
throwValidationError(message: string): never;
|
|
17
|
+
/**
|
|
18
|
+
* Stop hooks execution and send Forbidden error to the UI
|
|
19
|
+
* @param message the forbidden error message
|
|
20
|
+
* @example
|
|
21
|
+
* .throwForbiddenError('My forbidden error message');
|
|
22
|
+
*/
|
|
23
|
+
throwForbiddenError(message: string): never;
|
|
24
|
+
/**
|
|
25
|
+
* Stop hooks execution and send error to the UI
|
|
26
|
+
* @param message the error message
|
|
27
|
+
* @example
|
|
28
|
+
* .throwError('My error message');
|
|
29
|
+
*/
|
|
30
|
+
throwError(message: string): never;
|
|
10
31
|
}
|
|
11
32
|
//# sourceMappingURL=agent-context.d.ts.map
|
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const datasource_toolkit_1 = require("@forestadmin/datasource-toolkit");
|
|
6
7
|
const datasource_1 = __importDefault(require("./relaxed-wrappers/datasource"));
|
|
7
8
|
class AgentCustomizationContext {
|
|
8
9
|
get dataSource() {
|
|
@@ -15,6 +16,33 @@ class AgentCustomizationContext {
|
|
|
15
16
|
get caller() {
|
|
16
17
|
return Object.freeze(this._caller);
|
|
17
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Stop hooks execution and send Validation error to the UI
|
|
21
|
+
* @param message the validation error message
|
|
22
|
+
* @example
|
|
23
|
+
* .throwValidationError('My validation error message');
|
|
24
|
+
*/
|
|
25
|
+
throwValidationError(message) {
|
|
26
|
+
throw new datasource_toolkit_1.ValidationError(message);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Stop hooks execution and send Forbidden error to the UI
|
|
30
|
+
* @param message the forbidden error message
|
|
31
|
+
* @example
|
|
32
|
+
* .throwForbiddenError('My forbidden error message');
|
|
33
|
+
*/
|
|
34
|
+
throwForbiddenError(message) {
|
|
35
|
+
throw new datasource_toolkit_1.ForbiddenError(message);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Stop hooks execution and send error to the UI
|
|
39
|
+
* @param message the error message
|
|
40
|
+
* @example
|
|
41
|
+
* .throwError('My error message');
|
|
42
|
+
*/
|
|
43
|
+
throwError(message) {
|
|
44
|
+
throw new datasource_toolkit_1.UnprocessableError(message);
|
|
45
|
+
}
|
|
18
46
|
}
|
|
19
47
|
exports.default = AgentCustomizationContext;
|
|
20
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
48
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWdlbnQtY29udGV4dC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb250ZXh0L2FnZW50LWNvbnRleHQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSx3RUFNeUM7QUFFekMsK0VBQThEO0FBRzlELE1BQXFCLHlCQUF5QjtJQUk1QyxJQUFJLFVBQVU7UUFDWixPQUFPLElBQUksb0JBQWlCLENBQUksSUFBSSxDQUFDLGNBQWMsRUFBRSxJQUFJLENBQUMsT0FBTyxDQUFDLENBQUM7SUFDckUsQ0FBQztJQUVELFlBQVksVUFBc0IsRUFBRSxNQUFjO1FBQ2hELElBQUksQ0FBQyxjQUFjLEdBQUcsVUFBVSxDQUFDO1FBQ2pDLElBQUksQ0FBQyxPQUFPLEdBQUcsTUFBTSxDQUFDO0lBQ3hCLENBQUM7SUFFRCxJQUFJLE1BQU07UUFDUixPQUFPLE1BQU0sQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxDQUFDO0lBQ3JDLENBQUM7SUFFRDs7Ozs7T0FLRztJQUNILG9CQUFvQixDQUFDLE9BQWU7UUFDbEMsTUFBTSxJQUFJLG9DQUFlLENBQUMsT0FBTyxDQUFDLENBQUM7SUFDckMsQ0FBQztJQUVEOzs7OztPQUtHO0lBQ0gsbUJBQW1CLENBQUMsT0FBZTtRQUNqQyxNQUFNLElBQUksbUNBQWMsQ0FBQyxPQUFPLENBQUMsQ0FBQztJQUNwQyxDQUFDO0lBRUQ7Ozs7O09BS0c7SUFDSCxVQUFVLENBQUMsT0FBZTtRQUN4QixNQUFNLElBQUksdUNBQWtCLENBQUMsT0FBTyxDQUFDLENBQUM7SUFDeEMsQ0FBQztDQUNGO0FBOUNELDRDQThDQyJ9
|
|
@@ -1,26 +1,5 @@
|
|
|
1
1
|
import CollectionCustomizationContext from '../../../context/collection-context';
|
|
2
2
|
import { TCollectionName, TSchema } from '../../../templates';
|
|
3
3
|
export default abstract class HookContext<S extends TSchema = TSchema, N extends TCollectionName<S> = TCollectionName<S>> extends CollectionCustomizationContext<S, N> {
|
|
4
|
-
/**
|
|
5
|
-
* Stop hooks execution and send Validation error to the UI
|
|
6
|
-
* @param message the validation error message
|
|
7
|
-
* @example
|
|
8
|
-
* .throwValidationError('My validation error message');
|
|
9
|
-
*/
|
|
10
|
-
throwValidationError(message: string): never;
|
|
11
|
-
/**
|
|
12
|
-
* Stop hooks execution and send Forbidden error to the UI
|
|
13
|
-
* @param message the forbidden error message
|
|
14
|
-
* @example
|
|
15
|
-
* .throwForbiddenError('My forbidden error message');
|
|
16
|
-
*/
|
|
17
|
-
throwForbiddenError(message: string): never;
|
|
18
|
-
/**
|
|
19
|
-
* Stop hooks execution and send error to the UI
|
|
20
|
-
* @param message the error message
|
|
21
|
-
* @example
|
|
22
|
-
* .throwError('My error message');
|
|
23
|
-
*/
|
|
24
|
-
throwError(message: string): never;
|
|
25
4
|
}
|
|
26
5
|
//# sourceMappingURL=hook.d.ts.map
|
|
@@ -3,36 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const datasource_toolkit_1 = require("@forestadmin/datasource-toolkit");
|
|
7
6
|
const collection_context_1 = __importDefault(require("../../../context/collection-context"));
|
|
8
7
|
class HookContext extends collection_context_1.default {
|
|
9
|
-
/**
|
|
10
|
-
* Stop hooks execution and send Validation error to the UI
|
|
11
|
-
* @param message the validation error message
|
|
12
|
-
* @example
|
|
13
|
-
* .throwValidationError('My validation error message');
|
|
14
|
-
*/
|
|
15
|
-
throwValidationError(message) {
|
|
16
|
-
throw new datasource_toolkit_1.ValidationError(message);
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Stop hooks execution and send Forbidden error to the UI
|
|
20
|
-
* @param message the forbidden error message
|
|
21
|
-
* @example
|
|
22
|
-
* .throwForbiddenError('My forbidden error message');
|
|
23
|
-
*/
|
|
24
|
-
throwForbiddenError(message) {
|
|
25
|
-
throw new datasource_toolkit_1.ForbiddenError(message);
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Stop hooks execution and send error to the UI
|
|
29
|
-
* @param message the error message
|
|
30
|
-
* @example
|
|
31
|
-
* .throwError('My error message');
|
|
32
|
-
*/
|
|
33
|
-
throwError(message) {
|
|
34
|
-
throw new datasource_toolkit_1.UnprocessableError(message);
|
|
35
|
-
}
|
|
36
8
|
}
|
|
37
9
|
exports.default = HookContext;
|
|
38
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaG9vay5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9kZWNvcmF0b3JzL2hvb2svY29udGV4dC9ob29rLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsNkZBQWlGO0FBR2pGLE1BQThCLFdBRzVCLFNBQVEsNEJBQW9DO0NBQUc7QUFIakQsOEJBR2lEIn0=
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forestadmin/datasource-customizer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.47.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"publishConfig": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@types/uuid": "^9.0.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@forestadmin/datasource-toolkit": "1.34.
|
|
32
|
+
"@forestadmin/datasource-toolkit": "1.34.5",
|
|
33
33
|
"antlr4": "^4.13.1-patch-1",
|
|
34
34
|
"file-type": "^16.5.4",
|
|
35
35
|
"luxon": "^3.2.1",
|