@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.
Files changed (137) hide show
  1. package/.rush/temp/chunked-rush-logs/ts-http-storage.build.chunks.jsonl +9 -0
  2. package/.rush/temp/fbfcc9487d290993ba47f1d36e9383196e7b12ac.tar.log +61 -0
  3. package/.rush/temp/operation/build/all.log +9 -0
  4. package/.rush/temp/operation/build/log-chunks.jsonl +9 -0
  5. package/.rush/temp/operation/build/state.json +3 -0
  6. package/.rush/temp/shrinkwrap-deps.json +647 -0
  7. package/config/api-extractor.json +36 -0
  8. package/config/rig.json +10 -0
  9. package/config/typedoc.json +7 -0
  10. package/dist/ts-http-storage.d.ts +225 -0
  11. package/dist/tsdoc-metadata.json +11 -0
  12. package/docs/README.md +298 -0
  13. package/docs/classes/FsStorageProvider.createDirectory.md +20 -0
  14. package/docs/classes/FsStorageProvider.getChildren.md +20 -0
  15. package/docs/classes/FsStorageProvider.getFile.md +20 -0
  16. package/docs/classes/FsStorageProvider.getItem.md +20 -0
  17. package/docs/classes/FsStorageProvider.md +134 -0
  18. package/docs/classes/FsStorageProvider.saveFile.md +22 -0
  19. package/docs/classes/FsStorageProvider.sync.md +13 -0
  20. package/docs/classes/FsStorageProviderFactory.forNamespace.md +20 -0
  21. package/docs/classes/FsStorageProviderFactory.md +69 -0
  22. package/docs/classes/HttpStorageService.createDirectory.md +20 -0
  23. package/docs/classes/HttpStorageService.getChildren.md +20 -0
  24. package/docs/classes/HttpStorageService.getFile.md +20 -0
  25. package/docs/classes/HttpStorageService.getItem.md +20 -0
  26. package/docs/classes/HttpStorageService.md +132 -0
  27. package/docs/classes/HttpStorageService.saveFile.md +20 -0
  28. package/docs/classes/HttpStorageService.sync.md +20 -0
  29. package/docs/functions/createStorageRoutes.md +11 -0
  30. package/docs/functions/normalizeRequestPath.md +11 -0
  31. package/docs/functions/sanitizeNamespace.md +11 -0
  32. package/docs/interfaces/ICreateStorageRoutesOptions.logger.md +9 -0
  33. package/docs/interfaces/ICreateStorageRoutesOptions.md +61 -0
  34. package/docs/interfaces/ICreateStorageRoutesOptions.providers.md +9 -0
  35. package/docs/interfaces/IFsStorageProviderFactoryOptions.md +44 -0
  36. package/docs/interfaces/IFsStorageProviderFactoryOptions.rootPath.md +9 -0
  37. package/docs/interfaces/IHttpStorageProvider.createDirectory.md +20 -0
  38. package/docs/interfaces/IHttpStorageProvider.getChildren.md +20 -0
  39. package/docs/interfaces/IHttpStorageProvider.getFile.md +20 -0
  40. package/docs/interfaces/IHttpStorageProvider.getItem.md +20 -0
  41. package/docs/interfaces/IHttpStorageProvider.md +102 -0
  42. package/docs/interfaces/IHttpStorageProvider.saveFile.md +22 -0
  43. package/docs/interfaces/IHttpStorageProvider.sync.md +13 -0
  44. package/docs/interfaces/IHttpStorageProviderFactory.forNamespace.md +20 -0
  45. package/docs/interfaces/IHttpStorageProviderFactory.md +36 -0
  46. package/docs/interfaces/IStorageFileResponse.contentType.md +9 -0
  47. package/docs/interfaces/IStorageFileResponse.contents.md +9 -0
  48. package/docs/interfaces/IStorageFileResponse.md +78 -0
  49. package/docs/interfaces/IStorageFileResponse.path.md +9 -0
  50. package/docs/interfaces/IStoragePathRequest.md +61 -0
  51. package/docs/interfaces/IStoragePathRequest.namespace.md +9 -0
  52. package/docs/interfaces/IStoragePathRequest.path.md +9 -0
  53. package/docs/interfaces/IStorageSyncRequest.md +44 -0
  54. package/docs/interfaces/IStorageSyncRequest.namespace.md +9 -0
  55. package/docs/interfaces/IStorageSyncResponse.md +44 -0
  56. package/docs/interfaces/IStorageSyncResponse.synced.md +9 -0
  57. package/docs/interfaces/IStorageTreeChildrenResponse.children.md +9 -0
  58. package/docs/interfaces/IStorageTreeChildrenResponse.md +61 -0
  59. package/docs/interfaces/IStorageTreeChildrenResponse.path.md +9 -0
  60. package/docs/interfaces/IStorageTreeItem.md +78 -0
  61. package/docs/interfaces/IStorageTreeItem.name.md +9 -0
  62. package/docs/interfaces/IStorageTreeItem.path.md +9 -0
  63. package/docs/interfaces/IStorageTreeItem.type.md +9 -0
  64. package/docs/interfaces/IStorageWriteFileRequest.contentType.md +9 -0
  65. package/docs/interfaces/IStorageWriteFileRequest.contents.md +9 -0
  66. package/docs/interfaces/IStorageWriteFileRequest.md +97 -0
  67. package/docs/type-aliases/StorageItemType.md +11 -0
  68. package/docs/type-aliases/StorageNamespace.md +11 -0
  69. package/docs/variables/storageFileResponse.md +9 -0
  70. package/docs/variables/storagePathRequest.md +9 -0
  71. package/docs/variables/storageSyncRequest.md +9 -0
  72. package/docs/variables/storageTreeChildrenResponse.md +9 -0
  73. package/docs/variables/storageTreeItem.md +9 -0
  74. package/docs/variables/storageWriteFileRequest.md +9 -0
  75. package/etc/ts-http-storage.api.md +184 -0
  76. package/lib/index.d.ts +6 -0
  77. package/lib/index.d.ts.map +1 -0
  78. package/lib/index.js +43 -0
  79. package/lib/index.js.map +1 -0
  80. package/lib/packlets/storage/converters.d.ts +33 -0
  81. package/lib/packlets/storage/converters.d.ts.map +1 -0
  82. package/lib/packlets/storage/converters.js +81 -0
  83. package/lib/packlets/storage/converters.js.map +1 -0
  84. package/lib/packlets/storage/fsProvider.d.ts +47 -0
  85. package/lib/packlets/storage/fsProvider.d.ts.map +1 -0
  86. package/lib/packlets/storage/fsProvider.js +260 -0
  87. package/lib/packlets/storage/fsProvider.js.map +1 -0
  88. package/lib/packlets/storage/index.d.ts +11 -0
  89. package/lib/packlets/storage/index.d.ts.map +1 -0
  90. package/lib/packlets/storage/index.js +48 -0
  91. package/lib/packlets/storage/index.js.map +1 -0
  92. package/lib/packlets/storage/model.d.ts +82 -0
  93. package/lib/packlets/storage/model.d.ts.map +1 -0
  94. package/lib/packlets/storage/model.js +24 -0
  95. package/lib/packlets/storage/model.js.map +1 -0
  96. package/lib/packlets/storage/provider.d.ts +10 -0
  97. package/lib/packlets/storage/provider.d.ts.map +1 -0
  98. package/lib/packlets/storage/provider.js +24 -0
  99. package/lib/packlets/storage/provider.js.map +1 -0
  100. package/lib/packlets/storage/routes.d.ts +17 -0
  101. package/lib/packlets/storage/routes.d.ts.map +1 -0
  102. package/lib/packlets/storage/routes.js +170 -0
  103. package/lib/packlets/storage/routes.js.map +1 -0
  104. package/lib/packlets/storage/service.d.ts +20 -0
  105. package/lib/packlets/storage/service.d.ts.map +1 -0
  106. package/lib/packlets/storage/service.js +95 -0
  107. package/lib/packlets/storage/service.js.map +1 -0
  108. package/lib/test/unit/storage/fsProvider.test.d.ts +2 -0
  109. package/lib/test/unit/storage/fsProvider.test.d.ts.map +1 -0
  110. package/lib/test/unit/storage/fsProvider.test.js +106 -0
  111. package/lib/test/unit/storage/fsProvider.test.js.map +1 -0
  112. package/lib/test/unit/storage/routes.test.d.ts +2 -0
  113. package/lib/test/unit/storage/routes.test.d.ts.map +1 -0
  114. package/lib/test/unit/storage/routes.test.js +124 -0
  115. package/lib/test/unit/storage/routes.test.js.map +1 -0
  116. package/lib/test/unit/storage/service.test.d.ts +2 -0
  117. package/lib/test/unit/storage/service.test.d.ts.map +1 -0
  118. package/lib/test/unit/storage/service.test.js +67 -0
  119. package/lib/test/unit/storage/service.test.js.map +1 -0
  120. package/package.json +66 -0
  121. package/rush-logs/ts-http-storage.build.cache.log +3 -0
  122. package/rush-logs/ts-http-storage.build.log +9 -0
  123. package/src/index.ts +28 -0
  124. package/src/packlets/storage/converters.ts +100 -0
  125. package/src/packlets/storage/fsProvider.ts +263 -0
  126. package/src/packlets/storage/index.ts +33 -0
  127. package/src/packlets/storage/model.ts +113 -0
  128. package/src/packlets/storage/provider.ts +33 -0
  129. package/src/packlets/storage/routes.ts +215 -0
  130. package/src/packlets/storage/service.ts +114 -0
  131. package/src/test/unit/storage/fsProvider.test.ts +129 -0
  132. package/src/test/unit/storage/routes.test.ts +165 -0
  133. package/src/test/unit/storage/service.test.ts +95 -0
  134. package/temp/build/typescript/ts_l9Fw4VUO.json +1 -0
  135. package/temp/ts-http-storage.api.json +3103 -0
  136. package/temp/ts-http-storage.api.md +184 -0
  137. package/tsconfig.json +7 -0
