diff --git a/packages/client-js/package-lock.json b/packages/client-js/package-lock.json index d60fc8c..02f29e7 100644 --- a/packages/client-js/package-lock.json +++ b/packages/client-js/package-lock.json @@ -9,6 +9,7 @@ "version": "0.1.16", "license": "ISC", "devDependencies": { + "@types/node": "^20.11.13", "tsup": "^8.0.1", "tsx": "^4.7.0", "typescript": "^5.3.3" @@ -667,6 +668,15 @@ "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", "dev": true }, + "node_modules/@types/node": { + "version": "20.11.13", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.13.tgz", + "integrity": "sha512-5G4zQwdiQBSWYTDAH1ctw2eidqdhMJaNsiIDKHFr55ihz5Trl2qqR8fdrT732yPBho5gkNxXm67OxWFBqX9aPg==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, "node_modules/ansi-regex": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", @@ -1909,6 +1919,12 @@ "node": ">=14.17" } }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, "node_modules/webidl-conversions": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", diff --git a/packages/client-js/package.json b/packages/client-js/package.json index 4d4fd28..8f6df31 100644 --- a/packages/client-js/package.json +++ b/packages/client-js/package.json @@ -19,6 +19,7 @@ "author": "", "license": "ISC", "devDependencies": { + "@types/node": "^20.11.13", "tsup": "^8.0.1", "tsx": "^4.7.0", "typescript": "^5.3.3" @@ -35,6 +36,5 @@ "esm" ], "dts": true - }, - "dependencies": {} + } } diff --git a/packages/client-js/src/client.ts b/packages/client-js/src/client.ts index d921ac7..7cd69a5 100644 --- a/packages/client-js/src/client.ts +++ b/packages/client-js/src/client.ts @@ -3,10 +3,10 @@ export interface PathString { path: string; content: string; } -// export interface PathBuffer{ -// path: string; -// content: Buffer; -// } +export interface PathBuffer{ + path: string; + content: Buffer; +} export interface ExternalLink { href: string; @@ -20,8 +20,7 @@ export interface DocumentInput { keywords?: string[]; date?: string; }; - assets?: PathString[]; - //| PathBuffer + assets?: PathString[] | PathBuffer[]; //| ExternalLink } @@ -143,8 +142,11 @@ export class Onedoc { }); if (asset?.content) { + await uploadToSignedUrl(e.signedUrl, e.path, e.token, asset.content); + } else if (e.path == "/index.html") { + let htmlBuilder = new HtmlBuilder("Onedoc"); const styleSheets = document.assets