@cldmv/slothlet 3.2.3 → 3.3.2
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 +22 -9
- package/REFERENCE.md +23 -0
- package/dist/lib/builders/api-assignment.mjs +1 -589
- package/dist/lib/builders/api_builder.mjs +1 -1155
- package/dist/lib/builders/builder.mjs +1 -78
- package/dist/lib/builders/modes-processor.mjs +1 -1800
- package/dist/lib/errors.mjs +9 -211
- package/dist/lib/factories/component-base.mjs +1 -80
- package/dist/lib/factories/context.mjs +1 -22
- package/dist/lib/handlers/api-cache-manager.mjs +1 -200
- package/dist/lib/handlers/api-manager.mjs +1 -2513
- package/dist/lib/handlers/context-async.mjs +1 -168
- package/dist/lib/handlers/context-live.mjs +1 -168
- package/dist/lib/handlers/hook-manager.mjs +1 -773
- package/dist/lib/handlers/lifecycle-token.mjs +1 -28
- package/dist/lib/handlers/lifecycle.mjs +1 -115
- package/dist/lib/handlers/materialize-manager.mjs +1 -48
- package/dist/lib/handlers/metadata.mjs +1 -501
- package/dist/lib/handlers/ownership.mjs +1 -322
- package/dist/lib/handlers/permission-manager.mjs +17 -0
- package/dist/lib/handlers/unified-wrapper.mjs +1 -3042
- package/dist/lib/handlers/version-manager.mjs +1 -885
- package/dist/lib/helpers/class-instance-wrapper.mjs +1 -109
- package/dist/lib/helpers/config.mjs +1 -355
- package/dist/lib/helpers/eventemitter-context.mjs +1 -349
- package/dist/lib/helpers/hint-detector.mjs +1 -47
- package/dist/lib/helpers/modes-utils.mjs +1 -37
- package/dist/lib/helpers/pattern-matcher.mjs +17 -0
- package/dist/lib/helpers/resolve-from-caller.mjs +1 -169
- package/dist/lib/helpers/sanitize.mjs +1 -340
- package/dist/lib/helpers/utilities.mjs +1 -70
- package/dist/lib/i18n/languages/de-de.json +21 -1
- package/dist/lib/i18n/languages/en-gb.json +21 -1
- package/dist/lib/i18n/languages/en-us.json +21 -1
- package/dist/lib/i18n/languages/es-mx.json +21 -1
- package/dist/lib/i18n/languages/fr-fr.json +21 -1
- package/dist/lib/i18n/languages/hi-in.json +21 -1
- package/dist/lib/i18n/languages/ja-jp.json +21 -1
- package/dist/lib/i18n/languages/ko-kr.json +21 -1
- package/dist/lib/i18n/languages/pt-br.json +21 -1
- package/dist/lib/i18n/languages/ru-ru.json +21 -1
- package/dist/lib/i18n/languages/zh-cn.json +21 -1
- package/dist/lib/i18n/translations.mjs +1 -126
- package/dist/lib/modes/eager.mjs +1 -59
- package/dist/lib/modes/lazy.mjs +1 -81
- package/dist/lib/processors/flatten.mjs +1 -437
- package/dist/lib/processors/loader.mjs +1 -339
- package/dist/lib/processors/type-generator.mjs +1 -275
- package/dist/lib/processors/typescript.mjs +1 -172
- package/dist/lib/runtime/runtime-asynclocalstorage.mjs +1 -113
- package/dist/lib/runtime/runtime-livebindings.mjs +1 -78
- package/dist/lib/runtime/runtime.mjs +1 -102
- package/dist/slothlet.mjs +1 -808
- package/package.json +37 -31
- package/types/dist/lib/builders/api-assignment.d.mts +3 -92
- package/types/dist/lib/builders/api-assignment.d.mts.map +1 -1
- package/types/dist/lib/builders/api_builder.d.mts +102 -91
- package/types/dist/lib/builders/api_builder.d.mts.map +1 -1
- package/types/dist/lib/builders/builder.d.mts +1 -55
- package/types/dist/lib/builders/builder.d.mts.map +1 -1
- package/types/dist/lib/builders/modes-processor.d.mts +3 -27
- package/types/dist/lib/builders/modes-processor.d.mts.map +1 -1
- package/types/dist/lib/errors.d.mts +19 -109
- package/types/dist/lib/errors.d.mts.map +1 -1
- package/types/dist/lib/factories/component-base.d.mts +7 -177
- package/types/dist/lib/factories/component-base.d.mts.map +1 -1
- package/types/dist/lib/factories/context.d.mts +4 -22
- package/types/dist/lib/factories/context.d.mts.map +1 -1
- package/types/dist/lib/handlers/api-cache-manager.d.mts +20 -203
- package/types/dist/lib/handlers/api-cache-manager.d.mts.map +1 -1
- package/types/dist/lib/handlers/api-manager.d.mts +33 -408
- package/types/dist/lib/handlers/api-manager.d.mts.map +1 -1
- package/types/dist/lib/handlers/context-async.d.mts +23 -61
- package/types/dist/lib/handlers/context-async.d.mts.map +1 -1
- package/types/dist/lib/handlers/context-live.d.mts +22 -59
- package/types/dist/lib/handlers/context-live.d.mts.map +1 -1
- package/types/dist/lib/handlers/hook-manager.d.mts +46 -185
- package/types/dist/lib/handlers/hook-manager.d.mts.map +1 -1
- package/types/dist/lib/handlers/lifecycle-token.d.mts +3 -48
- package/types/dist/lib/handlers/lifecycle-token.d.mts.map +1 -1
- package/types/dist/lib/handlers/lifecycle.d.mts +5 -82
- package/types/dist/lib/handlers/lifecycle.d.mts.map +1 -1
- package/types/dist/lib/handlers/materialize-manager.d.mts +8 -70
- package/types/dist/lib/handlers/materialize-manager.d.mts.map +1 -1
- package/types/dist/lib/handlers/metadata.d.mts +17 -221
- package/types/dist/lib/handlers/metadata.d.mts.map +1 -1
- package/types/dist/lib/handlers/ownership.d.mts +44 -160
- package/types/dist/lib/handlers/ownership.d.mts.map +1 -1
- package/types/dist/lib/handlers/permission-manager.d.mts +47 -0
- package/types/dist/lib/handlers/permission-manager.d.mts.map +1 -0
- package/types/dist/lib/handlers/unified-wrapper.d.mts +26 -239
- package/types/dist/lib/handlers/unified-wrapper.d.mts.map +1 -1
- package/types/dist/lib/handlers/version-manager.d.mts +28 -225
- package/types/dist/lib/handlers/version-manager.d.mts.map +1 -1
- package/types/dist/lib/helpers/class-instance-wrapper.d.mts +2 -52
- package/types/dist/lib/helpers/class-instance-wrapper.d.mts.map +1 -1
- package/types/dist/lib/helpers/config.d.mts +125 -123
- package/types/dist/lib/helpers/config.d.mts.map +1 -1
- package/types/dist/lib/helpers/eventemitter-context.d.mts +3 -29
- package/types/dist/lib/helpers/eventemitter-context.d.mts.map +1 -1
- package/types/dist/lib/helpers/hint-detector.d.mts +2 -15
- package/types/dist/lib/helpers/hint-detector.d.mts.map +1 -1
- package/types/dist/lib/helpers/modes-utils.d.mts +3 -30
- package/types/dist/lib/helpers/modes-utils.d.mts.map +1 -1
- package/types/dist/lib/helpers/pattern-matcher.d.mts +4 -0
- package/types/dist/lib/helpers/pattern-matcher.d.mts.map +1 -0
- package/types/dist/lib/helpers/resolve-from-caller.d.mts +3 -27
- package/types/dist/lib/helpers/resolve-from-caller.d.mts.map +1 -1
- package/types/dist/lib/helpers/sanitize.d.mts +4 -92
- package/types/dist/lib/helpers/sanitize.d.mts.map +1 -1
- package/types/dist/lib/helpers/utilities.d.mts +4 -52
- package/types/dist/lib/helpers/utilities.d.mts.map +1 -1
- package/types/dist/lib/i18n/translations.d.mts +4 -37
- package/types/dist/lib/i18n/translations.d.mts.map +1 -1
- package/types/dist/lib/modes/eager.d.mts +8 -30
- package/types/dist/lib/modes/eager.d.mts.map +1 -1
- package/types/dist/lib/modes/lazy.d.mts +10 -43
- package/types/dist/lib/modes/lazy.d.mts.map +1 -1
- package/types/dist/lib/processors/flatten.d.mts +56 -107
- package/types/dist/lib/processors/flatten.d.mts.map +1 -1
- package/types/dist/lib/processors/loader.d.mts +6 -41
- package/types/dist/lib/processors/loader.d.mts.map +1 -1
- package/types/dist/lib/processors/type-generator.d.mts +2 -16
- package/types/dist/lib/processors/type-generator.d.mts.map +1 -1
- package/types/dist/lib/processors/typescript.d.mts +6 -53
- package/types/dist/lib/processors/typescript.d.mts.map +1 -1
- package/types/dist/lib/runtime/runtime-asynclocalstorage.d.mts +3 -71
- package/types/dist/lib/runtime/runtime-asynclocalstorage.d.mts.map +1 -1
- package/types/dist/lib/runtime/runtime-livebindings.d.mts +2 -37
- package/types/dist/lib/runtime/runtime-livebindings.d.mts.map +1 -1
- package/types/dist/lib/runtime/runtime.d.mts +3 -39
- package/types/dist/lib/runtime/runtime.d.mts.map +1 -1
- package/types/dist/slothlet.d.mts +3 -249
- package/types/dist/slothlet.d.mts.map +1 -1
- package/types/index.d.mts +36 -16
- package/types/index.d.mts.map +1 -0
- package/AGENT-USAGE.md +0 -736
- package/docs/API-RULES.md +0 -712
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.d.mts","sourceRoot":"","sources":["../../../../dist/lib/i18n/translations.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"translations.d.mts","sourceRoot":"","sources":["../../../../dist/lib/i18n/translations.mjs"],"names":[],"mappings":"AAA4wC,sCAA8C;AAAmc,6CAAgU;AAA/rC,6CAA8Y;AAA8C,oDAAmc;AAAnc,4DAAmc"}
|
|
@@ -1,35 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Eager mode component - builds APIs by loading all modules immediately.
|
|
3
|
-
* @class EagerMode
|
|
4
|
-
* @extends ComponentBase
|
|
5
|
-
* @package
|
|
6
|
-
*/
|
|
7
1
|
export class EagerMode extends ComponentBase {
|
|
8
2
|
static slothletProperty: string;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
* @param {string|null} [options.cacheBust=null] - Cache-busting value
|
|
18
|
-
* @param {Function|null} [options.fileFilter=null] - Optional filter (fileName) => boolean
|
|
19
|
-
* @returns {Promise<Object>} Built API object
|
|
20
|
-
* @public
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* const api = await slothlet.modes.eager.buildAPI({ dir: "./api", moduleID: "base" });
|
|
24
|
-
*/
|
|
25
|
-
public buildAPI({ dir, apiPathPrefix, collisionContext, moduleID, apiDepth, cacheBust, fileFilter }: {
|
|
26
|
-
dir: string;
|
|
27
|
-
apiPathPrefix?: string;
|
|
28
|
-
collisionContext?: string;
|
|
29
|
-
moduleID?: string;
|
|
30
|
-
apiDepth?: number;
|
|
31
|
-
cacheBust?: string | null;
|
|
32
|
-
fileFilter?: Function | null;
|
|
3
|
+
buildAPI({ dir, apiPathPrefix, collisionContext, moduleID, apiDepth, cacheBust, fileFilter }: {
|
|
4
|
+
dir: any;
|
|
5
|
+
apiPathPrefix?: string | undefined;
|
|
6
|
+
collisionContext?: string | undefined;
|
|
7
|
+
moduleID: any;
|
|
8
|
+
apiDepth?: number | undefined;
|
|
9
|
+
cacheBust?: null | undefined;
|
|
10
|
+
fileFilter?: null | undefined;
|
|
33
11
|
}): Promise<any>;
|
|
34
12
|
}
|
|
35
13
|
import { ComponentBase } from "@cldmv/slothlet/factories/component-base";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eager.d.mts","sourceRoot":"","sources":["../../../../dist/lib/modes/eager.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"eager.d.mts","sourceRoot":"","sources":["../../../../dist/lib/modes/eager.mjs"],"names":[],"mappings":"AAAoE;IAAsC,gCAAgC;IAAsC;;;;;;;;qBAAkpB;CAAC;8BAA1yB,0CAA0C"}
|
|
@@ -1,48 +1,15 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Lazy mode component - builds APIs with deferred (on-demand) loading.
|
|
3
|
-
* @class LazyMode
|
|
4
|
-
* @extends ComponentBase
|
|
5
|
-
* @package
|
|
6
|
-
*/
|
|
7
1
|
export class LazyMode extends ComponentBase {
|
|
8
2
|
static slothletProperty: string;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
public createNamedMaterializeFunc(apiPath: string, handler: Function): Function;
|
|
20
|
-
/**
|
|
21
|
-
* Build API in lazy mode (proxy-based deferred loading).
|
|
22
|
-
* @param {Object} options - Build options
|
|
23
|
-
* @param {string} options.dir - Directory to build from
|
|
24
|
-
* @param {string} [options.apiPathPrefix=""] - Prefix for API paths
|
|
25
|
-
* @param {string} [options.collisionContext="initial"] - Collision context
|
|
26
|
-
* @param {string|null} [options.collisionMode=null] - Collision mode override from api.add()
|
|
27
|
-
* @param {string} [options.moduleID] - Module ID
|
|
28
|
-
* @param {number} [options.apiDepth=Infinity] - Maximum directory depth
|
|
29
|
-
* @param {string|null} [options.cacheBust=null] - Cache-busting value
|
|
30
|
-
* @param {Function|null} [options.fileFilter=null] - Optional filter (fileName) => boolean
|
|
31
|
-
* @returns {Promise<Object>} Built API object with lazy proxies
|
|
32
|
-
* @public
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* const api = await slothlet.modes.lazy.buildAPI({ dir: "./api", moduleID: "base" });
|
|
36
|
-
*/
|
|
37
|
-
public buildAPI({ dir, apiPathPrefix, collisionContext, collisionMode, moduleID, apiDepth, cacheBust, fileFilter }: {
|
|
38
|
-
dir: string;
|
|
39
|
-
apiPathPrefix?: string;
|
|
40
|
-
collisionContext?: string;
|
|
41
|
-
collisionMode?: string | null;
|
|
42
|
-
moduleID?: string;
|
|
43
|
-
apiDepth?: number;
|
|
44
|
-
cacheBust?: string | null;
|
|
45
|
-
fileFilter?: Function | null;
|
|
3
|
+
createNamedMaterializeFunc(apiPath: any, handler: any): (...args: any[]) => Promise<any>;
|
|
4
|
+
buildAPI({ dir, apiPathPrefix, collisionContext, collisionMode, moduleID, apiDepth, cacheBust, fileFilter }: {
|
|
5
|
+
dir: any;
|
|
6
|
+
apiPathPrefix?: string | undefined;
|
|
7
|
+
collisionContext?: string | undefined;
|
|
8
|
+
collisionMode?: null | undefined;
|
|
9
|
+
moduleID: any;
|
|
10
|
+
apiDepth?: number | undefined;
|
|
11
|
+
cacheBust?: null | undefined;
|
|
12
|
+
fileFilter?: null | undefined;
|
|
46
13
|
}): Promise<any>;
|
|
47
14
|
}
|
|
48
15
|
import { ComponentBase } from "@cldmv/slothlet/factories/component-base";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazy.d.mts","sourceRoot":"","sources":["../../../../dist/lib/modes/lazy.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lazy.d.mts","sourceRoot":"","sources":["../../../../dist/lib/modes/lazy.mjs"],"names":[],"mappings":"AAAoE;IAAqC,gCAA+B;IAAsC,yFAAiV;IAAA;;;;;;;;;qBAAqyB;CAAC;8BAA5wC,0CAA0C"}
|
|
@@ -1,113 +1,62 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Flattening decision processor
|
|
3
|
-
* @class Flatten
|
|
4
|
-
* @extends ComponentBase
|
|
5
|
-
* @package
|
|
6
|
-
*/
|
|
7
1
|
export class Flatten extends ComponentBase {
|
|
8
2
|
static slothletProperty: string;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
* @param {string} options.propertyName - Resolved preferred name (decision.preferredName || moduleName).
|
|
49
|
-
* @param {string[]} options.moduleKeys - Named export keys (excluding "default").
|
|
50
|
-
* @param {object} options.analysis - { hasDefault, hasNamed, defaultExportType }.
|
|
51
|
-
* @param {object} [options.file=null] - File descriptor for AddApi detection via file.name / file.fullName.
|
|
52
|
-
* @param {string} [options.collisionContext="initial"] - Collision context ("initial" | "api").
|
|
53
|
-
* @param {string} [options.apiPathPrefix=""] - API path prefix for collision error messages.
|
|
54
|
-
* @returns {{ moduleContent: object|Function }} Built module content ready for wrapping/assignment.
|
|
55
|
-
* @public
|
|
56
|
-
*/
|
|
57
|
-
public processModuleForAPI(options: {
|
|
58
|
-
mod: object;
|
|
59
|
-
decision: object;
|
|
60
|
-
moduleName: string;
|
|
61
|
-
propertyName: string;
|
|
62
|
-
moduleKeys: string[];
|
|
63
|
-
analysis: object;
|
|
64
|
-
file?: object;
|
|
65
|
-
collisionContext?: string;
|
|
66
|
-
apiPathPrefix?: string;
|
|
67
|
-
}): {
|
|
68
|
-
moduleContent: object | Function;
|
|
3
|
+
getFlatteningDecision(options: any): Promise<{
|
|
4
|
+
preserveAsNamespace: boolean;
|
|
5
|
+
reason: any;
|
|
6
|
+
flattenToRoot?: undefined;
|
|
7
|
+
} | {
|
|
8
|
+
flattenToRoot: boolean;
|
|
9
|
+
reason: any;
|
|
10
|
+
preserveAsNamespace?: undefined;
|
|
11
|
+
} | {
|
|
12
|
+
flattenToCategory: boolean;
|
|
13
|
+
flattenType: string;
|
|
14
|
+
reason: any;
|
|
15
|
+
useAutoFlattening?: undefined;
|
|
16
|
+
preserveAsNamespace?: undefined;
|
|
17
|
+
preferredName?: undefined;
|
|
18
|
+
} | {
|
|
19
|
+
useAutoFlattening: boolean;
|
|
20
|
+
reason: any;
|
|
21
|
+
flattenToCategory?: undefined;
|
|
22
|
+
flattenType?: undefined;
|
|
23
|
+
preserveAsNamespace?: undefined;
|
|
24
|
+
preferredName?: undefined;
|
|
25
|
+
} | {
|
|
26
|
+
flattenToCategory: boolean;
|
|
27
|
+
reason: any;
|
|
28
|
+
flattenType?: undefined;
|
|
29
|
+
useAutoFlattening?: undefined;
|
|
30
|
+
preserveAsNamespace?: undefined;
|
|
31
|
+
preferredName?: undefined;
|
|
32
|
+
} | {
|
|
33
|
+
preserveAsNamespace: boolean;
|
|
34
|
+
preferredName: any;
|
|
35
|
+
reason: any;
|
|
36
|
+
flattenToCategory?: undefined;
|
|
37
|
+
flattenType?: undefined;
|
|
38
|
+
useAutoFlattening?: undefined;
|
|
39
|
+
}>;
|
|
40
|
+
processModuleForAPI(options: any): {
|
|
41
|
+
moduleContent: any;
|
|
69
42
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
categoryName: string;
|
|
88
|
-
mod: object;
|
|
89
|
-
moduleName: string;
|
|
90
|
-
fileBaseName: string;
|
|
91
|
-
analysis: object;
|
|
92
|
-
moduleKeys: any[];
|
|
93
|
-
currentDepth: number;
|
|
94
|
-
moduleFiles: any[];
|
|
95
|
-
t: Function;
|
|
96
|
-
}): Promise<object>;
|
|
97
|
-
/**
|
|
98
|
-
* Decide whether a named export should be attached to a callable default export.
|
|
99
|
-
*
|
|
100
|
-
* Returns false when the named export is the same reference as the default (re-export
|
|
101
|
-
* pattern), or when the export key matches the function name (self-referential export).
|
|
102
|
-
*
|
|
103
|
-
* @param {string} key - Named export key.
|
|
104
|
-
* @param {unknown} value - Named export value.
|
|
105
|
-
* @param {Function} defaultFunc - Wrapped callable default export.
|
|
106
|
-
* @param {Function} originalDefault - Original default export.
|
|
107
|
-
* @returns {boolean} True if the export should be attached.
|
|
108
|
-
* @public
|
|
109
|
-
*/
|
|
110
|
-
public shouldAttachNamedExport(key: string, value: unknown, defaultFunc: Function, originalDefault: Function): boolean;
|
|
43
|
+
buildCategoryDecisions(options: any): Promise<{
|
|
44
|
+
shouldFlatten: boolean;
|
|
45
|
+
flattenType: string;
|
|
46
|
+
reason: any;
|
|
47
|
+
preferredName?: undefined;
|
|
48
|
+
} | {
|
|
49
|
+
shouldFlatten: boolean;
|
|
50
|
+
flattenType: string;
|
|
51
|
+
preferredName: any;
|
|
52
|
+
reason: any;
|
|
53
|
+
} | {
|
|
54
|
+
shouldFlatten: boolean;
|
|
55
|
+
preferredName: any;
|
|
56
|
+
reason: any;
|
|
57
|
+
flattenType?: undefined;
|
|
58
|
+
}>;
|
|
59
|
+
shouldAttachNamedExport(key: any, value: any, defaultFunc: any, originalDefault: any): boolean;
|
|
111
60
|
#private;
|
|
112
61
|
}
|
|
113
62
|
import { ComponentBase } from "@cldmv/slothlet/factories/component-base";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flatten.d.mts","sourceRoot":"","sources":["../../../../dist/lib/processors/flatten.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flatten.d.mts","sourceRoot":"","sources":["../../../../dist/lib/processors/flatten.mjs"],"names":[],"mappings":"AAAoE;IAAoC,gCAAkC;IAAqjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAA8pE;IAAA;;MAA+yF;IAAA;;;;;;;;;;;;;;;OAAk7G;IAAA,+FAA0U;;CAAC;8BAAh3S,0CAA0C"}
|
|
@@ -1,46 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Loader component for module loading, directory scanning, and API merging
|
|
3
|
-
* @class Loader
|
|
4
|
-
* @extends ComponentBase
|
|
5
|
-
* @package
|
|
6
|
-
*/
|
|
7
1
|
export class Loader extends ComponentBase {
|
|
8
2
|
static slothletProperty: string;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
* @param {number|null} [cacheBust=null] - Timestamp for reload cache busting (forces fresh import)
|
|
16
|
-
* @returns {Promise<Object>} Loaded module
|
|
17
|
-
* @public
|
|
18
|
-
*/
|
|
19
|
-
public loadModule(filePath: string, instanceID?: string, moduleID?: string, cacheBust?: number | null): Promise<any>;
|
|
20
|
-
/**
|
|
21
|
-
* Scan directory for module files
|
|
22
|
-
* @param {string} dir - Directory to scan
|
|
23
|
-
* @param {Object} [options={}] - Scan options
|
|
24
|
-
* @param {boolean} [options.isRootScan=true] - Whether this is the root directory scan (shows empty dir warning)
|
|
25
|
-
* @param {number} [options.currentDepth=0] - Current traversal depth
|
|
26
|
-
* @param {number} [options.maxDepth=Infinity] - Maximum traversal depth
|
|
27
|
-
* @param {Function|null} [options.fileFilter=null] - Optional filter function (fileName) => boolean to load specific files only
|
|
28
|
-
* @returns {Promise<Object>} Directory structure
|
|
29
|
-
* @public
|
|
30
|
-
*/
|
|
31
|
-
public scanDirectory(dir: string, options?: {
|
|
32
|
-
isRootScan?: boolean;
|
|
33
|
-
currentDepth?: number;
|
|
34
|
-
maxDepth?: number;
|
|
35
|
-
fileFilter?: Function | null;
|
|
36
|
-
}): Promise<any>;
|
|
37
|
-
/**
|
|
38
|
-
* Extract exports from module
|
|
39
|
-
* @param {Object} module - Loaded module
|
|
40
|
-
* @returns {Object} Extracted exports
|
|
41
|
-
* @public
|
|
42
|
-
*/
|
|
43
|
-
public extractExports(module: any): any;
|
|
3
|
+
loadModule(filePath: any, instanceID: any, moduleID: any, cacheBust?: null): Promise<any>;
|
|
4
|
+
scanDirectory(dir: any, options?: {}): Promise<{
|
|
5
|
+
files: never[];
|
|
6
|
+
directories: never[];
|
|
7
|
+
}>;
|
|
8
|
+
extractExports(module: any): {};
|
|
44
9
|
#private;
|
|
45
10
|
}
|
|
46
11
|
import { ComponentBase } from "@cldmv/slothlet/factories/component-base";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.mts","sourceRoot":"","sources":["../../../../dist/lib/processors/loader.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"loader.d.mts","sourceRoot":"","sources":["../../../../dist/lib/processors/loader.mjs"],"names":[],"mappings":"AAA+O;IAAmC,gCAAiC;IAAsC,0FAA2nG;IAA4Y;;;OAA+7C;IAAA,gCAAipB;;CAAC;8BAA7uL,0CAA0C"}
|
|
@@ -1,19 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
* Generate TypeScript declaration file for a Slothlet API
|
|
3
|
-
* @param {object} api - The loaded Slothlet API
|
|
4
|
-
* @param {object} options - Generation options
|
|
5
|
-
* @param {string} options.output - Output file path for .d.ts
|
|
6
|
-
* @param {string} options.interfaceName - Name of the interface to generate
|
|
7
|
-
* @param {boolean} [options.includeDocumentation=true] - Include JSDoc comments
|
|
8
|
-
* @returns {Promise<{output: string, filePath: string}>} Generated declaration and output path
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
export function generateTypes(api: object, options: {
|
|
1
|
+
export function generateTypes(api: any, options: any): Promise<{
|
|
12
2
|
output: string;
|
|
13
|
-
|
|
14
|
-
includeDocumentation?: boolean;
|
|
15
|
-
}): Promise<{
|
|
16
|
-
output: string;
|
|
17
|
-
filePath: string;
|
|
3
|
+
filePath: any;
|
|
18
4
|
}>;
|
|
19
5
|
//# sourceMappingURL=type-generator.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-generator.d.mts","sourceRoot":"","sources":["../../../../dist/lib/processors/type-generator.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"type-generator.d.mts","sourceRoot":"","sources":["../../../../dist/lib/processors/type-generator.mjs"],"names":[],"mappings":"AAA+V;;;GAAwiC"}
|
|
@@ -1,55 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* @param {boolean} [options.sourcemap] - Generate source maps (default: false)
|
|
8
|
-
* @returns {Promise<string>} Transformed JavaScript code
|
|
9
|
-
* @throws {SlothletError} If transformation fails
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
export function transformTypeScript(filePath: string, options?: {
|
|
13
|
-
target?: string;
|
|
14
|
-
format?: string;
|
|
15
|
-
sourcemap?: boolean;
|
|
16
|
-
}): Promise<string>;
|
|
17
|
-
/**
|
|
18
|
-
* Create a data URL for dynamic import with cache busting
|
|
19
|
-
* @param {string} code - JavaScript code to encode
|
|
20
|
-
* @returns {string} Data URL suitable for dynamic import
|
|
21
|
-
* @public
|
|
22
|
-
*/
|
|
23
|
-
export function createDataUrl(code: string): string;
|
|
24
|
-
/**
|
|
25
|
-
* Transform TypeScript code to JavaScript using tsc with type checking
|
|
26
|
-
* @param {string} filePath - Path to the TypeScript file
|
|
27
|
-
* @param {object} [options={}] - TypeScript compiler options
|
|
28
|
-
* @param {string} [options.target] - ECMAScript target version (default: "ES2020")
|
|
29
|
-
* @param {string} [options.module] - Module format (default: "ESNext")
|
|
30
|
-
* @param {boolean} [options.strict] - Enable strict type checking (default: true)
|
|
31
|
-
* @param {boolean} [options.skipTypeCheck] - Skip type checking and only transform (default: false)
|
|
32
|
-
* @param {string} [options.typeDefinitionPath] - Path to .d.ts file for type checking
|
|
33
|
-
* @returns {Promise<{code: string, diagnostics: object[]}>} Transformed code and type diagnostics
|
|
34
|
-
* @throws {SlothletError} If transformation fails
|
|
35
|
-
* @public
|
|
36
|
-
*/
|
|
37
|
-
export function transformTypeScriptStrict(filePath: string, options?: {
|
|
38
|
-
target?: string;
|
|
39
|
-
module?: string;
|
|
40
|
-
strict?: boolean;
|
|
41
|
-
skipTypeCheck?: boolean;
|
|
42
|
-
typeDefinitionPath?: string;
|
|
43
|
-
}): Promise<{
|
|
44
|
-
code: string;
|
|
45
|
-
diagnostics: object[];
|
|
1
|
+
export function createDataUrl(code: any): string;
|
|
2
|
+
export function formatDiagnostics(diagnostics: any, ts: any): any;
|
|
3
|
+
export function transformTypeScript(filePath: any, options?: {}): Promise<any>;
|
|
4
|
+
export function transformTypeScriptStrict(filePath: any, options?: {}): Promise<{
|
|
5
|
+
code: any;
|
|
6
|
+
diagnostics: any[];
|
|
46
7
|
}>;
|
|
47
|
-
/**
|
|
48
|
-
* Format TypeScript diagnostics into readable error messages
|
|
49
|
-
* @param {object[]} diagnostics - TypeScript diagnostic objects
|
|
50
|
-
* @param {object} ts - TypeScript module instance
|
|
51
|
-
* @returns {string[]} Array of formatted error messages
|
|
52
|
-
* @private
|
|
53
|
-
*/
|
|
54
|
-
export function formatDiagnostics(diagnostics: object[], ts: object): string[];
|
|
55
8
|
//# sourceMappingURL=typescript.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.d.mts","sourceRoot":"","sources":["../../../../dist/lib/processors/typescript.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"typescript.d.mts","sourceRoot":"","sources":["../../../../dist/lib/processors/typescript.mjs"],"names":[],"mappings":"AAA83B,iDAAoK;AAAm6D,kEAAkZ;AAArxF,+EAA4T;AAAoK;;;GAAm6D"}
|
|
@@ -1,72 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* @public
|
|
5
|
-
*
|
|
6
|
-
* @description
|
|
7
|
-
* A proxy that provides access to the full API object within the current context.
|
|
8
|
-
* Automatically resolves to the correct instance's API in AsyncLocalStorage context.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* import { self } from "@cldmv/slothlet/runtime/async";
|
|
12
|
-
*
|
|
13
|
-
* export function callOtherFunction() {
|
|
14
|
-
* // Call another function in the same API
|
|
15
|
-
* return self.otherFunction();
|
|
16
|
-
* }
|
|
17
|
-
*/
|
|
18
|
-
export const self: ProxyConstructor;
|
|
19
|
-
/**
|
|
20
|
-
* User-provided context object
|
|
21
|
-
* @type {Proxy}
|
|
22
|
-
* @public
|
|
23
|
-
*
|
|
24
|
-
* @description
|
|
25
|
-
* A proxy that provides access to user-provided context data (e.g., request data, user info).
|
|
26
|
-
* Can be set via `slothlet.run()` or `slothlet.scope()`.
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* import { context } from "@cldmv/slothlet/runtime/async";
|
|
30
|
-
*
|
|
31
|
-
* export function getUserInfo() {
|
|
32
|
-
* // Access user-provided context
|
|
33
|
-
* return {
|
|
34
|
-
* userId: context.userId,
|
|
35
|
-
* userName: context.userName
|
|
36
|
-
* };
|
|
37
|
-
* }
|
|
38
|
-
*/
|
|
39
|
-
export const context: ProxyConstructor;
|
|
40
|
-
/**
|
|
41
|
-
* Reference to initialization reference object
|
|
42
|
-
* @type {Proxy}
|
|
43
|
-
* @public
|
|
44
|
-
*
|
|
45
|
-
* @description
|
|
46
|
-
* The reference object is merged directly into the API at initialization using the add API system.
|
|
47
|
-
* It is NOT available as a runtime export. Access it directly from the API or via api.slothlet.diag.reference().
|
|
48
|
-
*
|
|
49
|
-
* @example
|
|
50
|
-
* // Reference merged into API - access directly:
|
|
51
|
-
* export function useReferenceData() {
|
|
52
|
-
* return self.myData; // if reference had myData property
|
|
53
|
-
* }
|
|
54
|
-
*/
|
|
55
|
-
/**
|
|
56
|
-
* Current instance ID
|
|
57
|
-
* @type {Proxy}
|
|
58
|
-
* @public
|
|
59
|
-
*
|
|
60
|
-
* @description
|
|
61
|
-
* A proxy that provides access to the current slothlet instance ID.
|
|
62
|
-
* Useful for debugging and tracking which instance is handling a request.
|
|
63
|
-
*
|
|
64
|
-
* @example
|
|
65
|
-
* import { instanceID } from "@cldmv/slothlet/runtime/async";
|
|
66
|
-
*
|
|
67
|
-
* export function getInstanceInfo() {
|
|
68
|
-
* return { instanceID };
|
|
69
|
-
* }
|
|
70
|
-
*/
|
|
71
|
-
export const instanceID: ProxyConstructor;
|
|
1
|
+
export const context: {};
|
|
2
|
+
export const instanceID: {};
|
|
3
|
+
export const self: {};
|
|
72
4
|
//# sourceMappingURL=runtime-asynclocalstorage.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-asynclocalstorage.d.mts","sourceRoot":"","sources":["../../../../dist/lib/runtime/runtime-asynclocalstorage.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runtime-asynclocalstorage.d.mts","sourceRoot":"","sources":["../../../../dist/lib/runtime/runtime-asynclocalstorage.mjs"],"names":[],"mappings":"AAA2xB,yBAAmrB;AAAA,4BAA6V;AAA3mD,sBAA2lB"}
|
|
@@ -1,38 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* @type {Proxy}
|
|
4
|
-
* @public
|
|
5
|
-
*
|
|
6
|
-
* @description
|
|
7
|
-
* A proxy that provides direct access to the current instance's API.
|
|
8
|
-
* In live mode, this directly references the active instance without AsyncLocalStorage.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* import { self } from "@cldmv/slothlet/runtime/live";
|
|
12
|
-
*
|
|
13
|
-
* export function callOtherFunction() {
|
|
14
|
-
* return self.otherFunction();
|
|
15
|
-
* }
|
|
16
|
-
*/
|
|
17
|
-
export const self: ProxyConstructor;
|
|
18
|
-
/**
|
|
19
|
-
* User-provided context object
|
|
20
|
-
* @type {Proxy}
|
|
21
|
-
* @public
|
|
22
|
-
*
|
|
23
|
-
* @description
|
|
24
|
-
* A proxy that provides access to user-provided context data.
|
|
25
|
-
* In live mode, this directly accesses the current instance's context.
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* import { context } from "@cldmv/slothlet/runtime/live";
|
|
29
|
-
*
|
|
30
|
-
* export function getUserInfo() {
|
|
31
|
-
* return {
|
|
32
|
-
* userId: context.userId,
|
|
33
|
-
* userName: context.userName
|
|
34
|
-
* };
|
|
35
|
-
* }
|
|
36
|
-
*/
|
|
37
|
-
export const context: ProxyConstructor;
|
|
1
|
+
export const context: {};
|
|
2
|
+
export const self: {};
|
|
38
3
|
//# sourceMappingURL=runtime-livebindings.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-livebindings.d.mts","sourceRoot":"","sources":["../../../../dist/lib/runtime/runtime-livebindings.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runtime-livebindings.d.mts","sourceRoot":"","sources":["../../../../dist/lib/runtime/runtime-livebindings.mjs"],"names":[],"mappings":"AAAwuB,yBAA2tB;AAAt1C,sBAA2nB"}
|
|
@@ -1,40 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
* @memberof module:@cldmv/slothlet/runtime
|
|
6
|
-
* @type {object}
|
|
7
|
-
* @example
|
|
8
|
-
* import { self } from "@cldmv/slothlet/runtime";
|
|
9
|
-
* // Inside an API function:
|
|
10
|
-
* const result = await self.math.add(1, 2);
|
|
11
|
-
*/
|
|
12
|
-
export const self: object;
|
|
13
|
-
/**
|
|
14
|
-
* The current ambient context object. Seeded at instance startup via `config.context` and
|
|
15
|
-
* persists for the lifetime of the instance. `api.slothlet.context.run()` and `.scope()` can
|
|
16
|
-
* temporarily override it for the duration of a single call, after which the previous context
|
|
17
|
-
* is restored. Readable and writable.
|
|
18
|
-
*
|
|
19
|
-
* @memberof module:@cldmv/slothlet/runtime
|
|
20
|
-
* @type {object}
|
|
21
|
-
* @example
|
|
22
|
-
* import { context } from "@cldmv/slothlet/runtime";
|
|
23
|
-
* // Read the ambient context set via config.context or written by a previous call:
|
|
24
|
-
* const userId = context.userId;
|
|
25
|
-
* // context.run() overrides it only for the duration of that one call:
|
|
26
|
-
* await api.slothlet.context.run({ userId: 42 }, myFn);
|
|
27
|
-
*/
|
|
28
|
-
export const context: object;
|
|
29
|
-
/**
|
|
30
|
-
* Current Slothlet instance identifier. Unique per `slothlet()` call; useful when
|
|
31
|
-
* multiple Slothlet instances coexist and you need to identify which one is active.
|
|
32
|
-
*
|
|
33
|
-
* @memberof module:@cldmv/slothlet/runtime
|
|
34
|
-
* @type {string}
|
|
35
|
-
* @example
|
|
36
|
-
* import { instanceID } from "@cldmv/slothlet/runtime";
|
|
37
|
-
* console.log(instanceID); // e.g. "slothlet-1"
|
|
38
|
-
*/
|
|
39
|
-
export const instanceID: string;
|
|
1
|
+
export const context: {};
|
|
2
|
+
export const instanceID: {};
|
|
3
|
+
export const self: {};
|
|
40
4
|
//# sourceMappingURL=runtime.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.mts","sourceRoot":"","sources":["../../../../dist/lib/runtime/runtime.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runtime.d.mts","sourceRoot":"","sources":["../../../../dist/lib/runtime/runtime.mjs"],"names":[],"mappings":"AAA02B,yBAA4e;AAAA,4BAAoP;AAA7pC,sBAA6b"}
|