@fractary/core 0.3.2 → 0.4.0
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/__tests__/factories.test.d.ts +5 -0
- package/dist/__tests__/factories.test.d.ts.map +1 -0
- package/dist/__tests__/factories.test.js +66 -0
- package/dist/__tests__/factories.test.js.map +1 -0
- package/dist/auth/__tests__/create-token-provider.test.d.ts +5 -0
- package/dist/auth/__tests__/create-token-provider.test.d.ts.map +1 -0
- package/dist/auth/__tests__/create-token-provider.test.js +104 -0
- package/dist/auth/__tests__/create-token-provider.test.js.map +1 -0
- package/dist/auth/__tests__/github-app-auth.test.d.ts +5 -0
- package/dist/auth/__tests__/github-app-auth.test.d.ts.map +1 -0
- package/dist/auth/__tests__/github-app-auth.test.js +293 -0
- package/dist/auth/__tests__/github-app-auth.test.js.map +1 -0
- package/dist/auth/__tests__/static-token-provider.test.d.ts +5 -0
- package/dist/auth/__tests__/static-token-provider.test.d.ts.map +1 -0
- package/dist/auth/__tests__/static-token-provider.test.js +54 -0
- package/dist/auth/__tests__/static-token-provider.test.js.map +1 -0
- package/dist/auth/github-app-auth.d.ts +109 -0
- package/dist/auth/github-app-auth.d.ts.map +1 -0
- package/dist/auth/github-app-auth.js +262 -0
- package/dist/auth/github-app-auth.js.map +1 -0
- package/dist/auth/github-app-token-provider.d.ts +59 -0
- package/dist/auth/github-app-token-provider.d.ts.map +1 -0
- package/dist/auth/github-app-token-provider.js +68 -0
- package/dist/auth/github-app-token-provider.js.map +1 -0
- package/dist/auth/index.d.ts +45 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +74 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/static-token-provider.d.ts +35 -0
- package/dist/auth/static-token-provider.d.ts.map +1 -0
- package/dist/auth/static-token-provider.js +45 -0
- package/dist/auth/static-token-provider.js.map +1 -0
- package/dist/auth/types.d.ts +49 -0
- package/dist/auth/types.d.ts.map +1 -0
- package/dist/auth/types.js +8 -0
- package/dist/auth/types.js.map +1 -0
- package/dist/common/yaml-config.d.ts +10 -0
- package/dist/common/yaml-config.d.ts.map +1 -1
- package/dist/common/yaml-config.js.map +1 -1
- package/dist/config/__tests__/loader.test.d.ts +5 -0
- package/dist/config/__tests__/loader.test.d.ts.map +1 -0
- package/dist/config/__tests__/loader.test.js +129 -0
- package/dist/config/__tests__/loader.test.js.map +1 -0
- package/dist/config/index.d.ts +8 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +27 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/loader.d.ts +126 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +277 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/docs/index.d.ts +5 -0
- package/dist/docs/index.d.ts.map +1 -1
- package/dist/docs/index.js +6 -1
- package/dist/docs/index.js.map +1 -1
- package/dist/docs/manager.d.ts +27 -0
- package/dist/docs/manager.d.ts.map +1 -1
- package/dist/docs/manager.js +168 -15
- package/dist/docs/manager.js.map +1 -1
- package/dist/docs/type-registry.d.ts +123 -0
- package/dist/docs/type-registry.d.ts.map +1 -0
- package/dist/docs/type-registry.js +393 -0
- package/dist/docs/type-registry.js.map +1 -0
- package/dist/docs/types.d.ts +93 -0
- package/dist/docs/types.d.ts.map +1 -1
- package/dist/factories.d.ts +89 -0
- package/dist/factories.d.ts.map +1 -0
- package/dist/factories.js +228 -0
- package/dist/factories.js.map +1 -0
- package/dist/file/factory.d.ts +41 -0
- package/dist/file/factory.d.ts.map +1 -0
- package/dist/file/factory.js +237 -0
- package/dist/file/factory.js.map +1 -0
- package/dist/file/gcs.d.ts +66 -0
- package/dist/file/gcs.d.ts.map +1 -0
- package/dist/file/gcs.js +226 -0
- package/dist/file/gcs.js.map +1 -0
- package/dist/file/gdrive.d.ts +78 -0
- package/dist/file/gdrive.d.ts.map +1 -0
- package/dist/file/gdrive.js +302 -0
- package/dist/file/gdrive.js.map +1 -0
- package/dist/file/index.d.ts +13 -1
- package/dist/file/index.d.ts.map +1 -1
- package/dist/file/index.js +25 -1
- package/dist/file/index.js.map +1 -1
- package/dist/file/manager.d.ts +83 -2
- package/dist/file/manager.d.ts.map +1 -1
- package/dist/file/manager.js +125 -4
- package/dist/file/manager.js.map +1 -1
- package/dist/file/r2.d.ts +56 -0
- package/dist/file/r2.d.ts.map +1 -0
- package/dist/file/r2.js +96 -0
- package/dist/file/r2.js.map +1 -0
- package/dist/file/s3.d.ts +61 -0
- package/dist/file/s3.d.ts.map +1 -0
- package/dist/file/s3.js +258 -0
- package/dist/file/s3.js.map +1 -0
- package/dist/file/types.d.ts +145 -2
- package/dist/file/types.d.ts.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/logs/index.d.ts +1 -0
- package/dist/logs/index.d.ts.map +1 -1
- package/dist/logs/index.js +3 -1
- package/dist/logs/index.js.map +1 -1
- package/dist/logs/manager.d.ts +29 -2
- package/dist/logs/manager.d.ts.map +1 -1
- package/dist/logs/manager.js +48 -7
- package/dist/logs/manager.js.map +1 -1
- package/dist/logs/type-registry.d.ts +180 -0
- package/dist/logs/type-registry.d.ts.map +1 -0
- package/dist/logs/type-registry.js +421 -0
- package/dist/logs/type-registry.js.map +1 -0
- package/dist/logs/type-registry.test.d.ts +5 -0
- package/dist/logs/type-registry.test.d.ts.map +1 -0
- package/dist/logs/type-registry.test.js +671 -0
- package/dist/logs/type-registry.test.js.map +1 -0
- package/dist/logs/types.d.ts +2 -0
- package/dist/logs/types.d.ts.map +1 -1
- package/package.json +62 -8
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fractary/core - Log Type Registry
|
|
3
|
+
*
|
|
4
|
+
* Manages log type definitions for structured logging.
|
|
5
|
+
* Loads core types from YAML/Markdown files and custom types from config.
|
|
6
|
+
*
|
|
7
|
+
* Log types are stored as directories containing:
|
|
8
|
+
* - type.yaml: Type definition (schema, frontmatter rules, file naming, retention)
|
|
9
|
+
* - template.md: Mustache template for log generation
|
|
10
|
+
* - standards.md: Standards and conventions for this type
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Log type definition (camelCase for TypeScript)
|
|
14
|
+
*/
|
|
15
|
+
export interface LogTypeDefinition {
|
|
16
|
+
/** Type identifier (e.g., 'session', 'audit', 'build') */
|
|
17
|
+
id: string;
|
|
18
|
+
/** Human-readable name */
|
|
19
|
+
displayName: string;
|
|
20
|
+
/** Description of this log type */
|
|
21
|
+
description: string;
|
|
22
|
+
/** Mustache template for log content */
|
|
23
|
+
template: string;
|
|
24
|
+
/** Default output path relative to logs directory */
|
|
25
|
+
outputPath: string;
|
|
26
|
+
/** File naming configuration */
|
|
27
|
+
fileNaming: {
|
|
28
|
+
pattern: string;
|
|
29
|
+
dateFormat?: string;
|
|
30
|
+
slugSource?: string;
|
|
31
|
+
slugMaxLength?: number;
|
|
32
|
+
};
|
|
33
|
+
/** Frontmatter field configuration */
|
|
34
|
+
frontmatter: {
|
|
35
|
+
requiredFields: string[];
|
|
36
|
+
optionalFields?: string[];
|
|
37
|
+
defaults?: Record<string, unknown>;
|
|
38
|
+
};
|
|
39
|
+
/** Log structure requirements */
|
|
40
|
+
structure?: {
|
|
41
|
+
requiredSections?: string[];
|
|
42
|
+
optionalSections?: string[];
|
|
43
|
+
sectionOrder?: string[];
|
|
44
|
+
};
|
|
45
|
+
/** Status field configuration */
|
|
46
|
+
status?: {
|
|
47
|
+
allowedValues: string[];
|
|
48
|
+
default: string;
|
|
49
|
+
};
|
|
50
|
+
/** Severity levels (for applicable log types) */
|
|
51
|
+
severity?: {
|
|
52
|
+
allowedValues: string[];
|
|
53
|
+
default: string;
|
|
54
|
+
};
|
|
55
|
+
/** Retention policy */
|
|
56
|
+
retention?: {
|
|
57
|
+
defaultLocalDays: number | 'forever';
|
|
58
|
+
defaultCloudDays: number | 'forever';
|
|
59
|
+
autoArchive: boolean;
|
|
60
|
+
cleanupAfterArchive: boolean;
|
|
61
|
+
};
|
|
62
|
+
/** Documentation standards (markdown content) */
|
|
63
|
+
standards?: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Configuration for custom log types
|
|
67
|
+
*/
|
|
68
|
+
export interface CustomLogTypeConfig {
|
|
69
|
+
/** Type identifier */
|
|
70
|
+
id: string;
|
|
71
|
+
/** Local path to type directory */
|
|
72
|
+
path?: string;
|
|
73
|
+
/** Remote URL to type.yaml */
|
|
74
|
+
url?: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Registry configuration
|
|
78
|
+
*/
|
|
79
|
+
export interface LogTypeRegistryConfig {
|
|
80
|
+
/**
|
|
81
|
+
* Custom log types to load from config (individual type configs)
|
|
82
|
+
*/
|
|
83
|
+
customTypes?: CustomLogTypeConfig[];
|
|
84
|
+
/**
|
|
85
|
+
* Path to custom manifest.yaml file (loads all types from manifest)
|
|
86
|
+
* This is typically set from logs.custom_templates_path in config.yaml
|
|
87
|
+
*/
|
|
88
|
+
customManifestPath?: string;
|
|
89
|
+
/**
|
|
90
|
+
* Base directory for resolving relative paths
|
|
91
|
+
*/
|
|
92
|
+
baseDir?: string;
|
|
93
|
+
/**
|
|
94
|
+
* Path to core templates/logs directory (defaults to bundled types)
|
|
95
|
+
*/
|
|
96
|
+
coreTypesPath?: string;
|
|
97
|
+
/**
|
|
98
|
+
* Skip loading core types (useful for testing)
|
|
99
|
+
*/
|
|
100
|
+
skipCoreTypes?: boolean;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Log Type Registry - Load and manage log type definitions
|
|
104
|
+
*/
|
|
105
|
+
export declare class LogTypeRegistry {
|
|
106
|
+
private coreTypes;
|
|
107
|
+
private customTypes;
|
|
108
|
+
private baseDir;
|
|
109
|
+
private coreTypesPath;
|
|
110
|
+
constructor(config?: LogTypeRegistryConfig);
|
|
111
|
+
/**
|
|
112
|
+
* Find the core templates/logs directory
|
|
113
|
+
* @throws Error if no valid templates directory is found
|
|
114
|
+
*/
|
|
115
|
+
private findCoreTypesPath;
|
|
116
|
+
/**
|
|
117
|
+
* Load all core log types from the templates/logs directory
|
|
118
|
+
*/
|
|
119
|
+
private loadCoreTypes;
|
|
120
|
+
/**
|
|
121
|
+
* Load custom log types from a manifest file
|
|
122
|
+
* This is used when logs.custom_templates_path is set in config.yaml
|
|
123
|
+
*/
|
|
124
|
+
private loadCustomTypesFromManifest;
|
|
125
|
+
/**
|
|
126
|
+
* Load a log type from a directory
|
|
127
|
+
*/
|
|
128
|
+
private loadLogTypeFromDirectory;
|
|
129
|
+
/**
|
|
130
|
+
* Load custom types from config paths
|
|
131
|
+
*/
|
|
132
|
+
private loadCustomTypes;
|
|
133
|
+
/**
|
|
134
|
+
* Load a custom log type from a URL (async)
|
|
135
|
+
* @param id - Type identifier
|
|
136
|
+
* @param baseUrl - Base URL to the type directory (should contain type.yaml, template.md, standards.md)
|
|
137
|
+
*/
|
|
138
|
+
loadCustomTypeFromUrl(id: string, baseUrl: string): Promise<LogTypeDefinition | null>;
|
|
139
|
+
/**
|
|
140
|
+
* Get all available log types (core + custom)
|
|
141
|
+
*/
|
|
142
|
+
getAllTypes(): LogTypeDefinition[];
|
|
143
|
+
/**
|
|
144
|
+
* Get a log type by ID
|
|
145
|
+
*/
|
|
146
|
+
getType(id: string): LogTypeDefinition | null;
|
|
147
|
+
/**
|
|
148
|
+
* Check if a log type exists
|
|
149
|
+
*/
|
|
150
|
+
hasType(id: string): boolean;
|
|
151
|
+
/**
|
|
152
|
+
* Get only core types
|
|
153
|
+
*/
|
|
154
|
+
getCoreTypes(): LogTypeDefinition[];
|
|
155
|
+
/**
|
|
156
|
+
* Get only custom types
|
|
157
|
+
*/
|
|
158
|
+
getCustomTypes(): LogTypeDefinition[];
|
|
159
|
+
/**
|
|
160
|
+
* Register a custom type programmatically
|
|
161
|
+
*/
|
|
162
|
+
registerType(logType: LogTypeDefinition): void;
|
|
163
|
+
/**
|
|
164
|
+
* Unregister a custom type
|
|
165
|
+
*/
|
|
166
|
+
unregisterType(id: string): boolean;
|
|
167
|
+
/**
|
|
168
|
+
* Get the manifest URL for core types
|
|
169
|
+
*/
|
|
170
|
+
static getCoreManifestUrl(): string;
|
|
171
|
+
/**
|
|
172
|
+
* Get the base URL for a specific core type
|
|
173
|
+
*/
|
|
174
|
+
static getCoreTypeUrl(typeId: string): string;
|
|
175
|
+
/**
|
|
176
|
+
* Get type IDs as array (useful for validation)
|
|
177
|
+
*/
|
|
178
|
+
getTypeIds(): string[];
|
|
179
|
+
}
|
|
180
|
+
//# sourceMappingURL=type-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-registry.d.ts","sourceRoot":"","sources":["../../src/logs/type-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,0DAA0D;IAC1D,EAAE,EAAE,MAAM,CAAC;IAEX,0BAA0B;IAC1B,WAAW,EAAE,MAAM,CAAC;IAEpB,mCAAmC;IACnC,WAAW,EAAE,MAAM,CAAC;IAEpB,wCAAwC;IACxC,QAAQ,EAAE,MAAM,CAAC;IAEjB,qDAAqD;IACrD,UAAU,EAAE,MAAM,CAAC;IAEnB,gCAAgC;IAChC,UAAU,EAAE;QACV,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;IAEF,sCAAsC;IACtC,WAAW,EAAE;QACX,cAAc,EAAE,MAAM,EAAE,CAAC;QACzB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;QAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACpC,CAAC;IAEF,iCAAiC;IACjC,SAAS,CAAC,EAAE;QACV,gBAAgB,CA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AS;IACxB,OAAO,CAAC,aAAa,CAAS;gBAElB,MAAM,CAAC,EAAE,qBAAqB;IA+B1C;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IA0BzB;;OAEG;IACH,OAAO,CAAC,aAAa;IA0BrB;;;OAGG;IACH,OAAO,CAAC,2BAA2B;IAgCnC;;OAEG;IACH,OAAO,CAAC,wBAAwB;IA2ChC;;OAEG;IACH,OAAO,CAAC,eAAe;IA0BvB;;;;OAIG;IACG,qBAAqB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IA8C3F;;OAEG;IACH,WAAW,IAAI,iBAAiB,EAAE;IAqBlC;;OAEG;IACH,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,iBAAiB,GAAG,IAAI;IAS7C;;OAEG;IACH,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAI5B;;OAEG;IACH,YAAY,IAAI,iBAAiB,EAAE;IAInC;;OAEG;IACH,cAAc,IAAI,iBAAiB,EAAE;IAIrC;;OAEG;IACH,YAAY,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI;IAI9C;;OAEG;IACH,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAInC;;OAEG;IACH,MAAM,CAAC,kBAAkB,IAAI,MAAM;IAInC;;OAEG;IACH,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAI7C;;OAEG;IACH,UAAU,IAAI,MAAM,EAAE;CAUvB"}
|
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fractary/core - Log Type Registry
|
|
4
|
+
*
|
|
5
|
+
* Manages log type definitions for structured logging.
|
|
6
|
+
* Loads core types from YAML/Markdown files and custom types from config.
|
|
7
|
+
*
|
|
8
|
+
* Log types are stored as directories containing:
|
|
9
|
+
* - type.yaml: Type definition (schema, frontmatter rules, file naming, retention)
|
|
10
|
+
* - template.md: Mustache template for log generation
|
|
11
|
+
* - standards.md: Standards and conventions for this type
|
|
12
|
+
*/
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
46
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
+
exports.LogTypeRegistry = void 0;
|
|
48
|
+
const fs = __importStar(require("fs"));
|
|
49
|
+
const path = __importStar(require("path"));
|
|
50
|
+
const yaml = __importStar(require("js-yaml"));
|
|
51
|
+
/**
|
|
52
|
+
* Convert raw YAML (snake_case) to LogTypeDefinition (camelCase)
|
|
53
|
+
*/
|
|
54
|
+
function convertYamlToLogType(raw, template, standards) {
|
|
55
|
+
return {
|
|
56
|
+
id: raw.id,
|
|
57
|
+
displayName: raw.display_name,
|
|
58
|
+
description: raw.description,
|
|
59
|
+
template,
|
|
60
|
+
outputPath: raw.output_path,
|
|
61
|
+
fileNaming: {
|
|
62
|
+
pattern: raw.file_naming.pattern,
|
|
63
|
+
dateFormat: raw.file_naming.date_format,
|
|
64
|
+
slugSource: raw.file_naming.slug_source,
|
|
65
|
+
slugMaxLength: raw.file_naming.slug_max_length,
|
|
66
|
+
},
|
|
67
|
+
frontmatter: {
|
|
68
|
+
requiredFields: raw.frontmatter.required_fields,
|
|
69
|
+
optionalFields: raw.frontmatter.optional_fields,
|
|
70
|
+
defaults: raw.frontmatter.defaults,
|
|
71
|
+
},
|
|
72
|
+
structure: raw.structure
|
|
73
|
+
? {
|
|
74
|
+
requiredSections: raw.structure.required_sections,
|
|
75
|
+
optionalSections: raw.structure.optional_sections,
|
|
76
|
+
sectionOrder: raw.structure.section_order,
|
|
77
|
+
}
|
|
78
|
+
: undefined,
|
|
79
|
+
status: raw.status
|
|
80
|
+
? {
|
|
81
|
+
allowedValues: raw.status.allowed_values,
|
|
82
|
+
default: raw.status.default,
|
|
83
|
+
}
|
|
84
|
+
: undefined,
|
|
85
|
+
severity: raw.severity
|
|
86
|
+
? {
|
|
87
|
+
allowedValues: raw.severity.allowed_values,
|
|
88
|
+
default: raw.severity.default,
|
|
89
|
+
}
|
|
90
|
+
: undefined,
|
|
91
|
+
retention: raw.retention
|
|
92
|
+
? {
|
|
93
|
+
defaultLocalDays: raw.retention.default_local_days,
|
|
94
|
+
defaultCloudDays: raw.retention.default_cloud_days,
|
|
95
|
+
autoArchive: raw.retention.auto_archive,
|
|
96
|
+
cleanupAfterArchive: raw.retention.cleanup_after_archive,
|
|
97
|
+
}
|
|
98
|
+
: undefined,
|
|
99
|
+
standards,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Log Type Registry - Load and manage log type definitions
|
|
104
|
+
*/
|
|
105
|
+
class LogTypeRegistry {
|
|
106
|
+
coreTypes;
|
|
107
|
+
customTypes;
|
|
108
|
+
baseDir;
|
|
109
|
+
coreTypesPath;
|
|
110
|
+
constructor(config) {
|
|
111
|
+
this.baseDir = config?.baseDir || process.cwd();
|
|
112
|
+
this.coreTypes = new Map();
|
|
113
|
+
this.customTypes = new Map();
|
|
114
|
+
// Default to looking for templates/logs relative to package root
|
|
115
|
+
// Only resolve path if we need to load core types
|
|
116
|
+
if (config?.coreTypesPath) {
|
|
117
|
+
this.coreTypesPath = config.coreTypesPath;
|
|
118
|
+
}
|
|
119
|
+
else if (!config?.skipCoreTypes) {
|
|
120
|
+
this.coreTypesPath = this.findCoreTypesPath();
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
this.coreTypesPath = '';
|
|
124
|
+
}
|
|
125
|
+
// Load core types unless explicitly skipped
|
|
126
|
+
if (!config?.skipCoreTypes) {
|
|
127
|
+
this.loadCoreTypes();
|
|
128
|
+
}
|
|
129
|
+
// Load custom types from manifest file if provided
|
|
130
|
+
if (config?.customManifestPath) {
|
|
131
|
+
this.loadCustomTypesFromManifest(config.customManifestPath);
|
|
132
|
+
}
|
|
133
|
+
// Load individual custom types if provided (can override manifest types)
|
|
134
|
+
if (config?.customTypes) {
|
|
135
|
+
this.loadCustomTypes(config.customTypes);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Find the core templates/logs directory
|
|
140
|
+
* @throws Error if no valid templates directory is found
|
|
141
|
+
*/
|
|
142
|
+
findCoreTypesPath() {
|
|
143
|
+
// Try common locations
|
|
144
|
+
const candidates = [
|
|
145
|
+
// Development: relative to SDK source
|
|
146
|
+
path.resolve(__dirname, '../../../../templates/logs'),
|
|
147
|
+
// Development: from repo root
|
|
148
|
+
path.resolve(process.cwd(), 'templates/logs'),
|
|
149
|
+
// Installed package: look in parent directories
|
|
150
|
+
path.resolve(__dirname, '../../../../../templates/logs'),
|
|
151
|
+
path.resolve(__dirname, '../../../../../../templates/logs'),
|
|
152
|
+
];
|
|
153
|
+
for (const candidate of candidates) {
|
|
154
|
+
if (fs.existsSync(path.join(candidate, 'manifest.yaml'))) {
|
|
155
|
+
return candidate;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
// No valid path found - throw informative error
|
|
159
|
+
const triedPaths = candidates.map((c) => ` - ${c}`).join('\n');
|
|
160
|
+
throw new Error(`Could not find core log types manifest (manifest.yaml) in any of the expected locations:\n${triedPaths}\n` +
|
|
161
|
+
'If you are using @fractary/core as a dependency, ensure the templates/logs directory is included in the package.');
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Load all core log types from the templates/logs directory
|
|
165
|
+
*/
|
|
166
|
+
loadCoreTypes() {
|
|
167
|
+
const manifestPath = path.join(this.coreTypesPath, 'manifest.yaml');
|
|
168
|
+
if (!fs.existsSync(manifestPath)) {
|
|
169
|
+
console.warn(`Core log types manifest not found: ${manifestPath}`);
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
try {
|
|
173
|
+
const manifestContent = fs.readFileSync(manifestPath, 'utf-8');
|
|
174
|
+
const manifest = yaml.load(manifestContent);
|
|
175
|
+
for (const entry of manifest.log_types) {
|
|
176
|
+
const logType = this.loadLogTypeFromDirectory(entry.id, path.join(this.coreTypesPath, entry.path.replace('./', '')));
|
|
177
|
+
if (logType) {
|
|
178
|
+
this.coreTypes.set(logType.id, logType);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
catch (error) {
|
|
183
|
+
console.warn('Failed to load core log types:', error);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Load custom log types from a manifest file
|
|
188
|
+
* This is used when logs.custom_templates_path is set in config.yaml
|
|
189
|
+
*/
|
|
190
|
+
loadCustomTypesFromManifest(manifestPath) {
|
|
191
|
+
// Resolve path relative to baseDir if not absolute
|
|
192
|
+
const resolvedPath = path.isAbsolute(manifestPath)
|
|
193
|
+
? manifestPath
|
|
194
|
+
: path.join(this.baseDir, manifestPath);
|
|
195
|
+
if (!fs.existsSync(resolvedPath)) {
|
|
196
|
+
// Custom manifest is optional - don't warn if not found
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
try {
|
|
200
|
+
const manifestContent = fs.readFileSync(resolvedPath, 'utf-8');
|
|
201
|
+
const manifest = yaml.load(manifestContent);
|
|
202
|
+
// Get the directory containing the manifest
|
|
203
|
+
const manifestDir = path.dirname(resolvedPath);
|
|
204
|
+
for (const entry of manifest.log_types || []) {
|
|
205
|
+
// Resolve type directory relative to manifest location
|
|
206
|
+
const typeDirPath = path.join(manifestDir, entry.path.replace('./', ''));
|
|
207
|
+
const logType = this.loadLogTypeFromDirectory(entry.id, typeDirPath);
|
|
208
|
+
if (logType) {
|
|
209
|
+
this.customTypes.set(logType.id, logType);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
catch (error) {
|
|
214
|
+
console.warn(`Failed to load custom log types from ${manifestPath}:`, error);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Load a log type from a directory
|
|
219
|
+
*/
|
|
220
|
+
loadLogTypeFromDirectory(id, dirPath) {
|
|
221
|
+
const typeYamlPath = path.join(dirPath, 'type.yaml');
|
|
222
|
+
const templatePath = path.join(dirPath, 'template.md');
|
|
223
|
+
const standardsPath = path.join(dirPath, 'standards.md');
|
|
224
|
+
if (!fs.existsSync(typeYamlPath)) {
|
|
225
|
+
console.warn(`Log type definition not found: ${typeYamlPath}`);
|
|
226
|
+
return null;
|
|
227
|
+
}
|
|
228
|
+
try {
|
|
229
|
+
// Read type.yaml
|
|
230
|
+
const typeContent = fs.readFileSync(typeYamlPath, 'utf-8');
|
|
231
|
+
const rawType = yaml.load(typeContent);
|
|
232
|
+
// Read template.md
|
|
233
|
+
let template = '';
|
|
234
|
+
if (fs.existsSync(templatePath)) {
|
|
235
|
+
template = fs.readFileSync(templatePath, 'utf-8');
|
|
236
|
+
}
|
|
237
|
+
// Read standards.md
|
|
238
|
+
let standards = '';
|
|
239
|
+
if (fs.existsSync(standardsPath)) {
|
|
240
|
+
standards = fs.readFileSync(standardsPath, 'utf-8');
|
|
241
|
+
}
|
|
242
|
+
// Convert and validate
|
|
243
|
+
const logType = convertYamlToLogType(rawType, template, standards);
|
|
244
|
+
// Ensure ID matches
|
|
245
|
+
if (logType.id !== id) {
|
|
246
|
+
console.warn(`Log type ID mismatch: expected ${id}, got ${logType.id}`);
|
|
247
|
+
logType.id = id;
|
|
248
|
+
}
|
|
249
|
+
return logType;
|
|
250
|
+
}
|
|
251
|
+
catch (error) {
|
|
252
|
+
console.warn(`Failed to load log type ${id}:`, error);
|
|
253
|
+
return null;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Load custom types from config paths
|
|
258
|
+
*/
|
|
259
|
+
loadCustomTypes(configs) {
|
|
260
|
+
for (const config of configs) {
|
|
261
|
+
try {
|
|
262
|
+
if (config.path) {
|
|
263
|
+
// Load from local directory
|
|
264
|
+
const typePath = path.isAbsolute(config.path)
|
|
265
|
+
? config.path
|
|
266
|
+
: path.join(this.baseDir, config.path);
|
|
267
|
+
const logType = this.loadLogTypeFromDirectory(config.id, typePath);
|
|
268
|
+
if (logType) {
|
|
269
|
+
this.customTypes.set(logType.id, logType);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
else if (config.url) {
|
|
273
|
+
// URL loading would be async - not supported in constructor
|
|
274
|
+
// Users should use loadCustomTypeFromUrl() method instead
|
|
275
|
+
console.warn(`URL-based log type loading not supported in constructor. Use loadCustomTypeFromUrl() for ${config.id}`);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
catch (error) {
|
|
279
|
+
console.warn(`Failed to load custom log type ${config.id}:`, error);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Load a custom log type from a URL (async)
|
|
285
|
+
* @param id - Type identifier
|
|
286
|
+
* @param baseUrl - Base URL to the type directory (should contain type.yaml, template.md, standards.md)
|
|
287
|
+
*/
|
|
288
|
+
async loadCustomTypeFromUrl(id, baseUrl) {
|
|
289
|
+
try {
|
|
290
|
+
// Fetch type.yaml
|
|
291
|
+
const typeUrl = `${baseUrl}/type.yaml`;
|
|
292
|
+
const typeResponse = await fetch(typeUrl);
|
|
293
|
+
if (!typeResponse.ok) {
|
|
294
|
+
console.warn(`Failed to fetch log type: ${typeUrl}`);
|
|
295
|
+
return null;
|
|
296
|
+
}
|
|
297
|
+
const typeContent = await typeResponse.text();
|
|
298
|
+
const rawType = yaml.load(typeContent);
|
|
299
|
+
// Fetch template.md
|
|
300
|
+
let template = '';
|
|
301
|
+
try {
|
|
302
|
+
const templateUrl = `${baseUrl}/template.md`;
|
|
303
|
+
const templateResponse = await fetch(templateUrl);
|
|
304
|
+
if (templateResponse.ok) {
|
|
305
|
+
template = await templateResponse.text();
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
catch {
|
|
309
|
+
// Template is optional
|
|
310
|
+
}
|
|
311
|
+
// Fetch standards.md
|
|
312
|
+
let standards = '';
|
|
313
|
+
try {
|
|
314
|
+
const standardsUrl = `${baseUrl}/standards.md`;
|
|
315
|
+
const standardsResponse = await fetch(standardsUrl);
|
|
316
|
+
if (standardsResponse.ok) {
|
|
317
|
+
standards = await standardsResponse.text();
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
catch {
|
|
321
|
+
// Standards is optional
|
|
322
|
+
}
|
|
323
|
+
const logType = convertYamlToLogType(rawType, template, standards);
|
|
324
|
+
logType.id = id;
|
|
325
|
+
this.customTypes.set(id, logType);
|
|
326
|
+
return logType;
|
|
327
|
+
}
|
|
328
|
+
catch (error) {
|
|
329
|
+
console.warn(`Failed to load log type from URL ${baseUrl}:`, error);
|
|
330
|
+
return null;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Get all available log types (core + custom)
|
|
335
|
+
*/
|
|
336
|
+
getAllTypes() {
|
|
337
|
+
const types = [];
|
|
338
|
+
// Add core types
|
|
339
|
+
for (const logType of this.coreTypes.values()) {
|
|
340
|
+
types.push(logType);
|
|
341
|
+
}
|
|
342
|
+
// Add custom types (may override core types)
|
|
343
|
+
for (const logType of this.customTypes.values()) {
|
|
344
|
+
const existingIndex = types.findIndex((t) => t.id === logType.id);
|
|
345
|
+
if (existingIndex >= 0) {
|
|
346
|
+
types[existingIndex] = logType;
|
|
347
|
+
}
|
|
348
|
+
else {
|
|
349
|
+
types.push(logType);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
return types.sort((a, b) => a.id.localeCompare(b.id));
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Get a log type by ID
|
|
356
|
+
*/
|
|
357
|
+
getType(id) {
|
|
358
|
+
// Custom types take precedence
|
|
359
|
+
if (this.customTypes.has(id)) {
|
|
360
|
+
return this.customTypes.get(id);
|
|
361
|
+
}
|
|
362
|
+
return this.coreTypes.get(id) || null;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Check if a log type exists
|
|
366
|
+
*/
|
|
367
|
+
hasType(id) {
|
|
368
|
+
return this.coreTypes.has(id) || this.customTypes.has(id);
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Get only core types
|
|
372
|
+
*/
|
|
373
|
+
getCoreTypes() {
|
|
374
|
+
return Array.from(this.coreTypes.values()).sort((a, b) => a.id.localeCompare(b.id));
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Get only custom types
|
|
378
|
+
*/
|
|
379
|
+
getCustomTypes() {
|
|
380
|
+
return Array.from(this.customTypes.values()).sort((a, b) => a.id.localeCompare(b.id));
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Register a custom type programmatically
|
|
384
|
+
*/
|
|
385
|
+
registerType(logType) {
|
|
386
|
+
this.customTypes.set(logType.id, logType);
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Unregister a custom type
|
|
390
|
+
*/
|
|
391
|
+
unregisterType(id) {
|
|
392
|
+
return this.customTypes.delete(id);
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* Get the manifest URL for core types
|
|
396
|
+
*/
|
|
397
|
+
static getCoreManifestUrl() {
|
|
398
|
+
return 'https://raw.githubusercontent.com/fractary/core/main/templates/logs/manifest.yaml';
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Get the base URL for a specific core type
|
|
402
|
+
*/
|
|
403
|
+
static getCoreTypeUrl(typeId) {
|
|
404
|
+
return `https://raw.githubusercontent.com/fractary/core/main/templates/logs/${typeId}`;
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Get type IDs as array (useful for validation)
|
|
408
|
+
*/
|
|
409
|
+
getTypeIds() {
|
|
410
|
+
const ids = new Set();
|
|
411
|
+
for (const id of this.coreTypes.keys()) {
|
|
412
|
+
ids.add(id);
|
|
413
|
+
}
|
|
414
|
+
for (const id of this.customTypes.keys()) {
|
|
415
|
+
ids.add(id);
|
|
416
|
+
}
|
|
417
|
+
return Array.from(ids).sort();
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
exports.LogTypeRegistry = LogTypeRegistry;
|
|
421
|
+
//# sourceMappingURL=type-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-registry.js","sourceRoot":"","sources":["../../src/logs/type-registry.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;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