@camstack/core 0.1.1 → 0.1.3
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/builtins/local-backup/index.d.mts +42 -0
- package/dist/builtins/local-backup/index.d.ts +42 -0
- package/dist/builtins/local-backup/index.js +188 -0
- package/dist/builtins/local-backup/index.js.map +1 -0
- package/dist/builtins/local-backup/index.mjs +11 -0
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.d.mts +2 -0
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.d.ts +2 -0
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +210 -0
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js.map +1 -0
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +10 -0
- package/dist/builtins/sqlite-storage/index.d.mts +4 -0
- package/dist/builtins/sqlite-storage/index.d.ts +4 -0
- package/dist/builtins/sqlite-storage/index.js +1025 -0
- package/dist/builtins/sqlite-storage/index.js.map +1 -0
- package/dist/builtins/sqlite-storage/index.mjs +31 -0
- package/dist/builtins/sqlite-storage/index.mjs.map +1 -0
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.d.mts +2 -0
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.d.ts +2 -0
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +317 -0
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js.map +1 -0
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +10 -0
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs.map +1 -0
- package/dist/builtins/winston-logging/index.d.mts +30 -0
- package/dist/builtins/winston-logging/index.d.ts +30 -0
- package/dist/builtins/winston-logging/index.js +185 -0
- package/dist/builtins/winston-logging/index.js.map +1 -0
- package/dist/builtins/winston-logging/index.mjs +11 -0
- package/dist/builtins/winston-logging/index.mjs.map +1 -0
- package/dist/chunk-LQFPAEQF.mjs +147 -0
- package/dist/chunk-LQFPAEQF.mjs.map +1 -0
- package/dist/{chunk-LZOMFHX3.mjs → chunk-QEMJH3KY.mjs} +11 -1
- package/dist/chunk-QEMJH3KY.mjs.map +1 -0
- package/dist/chunk-R3DIIBBX.mjs +532 -0
- package/dist/chunk-R3DIIBBX.mjs.map +1 -0
- package/dist/chunk-SO4LROOT.mjs +150 -0
- package/dist/chunk-SO4LROOT.mjs.map +1 -0
- package/dist/chunk-SPA4JBKN.mjs +175 -0
- package/dist/chunk-SPA4JBKN.mjs.map +1 -0
- package/dist/chunk-YXNXYYHL.mjs +282 -0
- package/dist/chunk-YXNXYYHL.mjs.map +1 -0
- package/dist/dist-N7SR63RN.mjs +3515 -0
- package/dist/dist-N7SR63RN.mjs.map +1 -0
- package/dist/filesystem-storage.addon-C42r589X.d.mts +57 -0
- package/dist/filesystem-storage.addon-C42r589X.d.ts +57 -0
- package/dist/index.d.mts +281 -849
- package/dist/index.d.ts +281 -849
- package/dist/index.js +8351 -1942
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4086 -2164
- package/dist/index.mjs.map +1 -1
- package/dist/onnxruntime_binding-6Q6HXASN.node +0 -0
- package/dist/onnxruntime_binding-EKZT2NRK.node +0 -0
- package/dist/onnxruntime_binding-P6S7V3CI.node +0 -0
- package/dist/onnxruntime_binding-PJNNIIUO.node +0 -0
- package/dist/onnxruntime_binding-UN6SPTQK.node +0 -0
- package/dist/sql-schema-CKz78rId.d.mts +97 -0
- package/dist/sql-schema-CKz78rId.d.ts +97 -0
- package/dist/sqlite-settings.addon-DigoKwpZ.d.mts +70 -0
- package/dist/sqlite-settings.addon-DigoKwpZ.d.ts +70 -0
- package/dist/{storage-location-manager-F4YZMHGM.mjs → storage-location-manager-UQRGHTCA.mjs} +2 -2
- package/dist/storage-location-manager-UQRGHTCA.mjs.map +1 -0
- package/dist/{wrapper-NTBY5HOA.mjs → wrapper-Y55ADNM5.mjs} +2 -2
- package/package.json +64 -12
- /package/dist/{chunk-LZOMFHX3.mjs.map → builtins/local-backup/index.mjs.map} +0 -0
- /package/dist/{storage-location-manager-F4YZMHGM.mjs.map → builtins/sqlite-storage/filesystem-storage.addon.mjs.map} +0 -0
- /package/dist/{wrapper-NTBY5HOA.mjs.map → wrapper-Y55ADNM5.mjs.map} +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { IFileStorage, StorageLocationName, IStorageLocation, ICamstackAddon, IConfigurable, AddonManifest, AddonContext, CapabilityProviderMap, ConfigUISchema } from '@camstack/types';
|
|
2
|
+
|
|
3
|
+
declare class FileSystemStorage implements IFileStorage {
|
|
4
|
+
private readonly basePath;
|
|
5
|
+
constructor(basePath: string);
|
|
6
|
+
readFile(filePath: string): Promise<Buffer>;
|
|
7
|
+
writeFile(filePath: string, data: Buffer): Promise<void>;
|
|
8
|
+
deleteFile(filePath: string): Promise<void>;
|
|
9
|
+
listFiles(prefix?: string): Promise<readonly string[]>;
|
|
10
|
+
getFileUrl(_path: string): Promise<string>;
|
|
11
|
+
exists(filePath: string): Promise<boolean>;
|
|
12
|
+
}
|
|
13
|
+
/** @deprecated Use FilesystemStorageProvider + SqliteSettingsBackend instead */
|
|
14
|
+
declare class SqliteStorageProvider {
|
|
15
|
+
private mainDb;
|
|
16
|
+
private sharedStructured;
|
|
17
|
+
private readonly locations;
|
|
18
|
+
initialize(): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Configure all storage locations.
|
|
21
|
+
* ONE single SQLite database (camstack.db) is used for ALL structured storage.
|
|
22
|
+
* File-based locations use the filesystem at their configured path.
|
|
23
|
+
*/
|
|
24
|
+
configure(config: {
|
|
25
|
+
locations: Record<string, string>;
|
|
26
|
+
}): Promise<void>;
|
|
27
|
+
getLocation(name: StorageLocationName): IStorageLocation;
|
|
28
|
+
shutdown(): Promise<void>;
|
|
29
|
+
export(_locationName: StorageLocationName): Promise<Buffer>;
|
|
30
|
+
import(_locationName: StorageLocationName, _data: Buffer): Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
declare class SqliteStorageAddon implements ICamstackAddon, IConfigurable {
|
|
34
|
+
readonly manifest: AddonManifest;
|
|
35
|
+
private provider;
|
|
36
|
+
initialize(context: AddonContext): Promise<void>;
|
|
37
|
+
shutdown(): Promise<void>;
|
|
38
|
+
getProvider(): SqliteStorageProvider;
|
|
39
|
+
getCapabilityProvider<K extends keyof CapabilityProviderMap>(name: K): CapabilityProviderMap[K] | null;
|
|
40
|
+
getConfigSchema(): ConfigUISchema;
|
|
41
|
+
getConfig(): Record<string, unknown>;
|
|
42
|
+
onConfigChange(_config: Record<string, unknown>): Promise<void>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Thin wrapper over better-sqlite3 that manages the four settings tables:
|
|
47
|
+
* system_settings, addon_settings, provider_settings, device_settings.
|
|
48
|
+
*
|
|
49
|
+
* All values are stored as JSON text and deserialized on read.
|
|
50
|
+
*/
|
|
51
|
+
declare class SettingsStore {
|
|
52
|
+
private readonly db;
|
|
53
|
+
constructor(dbPath: string);
|
|
54
|
+
getSystem(key: string): unknown;
|
|
55
|
+
setSystem(key: string, value: unknown): void;
|
|
56
|
+
getAllSystem(): Record<string, unknown>;
|
|
57
|
+
getAddon(addonId: string, key: string): unknown;
|
|
58
|
+
setAddon(addonId: string, key: string, value: unknown): void;
|
|
59
|
+
getAllAddon(addonId: string): Record<string, unknown>;
|
|
60
|
+
/** Bulk-replace all keys for an addon (within a transaction). */
|
|
61
|
+
setAllAddon(addonId: string, config: Record<string, unknown>): void;
|
|
62
|
+
getProvider(providerId: string, key: string): unknown;
|
|
63
|
+
setProvider(providerId: string, key: string, value: unknown): void;
|
|
64
|
+
getAllProvider(providerId: string): Record<string, unknown>;
|
|
65
|
+
getDevice(deviceId: string, key: string): unknown;
|
|
66
|
+
setDevice(deviceId: string, key: string, value: unknown): void;
|
|
67
|
+
getAllDevice(deviceId: string): Record<string, unknown>;
|
|
68
|
+
/** Close the SQLite connection (call on shutdown). */
|
|
69
|
+
close(): void;
|
|
70
|
+
/** Check if system_settings is empty (used for first-boot seeding). */
|
|
71
|
+
isSystemSettingsEmpty(): boolean;
|
|
72
|
+
/** Seed system_settings with RUNTIME_DEFAULTS (only on first boot). */
|
|
73
|
+
seedDefaults(): void;
|
|
74
|
+
private initTables;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** Core table DDL statements -- executed on first boot */
|
|
78
|
+
declare const CORE_TABLE_DDL: readonly string[];
|
|
79
|
+
/** Addon table schema declaration */
|
|
80
|
+
interface AddonTableSchema {
|
|
81
|
+
readonly name: string;
|
|
82
|
+
readonly columns: ReadonlyArray<{
|
|
83
|
+
readonly name: string;
|
|
84
|
+
readonly type: 'TEXT' | 'INTEGER' | 'REAL' | 'JSON';
|
|
85
|
+
readonly primaryKey?: boolean;
|
|
86
|
+
readonly notNull?: boolean;
|
|
87
|
+
}>;
|
|
88
|
+
readonly indexes?: ReadonlyArray<{
|
|
89
|
+
readonly name: string;
|
|
90
|
+
readonly columns: readonly string[];
|
|
91
|
+
readonly unique?: boolean;
|
|
92
|
+
}>;
|
|
93
|
+
}
|
|
94
|
+
/** Generate CREATE TABLE DDL from addon schema */
|
|
95
|
+
declare function addonTableToDdl(schema: AddonTableSchema): string[];
|
|
96
|
+
|
|
97
|
+
export { type AddonTableSchema as A, CORE_TABLE_DDL as C, FileSystemStorage as F, SettingsStore as S, SqliteStorageAddon as a, SqliteStorageProvider as b, addonTableToDdl as c };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { IFileStorage, StorageLocationName, IStorageLocation, ICamstackAddon, IConfigurable, AddonManifest, AddonContext, CapabilityProviderMap, ConfigUISchema } from '@camstack/types';
|
|
2
|
+
|
|
3
|
+
declare class FileSystemStorage implements IFileStorage {
|
|
4
|
+
private readonly basePath;
|
|
5
|
+
constructor(basePath: string);
|
|
6
|
+
readFile(filePath: string): Promise<Buffer>;
|
|
7
|
+
writeFile(filePath: string, data: Buffer): Promise<void>;
|
|
8
|
+
deleteFile(filePath: string): Promise<void>;
|
|
9
|
+
listFiles(prefix?: string): Promise<readonly string[]>;
|
|
10
|
+
getFileUrl(_path: string): Promise<string>;
|
|
11
|
+
exists(filePath: string): Promise<boolean>;
|
|
12
|
+
}
|
|
13
|
+
/** @deprecated Use FilesystemStorageProvider + SqliteSettingsBackend instead */
|
|
14
|
+
declare class SqliteStorageProvider {
|
|
15
|
+
private mainDb;
|
|
16
|
+
private sharedStructured;
|
|
17
|
+
private readonly locations;
|
|
18
|
+
initialize(): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Configure all storage locations.
|
|
21
|
+
* ONE single SQLite database (camstack.db) is used for ALL structured storage.
|
|
22
|
+
* File-based locations use the filesystem at their configured path.
|
|
23
|
+
*/
|
|
24
|
+
configure(config: {
|
|
25
|
+
locations: Record<string, string>;
|
|
26
|
+
}): Promise<void>;
|
|
27
|
+
getLocation(name: StorageLocationName): IStorageLocation;
|
|
28
|
+
shutdown(): Promise<void>;
|
|
29
|
+
export(_locationName: StorageLocationName): Promise<Buffer>;
|
|
30
|
+
import(_locationName: StorageLocationName, _data: Buffer): Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
declare class SqliteStorageAddon implements ICamstackAddon, IConfigurable {
|
|
34
|
+
readonly manifest: AddonManifest;
|
|
35
|
+
private provider;
|
|
36
|
+
initialize(context: AddonContext): Promise<void>;
|
|
37
|
+
shutdown(): Promise<void>;
|
|
38
|
+
getProvider(): SqliteStorageProvider;
|
|
39
|
+
getCapabilityProvider<K extends keyof CapabilityProviderMap>(name: K): CapabilityProviderMap[K] | null;
|
|
40
|
+
getConfigSchema(): ConfigUISchema;
|
|
41
|
+
getConfig(): Record<string, unknown>;
|
|
42
|
+
onConfigChange(_config: Record<string, unknown>): Promise<void>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Thin wrapper over better-sqlite3 that manages the four settings tables:
|
|
47
|
+
* system_settings, addon_settings, provider_settings, device_settings.
|
|
48
|
+
*
|
|
49
|
+
* All values are stored as JSON text and deserialized on read.
|
|
50
|
+
*/
|
|
51
|
+
declare class SettingsStore {
|
|
52
|
+
private readonly db;
|
|
53
|
+
constructor(dbPath: string);
|
|
54
|
+
getSystem(key: string): unknown;
|
|
55
|
+
setSystem(key: string, value: unknown): void;
|
|
56
|
+
getAllSystem(): Record<string, unknown>;
|
|
57
|
+
getAddon(addonId: string, key: string): unknown;
|
|
58
|
+
setAddon(addonId: string, key: string, value: unknown): void;
|
|
59
|
+
getAllAddon(addonId: string): Record<string, unknown>;
|
|
60
|
+
/** Bulk-replace all keys for an addon (within a transaction). */
|
|
61
|
+
setAllAddon(addonId: string, config: Record<string, unknown>): void;
|
|
62
|
+
getProvider(providerId: string, key: string): unknown;
|
|
63
|
+
setProvider(providerId: string, key: string, value: unknown): void;
|
|
64
|
+
getAllProvider(providerId: string): Record<string, unknown>;
|
|
65
|
+
getDevice(deviceId: string, key: string): unknown;
|
|
66
|
+
setDevice(deviceId: string, key: string, value: unknown): void;
|
|
67
|
+
getAllDevice(deviceId: string): Record<string, unknown>;
|
|
68
|
+
/** Close the SQLite connection (call on shutdown). */
|
|
69
|
+
close(): void;
|
|
70
|
+
/** Check if system_settings is empty (used for first-boot seeding). */
|
|
71
|
+
isSystemSettingsEmpty(): boolean;
|
|
72
|
+
/** Seed system_settings with RUNTIME_DEFAULTS (only on first boot). */
|
|
73
|
+
seedDefaults(): void;
|
|
74
|
+
private initTables;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** Core table DDL statements -- executed on first boot */
|
|
78
|
+
declare const CORE_TABLE_DDL: readonly string[];
|
|
79
|
+
/** Addon table schema declaration */
|
|
80
|
+
interface AddonTableSchema {
|
|
81
|
+
readonly name: string;
|
|
82
|
+
readonly columns: ReadonlyArray<{
|
|
83
|
+
readonly name: string;
|
|
84
|
+
readonly type: 'TEXT' | 'INTEGER' | 'REAL' | 'JSON';
|
|
85
|
+
readonly primaryKey?: boolean;
|
|
86
|
+
readonly notNull?: boolean;
|
|
87
|
+
}>;
|
|
88
|
+
readonly indexes?: ReadonlyArray<{
|
|
89
|
+
readonly name: string;
|
|
90
|
+
readonly columns: readonly string[];
|
|
91
|
+
readonly unique?: boolean;
|
|
92
|
+
}>;
|
|
93
|
+
}
|
|
94
|
+
/** Generate CREATE TABLE DDL from addon schema */
|
|
95
|
+
declare function addonTableToDdl(schema: AddonTableSchema): string[];
|
|
96
|
+
|
|
97
|
+
export { type AddonTableSchema as A, CORE_TABLE_DDL as C, FileSystemStorage as F, SettingsStore as S, SqliteStorageAddon as a, SqliteStorageProvider as b, addonTableToDdl as c };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { ISettingsBackend, SettingsCollection, QueryFilter, SettingsRecord, ICamstackAddon, IConfigurable, AddonManifest, AddonContext, CapabilityProviderMap, ConfigUISchema } from '@camstack/types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* SQLite implementation of ISettingsBackend.
|
|
5
|
+
*
|
|
6
|
+
* One table per collection, auto-created on first access.
|
|
7
|
+
* All data stored as JSON in a TEXT column.
|
|
8
|
+
* WAL mode for concurrent reads.
|
|
9
|
+
*/
|
|
10
|
+
declare class SqliteSettingsBackend implements ISettingsBackend {
|
|
11
|
+
private readonly dbPath;
|
|
12
|
+
private db;
|
|
13
|
+
private readonly ensuredTables;
|
|
14
|
+
private readonly runtimeDefaults;
|
|
15
|
+
constructor(dbPath: string, runtimeDefaults?: Record<string, unknown>);
|
|
16
|
+
initialize(): Promise<void>;
|
|
17
|
+
shutdown(): Promise<void>;
|
|
18
|
+
get(collection: SettingsCollection, key: string): Promise<unknown>;
|
|
19
|
+
set(collection: SettingsCollection, key: string, value: unknown): Promise<void>;
|
|
20
|
+
query(collection: SettingsCollection, filter?: QueryFilter): Promise<readonly SettingsRecord[]>;
|
|
21
|
+
insert(collection: SettingsCollection, record: SettingsRecord): Promise<void>;
|
|
22
|
+
update(collection: SettingsCollection, id: string, data: Record<string, unknown>): Promise<void>;
|
|
23
|
+
delete(collection: SettingsCollection, key: string): Promise<void>;
|
|
24
|
+
count(collection: SettingsCollection, filter?: QueryFilter): Promise<number>;
|
|
25
|
+
isEmpty(collection: SettingsCollection): Promise<boolean>;
|
|
26
|
+
/** Get a system setting by dot-notation key */
|
|
27
|
+
getSystem(key: string): unknown;
|
|
28
|
+
/** Set a system setting */
|
|
29
|
+
setSystem(key: string, value: unknown): void;
|
|
30
|
+
/** Get all system settings as flat key-value */
|
|
31
|
+
getAllSystem(): Record<string, unknown>;
|
|
32
|
+
/** Get all settings for an addon */
|
|
33
|
+
getAllAddon(addonId: string): Record<string, unknown>;
|
|
34
|
+
/** Bulk-set all settings for an addon */
|
|
35
|
+
setAllAddon(addonId: string, config: Record<string, unknown>): void;
|
|
36
|
+
/** Get all settings for a provider */
|
|
37
|
+
getAllProvider(providerId: string): Record<string, unknown>;
|
|
38
|
+
/** Set a provider setting */
|
|
39
|
+
setProvider(providerId: string, key: string, value: unknown): void;
|
|
40
|
+
/** Get all settings for a device */
|
|
41
|
+
getAllDevice(deviceId: string): Record<string, unknown>;
|
|
42
|
+
/** Set a device setting */
|
|
43
|
+
setDevice(deviceId: string, key: string, value: unknown): void;
|
|
44
|
+
/** Seed system-settings with runtime defaults (first boot) */
|
|
45
|
+
private seedDefaults;
|
|
46
|
+
private getDb;
|
|
47
|
+
private ensureTable;
|
|
48
|
+
private getAllScoped;
|
|
49
|
+
private setScopedKey;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* SQLite Settings addon — provides persistent settings storage.
|
|
54
|
+
* Capability: 'settings-store' (singleton)
|
|
55
|
+
*
|
|
56
|
+
* Depends on 'storage' capability for resolving the DB file path.
|
|
57
|
+
*/
|
|
58
|
+
declare class SqliteSettingsAddon implements ICamstackAddon, IConfigurable {
|
|
59
|
+
readonly manifest: AddonManifest;
|
|
60
|
+
private backend;
|
|
61
|
+
initialize(context: AddonContext): Promise<void>;
|
|
62
|
+
shutdown(): Promise<void>;
|
|
63
|
+
getBackend(): SqliteSettingsBackend | null;
|
|
64
|
+
getCapabilityProvider<K extends keyof CapabilityProviderMap>(name: K): CapabilityProviderMap[K] | null;
|
|
65
|
+
getConfigSchema(): ConfigUISchema;
|
|
66
|
+
getConfig(): Record<string, unknown>;
|
|
67
|
+
onConfigChange(_config: Record<string, unknown>): Promise<void>;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export { SqliteSettingsAddon as S, SqliteSettingsBackend as a };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { ISettingsBackend, SettingsCollection, QueryFilter, SettingsRecord, ICamstackAddon, IConfigurable, AddonManifest, AddonContext, CapabilityProviderMap, ConfigUISchema } from '@camstack/types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* SQLite implementation of ISettingsBackend.
|
|
5
|
+
*
|
|
6
|
+
* One table per collection, auto-created on first access.
|
|
7
|
+
* All data stored as JSON in a TEXT column.
|
|
8
|
+
* WAL mode for concurrent reads.
|
|
9
|
+
*/
|
|
10
|
+
declare class SqliteSettingsBackend implements ISettingsBackend {
|
|
11
|
+
private readonly dbPath;
|
|
12
|
+
private db;
|
|
13
|
+
private readonly ensuredTables;
|
|
14
|
+
private readonly runtimeDefaults;
|
|
15
|
+
constructor(dbPath: string, runtimeDefaults?: Record<string, unknown>);
|
|
16
|
+
initialize(): Promise<void>;
|
|
17
|
+
shutdown(): Promise<void>;
|
|
18
|
+
get(collection: SettingsCollection, key: string): Promise<unknown>;
|
|
19
|
+
set(collection: SettingsCollection, key: string, value: unknown): Promise<void>;
|
|
20
|
+
query(collection: SettingsCollection, filter?: QueryFilter): Promise<readonly SettingsRecord[]>;
|
|
21
|
+
insert(collection: SettingsCollection, record: SettingsRecord): Promise<void>;
|
|
22
|
+
update(collection: SettingsCollection, id: string, data: Record<string, unknown>): Promise<void>;
|
|
23
|
+
delete(collection: SettingsCollection, key: string): Promise<void>;
|
|
24
|
+
count(collection: SettingsCollection, filter?: QueryFilter): Promise<number>;
|
|
25
|
+
isEmpty(collection: SettingsCollection): Promise<boolean>;
|
|
26
|
+
/** Get a system setting by dot-notation key */
|
|
27
|
+
getSystem(key: string): unknown;
|
|
28
|
+
/** Set a system setting */
|
|
29
|
+
setSystem(key: string, value: unknown): void;
|
|
30
|
+
/** Get all system settings as flat key-value */
|
|
31
|
+
getAllSystem(): Record<string, unknown>;
|
|
32
|
+
/** Get all settings for an addon */
|
|
33
|
+
getAllAddon(addonId: string): Record<string, unknown>;
|
|
34
|
+
/** Bulk-set all settings for an addon */
|
|
35
|
+
setAllAddon(addonId: string, config: Record<string, unknown>): void;
|
|
36
|
+
/** Get all settings for a provider */
|
|
37
|
+
getAllProvider(providerId: string): Record<string, unknown>;
|
|
38
|
+
/** Set a provider setting */
|
|
39
|
+
setProvider(providerId: string, key: string, value: unknown): void;
|
|
40
|
+
/** Get all settings for a device */
|
|
41
|
+
getAllDevice(deviceId: string): Record<string, unknown>;
|
|
42
|
+
/** Set a device setting */
|
|
43
|
+
setDevice(deviceId: string, key: string, value: unknown): void;
|
|
44
|
+
/** Seed system-settings with runtime defaults (first boot) */
|
|
45
|
+
private seedDefaults;
|
|
46
|
+
private getDb;
|
|
47
|
+
private ensureTable;
|
|
48
|
+
private getAllScoped;
|
|
49
|
+
private setScopedKey;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* SQLite Settings addon — provides persistent settings storage.
|
|
54
|
+
* Capability: 'settings-store' (singleton)
|
|
55
|
+
*
|
|
56
|
+
* Depends on 'storage' capability for resolving the DB file path.
|
|
57
|
+
*/
|
|
58
|
+
declare class SqliteSettingsAddon implements ICamstackAddon, IConfigurable {
|
|
59
|
+
readonly manifest: AddonManifest;
|
|
60
|
+
private backend;
|
|
61
|
+
initialize(context: AddonContext): Promise<void>;
|
|
62
|
+
shutdown(): Promise<void>;
|
|
63
|
+
getBackend(): SqliteSettingsBackend | null;
|
|
64
|
+
getCapabilityProvider<K extends keyof CapabilityProviderMap>(name: K): CapabilityProviderMap[K] | null;
|
|
65
|
+
getConfigSchema(): ConfigUISchema;
|
|
66
|
+
getConfig(): Record<string, unknown>;
|
|
67
|
+
onConfigChange(_config: Record<string, unknown>): Promise<void>;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export { SqliteSettingsAddon as S, SqliteSettingsBackend as a };
|
package/dist/{storage-location-manager-F4YZMHGM.mjs → storage-location-manager-UQRGHTCA.mjs}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StorageLocationManager
|
|
3
3
|
} from "./chunk-2F3XZYRW.mjs";
|
|
4
|
-
import "./chunk-
|
|
4
|
+
import "./chunk-QEMJH3KY.mjs";
|
|
5
5
|
export {
|
|
6
6
|
StorageLocationManager
|
|
7
7
|
};
|
|
8
|
-
//# sourceMappingURL=storage-location-manager-
|
|
8
|
+
//# sourceMappingURL=storage-location-manager-UQRGHTCA.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
__commonJS,
|
|
3
3
|
__require,
|
|
4
4
|
__toESM
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-QEMJH3KY.mjs";
|
|
6
6
|
|
|
7
7
|
// ../../node_modules/ws/lib/constants.js
|
|
8
8
|
var require_constants = __commonJS({
|
|
@@ -3649,4 +3649,4 @@ export {
|
|
|
3649
3649
|
export_extension as extension,
|
|
3650
3650
|
export_subprotocol as subprotocol
|
|
3651
3651
|
};
|
|
3652
|
-
//# sourceMappingURL=wrapper-
|
|
3652
|
+
//# sourceMappingURL=wrapper-Y55ADNM5.mjs.map
|
package/package.json
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/core",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Core
|
|
5
|
-
"keywords": [
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "Core addon for CamStack — builtins, pipeline, process management, auth, logging, events",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"camstack",
|
|
7
|
+
"core",
|
|
8
|
+
"addon",
|
|
9
|
+
"camera",
|
|
10
|
+
"nvr"
|
|
11
|
+
],
|
|
6
12
|
"license": "MIT",
|
|
7
13
|
"repository": {
|
|
8
14
|
"type": "git",
|
|
@@ -12,14 +18,60 @@
|
|
|
12
18
|
"module": "./dist/index.mjs",
|
|
13
19
|
"types": "./dist/index.d.ts",
|
|
14
20
|
"exports": {
|
|
15
|
-
".": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"import": "./dist/index.mjs",
|
|
24
|
+
"require": "./dist/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./package.json": "./package.json"
|
|
16
27
|
},
|
|
17
28
|
"camstack": {
|
|
18
29
|
"addons": [
|
|
19
|
-
{
|
|
30
|
+
{
|
|
31
|
+
"id": "filesystem-storage",
|
|
32
|
+
"entry": "./dist/builtins/sqlite-storage/filesystem-storage.addon.js",
|
|
33
|
+
"capabilities": [
|
|
34
|
+
{
|
|
35
|
+
"name": "storage",
|
|
36
|
+
"mode": "collection"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"id": "sqlite-settings",
|
|
42
|
+
"entry": "./dist/builtins/sqlite-storage/sqlite-settings.addon.js",
|
|
43
|
+
"capabilities": [
|
|
44
|
+
{
|
|
45
|
+
"name": "settings-store",
|
|
46
|
+
"mode": "singleton"
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"id": "winston-logging",
|
|
52
|
+
"entry": "./dist/builtins/winston-logging/index.js",
|
|
53
|
+
"capabilities": [
|
|
54
|
+
{
|
|
55
|
+
"name": "log-destination",
|
|
56
|
+
"mode": "collection"
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"id": "local-backup",
|
|
62
|
+
"entry": "./dist/builtins/local-backup/index.js",
|
|
63
|
+
"capabilities": [
|
|
64
|
+
{
|
|
65
|
+
"name": "backup",
|
|
66
|
+
"mode": "collection"
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
}
|
|
20
70
|
]
|
|
21
71
|
},
|
|
22
|
-
"files": [
|
|
72
|
+
"files": [
|
|
73
|
+
"dist"
|
|
74
|
+
],
|
|
23
75
|
"scripts": {
|
|
24
76
|
"build": "tsup",
|
|
25
77
|
"dev": "tsup --watch",
|
|
@@ -28,20 +80,20 @@
|
|
|
28
80
|
"test:watch": "vitest"
|
|
29
81
|
},
|
|
30
82
|
"dependencies": {
|
|
83
|
+
"@camstack/kernel": "*",
|
|
31
84
|
"bcryptjs": "^2.4.3",
|
|
32
85
|
"better-sqlite3": "^12.8.0",
|
|
33
|
-
"js-yaml": "^4.1.0",
|
|
34
86
|
"jsonwebtoken": "^9.0.0",
|
|
87
|
+
"systeminformation": "^5.31.5",
|
|
35
88
|
"winston": "^3.19.0",
|
|
36
|
-
"winston-daily-rotate-file": "^5.0.0"
|
|
37
|
-
|
|
89
|
+
"winston-daily-rotate-file": "^5.0.0"
|
|
90
|
+
},
|
|
91
|
+
"peerDependencies": {
|
|
92
|
+
"@camstack/types": "^0.1.0"
|
|
38
93
|
},
|
|
39
|
-
"peerDependencies": { "@camstack/types": "^0.1.0" },
|
|
40
94
|
"devDependencies": {
|
|
41
95
|
"@camstack/types": "*",
|
|
42
96
|
"@types/bcryptjs": "^2.4.6",
|
|
43
|
-
"@types/better-sqlite3": "^7.6.13",
|
|
44
|
-
"@types/js-yaml": "^4.0.9",
|
|
45
97
|
"@types/jsonwebtoken": "^9.0.0",
|
|
46
98
|
"tsup": "^8.0.0",
|
|
47
99
|
"typescript": "~5.9.0",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|