@aeriajs/types 0.0.18 → 0.0.19
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/dist/accessControl.d.ts +6 -5
- package/dist/accessControl.js +17 -5
- package/dist/accessControl.mjs +19 -4
- package/package.json +1 -1
package/dist/accessControl.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import type { Collection } from '.';
|
|
2
2
|
export declare enum ACErrors {
|
|
3
|
-
|
|
3
|
+
AssetNotFound = "ASSET_NOT_FOUND",
|
|
4
4
|
AuthenticationError = "AUTHENTICATION_ERROR",
|
|
5
|
+
AuthorizationError = "AUTHORIZATION_ERROR",
|
|
6
|
+
FunctionNotFound = "FUNCTION_NOT_FOUND",
|
|
5
7
|
ImmutabilityIncorrectChild = "IMMUTABILITY_INCORRECT_CHILD",
|
|
6
8
|
ImmutabilityParentNotFound = "IMMUTABILITY_PARENT_NOT_FOUND",
|
|
7
9
|
ImmutabilityTargetImmutable = "IMMUTABILITY_TARGET_IMMUTABLE",
|
|
10
|
+
InvalidLimit = "INVALID_LIMIT",
|
|
8
11
|
OwnershipError = "OWNERSHIP_ERROR",
|
|
9
|
-
ResourceNotFound = "RESOURCE_NOT_FOUND"
|
|
10
|
-
AssetNotFound = "ASSET_NOT_FOUND",
|
|
11
|
-
FunctionNotFound = "FUNCTION_NOT_FOUND",
|
|
12
|
-
InvalidLimit = "INVALID_LIMIT"
|
|
12
|
+
ResourceNotFound = "RESOURCE_NOT_FOUND"
|
|
13
13
|
}
|
|
14
|
+
export declare const ACErrorMessages: Record<ACErrors, string>;
|
|
14
15
|
export type Role<TCollection extends Collection = any, TAccessControl extends AccessControl<TCollection> = any> = {
|
|
15
16
|
inherit?: readonly (keyof TAccessControl['roles'])[];
|
|
16
17
|
grantEverything?: boolean;
|
package/dist/accessControl.js
CHANGED
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ACErrors = void 0;
|
|
3
|
+
exports.ACErrorMessages = exports.ACErrors = void 0;
|
|
4
4
|
var ACErrors;
|
|
5
5
|
(function (ACErrors) {
|
|
6
|
-
ACErrors["
|
|
6
|
+
ACErrors["AssetNotFound"] = "ASSET_NOT_FOUND";
|
|
7
7
|
ACErrors["AuthenticationError"] = "AUTHENTICATION_ERROR";
|
|
8
|
+
ACErrors["AuthorizationError"] = "AUTHORIZATION_ERROR";
|
|
9
|
+
ACErrors["FunctionNotFound"] = "FUNCTION_NOT_FOUND";
|
|
8
10
|
ACErrors["ImmutabilityIncorrectChild"] = "IMMUTABILITY_INCORRECT_CHILD";
|
|
9
11
|
ACErrors["ImmutabilityParentNotFound"] = "IMMUTABILITY_PARENT_NOT_FOUND";
|
|
10
12
|
ACErrors["ImmutabilityTargetImmutable"] = "IMMUTABILITY_TARGET_IMMUTABLE";
|
|
13
|
+
ACErrors["InvalidLimit"] = "INVALID_LIMIT";
|
|
11
14
|
ACErrors["OwnershipError"] = "OWNERSHIP_ERROR";
|
|
12
15
|
ACErrors["ResourceNotFound"] = "RESOURCE_NOT_FOUND";
|
|
13
|
-
ACErrors["AssetNotFound"] = "ASSET_NOT_FOUND";
|
|
14
|
-
ACErrors["FunctionNotFound"] = "FUNCTION_NOT_FOUND";
|
|
15
|
-
ACErrors["InvalidLimit"] = "INVALID_LIMIT";
|
|
16
16
|
})(ACErrors || (exports.ACErrors = ACErrors = {}));
|
|
17
|
+
exports.ACErrorMessages = {
|
|
18
|
+
[ACErrors.AssetNotFound]: 'collection has no registered functions',
|
|
19
|
+
[ACErrors.AuthenticationError]: 'you have insufficient privileges',
|
|
20
|
+
[ACErrors.AuthorizationError]: 'you have insufficient privileges',
|
|
21
|
+
[ACErrors.FunctionNotFound]: 'function not found',
|
|
22
|
+
[ACErrors.ImmutabilityIncorrectChild]: 'specified limit is invalid',
|
|
23
|
+
[ACErrors.ImmutabilityParentNotFound]: 'specified limit is invalid',
|
|
24
|
+
[ACErrors.ImmutabilityTargetImmutable]: 'specified limit is invalid',
|
|
25
|
+
[ACErrors.InvalidLimit]: 'specified limit is invalid',
|
|
26
|
+
[ACErrors.OwnershipError]: 'you have insufficient privileges',
|
|
27
|
+
[ACErrors.ResourceNotFound]: 'collection not found',
|
|
28
|
+
};
|
package/dist/accessControl.mjs
CHANGED
|
@@ -1,13 +1,28 @@
|
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
|
+
if (key in obj) {
|
|
3
|
+
Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
1
14
|
export var ACErrors;
|
|
2
15
|
(function(ACErrors) {
|
|
3
|
-
ACErrors["
|
|
16
|
+
ACErrors["AssetNotFound"] = "ASSET_NOT_FOUND";
|
|
4
17
|
ACErrors["AuthenticationError"] = "AUTHENTICATION_ERROR";
|
|
18
|
+
ACErrors["AuthorizationError"] = "AUTHORIZATION_ERROR";
|
|
19
|
+
ACErrors["FunctionNotFound"] = "FUNCTION_NOT_FOUND";
|
|
5
20
|
ACErrors["ImmutabilityIncorrectChild"] = "IMMUTABILITY_INCORRECT_CHILD";
|
|
6
21
|
ACErrors["ImmutabilityParentNotFound"] = "IMMUTABILITY_PARENT_NOT_FOUND";
|
|
7
22
|
ACErrors["ImmutabilityTargetImmutable"] = "IMMUTABILITY_TARGET_IMMUTABLE";
|
|
23
|
+
ACErrors["InvalidLimit"] = "INVALID_LIMIT";
|
|
8
24
|
ACErrors["OwnershipError"] = "OWNERSHIP_ERROR";
|
|
9
25
|
ACErrors["ResourceNotFound"] = "RESOURCE_NOT_FOUND";
|
|
10
|
-
ACErrors["AssetNotFound"] = "ASSET_NOT_FOUND";
|
|
11
|
-
ACErrors["FunctionNotFound"] = "FUNCTION_NOT_FOUND";
|
|
12
|
-
ACErrors["InvalidLimit"] = "INVALID_LIMIT";
|
|
13
26
|
})(ACErrors || (ACErrors = {}));
|
|
27
|
+
var _obj;
|
|
28
|
+
export var ACErrorMessages = (_obj = {}, _define_property(_obj, "ASSET_NOT_FOUND", "collection has no registered functions"), _define_property(_obj, "AUTHENTICATION_ERROR", "you have insufficient privileges"), _define_property(_obj, "AUTHORIZATION_ERROR", "you have insufficient privileges"), _define_property(_obj, "FUNCTION_NOT_FOUND", "function not found"), _define_property(_obj, "IMMUTABILITY_INCORRECT_CHILD", "specified limit is invalid"), _define_property(_obj, "IMMUTABILITY_PARENT_NOT_FOUND", "specified limit is invalid"), _define_property(_obj, "IMMUTABILITY_TARGET_IMMUTABLE", "specified limit is invalid"), _define_property(_obj, "INVALID_LIMIT", "specified limit is invalid"), _define_property(_obj, "OWNERSHIP_ERROR", "you have insufficient privileges"), _define_property(_obj, "RESOURCE_NOT_FOUND", "collection not found"), _obj);
|