@@ -0,0 +1,78 @@
1
+ [Home](../README.md) > IStorageTreeItem
2
+
3
+ # Interface: IStorageTreeItem
4
+
5
+ Storage tree item metadata.
6
+
7
+ ## Properties
8
+
9
+ <table><thead><tr><th>
10
+
11
+ Property
12
+
13
+ </th><th>
14
+
15
+ Modifiers
16
+
17
+ </th><th>
18
+
19
+ Type
20
+
21
+ </th><th>
22
+
23
+ Description
24
+
25
+ </th></tr></thead>
26
+ <tbody>
27
+ <tr><td>
28
+
29
+ [path](./IStorageTreeItem.path.md)
30
+
31
+ </td><td>
32
+
33
+ `readonly`
34
+
35
+ </td><td>
36
+
37
+ string
38
+
39
+ </td><td>
40
+
41
+
42
+
43
+ </td></tr>
44
+ <tr><td>
45
+
46
+ [name](./IStorageTreeItem.name.md)
47
+
48
+ </td><td>
49
+
50
+ `readonly`
51
+
52
+ </td><td>
53
+
54
+ string
55
+
56
+ </td><td>
57
+
58
+
59
+
60
+ </td></tr>
61
+ <tr><td>
62
+
63
+ [type](./IStorageTreeItem.type.md)
64
+
65
+ </td><td>
66
+
67
+ `readonly`
68
+
69
+ </td><td>
70
+
71
+ [StorageItemType](../type-aliases/StorageItemType.md)
72
+
73
+ </td><td>
74
+
75
+
76
+
77
+ </td></tr>
78
+ </tbody></table>
@@ -0,0 +1,9 @@
1
+ [Home](../README.md) > [IStorageTreeItem](./IStorageTreeItem.md) > name
2
+
3
+ ## IStorageTreeItem.name property
4
+
5
+ **Signature:**
6
+
7
+ ```typescript
8
+ readonly name: string;
9
+ ```
@@ -0,0 +1,9 @@
1
+ [Home](../README.md) > [IStorageTreeItem](./IStorageTreeItem.md) > path
2
+
3
+ ## IStorageTreeItem.path property
4
+
5
+ **Signature:**
6
+
7
+ ```typescript
8
+ readonly path: string;
9
+ ```
@@ -0,0 +1,9 @@
1
+ [Home](../README.md) > [IStorageTreeItem](./IStorageTreeItem.md) > type
2
+
3
+ ## IStorageTreeItem.type property
4
+
5
+ **Signature:**
6
+
7
+ ```typescript
8
+ readonly type: StorageItemType;
9
+ ```
@@ -0,0 +1,9 @@
1
+ [Home](../README.md) > [IStorageWriteFileRequest](./IStorageWriteFileRequest.md) > contentType
2
+
3
+ ## IStorageWriteFileRequest.contentType property
4
+
5
+ **Signature:**
6
+
7
+ ```typescript
8
+ readonly contentType: string;
9
+ ```
@@ -0,0 +1,9 @@
1
+ [Home](../README.md) > [IStorageWriteFileRequest](./IStorageWriteFileRequest.md) > contents
2
+
3
+ ## IStorageWriteFileRequest.contents property
4
+
5
+ **Signature:**
6
+
7
+ ```typescript
8
+ readonly contents: string;
9
+ ```
@@ -0,0 +1,97 @@
1
+ [Home](../README.md) > IStorageWriteFileRequest
2
+
3
+ # Interface: IStorageWriteFileRequest
4
+
5
+ Request for writing file contents.
6
+
7
+ **Extends:** [`IStoragePathRequest`](IStoragePathRequest.md)
8
+
9
+ ## Properties
10
+
11
+ <table><thead><tr><th>
12
+
13
+ Property
14
+
15
+ </th><th>
16
+
17
+ Modifiers
18
+
19
+ </th><th>
20
+
21
+ Type
22
+
23
+ </th><th>
24
+
25
+ Description
26
+
27
+ </th></tr></thead>
28
+ <tbody>
29
+ <tr><td>
30
+
31
+ [contents](./IStorageWriteFileRequest.contents.md)
32
+
33
+ </td><td>
34
+
35
+ `readonly`
36
+
37
+ </td><td>
38
+
39
+ string
40
+
41
+ </td><td>
42
+
43
+
44
+
45
+ </td></tr>
46
+ <tr><td>
47
+
48
+ [contentType](./IStorageWriteFileRequest.contentType.md)
49
+
50
+ </td><td>
51
+
52
+ `readonly`
53
+
54
+ </td><td>
55
+
56
+ string
57
+
58
+ </td><td>
59
+
60
+
61
+
62
+ </td></tr>
63
+ <tr><td>
64
+
65
+ [path](./IStoragePathRequest.path.md)
66
+
67
+ </td><td>
68
+
69
+ `readonly`
70
+
71
+ </td><td>
72
+
73
+ string
74
+
75
+ </td><td>
76
+
77
+
78
+
79
+ </td></tr>
80
+ <tr><td>
81
+
82
+ [namespace](./IStoragePathRequest.namespace.md)
83
+
84
+ </td><td>
85
+
86
+ `readonly`
87
+
88
+ </td><td>
89
+
90
+ string
91
+
92
+ </td><td>
93
+
94
+
95
+
96
+ </td></tr>
97
+ </tbody></table>
@@ -0,0 +1,11 @@
1
+ [Home](../README.md) > StorageItemType
2
+
3
+ # Type Alias: StorageItemType
4
+
5
+ Storage item type.
6
+
7
+ ## Type
8
+
9
+ ```typescript
10
+ type StorageItemType = "file" | "directory"
11
+ ```
@@ -0,0 +1,11 @@
1
+ [Home](../README.md) > StorageNamespace
2
+
3
+ # Type Alias: StorageNamespace
4
+
5
+ Namespace identifier for scoped storage.
6
+
7
+ ## Type
8
+
9
+ ```typescript
10
+ type StorageNamespace = string
11
+ ```
@@ -0,0 +1,9 @@
1
+ [Home](../README.md) > storageFileResponse
2
+
3
+ # Variable: storageFileResponse
4
+
5
+ Converter for file responses.
6
+
7
+ ## Type
8
+
9
+ `Converter<IStorageFileResponse>`
@@ -0,0 +1,9 @@
1
+ [Home](../README.md) > storagePathRequest
2
+
3
+ # Variable: storagePathRequest
4
+
5
+ Converter for path-based requests.
6
+
7
+ ## Type
8
+
9
+ `Converter<IStoragePathRequest>`
@@ -0,0 +1,9 @@
1
+ [Home](../README.md) > storageSyncRequest
2
+
3
+ # Variable: storageSyncRequest
4
+
5
+ Converter for sync requests.
6
+
7
+ ## Type
8
+
9
+ `Converter<IStorageSyncRequest>`
@@ -0,0 +1,9 @@
1
+ [Home](../README.md) > storageTreeChildrenResponse
2
+
3
+ # Variable: storageTreeChildrenResponse
4
+
5
+ Converter for children list responses.
6
+
7
+ ## Type
8
+
9
+ `Converter<IStorageTreeChildrenResponse>`
@@ -0,0 +1,9 @@
1
+ [Home](../README.md) > storageTreeItem
2
+
3
+ # Variable: storageTreeItem
4
+
5
+ Converter for IStorageTreeItem.
6
+
7
+ ## Type
8
+
9
+ `Converter<IStorageTreeItem>`
@@ -0,0 +1,9 @@
1
+ [Home](../README.md) > storageWriteFileRequest
2
+
3
+ # Variable: storageWriteFileRequest
4
+
5
+ Converter for write-file requests.
6
+
7
+ ## Type
8
+
9
+ `Converter<IStorageWriteFileRequest>`
@@ -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
+ ```
package/lib/index.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Reusable HTTP storage services for FileTree-style backends.
3
+ * @packageDocumentation
4
+ */
5
+ export * from './packlets/storage';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAsBA;;;GAGG;AAEH,cAAc,oBAAoB,CAAC"}
package/lib/index.js ADDED
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2026 Erik Fortune
4
+ *
5
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ * of this software and associated documentation files (the "Software"), to deal
7
+ * in the Software without restriction, including without limitation the rights
8
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ * copies of the Software, and to permit persons to whom the Software is
10
+ * furnished to do so, subject to the following conditions:
11
+ *
12
+ * The above copyright notice and this permission notice shall be included in all
13
+ * copies or substantial portions of the Software.
14
+ *
15
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ * SOFTWARE.
22
+ */
23
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
24
+ if (k2 === undefined) k2 = k;
25
+ var desc = Object.getOwnPropertyDescriptor(m, k);
26
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
27
+ desc = { enumerable: true, get: function() { return m[k]; } };
28
+ }
29
+ Object.defineProperty(o, k2, desc);
30
+ }) : (function(o, m, k, k2) {
31
+ if (k2 === undefined) k2 = k;
32
+ o[k2] = m[k];
33
+ }));
34
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
35
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
36
+ };
37
+ Object.defineProperty(exports, "__esModule", { value: true });
38
+ /**
39
+ * Reusable HTTP storage services for FileTree-style backends.
40
+ * @packageDocumentation
41
+ */
42
+ __exportStar(require("./packlets/storage"), exports);
43
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;AAEH;;;GAGG;AAEH,qDAAmC","sourcesContent":["/*\n * Copyright (c) 2026 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/**\n * Reusable HTTP storage services for FileTree-style backends.\n * @packageDocumentation\n */\n\nexport * from './packlets/storage';\n"]}
@@ -0,0 +1,33 @@
1
+ import { type Converter } from '@fgv/ts-utils';
2
+ import type { IStorageFileResponse, IStoragePathRequest, IStorageSyncRequest, IStorageTreeChildrenResponse, IStorageTreeItem, IStorageWriteFileRequest } from './model';
3
+ /**
4
+ * Converter for {@link IStorageTreeItem}.
5
+ * @public
6
+ */
7
+ export declare const storageTreeItem: Converter<IStorageTreeItem>;
8
+ /**
9
+ * Converter for path-based requests.
10
+ * @public
11
+ */
12
+ export declare const storagePathRequest: Converter<IStoragePathRequest>;
13
+ /**
14
+ * Converter for write-file requests.
15
+ * @public
16
+ */
17
+ export declare const storageWriteFileRequest: Converter<IStorageWriteFileRequest>;
18
+ /**
19
+ * Converter for sync requests.
20
+ * @public
21
+ */
22
+ export declare const storageSyncRequest: Converter<IStorageSyncRequest>;
23
+ /**
24
+ * Converter for file responses.
25
+ * @public
26
+ */
27
+ export declare const storageFileResponse: Converter<IStorageFileResponse>;
28
+ /**
29
+ * Converter for children list responses.
30
+ * @public
31
+ */
32
+ export declare const storageTreeChildrenResponse: Converter<IStorageTreeChildrenResponse>;
33
+ //# sourceMappingURL=converters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"converters.d.ts","sourceRoot":"","sources":["../../../src/packlets/storage/converters.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,KAAK,SAAS,EAAc,MAAM,eAAe,CAAC;AAE3D,OAAO,KAAK,EACV,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,4BAA4B,EAC5B,gBAAgB,EAChB,wBAAwB,EAEzB,MAAM,SAAS,CAAC;AAOjB;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,CAAC,gBAAgB,CAItD,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,CAAC,mBAAmB,CAI1D,CAAC;AAEL;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAAS,CAAC,wBAAwB,CAMpE,CAAC;AAEL;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,CAAC,mBAAmB,CAG1D,CAAC;AAEL;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,CAAC,oBAAoB,CAK5D,CAAC;AAEL;;;GAGG;AACH,eAAO,MAAM,2BAA2B,EAAE,SAAS,CAAC,4BAA4B,CAI5E,CAAC"}
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2026 Erik Fortune
4
+ *
5
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ * of this software and associated documentation files (the "Software"), to deal
7
+ * in the Software without restriction, including without limitation the rights
8
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ * copies of the Software, and to permit persons to whom the Software is
10
+ * furnished to do so, subject to the following conditions:
11
+ *
12
+ * The above copyright notice and this permission notice shall be included in all
13
+ * copies or substantial portions of the Software.
14
+ *
15
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ * SOFTWARE.
22
+ */
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.storageTreeChildrenResponse = exports.storageFileResponse = exports.storageSyncRequest = exports.storageWriteFileRequest = exports.storagePathRequest = exports.storageTreeItem = void 0;
25
+ const ts_utils_1 = require("@fgv/ts-utils");
26
+ const storageItemType = ts_utils_1.Converters.enumeratedValue([
27
+ 'file',
28
+ 'directory'
29
+ ]);
30
+ /**
31
+ * Converter for {@link IStorageTreeItem}.
32
+ * @public
33
+ */
34
+ exports.storageTreeItem = ts_utils_1.Converters.strictObject({
35
+ path: ts_utils_1.Converters.string,
36
+ name: ts_utils_1.Converters.string,
37
+ type: storageItemType
38
+ });
39
+ /**
40
+ * Converter for path-based requests.
41
+ * @public
42
+ */
43
+ exports.storagePathRequest = ts_utils_1.Converters.strictObject({
44
+ path: ts_utils_1.Converters.string,
45
+ namespace: ts_utils_1.Converters.string.optional()
46
+ });
47
+ /**
48
+ * Converter for write-file requests.
49
+ * @public
50
+ */
51
+ exports.storageWriteFileRequest = ts_utils_1.Converters.strictObject({
52
+ path: ts_utils_1.Converters.string,
53
+ contents: ts_utils_1.Converters.string,
54
+ contentType: ts_utils_1.Converters.string.optional(),
55
+ namespace: ts_utils_1.Converters.string.optional()
56
+ });
57
+ /**
58
+ * Converter for sync requests.
59
+ * @public
60
+ */
61
+ exports.storageSyncRequest = ts_utils_1.Converters.strictObject({
62
+ namespace: ts_utils_1.Converters.string.optional()
63
+ });
64
+ /**
65
+ * Converter for file responses.
66
+ * @public
67
+ */
68
+ exports.storageFileResponse = ts_utils_1.Converters.strictObject({
69
+ path: ts_utils_1.Converters.string,
70
+ contents: ts_utils_1.Converters.string,
71
+ contentType: ts_utils_1.Converters.string.optional()
72
+ });
73
+ /**
74
+ * Converter for children list responses.
75
+ * @public
76
+ */
77
+ exports.storageTreeChildrenResponse = ts_utils_1.Converters.strictObject({
78
+ path: ts_utils_1.Converters.string,
79
+ children: ts_utils_1.Converters.arrayOf(exports.storageTreeItem)
80
+ });
81
+ //# sourceMappingURL=converters.js.map