@hamak/ui-store-api 0.3.0 → 0.4.1
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/CHANGELOG.md +18 -0
- package/dist/es2015/fs/contracts/filesystem-facade.contract.js +1 -0
- package/dist/es2015/fs/contracts/filesystem-manager.contract.js +1 -0
- package/dist/es2015/fs/index.js +4 -0
- package/dist/es2015/index.js +1 -0
- package/dist/fs/contracts/filesystem-facade.contract.d.ts +57 -0
- package/dist/fs/contracts/filesystem-facade.contract.d.ts.map +1 -0
- package/dist/fs/contracts/filesystem-facade.contract.js +1 -0
- package/dist/fs/contracts/filesystem-manager.contract.d.ts +41 -0
- package/dist/fs/contracts/filesystem-manager.contract.d.ts.map +1 -0
- package/dist/fs/contracts/filesystem-manager.contract.js +1 -0
- package/dist/fs/index.d.ts +5 -0
- package/dist/fs/index.d.ts.map +1 -0
- package/dist/fs/index.js +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/package.json +2 -1
- package/src/fs/contracts/filesystem-facade.contract.ts +67 -0
- package/src/fs/contracts/filesystem-manager.contract.ts +50 -0
- package/src/fs/index.ts +16 -0
- package/src/index.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
## 0.4.0 (2025-11-10)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- implement notification plugin with UI and backend components ([c19ffcf](https://github.com/amah/app-framework/commit/c19ffcf))
|
|
6
|
+
- add ES2015 build support and fix TypeScript config for logging packages ([be5e45e](https://github.com/amah/app-framework/commit/be5e45e))
|
|
7
|
+
- complete logging system build and add optional console interception ([f390bc6](https://github.com/amah/app-framework/commit/f390bc6))
|
|
8
|
+
- implement core pluggable logging system (Phase 1) ([2abdc1a](https://github.com/amah/app-framework/commit/2abdc1a))
|
|
9
|
+
|
|
10
|
+
### 🩹 Fixes
|
|
11
|
+
|
|
12
|
+
- add notification packages to workspaces ([97a234d](https://github.com/amah/app-framework/commit/97a234d))
|
|
13
|
+
|
|
14
|
+
### ❤️ Thank You
|
|
15
|
+
|
|
16
|
+
- Amah
|
|
17
|
+
- Claude
|
|
18
|
+
|
|
1
19
|
## 0.3.0 (2025-11-06)
|
|
2
20
|
|
|
3
21
|
### 🚀 Features
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/es2015/index.js
CHANGED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { FileSystemNode, DirectoryNode, FileNode, Path } from '@hamak/shared-utils';
|
|
2
|
+
/**
|
|
3
|
+
* High-level facade for filesystem operations
|
|
4
|
+
* Provides a convenient API over the filesystem manager
|
|
5
|
+
*/
|
|
6
|
+
export interface IFileSystemFacade {
|
|
7
|
+
/**
|
|
8
|
+
* Get the root directory node
|
|
9
|
+
*/
|
|
10
|
+
getRoot(): DirectoryNode;
|
|
11
|
+
/**
|
|
12
|
+
* Resolve a file or directory at the given path
|
|
13
|
+
*/
|
|
14
|
+
resolve(path: Path): FileSystemNode | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Resolve a file at the given path
|
|
17
|
+
*/
|
|
18
|
+
resolveFile<T = any>(path: Path): FileNode<T> | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Resolve a directory at the given path
|
|
21
|
+
*/
|
|
22
|
+
resolveDirectory(path: Path): DirectoryNode | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Create or update a file at the given path
|
|
25
|
+
*/
|
|
26
|
+
setFile<T = any>(path: Path, content: T, schema?: string, params?: {
|
|
27
|
+
override?: boolean;
|
|
28
|
+
contentIsPresent?: boolean;
|
|
29
|
+
}): void;
|
|
30
|
+
/**
|
|
31
|
+
* Update file content at the given path
|
|
32
|
+
*/
|
|
33
|
+
updateFileContent<T = any>(path: Path, content: T): void;
|
|
34
|
+
/**
|
|
35
|
+
* Create a directory at the given path
|
|
36
|
+
*/
|
|
37
|
+
mkdir(path: Path, params?: {
|
|
38
|
+
override?: boolean;
|
|
39
|
+
}): void;
|
|
40
|
+
/**
|
|
41
|
+
* Remove a file or directory at the given path
|
|
42
|
+
*/
|
|
43
|
+
remove(path: Path): void;
|
|
44
|
+
/**
|
|
45
|
+
* Check if a path exists
|
|
46
|
+
*/
|
|
47
|
+
exists(path: Path): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Check if a path is a file
|
|
50
|
+
*/
|
|
51
|
+
isFile(path: Path): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Check if a path is a directory
|
|
54
|
+
*/
|
|
55
|
+
isDirectory(path: Path): boolean;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=filesystem-facade.contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filesystem-facade.contract.d.ts","sourceRoot":"","sources":["../../../src/fs/contracts/filesystem-facade.contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAEpF;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,OAAO,IAAI,aAAa,CAAC;IAEzB;;OAEG;IACH,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,cAAc,GAAG,SAAS,CAAC;IAEhD;;OAEG;IACH,WAAW,CAAC,CAAC,GAAG,GAAG,EAAE,IAAI,EAAE,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IAE1D;;OAEG;IACH,gBAAgB,CAAC,IAAI,EAAE,IAAI,GAAG,aAAa,GAAG,SAAS,CAAC;IAExD;;OAEG;IACH,OAAO,CAAC,CAAC,GAAG,GAAG,EACb,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,CAAC,EACV,MAAM,CAAC,EAAE,MAAM,EACf,MAAM,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;QAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;KAAE,GAC1D,IAAI,CAAC;IAER;;OAEG;IACH,iBAAiB,CAAC,CAAC,GAAG,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC;IAEzD;;OAEG;IACH,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IAEzD;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAEzB;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC;IAE5B;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC;IAE5B;;OAEG;IACH,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC;CAClC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { FileSystemNode, FileSystemState } from '@hamak/shared-utils';
|
|
2
|
+
import { Action } from 'redux';
|
|
3
|
+
/**
|
|
4
|
+
* Redux selector function type
|
|
5
|
+
*/
|
|
6
|
+
export type Selector<S, R> = (state: S) => R;
|
|
7
|
+
/**
|
|
8
|
+
* Actions for filesystem operations
|
|
9
|
+
*/
|
|
10
|
+
export interface FileSystemNodeAction extends Action {
|
|
11
|
+
command: any;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Parameters for filesystem node actions
|
|
15
|
+
*/
|
|
16
|
+
export interface FileSystemNodeActionParams {
|
|
17
|
+
override?: boolean;
|
|
18
|
+
contentIsPresent?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Filesystem manager interface - manages Redux state for virtual filesystem
|
|
22
|
+
*/
|
|
23
|
+
export interface IFileSystemManager {
|
|
24
|
+
/**
|
|
25
|
+
* Get the slice name for this filesystem
|
|
26
|
+
*/
|
|
27
|
+
readonly sliceName: string;
|
|
28
|
+
/**
|
|
29
|
+
* Get initial filesystem state
|
|
30
|
+
*/
|
|
31
|
+
getInitialState(): FileSystemState;
|
|
32
|
+
/**
|
|
33
|
+
* Get the reducer function for filesystem operations
|
|
34
|
+
*/
|
|
35
|
+
getReducer(): (state: FileSystemState, action: Action) => FileSystemState;
|
|
36
|
+
/**
|
|
37
|
+
* Create a selector for a specific path in the filesystem
|
|
38
|
+
*/
|
|
39
|
+
createSelector<S>(fileSystemSelector: Selector<S, FileSystemState | undefined>, path: string | string[]): Selector<S, FileSystemNode | undefined>;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=filesystem-manager.contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filesystem-manager.contract.d.ts","sourceRoot":"","sources":["../../../src/fs/contracts/filesystem-manager.contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAA2B,eAAe,EAAQ,MAAM,qBAAqB,CAAC;AACrG,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B;;GAEG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,MAAM;IAClD,OAAO,EAAE,GAAG,CAAA;CACb;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,eAAe,IAAI,eAAe,CAAC;IAEnC;;OAEG;IACH,UAAU,IAAI,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,KAAK,eAAe,CAAC;IAE1E;;OAEG;IACH,cAAc,CAAC,CAAC,EACd,kBAAkB,EAAE,QAAQ,CAAC,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC,EAC5D,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,GACtB,QAAQ,CAAC,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC,CAAC;CAC5C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { FileSystemNode, DirectoryNode, FileNode, FileSystemNodeBase, FileSystemNodeState, FileMemoState, FileSystemState, FileContentSchema } from '@hamak/shared-utils';
|
|
2
|
+
export { fileSystemNodeInitialState } from '@hamak/shared-utils';
|
|
3
|
+
export * from './contracts/filesystem-manager.contract';
|
|
4
|
+
export * from './contracts/filesystem-facade.contract';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fs/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,cAAc,EACd,aAAa,EACb,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACb,eAAe,EACf,iBAAiB,EAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAGjE,cAAc,yCAAyC,CAAC;AACxD,cAAc,wCAAwC,CAAC"}
|
package/dist/fs/index.js
ADDED
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,MAAM,CAAC"}
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hamak/ui-store-api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "UI Store API - Redux store interfaces and contracts",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
+
"@hamak/shared-utils": "0.4.1",
|
|
37
38
|
"redux": "^5.0.1"
|
|
38
39
|
},
|
|
39
40
|
"devDependencies": {
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { FileSystemNode, DirectoryNode, FileNode, Path } from '@hamak/shared-utils';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* High-level facade for filesystem operations
|
|
5
|
+
* Provides a convenient API over the filesystem manager
|
|
6
|
+
*/
|
|
7
|
+
export interface IFileSystemFacade {
|
|
8
|
+
/**
|
|
9
|
+
* Get the root directory node
|
|
10
|
+
*/
|
|
11
|
+
getRoot(): DirectoryNode;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Resolve a file or directory at the given path
|
|
15
|
+
*/
|
|
16
|
+
resolve(path: Path): FileSystemNode | undefined;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Resolve a file at the given path
|
|
20
|
+
*/
|
|
21
|
+
resolveFile<T = any>(path: Path): FileNode<T> | undefined;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Resolve a directory at the given path
|
|
25
|
+
*/
|
|
26
|
+
resolveDirectory(path: Path): DirectoryNode | undefined;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Create or update a file at the given path
|
|
30
|
+
*/
|
|
31
|
+
setFile<T = any>(
|
|
32
|
+
path: Path,
|
|
33
|
+
content: T,
|
|
34
|
+
schema?: string,
|
|
35
|
+
params?: { override?: boolean; contentIsPresent?: boolean }
|
|
36
|
+
): void;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Update file content at the given path
|
|
40
|
+
*/
|
|
41
|
+
updateFileContent<T = any>(path: Path, content: T): void;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Create a directory at the given path
|
|
45
|
+
*/
|
|
46
|
+
mkdir(path: Path, params?: { override?: boolean }): void;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Remove a file or directory at the given path
|
|
50
|
+
*/
|
|
51
|
+
remove(path: Path): void;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Check if a path exists
|
|
55
|
+
*/
|
|
56
|
+
exists(path: Path): boolean;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Check if a path is a file
|
|
60
|
+
*/
|
|
61
|
+
isFile(path: Path): boolean;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Check if a path is a directory
|
|
65
|
+
*/
|
|
66
|
+
isDirectory(path: Path): boolean;
|
|
67
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { FileSystemNode, DirectoryNode, FileNode, FileSystemState, Path } from '@hamak/shared-utils';
|
|
2
|
+
import { Action } from 'redux';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Redux selector function type
|
|
6
|
+
*/
|
|
7
|
+
export type Selector<S, R> = (state: S) => R;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Actions for filesystem operations
|
|
11
|
+
*/
|
|
12
|
+
export interface FileSystemNodeAction extends Action {
|
|
13
|
+
command: any // Will be typed more specifically in implementation
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Parameters for filesystem node actions
|
|
18
|
+
*/
|
|
19
|
+
export interface FileSystemNodeActionParams {
|
|
20
|
+
override?: boolean
|
|
21
|
+
contentIsPresent?: boolean
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Filesystem manager interface - manages Redux state for virtual filesystem
|
|
26
|
+
*/
|
|
27
|
+
export interface IFileSystemManager {
|
|
28
|
+
/**
|
|
29
|
+
* Get the slice name for this filesystem
|
|
30
|
+
*/
|
|
31
|
+
readonly sliceName: string;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Get initial filesystem state
|
|
35
|
+
*/
|
|
36
|
+
getInitialState(): FileSystemState;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Get the reducer function for filesystem operations
|
|
40
|
+
*/
|
|
41
|
+
getReducer(): (state: FileSystemState, action: Action) => FileSystemState;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Create a selector for a specific path in the filesystem
|
|
45
|
+
*/
|
|
46
|
+
createSelector<S>(
|
|
47
|
+
fileSystemSelector: Selector<S, FileSystemState | undefined>,
|
|
48
|
+
path: string | string[]
|
|
49
|
+
): Selector<S, FileSystemNode | undefined>;
|
|
50
|
+
}
|
package/src/fs/index.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Re-export filesystem types from shared-utils
|
|
2
|
+
export type {
|
|
3
|
+
FileSystemNode,
|
|
4
|
+
DirectoryNode,
|
|
5
|
+
FileNode,
|
|
6
|
+
FileSystemNodeBase,
|
|
7
|
+
FileSystemNodeState,
|
|
8
|
+
FileMemoState,
|
|
9
|
+
FileSystemState,
|
|
10
|
+
FileContentSchema
|
|
11
|
+
} from '@hamak/shared-utils';
|
|
12
|
+
export { fileSystemNodeInitialState } from '@hamak/shared-utils';
|
|
13
|
+
|
|
14
|
+
// Filesystem contracts
|
|
15
|
+
export * from './contracts/filesystem-manager.contract';
|
|
16
|
+
export * from './contracts/filesystem-facade.contract';
|
package/src/index.ts
CHANGED