@fjell/registry 4.4.17 → 4.4.22
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/build.js +4 -0
- package/dist/Coordinate.d.ts +2 -1
- package/dist/Coordinate.d.ts.map +1 -0
- package/dist/Instance.d.ts +3 -2
- package/dist/Instance.d.ts.map +1 -0
- package/dist/Registry.d.ts +1 -0
- package/dist/Registry.d.ts.map +1 -0
- package/dist/RegistryHub.d.ts +1 -0
- package/dist/RegistryHub.d.ts.map +1 -0
- package/dist/RegistryStats.d.ts +1 -0
- package/dist/RegistryStats.d.ts.map +1 -0
- package/dist/errors/CoordinateError.d.ts +1 -0
- package/dist/errors/CoordinateError.d.ts.map +1 -0
- package/dist/errors/InstanceError.d.ts +1 -0
- package/dist/errors/InstanceError.d.ts.map +1 -0
- package/dist/errors/RegistryError.d.ts +1 -0
- package/dist/errors/RegistryError.d.ts.map +1 -0
- package/dist/errors/RegistryHubError.d.ts +1 -0
- package/dist/errors/RegistryHubError.d.ts.map +1 -0
- package/dist/errors/index.d.ts +1 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +685 -10
- package/dist/index.js.map +7 -0
- package/dist/logger.d.ts +2 -1
- package/dist/logger.d.ts.map +1 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -0
- package/docs/README.md +8 -8
- package/docs/TIMING_NODE_OPTIMIZATION.md +3 -3
- package/docs/TIMING_README.md +2 -2
- package/docs/docs.config.ts +1 -32
- package/docs/package-lock.json +5129 -0
- package/docs/package.json +3 -3
- package/docs/public/README.md +1 -1
- package/docs/public/TIMING_NODE_OPTIMIZATION.md +2 -2
- package/docs/public/examples/registry-hub-types.ts +0 -0
- package/docs/public/package.json +4 -5
- package/docs/timing-range.svg +40 -40
- package/examples/registry-hub-types.ts +0 -0
- package/package.json +28 -38
- package/tsconfig.docs.json +28 -0
- package/vitest.config.ts +17 -0
- package/MIGRATION_SUMMARY.md +0 -200
- package/dist/Coordinate.cjs +0 -32
- package/dist/Coordinate.js +0 -28
- package/dist/Instance.cjs +0 -24
- package/dist/Instance.js +0 -19
- package/dist/Registry.cjs +0 -182
- package/dist/Registry.js +0 -178
- package/dist/RegistryHub.cjs +0 -94
- package/dist/RegistryHub.js +0 -90
- package/dist/RegistryStats.cjs +0 -198
- package/dist/RegistryStats.js +0 -194
- package/dist/errors/CoordinateError.cjs +0 -70
- package/dist/errors/CoordinateError.js +0 -63
- package/dist/errors/InstanceError.cjs +0 -101
- package/dist/errors/InstanceError.js +0 -92
- package/dist/errors/RegistryError.cjs +0 -82
- package/dist/errors/RegistryError.js +0 -75
- package/dist/errors/RegistryHubError.cjs +0 -92
- package/dist/errors/RegistryHubError.js +0 -84
- package/dist/index.cjs +0 -821
- package/dist/index.cjs.map +0 -1
- package/dist/logger.cjs +0 -10
- package/dist/logger.js +0 -6
- package/docs/src/index.css +0 -34
- package/docs/src/main.tsx +0 -12
- package/docs/src/test/setup.ts +0 -1
- package/docs/src/types.d.ts +0 -44
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { RegistryError } from './RegistryError.js';
|
|
2
|
-
|
|
3
|
-
function _define_property(obj, key, value) {
|
|
4
|
-
if (key in obj) {
|
|
5
|
-
Object.defineProperty(obj, key, {
|
|
6
|
-
value: value,
|
|
7
|
-
enumerable: true,
|
|
8
|
-
configurable: true,
|
|
9
|
-
writable: true
|
|
10
|
-
});
|
|
11
|
-
} else {
|
|
12
|
-
obj[key] = value;
|
|
13
|
-
}
|
|
14
|
-
return obj;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Base class for instance-related errors
|
|
18
|
-
*/ class InstanceError extends RegistryError {
|
|
19
|
-
constructor(message, keyPath, registryType, context){
|
|
20
|
-
super(message, registryType, {
|
|
21
|
-
...context,
|
|
22
|
-
keyPath
|
|
23
|
-
}), _define_property(this, "keyPath", void 0);
|
|
24
|
-
this.keyPath = keyPath;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Thrown when an instance cannot be found for a given key path
|
|
29
|
-
*/ class InstanceNotFoundError extends InstanceError {
|
|
30
|
-
constructor(keyPath, missingKey, registryType, context){
|
|
31
|
-
const keyPathStr = keyPath.join('.');
|
|
32
|
-
let message = `Instance not found for key path: ${keyPathStr}`;
|
|
33
|
-
if (missingKey) {
|
|
34
|
-
message += `, Missing key: ${missingKey}`;
|
|
35
|
-
}
|
|
36
|
-
super(message, keyPath, registryType, {
|
|
37
|
-
...context,
|
|
38
|
-
missingKey
|
|
39
|
-
}), _define_property(this, "missingKey", void 0);
|
|
40
|
-
this.missingKey = missingKey;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Thrown when no instances are registered for a key path that exists in the tree
|
|
45
|
-
*/ class NoInstancesRegisteredError extends InstanceError {
|
|
46
|
-
constructor(keyPath, registryType, context){
|
|
47
|
-
const keyPathStr = keyPath.join('.');
|
|
48
|
-
super(`No instances registered for key path: ${keyPathStr}. ` + `The key path exists in the registry tree but contains no instances.`, keyPath, registryType, context);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Thrown when no instances are available (empty instances array)
|
|
53
|
-
*/ class NoInstancesAvailableError extends InstanceError {
|
|
54
|
-
constructor(keyPath, registryType, context){
|
|
55
|
-
const keyPathStr = keyPath.join('.');
|
|
56
|
-
super(`No instances available for key path: ${keyPathStr}. ` + `This typically indicates an internal registry state issue.`, keyPath, registryType, context);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Thrown when no instance matches the requested scopes
|
|
61
|
-
*/ class ScopeNotFoundError extends InstanceError {
|
|
62
|
-
constructor(keyPath, requestedScopes, availableScopes = [], registryType){
|
|
63
|
-
const keyPathStr = keyPath.join('.');
|
|
64
|
-
const scopesStr = requestedScopes.join(', ');
|
|
65
|
-
const availableScopesStr = availableScopes.map((scopes)=>`[${scopes.join(', ')}]`).join(', ');
|
|
66
|
-
let message = `No instance found matching scopes: ${scopesStr} for key path: ${keyPathStr}`;
|
|
67
|
-
if (availableScopes.length > 0) {
|
|
68
|
-
message += `. Available scopes: ${availableScopesStr}`;
|
|
69
|
-
}
|
|
70
|
-
super(message, keyPath, registryType, {
|
|
71
|
-
requestedScopes,
|
|
72
|
-
availableScopes
|
|
73
|
-
}), _define_property(this, "requestedScopes", void 0), _define_property(this, "availableScopes", void 0);
|
|
74
|
-
this.requestedScopes = requestedScopes;
|
|
75
|
-
this.availableScopes = availableScopes;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Thrown when a key path has no children but children are expected
|
|
80
|
-
*/ class NoChildrenAvailableError extends InstanceError {
|
|
81
|
-
constructor(keyPath, parentKey, registryType, context){
|
|
82
|
-
const keyPathStr = keyPath.join('.');
|
|
83
|
-
super(`Instance not found for key path: ${keyPathStr}, No children for: ${parentKey}. ` + `The path cannot be traversed further as '${parentKey}' has no child nodes.`, keyPath, registryType, {
|
|
84
|
-
...context,
|
|
85
|
-
parentKey
|
|
86
|
-
}), _define_property(this, "parentKey", void 0);
|
|
87
|
-
this.parentKey = parentKey;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export { InstanceError, InstanceNotFoundError, NoChildrenAvailableError, NoInstancesAvailableError, NoInstancesRegisteredError, ScopeNotFoundError };
|
|
92
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSW5zdGFuY2VFcnJvci5qcyIsInNvdXJjZXMiOltdLCJzb3VyY2VzQ29udGVudCI6W10sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OyJ9
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Base class for all registry-related errors
|
|
7
|
-
*/ function _define_property(obj, key, value) {
|
|
8
|
-
if (key in obj) {
|
|
9
|
-
Object.defineProperty(obj, key, {
|
|
10
|
-
value: value,
|
|
11
|
-
enumerable: true,
|
|
12
|
-
configurable: true,
|
|
13
|
-
writable: true
|
|
14
|
-
});
|
|
15
|
-
} else {
|
|
16
|
-
obj[key] = value;
|
|
17
|
-
}
|
|
18
|
-
return obj;
|
|
19
|
-
}
|
|
20
|
-
class RegistryError extends Error {
|
|
21
|
-
getDetails() {
|
|
22
|
-
const details = [
|
|
23
|
-
this.message
|
|
24
|
-
];
|
|
25
|
-
if (this.registryType) {
|
|
26
|
-
details.push(`Registry Type: ${this.registryType}`);
|
|
27
|
-
}
|
|
28
|
-
if (this.context) {
|
|
29
|
-
details.push(`Context: ${JSON.stringify(this.context, null, 2)}`);
|
|
30
|
-
}
|
|
31
|
-
return details.join('\n');
|
|
32
|
-
}
|
|
33
|
-
constructor(message, registryType, context){
|
|
34
|
-
super(message), _define_property(this, "registryType", void 0), _define_property(this, "context", void 0);
|
|
35
|
-
this.name = this.constructor.name;
|
|
36
|
-
this.registryType = registryType;
|
|
37
|
-
this.context = context;
|
|
38
|
-
// Maintains proper stack trace for where our error was thrown
|
|
39
|
-
if (Error.captureStackTrace) {
|
|
40
|
-
Error.captureStackTrace(this, this.constructor);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Thrown when attempting to create a registry with invalid parameters
|
|
46
|
-
*/ class RegistryCreationError extends RegistryError {
|
|
47
|
-
constructor(type, reason, context){
|
|
48
|
-
super(`Failed to create registry of type '${type}': ${reason}`, type, context);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Thrown when a factory function returns an invalid instance
|
|
53
|
-
*/ class InvalidFactoryResultError extends RegistryError {
|
|
54
|
-
constructor(keyPath, factoryResult, registryType){
|
|
55
|
-
const keyPathStr = keyPath.join('.');
|
|
56
|
-
super(`Factory did not return a valid instance for: ${keyPathStr}. ` + `Expected instance with 'coordinate' and 'registry' properties, got: ${typeof factoryResult}`, registryType, {
|
|
57
|
-
keyPath,
|
|
58
|
-
factoryResult: typeof factoryResult
|
|
59
|
-
}), _define_property(this, "keyPath", void 0), _define_property(this, "factoryResult", void 0);
|
|
60
|
-
this.keyPath = keyPath;
|
|
61
|
-
this.factoryResult = factoryResult;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Thrown when attempting to register a non-instance object
|
|
66
|
-
*/ class InvalidInstanceRegistrationError extends RegistryError {
|
|
67
|
-
constructor(keyPath, attemptedRegistration, registryType){
|
|
68
|
-
const keyPathStr = keyPath.join('.');
|
|
69
|
-
super(`Attempting to register a non-instance: ${keyPathStr}. ` + `Expected instance with 'coordinate' and 'registry' properties, got: ${typeof attemptedRegistration}`, registryType, {
|
|
70
|
-
keyPath,
|
|
71
|
-
attemptedRegistration: typeof attemptedRegistration
|
|
72
|
-
}), _define_property(this, "keyPath", void 0), _define_property(this, "attemptedRegistration", void 0);
|
|
73
|
-
this.keyPath = keyPath;
|
|
74
|
-
this.attemptedRegistration = attemptedRegistration;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
exports.InvalidFactoryResultError = InvalidFactoryResultError;
|
|
79
|
-
exports.InvalidInstanceRegistrationError = InvalidInstanceRegistrationError;
|
|
80
|
-
exports.RegistryCreationError = RegistryCreationError;
|
|
81
|
-
exports.RegistryError = RegistryError;
|
|
82
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVnaXN0cnlFcnJvci5janMiLCJzb3VyY2VzIjpbXSwic291cmNlc0NvbnRlbnQiOltdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OyJ9
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base class for all registry-related errors
|
|
3
|
-
*/ function _define_property(obj, key, value) {
|
|
4
|
-
if (key in obj) {
|
|
5
|
-
Object.defineProperty(obj, key, {
|
|
6
|
-
value: value,
|
|
7
|
-
enumerable: true,
|
|
8
|
-
configurable: true,
|
|
9
|
-
writable: true
|
|
10
|
-
});
|
|
11
|
-
} else {
|
|
12
|
-
obj[key] = value;
|
|
13
|
-
}
|
|
14
|
-
return obj;
|
|
15
|
-
}
|
|
16
|
-
class RegistryError extends Error {
|
|
17
|
-
getDetails() {
|
|
18
|
-
const details = [
|
|
19
|
-
this.message
|
|
20
|
-
];
|
|
21
|
-
if (this.registryType) {
|
|
22
|
-
details.push(`Registry Type: ${this.registryType}`);
|
|
23
|
-
}
|
|
24
|
-
if (this.context) {
|
|
25
|
-
details.push(`Context: ${JSON.stringify(this.context, null, 2)}`);
|
|
26
|
-
}
|
|
27
|
-
return details.join('\n');
|
|
28
|
-
}
|
|
29
|
-
constructor(message, registryType, context){
|
|
30
|
-
super(message), _define_property(this, "registryType", void 0), _define_property(this, "context", void 0);
|
|
31
|
-
this.name = this.constructor.name;
|
|
32
|
-
this.registryType = registryType;
|
|
33
|
-
this.context = context;
|
|
34
|
-
// Maintains proper stack trace for where our error was thrown
|
|
35
|
-
if (Error.captureStackTrace) {
|
|
36
|
-
Error.captureStackTrace(this, this.constructor);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Thrown when attempting to create a registry with invalid parameters
|
|
42
|
-
*/ class RegistryCreationError extends RegistryError {
|
|
43
|
-
constructor(type, reason, context){
|
|
44
|
-
super(`Failed to create registry of type '${type}': ${reason}`, type, context);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Thrown when a factory function returns an invalid instance
|
|
49
|
-
*/ class InvalidFactoryResultError extends RegistryError {
|
|
50
|
-
constructor(keyPath, factoryResult, registryType){
|
|
51
|
-
const keyPathStr = keyPath.join('.');
|
|
52
|
-
super(`Factory did not return a valid instance for: ${keyPathStr}. ` + `Expected instance with 'coordinate' and 'registry' properties, got: ${typeof factoryResult}`, registryType, {
|
|
53
|
-
keyPath,
|
|
54
|
-
factoryResult: typeof factoryResult
|
|
55
|
-
}), _define_property(this, "keyPath", void 0), _define_property(this, "factoryResult", void 0);
|
|
56
|
-
this.keyPath = keyPath;
|
|
57
|
-
this.factoryResult = factoryResult;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Thrown when attempting to register a non-instance object
|
|
62
|
-
*/ class InvalidInstanceRegistrationError extends RegistryError {
|
|
63
|
-
constructor(keyPath, attemptedRegistration, registryType){
|
|
64
|
-
const keyPathStr = keyPath.join('.');
|
|
65
|
-
super(`Attempting to register a non-instance: ${keyPathStr}. ` + `Expected instance with 'coordinate' and 'registry' properties, got: ${typeof attemptedRegistration}`, registryType, {
|
|
66
|
-
keyPath,
|
|
67
|
-
attemptedRegistration: typeof attemptedRegistration
|
|
68
|
-
}), _define_property(this, "keyPath", void 0), _define_property(this, "attemptedRegistration", void 0);
|
|
69
|
-
this.keyPath = keyPath;
|
|
70
|
-
this.attemptedRegistration = attemptedRegistration;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export { InvalidFactoryResultError, InvalidInstanceRegistrationError, RegistryCreationError, RegistryError };
|
|
75
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVnaXN0cnlFcnJvci5qcyIsInNvdXJjZXMiOltdLCJzb3VyY2VzQ29udGVudCI6W10sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzsifQ==
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
|
|
5
|
-
const RegistryError = require('./RegistryError.cjs');
|
|
6
|
-
|
|
7
|
-
function _define_property(obj, key, value) {
|
|
8
|
-
if (key in obj) {
|
|
9
|
-
Object.defineProperty(obj, key, {
|
|
10
|
-
value: value,
|
|
11
|
-
enumerable: true,
|
|
12
|
-
configurable: true,
|
|
13
|
-
writable: true
|
|
14
|
-
});
|
|
15
|
-
} else {
|
|
16
|
-
obj[key] = value;
|
|
17
|
-
}
|
|
18
|
-
return obj;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Base class for registry hub-related errors
|
|
22
|
-
*/ class RegistryHubError extends RegistryError.RegistryError {
|
|
23
|
-
constructor(message, hubType, context){
|
|
24
|
-
const enrichedContext = hubType ? {
|
|
25
|
-
...context,
|
|
26
|
-
hubType
|
|
27
|
-
} : context;
|
|
28
|
-
super(message, '', enrichedContext), _define_property(this, "hubType", void 0);
|
|
29
|
-
this.hubType = hubType;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Thrown when attempting to register a registry with a type that already exists
|
|
34
|
-
*/ class DuplicateRegistryTypeError extends RegistryHubError {
|
|
35
|
-
constructor(type, context){
|
|
36
|
-
super(`Registry already registered under type: ${type}. ` + `Each registry type must be unique within a registry hub.`, '', {
|
|
37
|
-
...context,
|
|
38
|
-
duplicateType: type
|
|
39
|
-
}), _define_property(this, "duplicateType", void 0);
|
|
40
|
-
this.duplicateType = type;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Thrown when attempting to access a registry type that doesn't exist
|
|
45
|
-
*/ class RegistryTypeNotFoundError extends RegistryHubError {
|
|
46
|
-
constructor(requestedType, availableTypes = [], context){
|
|
47
|
-
let message = `No registry registered under type: ${requestedType}`;
|
|
48
|
-
if (availableTypes.length > 0) {
|
|
49
|
-
message += `. Available types: [${availableTypes.join(', ')}]`;
|
|
50
|
-
}
|
|
51
|
-
super(message, '', {
|
|
52
|
-
...context,
|
|
53
|
-
requestedType,
|
|
54
|
-
availableTypes
|
|
55
|
-
}), _define_property(this, "requestedType", void 0), _define_property(this, "availableTypes", void 0);
|
|
56
|
-
this.requestedType = requestedType;
|
|
57
|
-
this.availableTypes = availableTypes;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Thrown when a registry factory function fails to create a valid registry
|
|
62
|
-
*/ class RegistryFactoryError extends RegistryHubError {
|
|
63
|
-
constructor(type, factoryError, context){
|
|
64
|
-
super(`Registry factory failed to create registry of type '${type}': ${factoryError.message}`, '', {
|
|
65
|
-
...context,
|
|
66
|
-
attemptedType: type,
|
|
67
|
-
originalError: factoryError.message
|
|
68
|
-
}), _define_property(this, "factoryError", void 0), _define_property(this, "attemptedType", void 0);
|
|
69
|
-
this.factoryError = factoryError;
|
|
70
|
-
this.attemptedType = type;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Thrown when a factory returns an invalid registry object
|
|
75
|
-
*/ class InvalidRegistryFactoryResultError extends RegistryHubError {
|
|
76
|
-
constructor(type, factoryResult, context){
|
|
77
|
-
super(`Registry factory returned invalid registry for type '${type}'. ` + `Expected registry with 'type', 'get', 'register', and 'createInstance' properties, ` + `got: ${typeof factoryResult}`, '', {
|
|
78
|
-
...context,
|
|
79
|
-
attemptedType: type,
|
|
80
|
-
factoryResult: typeof factoryResult
|
|
81
|
-
}), _define_property(this, "factoryResult", void 0), _define_property(this, "attemptedType", void 0);
|
|
82
|
-
this.factoryResult = factoryResult;
|
|
83
|
-
this.attemptedType = type;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
exports.DuplicateRegistryTypeError = DuplicateRegistryTypeError;
|
|
88
|
-
exports.InvalidRegistryFactoryResultError = InvalidRegistryFactoryResultError;
|
|
89
|
-
exports.RegistryFactoryError = RegistryFactoryError;
|
|
90
|
-
exports.RegistryHubError = RegistryHubError;
|
|
91
|
-
exports.RegistryTypeNotFoundError = RegistryTypeNotFoundError;
|
|
92
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVnaXN0cnlIdWJFcnJvci5janMiLCJzb3VyY2VzIjpbXSwic291cmNlc0NvbnRlbnQiOltdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzsifQ==
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { RegistryError } from './RegistryError.js';
|
|
2
|
-
|
|
3
|
-
function _define_property(obj, key, value) {
|
|
4
|
-
if (key in obj) {
|
|
5
|
-
Object.defineProperty(obj, key, {
|
|
6
|
-
value: value,
|
|
7
|
-
enumerable: true,
|
|
8
|
-
configurable: true,
|
|
9
|
-
writable: true
|
|
10
|
-
});
|
|
11
|
-
} else {
|
|
12
|
-
obj[key] = value;
|
|
13
|
-
}
|
|
14
|
-
return obj;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Base class for registry hub-related errors
|
|
18
|
-
*/ class RegistryHubError extends RegistryError {
|
|
19
|
-
constructor(message, hubType, context){
|
|
20
|
-
const enrichedContext = hubType ? {
|
|
21
|
-
...context,
|
|
22
|
-
hubType
|
|
23
|
-
} : context;
|
|
24
|
-
super(message, '', enrichedContext), _define_property(this, "hubType", void 0);
|
|
25
|
-
this.hubType = hubType;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Thrown when attempting to register a registry with a type that already exists
|
|
30
|
-
*/ class DuplicateRegistryTypeError extends RegistryHubError {
|
|
31
|
-
constructor(type, context){
|
|
32
|
-
super(`Registry already registered under type: ${type}. ` + `Each registry type must be unique within a registry hub.`, '', {
|
|
33
|
-
...context,
|
|
34
|
-
duplicateType: type
|
|
35
|
-
}), _define_property(this, "duplicateType", void 0);
|
|
36
|
-
this.duplicateType = type;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Thrown when attempting to access a registry type that doesn't exist
|
|
41
|
-
*/ class RegistryTypeNotFoundError extends RegistryHubError {
|
|
42
|
-
constructor(requestedType, availableTypes = [], context){
|
|
43
|
-
let message = `No registry registered under type: ${requestedType}`;
|
|
44
|
-
if (availableTypes.length > 0) {
|
|
45
|
-
message += `. Available types: [${availableTypes.join(', ')}]`;
|
|
46
|
-
}
|
|
47
|
-
super(message, '', {
|
|
48
|
-
...context,
|
|
49
|
-
requestedType,
|
|
50
|
-
availableTypes
|
|
51
|
-
}), _define_property(this, "requestedType", void 0), _define_property(this, "availableTypes", void 0);
|
|
52
|
-
this.requestedType = requestedType;
|
|
53
|
-
this.availableTypes = availableTypes;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Thrown when a registry factory function fails to create a valid registry
|
|
58
|
-
*/ class RegistryFactoryError extends RegistryHubError {
|
|
59
|
-
constructor(type, factoryError, context){
|
|
60
|
-
super(`Registry factory failed to create registry of type '${type}': ${factoryError.message}`, '', {
|
|
61
|
-
...context,
|
|
62
|
-
attemptedType: type,
|
|
63
|
-
originalError: factoryError.message
|
|
64
|
-
}), _define_property(this, "factoryError", void 0), _define_property(this, "attemptedType", void 0);
|
|
65
|
-
this.factoryError = factoryError;
|
|
66
|
-
this.attemptedType = type;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Thrown when a factory returns an invalid registry object
|
|
71
|
-
*/ class InvalidRegistryFactoryResultError extends RegistryHubError {
|
|
72
|
-
constructor(type, factoryResult, context){
|
|
73
|
-
super(`Registry factory returned invalid registry for type '${type}'. ` + `Expected registry with 'type', 'get', 'register', and 'createInstance' properties, ` + `got: ${typeof factoryResult}`, '', {
|
|
74
|
-
...context,
|
|
75
|
-
attemptedType: type,
|
|
76
|
-
factoryResult: typeof factoryResult
|
|
77
|
-
}), _define_property(this, "factoryResult", void 0), _define_property(this, "attemptedType", void 0);
|
|
78
|
-
this.factoryResult = factoryResult;
|
|
79
|
-
this.attemptedType = type;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export { DuplicateRegistryTypeError, InvalidRegistryFactoryResultError, RegistryFactoryError, RegistryHubError, RegistryTypeNotFoundError };
|
|
84
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVnaXN0cnlIdWJFcnJvci5qcyIsInNvdXJjZXMiOltdLCJzb3VyY2VzQ29udGVudCI6W10sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzsifQ==
|