@fjell/registry 4.4.16 → 4.4.20

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.
Files changed (61) hide show
  1. package/build.js +4 -0
  2. package/dist/Coordinate.d.ts +2 -1
  3. package/dist/Coordinate.d.ts.map +1 -0
  4. package/dist/Instance.d.ts +3 -2
  5. package/dist/Instance.d.ts.map +1 -0
  6. package/dist/Registry.d.ts +1 -0
  7. package/dist/Registry.d.ts.map +1 -0
  8. package/dist/RegistryHub.d.ts +1 -0
  9. package/dist/RegistryHub.d.ts.map +1 -0
  10. package/dist/RegistryStats.d.ts +3 -1
  11. package/dist/RegistryStats.d.ts.map +1 -0
  12. package/dist/errors/CoordinateError.d.ts +1 -0
  13. package/dist/errors/CoordinateError.d.ts.map +1 -0
  14. package/dist/errors/InstanceError.d.ts +1 -0
  15. package/dist/errors/InstanceError.d.ts.map +1 -0
  16. package/dist/errors/RegistryError.d.ts +1 -0
  17. package/dist/errors/RegistryError.d.ts.map +1 -0
  18. package/dist/errors/RegistryHubError.d.ts +1 -0
  19. package/dist/errors/RegistryHubError.d.ts.map +1 -0
  20. package/dist/errors/index.d.ts +1 -0
  21. package/dist/errors/index.d.ts.map +1 -0
  22. package/dist/index.d.ts +1 -0
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/index.js +685 -10
  25. package/dist/index.js.map +7 -0
  26. package/dist/logger.d.ts +2 -1
  27. package/dist/logger.d.ts.map +1 -0
  28. package/dist/types.d.ts +6 -4
  29. package/dist/types.d.ts.map +1 -0
  30. package/docs/docs.config.ts +1 -32
  31. package/docs/package-lock.json +5129 -0
  32. package/docs/package.json +2 -2
  33. package/docs/src/types.d.ts +13 -5
  34. package/docs/timing-range.svg +172 -0
  35. package/examples/multi-level-keys.ts +10 -2
  36. package/package.json +21 -33
  37. package/tsconfig.docs.json +28 -0
  38. package/vitest.config.ts +17 -0
  39. package/MIGRATION_SUMMARY.md +0 -200
  40. package/dist/Coordinate.cjs +0 -32
  41. package/dist/Coordinate.js +0 -28
  42. package/dist/Instance.cjs +0 -24
  43. package/dist/Instance.js +0 -19
  44. package/dist/Registry.cjs +0 -182
  45. package/dist/Registry.js +0 -178
  46. package/dist/RegistryHub.cjs +0 -94
  47. package/dist/RegistryHub.js +0 -90
  48. package/dist/RegistryStats.cjs +0 -200
  49. package/dist/RegistryStats.js +0 -196
  50. package/dist/errors/CoordinateError.cjs +0 -70
  51. package/dist/errors/CoordinateError.js +0 -63
  52. package/dist/errors/InstanceError.cjs +0 -101
  53. package/dist/errors/InstanceError.js +0 -92
  54. package/dist/errors/RegistryError.cjs +0 -82
  55. package/dist/errors/RegistryError.js +0 -75
  56. package/dist/errors/RegistryHubError.cjs +0 -92
  57. package/dist/errors/RegistryHubError.js +0 -84
  58. package/dist/index.cjs +0 -823
  59. package/dist/index.cjs.map +0 -1
  60. package/dist/logger.cjs +0 -10
  61. package/dist/logger.js +0 -6
