@camstack/system 1.2.347 → 1.2.349
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/addon-runner.js +2 -2
- package/dist/addon-runner.mjs +2 -2
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/dist/builtins/alerts/alerts.addon.js +1 -1
- package/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/dist/builtins/autotrack/index.js +1 -1
- package/dist/builtins/autotrack/index.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
- package/dist/builtins/calendars/calendar-color.d.ts +5 -0
- package/dist/builtins/calendars/calendar-prefs-store.d.ts +13 -0
- package/dist/builtins/calendars/calendars.addon.d.ts +4 -1
- package/dist/builtins/calendars/calendars.addon.js +143 -23
- package/dist/builtins/calendars/calendars.addon.mjs +143 -23
- package/dist/builtins/camera-grid/index.js +1 -1
- package/dist/builtins/camera-grid/index.mjs +1 -1
- package/dist/builtins/composer/composer.addon.js +2 -2
- package/dist/builtins/composer/composer.addon.mjs +2 -2
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/core-blocks/block-package.d.ts +12 -1
- package/dist/builtins/core-blocks/block-settings-store.d.ts +25 -0
- package/dist/builtins/core-blocks/block-supervisor.d.ts +6 -1
- package/dist/builtins/core-blocks/compile-block.d.ts +33 -2
- package/dist/builtins/core-blocks/core-block-store.d.ts +5 -0
- package/dist/builtins/core-blocks/core-blocks.addon.d.ts +10 -1
- package/dist/builtins/core-blocks/core-blocks.addon.js +363 -20
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +360 -21
- package/dist/builtins/core-blocks/extract-settings-schema.d.ts +6 -0
- package/dist/builtins/core-blocks/index.d.ts +3 -1
- package/dist/builtins/core-blocks/index.js +3 -0
- package/dist/builtins/core-blocks/index.mjs +2 -2
- package/dist/builtins/device-manager/device-manager.addon.js +2 -2
- package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/dist/builtins/local-auth/local-auth.addon.js +1 -1
- package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
- package/dist/builtins/local-network/local-network.addon.js +3 -3
- package/dist/builtins/local-network/local-network.addon.mjs +3 -3
- package/dist/builtins/loki-logging/index.js +1 -1
- package/dist/builtins/loki-logging/index.mjs +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.js +4 -4
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +4 -4
- package/dist/builtins/platform-probe/index.js +3 -3
- package/dist/builtins/platform-probe/index.mjs +2 -2
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/dist/builtins/snapshot/index.js +1 -1
- package/dist/builtins/snapshot/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +2 -2
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +2 -2
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/dist/builtins/system-config/system-config.addon.js +1 -1
- package/dist/builtins/system-config/system-config.addon.mjs +1 -1
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{child-cap-dispatch-CVOa1BZI.js → child-cap-dispatch-DiDBYNY4.js} +3 -3
- package/dist/{child-cap-dispatch-OLFN-F85.mjs → child-cap-dispatch-Pkx_sEKR.mjs} +3 -3
- package/dist/{composition-sources-pQsmMdpR.mjs → composition-sources-DK-hFG7I.mjs} +1 -1
- package/dist/{composition-sources-CeZ3tyH8.js → composition-sources-w_NIID5d.js} +1 -1
- package/dist/{dist-BUFcHq7H.mjs → dist-C6CPaa8G.mjs} +5646 -5301
- package/dist/{dist-DTgd2gOR.js → dist-DvAczrLl.js} +5669 -5300
- package/dist/index.js +7 -7
- package/dist/index.mjs +6 -6
- package/dist/{retired-settings-keys-Ddb5cCNR.js → retired-settings-keys-BQYjCJWI.js} +1 -1
- package/dist/{retired-settings-keys-ltKefX3N.mjs → retired-settings-keys-tmMQQ9OH.mjs} +1 -1
- package/package.json +1 -1
- package/dist/{resource-monitor-B1v6E07R.mjs → resource-monitor-B2WZ8_q9.mjs} +1 -1
- package/dist/{resource-monitor-DzNn_IZK.js → resource-monitor-BgWGRxN5.js} +1 -1
- package/dist/{tls-DAtaKVUT.mjs → tls-DTlVWwAI.mjs} +1 -1
- package/dist/{tls-DEjOOARt.js → tls-ue_Xefmv.js} +1 -1
|
@@ -16,8 +16,14 @@ export interface MaterializeBlockInput {
|
|
|
16
16
|
readonly root: string;
|
|
17
17
|
readonly blockId: string;
|
|
18
18
|
readonly blockName: string;
|
|
19
|
-
/** The block's transpiled JavaScript. */
|
|
19
|
+
/** The block's bundled / transpiled JavaScript (written to `dist/block.js`). */
|
|
20
20
|
readonly js: string;
|
|
21
|
+
/**
|
|
22
|
+
* Optional TypeScript sources (path → content). Written under `src/` so a
|
|
23
|
+
* multi-file project is inspectable on disk next to the bundle the runner
|
|
24
|
+
* loads. Absent for a legacy single-file materialize.
|
|
25
|
+
*/
|
|
26
|
+
readonly files?: Readonly<Record<string, string>>;
|
|
21
27
|
}
|
|
22
28
|
export interface MaterializedBlock {
|
|
23
29
|
/** What `$process.spawnRunner` gets as `addonDir` — the package root. */
|
|
@@ -34,6 +40,11 @@ export declare function renderBlockManifest(blockId: string, blockName: string):
|
|
|
34
40
|
* rewrite: the author's code is the thing that changes, and a partial update
|
|
35
41
|
* that left a stale `block.js` behind would run yesterday's code while the
|
|
36
42
|
* editor showed today's.
|
|
43
|
+
*
|
|
44
|
+
* Layout:
|
|
45
|
+
* `src/<path>` — author TypeScript when `files` is provided
|
|
46
|
+
* `dist/block.js` — bundled / transpiled entry (what the wrapper imports)
|
|
47
|
+
* `dist/index.js` — generated BaseAddon wrapper
|
|
37
48
|
*/
|
|
38
49
|
export declare function materializeBlock(input: MaterializeBlockInput): Promise<MaterializedBlock>;
|
|
39
50
|
/** Remove a block's package. Idempotent — a missing directory is the desired
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SettingsStoreClient } from '@camstack/types';
|
|
2
|
+
export declare const CORE_BLOCK_SETTINGS_COLLECTION = "core-blocks:settings";
|
|
3
|
+
export declare const CORE_BLOCK_SETTINGS_COLUMNS: readonly [{
|
|
4
|
+
readonly name: "id";
|
|
5
|
+
readonly type: "TEXT";
|
|
6
|
+
readonly primaryKey: true;
|
|
7
|
+
readonly notNull: true;
|
|
8
|
+
}, {
|
|
9
|
+
readonly name: "values";
|
|
10
|
+
readonly type: "JSON";
|
|
11
|
+
readonly notNull: true;
|
|
12
|
+
readonly defaultValue: "{}";
|
|
13
|
+
}];
|
|
14
|
+
export interface BlockSettingsStoreDeps {
|
|
15
|
+
readonly store: SettingsStoreClient;
|
|
16
|
+
}
|
|
17
|
+
export declare class BlockSettingsStore {
|
|
18
|
+
private readonly store;
|
|
19
|
+
constructor(deps: BlockSettingsStoreDeps);
|
|
20
|
+
static declare(store: SettingsStoreClient): Promise<void>;
|
|
21
|
+
getValues(blockId: string): Promise<Record<string, unknown>>;
|
|
22
|
+
mergeValues(blockId: string, patch: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
23
|
+
delete(blockId: string): Promise<void>;
|
|
24
|
+
private mirrorToBlockAddon;
|
|
25
|
+
}
|
|
@@ -28,6 +28,11 @@ export interface BlockCompileOutcome {
|
|
|
28
28
|
readonly error?: string;
|
|
29
29
|
readonly js?: string;
|
|
30
30
|
}
|
|
31
|
+
export interface BlockCompileSource {
|
|
32
|
+
readonly code: string;
|
|
33
|
+
readonly files?: Readonly<Record<string, string>>;
|
|
34
|
+
readonly entry?: string;
|
|
35
|
+
}
|
|
31
36
|
/** The composer's one verb, as the supervisor needs it. */
|
|
32
37
|
export interface ComposerPort {
|
|
33
38
|
apply(input: ComposerApplyInput): Promise<ComposerApplyResult>;
|
|
@@ -39,7 +44,7 @@ export interface BlockSupervisorDeps {
|
|
|
39
44
|
readonly root: string;
|
|
40
45
|
readonly store: BlockStoreView;
|
|
41
46
|
readonly host: BlockProcessHost;
|
|
42
|
-
readonly compile: (
|
|
47
|
+
readonly compile: (source: BlockCompileSource) => Promise<BlockCompileOutcome>;
|
|
43
48
|
readonly logger: IScopedLogger;
|
|
44
49
|
/** Null when this node exposes no composer, and then every composition says so. */
|
|
45
50
|
readonly composer: ComposerPort | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CoreBlockCompileResult } from '@camstack/types';
|
|
1
|
+
import { CoreBlockCompileResult, DEFAULT_CORE_BLOCK_ENTRY } from '@camstack/types';
|
|
2
2
|
/** The esbuild surface this needs — injected so the compile is testable and so
|
|
3
3
|
* the kernel does not hard-depend on a bundler at import time. */
|
|
4
4
|
export interface BlockTranspiler {
|
|
@@ -9,7 +9,37 @@ export interface BlockTranspiler {
|
|
|
9
9
|
}): Promise<{
|
|
10
10
|
code: string;
|
|
11
11
|
}>;
|
|
12
|
+
/**
|
|
13
|
+
* Multi-file bundle. Absent on a node that only got `transform` (tests that
|
|
14
|
+
* never exercise files); then a files compile answers "unavailable".
|
|
15
|
+
*/
|
|
16
|
+
build?(options: BlockBundleOptions): Promise<BlockBundleResult>;
|
|
12
17
|
}
|
|
18
|
+
export interface BlockBundleOptions {
|
|
19
|
+
readonly absWorkingDir: string;
|
|
20
|
+
readonly entryPoints: readonly string[];
|
|
21
|
+
readonly outfile: string;
|
|
22
|
+
readonly bundle: true;
|
|
23
|
+
readonly format: 'esm';
|
|
24
|
+
readonly platform: 'node';
|
|
25
|
+
readonly target: string;
|
|
26
|
+
readonly write: true;
|
|
27
|
+
readonly logLevel: 'silent';
|
|
28
|
+
}
|
|
29
|
+
export interface BlockBundleResult {
|
|
30
|
+
readonly errors: readonly {
|
|
31
|
+
text: string;
|
|
32
|
+
location?: {
|
|
33
|
+
line: number;
|
|
34
|
+
column: number;
|
|
35
|
+
} | null;
|
|
36
|
+
}[];
|
|
37
|
+
}
|
|
38
|
+
export interface CompileBlockFilesInput {
|
|
39
|
+
readonly files: Readonly<Record<string, string>>;
|
|
40
|
+
readonly entry?: string;
|
|
41
|
+
}
|
|
42
|
+
export type CompileBlockSource = string | CompileBlockFilesInput;
|
|
13
43
|
export interface CompileBlockResult extends CoreBlockCompileResult {
|
|
14
44
|
/** The emitted JavaScript, when it compiled. */
|
|
15
45
|
readonly js?: string;
|
|
@@ -18,4 +48,5 @@ export interface CompileBlockResult extends CoreBlockCompileResult {
|
|
|
18
48
|
* Never throws. A compile failure is an ANSWER — the author needs to read it,
|
|
19
49
|
* and a thrown error at this layer becomes a 500 with the useful part buried.
|
|
20
50
|
*/
|
|
21
|
-
export declare function compileBlock(transpiler: BlockTranspiler,
|
|
51
|
+
export declare function compileBlock(transpiler: BlockTranspiler, source: CompileBlockSource): Promise<CompileBlockResult>;
|
|
52
|
+
export { DEFAULT_CORE_BLOCK_ENTRY };
|
|
@@ -120,4 +120,9 @@ export declare class CoreBlockStore {
|
|
|
120
120
|
/** Idempotent delete — an unknown id is a no-op. */
|
|
121
121
|
delete(blockId: string): Promise<void>;
|
|
122
122
|
private persist;
|
|
123
|
+
/**
|
|
124
|
+
* Resolve a source-affecting patch into the normalized `{ code, files?, entry? }`
|
|
125
|
+
* that will be stored. `null` when the patch does not touch source.
|
|
126
|
+
*/
|
|
127
|
+
private normalizeSourcePatch;
|
|
123
128
|
}
|
|
@@ -9,6 +9,7 @@ export declare class CoreBlocksAddon extends BaseAddon {
|
|
|
9
9
|
*/
|
|
10
10
|
constructor();
|
|
11
11
|
private store;
|
|
12
|
+
private prefs;
|
|
12
13
|
private transpiler;
|
|
13
14
|
private typeDefs;
|
|
14
15
|
private supervisor;
|
|
@@ -47,13 +48,21 @@ export declare class CoreBlocksAddon extends BaseAddon {
|
|
|
47
48
|
private convergeSoon;
|
|
48
49
|
private requireStore;
|
|
49
50
|
/**
|
|
50
|
-
* Compile, or explain why not.
|
|
51
|
+
* Compile, or explain why not. Returns the emitted JS so a successful gate
|
|
52
|
+
* can also extract `settingsSchema` without compiling twice.
|
|
51
53
|
*
|
|
52
54
|
* A missing transpiler REFUSES the write rather than waving it through: code
|
|
53
55
|
* that reached disk uncompiled is code the runner will fail on, far from the
|
|
54
56
|
* person who wrote it.
|
|
55
57
|
*/
|
|
56
58
|
private gate;
|
|
59
|
+
private requirePrefs;
|
|
60
|
+
/**
|
|
61
|
+
* After a successful compile, cache the entry's `settingsSchema` export on
|
|
62
|
+
* the block when the author did not set one by hand. Never overwrites an
|
|
63
|
+
* explicit schema the editor already stored.
|
|
64
|
+
*/
|
|
65
|
+
private maybeCacheSettingsSchema;
|
|
57
66
|
private buildProvider;
|
|
58
67
|
/**
|
|
59
68
|
* The composition methods (D659), flat. Sources and existing targets are read
|