@happyvertical/directory 0.79.0 → 0.80.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.
- package/AGENT.md +1 -1
- package/dist/chunks/errors-DjVGsCVd.js +66 -0
- package/dist/chunks/errors-DjVGsCVd.js.map +1 -0
- package/dist/index.js +1561 -2161
- package/dist/index.js.map +1 -1
- package/metadata.json +1 -1
- package/package.json +5 -5
package/AGENT.md
CHANGED
|
@@ -7,7 +7,7 @@ Unified directory services with adapter-based architecture (Kanidm, Stalwart, Po
|
|
|
7
7
|
## Package Map
|
|
8
8
|
- Package: `@happyvertical/directory`
|
|
9
9
|
- Hierarchy path: `@happyvertical/sdk > packages > directory`
|
|
10
|
-
- Workspace position: `7 of
|
|
10
|
+
- Workspace position: `7 of 32` local packages
|
|
11
11
|
- Internal dependencies: `@happyvertical/utils`
|
|
12
12
|
- Internal dependents: none
|
|
13
13
|
- Knowledge graph files: `AGENT.md`, `metadata.json`, `ecosystem-manifest.json`
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
//#region src/shared/errors.ts
|
|
2
|
+
/**
|
|
3
|
+
* Error classes for @happyvertical/directory package
|
|
4
|
+
*/
|
|
5
|
+
var DirectoryError = class extends Error {
|
|
6
|
+
code;
|
|
7
|
+
provider;
|
|
8
|
+
cause;
|
|
9
|
+
constructor(message, code, provider, cause) {
|
|
10
|
+
super(message);
|
|
11
|
+
this.name = "DirectoryError";
|
|
12
|
+
this.code = code;
|
|
13
|
+
this.provider = provider;
|
|
14
|
+
this.cause = cause;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var ConnectionError = class extends DirectoryError {
|
|
18
|
+
constructor(message, provider, cause) {
|
|
19
|
+
super(message, "CONNECTION_ERROR", provider, cause);
|
|
20
|
+
this.name = "ConnectionError";
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
var AuthenticationError = class extends DirectoryError {
|
|
24
|
+
constructor(message, provider, cause) {
|
|
25
|
+
super(message, "AUTHENTICATION_ERROR", provider, cause);
|
|
26
|
+
this.name = "AuthenticationError";
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
var NotFoundError = class extends DirectoryError {
|
|
30
|
+
resourceType;
|
|
31
|
+
resourceId;
|
|
32
|
+
constructor(resourceType, resourceId, provider, cause) {
|
|
33
|
+
super(`${resourceType} not found: ${resourceId}`, "NOT_FOUND", provider, cause);
|
|
34
|
+
this.name = "NotFoundError";
|
|
35
|
+
this.resourceType = resourceType;
|
|
36
|
+
this.resourceId = resourceId;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
var ConflictError = class extends DirectoryError {
|
|
40
|
+
resourceType;
|
|
41
|
+
resourceId;
|
|
42
|
+
constructor(resourceType, resourceId, provider, cause) {
|
|
43
|
+
super(`${resourceType} already exists: ${resourceId}`, "CONFLICT", provider, cause);
|
|
44
|
+
this.name = "ConflictError";
|
|
45
|
+
this.resourceType = resourceType;
|
|
46
|
+
this.resourceId = resourceId;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var ValidationError = class extends DirectoryError {
|
|
50
|
+
constructor(message, provider, cause) {
|
|
51
|
+
super(message, "VALIDATION_ERROR", provider, cause);
|
|
52
|
+
this.name = "ValidationError";
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
var RateLimitError = class extends DirectoryError {
|
|
56
|
+
retryAfter;
|
|
57
|
+
constructor(provider, retryAfter) {
|
|
58
|
+
super(`Rate limit exceeded${retryAfter ? ` (retry after ${retryAfter}s)` : ""}`, "RATE_LIMIT", provider);
|
|
59
|
+
this.name = "RateLimitError";
|
|
60
|
+
this.retryAfter = retryAfter;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
//#endregion
|
|
64
|
+
export { NotFoundError as a, DirectoryError as i, ConflictError as n, RateLimitError as o, ConnectionError as r, ValidationError as s, AuthenticationError as t };
|
|
65
|
+
|
|
66
|
+
//# sourceMappingURL=errors-DjVGsCVd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors-DjVGsCVd.js","names":[],"sources":["../../src/shared/errors.ts"],"sourcesContent":["/**\n * Error classes for @happyvertical/directory package\n */\n\n// ============================================================================\n// Base Error\n// ============================================================================\n\nexport class DirectoryError extends Error {\n code: string;\n provider?: string;\n cause?: unknown;\n\n constructor(\n message: string,\n code: string,\n provider?: string,\n cause?: unknown,\n ) {\n super(message);\n this.name = 'DirectoryError';\n this.code = code;\n this.provider = provider;\n this.cause = cause;\n }\n}\n\n// ============================================================================\n// Connection Errors\n// ============================================================================\n\nexport class ConnectionError extends DirectoryError {\n constructor(message: string, provider?: string, cause?: unknown) {\n super(message, 'CONNECTION_ERROR', provider, cause);\n this.name = 'ConnectionError';\n }\n}\n\n// ============================================================================\n// Authentication Errors\n// ============================================================================\n\nexport class AuthenticationError extends DirectoryError {\n constructor(message: string, provider?: string, cause?: unknown) {\n super(message, 'AUTHENTICATION_ERROR', provider, cause);\n this.name = 'AuthenticationError';\n }\n}\n\n// ============================================================================\n// Not Found Errors\n// ============================================================================\n\nexport class NotFoundError extends DirectoryError {\n resourceType: string;\n resourceId: string;\n\n constructor(\n resourceType: string,\n resourceId: string,\n provider?: string,\n cause?: unknown,\n ) {\n super(\n `${resourceType} not found: ${resourceId}`,\n 'NOT_FOUND',\n provider,\n cause,\n );\n this.name = 'NotFoundError';\n this.resourceType = resourceType;\n this.resourceId = resourceId;\n }\n}\n\n// ============================================================================\n// Conflict Errors\n// ============================================================================\n\nexport class ConflictError extends DirectoryError {\n resourceType: string;\n resourceId: string;\n\n constructor(\n resourceType: string,\n resourceId: string,\n provider?: string,\n cause?: unknown,\n ) {\n super(\n `${resourceType} already exists: ${resourceId}`,\n 'CONFLICT',\n provider,\n cause,\n );\n this.name = 'ConflictError';\n this.resourceType = resourceType;\n this.resourceId = resourceId;\n }\n}\n\n// ============================================================================\n// Validation Errors\n// ============================================================================\n\nexport class ValidationError extends DirectoryError {\n constructor(message: string, provider?: string, cause?: unknown) {\n super(message, 'VALIDATION_ERROR', provider, cause);\n this.name = 'ValidationError';\n }\n}\n\n// ============================================================================\n// Rate Limit Errors\n// ============================================================================\n\nexport class RateLimitError extends DirectoryError {\n retryAfter?: number;\n\n constructor(provider?: string, retryAfter?: number) {\n super(\n `Rate limit exceeded${retryAfter ? ` (retry after ${retryAfter}s)` : ''}`,\n 'RATE_LIMIT',\n provider,\n );\n this.name = 'RateLimitError';\n this.retryAfter = retryAfter;\n }\n}\n"],"mappings":";;;;AAQA,IAAa,iBAAb,cAAoC,MAAM;CACxC;CACA;CACA;CAEA,YACE,SACA,MACA,UACA,OACA;EACA,MAAM,OAAO;EACb,KAAK,OAAO;EACZ,KAAK,OAAO;EACZ,KAAK,WAAW;EAChB,KAAK,QAAQ;CACf;AACF;AAMA,IAAa,kBAAb,cAAqC,eAAe;CAClD,YAAY,SAAiB,UAAmB,OAAiB;EAC/D,MAAM,SAAS,oBAAoB,UAAU,KAAK;EAClD,KAAK,OAAO;CACd;AACF;AAMA,IAAa,sBAAb,cAAyC,eAAe;CACtD,YAAY,SAAiB,UAAmB,OAAiB;EAC/D,MAAM,SAAS,wBAAwB,UAAU,KAAK;EACtD,KAAK,OAAO;CACd;AACF;AAMA,IAAa,gBAAb,cAAmC,eAAe;CAChD;CACA;CAEA,YACE,cACA,YACA,UACA,OACA;EACA,MACE,GAAG,aAAa,cAAc,cAC9B,aACA,UACA,KACF;EACA,KAAK,OAAO;EACZ,KAAK,eAAe;EACpB,KAAK,aAAa;CACpB;AACF;AAMA,IAAa,gBAAb,cAAmC,eAAe;CAChD;CACA;CAEA,YACE,cACA,YACA,UACA,OACA;EACA,MACE,GAAG,aAAa,mBAAmB,cACnC,YACA,UACA,KACF;EACA,KAAK,OAAO;EACZ,KAAK,eAAe;EACpB,KAAK,aAAa;CACpB;AACF;AAMA,IAAa,kBAAb,cAAqC,eAAe;CAClD,YAAY,SAAiB,UAAmB,OAAiB;EAC/D,MAAM,SAAS,oBAAoB,UAAU,KAAK;EAClD,KAAK,OAAO;CACd;AACF;AAMA,IAAa,iBAAb,cAAoC,eAAe;CACjD;CAEA,YAAY,UAAmB,YAAqB;EAClD,MACE,sBAAsB,aAAa,iBAAiB,WAAW,MAAM,MACrE,cACA,QACF;EACA,KAAK,OAAO;EACZ,KAAK,aAAa;CACpB;AACF"}
|