@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,184 @@
|
|
|
1
|
+
## API Report File for "@fgv/ts-http-storage"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
import { Converter } from '@fgv/ts-utils';
|
|
8
|
+
import { Hono } from 'hono';
|
|
9
|
+
import type { Logging } from '@fgv/ts-utils';
|
|
10
|
+
import { Result } from '@fgv/ts-utils';
|
|
11
|
+
|
|
12
|
+
// @public
|
|
13
|
+
export function createStorageRoutes(options: ICreateStorageRoutesOptions): Hono;
|
|
14
|
+
|
|
15
|
+
// @public
|
|
16
|
+
export class FsStorageProvider implements IHttpStorageProvider {
|
|
17
|
+
constructor(rootPath: string);
|
|
18
|
+
// (undocumented)
|
|
19
|
+
createDirectory(itemPath: string): Promise<Result<IStorageTreeItem>>;
|
|
20
|
+
// (undocumented)
|
|
21
|
+
deleteFile(itemPath: string): Promise<Result<boolean>>;
|
|
22
|
+
// (undocumented)
|
|
23
|
+
getChildren(itemPath: string): Promise<Result<ReadonlyArray<IStorageTreeItem>>>;
|
|
24
|
+
// (undocumented)
|
|
25
|
+
getFile(itemPath: string): Promise<Result<IStorageFileResponse>>;
|
|
26
|
+
// (undocumented)
|
|
27
|
+
getItem(itemPath: string): Promise<Result<IStorageTreeItem>>;
|
|
28
|
+
// (undocumented)
|
|
29
|
+
saveFile(itemPath: string, contents: string, contentType?: string): Promise<Result<IStorageFileResponse>>;
|
|
30
|
+
// (undocumented)
|
|
31
|
+
sync(): Promise<Result<IStorageSyncResponse>>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// @public
|
|
35
|
+
export class FsStorageProviderFactory implements IHttpStorageProviderFactory {
|
|
36
|
+
constructor(options: IFsStorageProviderFactoryOptions);
|
|
37
|
+
// (undocumented)
|
|
38
|
+
forNamespace(namespace?: string): Result<IHttpStorageProvider>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// @public
|
|
42
|
+
export class HttpStorageService {
|
|
43
|
+
constructor(providers: IHttpStorageProviderFactory);
|
|
44
|
+
// (undocumented)
|
|
45
|
+
createDirectory(request: IStoragePathRequest): Promise<Result<IStorageTreeItem>>;
|
|
46
|
+
// (undocumented)
|
|
47
|
+
deleteFile(request: IStoragePathRequest): Promise<Result<boolean>>;
|
|
48
|
+
// (undocumented)
|
|
49
|
+
getChildren(request: IStoragePathRequest): Promise<Result<IStorageTreeChildrenResponse>>;
|
|
50
|
+
// (undocumented)
|
|
51
|
+
getFile(request: IStoragePathRequest): Promise<Result<IStorageFileResponse>>;
|
|
52
|
+
// (undocumented)
|
|
53
|
+
getItem(request: IStoragePathRequest): Promise<Result<IStorageTreeItem>>;
|
|
54
|
+
// (undocumented)
|
|
55
|
+
saveFile(request: IStorageWriteFileRequest): Promise<Result<IStorageFileResponse>>;
|
|
56
|
+
// (undocumented)
|
|
57
|
+
sync(request: IStorageSyncRequest): Promise<Result<IStorageSyncResponse>>;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// @public
|
|
61
|
+
export interface ICreateStorageRoutesOptions {
|
|
62
|
+
// (undocumented)
|
|
63
|
+
readonly logger?: Logging.ILogger;
|
|
64
|
+
// (undocumented)
|
|
65
|
+
readonly providers: IHttpStorageProviderFactory;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// @public
|
|
69
|
+
export interface IFsStorageProviderFactoryOptions {
|
|
70
|
+
// (undocumented)
|
|
71
|
+
readonly rootPath: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// @public
|
|
75
|
+
export interface IHttpStorageProvider {
|
|
76
|
+
// (undocumented)
|
|
77
|
+
createDirectory(path: string): Promise<Result<IStorageTreeItem>>;
|
|
78
|
+
// (undocumented)
|
|
79
|
+
deleteFile(path: string): Promise<Result<boolean>>;
|
|
80
|
+
// (undocumented)
|
|
81
|
+
getChildren(path: string): Promise<Result<ReadonlyArray<IStorageTreeItem>>>;
|
|
82
|
+
// (undocumented)
|
|
83
|
+
getFile(path: string): Promise<Result<IStorageFileResponse>>;
|
|
84
|
+
// (undocumented)
|
|
85
|
+
getItem(path: string): Promise<Result<IStorageTreeItem>>;
|
|
86
|
+
// (undocumented)
|
|
87
|
+
saveFile(path: string, contents: string, contentType?: string): Promise<Result<IStorageFileResponse>>;
|
|
88
|
+
// (undocumented)
|
|
89
|
+
sync(): Promise<Result<IStorageSyncResponse>>;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// @public
|
|
93
|
+
export interface IHttpStorageProviderFactory {
|
|
94
|
+
// (undocumented)
|
|
95
|
+
forNamespace(namespace?: StorageNamespace): Result<IHttpStorageProvider>;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// @public
|
|
99
|
+
export interface IStorageFileResponse {
|
|
100
|
+
// (undocumented)
|
|
101
|
+
readonly contents: string;
|
|
102
|
+
// (undocumented)
|
|
103
|
+
readonly contentType?: string;
|
|
104
|
+
// (undocumented)
|
|
105
|
+
readonly path: string;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// @public
|
|
109
|
+
export interface IStoragePathRequest {
|
|
110
|
+
// (undocumented)
|
|
111
|
+
readonly namespace?: StorageNamespace;
|
|
112
|
+
// (undocumented)
|
|
113
|
+
readonly path: string;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// @public
|
|
117
|
+
export interface IStorageSyncRequest {
|
|
118
|
+
// (undocumented)
|
|
119
|
+
readonly namespace?: StorageNamespace;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// @public
|
|
123
|
+
export interface IStorageSyncResponse {
|
|
124
|
+
// (undocumented)
|
|
125
|
+
readonly synced: number;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// @public
|
|
129
|
+
export interface IStorageTreeChildrenResponse {
|
|
130
|
+
// (undocumented)
|
|
131
|
+
readonly children: ReadonlyArray<IStorageTreeItem>;
|
|
132
|
+
// (undocumented)
|
|
133
|
+
readonly path: string;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// @public
|
|
137
|
+
export interface IStorageTreeItem {
|
|
138
|
+
// (undocumented)
|
|
139
|
+
readonly name: string;
|
|
140
|
+
// (undocumented)
|
|
141
|
+
readonly path: string;
|
|
142
|
+
// (undocumented)
|
|
143
|
+
readonly type: StorageItemType;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// @public
|
|
147
|
+
export interface IStorageWriteFileRequest extends IStoragePathRequest {
|
|
148
|
+
// (undocumented)
|
|
149
|
+
readonly contents: string;
|
|
150
|
+
// (undocumented)
|
|
151
|
+
readonly contentType?: string;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// @public
|
|
155
|
+
export function normalizeRequestPath(requestPath: string): string;
|
|
156
|
+
|
|
157
|
+
// @public
|
|
158
|
+
export function sanitizeNamespace(namespace?: string): Result<string>;
|
|
159
|
+
|
|
160
|
+
// @public
|
|
161
|
+
export const storageFileResponse: Converter<IStorageFileResponse>;
|
|
162
|
+
|
|
163
|
+
// @public
|
|
164
|
+
export type StorageItemType = 'file' | 'directory';
|
|
165
|
+
|
|
166
|
+
// @public
|
|
167
|
+
export type StorageNamespace = string;
|
|
168
|
+
|
|
169
|
+
// @public
|
|
170
|
+
export const storagePathRequest: Converter<IStoragePathRequest>;
|
|
171
|
+
|
|
172
|
+
// @public
|
|
173
|
+
export const storageSyncRequest: Converter<IStorageSyncRequest>;
|
|
174
|
+
|
|
175
|
+
// @public
|
|
176
|
+
export const storageTreeChildrenResponse: Converter<IStorageTreeChildrenResponse>;
|
|
177
|
+
|
|
178
|
+
// @public
|
|
179
|
+
export const storageTreeItem: Converter<IStorageTreeItem>;
|
|
180
|
+
|
|
181
|
+
// @public
|
|
182
|
+
export const storageWriteFileRequest: Converter<IStorageWriteFileRequest>;
|
|
183
|
+
|
|
184
|
+
```
|