@openstax/ts-utils 1.21.3 → 1.21.5
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/cjs/services/fileServer/index.d.ts +1 -1
- package/dist/cjs/services/fileServer/localFileServer.js +2 -1
- package/dist/cjs/services/fileServer/s3FileServer.js +1 -0
- package/dist/cjs/tsconfig.without-specs.cjs.tsbuildinfo +1 -1
- package/dist/esm/services/fileServer/index.d.ts +1 -1
- package/dist/esm/services/fileServer/localFileServer.js +2 -1
- package/dist/esm/services/fileServer/s3FileServer.js +1 -0
- package/dist/esm/tsconfig.without-specs.esm.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -12,7 +12,7 @@ export declare type FolderValue = {
|
|
|
12
12
|
export declare const isFileValue: (thing: any) => thing is FileValue;
|
|
13
13
|
export declare const isFolderValue: (thing: any) => thing is FolderValue;
|
|
14
14
|
export interface FileServerAdapter {
|
|
15
|
-
putFileContent: (source: FileValue, content: string) => Promise<
|
|
15
|
+
putFileContent: (source: FileValue, content: string) => Promise<FileValue>;
|
|
16
16
|
getSignedViewerUrl: (source: FileValue) => Promise<string>;
|
|
17
17
|
getFileContent: (source: FileValue) => Promise<Buffer>;
|
|
18
18
|
}
|
|
@@ -66,7 +66,8 @@ const localFileServer = (initializer) => (configProvider) => {
|
|
|
66
66
|
};
|
|
67
67
|
const putFileContent = async (source, content) => {
|
|
68
68
|
const filePath = path_1.default.join(await fileDir, source.path);
|
|
69
|
-
|
|
69
|
+
await fs_1.default.promises.writeFile(filePath, content);
|
|
70
|
+
return source;
|
|
70
71
|
};
|
|
71
72
|
return {
|
|
72
73
|
getSignedViewerUrl,
|