@g3nomaly/core 0.1.6 → 0.3.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/README.md +3 -0
- package/package.json +3 -50
- package/LICENSE +0 -95
- package/dist/config/config.d.ts +0 -33
- package/dist/config/config.d.ts.map +0 -1
- package/dist/config/config.js +0 -87
- package/dist/config/config.js.map +0 -1
- package/dist/config/index.d.ts +0 -4
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/index.js +0 -3
- package/dist/config/index.js.map +0 -1
- package/dist/config/types.d.ts +0 -141
- package/dist/config/types.d.ts.map +0 -1
- package/dist/config/types.js +0 -66
- package/dist/config/types.js.map +0 -1
- package/dist/hash/hash.d.ts +0 -25
- package/dist/hash/hash.d.ts.map +0 -1
- package/dist/hash/hash.js +0 -44
- package/dist/hash/hash.js.map +0 -1
- package/dist/hash/index.d.ts +0 -2
- package/dist/hash/index.d.ts.map +0 -1
- package/dist/hash/index.js +0 -2
- package/dist/hash/index.js.map +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +0 -1
- package/dist/registry/index.d.ts +0 -12
- package/dist/registry/index.d.ts.map +0 -1
- package/dist/registry/index.js +0 -12
- package/dist/registry/index.js.map +0 -1
- package/dist/registry/registry.handlers.d.ts +0 -9
- package/dist/registry/registry.handlers.d.ts.map +0 -1
- package/dist/registry/registry.handlers.js +0 -13
- package/dist/registry/registry.handlers.js.map +0 -1
- package/dist/registry/registry.io.d.ts +0 -22
- package/dist/registry/registry.io.d.ts.map +0 -1
- package/dist/registry/registry.io.js +0 -78
- package/dist/registry/registry.io.js.map +0 -1
- package/dist/registry/registry.mutations.d.ts +0 -12
- package/dist/registry/registry.mutations.d.ts.map +0 -1
- package/dist/registry/registry.mutations.js +0 -22
- package/dist/registry/registry.mutations.js.map +0 -1
- package/dist/registry/registry.selectors.d.ts +0 -27
- package/dist/registry/registry.selectors.d.ts.map +0 -1
- package/dist/registry/registry.selectors.js +0 -37
- package/dist/registry/registry.selectors.js.map +0 -1
- package/dist/registry/registry.store.d.ts +0 -34
- package/dist/registry/registry.store.d.ts.map +0 -1
- package/dist/registry/registry.store.js +0 -27
- package/dist/registry/registry.store.js.map +0 -1
- package/dist/registry/registry.template.d.ts +0 -23
- package/dist/registry/registry.template.d.ts.map +0 -1
- package/dist/registry/registry.template.js +0 -63
- package/dist/registry/registry.template.js.map +0 -1
- package/dist/registry/types.d.ts +0 -31
- package/dist/registry/types.d.ts.map +0 -1
- package/dist/registry/types.js +0 -20
- package/dist/registry/types.js.map +0 -1
- package/dist/security/index.d.ts +0 -2
- package/dist/security/index.d.ts.map +0 -1
- package/dist/security/index.js +0 -2
- package/dist/security/index.js.map +0 -1
- package/dist/security/securityParser.d.ts +0 -14
- package/dist/security/securityParser.d.ts.map +0 -1
- package/dist/security/securityParser.js +0 -89
- package/dist/security/securityParser.js.map +0 -1
- package/dist/security/securityWorker.d.ts +0 -8
- package/dist/security/securityWorker.d.ts.map +0 -1
- package/dist/security/securityWorker.js +0 -158
- package/dist/security/securityWorker.js.map +0 -1
- package/dist/utils/index.d.ts +0 -3
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -4
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/paths.d.ts +0 -16
- package/dist/utils/paths.d.ts.map +0 -1
- package/dist/utils/paths.js +0 -40
- package/dist/utils/paths.js.map +0 -1
- package/dist/utils/version.d.ts +0 -9
- package/dist/utils/version.d.ts.map +0 -1
- package/dist/utils/version.js +0 -103
- package/dist/utils/version.js.map +0 -1
package/dist/registry/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from "./types";
|
|
2
|
-
export * from "./registry.handlers";
|
|
3
|
-
export * from "./registry.store";
|
|
4
|
-
export * from "./registry.mutations";
|
|
5
|
-
export * from "./registry.selectors";
|
|
6
|
-
export * from "./registry.template";
|
|
7
|
-
export * from "./registry.io";
|
|
8
|
-
/**
|
|
9
|
-
* Purposfully a custom registry store. To reduce dependencies. Still follows the same pattern as the tanstack store design skill. Though it could still be improved since it is still missing a lot of default operators.
|
|
10
|
-
* Nevertheless, this stores doesn't need reactive updates. Hence, once more the, part of why it is a custom store.
|
|
11
|
-
*/
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA;AACpC,cAAc,qBAAqB,CAAA;AACnC,cAAc,eAAe,CAAA;AAE7B;;;GAGG"}
|
package/dist/registry/index.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from "./types";
|
|
2
|
-
export * from "./registry.handlers";
|
|
3
|
-
export * from "./registry.store";
|
|
4
|
-
export * from "./registry.mutations";
|
|
5
|
-
export * from "./registry.selectors";
|
|
6
|
-
export * from "./registry.template";
|
|
7
|
-
export * from "./registry.io";
|
|
8
|
-
/**
|
|
9
|
-
* Purposfully a custom registry store. To reduce dependencies. Still follows the same pattern as the tanstack store design skill. Though it could still be improved since it is still missing a lot of default operators.
|
|
10
|
-
* Nevertheless, this stores doesn't need reactive updates. Hence, once more the, part of why it is a custom store.
|
|
11
|
-
*/
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA;AACpC,cAAc,qBAAqB,CAAA;AACnC,cAAc,eAAe,CAAA;AAE7B;;;GAGG"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { BaseRegistry, BaseRegistryEntry } from "./types";
|
|
2
|
-
export interface RegistryHandler<T extends BaseRegistryEntry = BaseRegistryEntry> {
|
|
3
|
-
extensions: string[];
|
|
4
|
-
serialize: (data: BaseRegistry<T>) => string;
|
|
5
|
-
deserialize: (raw: string) => BaseRegistry<T>;
|
|
6
|
-
}
|
|
7
|
-
export declare const tsHandler: RegistryHandler<any>;
|
|
8
|
-
export declare const jsonHandler: RegistryHandler<any>;
|
|
9
|
-
//# sourceMappingURL=registry.handlers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.handlers.d.ts","sourceRoot":"","sources":["../../src/registry/registry.handlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAE9D,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,iBAAiB,GAAG,iBAAiB;IAC9E,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,SAAS,EAAE,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,MAAM,CAAA;IAC5C,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,YAAY,CAAC,CAAC,CAAC,CAAA;CAC9C;AAED,eAAO,MAAM,SAAS,EAAE,eAAe,CAAC,GAAG,CAO1C,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,eAAe,CAAC,GAAG,CAI5C,CAAA"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export const tsHandler = {
|
|
2
|
-
extensions: ["ts"],
|
|
3
|
-
serialize: (data) => `export const registry = ${JSON.stringify(data, null, 2)} as const\n`,
|
|
4
|
-
deserialize: () => {
|
|
5
|
-
throw new Error("TS handler deserializes via dynamic import — use load()");
|
|
6
|
-
},
|
|
7
|
-
};
|
|
8
|
-
export const jsonHandler = {
|
|
9
|
-
extensions: ["json"],
|
|
10
|
-
serialize: (data) => JSON.stringify(data, null, 2),
|
|
11
|
-
deserialize: (raw) => JSON.parse(raw),
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=registry.handlers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.handlers.js","sourceRoot":"","sources":["../../src/registry/registry.handlers.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,SAAS,GAAyB;IAC7C,UAAU,EAAE,CAAC,IAAI,CAAC;IAClB,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE,CAClB,2BAA2B,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,aAAa;IACvE,WAAW,EAAE,GAAG,EAAE;QAChB,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAA;IAC5E,CAAC;CACF,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAAyB;IAC/C,UAAU,EAAE,CAAC,MAAM,CAAC;IACpB,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAClD,WAAW,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;CACtC,CAAA"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { BaseRegistryEntry } from "./types";
|
|
2
|
-
import type { RegistryStore } from "./registry.store";
|
|
3
|
-
import type { RegistryHandler } from "./registry.handlers";
|
|
4
|
-
/**
|
|
5
|
-
* name alias for load() when you want to specify an explicit filePath. Otherwise identical behavior.
|
|
6
|
-
*/
|
|
7
|
-
export declare function loadFrom<T extends BaseRegistryEntry>(registry: RegistryStore<T>, filePath: string): Promise<void>;
|
|
8
|
-
export declare function load<T extends BaseRegistryEntry>(registry: RegistryStore<T>, filePath?: string): Promise<void>;
|
|
9
|
-
/**
|
|
10
|
-
* Flushes the store to its already-bound filePath.
|
|
11
|
-
* Sorts entries alphabetically for deterministic output.
|
|
12
|
-
*
|
|
13
|
-
* @throws If the store has no bound filePath.
|
|
14
|
-
*/
|
|
15
|
-
export declare function flush<T extends BaseRegistryEntry>(registry: RegistryStore<T>, handler?: RegistryHandler<T>): void;
|
|
16
|
-
/**
|
|
17
|
-
* Writes the store to an explicit path.
|
|
18
|
-
* Sorts entries alphabetically for deterministic output.
|
|
19
|
-
* Does not affect the store's bound filePath.
|
|
20
|
-
*/
|
|
21
|
-
export declare function writeTo<T extends BaseRegistryEntry>(registry: RegistryStore<T>, filePath: string, handler?: RegistryHandler<T>): void;
|
|
22
|
-
//# sourceMappingURL=registry.io.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.io.d.ts","sourceRoot":"","sources":["../../src/registry/registry.io.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAwB1D;;GAEG;AACH,wBAAsB,QAAQ,CAAC,CAAC,SAAS,iBAAiB,EACxD,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,EAC1B,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CAEf;AAYD,wBAAsB,IAAI,CAAC,CAAC,SAAS,iBAAiB,EACpD,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,EAC1B,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC,CAgBf;AAMD;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,CAAC,SAAS,iBAAiB,EAC/C,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,EAC1B,OAAO,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,GAC3B,IAAI,CASN;AAMD;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,iBAAiB,EACjD,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,EAC1B,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,GAC3B,IAAI,CAGN"}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { writeFileSync, readFileSync } from "node:fs";
|
|
2
|
-
import { tsHandler } from "./registry.handlers";
|
|
3
|
-
// ---------------------------------------------------------------------------
|
|
4
|
-
// Helpers
|
|
5
|
-
// ---------------------------------------------------------------------------
|
|
6
|
-
function resolveHandler(registry, override) {
|
|
7
|
-
return override ?? registry.handler ?? tsHandler;
|
|
8
|
-
}
|
|
9
|
-
function sortedEntries(registry) {
|
|
10
|
-
return Object.fromEntries(Object.entries(registry.store.state).sort(([a], [b]) => a.localeCompare(b)));
|
|
11
|
-
}
|
|
12
|
-
// ---------------------------------------------------------------------------
|
|
13
|
-
// loadFrom (file → store)
|
|
14
|
-
// ---------------------------------------------------------------------------
|
|
15
|
-
/**
|
|
16
|
-
* name alias for load() when you want to specify an explicit filePath. Otherwise identical behavior.
|
|
17
|
-
*/
|
|
18
|
-
export async function loadFrom(registry, filePath) {
|
|
19
|
-
return load(registry, filePath);
|
|
20
|
-
}
|
|
21
|
-
// ---------------------------------------------------------------------------
|
|
22
|
-
// load (file → store)
|
|
23
|
-
//
|
|
24
|
-
// Hydrates the store from its bound filePath.
|
|
25
|
-
// - .ts files: uses dynamic import (handler is not called — TS files export
|
|
26
|
-
// a `registry` object directly at runtime via Bun/tsx)
|
|
27
|
-
// - other files: uses readFileSync + handler.deserialize
|
|
28
|
-
//
|
|
29
|
-
// No-op if the store has no filePath or the file does not exist yet.
|
|
30
|
-
// ---------------------------------------------------------------------------
|
|
31
|
-
export async function load(registry, filePath) {
|
|
32
|
-
const target = filePath ?? registry.filePath;
|
|
33
|
-
if (!target)
|
|
34
|
-
return;
|
|
35
|
-
try {
|
|
36
|
-
if (target.endsWith(".ts")) {
|
|
37
|
-
const mod = (await import(`file://${target}`));
|
|
38
|
-
registry.store.setState(() => ({ ...mod.registry }));
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
const h = resolveHandler(registry);
|
|
42
|
-
const raw = readFileSync(target, "utf-8");
|
|
43
|
-
registry.store.setState(() => ({ ...h.deserialize(raw) }));
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
catch {
|
|
47
|
-
// File doesn't exist yet — store stays empty
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
// ---------------------------------------------------------------------------
|
|
51
|
-
// flush (store → bound filePath)
|
|
52
|
-
// ---------------------------------------------------------------------------
|
|
53
|
-
/**
|
|
54
|
-
* Flushes the store to its already-bound filePath.
|
|
55
|
-
* Sorts entries alphabetically for deterministic output.
|
|
56
|
-
*
|
|
57
|
-
* @throws If the store has no bound filePath.
|
|
58
|
-
*/
|
|
59
|
-
export function flush(registry, handler) {
|
|
60
|
-
if (!registry.filePath) {
|
|
61
|
-
throw new Error("flush() requires a bound filePath. Use createRegistryStore({ filePath }) to bind one.");
|
|
62
|
-
}
|
|
63
|
-
const h = resolveHandler(registry, handler);
|
|
64
|
-
writeFileSync(registry.filePath, h.serialize(sortedEntries(registry)), "utf-8");
|
|
65
|
-
}
|
|
66
|
-
// ---------------------------------------------------------------------------
|
|
67
|
-
// writeTo (store → explicit path)
|
|
68
|
-
// ---------------------------------------------------------------------------
|
|
69
|
-
/**
|
|
70
|
-
* Writes the store to an explicit path.
|
|
71
|
-
* Sorts entries alphabetically for deterministic output.
|
|
72
|
-
* Does not affect the store's bound filePath.
|
|
73
|
-
*/
|
|
74
|
-
export function writeTo(registry, filePath, handler) {
|
|
75
|
-
const h = resolveHandler(registry, handler);
|
|
76
|
-
writeFileSync(filePath, h.serialize(sortedEntries(registry)), "utf-8");
|
|
77
|
-
}
|
|
78
|
-
//# sourceMappingURL=registry.io.js.map
|
|
@@ -1 +0,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,SAAS,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC,CAAA;AACxE,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { BaseRegistryEntry } from "./types";
|
|
2
|
-
import type { RegistryStore } from "./registry.store";
|
|
3
|
-
/**
|
|
4
|
-
* Register or overwrite an entry in the store.
|
|
5
|
-
*/
|
|
6
|
-
export declare function register<T extends BaseRegistryEntry>(registry: RegistryStore<T>, key: string, entry: T): void;
|
|
7
|
-
/**
|
|
8
|
-
* Remove an entry from the store.
|
|
9
|
-
* Returns true if the entry existed, false if it was already absent.
|
|
10
|
-
*/
|
|
11
|
-
export declare function unregister<T extends BaseRegistryEntry>(registry: RegistryStore<T>, key: string): boolean;
|
|
12
|
-
//# sourceMappingURL=registry.mutations.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.mutations.d.ts","sourceRoot":"","sources":["../../src/registry/registry.mutations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAErD;;GAEG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,iBAAiB,EAClD,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,EAC1B,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,CAAC,GACP,IAAI,CAEN;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,iBAAiB,EACpD,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,EAC1B,GAAG,EAAE,MAAM,GACV,OAAO,CAYT"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Register or overwrite an entry in the store.
|
|
3
|
-
*/
|
|
4
|
-
export function register(registry, key, entry) {
|
|
5
|
-
registry.store.setState((s) => ({ ...s, [key]: entry }));
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Remove an entry from the store.
|
|
9
|
-
* Returns true if the entry existed, false if it was already absent.
|
|
10
|
-
*/
|
|
11
|
-
export function unregister(registry, key) {
|
|
12
|
-
const existed = key in registry.store.state;
|
|
13
|
-
if (existed) {
|
|
14
|
-
registry.store.setState((s) => {
|
|
15
|
-
const next = { ...s };
|
|
16
|
-
delete next[key];
|
|
17
|
-
return next;
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
return existed;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=registry.mutations.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.mutations.js","sourceRoot":"","sources":["../../src/registry/registry.mutations.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,UAAU,QAAQ,CACtB,QAA0B,EAC1B,GAAW,EACX,KAAQ;IAER,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAA;AAC1D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,UAAU,CACxB,QAA0B,EAC1B,GAAW;IAEX,MAAM,OAAO,GAAG,GAAG,IAAI,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAA;IAE3C,IAAI,OAAO,EAAE,CAAC;QACZ,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE;YAC5B,MAAM,IAAI,GAAG,EAAE,GAAG,CAAC,EAAE,CAAA;YACrB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAA;YAChB,OAAO,IAAI,CAAA;QACb,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,OAAO,CAAA;AAChB,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { BaseRegistry, BaseRegistryEntry } from "./types";
|
|
2
|
-
import type { RegistryStore } from "./registry.store";
|
|
3
|
-
/**
|
|
4
|
-
* Get a single entry by key. Returns undefined if not found.
|
|
5
|
-
*/
|
|
6
|
-
export declare function get<T extends BaseRegistryEntry>(registry: RegistryStore<T>, key: string): T | undefined;
|
|
7
|
-
/**
|
|
8
|
-
* Check whether a key exists in the store.
|
|
9
|
-
*/
|
|
10
|
-
export declare function has<T extends BaseRegistryEntry>(registry: RegistryStore<T>, key: string): boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Return all entries as a plain record.
|
|
13
|
-
*/
|
|
14
|
-
export declare function entries<T extends BaseRegistryEntry>(registry: RegistryStore<T>): BaseRegistry<T>;
|
|
15
|
-
/**
|
|
16
|
-
* Return all registered keys.
|
|
17
|
-
*/
|
|
18
|
-
export declare function keys<T extends BaseRegistryEntry>(registry: RegistryStore<T>): string[];
|
|
19
|
-
/**
|
|
20
|
-
* Return all entries that match a given version string.
|
|
21
|
-
*/
|
|
22
|
-
export declare function getByVersion<T extends BaseRegistryEntry>(registry: RegistryStore<T>, version: string): BaseRegistry<T>;
|
|
23
|
-
/**
|
|
24
|
-
* Return the count of registered entries.
|
|
25
|
-
*/
|
|
26
|
-
export declare function size<T extends BaseRegistryEntry>(registry: RegistryStore<T>): number;
|
|
27
|
-
//# sourceMappingURL=registry.selectors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.selectors.d.ts","sourceRoot":"","sources":["../../src/registry/registry.selectors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAErD;;GAEG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,iBAAiB,EAC7C,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,EAC1B,GAAG,EAAE,MAAM,GACV,CAAC,GAAG,SAAS,CAEf;AAED;;GAEG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,iBAAiB,EAC7C,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,EAC1B,GAAG,EAAE,MAAM,GACV,OAAO,CAET;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,iBAAiB,EACjD,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,GACzB,YAAY,CAAC,CAAC,CAAC,CAEjB;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,iBAAiB,EAC9C,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,GACzB,MAAM,EAAE,CAEV;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,iBAAiB,EACtD,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,EAC1B,OAAO,EAAE,MAAM,GACd,YAAY,CAAC,CAAC,CAAC,CAIjB;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,iBAAiB,EAC9C,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,GACzB,MAAM,CAER"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Get a single entry by key. Returns undefined if not found.
|
|
3
|
-
*/
|
|
4
|
-
export function get(registry, key) {
|
|
5
|
-
return registry.store.state[key];
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Check whether a key exists in the store.
|
|
9
|
-
*/
|
|
10
|
-
export function has(registry, key) {
|
|
11
|
-
return key in registry.store.state;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Return all entries as a plain record.
|
|
15
|
-
*/
|
|
16
|
-
export function entries(registry) {
|
|
17
|
-
return registry.store.state;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Return all registered keys.
|
|
21
|
-
*/
|
|
22
|
-
export function keys(registry) {
|
|
23
|
-
return Object.keys(registry.store.state);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Return all entries that match a given version string.
|
|
27
|
-
*/
|
|
28
|
-
export function getByVersion(registry, version) {
|
|
29
|
-
return Object.fromEntries(Object.entries(registry.store.state).filter(([, entry]) => entry.version === version));
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Return the count of registered entries.
|
|
33
|
-
*/
|
|
34
|
-
export function size(registry) {
|
|
35
|
-
return Object.keys(registry.store.state).length;
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=registry.selectors.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.selectors.js","sourceRoot":"","sources":["../../src/registry/registry.selectors.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,UAAU,GAAG,CACjB,QAA0B,EAC1B,GAAW;IAEX,OAAO,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;AAClC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,GAAG,CACjB,QAA0B,EAC1B,GAAW;IAEX,OAAO,GAAG,IAAI,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAA;AACpC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,OAAO,CACrB,QAA0B;IAE1B,OAAO,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAA;AAC7B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,IAAI,CAClB,QAA0B;IAE1B,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;AAC1C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAC1B,QAA0B,EAC1B,OAAe;IAEf,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,KAAK,OAAO,CAAC,CACtF,CAAA;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,IAAI,CAClB,QAA0B;IAE1B,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAA;AACjD,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Store } from "@tanstack/store";
|
|
2
|
-
import type { BaseRegistry, BaseRegistryEntry } from "./types";
|
|
3
|
-
import type { RegistryHandler } from "./registry.handlers";
|
|
4
|
-
export interface RegistryStoreOptions<T extends BaseRegistryEntry = BaseRegistryEntry> {
|
|
5
|
-
/** Absolute path to the manifest file. Used by load() and flush(). */
|
|
6
|
-
filePath?: string;
|
|
7
|
-
/** Default handler for serialization/deserialization. Defaults to tsHandler. */
|
|
8
|
-
handler?: RegistryHandler<T>;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* The registry store instance — passed to mutations, selectors, and io helpers.
|
|
12
|
-
*/
|
|
13
|
-
export interface RegistryStore<T extends BaseRegistryEntry = BaseRegistryEntry> {
|
|
14
|
-
/** The underlying TanStack Store. Subscribe, derive, or read .state directly. */
|
|
15
|
-
store: Store<BaseRegistry<T>>;
|
|
16
|
-
/** Absolute path this store is bound to (if any). */
|
|
17
|
-
filePath?: string;
|
|
18
|
-
/** Default handler for serialization/deserialization. */
|
|
19
|
-
handler?: RegistryHandler<T>;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Creates a RegistryStore backed by TanStack Store.
|
|
23
|
-
* State starts empty — call load() to hydrate from disk.
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* const registry = createRegistryStore<MyEntry>({ filePath: "/abs/.g3nerate-manifest.ts" })
|
|
27
|
-
* await load(registry)
|
|
28
|
-
*/
|
|
29
|
-
export declare function createRegistryStore<T extends BaseRegistryEntry = BaseRegistryEntry>(options?: RegistryStoreOptions<T>): RegistryStore<T>;
|
|
30
|
-
/**
|
|
31
|
-
* Sets the default handler on the store. Returns the store for chaining.
|
|
32
|
-
*/
|
|
33
|
-
export declare function useHandler<T extends BaseRegistryEntry>(registry: RegistryStore<T>, handler: RegistryHandler<T>): RegistryStore<T>;
|
|
34
|
-
//# sourceMappingURL=registry.store.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.store.d.ts","sourceRoot":"","sources":["../../src/registry/registry.store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAM1D,MAAM,WAAW,oBAAoB,CAAC,CAAC,SAAS,iBAAiB,GAAG,iBAAiB;IACnF,sEAAsE;IACtE,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,gFAAgF;IAChF,OAAO,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,CAAA;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,iBAAiB,GAAG,iBAAiB;IAC5E,iFAAiF;IACjF,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAA;IAC7B,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,yDAAyD;IACzD,OAAO,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,CAAA;CAC7B;AAMD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,iBAAiB,GAAG,iBAAiB,EACjF,OAAO,GAAE,oBAAoB,CAAC,CAAC,CAAM,GACpC,aAAa,CAAC,CAAC,CAAC,CAMlB;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,iBAAiB,EACpD,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,EAC1B,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,GAC1B,aAAa,CAAC,CAAC,CAAC,CAGlB"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Store } from "@tanstack/store";
|
|
2
|
-
// ---------------------------------------------------------------------------
|
|
3
|
-
// Factory
|
|
4
|
-
// ---------------------------------------------------------------------------
|
|
5
|
-
/**
|
|
6
|
-
* Creates a RegistryStore backed by TanStack Store.
|
|
7
|
-
* State starts empty — call load() to hydrate from disk.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* const registry = createRegistryStore<MyEntry>({ filePath: "/abs/.g3nerate-manifest.ts" })
|
|
11
|
-
* await load(registry)
|
|
12
|
-
*/
|
|
13
|
-
export function createRegistryStore(options = {}) {
|
|
14
|
-
return {
|
|
15
|
-
store: new Store({}),
|
|
16
|
-
filePath: options.filePath,
|
|
17
|
-
handler: options.handler,
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Sets the default handler on the store. Returns the store for chaining.
|
|
22
|
-
*/
|
|
23
|
-
export function useHandler(registry, handler) {
|
|
24
|
-
registry.handler = handler;
|
|
25
|
-
return registry;
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=registry.store.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.store.js","sourceRoot":"","sources":["../../src/registry/registry.store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AA2BvC,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CACjC,OAAO,GAA4B,EAAE;IAErC,OAAO;QACL,KAAK,EAAE,IAAI,KAAK,CAAkB,EAAE,CAAC;QACrC,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,OAAO,EAAE,OAAO,CAAC,OAAO;KACzB,CAAA;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CACxB,QAA0B,EAC1B,OAA2B;IAE3B,QAAQ,CAAC,OAAO,GAAG,OAAO,CAAA;IAC1B,OAAO,QAAQ,CAAA;AACjB,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Recursively serializes a value to a TypeScript object literal string.
|
|
3
|
-
* Used by generateRegistryFile to produce human-readable .ts output.
|
|
4
|
-
*/
|
|
5
|
-
export declare function stringifyValue(value: unknown, depth?: number): string;
|
|
6
|
-
/**
|
|
7
|
-
* Generates the full content of a typed .ts registry manifest file.
|
|
8
|
-
*
|
|
9
|
-
* @param entries - The registry entries to serialize
|
|
10
|
-
* @param typeName - TypeScript type name for the `satisfies` clause
|
|
11
|
-
* @param importFrom - Package to import the type from
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* generateRegistryFile(entries, "G3nerateRegistry", "@g3nomaly/g3nerate")
|
|
15
|
-
* // →
|
|
16
|
-
* // import type { G3nerateRegistry } from "@g3nomaly/g3nerate"
|
|
17
|
-
* //
|
|
18
|
-
* // export const registry = {
|
|
19
|
-
* // "my-schema": { ... },
|
|
20
|
-
* // } as const satisfies G3nerateRegistry
|
|
21
|
-
*/
|
|
22
|
-
export declare function generateRegistryFile(entries: Record<string, unknown>, typeName: string, importFrom: string): string;
|
|
23
|
-
//# sourceMappingURL=registry.template.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.template.d.ts","sourceRoot":"","sources":["../../src/registry/registry.template.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,SAAI,GAAG,MAAM,CA2BhE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,MAAM,CAeR"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Recursively serializes a value to a TypeScript object literal string.
|
|
3
|
-
* Used by generateRegistryFile to produce human-readable .ts output.
|
|
4
|
-
*/
|
|
5
|
-
export function stringifyValue(value, depth = 0) {
|
|
6
|
-
const indent = " ".repeat(depth);
|
|
7
|
-
const innerIndent = " ".repeat(depth + 1);
|
|
8
|
-
if (value === null)
|
|
9
|
-
return "null";
|
|
10
|
-
if (value === undefined)
|
|
11
|
-
return "undefined";
|
|
12
|
-
if (typeof value === "string")
|
|
13
|
-
return JSON.stringify(value);
|
|
14
|
-
if (typeof value === "number" || typeof value === "boolean")
|
|
15
|
-
return String(value);
|
|
16
|
-
if (Array.isArray(value)) {
|
|
17
|
-
if (value.length === 0)
|
|
18
|
-
return "[]";
|
|
19
|
-
const items = value
|
|
20
|
-
.map((v) => `${innerIndent}${stringifyValue(v, depth + 1)}`)
|
|
21
|
-
.join(",\n");
|
|
22
|
-
return `[\n${items},\n${indent}]`;
|
|
23
|
-
}
|
|
24
|
-
if (typeof value === "object") {
|
|
25
|
-
const entries = Object.entries(value);
|
|
26
|
-
if (entries.length === 0)
|
|
27
|
-
return "{}";
|
|
28
|
-
const lines = entries
|
|
29
|
-
.map(([k, v]) => `${innerIndent}${JSON.stringify(k)}: ${stringifyValue(v, depth + 1)}`)
|
|
30
|
-
.join(",\n");
|
|
31
|
-
return `{\n${lines},\n${indent}}`;
|
|
32
|
-
}
|
|
33
|
-
return String(value);
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Generates the full content of a typed .ts registry manifest file.
|
|
37
|
-
*
|
|
38
|
-
* @param entries - The registry entries to serialize
|
|
39
|
-
* @param typeName - TypeScript type name for the `satisfies` clause
|
|
40
|
-
* @param importFrom - Package to import the type from
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* generateRegistryFile(entries, "G3nerateRegistry", "@g3nomaly/g3nerate")
|
|
44
|
-
* // →
|
|
45
|
-
* // import type { G3nerateRegistry } from "@g3nomaly/g3nerate"
|
|
46
|
-
* //
|
|
47
|
-
* // export const registry = {
|
|
48
|
-
* // "my-schema": { ... },
|
|
49
|
-
* // } as const satisfies G3nerateRegistry
|
|
50
|
-
*/
|
|
51
|
-
export function generateRegistryFile(entries, typeName, importFrom) {
|
|
52
|
-
const lines = [];
|
|
53
|
-
lines.push(`import type { ${typeName} } from "${importFrom}"`);
|
|
54
|
-
lines.push("");
|
|
55
|
-
lines.push("export const registry = {");
|
|
56
|
-
for (const [key, value] of Object.entries(entries)) {
|
|
57
|
-
lines.push(` ${JSON.stringify(key)}: ${stringifyValue(value, 1)},`);
|
|
58
|
-
}
|
|
59
|
-
lines.push(`} as const satisfies ${typeName}`);
|
|
60
|
-
lines.push("");
|
|
61
|
-
return lines.join("\n");
|
|
62
|
-
}
|
|
63
|
-
//# sourceMappingURL=registry.template.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.template.js","sourceRoot":"","sources":["../../src/registry/registry.template.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,KAAc,EAAE,KAAK,GAAG,CAAC;IACtD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IACjC,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAA;IAE1C,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,MAAM,CAAA;IACjC,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,WAAW,CAAA;IAC3C,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;IAC3D,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAA;IAEjF,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,IAAI,KAAK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,CAAC,OAAO,CAAC,EAAE,CAAC;QACnD,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,cAAc,CAAC,KAAK,EAAE,CAAC,CAAC,GAAG,CAAC,CAAA;IACtE,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,wBAAwB,QAAQ,EAAE,CAAC,CAAA;IAC9C,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAEd,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACzB,CAAC"}
|
package/dist/registry/types.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
/**
|
|
3
|
-
* Base file entry — extended by each package with their own `type` enum.
|
|
4
|
-
*/
|
|
5
|
-
export declare const BaseFileEntrySchema: z.ZodObject<{
|
|
6
|
-
path: z.ZodString;
|
|
7
|
-
type: z.ZodString;
|
|
8
|
-
hash: z.ZodOptional<z.ZodString>;
|
|
9
|
-
version: z.ZodOptional<z.ZodString>;
|
|
10
|
-
}, z.core.$strip>;
|
|
11
|
-
export type BaseFileEntry = z.infer<typeof BaseFileEntrySchema>;
|
|
12
|
-
/**
|
|
13
|
-
* Base registry entry — extended by each package with their own fields.
|
|
14
|
-
*/
|
|
15
|
-
export declare const BaseRegistryEntrySchema: z.ZodObject<{
|
|
16
|
-
name: z.ZodString;
|
|
17
|
-
description: z.ZodOptional<z.ZodString>;
|
|
18
|
-
version: z.ZodOptional<z.ZodString>;
|
|
19
|
-
files: z.ZodArray<z.ZodObject<{
|
|
20
|
-
path: z.ZodString;
|
|
21
|
-
type: z.ZodString;
|
|
22
|
-
hash: z.ZodOptional<z.ZodString>;
|
|
23
|
-
version: z.ZodOptional<z.ZodString>;
|
|
24
|
-
}, z.core.$strip>>;
|
|
25
|
-
}, z.core.$strip>;
|
|
26
|
-
export type BaseRegistryEntry = z.infer<typeof BaseRegistryEntrySchema>;
|
|
27
|
-
/**
|
|
28
|
-
* Generic registry map — key → entry.
|
|
29
|
-
*/
|
|
30
|
-
export type BaseRegistry<T extends BaseRegistryEntry = BaseRegistryEntry> = Record<string, T>;
|
|
31
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/registry/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;iBAK9B,CAAA;AAEF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE/D;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;iBAKlC,CAAA;AAEF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAEvE;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,iBAAiB,GAAG,iBAAiB,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA"}
|
package/dist/registry/types.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
/**
|
|
3
|
-
* Base file entry — extended by each package with their own `type` enum.
|
|
4
|
-
*/
|
|
5
|
-
export const BaseFileEntrySchema = z.object({
|
|
6
|
-
path: z.string().min(1),
|
|
7
|
-
type: z.string(),
|
|
8
|
-
hash: z.string().min(1).optional(), // populated at build/install time, absent in unbuilt source meta files
|
|
9
|
-
version: z.string().min(1).optional(), // populated at build/install time, absent in unbuilt source meta files
|
|
10
|
-
});
|
|
11
|
-
/**
|
|
12
|
-
* Base registry entry — extended by each package with their own fields.
|
|
13
|
-
*/
|
|
14
|
-
export const BaseRegistryEntrySchema = z.object({
|
|
15
|
-
name: z.string().min(1),
|
|
16
|
-
description: z.string().optional(),
|
|
17
|
-
version: z.string().optional(),
|
|
18
|
-
files: z.array(BaseFileEntrySchema).min(1),
|
|
19
|
-
});
|
|
20
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/registry/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,IAAI,EAAK,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1B,IAAI,EAAK,CAAC,CAAC,MAAM,EAAE;IACnB,IAAI,EAAK,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,uEAAuE;IAC9G,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,uEAAuE;CAC/G,CAAC,CAAA;AAIF;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;CAC3C,CAAC,CAAA"}
|
package/dist/security/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/security/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/security/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/security/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { ZodType, z } from "zod";
|
|
2
|
-
/**
|
|
3
|
-
* Safely parses a TypeScript file that has a default export object literal.
|
|
4
|
-
* Transpiles the file, extracts the object literal via regex, evaluates it
|
|
5
|
-
* inside a sandboxed Worker with a timeout, then validates with the provided
|
|
6
|
-
* Zod schema.
|
|
7
|
-
*
|
|
8
|
-
* @param filePath - Absolute path to the .ts file to parse
|
|
9
|
-
* @param schema - Zod schema to validate the extracted object against
|
|
10
|
-
* @param timeoutMs - Worker timeout in milliseconds (default: 1000)
|
|
11
|
-
* @returns Validated, typed object
|
|
12
|
-
*/
|
|
13
|
-
export declare function getSafeObject<TSchema extends ZodType>(filePath: string, schema: TSchema, timeoutMs?: number): Promise<z.infer<TSchema>>;
|
|
14
|
-
//# sourceMappingURL=securityParser.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"securityParser.d.ts","sourceRoot":"","sources":["../../src/security/securityParser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAEtC;;;;;;;;;;GAUG;AACH,wBAAsB,aAAa,CAAC,OAAO,SAAS,OAAO,EACzD,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,OAAO,EACf,SAAS,SAAO,GACf,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAkG3B"}
|