@@ -1,200 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
-
5
- /**
6
- * Represents a service client (another service making the request)
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
- * Internal class for tracking Registry statistics with complex coordinate combinations and client tracking
22
- */ class RegistryStats {
23
- /**
24
- * Records a get() call for the specified coordinate and client
25
- */ recordGetCall(kta, scopes, client) {
26
- this.totalCalls++;
27
- const ktaKey = kta.join('.');
28
- const scopeKey = this.createScopeKey(scopes || []);
29
- const clientKey = this.createClientKey(client);
30
- if (!this.coordinateCalls.has(ktaKey)) {
31
- this.coordinateCalls.set(ktaKey, new Map());
32
- }
33
- const scopeMap = this.coordinateCalls.get(ktaKey);
34
- if (!scopeMap.has(scopeKey)) {
35
- scopeMap.set(scopeKey, new Map());
36
- }
37
- const clientMap = scopeMap.get(scopeKey);
38
- const currentCount = clientMap.get(clientKey) || 0;
39
- clientMap.set(clientKey, currentCount + 1);
40
- }
41
- /**
42
- * Gets the current statistics snapshot
43
- */ getStatistics() {
44
- const coordinateCallRecords = [];
45
- let serviceCalls = 0;
46
- let applicationCalls = 0;
47
- let unidentifiedCalls = 0;
48
- for (const [ktaKey, scopeMap] of this.coordinateCalls){
49
- for (const [scopeKey, clientMap] of scopeMap){
50
- const clientCalls = [];
51
- let totalCount = 0;
52
- for (const [clientKey, count] of clientMap){
53
- const client = this.parseClientKey(clientKey);
54
- if (client !== null) {
55
- clientCalls.push({
56
- client,
57
- count
58
- });
59
- }
60
- totalCount += count;
61
- // Update client summary
62
- if (clientKey === '__no_client__') {
63
- unidentifiedCalls += count;
64
- } else if (typeof client === 'string') {
65
- applicationCalls += count;
66
- } else if (client !== null) {
67
- serviceCalls += count;
68
- }
69
- }
70
- coordinateCallRecords.push({
71
- kta: ktaKey.split('.'),
72
- scopes: this.parseScopeKey(scopeKey),
73
- count: totalCount,
74
- clientCalls: [
75
- ...clientCalls
76
- ] // Return a copy
77
- });
78
- }
79
- }
80
- return {
81
- totalGetCalls: this.totalCalls,
82
- coordinateCallRecords: [
83
- ...coordinateCallRecords
84
- ],
85
- clientSummary: {
86
- serviceCalls,
87
- applicationCalls,
88
- unidentifiedCalls
89
- }
90
- };
91
- }
92
- /**
93
- * Gets call count for a specific coordinate combination
94
- */ getCallCount(kta, scopes) {
95
- const ktaKey = kta.join('.');
96
- const scopeKey = this.createScopeKey(scopes || []);
97
- const scopeMap = this.coordinateCalls.get(ktaKey);
98
- if (!scopeMap) return 0;
99
- const clientMap = scopeMap.get(scopeKey);
100
- if (!clientMap) return 0;
101
- let total = 0;
102
- for (const count of clientMap.values()){
103
- total += count;
104
- }
105
- return total;
106
- }
107
- /**
108
- * Gets call count for a specific coordinate combination from a specific client
109
- */ getCallCountByClient(kta, scopes, client) {
110
- const ktaKey = kta.join('.');
111
- const scopeKey = this.createScopeKey(scopes || []);
112
- const clientKey = this.createClientKey(client);
113
- const scopeMap = this.coordinateCalls.get(ktaKey);
114
- if (!scopeMap) return 0;
115
- const clientMap = scopeMap.get(scopeKey);
116
- if (!clientMap) return 0;
117
- return clientMap.get(clientKey) || 0;
118
- }
119
- /**
120
- * Gets total calls for a specific kta (across all scopes)
121
- */ getTotalCallsForKta(kta) {
122
- const ktaKey = kta.join('.');
123
- const scopeMap = this.coordinateCalls.get(ktaKey);
124
- if (!scopeMap) return 0;
125
- let total = 0;
126
- for (const clientMap of scopeMap.values()){
127
- for (const count of clientMap.values()){
128
- total += count;
129
- }
130
- }
131
- return total;
132
- }
133
- /**
134
- * Gets all unique kta paths that have been called
135
- */ getCalledKtaPaths() {
136
- const ktaPaths = [];
137
- for (const ktaKey of this.coordinateCalls.keys()){
138
- ktaPaths.push(ktaKey.split('.'));
139
- }
140
- return ktaPaths;
141
- }
142
- /**
143
- * Creates a normalized scope key from scopes array
144
- */ createScopeKey(scopes) {
145
- if (scopes.length === 0) return '__no_scopes__';
146
- return [
147
- ...scopes
148
- ].sort().join(',');
149
- }
150
- /**
151
- * Parses a scope key back to scopes array
152
- */ parseScopeKey(scopeKey) {
153
- if (scopeKey === '__no_scopes__') return [];
154
- return scopeKey.split(',');
155
- }
156
- /**
157
- * Creates a normalized client key from client identifier
158
- */ createClientKey(client) {
159
- if (!client) return '__no_client__';
160
- if (typeof client === 'string') {
161
- return `app:${client}`;
162
- }
163
- // Service client
164
- const coordKey = `${client.coordinate.kta.join('.')};${this.createScopeKey(client.coordinate.scopes)}`;
165
- return `service:${client.registryType}:${coordKey}`;
166
- }
167
- /**
168
- * Parses a client key back to client identifier
169
- */ parseClientKey(clientKey) {
170
- if (clientKey === '__no_client__') return null;
171
- if (clientKey.startsWith('app:')) {
172
- return clientKey.substring(4);
173
- }
174
- if (clientKey.startsWith('service:')) {
175
- const parts = clientKey.substring(8).split(':');
176
- if (parts.length !== 2) return null;
177
- const registryType = parts[0];
178
- const coordParts = parts[1].split(';');
179
- if (coordParts.length !== 2) return null;
180
- const kta = coordParts[0].split('.');
181
- const scopes = this.parseScopeKey(coordParts[1]);
182
- return {
183
- registryType,
184
- coordinate: {
185
- kta,
186
- scopes
187
- }
188
- };
189
- }
190
- return null;
191
- }
192
- constructor(){
193
- _define_property(this, "totalCalls", 0);
194
- // Map structure: ktaKey -> scopeKey -> clientKey -> count
195
- _define_property(this, "coordinateCalls", new Map());
196
- }
197
- }
198
-
199
- exports.RegistryStats = RegistryStats;
200
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVnaXN0cnlTdGF0cy5janMiLCJzb3VyY2VzIjpbXSwic291cmNlc0NvbnRlbnQiOltdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzsifQ==
@@ -1,196 +0,0 @@
1
- /**
2
- * Represents a service client (another service making the request)
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
- * Internal class for tracking Registry statistics with complex coordinate combinations and client tracking
18
- */ class RegistryStats {
19
- /**
20
- * Records a get() call for the specified coordinate and client
21
- */ recordGetCall(kta, scopes, client) {
22
- this.totalCalls++;
23
- const ktaKey = kta.join('.');
24
- const scopeKey = this.createScopeKey(scopes || []);
25
- const clientKey = this.createClientKey(client);
26
- if (!this.coordinateCalls.has(ktaKey)) {
27
- this.coordinateCalls.set(ktaKey, new Map());
28
- }
29
- const scopeMap = this.coordinateCalls.get(ktaKey);
30
- if (!scopeMap.has(scopeKey)) {
31
- scopeMap.set(scopeKey, new Map());
32
- }
33
- const clientMap = scopeMap.get(scopeKey);
34
- const currentCount = clientMap.get(clientKey) || 0;
35
- clientMap.set(clientKey, currentCount + 1);
36
- }
37
- /**
38
- * Gets the current statistics snapshot
39
- */ getStatistics() {
40
- const coordinateCallRecords = [];
41
- let serviceCalls = 0;
42
- let applicationCalls = 0;
43
- let unidentifiedCalls = 0;
44
- for (const [ktaKey, scopeMap] of this.coordinateCalls){
45
- for (const [scopeKey, clientMap] of scopeMap){
46
- const clientCalls = [];
47
- let totalCount = 0;
48
- for (const [clientKey, count] of clientMap){
49
- const client = this.parseClientKey(clientKey);
50
- if (client !== null) {
51
- clientCalls.push({
52
- client,
53
- count
54
- });
55
- }
56
- totalCount += count;
57
- // Update client summary
58
- if (clientKey === '__no_client__') {
59
- unidentifiedCalls += count;
60
- } else if (typeof client === 'string') {
61
- applicationCalls += count;
62
- } else if (client !== null) {
63
- serviceCalls += count;
64
- }
65
- }
66
- coordinateCallRecords.push({
67
- kta: ktaKey.split('.'),
68
- scopes: this.parseScopeKey(scopeKey),
69
- count: totalCount,
70
- clientCalls: [
71
- ...clientCalls
72
- ] // Return a copy
73
- });
74
- }
75
- }
76
- return {
77
- totalGetCalls: this.totalCalls,
78
- coordinateCallRecords: [
79
- ...coordinateCallRecords
80
- ],
81
- clientSummary: {
82
- serviceCalls,
83
- applicationCalls,
84
- unidentifiedCalls
85
- }
86
- };
87
- }
88
- /**
89
- * Gets call count for a specific coordinate combination
90
- */ getCallCount(kta, scopes) {
91
- const ktaKey = kta.join('.');
92
- const scopeKey = this.createScopeKey(scopes || []);
93
- const scopeMap = this.coordinateCalls.get(ktaKey);
94
- if (!scopeMap) return 0;
95
- const clientMap = scopeMap.get(scopeKey);
96
- if (!clientMap) return 0;
97
- let total = 0;
98
- for (const count of clientMap.values()){
99
- total += count;
100
- }
101
- return total;
102
- }
103
- /**
104
- * Gets call count for a specific coordinate combination from a specific client
105
- */ getCallCountByClient(kta, scopes, client) {
106
- const ktaKey = kta.join('.');
107
- const scopeKey = this.createScopeKey(scopes || []);
108
- const clientKey = this.createClientKey(client);
109
- const scopeMap = this.coordinateCalls.get(ktaKey);
110
- if (!scopeMap) return 0;
111
- const clientMap = scopeMap.get(scopeKey);
112
- if (!clientMap) return 0;
113
- return clientMap.get(clientKey) || 0;
114
- }
115
- /**
116
- * Gets total calls for a specific kta (across all scopes)
117
- */ getTotalCallsForKta(kta) {
118
- const ktaKey = kta.join('.');
119
- const scopeMap = this.coordinateCalls.get(ktaKey);
120
- if (!scopeMap) return 0;
121
- let total = 0;
122
- for (const clientMap of scopeMap.values()){
123
- for (const count of clientMap.values()){
124
- total += count;
125
- }
126
- }
127
- return total;
128
- }
129
- /**
130
- * Gets all unique kta paths that have been called
131
- */ getCalledKtaPaths() {
132
- const ktaPaths = [];
133
- for (const ktaKey of this.coordinateCalls.keys()){
134
- ktaPaths.push(ktaKey.split('.'));
135
- }
136
- return ktaPaths;
137
- }
138
- /**
139
- * Creates a normalized scope key from scopes array
140
- */ createScopeKey(scopes) {
141
- if (scopes.length === 0) return '__no_scopes__';
142
- return [
143
- ...scopes
144
- ].sort().join(',');
145
- }
146
- /**
147
- * Parses a scope key back to scopes array
148
- */ parseScopeKey(scopeKey) {
149
- if (scopeKey === '__no_scopes__') return [];
150
- return scopeKey.split(',');
151
- }
152
- /**
153
- * Creates a normalized client key from client identifier
154
- */ createClientKey(client) {
155
- if (!client) return '__no_client__';
156
- if (typeof client === 'string') {
157
- return `app:${client}`;
158
- }
159
- // Service client
160
- const coordKey = `${client.coordinate.kta.join('.')};${this.createScopeKey(client.coordinate.scopes)}`;
161
- return `service:${client.registryType}:${coordKey}`;
162
- }
163
- /**
164
- * Parses a client key back to client identifier
165
- */ parseClientKey(clientKey) {
166
- if (clientKey === '__no_client__') return null;
167
- if (clientKey.startsWith('app:')) {
168
- return clientKey.substring(4);
169
- }
170
- if (clientKey.startsWith('service:')) {
171
- const parts = clientKey.substring(8).split(':');
172
- if (parts.length !== 2) return null;
173
- const registryType = parts[0];
174
- const coordParts = parts[1].split(';');
175
- if (coordParts.length !== 2) return null;
176
- const kta = coordParts[0].split('.');
177
- const scopes = this.parseScopeKey(coordParts[1]);
178
- return {
179
- registryType,
180
- coordinate: {
181
- kta,
182
- scopes
183
- }
184
- };
185
- }
186
- return null;
187
- }
188
- constructor(){
189
- _define_property(this, "totalCalls", 0);
190
- // Map structure: ktaKey -> scopeKey -> clientKey -> count
191
- _define_property(this, "coordinateCalls", new Map());
192
- }
193
- }
194
-
195
- export { RegistryStats };
196
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVnaXN0cnlTdGF0cy5qcyIsInNvdXJjZXMiOltdLCJzb3VyY2VzQ29udGVudCI6W10sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7In0=
@@ -1,70 +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 coordinate-related errors
22
- */ class CoordinateError extends RegistryError.RegistryError {
23
- constructor(message, kta, scopes, context){
24
- super(message, '', {
25
- ...context,
26
- kta,
27
- scopes
28
- }), _define_property(this, "kta", void 0), _define_property(this, "scopes", void 0);
29
- this.kta = kta;
30
- this.scopes = scopes;
31
- }
32
- }
33
- /**
34
- * Thrown when coordinate creation fails due to invalid parameters
35
- */ class InvalidCoordinateError extends CoordinateError {
36
- constructor(kta, scopes, reason, context){
37
- super(`Invalid coordinate parameters: ${reason}. ` + `KTA: ${JSON.stringify(kta)}, Scopes: [${scopes.join(', ')}]`, kta, scopes, {
38
- ...context,
39
- reason
40
- });
41
- }
42
- }
43
- /**
44
- * Thrown when KTA (Key Type Array) is invalid
45
- */ class InvalidKTAError extends CoordinateError {
46
- constructor(kta, reason, context){
47
- super(`Invalid KTA (Key Type Array): ${reason}. ` + `Expected string or array of strings, got: ${JSON.stringify(kta)}`, kta, [], {
48
- ...context,
49
- reason
50
- });
51
- }
52
- }
53
- /**
54
- * Thrown when scopes array contains invalid values
55
- */ class InvalidScopesError extends CoordinateError {
56
- constructor(scopes, invalidScopes, reason, context){
57
- super(`Invalid scopes: ${reason}. ` + `Invalid scope values: ${JSON.stringify(invalidScopes)}`, null, scopes.filter((s)=>typeof s === 'string'), {
58
- ...context,
59
- reason,
60
- invalidScopes
61
- }), _define_property(this, "invalidScopes", void 0);
62
- this.invalidScopes = invalidScopes;
63
- }
64
- }
65
-
66
- exports.CoordinateError = CoordinateError;
67
- exports.InvalidCoordinateError = InvalidCoordinateError;
68
- exports.InvalidKTAError = InvalidKTAError;
69
- exports.InvalidScopesError = InvalidScopesError;
70
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQ29vcmRpbmF0ZUVycm9yLmNqcyIsInNvdXJjZXMiOltdLCJzb3VyY2VzQ29udGVudCI6W10sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7In0=
@@ -1,63 +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 coordinate-related errors
18
- */ class CoordinateError extends RegistryError {
19
- constructor(message, kta, scopes, context){
20
- super(message, '', {
21
- ...context,
22
- kta,
23
- scopes
24
- }), _define_property(this, "kta", void 0), _define_property(this, "scopes", void 0);
25
- this.kta = kta;
26
- this.scopes = scopes;
27
- }
28
- }
29
- /**
30
- * Thrown when coordinate creation fails due to invalid parameters
31
- */ class InvalidCoordinateError extends CoordinateError {
32
- constructor(kta, scopes, reason, context){
33
- super(`Invalid coordinate parameters: ${reason}. ` + `KTA: ${JSON.stringify(kta)}, Scopes: [${scopes.join(', ')}]`, kta, scopes, {
34
- ...context,
35
- reason
36
- });
37
- }
38
- }
39
- /**
40
- * Thrown when KTA (Key Type Array) is invalid
41
- */ class InvalidKTAError extends CoordinateError {
42
- constructor(kta, reason, context){
43
- super(`Invalid KTA (Key Type Array): ${reason}. ` + `Expected string or array of strings, got: ${JSON.stringify(kta)}`, kta, [], {
44
- ...context,
45
- reason
46
- });
47
- }
48
- }
49
- /**
50
- * Thrown when scopes array contains invalid values
51
- */ class InvalidScopesError extends CoordinateError {
52
- constructor(scopes, invalidScopes, reason, context){
53
- super(`Invalid scopes: ${reason}. ` + `Invalid scope values: ${JSON.stringify(invalidScopes)}`, null, scopes.filter((s)=>typeof s === 'string'), {
54
- ...context,
55
- reason,
56
- invalidScopes
57
- }), _define_property(this, "invalidScopes", void 0);
58
- this.invalidScopes = invalidScopes;
59
- }
60
- }
61
-
62
- export { CoordinateError, InvalidCoordinateError, InvalidKTAError, InvalidScopesError };
63
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQ29vcmRpbmF0ZUVycm9yLmpzIiwic291cmNlcyI6W10sInNvdXJjZXNDb250ZW50IjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OyJ9
@@ -1,101 +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 instance-related errors
22
- */ class InstanceError extends RegistryError.RegistryError {
23
- constructor(message, keyPath, registryType, context){
24
- super(message, registryType, {
25
- ...context,
26
- keyPath
27
- }), _define_property(this, "keyPath", void 0);
28
- this.keyPath = keyPath;
29
- }
30
- }
31
- /**
32
- * Thrown when an instance cannot be found for a given key path
33
- */ class InstanceNotFoundError extends InstanceError {
34
- constructor(keyPath, missingKey, registryType, context){
35
- const keyPathStr = keyPath.join('.');
36
- let message = `Instance not found for key path: ${keyPathStr}`;
37
- if (missingKey) {
38
- message += `, Missing key: ${missingKey}`;
39
- }
40
- super(message, keyPath, registryType, {
41
- ...context,
42
- missingKey
43
- }), _define_property(this, "missingKey", void 0);
44
- this.missingKey = missingKey;
45
- }
46
- }
47
- /**
48
- * Thrown when no instances are registered for a key path that exists in the tree
49
- */ class NoInstancesRegisteredError extends InstanceError {
50
- constructor(keyPath, registryType, context){
51
- const keyPathStr = keyPath.join('.');
52
- super(`No instances registered for key path: ${keyPathStr}. ` + `The key path exists in the registry tree but contains no instances.`, keyPath, registryType, context);
53
- }
54
- }
55
- /**
56
- * Thrown when no instances are available (empty instances array)
57
- */ class NoInstancesAvailableError extends InstanceError {
58
- constructor(keyPath, registryType, context){
59
- const keyPathStr = keyPath.join('.');
60
- super(`No instances available for key path: ${keyPathStr}. ` + `This typically indicates an internal registry state issue.`, keyPath, registryType, context);
61
- }
62
- }
63
- /**
64
- * Thrown when no instance matches the requested scopes
65
- */ class ScopeNotFoundError extends InstanceError {
66
- constructor(keyPath, requestedScopes, availableScopes = [], registryType){
67
- const keyPathStr = keyPath.join('.');
68
- const scopesStr = requestedScopes.join(', ');
69
- const availableScopesStr = availableScopes.map((scopes)=>`[${scopes.join(', ')}]`).join(', ');
70
- let message = `No instance found matching scopes: ${scopesStr} for key path: ${keyPathStr}`;
71
- if (availableScopes.length > 0) {
72
- message += `. Available scopes: ${availableScopesStr}`;
73
- }
74
- super(message, keyPath, registryType, {
75
- requestedScopes,
76
- availableScopes
77
- }), _define_property(this, "requestedScopes", void 0), _define_property(this, "availableScopes", void 0);
78
- this.requestedScopes = requestedScopes;
79
- this.availableScopes = availableScopes;
80
- }
81
- }
82
- /**
83
- * Thrown when a key path has no children but children are expected
84
- */ class NoChildrenAvailableError extends InstanceError {
85
- constructor(keyPath, parentKey, registryType, context){
86
- const keyPathStr = keyPath.join('.');
87
- 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, {
88
- ...context,
89
- parentKey
90
- }), _define_property(this, "parentKey", void 0);
91
- this.parentKey = parentKey;
92
- }
93
- }
94
-
95
- exports.InstanceError = InstanceError;
96
- exports.InstanceNotFoundError = InstanceNotFoundError;
97
- exports.NoChildrenAvailableError = NoChildrenAvailableError;
98
- exports.NoInstancesAvailableError = NoInstancesAvailableError;
99
- exports.NoInstancesRegisteredError = NoInstancesRegisteredError;
100
- exports.ScopeNotFoundError = ScopeNotFoundError;
101
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSW5zdGFuY2VFcnJvci5janMiLCJzb3VyY2VzIjpbXSwic291cmNlc0NvbnRlbnQiOltdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzsifQ==