@fgv/ts-http-storage 5.1.0-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/.rush/temp/chunked-rush-logs/ts-http-storage.build.chunks.jsonl +9 -0
- package/.rush/temp/fbfcc9487d290993ba47f1d36e9383196e7b12ac.tar.log +61 -0
- package/.rush/temp/operation/build/all.log +9 -0
- package/.rush/temp/operation/build/log-chunks.jsonl +9 -0
- package/.rush/temp/operation/build/state.json +3 -0
- package/.rush/temp/shrinkwrap-deps.json +647 -0
- package/config/api-extractor.json +36 -0
- package/config/rig.json +10 -0
- package/config/typedoc.json +7 -0
- package/dist/ts-http-storage.d.ts +225 -0
- package/dist/tsdoc-metadata.json +11 -0
- package/docs/README.md +298 -0
- package/docs/classes/FsStorageProvider.createDirectory.md +20 -0
- package/docs/classes/FsStorageProvider.getChildren.md +20 -0
- package/docs/classes/FsStorageProvider.getFile.md +20 -0
- package/docs/classes/FsStorageProvider.getItem.md +20 -0
- package/docs/classes/FsStorageProvider.md +134 -0
- package/docs/classes/FsStorageProvider.saveFile.md +22 -0
- package/docs/classes/FsStorageProvider.sync.md +13 -0
- package/docs/classes/FsStorageProviderFactory.forNamespace.md +20 -0
- package/docs/classes/FsStorageProviderFactory.md +69 -0
- package/docs/classes/HttpStorageService.createDirectory.md +20 -0
- package/docs/classes/HttpStorageService.getChildren.md +20 -0
- package/docs/classes/HttpStorageService.getFile.md +20 -0
- package/docs/classes/HttpStorageService.getItem.md +20 -0
- package/docs/classes/HttpStorageService.md +132 -0
- package/docs/classes/HttpStorageService.saveFile.md +20 -0
- package/docs/classes/HttpStorageService.sync.md +20 -0
- package/docs/functions/createStorageRoutes.md +11 -0
- package/docs/functions/normalizeRequestPath.md +11 -0
- package/docs/functions/sanitizeNamespace.md +11 -0
- package/docs/interfaces/ICreateStorageRoutesOptions.logger.md +9 -0
- package/docs/interfaces/ICreateStorageRoutesOptions.md +61 -0
- package/docs/interfaces/ICreateStorageRoutesOptions.providers.md +9 -0
- package/docs/interfaces/IFsStorageProviderFactoryOptions.md +44 -0
- package/docs/interfaces/IFsStorageProviderFactoryOptions.rootPath.md +9 -0
- package/docs/interfaces/IHttpStorageProvider.createDirectory.md +20 -0
- package/docs/interfaces/IHttpStorageProvider.getChildren.md +20 -0
- package/docs/interfaces/IHttpStorageProvider.getFile.md +20 -0
- package/docs/interfaces/IHttpStorageProvider.getItem.md +20 -0
- package/docs/interfaces/IHttpStorageProvider.md +102 -0
- package/docs/interfaces/IHttpStorageProvider.saveFile.md +22 -0
- package/docs/interfaces/IHttpStorageProvider.sync.md +13 -0
- package/docs/interfaces/IHttpStorageProviderFactory.forNamespace.md +20 -0
- package/docs/interfaces/IHttpStorageProviderFactory.md +36 -0
- package/docs/interfaces/IStorageFileResponse.contentType.md +9 -0
- package/docs/interfaces/IStorageFileResponse.contents.md +9 -0
- package/docs/interfaces/IStorageFileResponse.md +78 -0
- package/docs/interfaces/IStorageFileResponse.path.md +9 -0
- package/docs/interfaces/IStoragePathRequest.md +61 -0
- package/docs/interfaces/IStoragePathRequest.namespace.md +9 -0
- package/docs/interfaces/IStoragePathRequest.path.md +9 -0
- package/docs/interfaces/IStorageSyncRequest.md +44 -0
- package/docs/interfaces/IStorageSyncRequest.namespace.md +9 -0
- package/docs/interfaces/IStorageSyncResponse.md +44 -0
- package/docs/interfaces/IStorageSyncResponse.synced.md +9 -0
- package/docs/interfaces/IStorageTreeChildrenResponse.children.md +9 -0
- package/docs/interfaces/IStorageTreeChildrenResponse.md +61 -0
- package/docs/interfaces/IStorageTreeChildrenResponse.path.md +9 -0
- package/docs/interfaces/IStorageTreeItem.md +78 -0
- package/docs/interfaces/IStorageTreeItem.name.md +9 -0
- package/docs/interfaces/IStorageTreeItem.path.md +9 -0
- package/docs/interfaces/IStorageTreeItem.type.md +9 -0
- package/docs/interfaces/IStorageWriteFileRequest.contentType.md +9 -0
- package/docs/interfaces/IStorageWriteFileRequest.contents.md +9 -0
- package/docs/interfaces/IStorageWriteFileRequest.md +97 -0
- package/docs/type-aliases/StorageItemType.md +11 -0
- package/docs/type-aliases/StorageNamespace.md +11 -0
- package/docs/variables/storageFileResponse.md +9 -0
- package/docs/variables/storagePathRequest.md +9 -0
- package/docs/variables/storageSyncRequest.md +9 -0
- package/docs/variables/storageTreeChildrenResponse.md +9 -0
- package/docs/variables/storageTreeItem.md +9 -0
- package/docs/variables/storageWriteFileRequest.md +9 -0
- package/etc/ts-http-storage.api.md +184 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +43 -0
- package/lib/index.js.map +1 -0
- package/lib/packlets/storage/converters.d.ts +33 -0
- package/lib/packlets/storage/converters.d.ts.map +1 -0
- package/lib/packlets/storage/converters.js +81 -0
- package/lib/packlets/storage/converters.js.map +1 -0
- package/lib/packlets/storage/fsProvider.d.ts +47 -0
- package/lib/packlets/storage/fsProvider.d.ts.map +1 -0
- package/lib/packlets/storage/fsProvider.js +260 -0
- package/lib/packlets/storage/fsProvider.js.map +1 -0
- package/lib/packlets/storage/index.d.ts +11 -0
- package/lib/packlets/storage/index.d.ts.map +1 -0
- package/lib/packlets/storage/index.js +48 -0
- package/lib/packlets/storage/index.js.map +1 -0
- package/lib/packlets/storage/model.d.ts +82 -0
- package/lib/packlets/storage/model.d.ts.map +1 -0
- package/lib/packlets/storage/model.js +24 -0
- package/lib/packlets/storage/model.js.map +1 -0
- package/lib/packlets/storage/provider.d.ts +10 -0
- package/lib/packlets/storage/provider.d.ts.map +1 -0
- package/lib/packlets/storage/provider.js +24 -0
- package/lib/packlets/storage/provider.js.map +1 -0
- package/lib/packlets/storage/routes.d.ts +17 -0
- package/lib/packlets/storage/routes.d.ts.map +1 -0
- package/lib/packlets/storage/routes.js +170 -0
- package/lib/packlets/storage/routes.js.map +1 -0
- package/lib/packlets/storage/service.d.ts +20 -0
- package/lib/packlets/storage/service.d.ts.map +1 -0
- package/lib/packlets/storage/service.js +95 -0
- package/lib/packlets/storage/service.js.map +1 -0
- package/lib/test/unit/storage/fsProvider.test.d.ts +2 -0
- package/lib/test/unit/storage/fsProvider.test.d.ts.map +1 -0
- package/lib/test/unit/storage/fsProvider.test.js +106 -0
- package/lib/test/unit/storage/fsProvider.test.js.map +1 -0
- package/lib/test/unit/storage/routes.test.d.ts +2 -0
- package/lib/test/unit/storage/routes.test.d.ts.map +1 -0
- package/lib/test/unit/storage/routes.test.js +124 -0
- package/lib/test/unit/storage/routes.test.js.map +1 -0
- package/lib/test/unit/storage/service.test.d.ts +2 -0
- package/lib/test/unit/storage/service.test.d.ts.map +1 -0
- package/lib/test/unit/storage/service.test.js +67 -0
- package/lib/test/unit/storage/service.test.js.map +1 -0
- package/package.json +66 -0
- package/rush-logs/ts-http-storage.build.cache.log +3 -0
- package/rush-logs/ts-http-storage.build.log +9 -0
- package/src/index.ts +28 -0
- package/src/packlets/storage/converters.ts +100 -0
- package/src/packlets/storage/fsProvider.ts +263 -0
- package/src/packlets/storage/index.ts +33 -0
- package/src/packlets/storage/model.ts +113 -0
- package/src/packlets/storage/provider.ts +33 -0
- package/src/packlets/storage/routes.ts +215 -0
- package/src/packlets/storage/service.ts +114 -0
- package/src/test/unit/storage/fsProvider.test.ts +129 -0
- package/src/test/unit/storage/routes.test.ts +165 -0
- package/src/test/unit/storage/service.test.ts +95 -0
- package/temp/build/typescript/ts_l9Fw4VUO.json +1 -0
- package/temp/ts-http-storage.api.json +3103 -0
- package/temp/ts-http-storage.api.md +184 -0
- package/tsconfig.json +7 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"projectFolder": "..",
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/lib/index.d.ts",
|
|
5
|
+
"bundledPackages": [],
|
|
6
|
+
"apiReport": {
|
|
7
|
+
"enabled": true
|
|
8
|
+
},
|
|
9
|
+
"docModel": {
|
|
10
|
+
"enabled": true
|
|
11
|
+
},
|
|
12
|
+
"dtsRollup": {
|
|
13
|
+
"enabled": true
|
|
14
|
+
},
|
|
15
|
+
"messages": {
|
|
16
|
+
"compilerMessageReporting": {
|
|
17
|
+
"default": {
|
|
18
|
+
"logLevel": "warning"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"extractorMessageReporting": {
|
|
22
|
+
"default": {
|
|
23
|
+
"logLevel": "warning"
|
|
24
|
+
},
|
|
25
|
+
"ae-unresolved-link": {
|
|
26
|
+
"logLevel": "none",
|
|
27
|
+
"addToApiReportFile": true
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"tsdocMessageReporting": {
|
|
31
|
+
"default": {
|
|
32
|
+
"logLevel": "warning"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
package/config/rig.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// The "rig.json" file directs tools to look for their config files in an external package.
|
|
2
|
+
// Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package
|
|
3
|
+
{
|
|
4
|
+
"$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json",
|
|
5
|
+
/**
|
|
6
|
+
* (Required) The name of the rig package to inherit from.
|
|
7
|
+
* It should be an NPM package name with the "-rig" suffix.
|
|
8
|
+
*/
|
|
9
|
+
"rigPackageName": "@rushstack/heft-node-rig"
|
|
10
|
+
}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reusable HTTP storage services for FileTree-style backends.
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { Converter } from '@fgv/ts-utils';
|
|
7
|
+
import { Hono } from 'hono';
|
|
8
|
+
import type { Logging } from '@fgv/ts-utils';
|
|
9
|
+
import { Result } from '@fgv/ts-utils';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Builds storage routes for a Hono app.
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export declare function createStorageRoutes(options: ICreateStorageRoutesOptions): Hono;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Filesystem-backed implementation of {@link IHttpStorageProvider}.
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export declare class FsStorageProvider implements IHttpStorageProvider {
|
|
22
|
+
private readonly _rootPath;
|
|
23
|
+
constructor(rootPath: string);
|
|
24
|
+
getItem(itemPath: string): Promise<Result<IStorageTreeItem>>;
|
|
25
|
+
getChildren(itemPath: string): Promise<Result<ReadonlyArray<IStorageTreeItem>>>;
|
|
26
|
+
getFile(itemPath: string): Promise<Result<IStorageFileResponse>>;
|
|
27
|
+
saveFile(itemPath: string, contents: string, contentType?: string): Promise<Result<IStorageFileResponse>>;
|
|
28
|
+
deleteFile(itemPath: string): Promise<Result<boolean>>;
|
|
29
|
+
createDirectory(itemPath: string): Promise<Result<IStorageTreeItem>>;
|
|
30
|
+
sync(): Promise<Result<IStorageSyncResponse>>;
|
|
31
|
+
private _resolveAbsolutePath;
|
|
32
|
+
private _toTreeItem;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Namespace-aware provider factory backed by filesystem directories.
|
|
37
|
+
* @public
|
|
38
|
+
*/
|
|
39
|
+
export declare class FsStorageProviderFactory implements IHttpStorageProviderFactory {
|
|
40
|
+
private readonly _rootPath;
|
|
41
|
+
constructor(options: IFsStorageProviderFactoryOptions);
|
|
42
|
+
forNamespace(namespace?: string): Result<IHttpStorageProvider>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Service layer for storage API operations.
|
|
47
|
+
* @public
|
|
48
|
+
*/
|
|
49
|
+
export declare class HttpStorageService {
|
|
50
|
+
private readonly _providers;
|
|
51
|
+
constructor(providers: IHttpStorageProviderFactory);
|
|
52
|
+
getItem(request: IStoragePathRequest): Promise<Result<IStorageTreeItem>>;
|
|
53
|
+
getChildren(request: IStoragePathRequest): Promise<Result<IStorageTreeChildrenResponse>>;
|
|
54
|
+
getFile(request: IStoragePathRequest): Promise<Result<IStorageFileResponse>>;
|
|
55
|
+
saveFile(request: IStorageWriteFileRequest): Promise<Result<IStorageFileResponse>>;
|
|
56
|
+
deleteFile(request: IStoragePathRequest): Promise<Result<boolean>>;
|
|
57
|
+
createDirectory(request: IStoragePathRequest): Promise<Result<IStorageTreeItem>>;
|
|
58
|
+
sync(request: IStorageSyncRequest): Promise<Result<IStorageSyncResponse>>;
|
|
59
|
+
private _getProvider;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Options for creating storage routes.
|
|
64
|
+
* @public
|
|
65
|
+
*/
|
|
66
|
+
export declare interface ICreateStorageRoutesOptions {
|
|
67
|
+
readonly providers: IHttpStorageProviderFactory;
|
|
68
|
+
readonly logger?: Logging.ILogger;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Options for creating filesystem-backed storage providers.
|
|
73
|
+
* @public
|
|
74
|
+
*/
|
|
75
|
+
export declare interface IFsStorageProviderFactoryOptions {
|
|
76
|
+
readonly rootPath: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Provider contract for storage backends.
|
|
81
|
+
* All methods are async to support both filesystem and database backends.
|
|
82
|
+
* @public
|
|
83
|
+
*/
|
|
84
|
+
export declare interface IHttpStorageProvider {
|
|
85
|
+
getItem(path: string): Promise<Result<IStorageTreeItem>>;
|
|
86
|
+
getChildren(path: string): Promise<Result<ReadonlyArray<IStorageTreeItem>>>;
|
|
87
|
+
getFile(path: string): Promise<Result<IStorageFileResponse>>;
|
|
88
|
+
saveFile(path: string, contents: string, contentType?: string): Promise<Result<IStorageFileResponse>>;
|
|
89
|
+
deleteFile(path: string): Promise<Result<boolean>>;
|
|
90
|
+
createDirectory(path: string): Promise<Result<IStorageTreeItem>>;
|
|
91
|
+
sync(): Promise<Result<IStorageSyncResponse>>;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Factory for creating namespace-scoped storage providers.
|
|
96
|
+
* @public
|
|
97
|
+
*/
|
|
98
|
+
export declare interface IHttpStorageProviderFactory {
|
|
99
|
+
forNamespace(namespace?: StorageNamespace): Result<IHttpStorageProvider>;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Response for reading a file.
|
|
104
|
+
* @public
|
|
105
|
+
*/
|
|
106
|
+
export declare interface IStorageFileResponse {
|
|
107
|
+
readonly path: string;
|
|
108
|
+
readonly contents: string;
|
|
109
|
+
readonly contentType?: string;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Request for path-based operations.
|
|
114
|
+
* @public
|
|
115
|
+
*/
|
|
116
|
+
export declare interface IStoragePathRequest {
|
|
117
|
+
readonly path: string;
|
|
118
|
+
readonly namespace?: StorageNamespace;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Request for sync operation.
|
|
123
|
+
* @public
|
|
124
|
+
*/
|
|
125
|
+
export declare interface IStorageSyncRequest {
|
|
126
|
+
readonly namespace?: StorageNamespace;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Sync response metadata.
|
|
131
|
+
* @public
|
|
132
|
+
*/
|
|
133
|
+
export declare interface IStorageSyncResponse {
|
|
134
|
+
readonly synced: number;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Response for listing children.
|
|
139
|
+
* @public
|
|
140
|
+
*/
|
|
141
|
+
export declare interface IStorageTreeChildrenResponse {
|
|
142
|
+
readonly path: string;
|
|
143
|
+
readonly children: ReadonlyArray<IStorageTreeItem>;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Storage tree item metadata.
|
|
148
|
+
* @public
|
|
149
|
+
*/
|
|
150
|
+
export declare interface IStorageTreeItem {
|
|
151
|
+
readonly path: string;
|
|
152
|
+
readonly name: string;
|
|
153
|
+
readonly type: StorageItemType;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Request for writing file contents.
|
|
158
|
+
* @public
|
|
159
|
+
*/
|
|
160
|
+
export declare interface IStorageWriteFileRequest extends IStoragePathRequest {
|
|
161
|
+
readonly contents: string;
|
|
162
|
+
readonly contentType?: string;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Normalizes a request path to a consistent POSIX format.
|
|
167
|
+
* @public
|
|
168
|
+
*/
|
|
169
|
+
export declare function normalizeRequestPath(requestPath: string): string;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Sanitize namespace path segment.
|
|
173
|
+
* @public
|
|
174
|
+
*/
|
|
175
|
+
export declare function sanitizeNamespace(namespace?: string): Result<string>;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Converter for file responses.
|
|
179
|
+
* @public
|
|
180
|
+
*/
|
|
181
|
+
export declare const storageFileResponse: Converter<IStorageFileResponse>;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Storage item type.
|
|
185
|
+
* @public
|
|
186
|
+
*/
|
|
187
|
+
export declare type StorageItemType = 'file' | 'directory';
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Namespace identifier for scoped storage.
|
|
191
|
+
* @public
|
|
192
|
+
*/
|
|
193
|
+
export declare type StorageNamespace = string;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Converter for path-based requests.
|
|
197
|
+
* @public
|
|
198
|
+
*/
|
|
199
|
+
export declare const storagePathRequest: Converter<IStoragePathRequest>;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Converter for sync requests.
|
|
203
|
+
* @public
|
|
204
|
+
*/
|
|
205
|
+
export declare const storageSyncRequest: Converter<IStorageSyncRequest>;
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Converter for children list responses.
|
|
209
|
+
* @public
|
|
210
|
+
*/
|
|
211
|
+
export declare const storageTreeChildrenResponse: Converter<IStorageTreeChildrenResponse>;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Converter for {@link IStorageTreeItem}.
|
|
215
|
+
* @public
|
|
216
|
+
*/
|
|
217
|
+
export declare const storageTreeItem: Converter<IStorageTreeItem>;
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Converter for write-file requests.
|
|
221
|
+
* @public
|
|
222
|
+
*/
|
|
223
|
+
export declare const storageWriteFileRequest: Converter<IStorageWriteFileRequest>;
|
|
224
|
+
|
|
225
|
+
export { }
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
+
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
+
{
|
|
4
|
+
"tsdocVersion": "0.12",
|
|
5
|
+
"toolPackages": [
|
|
6
|
+
{
|
|
7
|
+
"packageName": "@microsoft/api-extractor",
|
|
8
|
+
"packageVersion": "7.57.6"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
package/docs/README.md
ADDED
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
# @fgv/ts-http-storage
|
|
2
|
+
|
|
3
|
+
Reusable HTTP storage services for FileTree-style backends.
|
|
4
|
+
|
|
5
|
+
## Classes
|
|
6
|
+
|
|
7
|
+
<table><thead><tr><th>
|
|
8
|
+
|
|
9
|
+
Name
|
|
10
|
+
|
|
11
|
+
</th><th>
|
|
12
|
+
|
|
13
|
+
Description
|
|
14
|
+
|
|
15
|
+
</th></tr></thead>
|
|
16
|
+
<tbody>
|
|
17
|
+
<tr><td>
|
|
18
|
+
|
|
19
|
+
[FsStorageProvider](./classes/FsStorageProvider.md)
|
|
20
|
+
|
|
21
|
+
</td><td>
|
|
22
|
+
|
|
23
|
+
Filesystem-backed implementation of IHttpStorageProvider.
|
|
24
|
+
|
|
25
|
+
</td></tr>
|
|
26
|
+
<tr><td>
|
|
27
|
+
|
|
28
|
+
[FsStorageProviderFactory](./classes/FsStorageProviderFactory.md)
|
|
29
|
+
|
|
30
|
+
</td><td>
|
|
31
|
+
|
|
32
|
+
Namespace-aware provider factory backed by filesystem directories.
|
|
33
|
+
|
|
34
|
+
</td></tr>
|
|
35
|
+
<tr><td>
|
|
36
|
+
|
|
37
|
+
[HttpStorageService](./classes/HttpStorageService.md)
|
|
38
|
+
|
|
39
|
+
</td><td>
|
|
40
|
+
|
|
41
|
+
Service layer for storage API operations.
|
|
42
|
+
|
|
43
|
+
</td></tr>
|
|
44
|
+
</tbody></table>
|
|
45
|
+
|
|
46
|
+
## Interfaces
|
|
47
|
+
|
|
48
|
+
<table><thead><tr><th>
|
|
49
|
+
|
|
50
|
+
Name
|
|
51
|
+
|
|
52
|
+
</th><th>
|
|
53
|
+
|
|
54
|
+
Description
|
|
55
|
+
|
|
56
|
+
</th></tr></thead>
|
|
57
|
+
<tbody>
|
|
58
|
+
<tr><td>
|
|
59
|
+
|
|
60
|
+
[IStorageTreeItem](./interfaces/IStorageTreeItem.md)
|
|
61
|
+
|
|
62
|
+
</td><td>
|
|
63
|
+
|
|
64
|
+
Storage tree item metadata.
|
|
65
|
+
|
|
66
|
+
</td></tr>
|
|
67
|
+
<tr><td>
|
|
68
|
+
|
|
69
|
+
[IStorageTreeChildrenResponse](./interfaces/IStorageTreeChildrenResponse.md)
|
|
70
|
+
|
|
71
|
+
</td><td>
|
|
72
|
+
|
|
73
|
+
Response for listing children.
|
|
74
|
+
|
|
75
|
+
</td></tr>
|
|
76
|
+
<tr><td>
|
|
77
|
+
|
|
78
|
+
[IStorageFileResponse](./interfaces/IStorageFileResponse.md)
|
|
79
|
+
|
|
80
|
+
</td><td>
|
|
81
|
+
|
|
82
|
+
Response for reading a file.
|
|
83
|
+
|
|
84
|
+
</td></tr>
|
|
85
|
+
<tr><td>
|
|
86
|
+
|
|
87
|
+
[IStoragePathRequest](./interfaces/IStoragePathRequest.md)
|
|
88
|
+
|
|
89
|
+
</td><td>
|
|
90
|
+
|
|
91
|
+
Request for path-based operations.
|
|
92
|
+
|
|
93
|
+
</td></tr>
|
|
94
|
+
<tr><td>
|
|
95
|
+
|
|
96
|
+
[IStorageWriteFileRequest](./interfaces/IStorageWriteFileRequest.md)
|
|
97
|
+
|
|
98
|
+
</td><td>
|
|
99
|
+
|
|
100
|
+
Request for writing file contents.
|
|
101
|
+
|
|
102
|
+
</td></tr>
|
|
103
|
+
<tr><td>
|
|
104
|
+
|
|
105
|
+
[IStorageSyncRequest](./interfaces/IStorageSyncRequest.md)
|
|
106
|
+
|
|
107
|
+
</td><td>
|
|
108
|
+
|
|
109
|
+
Request for sync operation.
|
|
110
|
+
|
|
111
|
+
</td></tr>
|
|
112
|
+
<tr><td>
|
|
113
|
+
|
|
114
|
+
[IStorageSyncResponse](./interfaces/IStorageSyncResponse.md)
|
|
115
|
+
|
|
116
|
+
</td><td>
|
|
117
|
+
|
|
118
|
+
Sync response metadata.
|
|
119
|
+
|
|
120
|
+
</td></tr>
|
|
121
|
+
<tr><td>
|
|
122
|
+
|
|
123
|
+
[IHttpStorageProvider](./interfaces/IHttpStorageProvider.md)
|
|
124
|
+
|
|
125
|
+
</td><td>
|
|
126
|
+
|
|
127
|
+
Provider contract for storage backends.
|
|
128
|
+
|
|
129
|
+
</td></tr>
|
|
130
|
+
<tr><td>
|
|
131
|
+
|
|
132
|
+
[IHttpStorageProviderFactory](./interfaces/IHttpStorageProviderFactory.md)
|
|
133
|
+
|
|
134
|
+
</td><td>
|
|
135
|
+
|
|
136
|
+
Factory for creating namespace-scoped storage providers.
|
|
137
|
+
|
|
138
|
+
</td></tr>
|
|
139
|
+
<tr><td>
|
|
140
|
+
|
|
141
|
+
[IFsStorageProviderFactoryOptions](./interfaces/IFsStorageProviderFactoryOptions.md)
|
|
142
|
+
|
|
143
|
+
</td><td>
|
|
144
|
+
|
|
145
|
+
Options for creating filesystem-backed storage providers.
|
|
146
|
+
|
|
147
|
+
</td></tr>
|
|
148
|
+
<tr><td>
|
|
149
|
+
|
|
150
|
+
[ICreateStorageRoutesOptions](./interfaces/ICreateStorageRoutesOptions.md)
|
|
151
|
+
|
|
152
|
+
</td><td>
|
|
153
|
+
|
|
154
|
+
Options for creating storage routes.
|
|
155
|
+
|
|
156
|
+
</td></tr>
|
|
157
|
+
</tbody></table>
|
|
158
|
+
|
|
159
|
+
## Type Aliases
|
|
160
|
+
|
|
161
|
+
<table><thead><tr><th>
|
|
162
|
+
|
|
163
|
+
Name
|
|
164
|
+
|
|
165
|
+
</th><th>
|
|
166
|
+
|
|
167
|
+
Description
|
|
168
|
+
|
|
169
|
+
</th></tr></thead>
|
|
170
|
+
<tbody>
|
|
171
|
+
<tr><td>
|
|
172
|
+
|
|
173
|
+
[StorageNamespace](./type-aliases/StorageNamespace.md)
|
|
174
|
+
|
|
175
|
+
</td><td>
|
|
176
|
+
|
|
177
|
+
Namespace identifier for scoped storage.
|
|
178
|
+
|
|
179
|
+
</td></tr>
|
|
180
|
+
<tr><td>
|
|
181
|
+
|
|
182
|
+
[StorageItemType](./type-aliases/StorageItemType.md)
|
|
183
|
+
|
|
184
|
+
</td><td>
|
|
185
|
+
|
|
186
|
+
Storage item type.
|
|
187
|
+
|
|
188
|
+
</td></tr>
|
|
189
|
+
</tbody></table>
|
|
190
|
+
|
|
191
|
+
## Functions
|
|
192
|
+
|
|
193
|
+
<table><thead><tr><th>
|
|
194
|
+
|
|
195
|
+
Name
|
|
196
|
+
|
|
197
|
+
</th><th>
|
|
198
|
+
|
|
199
|
+
Description
|
|
200
|
+
|
|
201
|
+
</th></tr></thead>
|
|
202
|
+
<tbody>
|
|
203
|
+
<tr><td>
|
|
204
|
+
|
|
205
|
+
[normalizeRequestPath](./functions/normalizeRequestPath.md)
|
|
206
|
+
|
|
207
|
+
</td><td>
|
|
208
|
+
|
|
209
|
+
Normalizes a request path to a consistent POSIX format.
|
|
210
|
+
|
|
211
|
+
</td></tr>
|
|
212
|
+
<tr><td>
|
|
213
|
+
|
|
214
|
+
[sanitizeNamespace](./functions/sanitizeNamespace.md)
|
|
215
|
+
|
|
216
|
+
</td><td>
|
|
217
|
+
|
|
218
|
+
Sanitize namespace path segment.
|
|
219
|
+
|
|
220
|
+
</td></tr>
|
|
221
|
+
<tr><td>
|
|
222
|
+
|
|
223
|
+
[createStorageRoutes](./functions/createStorageRoutes.md)
|
|
224
|
+
|
|
225
|
+
</td><td>
|
|
226
|
+
|
|
227
|
+
Builds storage routes for a Hono app.
|
|
228
|
+
|
|
229
|
+
</td></tr>
|
|
230
|
+
</tbody></table>
|
|
231
|
+
|
|
232
|
+
## Variables
|
|
233
|
+
|
|
234
|
+
<table><thead><tr><th>
|
|
235
|
+
|
|
236
|
+
Name
|
|
237
|
+
|
|
238
|
+
</th><th>
|
|
239
|
+
|
|
240
|
+
Description
|
|
241
|
+
|
|
242
|
+
</th></tr></thead>
|
|
243
|
+
<tbody>
|
|
244
|
+
<tr><td>
|
|
245
|
+
|
|
246
|
+
[storageTreeItem](./variables/storageTreeItem.md)
|
|
247
|
+
|
|
248
|
+
</td><td>
|
|
249
|
+
|
|
250
|
+
Converter for IStorageTreeItem.
|
|
251
|
+
|
|
252
|
+
</td></tr>
|
|
253
|
+
<tr><td>
|
|
254
|
+
|
|
255
|
+
[storagePathRequest](./variables/storagePathRequest.md)
|
|
256
|
+
|
|
257
|
+
</td><td>
|
|
258
|
+
|
|
259
|
+
Converter for path-based requests.
|
|
260
|
+
|
|
261
|
+
</td></tr>
|
|
262
|
+
<tr><td>
|
|
263
|
+
|
|
264
|
+
[storageWriteFileRequest](./variables/storageWriteFileRequest.md)
|
|
265
|
+
|
|
266
|
+
</td><td>
|
|
267
|
+
|
|
268
|
+
Converter for write-file requests.
|
|
269
|
+
|
|
270
|
+
</td></tr>
|
|
271
|
+
<tr><td>
|
|
272
|
+
|
|
273
|
+
[storageSyncRequest](./variables/storageSyncRequest.md)
|
|
274
|
+
|
|
275
|
+
</td><td>
|
|
276
|
+
|
|
277
|
+
Converter for sync requests.
|
|
278
|
+
|
|
279
|
+
</td></tr>
|
|
280
|
+
<tr><td>
|
|
281
|
+
|
|
282
|
+
[storageFileResponse](./variables/storageFileResponse.md)
|
|
283
|
+
|
|
284
|
+
</td><td>
|
|
285
|
+
|
|
286
|
+
Converter for file responses.
|
|
287
|
+
|
|
288
|
+
</td></tr>
|
|
289
|
+
<tr><td>
|
|
290
|
+
|
|
291
|
+
[storageTreeChildrenResponse](./variables/storageTreeChildrenResponse.md)
|
|
292
|
+
|
|
293
|
+
</td><td>
|
|
294
|
+
|
|
295
|
+
Converter for children list responses.
|
|
296
|
+
|
|
297
|
+
</td></tr>
|
|
298
|
+
</tbody></table>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
[Home](../README.md) > [FsStorageProvider](./FsStorageProvider.md) > createDirectory
|
|
2
|
+
|
|
3
|
+
## FsStorageProvider.createDirectory() method
|
|
4
|
+
|
|
5
|
+
**Signature:**
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
createDirectory(itemPath: string): Promise<Result<IStorageTreeItem>>;
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**Parameters:**
|
|
12
|
+
|
|
13
|
+
<table><thead><tr><th>Parameter</th><th>Type</th><th>Description</th></tr></thead>
|
|
14
|
+
<tbody>
|
|
15
|
+
<tr><td>itemPath</td><td>string</td><td></td></tr>
|
|
16
|
+
</tbody></table>
|
|
17
|
+
|
|
18
|
+
**Returns:**
|
|
19
|
+
|
|
20
|
+
Promise<Result<[IStorageTreeItem](../interfaces/IStorageTreeItem.md)>>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
[Home](../README.md) > [FsStorageProvider](./FsStorageProvider.md) > getChildren
|
|
2
|
+
|
|
3
|
+
## FsStorageProvider.getChildren() method
|
|
4
|
+
|
|
5
|
+
**Signature:**
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
getChildren(itemPath: string): Promise<Result<readonly IStorageTreeItem[]>>;
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**Parameters:**
|
|
12
|
+
|
|
13
|
+
<table><thead><tr><th>Parameter</th><th>Type</th><th>Description</th></tr></thead>
|
|
14
|
+
<tbody>
|
|
15
|
+
<tr><td>itemPath</td><td>string</td><td></td></tr>
|
|
16
|
+
</tbody></table>
|
|
17
|
+
|
|
18
|
+
**Returns:**
|
|
19
|
+
|
|
20
|
+
Promise<Result<readonly [IStorageTreeItem](../interfaces/IStorageTreeItem.md)[]>>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
[Home](../README.md) > [FsStorageProvider](./FsStorageProvider.md) > getFile
|
|
2
|
+
|
|
3
|
+
## FsStorageProvider.getFile() method
|
|
4
|
+
|
|
5
|
+
**Signature:**
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
getFile(itemPath: string): Promise<Result<IStorageFileResponse>>;
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**Parameters:**
|
|
12
|
+
|
|
13
|
+
<table><thead><tr><th>Parameter</th><th>Type</th><th>Description</th></tr></thead>
|
|
14
|
+
<tbody>
|
|
15
|
+
<tr><td>itemPath</td><td>string</td><td></td></tr>
|
|
16
|
+
</tbody></table>
|
|
17
|
+
|
|
18
|
+
**Returns:**
|
|
19
|
+
|
|
20
|
+
Promise<Result<[IStorageFileResponse](../interfaces/IStorageFileResponse.md)>>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
[Home](../README.md) > [FsStorageProvider](./FsStorageProvider.md) > getItem
|
|
2
|
+
|
|
3
|
+
## FsStorageProvider.getItem() method
|
|
4
|
+
|
|
5
|
+
**Signature:**
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
getItem(itemPath: string): Promise<Result<IStorageTreeItem>>;
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**Parameters:**
|
|
12
|
+
|
|
13
|
+
<table><thead><tr><th>Parameter</th><th>Type</th><th>Description</th></tr></thead>
|
|
14
|
+
<tbody>
|
|
15
|
+
<tr><td>itemPath</td><td>string</td><td></td></tr>
|
|
16
|
+
</tbody></table>
|
|
17
|
+
|
|
18
|
+
**Returns:**
|
|
19
|
+
|
|
20
|
+
Promise<Result<[IStorageTreeItem](../interfaces/IStorageTreeItem.md)>>
|