diff --git a/Dockerfile b/Dockerfile index 9f17ba7..222cb9c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,4 +23,6 @@ COPY --from=builder /app/dist ./dist EXPOSE 4000 +ENV NODE_ENV=production + CMD ["node", "dist/server.js"] \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 1e2594d..af9aa11 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,8 +8,8 @@ "name": "backend", "version": "1.0.0", "dependencies": { - "@aws-sdk/client-s3": "^3.948.0", - "@aws-sdk/s3-request-presigner": "^3.948.0", + "@aws-sdk/client-s3": "^3.1004.0", + "@aws-sdk/s3-request-presigner": "^3.1004.0", "@types/cookie-parser": "^1.4.10", "@types/multer": "^2.0.0", "bcrypt": "^6.0.0", @@ -24,6 +24,7 @@ "multer": "^2.0.2", "nodemailer": "^7.0.11", "pino": "^10.1.0", + "sharp": "^0.34.5", "ua-parser-js": "^2.0.6", "undici": "^7.16.0", "zod": "^4.1.13" @@ -247,43 +248,578 @@ } }, "node_modules/@aws-sdk/client-s3": { - "version": "3.948.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-s3/-/client-s3-3.948.0.tgz", - "integrity": "sha512-uvEjds8aYA9SzhBS8RKDtsDUhNV9VhqKiHTcmvhM7gJO92q0WTn8/QeFTdNyLc6RxpiDyz+uBxS7PcdNiZzqfA==", + "version": "3.1004.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-s3/-/client-s3-3.1004.0.tgz", + "integrity": "sha512-m0zNfpsona9jQdX1cHtHArOiuvSGZPsgp/KRZS2YjJhKah96G2UN3UNGZQ6aVjXIQjCY6UanCJo0uW9Xf2U41w==", "license": "Apache-2.0", "dependencies": { "@aws-crypto/sha1-browser": "5.2.0", "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.947.0", - "@aws-sdk/credential-provider-node": "3.948.0", - "@aws-sdk/middleware-bucket-endpoint": "3.936.0", - "@aws-sdk/middleware-expect-continue": "3.936.0", - "@aws-sdk/middleware-flexible-checksums": "3.947.0", + "@aws-sdk/core": "^3.973.18", + "@aws-sdk/credential-provider-node": "^3.972.18", + "@aws-sdk/middleware-bucket-endpoint": "^3.972.7", + "@aws-sdk/middleware-expect-continue": "^3.972.7", + "@aws-sdk/middleware-flexible-checksums": "^3.973.4", + "@aws-sdk/middleware-host-header": "^3.972.7", + "@aws-sdk/middleware-location-constraint": "^3.972.7", + "@aws-sdk/middleware-logger": "^3.972.7", + "@aws-sdk/middleware-recursion-detection": "^3.972.7", + "@aws-sdk/middleware-sdk-s3": "^3.972.18", + "@aws-sdk/middleware-ssec": "^3.972.7", + "@aws-sdk/middleware-user-agent": "^3.972.19", + "@aws-sdk/region-config-resolver": "^3.972.7", + "@aws-sdk/signature-v4-multi-region": "^3.996.6", + "@aws-sdk/types": "^3.973.5", + "@aws-sdk/util-endpoints": "^3.996.4", + "@aws-sdk/util-user-agent-browser": "^3.972.7", + "@aws-sdk/util-user-agent-node": "^3.973.4", + "@smithy/config-resolver": "^4.4.10", + "@smithy/core": "^3.23.8", + "@smithy/eventstream-serde-browser": "^4.2.11", + "@smithy/eventstream-serde-config-resolver": "^4.3.11", + "@smithy/eventstream-serde-node": "^4.2.11", + "@smithy/fetch-http-handler": "^5.3.13", + "@smithy/hash-blob-browser": "^4.2.12", + "@smithy/hash-node": "^4.2.11", + "@smithy/hash-stream-node": "^4.2.11", + "@smithy/invalid-dependency": "^4.2.11", + "@smithy/md5-js": "^4.2.11", + "@smithy/middleware-content-length": "^4.2.11", + "@smithy/middleware-endpoint": "^4.4.22", + "@smithy/middleware-retry": "^4.4.39", + "@smithy/middleware-serde": "^4.2.12", + "@smithy/middleware-stack": "^4.2.11", + "@smithy/node-config-provider": "^4.3.11", + "@smithy/node-http-handler": "^4.4.14", + "@smithy/protocol-http": "^5.3.11", + "@smithy/smithy-client": "^4.12.2", + "@smithy/types": "^4.13.0", + "@smithy/url-parser": "^4.2.11", + "@smithy/util-base64": "^4.3.2", + "@smithy/util-body-length-browser": "^4.2.2", + "@smithy/util-body-length-node": "^4.2.3", + "@smithy/util-defaults-mode-browser": "^4.3.38", + "@smithy/util-defaults-mode-node": "^4.2.41", + "@smithy/util-endpoints": "^3.3.2", + "@smithy/util-middleware": "^4.2.11", + "@smithy/util-retry": "^4.2.11", + "@smithy/util-stream": "^4.5.17", + "@smithy/util-utf8": "^4.2.2", + "@smithy/util-waiter": "^4.2.11", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/core": { + "version": "3.973.18", + "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.973.18.tgz", + "integrity": "sha512-GUIlegfcK2LO1J2Y98sCJy63rQSiLiDOgVw7HiHPRqfI2vb3XozTVqemwO0VSGXp54ngCnAQz0Lf0YPCBINNxA==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "^3.973.5", + "@aws-sdk/xml-builder": "^3.972.10", + "@smithy/core": "^3.23.8", + "@smithy/node-config-provider": "^4.3.11", + "@smithy/property-provider": "^4.2.11", + "@smithy/protocol-http": "^5.3.11", + "@smithy/signature-v4": "^5.3.11", + "@smithy/smithy-client": "^4.12.2", + "@smithy/types": "^4.13.0", + "@smithy/util-base64": "^4.3.2", + "@smithy/util-middleware": "^4.2.11", + "@smithy/util-utf8": "^4.2.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-env": { + "version": "3.972.16", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.972.16.tgz", + "integrity": "sha512-HrdtnadvTGAQUr18sPzGlE5El3ICphnH6SU7UQOMOWFgRKbTRNN8msTxM4emzguUso9CzaHU2xy5ctSrmK5YNA==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "^3.973.18", + "@aws-sdk/types": "^3.973.5", + "@smithy/property-provider": "^4.2.11", + "@smithy/types": "^4.13.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-http": { + "version": "3.972.18", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.972.18.tgz", + "integrity": "sha512-NyB6smuZAixND5jZumkpkunQ0voc4Mwgkd+SZ6cvAzIB7gK8HV8Zd4rS8Kn5MmoGgusyNfVGG+RLoYc4yFiw+A==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "^3.973.18", + "@aws-sdk/types": "^3.973.5", + "@smithy/fetch-http-handler": "^5.3.13", + "@smithy/node-http-handler": "^4.4.14", + "@smithy/property-provider": "^4.2.11", + "@smithy/protocol-http": "^5.3.11", + "@smithy/smithy-client": "^4.12.2", + "@smithy/types": "^4.13.0", + "@smithy/util-stream": "^4.5.17", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.972.17", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.972.17.tgz", + "integrity": "sha512-dFqh7nfX43B8dO1aPQHOcjC0SnCJ83H3F+1LoCh3X1P7E7N09I+0/taID0asU6GCddfDExqnEvQtDdkuMe5tKQ==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "^3.973.18", + "@aws-sdk/credential-provider-env": "^3.972.16", + "@aws-sdk/credential-provider-http": "^3.972.18", + "@aws-sdk/credential-provider-login": "^3.972.17", + "@aws-sdk/credential-provider-process": "^3.972.16", + "@aws-sdk/credential-provider-sso": "^3.972.17", + "@aws-sdk/credential-provider-web-identity": "^3.972.17", + "@aws-sdk/nested-clients": "^3.996.7", + "@aws-sdk/types": "^3.973.5", + "@smithy/credential-provider-imds": "^4.2.11", + "@smithy/property-provider": "^4.2.11", + "@smithy/shared-ini-file-loader": "^4.4.6", + "@smithy/types": "^4.13.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-login": { + "version": "3.972.17", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-login/-/credential-provider-login-3.972.17.tgz", + "integrity": "sha512-gf2E5b7LpKb+JX2oQsRIDxdRZjBFZt2olCGlWCdb3vBERbXIPgm2t1R5mEnwd4j0UEO/Tbg5zN2KJbHXttJqwA==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "^3.973.18", + "@aws-sdk/nested-clients": "^3.996.7", + "@aws-sdk/types": "^3.973.5", + "@smithy/property-provider": "^4.2.11", + "@smithy/protocol-http": "^5.3.11", + "@smithy/shared-ini-file-loader": "^4.4.6", + "@smithy/types": "^4.13.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-node": { + "version": "3.972.18", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.972.18.tgz", + "integrity": "sha512-ZDJa2gd1xiPg/nBDGhUlat02O8obaDEnICBAVS8qieZ0+nDfaB0Z3ec6gjZj27OqFTjnB/Q5a0GwQwb7rMVViw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/credential-provider-env": "^3.972.16", + "@aws-sdk/credential-provider-http": "^3.972.18", + "@aws-sdk/credential-provider-ini": "^3.972.17", + "@aws-sdk/credential-provider-process": "^3.972.16", + "@aws-sdk/credential-provider-sso": "^3.972.17", + "@aws-sdk/credential-provider-web-identity": "^3.972.17", + "@aws-sdk/types": "^3.973.5", + "@smithy/credential-provider-imds": "^4.2.11", + "@smithy/property-provider": "^4.2.11", + "@smithy/shared-ini-file-loader": "^4.4.6", + "@smithy/types": "^4.13.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-process": { + "version": "3.972.16", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.972.16.tgz", + "integrity": "sha512-n89ibATwnLEg0ZdZmUds5bq8AfBAdoYEDpqP3uzPLaRuGelsKlIvCYSNNvfgGLi8NaHPNNhs1HjJZYbqkW9b+g==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "^3.973.18", + "@aws-sdk/types": "^3.973.5", + "@smithy/property-provider": "^4.2.11", + "@smithy/shared-ini-file-loader": "^4.4.6", + "@smithy/types": "^4.13.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.972.17", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.972.17.tgz", + "integrity": "sha512-wGtte+48xnhnhHMl/MsxzacBPs5A+7JJedjiP452IkHY7vsbYKcvQBqFye8LwdTJVeHtBHv+JFeTscnwepoWGg==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "^3.973.18", + "@aws-sdk/nested-clients": "^3.996.7", + "@aws-sdk/token-providers": "3.1004.0", + "@aws-sdk/types": "^3.973.5", + "@smithy/property-provider": "^4.2.11", + "@smithy/shared-ini-file-loader": "^4.4.6", + "@smithy/types": "^4.13.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.972.17", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.972.17.tgz", + "integrity": "sha512-8aiVJh6fTdl8gcyL+sVNcNwTtWpmoFa1Sh7xlj6Z7L/cZ/tYMEBHq44wTYG8Kt0z/PpGNopD89nbj3FHl9QmTA==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "^3.973.18", + "@aws-sdk/nested-clients": "^3.996.7", + "@aws-sdk/types": "^3.973.5", + "@smithy/property-provider": "^4.2.11", + "@smithy/shared-ini-file-loader": "^4.4.6", + "@smithy/types": "^4.13.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-host-header": { + "version": "3.972.7", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.972.7.tgz", + "integrity": "sha512-aHQZgztBFEpDU1BB00VWCIIm85JjGjQW1OG9+98BdmaOpguJvzmXBGbnAiYcciCd+IS4e9BEq664lhzGnWJHgQ==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "^3.973.5", + "@smithy/protocol-http": "^5.3.11", + "@smithy/types": "^4.13.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-logger": { + "version": "3.972.7", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.972.7.tgz", + "integrity": "sha512-LXhiWlWb26txCU1vcI9PneESSeRp/RYY/McuM4SpdrimQR5NgwaPb4VJCadVeuGWgh6QmqZ6rAKSoL1ob16W6w==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "^3.973.5", + "@smithy/types": "^4.13.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.972.7", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.972.7.tgz", + "integrity": "sha512-l2VQdcBcYLzIzykCHtXlbpiVCZ94/xniLIkAj0jpnpjY4xlgZx7f56Ypn+uV1y3gG0tNVytJqo3K9bfMFee7SQ==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "^3.973.5", + "@aws/lambda-invoke-store": "^0.2.2", + "@smithy/protocol-http": "^5.3.11", + "@smithy/types": "^4.13.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-sdk-s3": { + "version": "3.972.18", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-s3/-/middleware-sdk-s3-3.972.18.tgz", + "integrity": "sha512-5E3XxaElrdyk6ZJ0TjH7Qm6ios4b/qQCiLr6oQ8NK7e4Kn6JBTJCaYioQCQ65BpZ1+l1mK5wTAac2+pEz0Smpw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "^3.973.18", + "@aws-sdk/types": "^3.973.5", + "@aws-sdk/util-arn-parser": "^3.972.3", + "@smithy/core": "^3.23.8", + "@smithy/node-config-provider": "^4.3.11", + "@smithy/protocol-http": "^5.3.11", + "@smithy/signature-v4": "^5.3.11", + "@smithy/smithy-client": "^4.12.2", + "@smithy/types": "^4.13.0", + "@smithy/util-config-provider": "^4.2.2", + "@smithy/util-middleware": "^4.2.11", + "@smithy/util-stream": "^4.5.17", + "@smithy/util-utf8": "^4.2.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.972.19", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.972.19.tgz", + "integrity": "sha512-Km90fcXt3W/iqujHzuM6IaDkYCj73gsYufcuWXApWdzoTy6KGk8fnchAjePMARU0xegIR3K4N3yIo1vy7OVe8A==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "^3.973.18", + "@aws-sdk/types": "^3.973.5", + "@aws-sdk/util-endpoints": "^3.996.4", + "@smithy/core": "^3.23.8", + "@smithy/protocol-http": "^5.3.11", + "@smithy/types": "^4.13.0", + "@smithy/util-retry": "^4.2.11", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/nested-clients": { + "version": "3.996.7", + "resolved": "https://registry.npmjs.org/@aws-sdk/nested-clients/-/nested-clients-3.996.7.tgz", + "integrity": "sha512-MlGWA8uPaOs5AiTZ5JLM4uuWDm9EEAnm9cqwvqQIc6kEgel/8s1BaOWm9QgUcfc9K8qd7KkC3n43yDbeXOA2tg==", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "^3.973.18", + "@aws-sdk/middleware-host-header": "^3.972.7", + "@aws-sdk/middleware-logger": "^3.972.7", + "@aws-sdk/middleware-recursion-detection": "^3.972.7", + "@aws-sdk/middleware-user-agent": "^3.972.19", + "@aws-sdk/region-config-resolver": "^3.972.7", + "@aws-sdk/types": "^3.973.5", + "@aws-sdk/util-endpoints": "^3.996.4", + "@aws-sdk/util-user-agent-browser": "^3.972.7", + "@aws-sdk/util-user-agent-node": "^3.973.4", + "@smithy/config-resolver": "^4.4.10", + "@smithy/core": "^3.23.8", + "@smithy/fetch-http-handler": "^5.3.13", + "@smithy/hash-node": "^4.2.11", + "@smithy/invalid-dependency": "^4.2.11", + "@smithy/middleware-content-length": "^4.2.11", + "@smithy/middleware-endpoint": "^4.4.22", + "@smithy/middleware-retry": "^4.4.39", + "@smithy/middleware-serde": "^4.2.12", + "@smithy/middleware-stack": "^4.2.11", + "@smithy/node-config-provider": "^4.3.11", + "@smithy/node-http-handler": "^4.4.14", + "@smithy/protocol-http": "^5.3.11", + "@smithy/smithy-client": "^4.12.2", + "@smithy/types": "^4.13.0", + "@smithy/url-parser": "^4.2.11", + "@smithy/util-base64": "^4.3.2", + "@smithy/util-body-length-browser": "^4.2.2", + "@smithy/util-body-length-node": "^4.2.3", + "@smithy/util-defaults-mode-browser": "^4.3.38", + "@smithy/util-defaults-mode-node": "^4.2.41", + "@smithy/util-endpoints": "^3.3.2", + "@smithy/util-middleware": "^4.2.11", + "@smithy/util-retry": "^4.2.11", + "@smithy/util-utf8": "^4.2.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/region-config-resolver": { + "version": "3.972.7", + "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.972.7.tgz", + "integrity": "sha512-/Ev/6AI8bvt4HAAptzSjThGUMjcWaX3GX8oERkB0F0F9x2dLSBdgFDiyrRz3i0u0ZFZFQ1b28is4QhyqXTUsVA==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "^3.973.5", + "@smithy/config-resolver": "^4.4.10", + "@smithy/node-config-provider": "^4.3.11", + "@smithy/types": "^4.13.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/signature-v4-multi-region": { + "version": "3.996.6", + "resolved": "https://registry.npmjs.org/@aws-sdk/signature-v4-multi-region/-/signature-v4-multi-region-3.996.6.tgz", + "integrity": "sha512-NnsOQsVmJXy4+IdPFUjRCWPn9qNH1TzS/f7MiWgXeoHs903tJpAWQWQtoFvLccyPoBgomKP9L89RRr2YsT/L0g==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/middleware-sdk-s3": "^3.972.18", + "@aws-sdk/types": "^3.973.5", + "@smithy/protocol-http": "^5.3.11", + "@smithy/signature-v4": "^5.3.11", + "@smithy/types": "^4.13.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/token-providers": { + "version": "3.1004.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.1004.0.tgz", + "integrity": "sha512-j9BwZZId9sFp+4GPhf6KrwO8Tben2sXibZA8D1vv2I1zBdvkUHcBA2g4pkqIpTRalMTLC0NPkBPX0gERxfy/iA==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "^3.973.18", + "@aws-sdk/nested-clients": "^3.996.7", + "@aws-sdk/types": "^3.973.5", + "@smithy/property-provider": "^4.2.11", + "@smithy/shared-ini-file-loader": "^4.4.6", + "@smithy/types": "^4.13.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/types": { + "version": "3.973.5", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.973.5.tgz", + "integrity": "sha512-hl7BGwDCWsjH8NkZfx+HgS7H2LyM2lTMAI7ba9c8O0KqdBLTdNJivsHpqjg9rNlAlPyREb6DeDRXUl0s8uFdmQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.13.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/util-arn-parser": { + "version": "3.972.3", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-arn-parser/-/util-arn-parser-3.972.3.tgz", + "integrity": "sha512-HzSD8PMFrvgi2Kserxuff5VitNq2sgf3w9qxmskKDiDTThWfVteJxuCS9JXiPIPtmCrp+7N9asfIaVhBFORllA==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/util-endpoints": { + "version": "3.996.4", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.996.4.tgz", + "integrity": "sha512-Hek90FBmd4joCFj+Vc98KLJh73Zqj3s2W56gjAcTkrNLMDI5nIFkG9YpfcJiVI1YlE2Ne1uOQNe+IgQ/Vz2XRA==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "^3.973.5", + "@smithy/types": "^4.13.0", + "@smithy/url-parser": "^4.2.11", + "@smithy/util-endpoints": "^3.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.972.7", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.972.7.tgz", + "integrity": "sha512-7SJVuvhKhMF/BkNS1n0QAJYgvEwYbK2QLKBrzDiwQGiTRU6Yf1f3nehTzm/l21xdAOtWSfp2uWSddPnP2ZtsVw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "^3.973.5", + "@smithy/types": "^4.13.0", + "bowser": "^2.11.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.973.4", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.973.4.tgz", + "integrity": "sha512-uqKeLqZ9D3nQjH7HGIERNXK9qnSpUK08l4MlJ5/NZqSSdeJsVANYp437EM9sEzwU28c2xfj2V6qlkqzsgtKs6Q==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/middleware-user-agent": "^3.972.19", + "@aws-sdk/types": "^3.973.5", + "@smithy/node-config-provider": "^4.3.11", + "@smithy/types": "^4.13.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + }, + "peerDependencies": { + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } + } + }, + "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/xml-builder": { + "version": "3.972.10", + "resolved": "https://registry.npmjs.org/@aws-sdk/xml-builder/-/xml-builder-3.972.10.tgz", + "integrity": "sha512-OnejAIVD+CxzyAUrVic7lG+3QRltyja9LoNqCE/1YVs8ichoTbJlVSaZ9iSMcnHLyzrSNtvaOGjSDRP+d/ouFA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.13.0", + "fast-xml-parser": "5.4.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/client-s3/node_modules/fast-xml-parser": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.4.1.tgz", + "integrity": "sha512-BQ30U1mKkvXQXXkAGcuyUA/GA26oEB7NzOtsxCDtyu62sjGw5QraKFhx2Em3WQNjPw9PG6MQ9yuIIgkSDfGu5A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT", + "dependencies": { + "fast-xml-builder": "^1.0.0", + "strnum": "^2.1.2" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, + "node_modules/@aws-sdk/client-sesv2": { + "version": "3.946.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sesv2/-/client-sesv2-3.946.0.tgz", + "integrity": "sha512-JYj3BPqgyRXgBjZ3Xvo4Abd+vLxcsHe4gb0TvwiSM/k7e6MRgBZoYwDOnwbNDs/62X1sn7MPHqqB3miuO4nR5g==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.946.0", + "@aws-sdk/credential-provider-node": "3.946.0", "@aws-sdk/middleware-host-header": "3.936.0", - "@aws-sdk/middleware-location-constraint": "3.936.0", "@aws-sdk/middleware-logger": "3.936.0", - "@aws-sdk/middleware-recursion-detection": "3.948.0", - "@aws-sdk/middleware-sdk-s3": "3.947.0", - "@aws-sdk/middleware-ssec": "3.936.0", - "@aws-sdk/middleware-user-agent": "3.947.0", + "@aws-sdk/middleware-recursion-detection": "3.936.0", + "@aws-sdk/middleware-user-agent": "3.946.0", "@aws-sdk/region-config-resolver": "3.936.0", - "@aws-sdk/signature-v4-multi-region": "3.947.0", + "@aws-sdk/signature-v4-multi-region": "3.946.0", "@aws-sdk/types": "3.936.0", "@aws-sdk/util-endpoints": "3.936.0", "@aws-sdk/util-user-agent-browser": "3.936.0", - "@aws-sdk/util-user-agent-node": "3.947.0", + "@aws-sdk/util-user-agent-node": "3.946.0", "@smithy/config-resolver": "^4.4.3", "@smithy/core": "^3.18.7", - "@smithy/eventstream-serde-browser": "^4.2.5", - "@smithy/eventstream-serde-config-resolver": "^4.3.5", - "@smithy/eventstream-serde-node": "^4.2.5", "@smithy/fetch-http-handler": "^5.3.6", - "@smithy/hash-blob-browser": "^4.2.6", "@smithy/hash-node": "^4.2.5", - "@smithy/hash-stream-node": "^4.2.5", "@smithy/invalid-dependency": "^4.2.5", - "@smithy/md5-js": "^4.2.5", "@smithy/middleware-content-length": "^4.2.5", "@smithy/middleware-endpoint": "^4.3.14", "@smithy/middleware-retry": "^4.4.14", @@ -303,33 +839,32 @@ "@smithy/util-endpoints": "^3.2.5", "@smithy/util-middleware": "^4.2.5", "@smithy/util-retry": "^4.2.5", - "@smithy/util-stream": "^4.5.6", "@smithy/util-utf8": "^4.2.0", - "@smithy/util-waiter": "^4.2.5", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/client-sso": { - "version": "3.948.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.948.0.tgz", - "integrity": "sha512-iWjchXy8bIAVBUsKnbfKYXRwhLgRg3EqCQ5FTr3JbR+QR75rZm4ZOYXlvHGztVTmtAZ+PQVA1Y4zO7v7N87C0A==", + "node_modules/@aws-sdk/client-sso": { + "version": "3.946.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.946.0.tgz", + "integrity": "sha512-kGAs5iIVyUz4p6TX3pzG5q3cNxXnVpC4pwRC6DCSaSv9ozyPjc2d74FsK4fZ+J+ejtvCdJk72uiuQtWJc86Wuw==", + "dev": true, "license": "Apache-2.0", "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.947.0", + "@aws-sdk/core": "3.946.0", "@aws-sdk/middleware-host-header": "3.936.0", "@aws-sdk/middleware-logger": "3.936.0", - "@aws-sdk/middleware-recursion-detection": "3.948.0", - "@aws-sdk/middleware-user-agent": "3.947.0", + "@aws-sdk/middleware-recursion-detection": "3.936.0", + "@aws-sdk/middleware-user-agent": "3.946.0", "@aws-sdk/region-config-resolver": "3.936.0", "@aws-sdk/types": "3.936.0", "@aws-sdk/util-endpoints": "3.936.0", "@aws-sdk/util-user-agent-browser": "3.936.0", - "@aws-sdk/util-user-agent-node": "3.947.0", + "@aws-sdk/util-user-agent-node": "3.946.0", "@smithy/config-resolver": "^4.4.3", "@smithy/core": "^3.18.7", "@smithy/fetch-http-handler": "^5.3.6", @@ -361,10 +896,11 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/core": { - "version": "3.947.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.947.0.tgz", - "integrity": "sha512-Khq4zHhuAkvCFuFbgcy3GrZTzfSX7ZIjIcW1zRDxXRLZKRtuhnZdonqTUfaWi5K42/4OmxkYNpsO7X7trQOeHw==", + "node_modules/@aws-sdk/core": { + "version": "3.946.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.946.0.tgz", + "integrity": "sha512-u2BkbLLVbMFrEiXrko2+S6ih5sUZPlbVyRPtXOqMHlCyzr70sE8kIiD6ba223rQeIFPcYfW/wHc6k4ihW2xxVg==", + "dev": true, "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "3.936.0", @@ -385,13 +921,27 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-env": { - "version": "3.947.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.947.0.tgz", - "integrity": "sha512-VR2V6dRELmzwAsCpK4GqxUi6UW5WNhAXS9F9AzWi5jvijwJo3nH92YNJUP4quMpgFZxJHEWyXLWgPjh9u0zYOA==", + "node_modules/@aws-sdk/crc64-nvme": { + "version": "3.972.4", + "resolved": "https://registry.npmjs.org/@aws-sdk/crc64-nvme/-/crc64-nvme-3.972.4.tgz", + "integrity": "sha512-HKZIZLbRyvzo/bXZU7Zmk6XqU+1C9DjI56xd02vwuDIxedxBEqP17t9ExhbP9QFeNq/a3l9GOcyirFXxmbDhmw==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.13.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-env": { + "version": "3.946.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.946.0.tgz", + "integrity": "sha512-P4l+K6wX1tf8LmWUvZofdQ+BgCNyk6Tb9u1H10npvqpuCD+dCM4pXIBq3PQcv/juUBOvLGGREo+Govuh3lfD0Q==", + "dev": true, "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.947.0", + "@aws-sdk/core": "3.946.0", "@aws-sdk/types": "3.936.0", "@smithy/property-provider": "^4.2.5", "@smithy/types": "^4.9.0", @@ -401,13 +951,14 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-http": { - "version": "3.947.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.947.0.tgz", - "integrity": "sha512-inF09lh9SlHj63Vmr5d+LmwPXZc2IbK8lAruhOr3KLsZAIHEgHgGPXWDC2ukTEMzg0pkexQ6FOhXXad6klK4RA==", + "node_modules/@aws-sdk/credential-provider-http": { + "version": "3.946.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.946.0.tgz", + "integrity": "sha512-/zeOJ6E7dGZQ/l2k7KytEoPJX0APIhwt0A79hPf/bUpMF4dDs2P6JmchDrotk0a0Y/MIdNF8sBQ/MEOPnBiYoQ==", + "dev": true, "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.947.0", + "@aws-sdk/core": "3.946.0", "@aws-sdk/types": "3.936.0", "@smithy/fetch-http-handler": "^5.3.6", "@smithy/node-http-handler": "^4.4.5", @@ -422,39 +973,41 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.948.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.948.0.tgz", - "integrity": "sha512-Cl//Qh88e8HBL7yYkJNpF5eq76IO6rq8GsatKcfVBm7RFVxCqYEPSSBtkHdbtNwQdRQqAMXc6E/lEB/CZUDxnA==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/core": "3.947.0", - "@aws-sdk/credential-provider-env": "3.947.0", - "@aws-sdk/credential-provider-http": "3.947.0", - "@aws-sdk/credential-provider-login": "3.948.0", - "@aws-sdk/credential-provider-process": "3.947.0", - "@aws-sdk/credential-provider-sso": "3.948.0", - "@aws-sdk/credential-provider-web-identity": "3.948.0", - "@aws-sdk/nested-clients": "3.948.0", - "@aws-sdk/types": "3.936.0", - "@smithy/credential-provider-imds": "^4.2.5", - "@smithy/property-provider": "^4.2.5", - "@smithy/shared-ini-file-loader": "^4.4.0", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, + "node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.946.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.946.0.tgz", + "integrity": "sha512-Pdgcra3RivWj/TuZmfFaHbqsvvgnSKO0CxlRUMMr0PgBiCnUhyl+zBktdNOeGsOPH2fUzQpYhcUjYUgVSdcSDQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.946.0", + "@aws-sdk/credential-provider-env": "3.946.0", + "@aws-sdk/credential-provider-http": "3.946.0", + "@aws-sdk/credential-provider-login": "3.946.0", + "@aws-sdk/credential-provider-process": "3.946.0", + "@aws-sdk/credential-provider-sso": "3.946.0", + "@aws-sdk/credential-provider-web-identity": "3.946.0", + "@aws-sdk/nested-clients": "3.946.0", + "@aws-sdk/types": "3.936.0", + "@smithy/credential-provider-imds": "^4.2.5", + "@smithy/property-provider": "^4.2.5", + "@smithy/shared-ini-file-loader": "^4.4.0", + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-login": { - "version": "3.948.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-login/-/credential-provider-login-3.948.0.tgz", - "integrity": "sha512-gcKO2b6eeTuZGp3Vvgr/9OxajMrD3W+FZ2FCyJox363ZgMoYJsyNid1vuZrEuAGkx0jvveLXfwiVS0UXyPkgtw==", + "node_modules/@aws-sdk/credential-provider-login": { + "version": "3.946.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-login/-/credential-provider-login-3.946.0.tgz", + "integrity": "sha512-5iqLNc15u2Zx+7jOdQkIbP62N7n2031tw5hkmIG0DLnozhnk64osOh2CliiOE9x3c4P9Pf4frAwgyy9GzNTk2g==", + "dev": true, "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.947.0", - "@aws-sdk/nested-clients": "3.948.0", + "@aws-sdk/core": "3.946.0", + "@aws-sdk/nested-clients": "3.946.0", "@aws-sdk/types": "3.936.0", "@smithy/property-provider": "^4.2.5", "@smithy/protocol-http": "^5.3.5", @@ -466,18 +1019,19 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-node": { - "version": "3.948.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.948.0.tgz", - "integrity": "sha512-ep5vRLnrRdcsP17Ef31sNN4g8Nqk/4JBydcUJuFRbGuyQtrZZrVT81UeH2xhz6d0BK6ejafDB9+ZpBjXuWT5/Q==", + "node_modules/@aws-sdk/credential-provider-node": { + "version": "3.946.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.946.0.tgz", + "integrity": "sha512-I7URUqnBPng1a5y81OImxrwERysZqMBREG6svhhGeZgxmqcpAZ8z5ywILeQXdEOCuuES8phUp/ojzxFjPXp/eA==", + "dev": true, "license": "Apache-2.0", "dependencies": { - "@aws-sdk/credential-provider-env": "3.947.0", - "@aws-sdk/credential-provider-http": "3.947.0", - "@aws-sdk/credential-provider-ini": "3.948.0", - "@aws-sdk/credential-provider-process": "3.947.0", - "@aws-sdk/credential-provider-sso": "3.948.0", - "@aws-sdk/credential-provider-web-identity": "3.948.0", + "@aws-sdk/credential-provider-env": "3.946.0", + "@aws-sdk/credential-provider-http": "3.946.0", + "@aws-sdk/credential-provider-ini": "3.946.0", + "@aws-sdk/credential-provider-process": "3.946.0", + "@aws-sdk/credential-provider-sso": "3.946.0", + "@aws-sdk/credential-provider-web-identity": "3.946.0", "@aws-sdk/types": "3.936.0", "@smithy/credential-provider-imds": "^4.2.5", "@smithy/property-provider": "^4.2.5", @@ -489,13 +1043,14 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-process": { - "version": "3.947.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.947.0.tgz", - "integrity": "sha512-WpanFbHe08SP1hAJNeDdBDVz9SGgMu/gc0XJ9u3uNpW99nKZjDpvPRAdW7WLA4K6essMjxWkguIGNOpij6Do2Q==", + "node_modules/@aws-sdk/credential-provider-process": { + "version": "3.946.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.946.0.tgz", + "integrity": "sha512-GtGHX7OGqIeVQ3DlVm5RRF43Qmf3S1+PLJv9svrdvAhAdy2bUb044FdXXqrtSsIfpzTKlHgQUiRo5MWLd35Ntw==", + "dev": true, "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.947.0", + "@aws-sdk/core": "3.946.0", "@aws-sdk/types": "3.936.0", "@smithy/property-provider": "^4.2.5", "@smithy/shared-ini-file-loader": "^4.4.0", @@ -506,15 +1061,16 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.948.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.948.0.tgz", - "integrity": "sha512-gqLhX1L+zb/ZDnnYbILQqJ46j735StfWV5PbDjxRzBKS7GzsiYoaf6MyHseEopmWrez5zl5l6aWzig7UpzSeQQ==", + "node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.946.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.946.0.tgz", + "integrity": "sha512-LeGSSt2V5iwYey1ENGY75RmoDP3bA2iE/py8QBKW8EDA8hn74XBLkprhrK5iccOvU3UGWY8WrEKFAFGNjJOL9g==", + "dev": true, "license": "Apache-2.0", "dependencies": { - "@aws-sdk/client-sso": "3.948.0", - "@aws-sdk/core": "3.947.0", - "@aws-sdk/token-providers": "3.948.0", + "@aws-sdk/client-sso": "3.946.0", + "@aws-sdk/core": "3.946.0", + "@aws-sdk/token-providers": "3.946.0", "@aws-sdk/types": "3.936.0", "@smithy/property-provider": "^4.2.5", "@smithy/shared-ini-file-loader": "^4.4.0", @@ -525,14 +1081,15 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-web-identity": { - "version": "3.948.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.948.0.tgz", - "integrity": "sha512-MvYQlXVoJyfF3/SmnNzOVEtANRAiJIObEUYYyjTqKZTmcRIVVky0tPuG26XnB8LmTYgtESwJIZJj/Eyyc9WURQ==", + "node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.946.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.946.0.tgz", + "integrity": "sha512-ocBCvjWfkbjxElBI1QUxOnHldsNhoU0uOICFvuRDAZAoxvypJHN3m5BJkqb7gqorBbcv3LRgmBdEnWXOAvq+7Q==", + "dev": true, "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.947.0", - "@aws-sdk/nested-clients": "3.948.0", + "@aws-sdk/core": "3.946.0", + "@aws-sdk/nested-clients": "3.946.0", "@aws-sdk/types": "3.936.0", "@smithy/property-provider": "^4.2.5", "@smithy/shared-ini-file-loader": "^4.4.0", @@ -543,14 +1100,180 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-recursion-detection": { - "version": "3.948.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.948.0.tgz", - "integrity": "sha512-Qa8Zj+EAqA0VlAVvxpRnpBpIWJI9KUwaioY1vkeNVwXPlNaz9y9zCKVM9iU9OZ5HXpoUg6TnhATAHXHAE8+QsQ==", + "node_modules/@aws-sdk/middleware-bucket-endpoint": { + "version": "3.972.7", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-bucket-endpoint/-/middleware-bucket-endpoint-3.972.7.tgz", + "integrity": "sha512-goX+axlJ6PQlRnzE2bQisZ8wVrlm6dXJfBzMJhd8LhAIBan/w1Kl73fJnalM/S+18VnpzIHumyV6DtgmvqG5IA==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "^3.973.5", + "@aws-sdk/util-arn-parser": "^3.972.3", + "@smithy/node-config-provider": "^4.3.11", + "@smithy/protocol-http": "^5.3.11", + "@smithy/types": "^4.13.0", + "@smithy/util-config-provider": "^4.2.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/middleware-bucket-endpoint/node_modules/@aws-sdk/types": { + "version": "3.973.5", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.973.5.tgz", + "integrity": "sha512-hl7BGwDCWsjH8NkZfx+HgS7H2LyM2lTMAI7ba9c8O0KqdBLTdNJivsHpqjg9rNlAlPyREb6DeDRXUl0s8uFdmQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.13.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/middleware-bucket-endpoint/node_modules/@aws-sdk/util-arn-parser": { + "version": "3.972.3", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-arn-parser/-/util-arn-parser-3.972.3.tgz", + "integrity": "sha512-HzSD8PMFrvgi2Kserxuff5VitNq2sgf3w9qxmskKDiDTThWfVteJxuCS9JXiPIPtmCrp+7N9asfIaVhBFORllA==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/middleware-expect-continue": { + "version": "3.972.7", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-expect-continue/-/middleware-expect-continue-3.972.7.tgz", + "integrity": "sha512-mvWqvm61bmZUKmmrtl2uWbokqpenY3Mc3Jf4nXB/Hse6gWxLPaCQThmhPBDzsPSV8/Odn8V6ovWt3pZ7vy4BFQ==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "^3.973.5", + "@smithy/protocol-http": "^5.3.11", + "@smithy/types": "^4.13.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/middleware-expect-continue/node_modules/@aws-sdk/types": { + "version": "3.973.5", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.973.5.tgz", + "integrity": "sha512-hl7BGwDCWsjH8NkZfx+HgS7H2LyM2lTMAI7ba9c8O0KqdBLTdNJivsHpqjg9rNlAlPyREb6DeDRXUl0s8uFdmQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.13.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/middleware-flexible-checksums": { + "version": "3.973.4", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-flexible-checksums/-/middleware-flexible-checksums-3.973.4.tgz", + "integrity": "sha512-7CH2jcGmkvkHc5Buz9IGbdjq1729AAlgYJiAvGq7qhCHqYleCsriWdSnmsqWTwdAfXHMT+pkxX3w6v5tJNcSug==", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/crc32": "5.2.0", + "@aws-crypto/crc32c": "5.2.0", + "@aws-crypto/util": "5.2.0", + "@aws-sdk/core": "^3.973.18", + "@aws-sdk/crc64-nvme": "^3.972.4", + "@aws-sdk/types": "^3.973.5", + "@smithy/is-array-buffer": "^4.2.2", + "@smithy/node-config-provider": "^4.3.11", + "@smithy/protocol-http": "^5.3.11", + "@smithy/types": "^4.13.0", + "@smithy/util-middleware": "^4.2.11", + "@smithy/util-stream": "^4.5.17", + "@smithy/util-utf8": "^4.2.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/middleware-flexible-checksums/node_modules/@aws-sdk/core": { + "version": "3.973.18", + "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.973.18.tgz", + "integrity": "sha512-GUIlegfcK2LO1J2Y98sCJy63rQSiLiDOgVw7HiHPRqfI2vb3XozTVqemwO0VSGXp54ngCnAQz0Lf0YPCBINNxA==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "^3.973.5", + "@aws-sdk/xml-builder": "^3.972.10", + "@smithy/core": "^3.23.8", + "@smithy/node-config-provider": "^4.3.11", + "@smithy/property-provider": "^4.2.11", + "@smithy/protocol-http": "^5.3.11", + "@smithy/signature-v4": "^5.3.11", + "@smithy/smithy-client": "^4.12.2", + "@smithy/types": "^4.13.0", + "@smithy/util-base64": "^4.3.2", + "@smithy/util-middleware": "^4.2.11", + "@smithy/util-utf8": "^4.2.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/middleware-flexible-checksums/node_modules/@aws-sdk/types": { + "version": "3.973.5", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.973.5.tgz", + "integrity": "sha512-hl7BGwDCWsjH8NkZfx+HgS7H2LyM2lTMAI7ba9c8O0KqdBLTdNJivsHpqjg9rNlAlPyREb6DeDRXUl0s8uFdmQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.13.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/middleware-flexible-checksums/node_modules/@aws-sdk/xml-builder": { + "version": "3.972.10", + "resolved": "https://registry.npmjs.org/@aws-sdk/xml-builder/-/xml-builder-3.972.10.tgz", + "integrity": "sha512-OnejAIVD+CxzyAUrVic7lG+3QRltyja9LoNqCE/1YVs8ichoTbJlVSaZ9iSMcnHLyzrSNtvaOGjSDRP+d/ouFA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.13.0", + "fast-xml-parser": "5.4.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/middleware-flexible-checksums/node_modules/fast-xml-parser": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.4.1.tgz", + "integrity": "sha512-BQ30U1mKkvXQXXkAGcuyUA/GA26oEB7NzOtsxCDtyu62sjGw5QraKFhx2Em3WQNjPw9PG6MQ9yuIIgkSDfGu5A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT", + "dependencies": { + "fast-xml-builder": "^1.0.0", + "strnum": "^2.1.2" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, + "node_modules/@aws-sdk/middleware-host-header": { + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.936.0.tgz", + "integrity": "sha512-tAaObaAnsP1XnLGndfkGWFuzrJYuk9W0b/nLvol66t8FZExIAf/WdkT2NNAWOYxljVs++oHnyHBCxIlaHrzSiw==", + "dev": true, "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "3.936.0", - "@aws/lambda-invoke-store": "^0.2.2", "@smithy/protocol-http": "^5.3.5", "@smithy/types": "^4.9.0", "tslib": "^2.6.2" @@ -559,13 +1282,73 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-sdk-s3": { - "version": "3.947.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-s3/-/middleware-sdk-s3-3.947.0.tgz", - "integrity": "sha512-DS2tm5YBKhPW2PthrRBDr6eufChbwXe0NjtTZcYDfUCXf0OR+W6cIqyKguwHMJ+IyYdey30AfVw9/Lb5KB8U8A==", + "node_modules/@aws-sdk/middleware-location-constraint": { + "version": "3.972.7", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-location-constraint/-/middleware-location-constraint-3.972.7.tgz", + "integrity": "sha512-vdK1LJfffBp87Lj0Bw3WdK1rJk9OLDYdQpqoKgmpIZPe+4+HawZ6THTbvjhJt4C4MNnRrHTKHQjkwBiIpDBoig==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "^3.973.5", + "@smithy/types": "^4.13.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/middleware-location-constraint/node_modules/@aws-sdk/types": { + "version": "3.973.5", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.973.5.tgz", + "integrity": "sha512-hl7BGwDCWsjH8NkZfx+HgS7H2LyM2lTMAI7ba9c8O0KqdBLTdNJivsHpqjg9rNlAlPyREb6DeDRXUl0s8uFdmQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.13.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/middleware-logger": { + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.936.0.tgz", + "integrity": "sha512-aPSJ12d3a3Ea5nyEnLbijCaaYJT2QjQ9iW+zGh5QcZYXmOGWbKVyPSxmVOboZQG+c1M8t6d2O7tqrwzIq8L8qw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.936.0", + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.936.0.tgz", + "integrity": "sha512-l4aGbHpXM45YNgXggIux1HgsCVAvvBoqHPkqLnqMl9QVapfuSTjJHfDYDsx1Xxct6/m7qSMUzanBALhiaGO2fA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.936.0", + "@aws/lambda-invoke-store": "^0.2.0", + "@smithy/protocol-http": "^5.3.5", + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/middleware-sdk-s3": { + "version": "3.946.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-s3/-/middleware-sdk-s3-3.946.0.tgz", + "integrity": "sha512-0UTFmFd8PX2k/jLu/DBmR+mmLQWAtUGHYps9Rjx3dcXNwaMLaa/39NoV3qn7Dwzfpqc6JZlZzBk+NDOCJIHW9g==", + "dev": true, "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.947.0", + "@aws-sdk/core": "3.946.0", "@aws-sdk/types": "3.936.0", "@aws-sdk/util-arn-parser": "3.893.0", "@smithy/core": "^3.18.7", @@ -584,13 +1367,41 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-user-agent": { - "version": "3.947.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.947.0.tgz", - "integrity": "sha512-7rpKV8YNgCP2R4F9RjWZFcD2R+SO/0R4VHIbY9iZJdH2MzzJ8ZG7h8dZ2m8QkQd1fjx4wrFJGGPJUTYXPV3baA==", + "node_modules/@aws-sdk/middleware-ssec": { + "version": "3.972.7", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-ssec/-/middleware-ssec-3.972.7.tgz", + "integrity": "sha512-G9clGVuAml7d8DYzY6DnRi7TIIDRvZ3YpqJPz/8wnWS5fYx/FNWNmkO6iJVlVkQg9BfeMzd+bVPtPJOvC4B+nQ==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "^3.973.5", + "@smithy/types": "^4.13.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/middleware-ssec/node_modules/@aws-sdk/types": { + "version": "3.973.5", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.973.5.tgz", + "integrity": "sha512-hl7BGwDCWsjH8NkZfx+HgS7H2LyM2lTMAI7ba9c8O0KqdBLTdNJivsHpqjg9rNlAlPyREb6DeDRXUl0s8uFdmQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.13.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.946.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.946.0.tgz", + "integrity": "sha512-7QcljCraeaWQNuqmOoAyZs8KpZcuhPiqdeeKoRd397jVGNRehLFsZbIMOvwaluUDFY11oMyXOkQEERe1Zo2fCw==", + "dev": true, "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.947.0", + "@aws-sdk/core": "3.946.0", "@aws-sdk/types": "3.936.0", "@aws-sdk/util-endpoints": "3.936.0", "@smithy/core": "^3.18.7", @@ -602,24 +1413,25 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/nested-clients": { - "version": "3.948.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/nested-clients/-/nested-clients-3.948.0.tgz", - "integrity": "sha512-zcbJfBsB6h254o3NuoEkf0+UY1GpE9ioiQdENWv7odo69s8iaGBEQ4BDpsIMqcuiiUXw1uKIVNxCB1gUGYz8lw==", + "node_modules/@aws-sdk/nested-clients": { + "version": "3.946.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/nested-clients/-/nested-clients-3.946.0.tgz", + "integrity": "sha512-rjAtEguukeW8mlyEQMQI56vxFoyWlaNwowmz1p1rav948SUjtrzjHAp4TOQWhibb7AR7BUTHBCgIcyCRjBEf4g==", + "dev": true, "license": "Apache-2.0", "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.947.0", + "@aws-sdk/core": "3.946.0", "@aws-sdk/middleware-host-header": "3.936.0", "@aws-sdk/middleware-logger": "3.936.0", - "@aws-sdk/middleware-recursion-detection": "3.948.0", - "@aws-sdk/middleware-user-agent": "3.947.0", + "@aws-sdk/middleware-recursion-detection": "3.936.0", + "@aws-sdk/middleware-user-agent": "3.946.0", "@aws-sdk/region-config-resolver": "3.936.0", "@aws-sdk/types": "3.936.0", "@aws-sdk/util-endpoints": "3.936.0", "@aws-sdk/util-user-agent-browser": "3.936.0", - "@aws-sdk/util-user-agent-node": "3.947.0", + "@aws-sdk/util-user-agent-node": "3.946.0", "@smithy/config-resolver": "^4.4.3", "@smithy/core": "^3.18.7", "@smithy/fetch-http-handler": "^5.3.6", @@ -651,16 +1463,16 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/signature-v4-multi-region": { - "version": "3.947.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/signature-v4-multi-region/-/signature-v4-multi-region-3.947.0.tgz", - "integrity": "sha512-UaYmzoxf9q3mabIA2hc4T6x5YSFUG2BpNjAZ207EA1bnQMiK+d6vZvb83t7dIWL/U1de1sGV19c1C81Jf14rrA==", + "node_modules/@aws-sdk/region-config-resolver": { + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.936.0.tgz", + "integrity": "sha512-wOKhzzWsshXGduxO4pqSiNyL9oUtk4BEvjWm9aaq6Hmfdoydq6v6t0rAGHWPjFwy9z2haovGRi3C8IxdMB4muw==", + "dev": true, "license": "Apache-2.0", "dependencies": { - "@aws-sdk/middleware-sdk-s3": "3.947.0", "@aws-sdk/types": "3.936.0", - "@smithy/protocol-http": "^5.3.5", - "@smithy/signature-v4": "^5.3.5", + "@smithy/config-resolver": "^4.4.3", + "@smithy/node-config-provider": "^4.3.5", "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, @@ -668,231 +1480,177 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/token-providers": { - "version": "3.948.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.948.0.tgz", - "integrity": "sha512-V487/kM4Teq5dcr1t5K6eoUKuqlGr9FRWL3MIMukMERJXHZvio6kox60FZ/YtciRHRI75u14YUqm2Dzddcu3+A==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/core": "3.947.0", - "@aws-sdk/nested-clients": "3.948.0", - "@aws-sdk/types": "3.936.0", - "@smithy/property-provider": "^4.2.5", - "@smithy/shared-ini-file-loader": "^4.4.0", - "@smithy/types": "^4.9.0", + "node_modules/@aws-sdk/s3-request-presigner": { + "version": "3.1004.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/s3-request-presigner/-/s3-request-presigner-3.1004.0.tgz", + "integrity": "sha512-JlYj2tDr14czOkXtsK8x27xein8MgHtYzI1d2V3uswlh/ngZncrRhbWXnqW35DsRUSVj8cmvabKxilVitRJ0rw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/signature-v4-multi-region": "^3.996.6", + "@aws-sdk/types": "^3.973.5", + "@aws-sdk/util-format-url": "^3.972.7", + "@smithy/middleware-endpoint": "^4.4.22", + "@smithy/protocol-http": "^5.3.11", + "@smithy/smithy-client": "^4.12.2", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.947.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.947.0.tgz", - "integrity": "sha512-+vhHoDrdbb+zerV4noQk1DHaUMNzWFWPpPYjVTwW2186k5BEJIecAMChYkghRrBVJ3KPWP1+JnZwOd72F3d4rQ==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/middleware-user-agent": "3.947.0", - "@aws-sdk/types": "3.936.0", - "@smithy/node-config-provider": "^4.3.5", - "@smithy/types": "^4.9.0", + "node_modules/@aws-sdk/s3-request-presigner/node_modules/@aws-sdk/core": { + "version": "3.973.18", + "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.973.18.tgz", + "integrity": "sha512-GUIlegfcK2LO1J2Y98sCJy63rQSiLiDOgVw7HiHPRqfI2vb3XozTVqemwO0VSGXp54ngCnAQz0Lf0YPCBINNxA==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "^3.973.5", + "@aws-sdk/xml-builder": "^3.972.10", + "@smithy/core": "^3.23.8", + "@smithy/node-config-provider": "^4.3.11", + "@smithy/property-provider": "^4.2.11", + "@smithy/protocol-http": "^5.3.11", + "@smithy/signature-v4": "^5.3.11", + "@smithy/smithy-client": "^4.12.2", + "@smithy/types": "^4.13.0", + "@smithy/util-base64": "^4.3.2", + "@smithy/util-middleware": "^4.2.11", + "@smithy/util-utf8": "^4.2.2", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" - }, - "peerDependencies": { - "aws-crt": ">=1.0.0" + "node": ">=20.0.0" + } + }, + "node_modules/@aws-sdk/s3-request-presigner/node_modules/@aws-sdk/middleware-sdk-s3": { + "version": "3.972.18", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-s3/-/middleware-sdk-s3-3.972.18.tgz", + "integrity": "sha512-5E3XxaElrdyk6ZJ0TjH7Qm6ios4b/qQCiLr6oQ8NK7e4Kn6JBTJCaYioQCQ65BpZ1+l1mK5wTAac2+pEz0Smpw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "^3.973.18", + "@aws-sdk/types": "^3.973.5", + "@aws-sdk/util-arn-parser": "^3.972.3", + "@smithy/core": "^3.23.8", + "@smithy/node-config-provider": "^4.3.11", + "@smithy/protocol-http": "^5.3.11", + "@smithy/signature-v4": "^5.3.11", + "@smithy/smithy-client": "^4.12.2", + "@smithy/types": "^4.13.0", + "@smithy/util-config-provider": "^4.2.2", + "@smithy/util-middleware": "^4.2.11", + "@smithy/util-stream": "^4.5.17", + "@smithy/util-utf8": "^4.2.2", + "tslib": "^2.6.2" }, - "peerDependenciesMeta": { - "aws-crt": { - "optional": true - } + "engines": { + "node": ">=20.0.0" } }, - "node_modules/@aws-sdk/client-sesv2": { - "version": "3.946.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sesv2/-/client-sesv2-3.946.0.tgz", - "integrity": "sha512-JYj3BPqgyRXgBjZ3Xvo4Abd+vLxcsHe4gb0TvwiSM/k7e6MRgBZoYwDOnwbNDs/62X1sn7MPHqqB3miuO4nR5g==", - "dev": true, + "node_modules/@aws-sdk/s3-request-presigner/node_modules/@aws-sdk/signature-v4-multi-region": { + "version": "3.996.6", + "resolved": "https://registry.npmjs.org/@aws-sdk/signature-v4-multi-region/-/signature-v4-multi-region-3.996.6.tgz", + "integrity": "sha512-NnsOQsVmJXy4+IdPFUjRCWPn9qNH1TzS/f7MiWgXeoHs903tJpAWQWQtoFvLccyPoBgomKP9L89RRr2YsT/L0g==", "license": "Apache-2.0", "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.946.0", - "@aws-sdk/credential-provider-node": "3.946.0", - "@aws-sdk/middleware-host-header": "3.936.0", - "@aws-sdk/middleware-logger": "3.936.0", - "@aws-sdk/middleware-recursion-detection": "3.936.0", - "@aws-sdk/middleware-user-agent": "3.946.0", - "@aws-sdk/region-config-resolver": "3.936.0", - "@aws-sdk/signature-v4-multi-region": "3.946.0", - "@aws-sdk/types": "3.936.0", - "@aws-sdk/util-endpoints": "3.936.0", - "@aws-sdk/util-user-agent-browser": "3.936.0", - "@aws-sdk/util-user-agent-node": "3.946.0", - "@smithy/config-resolver": "^4.4.3", - "@smithy/core": "^3.18.7", - "@smithy/fetch-http-handler": "^5.3.6", - "@smithy/hash-node": "^4.2.5", - "@smithy/invalid-dependency": "^4.2.5", - "@smithy/middleware-content-length": "^4.2.5", - "@smithy/middleware-endpoint": "^4.3.14", - "@smithy/middleware-retry": "^4.4.14", - "@smithy/middleware-serde": "^4.2.6", - "@smithy/middleware-stack": "^4.2.5", - "@smithy/node-config-provider": "^4.3.5", - "@smithy/node-http-handler": "^4.4.5", - "@smithy/protocol-http": "^5.3.5", - "@smithy/smithy-client": "^4.9.10", - "@smithy/types": "^4.9.0", - "@smithy/url-parser": "^4.2.5", - "@smithy/util-base64": "^4.3.0", - "@smithy/util-body-length-browser": "^4.2.0", - "@smithy/util-body-length-node": "^4.2.1", - "@smithy/util-defaults-mode-browser": "^4.3.13", - "@smithy/util-defaults-mode-node": "^4.2.16", - "@smithy/util-endpoints": "^3.2.5", - "@smithy/util-middleware": "^4.2.5", - "@smithy/util-retry": "^4.2.5", - "@smithy/util-utf8": "^4.2.0", + "@aws-sdk/middleware-sdk-s3": "^3.972.18", + "@aws-sdk/types": "^3.973.5", + "@smithy/protocol-http": "^5.3.11", + "@smithy/signature-v4": "^5.3.11", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, - "node_modules/@aws-sdk/client-sso": { - "version": "3.946.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.946.0.tgz", - "integrity": "sha512-kGAs5iIVyUz4p6TX3pzG5q3cNxXnVpC4pwRC6DCSaSv9ozyPjc2d74FsK4fZ+J+ejtvCdJk72uiuQtWJc86Wuw==", - "dev": true, + "node_modules/@aws-sdk/s3-request-presigner/node_modules/@aws-sdk/types": { + "version": "3.973.5", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.973.5.tgz", + "integrity": "sha512-hl7BGwDCWsjH8NkZfx+HgS7H2LyM2lTMAI7ba9c8O0KqdBLTdNJivsHpqjg9rNlAlPyREb6DeDRXUl0s8uFdmQ==", "license": "Apache-2.0", "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.946.0", - "@aws-sdk/middleware-host-header": "3.936.0", - "@aws-sdk/middleware-logger": "3.936.0", - "@aws-sdk/middleware-recursion-detection": "3.936.0", - "@aws-sdk/middleware-user-agent": "3.946.0", - "@aws-sdk/region-config-resolver": "3.936.0", - "@aws-sdk/types": "3.936.0", - "@aws-sdk/util-endpoints": "3.936.0", - "@aws-sdk/util-user-agent-browser": "3.936.0", - "@aws-sdk/util-user-agent-node": "3.946.0", - "@smithy/config-resolver": "^4.4.3", - "@smithy/core": "^3.18.7", - "@smithy/fetch-http-handler": "^5.3.6", - "@smithy/hash-node": "^4.2.5", - "@smithy/invalid-dependency": "^4.2.5", - "@smithy/middleware-content-length": "^4.2.5", - "@smithy/middleware-endpoint": "^4.3.14", - "@smithy/middleware-retry": "^4.4.14", - "@smithy/middleware-serde": "^4.2.6", - "@smithy/middleware-stack": "^4.2.5", - "@smithy/node-config-provider": "^4.3.5", - "@smithy/node-http-handler": "^4.4.5", - "@smithy/protocol-http": "^5.3.5", - "@smithy/smithy-client": "^4.9.10", - "@smithy/types": "^4.9.0", - "@smithy/url-parser": "^4.2.5", - "@smithy/util-base64": "^4.3.0", - "@smithy/util-body-length-browser": "^4.2.0", - "@smithy/util-body-length-node": "^4.2.1", - "@smithy/util-defaults-mode-browser": "^4.3.13", - "@smithy/util-defaults-mode-node": "^4.2.16", - "@smithy/util-endpoints": "^3.2.5", - "@smithy/util-middleware": "^4.2.5", - "@smithy/util-retry": "^4.2.5", - "@smithy/util-utf8": "^4.2.0", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, - "node_modules/@aws-sdk/core": { - "version": "3.946.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.946.0.tgz", - "integrity": "sha512-u2BkbLLVbMFrEiXrko2+S6ih5sUZPlbVyRPtXOqMHlCyzr70sE8kIiD6ba223rQeIFPcYfW/wHc6k4ihW2xxVg==", - "dev": true, + "node_modules/@aws-sdk/s3-request-presigner/node_modules/@aws-sdk/util-arn-parser": { + "version": "3.972.3", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-arn-parser/-/util-arn-parser-3.972.3.tgz", + "integrity": "sha512-HzSD8PMFrvgi2Kserxuff5VitNq2sgf3w9qxmskKDiDTThWfVteJxuCS9JXiPIPtmCrp+7N9asfIaVhBFORllA==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.936.0", - "@aws-sdk/xml-builder": "3.930.0", - "@smithy/core": "^3.18.7", - "@smithy/node-config-provider": "^4.3.5", - "@smithy/property-provider": "^4.2.5", - "@smithy/protocol-http": "^5.3.5", - "@smithy/signature-v4": "^5.3.5", - "@smithy/smithy-client": "^4.9.10", - "@smithy/types": "^4.9.0", - "@smithy/util-base64": "^4.3.0", - "@smithy/util-middleware": "^4.2.5", - "@smithy/util-utf8": "^4.2.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, - "node_modules/@aws-sdk/credential-provider-env": { - "version": "3.946.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.946.0.tgz", - "integrity": "sha512-P4l+K6wX1tf8LmWUvZofdQ+BgCNyk6Tb9u1H10npvqpuCD+dCM4pXIBq3PQcv/juUBOvLGGREo+Govuh3lfD0Q==", - "dev": true, + "node_modules/@aws-sdk/s3-request-presigner/node_modules/@aws-sdk/xml-builder": { + "version": "3.972.10", + "resolved": "https://registry.npmjs.org/@aws-sdk/xml-builder/-/xml-builder-3.972.10.tgz", + "integrity": "sha512-OnejAIVD+CxzyAUrVic7lG+3QRltyja9LoNqCE/1YVs8ichoTbJlVSaZ9iSMcnHLyzrSNtvaOGjSDRP+d/ouFA==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.946.0", - "@aws-sdk/types": "3.936.0", - "@smithy/property-provider": "^4.2.5", - "@smithy/types": "^4.9.0", + "@smithy/types": "^4.13.0", + "fast-xml-parser": "5.4.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, - "node_modules/@aws-sdk/credential-provider-http": { + "node_modules/@aws-sdk/s3-request-presigner/node_modules/fast-xml-parser": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.4.1.tgz", + "integrity": "sha512-BQ30U1mKkvXQXXkAGcuyUA/GA26oEB7NzOtsxCDtyu62sjGw5QraKFhx2Em3WQNjPw9PG6MQ9yuIIgkSDfGu5A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT", + "dependencies": { + "fast-xml-builder": "^1.0.0", + "strnum": "^2.1.2" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, + "node_modules/@aws-sdk/signature-v4-multi-region": { "version": "3.946.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.946.0.tgz", - "integrity": "sha512-/zeOJ6E7dGZQ/l2k7KytEoPJX0APIhwt0A79hPf/bUpMF4dDs2P6JmchDrotk0a0Y/MIdNF8sBQ/MEOPnBiYoQ==", + "resolved": "https://registry.npmjs.org/@aws-sdk/signature-v4-multi-region/-/signature-v4-multi-region-3.946.0.tgz", + "integrity": "sha512-61FZ685lKiJuQ06g6U7K3PL9EwKCxNm51wNlxyKV57nnl1GrLD0NC8O3/hDNkCQLNBArT9y3IXl2H7TtIxP8Jg==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.946.0", + "@aws-sdk/middleware-sdk-s3": "3.946.0", "@aws-sdk/types": "3.936.0", - "@smithy/fetch-http-handler": "^5.3.6", - "@smithy/node-http-handler": "^4.4.5", - "@smithy/property-provider": "^4.2.5", "@smithy/protocol-http": "^5.3.5", - "@smithy/smithy-client": "^4.9.10", + "@smithy/signature-v4": "^5.3.5", "@smithy/types": "^4.9.0", - "@smithy/util-stream": "^4.5.6", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-ini": { + "node_modules/@aws-sdk/token-providers": { "version": "3.946.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.946.0.tgz", - "integrity": "sha512-Pdgcra3RivWj/TuZmfFaHbqsvvgnSKO0CxlRUMMr0PgBiCnUhyl+zBktdNOeGsOPH2fUzQpYhcUjYUgVSdcSDQ==", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.946.0.tgz", + "integrity": "sha512-a5c+rM6CUPX2ExmUZ3DlbLlS5rQr4tbdoGcgBsjnAHiYx8MuMNAI+8M7wfjF13i2yvUQj5WEIddvLpayfEZj9g==", "dev": true, "license": "Apache-2.0", "dependencies": { "@aws-sdk/core": "3.946.0", - "@aws-sdk/credential-provider-env": "3.946.0", - "@aws-sdk/credential-provider-http": "3.946.0", - "@aws-sdk/credential-provider-login": "3.946.0", - "@aws-sdk/credential-provider-process": "3.946.0", - "@aws-sdk/credential-provider-sso": "3.946.0", - "@aws-sdk/credential-provider-web-identity": "3.946.0", "@aws-sdk/nested-clients": "3.946.0", "@aws-sdk/types": "3.936.0", - "@smithy/credential-provider-imds": "^4.2.5", "@smithy/property-provider": "^4.2.5", "@smithy/shared-ini-file-loader": "^4.4.0", "@smithy/types": "^4.9.0", @@ -902,19 +1660,12 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-login": { - "version": "3.946.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-login/-/credential-provider-login-3.946.0.tgz", - "integrity": "sha512-5iqLNc15u2Zx+7jOdQkIbP62N7n2031tw5hkmIG0DLnozhnk64osOh2CliiOE9x3c4P9Pf4frAwgyy9GzNTk2g==", - "dev": true, + "node_modules/@aws-sdk/types": { + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.936.0.tgz", + "integrity": "sha512-uz0/VlMd2pP5MepdrHizd+T+OKfyK4r3OA9JI+L/lPKg0YFQosdJNCKisr6o70E3dh8iMpFYxF1UN/4uZsyARg==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.946.0", - "@aws-sdk/nested-clients": "3.946.0", - "@aws-sdk/types": "3.936.0", - "@smithy/property-provider": "^4.2.5", - "@smithy/protocol-http": "^5.3.5", - "@smithy/shared-ini-file-loader": "^4.4.0", "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, @@ -922,641 +1673,475 @@ "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-node": { - "version": "3.946.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.946.0.tgz", - "integrity": "sha512-I7URUqnBPng1a5y81OImxrwERysZqMBREG6svhhGeZgxmqcpAZ8z5ywILeQXdEOCuuES8phUp/ojzxFjPXp/eA==", + "node_modules/@aws-sdk/util-arn-parser": { + "version": "3.893.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-arn-parser/-/util-arn-parser-3.893.0.tgz", + "integrity": "sha512-u8H4f2Zsi19DGnwj5FSZzDMhytYF/bCh37vAtBsn3cNDL3YG578X5oc+wSX54pM3tOxS+NY7tvOAo52SW7koUA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@aws-sdk/credential-provider-env": "3.946.0", - "@aws-sdk/credential-provider-http": "3.946.0", - "@aws-sdk/credential-provider-ini": "3.946.0", - "@aws-sdk/credential-provider-process": "3.946.0", - "@aws-sdk/credential-provider-sso": "3.946.0", - "@aws-sdk/credential-provider-web-identity": "3.946.0", - "@aws-sdk/types": "3.936.0", - "@smithy/credential-provider-imds": "^4.2.5", - "@smithy/property-provider": "^4.2.5", - "@smithy/shared-ini-file-loader": "^4.4.0", - "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-process": { - "version": "3.946.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.946.0.tgz", - "integrity": "sha512-GtGHX7OGqIeVQ3DlVm5RRF43Qmf3S1+PLJv9svrdvAhAdy2bUb044FdXXqrtSsIfpzTKlHgQUiRo5MWLd35Ntw==", + "node_modules/@aws-sdk/util-endpoints": { + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.936.0.tgz", + "integrity": "sha512-0Zx3Ntdpu+z9Wlm7JKUBOzS9EunwKAb4KdGUQQxDqh5Lc3ta5uBoub+FgmVuzwnmBu9U1Os8UuwVTH0Lgu+P5w==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.946.0", "@aws-sdk/types": "3.936.0", - "@smithy/property-provider": "^4.2.5", - "@smithy/shared-ini-file-loader": "^4.4.0", "@smithy/types": "^4.9.0", + "@smithy/url-parser": "^4.2.5", + "@smithy/util-endpoints": "^3.2.5", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.946.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.946.0.tgz", - "integrity": "sha512-LeGSSt2V5iwYey1ENGY75RmoDP3bA2iE/py8QBKW8EDA8hn74XBLkprhrK5iccOvU3UGWY8WrEKFAFGNjJOL9g==", - "dev": true, + "node_modules/@aws-sdk/util-format-url": { + "version": "3.972.7", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-format-url/-/util-format-url-3.972.7.tgz", + "integrity": "sha512-V+PbnWfUl93GuFwsOHsAq7hY/fnm9kElRqR8IexIJr5Rvif9e614X5sGSyz3mVSf1YAZ+VTy63W1/pGdA55zyA==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/client-sso": "3.946.0", - "@aws-sdk/core": "3.946.0", - "@aws-sdk/token-providers": "3.946.0", - "@aws-sdk/types": "3.936.0", - "@smithy/property-provider": "^4.2.5", - "@smithy/shared-ini-file-loader": "^4.4.0", - "@smithy/types": "^4.9.0", + "@aws-sdk/types": "^3.973.5", + "@smithy/querystring-builder": "^4.2.11", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, - "node_modules/@aws-sdk/credential-provider-web-identity": { - "version": "3.946.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.946.0.tgz", - "integrity": "sha512-ocBCvjWfkbjxElBI1QUxOnHldsNhoU0uOICFvuRDAZAoxvypJHN3m5BJkqb7gqorBbcv3LRgmBdEnWXOAvq+7Q==", - "dev": true, + "node_modules/@aws-sdk/util-format-url/node_modules/@aws-sdk/types": { + "version": "3.973.5", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.973.5.tgz", + "integrity": "sha512-hl7BGwDCWsjH8NkZfx+HgS7H2LyM2lTMAI7ba9c8O0KqdBLTdNJivsHpqjg9rNlAlPyREb6DeDRXUl0s8uFdmQ==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "3.946.0", - "@aws-sdk/nested-clients": "3.946.0", - "@aws-sdk/types": "3.936.0", - "@smithy/property-provider": "^4.2.5", - "@smithy/shared-ini-file-loader": "^4.4.0", - "@smithy/types": "^4.9.0", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, - "node_modules/@aws-sdk/middleware-bucket-endpoint": { - "version": "3.936.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-bucket-endpoint/-/middleware-bucket-endpoint-3.936.0.tgz", - "integrity": "sha512-XLSVVfAorUxZh6dzF+HTOp4R1B5EQcdpGcPliWr0KUj2jukgjZEcqbBmjyMF/p9bmyQsONX80iURF1HLAlW0qg==", - "license": "Apache-2.0", + "node_modules/@aws-sdk/util-locate-window": { + "version": "3.893.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-locate-window/-/util-locate-window-3.893.0.tgz", + "integrity": "sha512-T89pFfgat6c8nMmpI8eKjBcDcgJq36+m9oiXbcUzeU55MP9ZuGgBomGjGnHaEyF36jenW9gmg3NfZDm0AO2XPg==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.936.0", - "@aws-sdk/util-arn-parser": "3.893.0", - "@smithy/node-config-provider": "^4.3.5", - "@smithy/protocol-http": "^5.3.5", - "@smithy/types": "^4.9.0", - "@smithy/util-config-provider": "^4.2.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/middleware-expect-continue": { + "node_modules/@aws-sdk/util-user-agent-browser": { "version": "3.936.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-expect-continue/-/middleware-expect-continue-3.936.0.tgz", - "integrity": "sha512-Eb4ELAC23bEQLJmUMYnPWcjD3FZIsmz2svDiXEcxRkQU9r7NRID7pM7C5NPH94wOfiCk0b2Y8rVyFXW0lGQwbA==", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.936.0.tgz", + "integrity": "sha512-eZ/XF6NxMtu+iCma58GRNRxSq4lHo6zHQLOZRIeL/ghqYJirqHdenMOwrzPettj60KWlv827RVebP9oNVrwZbw==", + "dev": true, "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "3.936.0", - "@smithy/protocol-http": "^5.3.5", "@smithy/types": "^4.9.0", + "bowser": "^2.11.0", "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/middleware-flexible-checksums": { - "version": "3.947.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-flexible-checksums/-/middleware-flexible-checksums-3.947.0.tgz", - "integrity": "sha512-kXXxS2raNESNO+zR0L4YInVjhcGGNI2Mx0AE1ThRhDkAt2se3a+rGf9equ9YvOqA1m8Jl/GSI8cXYvSxXmS9Ag==", + "node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.946.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.946.0.tgz", + "integrity": "sha512-a2UwwvzbK5AxHKUBupfg4s7VnkqRAHjYsuezHnKCniczmT4HZfP1NnfwwvLKEH8qaTrwenxjKSfq4UWmWkvG+Q==", + "dev": true, "license": "Apache-2.0", "dependencies": { - "@aws-crypto/crc32": "5.2.0", - "@aws-crypto/crc32c": "5.2.0", - "@aws-crypto/util": "5.2.0", - "@aws-sdk/core": "3.947.0", + "@aws-sdk/middleware-user-agent": "3.946.0", "@aws-sdk/types": "3.936.0", - "@smithy/is-array-buffer": "^4.2.0", "@smithy/node-config-provider": "^4.3.5", - "@smithy/protocol-http": "^5.3.5", "@smithy/types": "^4.9.0", - "@smithy/util-middleware": "^4.2.5", - "@smithy/util-stream": "^4.5.6", - "@smithy/util-utf8": "^4.2.0", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" + }, + "peerDependencies": { + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } } }, - "node_modules/@aws-sdk/middleware-flexible-checksums/node_modules/@aws-sdk/core": { - "version": "3.947.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.947.0.tgz", - "integrity": "sha512-Khq4zHhuAkvCFuFbgcy3GrZTzfSX7ZIjIcW1zRDxXRLZKRtuhnZdonqTUfaWi5K42/4OmxkYNpsO7X7trQOeHw==", + "node_modules/@aws-sdk/xml-builder": { + "version": "3.930.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/xml-builder/-/xml-builder-3.930.0.tgz", + "integrity": "sha512-YIfkD17GocxdmlUVc3ia52QhcWuRIUJonbF8A2CYfcWNV3HzvAqpcPeC0bYUhkK+8e8YO1ARnLKZQE0TlwzorA==", + "dev": true, "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.936.0", - "@aws-sdk/xml-builder": "3.930.0", - "@smithy/core": "^3.18.7", - "@smithy/node-config-provider": "^4.3.5", - "@smithy/property-provider": "^4.2.5", - "@smithy/protocol-http": "^5.3.5", - "@smithy/signature-v4": "^5.3.5", - "@smithy/smithy-client": "^4.9.10", "@smithy/types": "^4.9.0", - "@smithy/util-base64": "^4.3.0", - "@smithy/util-middleware": "^4.2.5", - "@smithy/util-utf8": "^4.2.0", + "fast-xml-parser": "5.2.5", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/middleware-host-header": { - "version": "3.936.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.936.0.tgz", - "integrity": "sha512-tAaObaAnsP1XnLGndfkGWFuzrJYuk9W0b/nLvol66t8FZExIAf/WdkT2NNAWOYxljVs++oHnyHBCxIlaHrzSiw==", + "node_modules/@aws/lambda-invoke-store": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@aws/lambda-invoke-store/-/lambda-invoke-store-0.2.2.tgz", + "integrity": "sha512-C0NBLsIqzDIae8HFw9YIrIBsbc0xTiOtt7fAukGPnqQ/+zZNaq+4jhuccltK0QuWHBnNm/a6kLIRA6GFiM10eg==", "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.936.0", - "@smithy/protocol-http": "^5.3.5", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, "engines": { "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/middleware-location-constraint": { - "version": "3.936.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-location-constraint/-/middleware-location-constraint-3.936.0.tgz", - "integrity": "sha512-SCMPenDtQMd9o5da9JzkHz838w3327iqXk3cbNnXWqnNRx6unyW8FL0DZ84gIY12kAyVHz5WEqlWuekc15ehfw==", - "license": "Apache-2.0", + "node_modules/@emnapi/runtime": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.9.0.tgz", + "integrity": "sha512-QN75eB0IH2ywSpRpNddCRfQIhmJYBCJ1x5Lb3IscKAL8bMnVAKnRg8dCoXbHzVLLH7P38N2Z3mtulB7W0J0FKw==", + "license": "MIT", + "optional": true, "dependencies": { - "@aws-sdk/types": "3.936.0", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, + "tslib": "^2.4.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.1.tgz", + "integrity": "sha512-HHB50pdsBX6k47S4u5g/CaLjqS3qwaOVE5ILsq64jyzgMhLuCuZ8rGzM9yhsAjfjkbgUPMzZEPa7DAp7yz6vuA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], "engines": { - "node": ">=18.0.0" + "node": ">=18" } }, - "node_modules/@aws-sdk/middleware-logger": { - "version": "3.936.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.936.0.tgz", - "integrity": "sha512-aPSJ12d3a3Ea5nyEnLbijCaaYJT2QjQ9iW+zGh5QcZYXmOGWbKVyPSxmVOboZQG+c1M8t6d2O7tqrwzIq8L8qw==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.936.0", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, + "node_modules/@esbuild/android-arm": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.1.tgz", + "integrity": "sha512-kFqa6/UcaTbGm/NncN9kzVOODjhZW8e+FRdSeypWe6j33gzclHtwlANs26JrupOntlcWmB0u8+8HZo8s7thHvg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], "engines": { - "node": ">=18.0.0" + "node": ">=18" } }, - "node_modules/@aws-sdk/middleware-recursion-detection": { - "version": "3.936.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.936.0.tgz", - "integrity": "sha512-l4aGbHpXM45YNgXggIux1HgsCVAvvBoqHPkqLnqMl9QVapfuSTjJHfDYDsx1Xxct6/m7qSMUzanBALhiaGO2fA==", + "node_modules/@esbuild/android-arm64": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.1.tgz", + "integrity": "sha512-45fuKmAJpxnQWixOGCrS+ro4Uvb4Re9+UTieUY2f8AEc+t7d4AaZ6eUJ3Hva7dtrxAAWHtlEFsXFMAgNnGU9uQ==", + "cpu": [ + "arm64" + ], "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.936.0", - "@aws/lambda-invoke-store": "^0.2.0", - "@smithy/protocol-http": "^5.3.5", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], "engines": { - "node": ">=18.0.0" + "node": ">=18" } }, - "node_modules/@aws-sdk/middleware-sdk-s3": { - "version": "3.946.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-s3/-/middleware-sdk-s3-3.946.0.tgz", - "integrity": "sha512-0UTFmFd8PX2k/jLu/DBmR+mmLQWAtUGHYps9Rjx3dcXNwaMLaa/39NoV3qn7Dwzfpqc6JZlZzBk+NDOCJIHW9g==", + "node_modules/@esbuild/android-x64": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.1.tgz", + "integrity": "sha512-LBEpOz0BsgMEeHgenf5aqmn/lLNTFXVfoWMUox8CtWWYK9X4jmQzWjoGoNb8lmAYml/tQ/Ysvm8q7szu7BoxRQ==", + "cpu": [ + "x64" + ], "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/core": "3.946.0", - "@aws-sdk/types": "3.936.0", - "@aws-sdk/util-arn-parser": "3.893.0", - "@smithy/core": "^3.18.7", - "@smithy/node-config-provider": "^4.3.5", - "@smithy/protocol-http": "^5.3.5", - "@smithy/signature-v4": "^5.3.5", - "@smithy/smithy-client": "^4.9.10", - "@smithy/types": "^4.9.0", - "@smithy/util-config-provider": "^4.2.0", - "@smithy/util-middleware": "^4.2.5", - "@smithy/util-stream": "^4.5.6", - "@smithy/util-utf8": "^4.2.0", - "tslib": "^2.6.2" - }, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], "engines": { - "node": ">=18.0.0" + "node": ">=18" } }, - "node_modules/@aws-sdk/middleware-ssec": { - "version": "3.936.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-ssec/-/middleware-ssec-3.936.0.tgz", - "integrity": "sha512-/GLC9lZdVp05ozRik5KsuODR/N7j+W+2TbfdFL3iS+7un+gnP6hC8RDOZd6WhpZp7drXQ9guKiTAxkZQwzS8DA==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.936.0", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.1.tgz", + "integrity": "sha512-veg7fL8eMSCVKL7IW4pxb54QERtedFDfY/ASrumK/SbFsXnRazxY4YykN/THYqFnFwJ0aVjiUrVG2PwcdAEqQQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=18.0.0" + "node": ">=18" } }, - "node_modules/@aws-sdk/middleware-user-agent": { - "version": "3.946.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.946.0.tgz", - "integrity": "sha512-7QcljCraeaWQNuqmOoAyZs8KpZcuhPiqdeeKoRd397jVGNRehLFsZbIMOvwaluUDFY11oMyXOkQEERe1Zo2fCw==", + "node_modules/@esbuild/darwin-x64": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.1.tgz", + "integrity": "sha512-+3ELd+nTzhfWb07Vol7EZ+5PTbJ/u74nC6iv4/lwIU99Ip5uuY6QoIf0Hn4m2HoV0qcnRivN3KSqc+FyCHjoVQ==", + "cpu": [ + "x64" + ], "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/core": "3.946.0", - "@aws-sdk/types": "3.936.0", - "@aws-sdk/util-endpoints": "3.936.0", - "@smithy/core": "^3.18.7", - "@smithy/protocol-http": "^5.3.5", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=18.0.0" + "node": ">=18" } }, - "node_modules/@aws-sdk/nested-clients": { - "version": "3.946.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/nested-clients/-/nested-clients-3.946.0.tgz", - "integrity": "sha512-rjAtEguukeW8mlyEQMQI56vxFoyWlaNwowmz1p1rav948SUjtrzjHAp4TOQWhibb7AR7BUTHBCgIcyCRjBEf4g==", + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.1.tgz", + "integrity": "sha512-/8Rfgns4XD9XOSXlzUDepG8PX+AVWHliYlUkFI3K3GB6tqbdjYqdhcb4BKRd7C0BhZSoaCxhv8kTcBrcZWP+xg==", + "cpu": [ + "arm64" + ], "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.946.0", - "@aws-sdk/middleware-host-header": "3.936.0", - "@aws-sdk/middleware-logger": "3.936.0", - "@aws-sdk/middleware-recursion-detection": "3.936.0", - "@aws-sdk/middleware-user-agent": "3.946.0", - "@aws-sdk/region-config-resolver": "3.936.0", - "@aws-sdk/types": "3.936.0", - "@aws-sdk/util-endpoints": "3.936.0", - "@aws-sdk/util-user-agent-browser": "3.936.0", - "@aws-sdk/util-user-agent-node": "3.946.0", - "@smithy/config-resolver": "^4.4.3", - "@smithy/core": "^3.18.7", - "@smithy/fetch-http-handler": "^5.3.6", - "@smithy/hash-node": "^4.2.5", - "@smithy/invalid-dependency": "^4.2.5", - "@smithy/middleware-content-length": "^4.2.5", - "@smithy/middleware-endpoint": "^4.3.14", - "@smithy/middleware-retry": "^4.4.14", - "@smithy/middleware-serde": "^4.2.6", - "@smithy/middleware-stack": "^4.2.5", - "@smithy/node-config-provider": "^4.3.5", - "@smithy/node-http-handler": "^4.4.5", - "@smithy/protocol-http": "^5.3.5", - "@smithy/smithy-client": "^4.9.10", - "@smithy/types": "^4.9.0", - "@smithy/url-parser": "^4.2.5", - "@smithy/util-base64": "^4.3.0", - "@smithy/util-body-length-browser": "^4.2.0", - "@smithy/util-body-length-node": "^4.2.1", - "@smithy/util-defaults-mode-browser": "^4.3.13", - "@smithy/util-defaults-mode-node": "^4.2.16", - "@smithy/util-endpoints": "^3.2.5", - "@smithy/util-middleware": "^4.2.5", - "@smithy/util-retry": "^4.2.5", - "@smithy/util-utf8": "^4.2.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/region-config-resolver": { - "version": "3.936.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.936.0.tgz", - "integrity": "sha512-wOKhzzWsshXGduxO4pqSiNyL9oUtk4BEvjWm9aaq6Hmfdoydq6v6t0rAGHWPjFwy9z2haovGRi3C8IxdMB4muw==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.936.0", - "@smithy/config-resolver": "^4.4.3", - "@smithy/node-config-provider": "^4.3.5", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/s3-request-presigner": { - "version": "3.948.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/s3-request-presigner/-/s3-request-presigner-3.948.0.tgz", - "integrity": "sha512-tlQhMDsDWwUDUzzlo8XYGpmMfjGDmXgbysv1+h1v2xJe0A+ogv/nJ6KFVP94uf1j4ePmCN/gDdxEp2PWZMBPOQ==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/signature-v4-multi-region": "3.947.0", - "@aws-sdk/types": "3.936.0", - "@aws-sdk/util-format-url": "3.936.0", - "@smithy/middleware-endpoint": "^4.3.14", - "@smithy/protocol-http": "^5.3.5", - "@smithy/smithy-client": "^4.9.10", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/s3-request-presigner/node_modules/@aws-sdk/core": { - "version": "3.947.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.947.0.tgz", - "integrity": "sha512-Khq4zHhuAkvCFuFbgcy3GrZTzfSX7ZIjIcW1zRDxXRLZKRtuhnZdonqTUfaWi5K42/4OmxkYNpsO7X7trQOeHw==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.936.0", - "@aws-sdk/xml-builder": "3.930.0", - "@smithy/core": "^3.18.7", - "@smithy/node-config-provider": "^4.3.5", - "@smithy/property-provider": "^4.2.5", - "@smithy/protocol-http": "^5.3.5", - "@smithy/signature-v4": "^5.3.5", - "@smithy/smithy-client": "^4.9.10", - "@smithy/types": "^4.9.0", - "@smithy/util-base64": "^4.3.0", - "@smithy/util-middleware": "^4.2.5", - "@smithy/util-utf8": "^4.2.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/s3-request-presigner/node_modules/@aws-sdk/middleware-sdk-s3": { - "version": "3.947.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-s3/-/middleware-sdk-s3-3.947.0.tgz", - "integrity": "sha512-DS2tm5YBKhPW2PthrRBDr6eufChbwXe0NjtTZcYDfUCXf0OR+W6cIqyKguwHMJ+IyYdey30AfVw9/Lb5KB8U8A==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/core": "3.947.0", - "@aws-sdk/types": "3.936.0", - "@aws-sdk/util-arn-parser": "3.893.0", - "@smithy/core": "^3.18.7", - "@smithy/node-config-provider": "^4.3.5", - "@smithy/protocol-http": "^5.3.5", - "@smithy/signature-v4": "^5.3.5", - "@smithy/smithy-client": "^4.9.10", - "@smithy/types": "^4.9.0", - "@smithy/util-config-provider": "^4.2.0", - "@smithy/util-middleware": "^4.2.5", - "@smithy/util-stream": "^4.5.6", - "@smithy/util-utf8": "^4.2.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/s3-request-presigner/node_modules/@aws-sdk/signature-v4-multi-region": { - "version": "3.947.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/signature-v4-multi-region/-/signature-v4-multi-region-3.947.0.tgz", - "integrity": "sha512-UaYmzoxf9q3mabIA2hc4T6x5YSFUG2BpNjAZ207EA1bnQMiK+d6vZvb83t7dIWL/U1de1sGV19c1C81Jf14rrA==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/middleware-sdk-s3": "3.947.0", - "@aws-sdk/types": "3.936.0", - "@smithy/protocol-http": "^5.3.5", - "@smithy/signature-v4": "^5.3.5", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], "engines": { - "node": ">=18.0.0" + "node": ">=18" } }, - "node_modules/@aws-sdk/signature-v4-multi-region": { - "version": "3.946.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/signature-v4-multi-region/-/signature-v4-multi-region-3.946.0.tgz", - "integrity": "sha512-61FZ685lKiJuQ06g6U7K3PL9EwKCxNm51wNlxyKV57nnl1GrLD0NC8O3/hDNkCQLNBArT9y3IXl2H7TtIxP8Jg==", + "node_modules/@esbuild/freebsd-x64": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.1.tgz", + "integrity": "sha512-GITpD8dK9C+r+5yRT/UKVT36h/DQLOHdwGVwwoHidlnA168oD3uxA878XloXebK4Ul3gDBBIvEdL7go9gCUFzQ==", + "cpu": [ + "x64" + ], "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/middleware-sdk-s3": "3.946.0", - "@aws-sdk/types": "3.936.0", - "@smithy/protocol-http": "^5.3.5", - "@smithy/signature-v4": "^5.3.5", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], "engines": { - "node": ">=18.0.0" + "node": ">=18" } }, - "node_modules/@aws-sdk/token-providers": { - "version": "3.946.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.946.0.tgz", - "integrity": "sha512-a5c+rM6CUPX2ExmUZ3DlbLlS5rQr4tbdoGcgBsjnAHiYx8MuMNAI+8M7wfjF13i2yvUQj5WEIddvLpayfEZj9g==", + "node_modules/@esbuild/linux-arm": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.1.tgz", + "integrity": "sha512-ieMID0JRZY/ZeCrsFQ3Y3NlHNCqIhTprJfDgSB3/lv5jJZ8FX3hqPyXWhe+gvS5ARMBJ242PM+VNz/ctNj//eA==", + "cpu": [ + "arm" + ], "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/core": "3.946.0", - "@aws-sdk/nested-clients": "3.946.0", - "@aws-sdk/types": "3.936.0", - "@smithy/property-provider": "^4.2.5", - "@smithy/shared-ini-file-loader": "^4.4.0", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=18.0.0" + "node": ">=18" } }, - "node_modules/@aws-sdk/types": { - "version": "3.936.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.936.0.tgz", - "integrity": "sha512-uz0/VlMd2pP5MepdrHizd+T+OKfyK4r3OA9JI+L/lPKg0YFQosdJNCKisr6o70E3dh8iMpFYxF1UN/4uZsyARg==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.1.tgz", + "integrity": "sha512-W9//kCrh/6in9rWIBdKaMtuTTzNj6jSeG/haWBADqLLa9P8O5YSRDzgD5y9QBok4AYlzS6ARHifAb75V6G670Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=18.0.0" + "node": ">=18" } }, - "node_modules/@aws-sdk/util-arn-parser": { - "version": "3.893.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-arn-parser/-/util-arn-parser-3.893.0.tgz", - "integrity": "sha512-u8H4f2Zsi19DGnwj5FSZzDMhytYF/bCh37vAtBsn3cNDL3YG578X5oc+wSX54pM3tOxS+NY7tvOAo52SW7koUA==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.1.tgz", + "integrity": "sha512-VIUV4z8GD8rtSVMfAj1aXFahsi/+tcoXXNYmXgzISL+KB381vbSTNdeZHHHIYqFyXcoEhu9n5cT+05tRv13rlw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=18.0.0" + "node": ">=18" } }, - "node_modules/@aws-sdk/util-endpoints": { - "version": "3.936.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.936.0.tgz", - "integrity": "sha512-0Zx3Ntdpu+z9Wlm7JKUBOzS9EunwKAb4KdGUQQxDqh5Lc3ta5uBoub+FgmVuzwnmBu9U1Os8UuwVTH0Lgu+P5w==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.936.0", - "@smithy/types": "^4.9.0", - "@smithy/url-parser": "^4.2.5", - "@smithy/util-endpoints": "^3.2.5", - "tslib": "^2.6.2" - }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.1.tgz", + "integrity": "sha512-l4rfiiJRN7sTNI//ff65zJ9z8U+k6zcCg0LALU5iEWzY+a1mVZ8iWC1k5EsNKThZ7XCQ6YWtsZ8EWYm7r1UEsg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=18.0.0" + "node": ">=18" } }, - "node_modules/@aws-sdk/util-format-url": { - "version": "3.936.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-format-url/-/util-format-url-3.936.0.tgz", - "integrity": "sha512-MS5eSEtDUFIAMHrJaMERiHAvDPdfxc/T869ZjDNFAIiZhyc037REw0aoTNeimNXDNy2txRNZJaAUn/kE4RwN+g==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.936.0", - "@smithy/querystring-builder": "^4.2.5", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.1.tgz", + "integrity": "sha512-U0bEuAOLvO/DWFdygTHWY8C067FXz+UbzKgxYhXC0fDieFa0kDIra1FAhsAARRJbvEyso8aAqvPdNxzWuStBnA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=18.0.0" + "node": ">=18" } }, - "node_modules/@aws-sdk/util-locate-window": { - "version": "3.893.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-locate-window/-/util-locate-window-3.893.0.tgz", - "integrity": "sha512-T89pFfgat6c8nMmpI8eKjBcDcgJq36+m9oiXbcUzeU55MP9ZuGgBomGjGnHaEyF36jenW9gmg3NfZDm0AO2XPg==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.1.tgz", + "integrity": "sha512-NzdQ/Xwu6vPSf/GkdmRNsOfIeSGnh7muundsWItmBsVpMoNPVpM61qNzAVY3pZ1glzzAxLR40UyYM23eaDDbYQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/util-user-agent-browser": { - "version": "3.936.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.936.0.tgz", - "integrity": "sha512-eZ/XF6NxMtu+iCma58GRNRxSq4lHo6zHQLOZRIeL/ghqYJirqHdenMOwrzPettj60KWlv827RVebP9oNVrwZbw==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.936.0", - "@smithy/types": "^4.9.0", - "bowser": "^2.11.0", - "tslib": "^2.6.2" + "node": ">=18" } }, - "node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.946.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.946.0.tgz", - "integrity": "sha512-a2UwwvzbK5AxHKUBupfg4s7VnkqRAHjYsuezHnKCniczmT4HZfP1NnfwwvLKEH8qaTrwenxjKSfq4UWmWkvG+Q==", + "node_modules/@esbuild/linux-riscv64": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.1.tgz", + "integrity": "sha512-7zlw8p3IApcsN7mFw0O1Z1PyEk6PlKMu18roImfl3iQHTnr/yAfYv6s4hXPidbDoI2Q0pW+5xeoM4eTCC0UdrQ==", + "cpu": [ + "riscv64" + ], "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/middleware-user-agent": "3.946.0", - "@aws-sdk/types": "3.936.0", - "@smithy/node-config-provider": "^4.3.5", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=18.0.0" - }, - "peerDependencies": { - "aws-crt": ">=1.0.0" - }, - "peerDependenciesMeta": { - "aws-crt": { - "optional": true - } + "node": ">=18" } }, - "node_modules/@aws-sdk/xml-builder": { - "version": "3.930.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/xml-builder/-/xml-builder-3.930.0.tgz", - "integrity": "sha512-YIfkD17GocxdmlUVc3ia52QhcWuRIUJonbF8A2CYfcWNV3HzvAqpcPeC0bYUhkK+8e8YO1ARnLKZQE0TlwzorA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^4.9.0", - "fast-xml-parser": "5.2.5", - "tslib": "^2.6.2" - }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.1.tgz", + "integrity": "sha512-cGj5wli+G+nkVQdZo3+7FDKC25Uh4ZVwOAK6A06Hsvgr8WqBBuOy/1s+PUEd/6Je+vjfm6stX0kmib5b/O2Ykw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=18.0.0" + "node": ">=18" } }, - "node_modules/@aws/lambda-invoke-store": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/@aws/lambda-invoke-store/-/lambda-invoke-store-0.2.2.tgz", - "integrity": "sha512-C0NBLsIqzDIae8HFw9YIrIBsbc0xTiOtt7fAukGPnqQ/+zZNaq+4jhuccltK0QuWHBnNm/a6kLIRA6GFiM10eg==", - "license": "Apache-2.0", + "node_modules/@esbuild/linux-x64": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.1.tgz", + "integrity": "sha512-z3H/HYI9MM0HTv3hQZ81f+AKb+yEoCRlUby1F80vbQ5XdzEMyY/9iNlAmhqiBKw4MJXwfgsh7ERGEOhrM1niMA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=18.0.0" + "node": ">=18" } }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.1.tgz", - "integrity": "sha512-HHB50pdsBX6k47S4u5g/CaLjqS3qwaOVE5ILsq64jyzgMhLuCuZ8rGzM9yhsAjfjkbgUPMzZEPa7DAp7yz6vuA==", + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.1.tgz", + "integrity": "sha512-wzC24DxAvk8Em01YmVXyjl96Mr+ecTPyOuADAvjGg+fyBpGmxmcr2E5ttf7Im8D0sXZihpxzO1isus8MdjMCXQ==", "cpu": [ - "ppc64" + "arm64" ], "dev": true, "license": "MIT", "optional": true, "os": [ - "aix" + "netbsd" ], "engines": { "node": ">=18" } }, - "node_modules/@esbuild/android-arm": { + "node_modules/@esbuild/netbsd-x64": { "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.1.tgz", - "integrity": "sha512-kFqa6/UcaTbGm/NncN9kzVOODjhZW8e+FRdSeypWe6j33gzclHtwlANs26JrupOntlcWmB0u8+8HZo8s7thHvg==", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.1.tgz", + "integrity": "sha512-1YQ8ybGi2yIXswu6eNzJsrYIGFpnlzEWRl6iR5gMgmsrR0FcNoV1m9k9sc3PuP5rUBLshOZylc9nqSgymI+TYg==", "cpu": [ - "arm" + "x64" ], "dev": true, "license": "MIT", "optional": true, "os": [ - "android" + "netbsd" ], "engines": { "node": ">=18" } }, - "node_modules/@esbuild/android-arm64": { + "node_modules/@esbuild/openbsd-arm64": { "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.1.tgz", - "integrity": "sha512-45fuKmAJpxnQWixOGCrS+ro4Uvb4Re9+UTieUY2f8AEc+t7d4AaZ6eUJ3Hva7dtrxAAWHtlEFsXFMAgNnGU9uQ==", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.1.tgz", + "integrity": "sha512-5Z+DzLCrq5wmU7RDaMDe2DVXMRm2tTDvX2KU14JJVBN2CT/qov7XVix85QoJqHltpvAOZUAc3ndU56HSMWrv8g==", "cpu": [ "arm64" ], @@ -1564,16 +2149,16 @@ "license": "MIT", "optional": true, "os": [ - "android" + "openbsd" ], "engines": { "node": ">=18" } }, - "node_modules/@esbuild/android-x64": { + "node_modules/@esbuild/openbsd-x64": { "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.1.tgz", - "integrity": "sha512-LBEpOz0BsgMEeHgenf5aqmn/lLNTFXVfoWMUox8CtWWYK9X4jmQzWjoGoNb8lmAYml/tQ/Ysvm8q7szu7BoxRQ==", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.1.tgz", + "integrity": "sha512-Q73ENzIdPF5jap4wqLtsfh8YbYSZ8Q0wnxplOlZUOyZy7B4ZKW8DXGWgTCZmF8VWD7Tciwv5F4NsRf6vYlZtqg==", "cpu": [ "x64" ], @@ -1581,16 +2166,16 @@ "license": "MIT", "optional": true, "os": [ - "android" + "openbsd" ], "engines": { "node": ">=18" } }, - "node_modules/@esbuild/darwin-arm64": { + "node_modules/@esbuild/openharmony-arm64": { "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.1.tgz", - "integrity": "sha512-veg7fL8eMSCVKL7IW4pxb54QERtedFDfY/ASrumK/SbFsXnRazxY4YykN/THYqFnFwJ0aVjiUrVG2PwcdAEqQQ==", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.1.tgz", + "integrity": "sha512-ajbHrGM/XiK+sXM0JzEbJAen+0E+JMQZ2l4RR4VFwvV9JEERx+oxtgkpoKv1SevhjavK2z2ReHk32pjzktWbGg==", "cpu": [ "arm64" ], @@ -1598,16 +2183,16 @@ "license": "MIT", "optional": true, "os": [ - "darwin" + "openharmony" ], "engines": { "node": ">=18" } }, - "node_modules/@esbuild/darwin-x64": { + "node_modules/@esbuild/sunos-x64": { "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.1.tgz", - "integrity": "sha512-+3ELd+nTzhfWb07Vol7EZ+5PTbJ/u74nC6iv4/lwIU99Ip5uuY6QoIf0Hn4m2HoV0qcnRivN3KSqc+FyCHjoVQ==", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.1.tgz", + "integrity": "sha512-IPUW+y4VIjuDVn+OMzHc5FV4GubIwPnsz6ubkvN8cuhEqH81NovB53IUlrlBkPMEPxvNnf79MGBoz8rZ2iW8HA==", "cpu": [ "x64" ], @@ -1615,16 +2200,16 @@ "license": "MIT", "optional": true, "os": [ - "darwin" + "sunos" ], "engines": { "node": ">=18" } }, - "node_modules/@esbuild/freebsd-arm64": { + "node_modules/@esbuild/win32-arm64": { "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.1.tgz", - "integrity": "sha512-/8Rfgns4XD9XOSXlzUDepG8PX+AVWHliYlUkFI3K3GB6tqbdjYqdhcb4BKRd7C0BhZSoaCxhv8kTcBrcZWP+xg==", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.1.tgz", + "integrity": "sha512-RIVRWiljWA6CdVu8zkWcRmGP7iRRIIwvhDKem8UMBjPql2TXM5PkDVvvrzMtj1V+WFPB4K7zkIGM7VzRtFkjdg==", "cpu": [ "arm64" ], @@ -1632,333 +2217,509 @@ "license": "MIT", "optional": true, "os": [ - "freebsd" + "win32" ], "engines": { "node": ">=18" } }, - "node_modules/@esbuild/freebsd-x64": { + "node_modules/@esbuild/win32-ia32": { "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.1.tgz", - "integrity": "sha512-GITpD8dK9C+r+5yRT/UKVT36h/DQLOHdwGVwwoHidlnA168oD3uxA878XloXebK4Ul3gDBBIvEdL7go9gCUFzQ==", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.1.tgz", + "integrity": "sha512-2BR5M8CPbptC1AK5JbJT1fWrHLvejwZidKx3UMSF0ecHMa+smhi16drIrCEggkgviBwLYd5nwrFLSl5Kho96RQ==", "cpu": [ - "x64" + "ia32" ], "dev": true, "license": "MIT", "optional": true, "os": [ - "freebsd" + "win32" ], "engines": { "node": ">=18" } }, - "node_modules/@esbuild/linux-arm": { + "node_modules/@esbuild/win32-x64": { "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.1.tgz", - "integrity": "sha512-ieMID0JRZY/ZeCrsFQ3Y3NlHNCqIhTprJfDgSB3/lv5jJZ8FX3hqPyXWhe+gvS5ARMBJ242PM+VNz/ctNj//eA==", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.1.tgz", + "integrity": "sha512-d5X6RMYv6taIymSk8JBP+nxv8DQAMY6A51GPgusqLdK9wBz5wWIXy1KjTck6HnjE9hqJzJRdk+1p/t5soSbCtw==", "cpu": [ - "arm" + "x64" ], "dev": true, "license": "MIT", "optional": true, "os": [ - "linux" + "win32" ], "engines": { "node": ">=18" } }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.1.tgz", - "integrity": "sha512-W9//kCrh/6in9rWIBdKaMtuTTzNj6jSeG/haWBADqLLa9P8O5YSRDzgD5y9QBok4AYlzS6ARHifAb75V6G670Q==", + "node_modules/@img/colour": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.1.0.tgz", + "integrity": "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@img/sharp-darwin-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.5.tgz", + "integrity": "sha512-imtQ3WMJXbMY4fxb/Ndp6HBTNVtWCUI0WdobyheGf5+ad6xX8VIDO8u2xE4qc/fr08CKG/7dDseFtn6M6g/r3w==", "cpu": [ "arm64" ], - "dev": true, - "license": "MIT", + "license": "Apache-2.0", "optional": true, "os": [ - "linux" + "darwin" ], "engines": { - "node": ">=18" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-arm64": "1.2.4" } }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.1.tgz", - "integrity": "sha512-VIUV4z8GD8rtSVMfAj1aXFahsi/+tcoXXNYmXgzISL+KB381vbSTNdeZHHHIYqFyXcoEhu9n5cT+05tRv13rlw==", + "node_modules/@img/sharp-darwin-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.5.tgz", + "integrity": "sha512-YNEFAF/4KQ/PeW0N+r+aVVsoIY0/qxxikF2SWdp+NRkmMB7y9LBZAVqQ4yhGCm/H3H270OSykqmQMKLBhBJDEw==", "cpu": [ - "ia32" + "x64" ], - "dev": true, - "license": "MIT", + "license": "Apache-2.0", "optional": true, "os": [ - "linux" + "darwin" ], "engines": { - "node": ">=18" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.2.4" } }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.1.tgz", - "integrity": "sha512-l4rfiiJRN7sTNI//ff65zJ9z8U+k6zcCg0LALU5iEWzY+a1mVZ8iWC1k5EsNKThZ7XCQ6YWtsZ8EWYm7r1UEsg==", + "node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.4.tgz", + "integrity": "sha512-zqjjo7RatFfFoP0MkQ51jfuFZBnVE2pRiaydKJ1G/rHZvnsrHAOcQALIi9sA5co5xenQdTugCvtb1cuf78Vf4g==", "cpu": [ - "loong64" + "arm64" ], - "dev": true, - "license": "MIT", + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.2.4.tgz", + "integrity": "sha512-1IOd5xfVhlGwX+zXv2N93k0yMONvUlANylbJw1eTah8K/Jtpi15KC+WSiaX/nBmbm2HxRM1gZ0nSdjSsrZbGKg==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.2.4.tgz", + "integrity": "sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==", + "cpu": [ + "arm" + ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "linux" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://opencollective.com/libvips" } }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.1.tgz", - "integrity": "sha512-U0bEuAOLvO/DWFdygTHWY8C067FXz+UbzKgxYhXC0fDieFa0kDIra1FAhsAARRJbvEyso8aAqvPdNxzWuStBnA==", + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.2.4.tgz", + "integrity": "sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==", "cpu": [ - "mips64el" + "arm64" ], - "dev": true, - "license": "MIT", + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "linux" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://opencollective.com/libvips" } }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.1.tgz", - "integrity": "sha512-NzdQ/Xwu6vPSf/GkdmRNsOfIeSGnh7muundsWItmBsVpMoNPVpM61qNzAVY3pZ1glzzAxLR40UyYM23eaDDbYQ==", + "node_modules/@img/sharp-libvips-linux-ppc64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.2.4.tgz", + "integrity": "sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==", "cpu": [ "ppc64" ], - "dev": true, - "license": "MIT", + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "linux" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://opencollective.com/libvips" } }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.1.tgz", - "integrity": "sha512-7zlw8p3IApcsN7mFw0O1Z1PyEk6PlKMu18roImfl3iQHTnr/yAfYv6s4hXPidbDoI2Q0pW+5xeoM4eTCC0UdrQ==", + "node_modules/@img/sharp-libvips-linux-riscv64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.2.4.tgz", + "integrity": "sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==", "cpu": [ "riscv64" ], - "dev": true, - "license": "MIT", + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "linux" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://opencollective.com/libvips" } }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.1.tgz", - "integrity": "sha512-cGj5wli+G+nkVQdZo3+7FDKC25Uh4ZVwOAK6A06Hsvgr8WqBBuOy/1s+PUEd/6Je+vjfm6stX0kmib5b/O2Ykw==", + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.2.4.tgz", + "integrity": "sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==", "cpu": [ "s390x" ], - "dev": true, - "license": "MIT", + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "linux" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://opencollective.com/libvips" } }, - "node_modules/@esbuild/linux-x64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.1.tgz", - "integrity": "sha512-z3H/HYI9MM0HTv3hQZ81f+AKb+yEoCRlUby1F80vbQ5XdzEMyY/9iNlAmhqiBKw4MJXwfgsh7ERGEOhrM1niMA==", + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.2.4.tgz", + "integrity": "sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==", "cpu": [ "x64" ], - "dev": true, - "license": "MIT", + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.2.4.tgz", + "integrity": "sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.2.4.tgz", + "integrity": "sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-linux-arm": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.5.tgz", + "integrity": "sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==", + "cpu": [ + "arm" + ], + "license": "Apache-2.0", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=18" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.2.4" } }, - "node_modules/@esbuild/netbsd-arm64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.1.tgz", - "integrity": "sha512-wzC24DxAvk8Em01YmVXyjl96Mr+ecTPyOuADAvjGg+fyBpGmxmcr2E5ttf7Im8D0sXZihpxzO1isus8MdjMCXQ==", + "node_modules/@img/sharp-linux-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.5.tgz", + "integrity": "sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==", "cpu": [ "arm64" ], - "dev": true, - "license": "MIT", + "license": "Apache-2.0", "optional": true, "os": [ - "netbsd" + "linux" ], "engines": { - "node": ">=18" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.2.4" } }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.1.tgz", - "integrity": "sha512-1YQ8ybGi2yIXswu6eNzJsrYIGFpnlzEWRl6iR5gMgmsrR0FcNoV1m9k9sc3PuP5rUBLshOZylc9nqSgymI+TYg==", + "node_modules/@img/sharp-linux-ppc64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.34.5.tgz", + "integrity": "sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==", + "cpu": [ + "ppc64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-ppc64": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-riscv64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.34.5.tgz", + "integrity": "sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==", "cpu": [ - "x64" + "riscv64" ], - "dev": true, - "license": "MIT", + "license": "Apache-2.0", "optional": true, "os": [ - "netbsd" + "linux" ], "engines": { - "node": ">=18" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-riscv64": "1.2.4" } }, - "node_modules/@esbuild/openbsd-arm64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.1.tgz", - "integrity": "sha512-5Z+DzLCrq5wmU7RDaMDe2DVXMRm2tTDvX2KU14JJVBN2CT/qov7XVix85QoJqHltpvAOZUAc3ndU56HSMWrv8g==", + "node_modules/@img/sharp-linux-s390x": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.5.tgz", + "integrity": "sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==", "cpu": [ - "arm64" + "s390x" ], - "dev": true, - "license": "MIT", + "license": "Apache-2.0", "optional": true, "os": [ - "openbsd" + "linux" ], "engines": { - "node": ">=18" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.2.4" } }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.1.tgz", - "integrity": "sha512-Q73ENzIdPF5jap4wqLtsfh8YbYSZ8Q0wnxplOlZUOyZy7B4ZKW8DXGWgTCZmF8VWD7Tciwv5F4NsRf6vYlZtqg==", + "node_modules/@img/sharp-linux-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.5.tgz", + "integrity": "sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==", "cpu": [ "x64" ], - "dev": true, - "license": "MIT", + "license": "Apache-2.0", "optional": true, "os": [ - "openbsd" + "linux" ], "engines": { - "node": ">=18" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.2.4" } }, - "node_modules/@esbuild/openharmony-arm64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.1.tgz", - "integrity": "sha512-ajbHrGM/XiK+sXM0JzEbJAen+0E+JMQZ2l4RR4VFwvV9JEERx+oxtgkpoKv1SevhjavK2z2ReHk32pjzktWbGg==", + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.5.tgz", + "integrity": "sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==", "cpu": [ "arm64" ], - "dev": true, - "license": "MIT", + "license": "Apache-2.0", "optional": true, "os": [ - "openharmony" + "linux" ], "engines": { - "node": ">=18" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.2.4" } }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.1.tgz", - "integrity": "sha512-IPUW+y4VIjuDVn+OMzHc5FV4GubIwPnsz6ubkvN8cuhEqH81NovB53IUlrlBkPMEPxvNnf79MGBoz8rZ2iW8HA==", + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.5.tgz", + "integrity": "sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==", "cpu": [ "x64" ], - "dev": true, - "license": "MIT", + "license": "Apache-2.0", "optional": true, "os": [ - "sunos" + "linux" ], "engines": { - "node": ">=18" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.2.4" } }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.1.tgz", - "integrity": "sha512-RIVRWiljWA6CdVu8zkWcRmGP7iRRIIwvhDKem8UMBjPql2TXM5PkDVvvrzMtj1V+WFPB4K7zkIGM7VzRtFkjdg==", + "node_modules/@img/sharp-wasm32": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.34.5.tgz", + "integrity": "sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==", + "cpu": [ + "wasm32" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", + "optional": true, + "dependencies": { + "@emnapi/runtime": "^1.7.0" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.5.tgz", + "integrity": "sha512-WQ3AgWCWYSb2yt+IG8mnC6Jdk9Whs7O0gxphblsLvdhSpSTtmu69ZG1Gkb6NuvxsNACwiPV6cNSZNzt0KPsw7g==", "cpu": [ "arm64" ], - "dev": true, - "license": "MIT", + "license": "Apache-2.0 AND LGPL-3.0-or-later", "optional": true, "os": [ "win32" ], "engines": { - "node": ">=18" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" } }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.1.tgz", - "integrity": "sha512-2BR5M8CPbptC1AK5JbJT1fWrHLvejwZidKx3UMSF0ecHMa+smhi16drIrCEggkgviBwLYd5nwrFLSl5Kho96RQ==", + "node_modules/@img/sharp-win32-ia32": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.5.tgz", + "integrity": "sha512-FV9m/7NmeCmSHDD5j4+4pNI8Cp3aW+JvLoXcTUo0IqyjSfAZJ8dIUmijx1qaJsIiU+Hosw6xM5KijAWRJCSgNg==", "cpu": [ "ia32" ], - "dev": true, - "license": "MIT", + "license": "Apache-2.0 AND LGPL-3.0-or-later", "optional": true, "os": [ "win32" ], "engines": { - "node": ">=18" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" } }, - "node_modules/@esbuild/win32-x64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.1.tgz", - "integrity": "sha512-d5X6RMYv6taIymSk8JBP+nxv8DQAMY6A51GPgusqLdK9wBz5wWIXy1KjTck6HnjE9hqJzJRdk+1p/t5soSbCtw==", + "node_modules/@img/sharp-win32-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.5.tgz", + "integrity": "sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw==", "cpu": [ "x64" ], - "dev": true, - "license": "MIT", + "license": "Apache-2.0 AND LGPL-3.0-or-later", "optional": true, "os": [ "win32" ], "engines": { - "node": ">=18" + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" } }, "node_modules/@mongodb-js/saslprep": { @@ -2015,12 +2776,12 @@ "license": "MIT" }, "node_modules/@smithy/abort-controller": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-4.2.5.tgz", - "integrity": "sha512-j7HwVkBw68YW8UmFRcjZOmssE77Rvk0GWAIN1oFBhsaovQmZWYCIcGa9/pwRB0ExI8Sk9MWNALTjftjHZea7VA==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-4.2.11.tgz", + "integrity": "sha512-Hj4WoYWMJnSpM6/kchsm4bUNTL9XiSyhvoMb2KIq4VJzyDt7JpGHUZHkVNPZVC7YE1tf8tPeVauxpFBKGW4/KQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.9.0", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2028,9 +2789,9 @@ } }, "node_modules/@smithy/chunked-blob-reader": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@smithy/chunked-blob-reader/-/chunked-blob-reader-5.2.0.tgz", - "integrity": "sha512-WmU0TnhEAJLWvfSeMxBNe5xtbselEO8+4wG0NtZeL8oR21WgH1xiO37El+/Y+H/Ie4SCwBy3MxYWmOYaGgZueA==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/@smithy/chunked-blob-reader/-/chunked-blob-reader-5.2.2.tgz", + "integrity": "sha512-St+kVicSyayWQca+I1rGitaOEH6uKgE8IUWoYnnEX26SWdWQcL6LvMSD19Lg+vYHKdT9B2Zuu7rd3i6Wnyb/iw==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" @@ -2040,12 +2801,12 @@ } }, "node_modules/@smithy/chunked-blob-reader-native": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@smithy/chunked-blob-reader-native/-/chunked-blob-reader-native-4.2.1.tgz", - "integrity": "sha512-lX9Ay+6LisTfpLid2zZtIhSEjHMZoAR5hHCR4H7tBz/Zkfr5ea8RcQ7Tk4mi0P76p4cN+Btz16Ffno7YHpKXnQ==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/@smithy/chunked-blob-reader-native/-/chunked-blob-reader-native-4.2.3.tgz", + "integrity": "sha512-jA5k5Udn7Y5717L86h4EIv06wIr3xn8GM1qHRi/Nf31annXcXHJjBKvgztnbn2TxH3xWrPBfgwHsOwZf0UmQWw==", "license": "Apache-2.0", "dependencies": { - "@smithy/util-base64": "^4.3.0", + "@smithy/util-base64": "^4.3.2", "tslib": "^2.6.2" }, "engines": { @@ -2053,16 +2814,16 @@ } }, "node_modules/@smithy/config-resolver": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-4.4.3.tgz", - "integrity": "sha512-ezHLe1tKLUxDJo2LHtDuEDyWXolw8WGOR92qb4bQdWq/zKenO5BvctZGrVJBK08zjezSk7bmbKFOXIVyChvDLw==", + "version": "4.4.10", + "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-4.4.10.tgz", + "integrity": "sha512-IRTkd6ps0ru+lTWnfnsbXzW80A8Od8p3pYiZnW98K2Hb20rqfsX7VTlfUwhrcOeSSy68Gn9WBofwPuw3e5CCsg==", "license": "Apache-2.0", "dependencies": { - "@smithy/node-config-provider": "^4.3.5", - "@smithy/types": "^4.9.0", - "@smithy/util-config-provider": "^4.2.0", - "@smithy/util-endpoints": "^3.2.5", - "@smithy/util-middleware": "^4.2.5", + "@smithy/node-config-provider": "^4.3.11", + "@smithy/types": "^4.13.0", + "@smithy/util-config-provider": "^4.2.2", + "@smithy/util-endpoints": "^3.3.2", + "@smithy/util-middleware": "^4.2.11", "tslib": "^2.6.2" }, "engines": { @@ -2070,20 +2831,20 @@ } }, "node_modules/@smithy/core": { - "version": "3.18.7", - "resolved": "https://registry.npmjs.org/@smithy/core/-/core-3.18.7.tgz", - "integrity": "sha512-axG9MvKhMWOhFbvf5y2DuyTxQueO0dkedY9QC3mAfndLosRI/9LJv8WaL0mw7ubNhsO4IuXX9/9dYGPFvHrqlw==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/middleware-serde": "^4.2.6", - "@smithy/protocol-http": "^5.3.5", - "@smithy/types": "^4.9.0", - "@smithy/util-base64": "^4.3.0", - "@smithy/util-body-length-browser": "^4.2.0", - "@smithy/util-middleware": "^4.2.5", - "@smithy/util-stream": "^4.5.6", - "@smithy/util-utf8": "^4.2.0", - "@smithy/uuid": "^1.1.0", + "version": "3.23.9", + "resolved": "https://registry.npmjs.org/@smithy/core/-/core-3.23.9.tgz", + "integrity": "sha512-1Vcut4LEL9HZsdpI0vFiRYIsaoPwZLjAxnVQDUMQK8beMS+EYPLDQCXtbzfxmM5GzSgjfe2Q9M7WaXwIMQllyQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/middleware-serde": "^4.2.12", + "@smithy/protocol-http": "^5.3.11", + "@smithy/types": "^4.13.0", + "@smithy/util-base64": "^4.3.2", + "@smithy/util-body-length-browser": "^4.2.2", + "@smithy/util-middleware": "^4.2.11", + "@smithy/util-stream": "^4.5.17", + "@smithy/util-utf8": "^4.2.2", + "@smithy/uuid": "^1.1.2", "tslib": "^2.6.2" }, "engines": { @@ -2091,15 +2852,15 @@ } }, "node_modules/@smithy/credential-provider-imds": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-4.2.5.tgz", - "integrity": "sha512-BZwotjoZWn9+36nimwm/OLIcVe+KYRwzMjfhd4QT7QxPm9WY0HiOV8t/Wlh+HVUif0SBVV7ksq8//hPaBC/okQ==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-4.2.11.tgz", + "integrity": "sha512-lBXrS6ku0kTj3xLmsJW0WwqWbGQ6ueooYyp/1L9lkyT0M02C+DWwYwc5aTyXFbRaK38ojALxNixg+LxKSHZc0g==", "license": "Apache-2.0", "dependencies": { - "@smithy/node-config-provider": "^4.3.5", - "@smithy/property-provider": "^4.2.5", - "@smithy/types": "^4.9.0", - "@smithy/url-parser": "^4.2.5", + "@smithy/node-config-provider": "^4.3.11", + "@smithy/property-provider": "^4.2.11", + "@smithy/types": "^4.13.0", + "@smithy/url-parser": "^4.2.11", "tslib": "^2.6.2" }, "engines": { @@ -2107,14 +2868,14 @@ } }, "node_modules/@smithy/eventstream-codec": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/eventstream-codec/-/eventstream-codec-4.2.5.tgz", - "integrity": "sha512-Ogt4Zi9hEbIP17oQMd68qYOHUzmH47UkK7q7Gl55iIm9oKt27MUGrC5JfpMroeHjdkOliOA4Qt3NQ1xMq/nrlA==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-codec/-/eventstream-codec-4.2.11.tgz", + "integrity": "sha512-Sf39Ml0iVX+ba/bgMPxaXWAAFmHqYLTmbjAPfLPLY8CrYkRDEqZdUsKC1OwVMCdJXfAt0v4j49GIJ8DoSYAe6w==", "license": "Apache-2.0", "dependencies": { "@aws-crypto/crc32": "5.2.0", - "@smithy/types": "^4.9.0", - "@smithy/util-hex-encoding": "^4.2.0", + "@smithy/types": "^4.13.0", + "@smithy/util-hex-encoding": "^4.2.2", "tslib": "^2.6.2" }, "engines": { @@ -2122,13 +2883,13 @@ } }, "node_modules/@smithy/eventstream-serde-browser": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-browser/-/eventstream-serde-browser-4.2.5.tgz", - "integrity": "sha512-HohfmCQZjppVnKX2PnXlf47CW3j92Ki6T/vkAT2DhBR47e89pen3s4fIa7otGTtrVxmj7q+IhH0RnC5kpR8wtw==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-browser/-/eventstream-serde-browser-4.2.11.tgz", + "integrity": "sha512-3rEpo3G6f/nRS7fQDsZmxw/ius6rnlIpz4UX6FlALEzz8JoSxFmdBt0SZnthis+km7sQo6q5/3e+UJcuQivoXA==", "license": "Apache-2.0", "dependencies": { - "@smithy/eventstream-serde-universal": "^4.2.5", - "@smithy/types": "^4.9.0", + "@smithy/eventstream-serde-universal": "^4.2.11", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2136,12 +2897,12 @@ } }, "node_modules/@smithy/eventstream-serde-config-resolver": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-config-resolver/-/eventstream-serde-config-resolver-4.3.5.tgz", - "integrity": "sha512-ibjQjM7wEXtECiT6my1xfiMH9IcEczMOS6xiCQXoUIYSj5b1CpBbJ3VYbdwDy8Vcg5JHN7eFpOCGk8nyZAltNQ==", + "version": "4.3.11", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-config-resolver/-/eventstream-serde-config-resolver-4.3.11.tgz", + "integrity": "sha512-XeNIA8tcP/GDWnnKkO7qEm/bg0B/bP9lvIXZBXcGZwZ+VYM8h8k9wuDvUODtdQ2Wcp2RcBkPTCSMmaniVHrMlA==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.9.0", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2149,13 +2910,13 @@ } }, "node_modules/@smithy/eventstream-serde-node": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-node/-/eventstream-serde-node-4.2.5.tgz", - "integrity": "sha512-+elOuaYx6F2H6x1/5BQP5ugv12nfJl66GhxON8+dWVUEDJ9jah/A0tayVdkLRP0AeSac0inYkDz5qBFKfVp2Gg==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-node/-/eventstream-serde-node-4.2.11.tgz", + "integrity": "sha512-fzbCh18rscBDTQSCrsp1fGcclLNF//nJyhjldsEl/5wCYmgpHblv5JSppQAyQI24lClsFT0wV06N1Porn0IsEw==", "license": "Apache-2.0", "dependencies": { - "@smithy/eventstream-serde-universal": "^4.2.5", - "@smithy/types": "^4.9.0", + "@smithy/eventstream-serde-universal": "^4.2.11", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2163,13 +2924,13 @@ } }, "node_modules/@smithy/eventstream-serde-universal": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-universal/-/eventstream-serde-universal-4.2.5.tgz", - "integrity": "sha512-G9WSqbST45bmIFaeNuP/EnC19Rhp54CcVdX9PDL1zyEB514WsDVXhlyihKlGXnRycmHNmVv88Bvvt4EYxWef/Q==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-universal/-/eventstream-serde-universal-4.2.11.tgz", + "integrity": "sha512-MJ7HcI+jEkqoWT5vp+uoVaAjBrmxBtKhZTeynDRG/seEjJfqyg3SiqMMqyPnAMzmIfLaeJ/uiuSDP/l9AnMy/Q==", "license": "Apache-2.0", "dependencies": { - "@smithy/eventstream-codec": "^4.2.5", - "@smithy/types": "^4.9.0", + "@smithy/eventstream-codec": "^4.2.11", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2177,15 +2938,15 @@ } }, "node_modules/@smithy/fetch-http-handler": { - "version": "5.3.6", - "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-5.3.6.tgz", - "integrity": "sha512-3+RG3EA6BBJ/ofZUeTFJA7mHfSYrZtQIrDP9dI8Lf7X6Jbos2jptuLrAAteDiFVrmbEmLSuRG/bUKzfAXk7dhg==", + "version": "5.3.13", + "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-5.3.13.tgz", + "integrity": "sha512-U2Hcfl2s3XaYjikN9cT4mPu8ybDbImV3baXR0PkVlC0TTx808bRP3FaPGAzPtB8OByI+JqJ1kyS+7GEgae7+qQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/protocol-http": "^5.3.5", - "@smithy/querystring-builder": "^4.2.5", - "@smithy/types": "^4.9.0", - "@smithy/util-base64": "^4.3.0", + "@smithy/protocol-http": "^5.3.11", + "@smithy/querystring-builder": "^4.2.11", + "@smithy/types": "^4.13.0", + "@smithy/util-base64": "^4.3.2", "tslib": "^2.6.2" }, "engines": { @@ -2193,14 +2954,14 @@ } }, "node_modules/@smithy/hash-blob-browser": { - "version": "4.2.6", - "resolved": "https://registry.npmjs.org/@smithy/hash-blob-browser/-/hash-blob-browser-4.2.6.tgz", - "integrity": "sha512-8P//tA8DVPk+3XURk2rwcKgYwFvwGwmJH/wJqQiSKwXZtf/LiZK+hbUZmPj/9KzM+OVSwe4o85KTp5x9DUZTjw==", + "version": "4.2.12", + "resolved": "https://registry.npmjs.org/@smithy/hash-blob-browser/-/hash-blob-browser-4.2.12.tgz", + "integrity": "sha512-1wQE33DsxkM/waftAhCH9VtJbUGyt1PJ9YRDpOu+q9FUi73LLFUZ2fD8A61g2mT1UY9k7b99+V1xZ41Rz4SHRQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/chunked-blob-reader": "^5.2.0", - "@smithy/chunked-blob-reader-native": "^4.2.1", - "@smithy/types": "^4.9.0", + "@smithy/chunked-blob-reader": "^5.2.2", + "@smithy/chunked-blob-reader-native": "^4.2.3", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2208,14 +2969,14 @@ } }, "node_modules/@smithy/hash-node": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-4.2.5.tgz", - "integrity": "sha512-DpYX914YOfA3UDT9CN1BM787PcHfWRBB43fFGCYrZFUH0Jv+5t8yYl+Pd5PW4+QzoGEDvn5d5QIO4j2HyYZQSA==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-4.2.11.tgz", + "integrity": "sha512-T+p1pNynRkydpdL015ruIoyPSRw9e/SQOWmSAMmmprfswMrd5Ow5igOWNVlvyVFZlxXqGmyH3NQwfwy8r5Jx0A==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.9.0", - "@smithy/util-buffer-from": "^4.2.0", - "@smithy/util-utf8": "^4.2.0", + "@smithy/types": "^4.13.0", + "@smithy/util-buffer-from": "^4.2.2", + "@smithy/util-utf8": "^4.2.2", "tslib": "^2.6.2" }, "engines": { @@ -2223,13 +2984,13 @@ } }, "node_modules/@smithy/hash-stream-node": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/hash-stream-node/-/hash-stream-node-4.2.5.tgz", - "integrity": "sha512-6+do24VnEyvWcGdHXomlpd0m8bfZePpUKBy7m311n+JuRwug8J4dCanJdTymx//8mi0nlkflZBvJe+dEO/O12Q==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/hash-stream-node/-/hash-stream-node-4.2.11.tgz", + "integrity": "sha512-hQsTjwPCRY8w9GK07w1RqJi3e+myh0UaOWBBhZ1UMSDgofH/Q1fEYzU1teaX6HkpX/eWDdm7tAGR0jBPlz9QEQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.9.0", - "@smithy/util-utf8": "^4.2.0", + "@smithy/types": "^4.13.0", + "@smithy/util-utf8": "^4.2.2", "tslib": "^2.6.2" }, "engines": { @@ -2237,12 +2998,12 @@ } }, "node_modules/@smithy/invalid-dependency": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-4.2.5.tgz", - "integrity": "sha512-2L2erASEro1WC5nV+plwIMxrTXpvpfzl4e+Nre6vBVRR2HKeGGcvpJyyL3/PpiSg+cJG2KpTmZmq934Olb6e5A==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-4.2.11.tgz", + "integrity": "sha512-cGNMrgykRmddrNhYy1yBdrp5GwIgEkniS7k9O1VLB38yxQtlvrxpZtUVvo6T4cKpeZsriukBuuxfJcdZQc/f/g==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.9.0", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2250,9 +3011,9 @@ } }, "node_modules/@smithy/is-array-buffer": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-4.2.0.tgz", - "integrity": "sha512-DZZZBvC7sjcYh4MazJSGiWMI2L7E0oCiRHREDzIxi/M2LY79/21iXt6aPLHge82wi5LsuRF5A06Ds3+0mlh6CQ==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-4.2.2.tgz", + "integrity": "sha512-n6rQ4N8Jj4YTQO3YFrlgZuwKodf4zUFs7EJIWH86pSCWBaAtAGBFfCM7Wx6D2bBJ2xqFNxGBSrUWswT3M0VJow==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" @@ -2262,13 +3023,13 @@ } }, "node_modules/@smithy/md5-js": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/md5-js/-/md5-js-4.2.5.tgz", - "integrity": "sha512-Bt6jpSTMWfjCtC0s79gZ/WZ1w90grfmopVOWqkI2ovhjpD5Q2XRXuecIPB9689L2+cCySMbaXDhBPU56FKNDNg==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/md5-js/-/md5-js-4.2.11.tgz", + "integrity": "sha512-350X4kGIrty0Snx2OWv7rPM6p6vM7RzryvFs6B/56Cux3w3sChOb3bymo5oidXJlPcP9fIRxGUCk7GqpiSOtng==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.9.0", - "@smithy/util-utf8": "^4.2.0", + "@smithy/types": "^4.13.0", + "@smithy/util-utf8": "^4.2.2", "tslib": "^2.6.2" }, "engines": { @@ -2276,13 +3037,13 @@ } }, "node_modules/@smithy/middleware-content-length": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-4.2.5.tgz", - "integrity": "sha512-Y/RabVa5vbl5FuHYV2vUCwvh/dqzrEY/K2yWPSqvhFUwIY0atLqO4TienjBXakoy4zrKAMCZwg+YEqmH7jaN7A==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-4.2.11.tgz", + "integrity": "sha512-UvIfKYAKhCzr4p6jFevPlKhQwyQwlJ6IeKLDhmV1PlYfcW3RL4ROjNEDtSik4NYMi9kDkH7eSwyTP3vNJ/u/Dw==", "license": "Apache-2.0", "dependencies": { - "@smithy/protocol-http": "^5.3.5", - "@smithy/types": "^4.9.0", + "@smithy/protocol-http": "^5.3.11", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2290,18 +3051,18 @@ } }, "node_modules/@smithy/middleware-endpoint": { - "version": "4.3.14", - "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-4.3.14.tgz", - "integrity": "sha512-v0q4uTKgBM8dsqGjqsabZQyH85nFaTnFcgpWU1uydKFsdyyMzfvOkNum9G7VK+dOP01vUnoZxIeRiJ6uD0kjIg==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/core": "^3.18.7", - "@smithy/middleware-serde": "^4.2.6", - "@smithy/node-config-provider": "^4.3.5", - "@smithy/shared-ini-file-loader": "^4.4.0", - "@smithy/types": "^4.9.0", - "@smithy/url-parser": "^4.2.5", - "@smithy/util-middleware": "^4.2.5", + "version": "4.4.23", + "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-4.4.23.tgz", + "integrity": "sha512-UEFIejZy54T1EJn2aWJ45voB7RP2T+IRzUqocIdM6GFFa5ClZncakYJfcYnoXt3UsQrZZ9ZRauGm77l9UCbBLw==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/core": "^3.23.9", + "@smithy/middleware-serde": "^4.2.12", + "@smithy/node-config-provider": "^4.3.11", + "@smithy/shared-ini-file-loader": "^4.4.6", + "@smithy/types": "^4.13.0", + "@smithy/url-parser": "^4.2.11", + "@smithy/util-middleware": "^4.2.11", "tslib": "^2.6.2" }, "engines": { @@ -2309,19 +3070,19 @@ } }, "node_modules/@smithy/middleware-retry": { - "version": "4.4.14", - "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-4.4.14.tgz", - "integrity": "sha512-Z2DG8Ej7FyWG1UA+7HceINtSLzswUgs2np3sZX0YBBxCt+CXG4QUxv88ZDS3+2/1ldW7LqtSY1UO/6VQ1pND8Q==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/node-config-provider": "^4.3.5", - "@smithy/protocol-http": "^5.3.5", - "@smithy/service-error-classification": "^4.2.5", - "@smithy/smithy-client": "^4.9.10", - "@smithy/types": "^4.9.0", - "@smithy/util-middleware": "^4.2.5", - "@smithy/util-retry": "^4.2.5", - "@smithy/uuid": "^1.1.0", + "version": "4.4.40", + "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-4.4.40.tgz", + "integrity": "sha512-YhEMakG1Ae57FajERdHNZ4ShOPIY7DsgV+ZoAxo/5BT0KIe+f6DDU2rtIymNNFIj22NJfeeI6LWIifrwM0f+rA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/node-config-provider": "^4.3.11", + "@smithy/protocol-http": "^5.3.11", + "@smithy/service-error-classification": "^4.2.11", + "@smithy/smithy-client": "^4.12.3", + "@smithy/types": "^4.13.0", + "@smithy/util-middleware": "^4.2.11", + "@smithy/util-retry": "^4.2.11", + "@smithy/uuid": "^1.1.2", "tslib": "^2.6.2" }, "engines": { @@ -2329,13 +3090,13 @@ } }, "node_modules/@smithy/middleware-serde": { - "version": "4.2.6", - "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-4.2.6.tgz", - "integrity": "sha512-VkLoE/z7e2g8pirwisLz8XJWedUSY8my/qrp81VmAdyrhi94T+riBfwP+AOEEFR9rFTSonC/5D2eWNmFabHyGQ==", + "version": "4.2.12", + "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-4.2.12.tgz", + "integrity": "sha512-W9g1bOLui7Xn5FABRVS0o3rXL0gfN37d/8I/W7i0N7oxjx9QecUmXEMSUMADTODwdtka9cN43t5BI2CodLJpng==", "license": "Apache-2.0", "dependencies": { - "@smithy/protocol-http": "^5.3.5", - "@smithy/types": "^4.9.0", + "@smithy/protocol-http": "^5.3.11", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2343,12 +3104,12 @@ } }, "node_modules/@smithy/middleware-stack": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-4.2.5.tgz", - "integrity": "sha512-bYrutc+neOyWxtZdbB2USbQttZN0mXaOyYLIsaTbJhFsfpXyGWUxJpEuO1rJ8IIJm2qH4+xJT0mxUSsEDTYwdQ==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-4.2.11.tgz", + "integrity": "sha512-s+eenEPW6RgliDk2IhjD2hWOxIx1NKrOHxEwNUaUXxYBxIyCcDfNULZ2Mu15E3kwcJWBedTET/kEASPV1A1Akg==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.9.0", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2356,14 +3117,14 @@ } }, "node_modules/@smithy/node-config-provider": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-4.3.5.tgz", - "integrity": "sha512-UTurh1C4qkVCtqggI36DGbLB2Kv8UlcFdMXDcWMbqVY2uRg0XmT9Pb4Vj6oSQ34eizO1fvR0RnFV4Axw4IrrAg==", + "version": "4.3.11", + "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-4.3.11.tgz", + "integrity": "sha512-xD17eE7kaLgBBGf5CZQ58hh2YmwK1Z0O8YhffwB/De2jsL0U3JklmhVYJ9Uf37OtUDLF2gsW40Xwwag9U869Gg==", "license": "Apache-2.0", "dependencies": { - "@smithy/property-provider": "^4.2.5", - "@smithy/shared-ini-file-loader": "^4.4.0", - "@smithy/types": "^4.9.0", + "@smithy/property-provider": "^4.2.11", + "@smithy/shared-ini-file-loader": "^4.4.6", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2371,15 +3132,15 @@ } }, "node_modules/@smithy/node-http-handler": { - "version": "4.4.5", - "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.4.5.tgz", - "integrity": "sha512-CMnzM9R2WqlqXQGtIlsHMEZfXKJVTIrqCNoSd/QpAyp+Dw0a1Vps13l6ma1fH8g7zSPNsA59B/kWgeylFuA/lw==", + "version": "4.4.14", + "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.4.14.tgz", + "integrity": "sha512-DamSqaU8nuk0xTJDrYnRzZndHwwRnyj/n/+RqGGCcBKB4qrQem0mSDiWdupaNWdwxzyMU91qxDmHOCazfhtO3A==", "license": "Apache-2.0", "dependencies": { - "@smithy/abort-controller": "^4.2.5", - "@smithy/protocol-http": "^5.3.5", - "@smithy/querystring-builder": "^4.2.5", - "@smithy/types": "^4.9.0", + "@smithy/abort-controller": "^4.2.11", + "@smithy/protocol-http": "^5.3.11", + "@smithy/querystring-builder": "^4.2.11", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2387,12 +3148,12 @@ } }, "node_modules/@smithy/property-provider": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-4.2.5.tgz", - "integrity": "sha512-8iLN1XSE1rl4MuxvQ+5OSk/Zb5El7NJZ1td6Tn+8dQQHIjp59Lwl6bd0+nzw6SKm2wSSriH2v/I9LPzUic7EOg==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-4.2.11.tgz", + "integrity": "sha512-14T1V64o6/ndyrnl1ze1ZhyLzIeYNN47oF/QU6P5m82AEtyOkMJTb0gO1dPubYjyyKuPD6OSVMPDKe+zioOnCg==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.9.0", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2400,12 +3161,12 @@ } }, "node_modules/@smithy/protocol-http": { - "version": "5.3.5", - "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-5.3.5.tgz", - "integrity": "sha512-RlaL+sA0LNMp03bf7XPbFmT5gN+w3besXSWMkA8rcmxLSVfiEXElQi4O2IWwPfxzcHkxqrwBFMbngB8yx/RvaQ==", + "version": "5.3.11", + "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-5.3.11.tgz", + "integrity": "sha512-hI+barOVDJBkNt4y0L2mu3Ugc0w7+BpJ2CZuLwXtSltGAAwCb3IvnalGlbDV/UCS6a9ZuT3+exd1WxNdLb5IlQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.9.0", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2413,13 +3174,13 @@ } }, "node_modules/@smithy/querystring-builder": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-4.2.5.tgz", - "integrity": "sha512-y98otMI1saoajeik2kLfGyRp11e5U/iJYH/wLCh3aTV/XutbGT9nziKGkgCaMD1ghK7p6htHMm6b6scl9JRUWg==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-4.2.11.tgz", + "integrity": "sha512-7spdikrYiljpket6u0up2Ck2mxhy7dZ0+TDd+S53Dg2DHd6wg+YNJrTCHiLdgZmEXZKI7LJZcwL3721ZRDFiqA==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.9.0", - "@smithy/util-uri-escape": "^4.2.0", + "@smithy/types": "^4.13.0", + "@smithy/util-uri-escape": "^4.2.2", "tslib": "^2.6.2" }, "engines": { @@ -2427,12 +3188,12 @@ } }, "node_modules/@smithy/querystring-parser": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-4.2.5.tgz", - "integrity": "sha512-031WCTdPYgiQRYNPXznHXof2YM0GwL6SeaSyTH/P72M1Vz73TvCNH2Nq8Iu2IEPq9QP2yx0/nrw5YmSeAi/AjQ==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-4.2.11.tgz", + "integrity": "sha512-nE3IRNjDltvGcoThD2abTozI1dkSy8aX+a2N1Rs55en5UsdyyIXgGEmevUL3okZFoJC77JgRGe99xYohhsjivQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.9.0", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2440,24 +3201,24 @@ } }, "node_modules/@smithy/service-error-classification": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-4.2.5.tgz", - "integrity": "sha512-8fEvK+WPE3wUAcDvqDQG1Vk3ANLR8Px979te96m84CbKAjBVf25rPYSzb4xU4hlTyho7VhOGnh5i62D/JVF0JQ==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-4.2.11.tgz", + "integrity": "sha512-HkMFJZJUhzU3HvND1+Yw/kYWXp4RPDLBWLcK1n+Vqw8xn4y2YiBhdww8IxhkQjP/QlZun5bwm3vcHc8AqIU3zw==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.9.0" + "@smithy/types": "^4.13.0" }, "engines": { "node": ">=18.0.0" } }, "node_modules/@smithy/shared-ini-file-loader": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-4.4.0.tgz", - "integrity": "sha512-5WmZ5+kJgJDjwXXIzr1vDTG+RhF9wzSODQBfkrQ2VVkYALKGvZX1lgVSxEkgicSAFnFhPj5rudJV0zoinqS0bA==", + "version": "4.4.6", + "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-4.4.6.tgz", + "integrity": "sha512-IB/M5I8G0EeXZTHsAxpx51tMQ5R719F3aq+fjEB6VtNcCHDc0ajFDIGDZw+FW9GxtEkgTduiPpjveJdA/CX7sw==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.9.0", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2465,18 +3226,18 @@ } }, "node_modules/@smithy/signature-v4": { - "version": "5.3.5", - "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-5.3.5.tgz", - "integrity": "sha512-xSUfMu1FT7ccfSXkoLl/QRQBi2rOvi3tiBZU2Tdy3I6cgvZ6SEi9QNey+lqps/sJRnogIS+lq+B1gxxbra2a/w==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/is-array-buffer": "^4.2.0", - "@smithy/protocol-http": "^5.3.5", - "@smithy/types": "^4.9.0", - "@smithy/util-hex-encoding": "^4.2.0", - "@smithy/util-middleware": "^4.2.5", - "@smithy/util-uri-escape": "^4.2.0", - "@smithy/util-utf8": "^4.2.0", + "version": "5.3.11", + "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-5.3.11.tgz", + "integrity": "sha512-V1L6N9aKOBAN4wEHLyqjLBnAz13mtILU0SeDrjOaIZEeN6IFa6DxwRt1NNpOdmSpQUfkBj0qeD3m6P77uzMhgQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/is-array-buffer": "^4.2.2", + "@smithy/protocol-http": "^5.3.11", + "@smithy/types": "^4.13.0", + "@smithy/util-hex-encoding": "^4.2.2", + "@smithy/util-middleware": "^4.2.11", + "@smithy/util-uri-escape": "^4.2.2", + "@smithy/util-utf8": "^4.2.2", "tslib": "^2.6.2" }, "engines": { @@ -2484,17 +3245,17 @@ } }, "node_modules/@smithy/smithy-client": { - "version": "4.9.10", - "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-4.9.10.tgz", - "integrity": "sha512-Jaoz4Jw1QYHc1EFww/E6gVtNjhoDU+gwRKqXP6C3LKYqqH2UQhP8tMP3+t/ePrhaze7fhLE8vS2q6vVxBANFTQ==", + "version": "4.12.3", + "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-4.12.3.tgz", + "integrity": "sha512-7k4UxjSpHmPN2AxVhvIazRSzFQjWnud3sOsXcFStzagww17j1cFQYqTSiQ8xuYK3vKLR1Ni8FzuT3VlKr3xCNw==", "license": "Apache-2.0", "dependencies": { - "@smithy/core": "^3.18.7", - "@smithy/middleware-endpoint": "^4.3.14", - "@smithy/middleware-stack": "^4.2.5", - "@smithy/protocol-http": "^5.3.5", - "@smithy/types": "^4.9.0", - "@smithy/util-stream": "^4.5.6", + "@smithy/core": "^3.23.9", + "@smithy/middleware-endpoint": "^4.4.23", + "@smithy/middleware-stack": "^4.2.11", + "@smithy/protocol-http": "^5.3.11", + "@smithy/types": "^4.13.0", + "@smithy/util-stream": "^4.5.17", "tslib": "^2.6.2" }, "engines": { @@ -2502,9 +3263,9 @@ } }, "node_modules/@smithy/types": { - "version": "4.9.0", - "resolved": "https://registry.npmjs.org/@smithy/types/-/types-4.9.0.tgz", - "integrity": "sha512-MvUbdnXDTwykR8cB1WZvNNwqoWVaTRA0RLlLmf/cIFNMM2cKWz01X4Ly6SMC4Kks30r8tT3Cty0jmeWfiuyHTA==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@smithy/types/-/types-4.13.0.tgz", + "integrity": "sha512-COuLsZILbbQsdrwKQpkkpyep7lCsByxwj7m0Mg5v66/ZTyenlfBc40/QFQ5chO0YN/PNEH1Bi3fGtfXPnYNeDw==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" @@ -2514,13 +3275,13 @@ } }, "node_modules/@smithy/url-parser": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-4.2.5.tgz", - "integrity": "sha512-VaxMGsilqFnK1CeBX+LXnSuaMx4sTL/6znSZh2829txWieazdVxr54HmiyTsIbpOTLcf5nYpq9lpzmwRdxj6rQ==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-4.2.11.tgz", + "integrity": "sha512-oTAGGHo8ZYc5VZsBREzuf5lf2pAurJQsccMusVZ85wDkX66ojEc/XauiGjzCj50A61ObFTPe6d7Pyt6UBYaing==", "license": "Apache-2.0", "dependencies": { - "@smithy/querystring-parser": "^4.2.5", - "@smithy/types": "^4.9.0", + "@smithy/querystring-parser": "^4.2.11", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2528,13 +3289,13 @@ } }, "node_modules/@smithy/util-base64": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-4.3.0.tgz", - "integrity": "sha512-GkXZ59JfyxsIwNTWFnjmFEI8kZpRNIBfxKjv09+nkAWPt/4aGaEWMM04m4sxgNVWkbt2MdSvE3KF/PfX4nFedQ==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-4.3.2.tgz", + "integrity": "sha512-XRH6b0H/5A3SgblmMa5ErXQ2XKhfbQB+Fm/oyLZ2O2kCUrwgg55bU0RekmzAhuwOjA9qdN5VU2BprOvGGUkOOQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/util-buffer-from": "^4.2.0", - "@smithy/util-utf8": "^4.2.0", + "@smithy/util-buffer-from": "^4.2.2", + "@smithy/util-utf8": "^4.2.2", "tslib": "^2.6.2" }, "engines": { @@ -2542,9 +3303,9 @@ } }, "node_modules/@smithy/util-body-length-browser": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-4.2.0.tgz", - "integrity": "sha512-Fkoh/I76szMKJnBXWPdFkQJl2r9SjPt3cMzLdOB6eJ4Pnpas8hVoWPYemX/peO0yrrvldgCUVJqOAjUrOLjbxg==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-4.2.2.tgz", + "integrity": "sha512-JKCrLNOup3OOgmzeaKQwi4ZCTWlYR5H4Gm1r2uTMVBXoemo1UEghk5vtMi1xSu2ymgKVGW631e2fp9/R610ZjQ==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" @@ -2554,9 +3315,9 @@ } }, "node_modules/@smithy/util-body-length-node": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-4.2.1.tgz", - "integrity": "sha512-h53dz/pISVrVrfxV1iqXlx5pRg3V2YWFcSQyPyXZRrZoZj4R4DeWRDo1a7dd3CPTcFi3kE+98tuNyD2axyZReA==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-4.2.3.tgz", + "integrity": "sha512-ZkJGvqBzMHVHE7r/hcuCxlTY8pQr1kMtdsVPs7ex4mMU+EAbcXppfo5NmyxMYi2XU49eqaz56j2gsk4dHHPG/g==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" @@ -2566,12 +3327,12 @@ } }, "node_modules/@smithy/util-buffer-from": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-4.2.0.tgz", - "integrity": "sha512-kAY9hTKulTNevM2nlRtxAG2FQ3B2OR6QIrPY3zE5LqJy1oxzmgBGsHLWTcNhWXKchgA0WHW+mZkQrng/pgcCew==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-4.2.2.tgz", + "integrity": "sha512-FDXD7cvUoFWwN6vtQfEta540Y/YBe5JneK3SoZg9bThSoOAC/eGeYEua6RkBgKjGa/sz6Y+DuBZj3+YEY21y4Q==", "license": "Apache-2.0", "dependencies": { - "@smithy/is-array-buffer": "^4.2.0", + "@smithy/is-array-buffer": "^4.2.2", "tslib": "^2.6.2" }, "engines": { @@ -2579,9 +3340,9 @@ } }, "node_modules/@smithy/util-config-provider": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-4.2.0.tgz", - "integrity": "sha512-YEjpl6XJ36FTKmD+kRJJWYvrHeUvm5ykaUS5xK+6oXffQPHeEM4/nXlZPe+Wu0lsgRUcNZiliYNh/y7q9c2y6Q==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-4.2.2.tgz", + "integrity": "sha512-dWU03V3XUprJwaUIFVv4iOnS1FC9HnMHDfUrlNDSh4315v0cWyaIErP8KiqGVbf5z+JupoVpNM7ZB3jFiTejvQ==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" @@ -2591,14 +3352,14 @@ } }, "node_modules/@smithy/util-defaults-mode-browser": { - "version": "4.3.13", - "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-4.3.13.tgz", - "integrity": "sha512-hlVLdAGrVfyNei+pKIgqDTxfu/ZI2NSyqj4IDxKd5bIsIqwR/dSlkxlPaYxFiIaDVrBy0he8orsFy+Cz119XvA==", + "version": "4.3.39", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-4.3.39.tgz", + "integrity": "sha512-ui7/Ho/+VHqS7Km2wBw4/Ab4RktoiSshgcgpJzC4keFPs6tLJS4IQwbeahxQS3E/w98uq6E1mirCH/id9xIXeQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/property-provider": "^4.2.5", - "@smithy/smithy-client": "^4.9.10", - "@smithy/types": "^4.9.0", + "@smithy/property-provider": "^4.2.11", + "@smithy/smithy-client": "^4.12.3", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2606,17 +3367,17 @@ } }, "node_modules/@smithy/util-defaults-mode-node": { - "version": "4.2.16", - "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-4.2.16.tgz", - "integrity": "sha512-F1t22IUiJLHrxW9W1CQ6B9PN+skZ9cqSuzB18Eh06HrJPbjsyZ7ZHecAKw80DQtyGTRcVfeukKaCRYebFwclbg==", + "version": "4.2.42", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-4.2.42.tgz", + "integrity": "sha512-QDA84CWNe8Akpj15ofLO+1N3Rfg8qa2K5uX0y6HnOp4AnRYRgWrKx/xzbYNbVF9ZsyJUYOfcoaN3y93wA/QJ2A==", "license": "Apache-2.0", "dependencies": { - "@smithy/config-resolver": "^4.4.3", - "@smithy/credential-provider-imds": "^4.2.5", - "@smithy/node-config-provider": "^4.3.5", - "@smithy/property-provider": "^4.2.5", - "@smithy/smithy-client": "^4.9.10", - "@smithy/types": "^4.9.0", + "@smithy/config-resolver": "^4.4.10", + "@smithy/credential-provider-imds": "^4.2.11", + "@smithy/node-config-provider": "^4.3.11", + "@smithy/property-provider": "^4.2.11", + "@smithy/smithy-client": "^4.12.3", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2624,13 +3385,13 @@ } }, "node_modules/@smithy/util-endpoints": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-3.2.5.tgz", - "integrity": "sha512-3O63AAWu2cSNQZp+ayl9I3NapW1p1rR5mlVHcF6hAB1dPZUQFfRPYtplWX/3xrzWthPGj5FqB12taJJCfH6s8A==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-3.3.2.tgz", + "integrity": "sha512-+4HFLpE5u29AbFlTdlKIT7jfOzZ8PDYZKTb3e+AgLz986OYwqTourQ5H+jg79/66DB69Un1+qKecLnkZdAsYcA==", "license": "Apache-2.0", "dependencies": { - "@smithy/node-config-provider": "^4.3.5", - "@smithy/types": "^4.9.0", + "@smithy/node-config-provider": "^4.3.11", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2638,9 +3399,9 @@ } }, "node_modules/@smithy/util-hex-encoding": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-4.2.0.tgz", - "integrity": "sha512-CCQBwJIvXMLKxVbO88IukazJD9a4kQ9ZN7/UMGBjBcJYvatpWk+9g870El4cB8/EJxfe+k+y0GmR9CAzkF+Nbw==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-4.2.2.tgz", + "integrity": "sha512-Qcz3W5vuHK4sLQdyT93k/rfrUwdJ8/HZ+nMUOyGdpeGA1Wxt65zYwi3oEl9kOM+RswvYq90fzkNDahPS8K0OIg==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" @@ -2650,12 +3411,12 @@ } }, "node_modules/@smithy/util-middleware": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-4.2.5.tgz", - "integrity": "sha512-6Y3+rvBF7+PZOc40ybeZMcGln6xJGVeY60E7jy9Mv5iKpMJpHgRE6dKy9ScsVxvfAYuEX4Q9a65DQX90KaQ3bA==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-4.2.11.tgz", + "integrity": "sha512-r3dtF9F+TpSZUxpOVVtPfk09Rlo4lT6ORBqEvX3IBT6SkQAdDSVKR5GcfmZbtl7WKhKnmb3wbDTQ6ibR2XHClw==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.9.0", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2663,13 +3424,13 @@ } }, "node_modules/@smithy/util-retry": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-4.2.5.tgz", - "integrity": "sha512-GBj3+EZBbN4NAqJ/7pAhsXdfzdlznOh8PydUijy6FpNIMnHPSMO2/rP4HKu+UFeikJxShERk528oy7GT79YiJg==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-4.2.11.tgz", + "integrity": "sha512-XSZULmL5x6aCTTii59wJqKsY1l3eMIAomRAccW7Tzh9r8s7T/7rdo03oektuH5jeYRlJMPcNP92EuRDvk9aXbw==", "license": "Apache-2.0", "dependencies": { - "@smithy/service-error-classification": "^4.2.5", - "@smithy/types": "^4.9.0", + "@smithy/service-error-classification": "^4.2.11", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2677,18 +3438,18 @@ } }, "node_modules/@smithy/util-stream": { - "version": "4.5.6", - "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-4.5.6.tgz", - "integrity": "sha512-qWw/UM59TiaFrPevefOZ8CNBKbYEP6wBAIlLqxn3VAIo9rgnTNc4ASbVrqDmhuwI87usnjhdQrxodzAGFFzbRQ==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/fetch-http-handler": "^5.3.6", - "@smithy/node-http-handler": "^4.4.5", - "@smithy/types": "^4.9.0", - "@smithy/util-base64": "^4.3.0", - "@smithy/util-buffer-from": "^4.2.0", - "@smithy/util-hex-encoding": "^4.2.0", - "@smithy/util-utf8": "^4.2.0", + "version": "4.5.17", + "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-4.5.17.tgz", + "integrity": "sha512-793BYZ4h2JAQkNHcEnyFxDTcZbm9bVybD0UV/LEWmZ5bkTms7JqjfrLMi2Qy0E5WFcCzLwCAPgcvcvxoeALbAQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/fetch-http-handler": "^5.3.13", + "@smithy/node-http-handler": "^4.4.14", + "@smithy/types": "^4.13.0", + "@smithy/util-base64": "^4.3.2", + "@smithy/util-buffer-from": "^4.2.2", + "@smithy/util-hex-encoding": "^4.2.2", + "@smithy/util-utf8": "^4.2.2", "tslib": "^2.6.2" }, "engines": { @@ -2696,9 +3457,9 @@ } }, "node_modules/@smithy/util-uri-escape": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-4.2.0.tgz", - "integrity": "sha512-igZpCKV9+E/Mzrpq6YacdTQ0qTiLm85gD6N/IrmyDvQFA4UnU3d5g3m8tMT/6zG/vVkWSU+VxeUyGonL62DuxA==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-4.2.2.tgz", + "integrity": "sha512-2kAStBlvq+lTXHyAZYfJRb/DfS3rsinLiwb+69SstC9Vb0s9vNWkRwpnj918Pfi85mzi42sOqdV72OLxWAISnw==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" @@ -2708,12 +3469,12 @@ } }, "node_modules/@smithy/util-utf8": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-4.2.0.tgz", - "integrity": "sha512-zBPfuzoI8xyBtR2P6WQj63Rz8i3AmfAaJLuNG8dWsfvPe8lO4aCPYLn879mEgHndZH1zQ2oXmG8O1GGzzaoZiw==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-4.2.2.tgz", + "integrity": "sha512-75MeYpjdWRe8M5E3AW0O4Cx3UadweS+cwdXjwYGBW5h/gxxnbeZ877sLPX/ZJA9GVTlL/qG0dXP29JWFCD1Ayw==", "license": "Apache-2.0", "dependencies": { - "@smithy/util-buffer-from": "^4.2.0", + "@smithy/util-buffer-from": "^4.2.2", "tslib": "^2.6.2" }, "engines": { @@ -2721,13 +3482,13 @@ } }, "node_modules/@smithy/util-waiter": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/util-waiter/-/util-waiter-4.2.5.tgz", - "integrity": "sha512-Dbun99A3InifQdIrsXZ+QLcC0PGBPAdrl4cj1mTgJvyc9N2zf7QSxg8TBkzsCmGJdE3TLbO9ycwpY0EkWahQ/g==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@smithy/util-waiter/-/util-waiter-4.2.11.tgz", + "integrity": "sha512-x7Rh2azQPs3XxbvCzcttRErKKvLnbZfqRf/gOjw2pb+ZscX88e5UkRPCB67bVnsFHxayvMvmePfKTqsRb+is1A==", "license": "Apache-2.0", "dependencies": { - "@smithy/abort-controller": "^4.2.5", - "@smithy/types": "^4.9.0", + "@smithy/abort-controller": "^4.2.11", + "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "engines": { @@ -2735,9 +3496,9 @@ } }, "node_modules/@smithy/uuid": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@smithy/uuid/-/uuid-1.1.0.tgz", - "integrity": "sha512-4aUIteuyxtBUhVdiQqcDhKFitwfd9hqoSDYY2KRXiWtgoWJ9Bmise+KfEPDiVHWeJepvF8xJO9/9+WDIciMFFw==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@smithy/uuid/-/uuid-1.1.2.tgz", + "integrity": "sha512-O/IEdcCUKkubz60tFbGA7ceITTAJsty+lBjNoorP4Z6XRqaFb/OjQjZODophEcuq68nKm6/0r+6/lLQ+XVpk8g==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" @@ -3333,6 +4094,15 @@ ], "license": "MIT" }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, "node_modules/dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -3567,10 +4337,23 @@ "dev": true, "license": "MIT" }, + "node_modules/fast-xml-builder": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fast-xml-builder/-/fast-xml-builder-1.0.0.tgz", + "integrity": "sha512-fpZuDogrAgnyt9oDDz+5DBz0zgPdPZz6D4IR7iESxRXElrlGTRkHJ9eEt+SACRJwT0FNFrt71DFQIUFBJfX/uQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT" + }, "node_modules/fast-xml-parser": { "version": "5.2.5", "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.2.5.tgz", "integrity": "sha512-pfX9uG9Ki0yekDHx2SiuRIyFdyAr1kMIMitPvb0YBo8SUfKvia7w7FIyd/l6av85pFYRhZscS75MwMnbvY+hcQ==", + "dev": true, "funding": [ { "type": "github", @@ -4983,6 +5766,50 @@ "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", "license": "ISC" }, + "node_modules/sharp": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.5.tgz", + "integrity": "sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==", + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@img/colour": "^1.0.0", + "detect-libc": "^2.1.2", + "semver": "^7.7.3" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.34.5", + "@img/sharp-darwin-x64": "0.34.5", + "@img/sharp-libvips-darwin-arm64": "1.2.4", + "@img/sharp-libvips-darwin-x64": "1.2.4", + "@img/sharp-libvips-linux-arm": "1.2.4", + "@img/sharp-libvips-linux-arm64": "1.2.4", + "@img/sharp-libvips-linux-ppc64": "1.2.4", + "@img/sharp-libvips-linux-riscv64": "1.2.4", + "@img/sharp-libvips-linux-s390x": "1.2.4", + "@img/sharp-libvips-linux-x64": "1.2.4", + "@img/sharp-libvips-linuxmusl-arm64": "1.2.4", + "@img/sharp-libvips-linuxmusl-x64": "1.2.4", + "@img/sharp-linux-arm": "0.34.5", + "@img/sharp-linux-arm64": "0.34.5", + "@img/sharp-linux-ppc64": "0.34.5", + "@img/sharp-linux-riscv64": "0.34.5", + "@img/sharp-linux-s390x": "0.34.5", + "@img/sharp-linux-x64": "0.34.5", + "@img/sharp-linuxmusl-arm64": "0.34.5", + "@img/sharp-linuxmusl-x64": "0.34.5", + "@img/sharp-wasm32": "0.34.5", + "@img/sharp-win32-arm64": "0.34.5", + "@img/sharp-win32-ia32": "0.34.5", + "@img/sharp-win32-x64": "0.34.5" + } + }, "node_modules/side-channel": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", @@ -5161,9 +5988,9 @@ } }, "node_modules/strnum": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/strnum/-/strnum-2.1.1.tgz", - "integrity": "sha512-7ZvoFTiCnGxBtDqJ//Cu6fWtZtc7Y3x+QOirG15wztbdngGSkht27o2pyGWrVy0b4WAy3jbKmnoK6g5VlVNUUw==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-2.2.0.tgz", + "integrity": "sha512-Y7Bj8XyJxnPAORMZj/xltsfo55uOiyHcU2tnAVzHUnSJR/KsEX+9RoDeXEnsXtl/CX4fAcrt64gZ13aGaWPeBg==", "funding": [ { "type": "github", diff --git a/package.json b/package.json index b63c588..2ed7bb9 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,8 @@ "start": "node dist/server.js" }, "dependencies": { - "@aws-sdk/client-s3": "^3.948.0", - "@aws-sdk/s3-request-presigner": "^3.948.0", + "@aws-sdk/client-s3": "^3.1004.0", + "@aws-sdk/s3-request-presigner": "^3.1004.0", "@types/cookie-parser": "^1.4.10", "@types/multer": "^2.0.0", "bcrypt": "^6.0.0", @@ -24,6 +24,7 @@ "multer": "^2.0.2", "nodemailer": "^7.0.11", "pino": "^10.1.0", + "sharp": "^0.34.5", "ua-parser-js": "^2.0.6", "undici": "^7.16.0", "zod": "^4.1.13" diff --git a/src/config/corsConfig.ts b/src/config/corsConfig.ts index dc42528..c4e7ae4 100644 --- a/src/config/corsConfig.ts +++ b/src/config/corsConfig.ts @@ -1,34 +1,20 @@ -import { ALLOWED_ORIGINS } from 'constants/globalConts.js'; +import { ALLOWED_ORIGINS } from '@constants/globalConts.js'; import type { CorsOptions } from 'cors'; - /** - * Returns the appropriate CORS configuration based on the current environment. - * @returns CorsOptions object for the Express 'cors' middleware. - */ const getCorsConfig = (): CorsOptions => { - // Check if the environment is explicitly set to production - const isProduction = process.env.NODE_ENV === 'production'; - - // Determine the allowed origin - // In production, strictly use the production URL. - // In any other environment (development, staging, test), use the development URL. - const allowedOrigin = ALLOWED_ORIGINS; + const isProduction = process.env.NODE_ENV === 'production'; - return { - // Set the dynamic origin - origin: allowedOrigin, - - // Define allowed interactions - methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'], - allowedHeaders: ['Content-Type', 'Authorization', 'X-Requested-With', 'X-CSRF-Token'], - - - // Allow cookies or authorization headers to be sent - credentials: true, - - // Caching for preflight requests - maxAge: 86400 // Cache preflight response for 24 hours - }; + const allowedOrigin = ALLOWED_ORIGINS.filter((origin): origin is string => origin !== undefined); + + return { + origin: allowedOrigin, + + methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'], + allowedHeaders: ['Content-Type', 'Authorization', 'X-Requested-With', 'X-CSRF-Token'], + credentials: true, + + maxAge: 86400, + }; }; -export default getCorsConfig; \ No newline at end of file +export default getCorsConfig; diff --git a/src/constants/audioConsts.ts b/src/constants/audioConsts.ts new file mode 100644 index 0000000..f954468 --- /dev/null +++ b/src/constants/audioConsts.ts @@ -0,0 +1,28 @@ +// Audio generation configuration +export const DEFAULT_VOICE_STABILITY = 0.5; +export const DEFAULT_VOICE_SIMILARITY_BOOST = 0.75; +export const DEFAULT_VOICE_STYLE = 0; +export const DEFAULT_USE_SPEAKER_BOOST = true; + +// Supported TTS providers +export const TTS_PROVIDERS = ['elevenlabs', 'openai', 'azure', 'google'] as const; +export type TTSProvider = (typeof TTS_PROVIDERS)[number]; + +// Default provider +export const DEFAULT_TTS_PROVIDER: TTSProvider = 'elevenlabs'; + +// Audio quality settings +export const AUDIO_OUTPUT_FORMAT = 'mp3_44100_128' as const; +export const AUDIO_SAMPLE_RATE = 44100; +export const AUDIO_BIT_RATE = 128; + +// Rate limiting +export const MAX_AUDIO_GENERATIONS_PER_DAY = 100; +export const MAX_AUDIO_GENERATIONS_PER_HOUR = 20; + +// Cache TTL (in seconds) +export const AUDIO_CACHE_TTL = 86400; // 24 hours + +// Version constants +export const AUDIO_VERSION_START = 1; +export const MAX_AUDIO_VERSIONS_PER_NARRATION = 100; diff --git a/src/constants/globalConts.ts b/src/constants/globalConts.ts index 3558001..ded1e7c 100644 --- a/src/constants/globalConts.ts +++ b/src/constants/globalConts.ts @@ -1,7 +1,3 @@ export const ALLOWED_ORIGINS = process.env.ALLOWED_ORIGINS ? process.env.ALLOWED_ORIGINS.split(',') - : [ - process.env.DEV_CLIENT_URL || 'http://localhost:5173', - process.env.PROD_CLIENT_URL || 'https://your-production-app.com', - ]; - \ No newline at end of file + : [process.env.DEV_CLIENT_URL, process.env.PROD_CLIENT_URL]; diff --git a/src/modules/narration/narration.constants.ts b/src/constants/narrationConsts.ts similarity index 55% rename from src/modules/narration/narration.constants.ts rename to src/constants/narrationConsts.ts index 935221f..6dab181 100644 --- a/src/modules/narration/narration.constants.ts +++ b/src/constants/narrationConsts.ts @@ -1,3 +1,4 @@ +// Narration timing constants export const DEFAULT_WORDS_PER_SECOND = 2.5; export const MAX_NARRATION_LENGTH = 20000; -export const NARRATION_VERSION_GAP = 1; \ No newline at end of file +export const NARRATION_VERSION_GAP = 1; diff --git a/src/db/connect.ts b/src/db/connect.ts index 8d88601..9b3fd00 100644 --- a/src/db/connect.ts +++ b/src/db/connect.ts @@ -1,27 +1,24 @@ -import mongoose from "mongoose"; -import dotenv from "dotenv"; +import mongoose from 'mongoose'; +import dotenv from 'dotenv'; dotenv.config(); -const password = encodeURIComponent(process.env.DB_PASSWORD ?? ""); -const username = encodeURIComponent(process.env.DB_USERNAME ?? ""); +const password = encodeURIComponent(process.env.DB_PASSWORD ?? ''); +const username = encodeURIComponent(process.env.DB_USERNAME ?? ''); const CONNECTION_STRING = `${ - process.env.NODE_ENV !== "production" - ? "mongodb://localhost:27017/your_db_name?replicaSet=rs0" + process.env.NODE_ENV === 'development' + ? 'mongodb://localhost:27017/your_db_name?replicaSet=rs0' : `mongodb+srv://${username}:${password}@db0.huxhv46.mongodb.net/?appName=DB0` }`; const connectDB = async () => { try { await mongoose.connect(`${CONNECTION_STRING}`, { - dbName: "myapp", + dbName: 'myapp', }); - console.log("✅ MongoDB Connected"); + console.log('✅ MongoDB Connected'); } catch (err) { - console.error( - "❌ MongoDB Error:", - err instanceof Error ? err.message : String(err) - ); + console.error('❌ MongoDB Error:', err instanceof Error ? err.message : String(err)); process.exit(1); } }; diff --git a/src/libs/ai/clients/openAI.ts b/src/libs/ai/clients/openAI.ts index df9749c..280bdd6 100644 --- a/src/libs/ai/clients/openAI.ts +++ b/src/libs/ai/clients/openAI.ts @@ -11,7 +11,7 @@ export async function openRouterAI(prompt: string): Promise { 'Content-Type': 'application/json', }, body: JSON.stringify({ - model: 'google/gemma-3-27b-it:free', + model: 'google/gemma-4-31b-it:free', temperature: 0.7, messages: [ { diff --git a/src/libs/ai/policies/resolveModel.ts b/src/libs/ai/policies/resolveModel.ts index 7b4cf59..02ed785 100644 --- a/src/libs/ai/policies/resolveModel.ts +++ b/src/libs/ai/policies/resolveModel.ts @@ -1,5 +1,5 @@ import { BadRequestError } from '@middleware/error/index.js'; -import type { AIMode, Plan } from 'types/index.js'; +import type { AIMode, Plan } from '@app-types/index.js'; type ModelConfig = | { diff --git a/src/libs/ai/prompts/batchScenesPrompt.ts b/src/libs/ai/prompts/batchScenesPrompt.ts index 4988914..f54765b 100644 --- a/src/libs/ai/prompts/batchScenesPrompt.ts +++ b/src/libs/ai/prompts/batchScenesPrompt.ts @@ -7,9 +7,11 @@ import { MULTI_SCENE_REGENERATION_PROMPT, MULTI_SCENE_STRUCTURE_FORMAT, } from '../constants/scenesPromptConts.js'; -import { StoryContent } from 'types/index.js'; +import { StoryContent } from '@app-types/index.js'; -export type BatchSceneMode = 'generate' | 'regenerate'; +import type { BatchSceneMode } from '@app-types/Scene.js'; + +export type { BatchSceneMode }; type BuildBatchScenePromptInput = { mode: BatchSceneMode; diff --git a/src/libs/ai/prompts/generateStoryRegenerationPrompt.ts b/src/libs/ai/prompts/generateStoryRegenerationPrompt.ts index 261cd77..740a0fc 100644 --- a/src/libs/ai/prompts/generateStoryRegenerationPrompt.ts +++ b/src/libs/ai/prompts/generateStoryRegenerationPrompt.ts @@ -1,6 +1,6 @@ import { Platform, StoryIntent } from '@constants/storyConsts.js'; import { ContextProfile } from '@models/ContextProfile.js'; -import { GLOBAL_SAFETY_RULES } from 'libs/ai/constants/globalSafetyRules.js'; +import { GLOBAL_SAFETY_RULES } from '@libs/ai/constants/globalSafetyRules.js'; import { STORY_GENERATION_FORMAT } from '../constants/storyPromptConts.js'; import { buildContextSection } from './utils/buildContextSection.js'; import { calculateWordLimits } from '../constants/calculateWordLimits.js'; diff --git a/src/libs/ai/prompts/narrationPrompt.ts b/src/libs/ai/prompts/narrationPrompt.ts index 40d821d..c20464c 100644 --- a/src/libs/ai/prompts/narrationPrompt.ts +++ b/src/libs/ai/prompts/narrationPrompt.ts @@ -2,7 +2,7 @@ import { ContextProfile } from '@models/ContextProfile.js'; import { GLOBAL_SAFETY_RULES } from '../constants/globalSafetyRules.js'; import { FULL_STORY_NARRATION_STRUCTURE_FORMAT } from '../constants/narrationPromptConsts.js'; import { Platform, StoryIntent } from '@constants/storyConsts.js'; -import { StoryContent } from 'types/index.js'; +import { StoryContent } from '@app-types/index.js'; type BuildFullNarrationPromptInput = { storyTitle: string; diff --git a/src/libs/ai/prompts/singleScenePrompt.ts b/src/libs/ai/prompts/singleScenePrompt.ts index f022af1..a2ea882 100644 --- a/src/libs/ai/prompts/singleScenePrompt.ts +++ b/src/libs/ai/prompts/singleScenePrompt.ts @@ -9,9 +9,11 @@ import { SCENE_STRUCTURE_FORMAT, } from '../constants/scenesPromptConts.js'; import { BadRequestError } from '@middleware/error/index.js'; -import { StoryContent } from 'types/index.js'; +import { StoryContent } from '@app-types/index.js'; -export type SingleSceneMode = 'generate' | 'variation' | 'regenerate'; +import type { SingleSceneMode } from '@app-types/Scene.js'; + +export type { SingleSceneMode }; type BuildSingleScenePromptInput = { mode: SingleSceneMode; diff --git a/src/libs/aws/s3.ts b/src/libs/aws/s3.ts index b774e7b..1c2b1bc 100644 --- a/src/libs/aws/s3.ts +++ b/src/libs/aws/s3.ts @@ -1,23 +1,73 @@ -import { GetObjectAclCommand, S3Client } from "@aws-sdk/client-s3"; -import { getSignedUrl } from "@aws-sdk/s3-request-presigner"; - -const s3Client = new S3Client({ - region: "us-east-1", - endpoint: "http://localhost.localstack.cloud:4566", - forcePathStyle: true, - credentials: { - accessKeyId: "test", - secretAccessKey: "test", - }, +import { S3Client, PutObjectCommand, DeleteObjectCommand } from '@aws-sdk/client-s3'; + +import { getSignedUrl } from '@aws-sdk/s3-request-presigner'; + +const REGION = process.env.AWS_REGION!; +const BUCKET = process.env.S3_BUCKET!; +const CDN = process.env.CDN_URL!; + +export const s3 = new S3Client({ + region: REGION, }); -async function getObjectURL(key:any) { - const command = new GetObjectAclCommand({ - Bucket: "sample-bucket", +export async function uploadFile({ + buffer, + key, + contentType, +}: { + buffer: Buffer; + key: string; + contentType: string; +}) { + const command = new PutObjectCommand({ + Bucket: BUCKET, + Key: key, + Body: buffer, + ContentType: contentType, + }); + + await s3.send(command); + + return `${CDN}/${key}`; +} + +export async function deleteFile(key: string) { + const command = new DeleteObjectCommand({ + Bucket: BUCKET, Key: key, }); - const url = await getSignedUrl(s3Client, command, { expiresIn: 3600 }); - return url; + + await s3.send(command); + + return true; } -console.log("Generated Signed URL:", await getObjectURL("AI Studio API.txt")); \ No newline at end of file + +export function getFileUrl(key: string) { + return `${CDN}/${key}`; +} + +export async function createPresignedUploadUrl({ + key, + contentType, + expiresIn = 300, +}: { + key: string; + contentType: string; + expiresIn?: number; +}) { + const command = new PutObjectCommand({ + Bucket: BUCKET, + Key: key, + ContentType: contentType, + }); + + const url = await getSignedUrl(s3, command, { + expiresIn, + }); + + return { + uploadUrl: url, + fileUrl: `${CDN}/${key}`, + }; +} diff --git a/src/middleware/404/notFoundHandler.ts b/src/middleware/404/notFoundHandler.ts index de07254..cb69ecc 100644 --- a/src/middleware/404/notFoundHandler.ts +++ b/src/middleware/404/notFoundHandler.ts @@ -1,26 +1,13 @@ -import type { Request, Response, NextFunction } from "express"; - -interface ErrorResponse { - error: string; - message: string; -} - -const notFoundHandler = ( - req: Request, - res: Response, - next: NextFunction -): void => { - res.status(404); - - if (req.accepts("json")) { - res.json({ - error: "Not Found", - message: `The resource at ${req.originalUrl} was not found on this server.`, - } as ErrorResponse); - return; - } - - res.type("txt").send("404 Not Found"); +import type { Request, Response, NextFunction } from 'express'; + +const notFoundHandler = (req: Request, res: Response, _next: NextFunction): void => { + res.status(404).json({ + message: `The resource at ${req.originalUrl} was not found on this server.`, + data: { + code: 'not_found', + path: req.originalUrl, + }, + }); }; -export default notFoundHandler; +export default notFoundHandler; diff --git a/src/middleware/error/appError.ts b/src/middleware/error/appError.ts index 52b12ad..c39723d 100644 --- a/src/middleware/error/appError.ts +++ b/src/middleware/error/appError.ts @@ -24,42 +24,42 @@ export class AppError extends Error { this.name = this.constructor.name; this.statusCode = statusCode; this.code = code; - this.actions = actions; // optional now + this.actions = actions; this.isOperational = true; this.details = details; - // Dev mode: include stack trace - if (process.env.NODE_ENV === "development") { + if (process.env.NODE_ENV === 'development') { Error.captureStackTrace(this, this.constructor); this.stackTrace = this.stack; } - // Production mode: hide stack trace - if (process.env.NODE_ENV === "production") { + if (process.env.NODE_ENV === 'production') { this.stack = undefined; this.details = undefined; } } + /** + * Serialises the error into the standard API envelope: + * { message: string, data: { code, actions?, details?, stack? } } + */ serialize() { - const base: any = { - error: this.code, - message: this.message, + const errorPayload: Record = { + code: this.code, }; - // Only include actions if they exist if (this.actions) { - base.actions = this.actions; + errorPayload.actions = this.actions; } - if (process.env.NODE_ENV === "development") { - return { - ...base, - details: this.details, - stack: this.stackTrace, - }; + if (process.env.NODE_ENV === 'development') { + errorPayload.details = this.details; + errorPayload.stack = this.stackTrace; } - return base; + return { + message: this.message, + data: errorPayload, + }; } } diff --git a/src/middleware/error/globalErrorHandler.ts b/src/middleware/error/globalErrorHandler.ts index d0519c7..2c277ae 100644 --- a/src/middleware/error/globalErrorHandler.ts +++ b/src/middleware/error/globalErrorHandler.ts @@ -21,7 +21,6 @@ const errorHandler = (err: unknown, req: Request, res: Response, _next: NextFunc return res.status(err.statusCode).json(err.serialize()); } - console.log(err); logger.error({ requestId, name: 'UnhandledError', @@ -33,8 +32,10 @@ const errorHandler = (err: unknown, req: Request, res: Response, _next: NextFunc }); return res.status(500).json({ - status: 'error', message: 'Internal Server Error', + data: { + code: 'internal_error', + }, }); }; diff --git a/src/middleware/error/index.ts b/src/middleware/error/index.ts index d290125..97b5dcf 100644 --- a/src/middleware/error/index.ts +++ b/src/middleware/error/index.ts @@ -1,100 +1,104 @@ -// src/errors/index.ts import { AppError } from './appError.js'; import { ERROR_CODES } from './errorCodes.js'; // 400 – Bad Request export class BadRequestError extends AppError { constructor(message = 'Bad request', details?: any) { - super(message, 400, ERROR_CODES.BAD_REQUEST, details); + super(message, 400, ERROR_CODES.BAD_REQUEST, undefined, details); } } // 401 – Unauthenticated (invalid or missing credentials) export class UnauthenticatedError extends AppError { - constructor(message = 'Invalid credentials', details?: any) { - super(message, 401, ERROR_CODES.UNAUTHENTICATED, details); + constructor(message = 'Authentication required', details?: any) { + super(message, 401, ERROR_CODES.UNAUTHENTICATED, undefined, details); } } -// 403 – User authenticated, but not allowed +// 403 – User authenticated but not allowed export class UnauthorizedError extends AppError { constructor(message = 'Unauthorized', details?: any) { - super(message, 403, ERROR_CODES.UNAUTHORIZED, details); + super(message, 403, ERROR_CODES.UNAUTHORIZED, undefined, details); } } -// Explicit permission failure +// 403 - Explicit permission failure export class ForbiddenError extends AppError { constructor(message = 'Forbidden', details?: any) { - super(message, 403, ERROR_CODES.FORBIDDEN, details); + super(message, 403, ERROR_CODES.FORBIDDEN, undefined, details); } } // 404 – Resource not found export class NotFoundError extends AppError { constructor(message = 'Resource not found', details?: any) { - super(message, 404, ERROR_CODES.NOT_FOUND, details); + super(message, 404, ERROR_CODES.NOT_FOUND, undefined, details); } } // 405 – Method not allowed export class MethodNotAllowedError extends AppError { constructor(message = 'Method not allowed', details?: any) { - super(message, 405, ERROR_CODES.METHOD_NOT_ALLOWED, details); + super(message, 405, ERROR_CODES.METHOD_NOT_ALLOWED, undefined, details); } } -// 409 – Conflict (duplicate email, invalid state change, etc.) +// 409 – Conflict (duplicate, invalid state) export class ConflictError extends AppError { constructor(message = 'Conflict', details?: any) { - super(message, 409, ERROR_CODES.CONFLICT, details); + super(message, 409, ERROR_CODES.CONFLICT, undefined, details); } } // 410 – Resource permanently gone export class GoneError extends AppError { constructor(message = 'Resource gone', details?: any) { - super(message, 410, ERROR_CODES.GONE, details); + super(message, 410, ERROR_CODES.GONE, undefined, details); } } +// 413 – Payload too large export class PayloadTooLargeError extends AppError { constructor(message = 'Payload too large', details?: any) { - super(message, 413, ERROR_CODES.PAYLOAD_TOO_LARGE, details); + super(message, 413, ERROR_CODES.PAYLOAD_TOO_LARGE, undefined, details); } } // 422 – Validation errors export class UnprocessableEntityError extends AppError { constructor(message = 'Validation error', details?: any) { - super(message, 422, ERROR_CODES.VALIDATION_ERROR, details); + super(message, 422, ERROR_CODES.VALIDATION_ERROR, undefined, details); } } // 429 – Rate limit exceeded export class TooManyRequestsError extends AppError { constructor(message = 'Too many requests', details?: any) { - super(message, 429, ERROR_CODES.TOO_MANY_REQUESTS, details); + super(message, 429, ERROR_CODES.TOO_MANY_REQUESTS, undefined, details); } } // 500 – Unexpected backend failure export class InternalServerError extends AppError { constructor(message = 'Internal server error', details?: any) { - super(message, 500, ERROR_CODES.INTERNAL_ERROR, details); + super(message, 500, ERROR_CODES.INTERNAL_ERROR, undefined, details); } } // 503 – External service or DB unavailable export class ServiceUnavailableError extends AppError { constructor(message = 'Service unavailable', details?: any) { - super(message, 503, ERROR_CODES.SERVICE_UNAVAILABLE, details); + super(message, 503, ERROR_CODES.SERVICE_UNAVAILABLE, undefined, details); } } // 504 – External API timeout export class GatewayTimeoutError extends AppError { constructor(message = 'Gateway timeout', details?: any) { - super(message, 504, ERROR_CODES.GATEWAY_TIMEOUT, details); + super(message, 504, ERROR_CODES.GATEWAY_TIMEOUT, undefined, details); } } + +// Re-export base classes for convenience +export { AppError } from './appError.js'; +export { ERROR_CODES } from './errorCodes.js'; diff --git a/src/middleware/multer/filenameLogic/multerAudio.ts b/src/middleware/multer/filenameLogic/multerAudio.ts index 745dcee..32870c3 100644 --- a/src/middleware/multer/filenameLogic/multerAudio.ts +++ b/src/middleware/multer/filenameLogic/multerAudio.ts @@ -1,36 +1,8 @@ -import { Request } from 'express'; -import fs from 'fs'; import multer from 'multer'; import { BadRequestError } from '../../error/index.js'; -const storage = multer.diskStorage({ - destination: function ( - _req: Request, - _file: Express.Multer.File, - cb: (error: Error | null, destination: string) => void - ) { - const uploadPath = './temp/uploads/audio'; - fs.mkdir(uploadPath, { recursive: true }, (err) => { - if (err) { - cb(err, uploadPath); - } else { - cb(null, uploadPath); - } - }); - }, - filename: function ( - _req: Request, - file: Express.Multer.File, - cb: (error: Error | null, filename: string) => void - ) { - const lastDotIndex = file.originalname.lastIndexOf('.'); - const fileExtension = lastDotIndex >= 0 ? file.originalname.substring(lastDotIndex).toLowerCase() : ''; - const uniqueSuffix = Date.now() + '-' + Math.round(Math.random() * 1e9); - cb(null, file.fieldname + '-' + uniqueSuffix + fileExtension); - }, -}); - const allowedExtensions = ['.mp3', '.wav', '.ogg', '.aac', '.m4a', '.flac', '.wma', '.opus']; + const allowedMimetypes = [ 'audio/mpeg', 'audio/mp3', @@ -52,23 +24,28 @@ const fileFilter: multer.Options['fileFilter'] = (_req, file, cb) => { cb(new BadRequestError('Only audio files (mp3, wav, ogg, aac, m4a, flac, wma, opus) are allowed')); return; } + const lastDotIndex = file.originalname.lastIndexOf('.'); + if (lastDotIndex < 0) { cb(new BadRequestError('Only audio files (mp3, wav, ogg, aac, m4a, flac, wma, opus) are allowed')); return; } + const fileExtension = file.originalname.substring(lastDotIndex).toLowerCase(); + if (!allowedExtensions.includes(fileExtension)) { cb(new BadRequestError('Only audio files (mp3, wav, ogg, aac, m4a, flac, wma, opus) are allowed')); return; } + cb(null, true); }; -const upload = multer({ - storage, +export const upload = multer({ + storage: multer.memoryStorage(), fileFilter, - limits: { fileSize: 10 * 1024 * 1024 }, // 10 MB limit + limits: { + fileSize: 10 * 1024 * 1024, // 10MB + }, }); - -export { upload }; diff --git a/src/middleware/multer/filenameLogic/multerImage.ts b/src/middleware/multer/filenameLogic/multerImage.ts index 738f67c..74fc72a 100644 --- a/src/middleware/multer/filenameLogic/multerImage.ts +++ b/src/middleware/multer/filenameLogic/multerImage.ts @@ -1,60 +1,45 @@ -import { Request } from 'express'; -import fs from 'fs'; -import multer from 'multer'; -import { BadRequestError } from '../../error/index.js'; - -const storage = multer.diskStorage({ - destination: function ( - _req: Request, - _file: Express.Multer.File, - cb: (error: Error | null, destination: string) => void - ) { - const uploadPath = './temp/uploads/images'; - fs.mkdir(uploadPath, { recursive: true }, (err) => { - if (err) { - cb(err, uploadPath); - } else { - cb(null, uploadPath); - } - }); - }, - filename: function ( - _req: Request, - file: Express.Multer.File, - cb: (error: Error | null, filename: string) => void - ) { - const lastDotIndex = file.originalname.lastIndexOf('.'); - const fileExtension = lastDotIndex >= 0 ? file.originalname.substring(lastDotIndex).toLowerCase() : ''; - const uniqueSuffix = Date.now() + '-' + Math.round(Math.random() * 1e9); - cb(null, file.fieldname + '-' + uniqueSuffix + fileExtension); - }, -}); - -const allowedExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.webp']; -const allowedMimetypes = ['image/jpeg', 'image/png', 'image/gif', 'image/webp']; - -const fileFilter: multer.Options['fileFilter'] = (_req, file, cb) => { +import multer from "multer"; +import { BadRequestError } from "../../error/index.js"; + +const allowedExtensions = [".jpg", ".jpeg", ".png", ".gif", ".webp"]; + +const allowedMimetypes = [ + "image/jpeg", + "image/png", + "image/gif", + "image/webp" +]; + +const fileFilter: multer.Options["fileFilter"] = (_req, file, cb) => { + if (!allowedMimetypes.includes(file.mimetype)) { - cb(new BadRequestError('Only image files (jpg, jpeg, png, gif, webp) are allowed')); + cb(new BadRequestError("Only image files (jpg, jpeg, png, gif, webp) are allowed")); return; } - const lastDotIndex = file.originalname.lastIndexOf('.'); + + const lastDotIndex = file.originalname.lastIndexOf("."); + if (lastDotIndex < 0) { - cb(new BadRequestError('Only image files (jpg, jpeg, png, gif, webp) are allowed')); + cb(new BadRequestError("Only image files (jpg, jpeg, png, gif, webp) are allowed")); return; } - const fileExtension = file.originalname.substring(lastDotIndex).toLowerCase(); + + const fileExtension = file.originalname + .substring(lastDotIndex) + .toLowerCase(); + if (!allowedExtensions.includes(fileExtension)) { - cb(new BadRequestError('Only image files (jpg, jpeg, png, gif, webp) are allowed')); + cb(new BadRequestError("Only image files (jpg, jpeg, png, gif, webp) are allowed")); return; } + cb(null, true); }; -const upload = multer({ - storage, +export const upload = multer({ + storage: multer.memoryStorage(), fileFilter, - limits: { fileSize: 2 * 1024 * 1024 }, -}); - -export { upload }; + limits: { + fileSize: 2 * 1024 * 1024 + } +}); \ No newline at end of file diff --git a/src/middleware/multer/filenameLogic/multerJSON.ts b/src/middleware/multer/filenameLogic/multerJSON.ts index 901ba5e..78080d5 100644 --- a/src/middleware/multer/filenameLogic/multerJSON.ts +++ b/src/middleware/multer/filenameLogic/multerJSON.ts @@ -1,63 +1,39 @@ -import { Request } from 'express'; -import fs from 'fs'; -import multer from 'multer'; -import { BadRequestError } from '../../error/index.js'; - -const storage = multer.diskStorage({ - destination: function ( - _req: Request, - _file: Express.Multer.File, - cb: (error: Error | null, destination: string) => void - ) { - const uploadPath = './temp/uploads/json'; - fs.mkdir(uploadPath, { recursive: true }, (err) => { - if (err) { - cb(err, uploadPath); - } else { - cb(null, uploadPath); - } - }); - }, - filename: function ( - _req: Request, - file: Express.Multer.File, - cb: (error: Error | null, filename: string) => void - ) { - const lastDotIndex = file.originalname.lastIndexOf('.'); - const fileExtension = lastDotIndex >= 0 ? file.originalname.substring(lastDotIndex).toLowerCase() : ''; - const uniqueSuffix = Date.now() + '-' + Math.round(Math.random() * 1e9); - cb(null, file.fieldname + '-' + uniqueSuffix + fileExtension); - }, -}); - -const allowedExtensions = ['.json']; -const allowedMimetypes = ['application/json']; - -const fileFilter: multer.Options['fileFilter'] = (_req, file, cb) => { +import multer from "multer"; +import { BadRequestError } from "../../error/index.js"; + +const allowedExtensions = [".json"]; +const allowedMimetypes = ["application/json"]; + +const fileFilter: multer.Options["fileFilter"] = (_req, file, cb) => { + if (!allowedMimetypes.includes(file.mimetype)) { - cb(new BadRequestError('Only JSON files are allowed')); + cb(new BadRequestError("Only JSON files are allowed")); return; } - const lastDotIndex = file.originalname.lastIndexOf('.'); + const lastDotIndex = file.originalname.lastIndexOf("."); + if (lastDotIndex < 0) { - cb(new BadRequestError('Only JSON files are allowed')); + cb(new BadRequestError("Only JSON files are allowed")); return; } - const fileExtension = file.originalname.substring(lastDotIndex).toLowerCase(); + const fileExtension = file.originalname + .substring(lastDotIndex) + .toLowerCase(); + if (!allowedExtensions.includes(fileExtension)) { - cb(new BadRequestError('Only JSON files are allowed')); + cb(new BadRequestError("Only JSON files are allowed")); return; } cb(null, true); }; -const uploadJSON = multer({ - storage, +export const uploadJSON = multer({ + storage: multer.memoryStorage(), fileFilter, - limits: { fileSize: 2 * 1024 * 1024 }, // 2MB max limit -}); - -export { uploadJSON }; + limits: { + fileSize: 2 * 1024 * 1024 // 2MB + } +}); \ No newline at end of file diff --git a/src/middleware/multer/filenameLogic/multerVideo.ts b/src/middleware/multer/filenameLogic/multerVideo.ts index e1a0a0a..ff76261 100644 --- a/src/middleware/multer/filenameLogic/multerVideo.ts +++ b/src/middleware/multer/filenameLogic/multerVideo.ts @@ -60,7 +60,7 @@ const fileFilter: multer.Options['fileFilter'] = (_req, file, cb) => { const upload = multer({ storage, fileFilter, - limits: { fileSize: 20 * 1024 * 1024 }, + limits: { fileSize: 50 * 1024 * 1024 }, }); export { upload }; diff --git a/src/middleware/multer/scenesJSONUpload.ts b/src/middleware/multer/scenesJSONUpload.ts new file mode 100644 index 0000000..4416267 --- /dev/null +++ b/src/middleware/multer/scenesJSONUpload.ts @@ -0,0 +1,19 @@ +import { Request, Response, NextFunction } from 'express'; +import multer from 'multer'; +import { uploadJSON } from './filenameLogic/multerJSON.js'; +import { BadRequestError, PayloadTooLargeError } from '../error/index.js'; + +export const scenesJSONUpload = (req: Request, res: Response, next: NextFunction) => { + uploadJSON.single('scenesFile')(req, res, (err) => { + if (!err) return next(); + + if (err instanceof multer.MulterError) { + if (err.code === 'LIMIT_FILE_SIZE') { + return next(new PayloadTooLargeError('JSON file size exceeds the 2MB limit', err)); + } + return next(new BadRequestError('Multer error during JSON upload', { cause: err })); + } + + return next(err); + }); +}; diff --git a/src/middleware/request/paginationAndSorting.ts b/src/middleware/request/paginationAndSorting.ts index 23eb833..0da146f 100644 --- a/src/middleware/request/paginationAndSorting.ts +++ b/src/middleware/request/paginationAndSorting.ts @@ -1,6 +1,6 @@ import { Request, Response, NextFunction } from 'express'; import { BadRequestError } from '../error/index.js'; -import type { Pagination, Sorting } from 'types/Pagination.js'; +import type { Pagination, Sorting } from '@app-types/Pagination.js'; const DEFAULT_PAGE = 1; const DEFAULT_LIMIT = 10; diff --git a/src/middleware/security/requireCsrf.ts b/src/middleware/security/requireCsrf.ts index a1dc2f7..1dc05eb 100644 --- a/src/middleware/security/requireCsrf.ts +++ b/src/middleware/security/requireCsrf.ts @@ -2,7 +2,7 @@ import type { Request, Response, NextFunction } from 'express'; import { UnauthorizedError } from '@middleware/error/index.js'; import { SessionModel } from '@models/Session.js'; import { verifyToken } from '@utils/tokens.js'; -import { ALLOWED_ORIGINS } from 'constants/globalConts.js'; +import { ALLOWED_ORIGINS } from '@constants/globalConts.js'; export const csrfMiddleware = async (req: Request, res: Response, next: NextFunction) => { const unsafeMethods = ['POST', 'PUT', 'PATCH', 'DELETE']; @@ -10,8 +10,8 @@ export const csrfMiddleware = async (req: Request, res: Response, next: NextFunc return next(); } - const origin = req.headers.Origin; - if (origin && (origin === 'null' || !ALLOWED_ORIGINS.includes(origin as string))) { + const origin = req.header('Origin') || req.headers['origin'] || req.headers.origin; + if (!origin && (origin === 'null' || !ALLOWED_ORIGINS.includes(origin as string))) { throw new UnauthorizedError('Invalid origin'); } diff --git a/src/models/AudioAsset.ts b/src/models/AudioAsset.ts index eb97800..cd5d5bd 100644 --- a/src/models/AudioAsset.ts +++ b/src/models/AudioAsset.ts @@ -8,6 +8,7 @@ export interface AudioAsset extends Document { url: string; prompt?: string; generationSource: 'ai' | 'user'; + status: 'not-generated' | 'generating' | 'ready' | 'error'; voiceId?: string; duration?: number; version?: number; diff --git a/src/models/ContextProfile.ts b/src/models/ContextProfile.ts index 7584cce..f65e279 100644 --- a/src/models/ContextProfile.ts +++ b/src/models/ContextProfile.ts @@ -136,6 +136,7 @@ export interface ContextProfile extends Document { userId: Types.ObjectId; projectId?: Types.ObjectId; + storyId?: Types.ObjectId; scope: ContextScope; isDefaultForProject: boolean; parentContextId?: Types.ObjectId; @@ -195,6 +196,11 @@ const contextProfileSchema = new Schema( type: Boolean, default: false, }, + storyId: { + type: Schema.Types.ObjectId, + ref: 'Story', + }, + parentContextId: { type: Schema.Types.ObjectId, ref: 'ContextProfile', @@ -332,6 +338,7 @@ const contextProfileSchema = new Schema( ); contextProfileSchema.index({ projectId: 1, isDefaultForProject: 1 }); +contextProfileSchema.index({ storyId: 1 }); contextProfileSchema.index({ parentContextId: 1 }); contextProfileSchema.index({ userId: 1, lastUsedAt: -1 }); diff --git a/src/models/Narration.ts b/src/models/Narration.ts index 0b6d549..49d0f87 100644 --- a/src/models/Narration.ts +++ b/src/models/Narration.ts @@ -9,6 +9,7 @@ export interface NarrationSegment { minWords: number; maxWords: number; narration: string; + source?: 'ai' | 'manual'; } export interface StoryNarration extends Document { @@ -21,6 +22,7 @@ export interface StoryNarration extends Document { narrationSegments: NarrationSegment[]; version: number; active: boolean; + status: 'not-generated' | 'generating' | 'ready' | 'error'; deletedAt?: Date; source: 'ai' | 'user'; createdAt: Date; @@ -74,6 +76,11 @@ const narrationSegmentSchema = new Schema( type: String, trim: true, }, + source: { + type: String, + enum: ['ai', 'manual'], + default: 'ai', + }, }, { _id: false } ); diff --git a/src/models/Scene.ts b/src/models/Scene.ts index 122a32e..a554676 100644 --- a/src/models/Scene.ts +++ b/src/models/Scene.ts @@ -1,12 +1,12 @@ import { Schema, model, Document, Types } from 'mongoose'; -//RULE: deletedAt != null ⇒ active must be false export interface Scene extends Document { userId: Types.ObjectId; storyId: Types.ObjectId; order: number; title?: string; description: string; + status: 'not-generated' | 'generating' | 'ready' | 'error'; narrativeRole: 'intro' | 'transition' | 'climax' | 'outro' | 'standard'; authorType: 'ai' | 'user'; imagePrompt: string; @@ -45,11 +45,15 @@ const sceneSchema = new Schema( trim: true, maxlength: 200, }, - description: { type: String, required: true, }, + status: { + type: String, + enum: ['not-generated', 'generating', 'ready', 'error'], + default: 'not-generated', + }, narrativeRole: { type: String, enum: ['intro', 'transition', 'climax', 'outro', 'standard'], @@ -82,7 +86,7 @@ const sceneSchema = new Schema( }, deletedAt: { type: Date, - default: undefined, + default: undefined, }, }, { timestamps: true } diff --git a/src/models/SceneAssets.ts b/src/models/SceneAssets.ts index 86ed5f7..80b1ecc 100644 --- a/src/models/SceneAssets.ts +++ b/src/models/SceneAssets.ts @@ -6,7 +6,9 @@ export interface SceneAsset extends Document { sceneId: Types.ObjectId; type: 'image' | 'video'; url: string; + thumbnailUrl?: string; visibility: 'private' | 'public'; + status: 'not-generated' | 'generating' | 'ready' | 'error'; prompt?: string; generationSource: 'ai' | 'user'; version: number; @@ -42,11 +44,19 @@ const sceneAssetSchema = new Schema( type: String, required: true, }, + thumbnailUrl: { + type: String, + }, visibility: { type: String, enum: ['private', 'public'], default: 'public', }, + status: { + type: String, + enum: ['not-generated', 'generating', 'ready', 'error'], + default: 'not-generated', + }, prompt: { type: String, }, diff --git a/src/models/Story.ts b/src/models/Story.ts index 8d3b573..3dbe8ab 100644 --- a/src/models/Story.ts +++ b/src/models/Story.ts @@ -14,8 +14,8 @@ export interface Story extends Document { keywords?: string[]; tags?: string[]; authorType: 'ai' | 'user'; + contentStatus: 'not-generated' | 'generating' | 'ready' | 'error'; }; - status: 'active' | 'delete' | 'archive' | 'draft'; deletedAt: Date; version: number; @@ -74,15 +74,19 @@ const storySchema = new Schema( enum: ['ai', 'user'], default: 'ai', }, + contentStatus: { + type: String, + enum: ['not-generated', 'generating', 'ready', 'error'], + default: 'not-generated', + }, }, - status: { type: String, enum: ['active', 'archive', 'delete', 'draft'], default: 'active', }, deletedAt: { - type: Date, + type: Date, }, version: { type: Number, diff --git a/src/models/User.ts b/src/models/User.ts index 6efcd1e..3b78d31 100644 --- a/src/models/User.ts +++ b/src/models/User.ts @@ -1,4 +1,4 @@ -import { ACCOUNT_STATUSES } from 'constants/authConsts.js'; +import { ACCOUNT_STATUSES } from '@constants/authConsts.js'; import { Schema, model, type InferSchemaType, type HydratedDocument } from 'mongoose'; const ResetSchema = new Schema( @@ -48,9 +48,6 @@ const changeMetaSchema = new Schema( { _id: false } ); -/** - * Subdocument: OAuth / social providers (Google, GitHub, etc.) - */ const providerSchema = new Schema( { provider: { @@ -77,14 +74,14 @@ const providerSchema = new Schema( default: Date.now, }, }, - { _id: false } // no separate _id needed per provider + { _id: false } ); const privacyPrefsSchema = new Schema( { profileVisibility: { type: String, - enum: ['private', 'public', 'unlisted'], + enum: ['private', 'public'], default: 'private', }, showEmailOnProfile: { @@ -95,10 +92,6 @@ const privacyPrefsSchema = new Schema( type: Boolean, default: true, }, - allowDiscoverability: { - type: Boolean, - default: true, - }, }, { _id: false } ); @@ -124,34 +117,6 @@ const notificationPrefsSchema = new Schema( { _id: false } ); -/** - * Subdocument: usage / quotas - */ -const usageSchema = new Schema( - { - imagesGenerated: { - type: Number, - default: 0, - min: 0, - }, - secondsRendered: { - type: Number, - default: 0, - min: 0, - }, - apiCalls: { - type: Number, - default: 0, - min: 0, - }, - lastResetAt: { - type: Date, - default: Date.now, - }, - }, - { _id: false } -); - /** * MAIN USER SCHEMA */ @@ -220,13 +185,9 @@ const userSchema = new Schema( }, planEndsAt: { - type: Date, + type: Date, }, - usage: { - type: usageSchema, - default: () => ({}), - }, passwordHash: { type: String, required: true, diff --git a/src/modules/audio/audio.constants.ts b/src/modules/audio/audio.constants.ts index f954468..6333381 100644 --- a/src/modules/audio/audio.constants.ts +++ b/src/modules/audio/audio.constants.ts @@ -1,28 +1,19 @@ -// Audio generation configuration -export const DEFAULT_VOICE_STABILITY = 0.5; -export const DEFAULT_VOICE_SIMILARITY_BOOST = 0.75; -export const DEFAULT_VOICE_STYLE = 0; -export const DEFAULT_USE_SPEAKER_BOOST = true; +// Re-export from global constants for backward compatibility +export { + DEFAULT_VOICE_STABILITY, + DEFAULT_VOICE_SIMILARITY_BOOST, + DEFAULT_VOICE_STYLE, + DEFAULT_USE_SPEAKER_BOOST, + TTS_PROVIDERS, + DEFAULT_TTS_PROVIDER, + AUDIO_OUTPUT_FORMAT, + AUDIO_SAMPLE_RATE, + AUDIO_BIT_RATE, + MAX_AUDIO_GENERATIONS_PER_DAY, + MAX_AUDIO_GENERATIONS_PER_HOUR, + AUDIO_CACHE_TTL, + AUDIO_VERSION_START, + MAX_AUDIO_VERSIONS_PER_NARRATION, +} from '@constants/audioConsts.js'; -// Supported TTS providers -export const TTS_PROVIDERS = ['elevenlabs', 'openai', 'azure', 'google'] as const; -export type TTSProvider = (typeof TTS_PROVIDERS)[number]; - -// Default provider -export const DEFAULT_TTS_PROVIDER: TTSProvider = 'elevenlabs'; - -// Audio quality settings -export const AUDIO_OUTPUT_FORMAT = 'mp3_44100_128' as const; -export const AUDIO_SAMPLE_RATE = 44100; -export const AUDIO_BIT_RATE = 128; - -// Rate limiting -export const MAX_AUDIO_GENERATIONS_PER_DAY = 100; -export const MAX_AUDIO_GENERATIONS_PER_HOUR = 20; - -// Cache TTL (in seconds) -export const AUDIO_CACHE_TTL = 86400; // 24 hours - -// Version constants -export const AUDIO_VERSION_START = 1; -export const MAX_AUDIO_VERSIONS_PER_NARRATION = 100; +export type { TTSProvider } from '@constants/audioConsts.js'; diff --git a/src/modules/audio/audio.controller.ts b/src/modules/audio/audio.controller.ts index 2d678db..0abc1c6 100644 --- a/src/modules/audio/audio.controller.ts +++ b/src/modules/audio/audio.controller.ts @@ -23,13 +23,13 @@ import { import type { GenerateAudioAssetInput, RegenerateAudioAssetInput, - UploadAudioAssetInput, SetActiveAudioAssetInput, - UpdateAudioAssetInput, BulkDeleteAudioAssetsInput, BulkRestoreAudioAssetsInput, } from '@validation/audio.schema.js'; import { paginationResponse } from '@utils/paginationResponse.js'; +import { sendSuccess, sendPaginated } from '@shared/response.js'; +import { BadRequestError } from '@middleware/error/index.js'; // ==================== ALL OPERATIONS ==================== @@ -38,16 +38,13 @@ export const getAllAudioAssetsController = async (req: Request, res: Response) = const { narrationId } = req.params; const pagination = req?.pagination!; const sorting = req?.sorting!; - const [audioAssets, total] = await getAllAudioAssetsForNarration(userId, narrationId, pagination, sorting); - - const paginationRes = paginationResponse(pagination, total as number); - - res.status(200).json({ - message: 'Audio assets retrieved successfully', - data: audioAssets, - pagination: paginationRes, - }); + return sendPaginated( + res, + audioAssets as any[], + paginationResponse(pagination, total as number), + 'Audio assets retrieved successfully' + ); }; export const getAllDeletedAudioAssetsController = async (req: Request, res: Response) => { @@ -55,64 +52,53 @@ export const getAllDeletedAudioAssetsController = async (req: Request, res: Resp const { narrationId } = req.params; const pagination = req?.pagination!; const sorting = req?.sorting!; - const [audioAssets, total] = await getAllDeletedAudioAssets(userId, narrationId, pagination, sorting); - - const paginationRes = paginationResponse(pagination, total as number); - - res.status(200).json({ - message: 'Deleted audio assets retrieved successfully', - data: audioAssets, - pagination: paginationRes, - }); + return sendPaginated( + res, + audioAssets as any[], + paginationResponse(pagination, total as number), + 'Deleted audio assets retrieved successfully' + ); }; export const restoreAllDeletedAudioAssetsController = async (req: Request, res: Response) => { const userId = req.user!.id; const { narrationId } = req.params; - const result = await restoreAllDeletedAudioAssets(userId, narrationId); - - res.status(200).json({ - message: 'All deleted audio assets restored successfully', - restoredCount: result.restoredCount, - }); + return sendSuccess( + res, + { restoredCount: result.restoredCount }, + 'All deleted audio assets restored successfully' + ); }; export const softDeleteAllAudioAssetsController = async (req: Request, res: Response) => { const userId = req.user!.id; const { narrationId } = req.params; - const result = await softDeleteAllAudioAssetsForNarration(userId, narrationId); - - res.status(200).json({ - message: 'All audio assets soft deleted successfully', - deletedCount: result.deletedCount, - }); + return sendSuccess( + res, + { deletedCount: result.deletedCount }, + 'All audio assets soft deleted successfully' + ); }; export const permanentDeleteAllAudioAssetsController = async (req: Request, res: Response) => { const userId = req.user!.id; const { narrationId } = req.params; - const result = await permanentDeleteAllAudioAssetsForNarration(userId, narrationId); - - res.status(200).json({ - message: 'All audio assets permanently deleted successfully', - deletedCount: result.deletedCount, - }); + return sendSuccess( + res, + { deletedCount: result.deletedCount }, + 'All audio assets permanently deleted successfully' + ); }; export const getAudioAssetCountController = async (req: Request, res: Response) => { const userId = req.user!.id; const { narrationId } = req.params; - const count = await getAudioAssetCount(userId, narrationId); - - res.status(200).json({ - message: 'Audio asset count retrieved successfully', - count, - }); + return sendSuccess(res, { count }, 'Audio asset count retrieved successfully'); }; // ==================== BULK OPERATIONS ==================== @@ -121,39 +107,28 @@ export const softBulkDeleteAudioAssetsController = async (req: Request, res: Res const userId = req.user!.id; const { narrationId } = req.params; const { audioAssetIds } = req.validatedBody as BulkDeleteAudioAssetsInput; - const result = await softBulkDeleteAudioAssets(userId, narrationId, audioAssetIds); - - res.status(200).json({ - message: 'Audio assets soft deleted successfully', - deletedCount: result.deletedCount, - }); + return sendSuccess(res, { deletedCount: result.deletedCount }, 'Audio assets soft deleted successfully'); }; export const permanentBulkDeleteAudioAssetsController = async (req: Request, res: Response) => { const userId = req.user!.id; const { narrationId } = req.params; const { audioAssetIds } = req.validatedBody as BulkDeleteAudioAssetsInput; - const result = await permanentBulkDeleteAudioAssets(userId, narrationId, audioAssetIds); - - res.status(200).json({ - message: 'Audio assets permanently deleted successfully', - deletedCount: result.deletedCount, - }); + return sendSuccess( + res, + { deletedCount: result.deletedCount }, + 'Audio assets permanently deleted successfully' + ); }; export const bulkRestoreAudioAssetsController = async (req: Request, res: Response) => { const userId = req.user!.id; const { narrationId } = req.params; const { audioAssetIds } = req.validatedBody as BulkRestoreAudioAssetsInput; - const result = await bulkRestoreAudioAssets(userId, narrationId, audioAssetIds); - - res.status(200).json({ - message: 'Audio assets restored successfully', - data: result, - }); + return sendSuccess(res, result, 'Audio assets restored successfully'); }; // ==================== SINGLE OPERATIONS ==================== @@ -161,58 +136,37 @@ export const bulkRestoreAudioAssetsController = async (req: Request, res: Respon export const getAudioAssetByIdController = async (req: Request, res: Response) => { const userId = req.user!.id; const { audioAssetId } = req.params; - const audioAsset = await getAudioAssetById(userId, audioAssetId); - - res.status(200).json({ - message: 'Audio asset retrieved successfully', - data: audioAsset, - }); + return sendSuccess(res, audioAsset, 'Audio asset retrieved successfully'); }; export const getActiveAudioAssetController = async (req: Request, res: Response) => { const userId = req.user!.id; const { narrationId } = req.params; - const audioAsset = await getActiveAudioAssetForNarration(userId, narrationId); - - if (!audioAsset) { - return res.status(200).json({ - message: 'No active audio asset found for this narration', - data: null, - }); - } - - res.status(200).json({ - message: 'Active audio asset retrieved successfully', - data: audioAsset, - }); + return sendSuccess( + res, + audioAsset ?? null, + audioAsset + ? 'Active audio asset retrieved successfully' + : 'No active audio asset found for this narration' + ); }; export const generateAudioAssetController = async (req: Request, res: Response) => { const userId = req.user!.id; const { narrationId } = req.params; const { voiceId, prompt } = req.validatedBody as GenerateAudioAssetInput; - const audioAsset = await generateAudioAsset(userId, narrationId, voiceId, prompt); - - res.status(201).json({ - message: 'Audio asset generated successfully', - data: audioAsset, - }); + return sendSuccess(res, audioAsset, 'Audio asset generated successfully', 201); }; export const regenerateAudioAssetController = async (req: Request, res: Response) => { const userId = req.user!.id; const { audioAssetId } = req.params; const { voiceId, extraPrompt } = req.validatedBody as RegenerateAudioAssetInput; - const audioAsset = await regenerateAudioAsset(userId, audioAssetId, voiceId, extraPrompt); - - res.status(201).json({ - message: 'Audio asset regenerated successfully', - data: audioAsset, - }); + return sendSuccess(res, audioAsset, 'Audio asset regenerated successfully', 201); }; export const uploadAudioAssetController = async (req: Request, res: Response) => { @@ -220,73 +174,45 @@ export const uploadAudioAssetController = async (req: Request, res: Response) => const { narrationId } = req.params; if (!req.file) { - return res.status(400).json({ - message: 'No file uploaded', - }); + throw new BadRequestError('No file uploaded'); } const audioAsset = await uploadNarrationAudioAsset(userId, narrationId, req.file.path); - - res.status(201).json({ - message: 'Audio asset uploaded successfully', - data: audioAsset, - }); + return sendSuccess(res, audioAsset, 'Audio asset uploaded successfully', 201); }; export const setActiveAudioAssetController = async (req: Request, res: Response) => { const userId = req.user!.id; const { narrationId } = req.params; const { audioAssetId } = req.validatedBody as SetActiveAudioAssetInput; - const audioAsset = await setActiveAudioAsset(userId, narrationId, audioAssetId); - - res.status(200).json({ - message: 'Audio asset set as active successfully', - data: audioAsset, - }); + return sendSuccess(res, audioAsset, 'Audio asset set as active successfully'); }; export const softDeleteAudioAssetController = async (req: Request, res: Response) => { const userId = req.user!.id; const { audioAssetId } = req.params; - await softDeleteAudioAsset(userId, audioAssetId); - - res.status(200).json({ - message: 'Audio asset soft deleted successfully', - }); + return sendSuccess(res, null, 'Audio asset soft deleted successfully'); }; export const permanentDeleteAudioAssetController = async (req: Request, res: Response) => { const userId = req.user!.id; const { audioAssetId } = req.params; - await permanentDeleteAudioAsset(userId, audioAssetId); - - res.status(200).json({ - message: 'Audio asset permanently deleted successfully', - }); + return sendSuccess(res, null, 'Audio asset permanently deleted successfully'); }; export const forceDeleteActiveAudioAssetController = async (req: Request, res: Response) => { const userId = req.user!.id; const { audioAssetId } = req.params; - await forceDeleteActiveAudioAsset(userId, audioAssetId); - - res.status(200).json({ - message: 'Active audio asset force deleted successfully', - }); + return sendSuccess(res, null, 'Active audio asset force deleted successfully'); }; export const restoreAudioAssetController = async (req: Request, res: Response) => { const userId = req.user!.id; const { narrationId, audioAssetId } = req.params; - const audioAsset = await restoreAudioAsset(userId, narrationId, audioAssetId); - - res.status(200).json({ - message: 'Audio asset restored successfully', - data: audioAsset, - }); + return sendSuccess(res, audioAsset, 'Audio asset restored successfully'); }; diff --git a/src/modules/audio/audio.routes.ts b/src/modules/audio/audio.routes.ts index 7057cbb..85bd7bb 100644 --- a/src/modules/audio/audio.routes.ts +++ b/src/modules/audio/audio.routes.ts @@ -13,7 +13,6 @@ import { regenerateAudioAssetSchema, uploadAudioAssetSchema, setActiveAudioAssetSchema, - updateAudioAssetSchema, bulkDeleteAudioAssetsSchema, bulkRestoreAudioAssetsSchema, } from '@validation/audio.schema.js'; diff --git a/src/modules/audio/audio.service.ts b/src/modules/audio/audio.service.ts index 82d53dd..3d2d01d 100644 --- a/src/modules/audio/audio.service.ts +++ b/src/modules/audio/audio.service.ts @@ -2,7 +2,7 @@ import { AudioAsset, AudioAssetModel } from '@models/AudioAsset.js'; import { StoryNarrationModel } from '@models/Narration.js'; import { NotFoundError, BadRequestError, ConflictError } from '@middleware/error/index.js'; import { ClientSession } from 'mongoose'; -import type { Pagination, Sorting } from 'types/Pagination.js'; +import type { Pagination, Sorting } from '@app-types/Pagination.js'; import { validateNarrationOwnership } from 'validators/validateNarrationOwnership.js'; import { validateAudioAssetOwnership } from 'validators/validateAudioAssetOwnership.js'; import { diff --git a/src/modules/auth/auth.controller.ts b/src/modules/auth/auth.controller.ts index 41434f1..410a0dd 100644 --- a/src/modules/auth/auth.controller.ts +++ b/src/modules/auth/auth.controller.ts @@ -19,177 +19,127 @@ import type { VerifyEmailInput, VerifyUpdateEmailInput, } from '@validation/auth.schema.js'; +import { sendSuccess } from '@shared/response.js'; -const CookieOptions: CookieOptions = { +// ─── Cookie Configuration ─────────────────────────────────────────────────── + +const CSRF_AGE = 15 * 24 * 60 * 60 * 1000; // 15 days +const REFRESH_AGE = 15 * 24 * 60 * 60 * 1000; // 15 days +const ACCESS_AGE = 30 * 60 * 1000; // 30 minutes + +const cookieOptions: CookieOptions = { httpOnly: true, secure: process.env.NODE_ENV === 'production', sameSite: process.env.NODE_ENV === 'production' ? 'none' : 'lax', - maxAge: 1 * 24 * 60 * 60 * 1000, + maxAge: ACCESS_AGE, }; -const CSRF_AGE = 15 * 24 * 60 * 60 * 1000; -const REFRESH_AGE = 15 * 24 * 60 * 60 * 1000; -const ACCESS_AGE = 30 * 60 * 1000; +/** Sets the three auth cookies (access / refresh / csrf) on the response. */ +function setAuthCookies(res: Response, tokens: { accessToken: string; refreshToken: string; csrfToken: string }) { + res + .cookie('access-token', tokens.accessToken, { ...cookieOptions, maxAge: ACCESS_AGE }) + .cookie('refresh-token', tokens.refreshToken, { ...cookieOptions, maxAge: REFRESH_AGE }) + .cookie('csrf-token', tokens.csrfToken, { ...cookieOptions, httpOnly: false, maxAge: CSRF_AGE }); +} + +// ─── Controllers ──────────────────────────────────────────────────────────── export const registerController = async (req: Request, res: Response) => { const body = req.validatedBody as RegisterInput; + const userAgent = req.headers['user-agent'] || 'unknown'; + const ip = + req.headers['x-forwarded-for'] || req.headers['x-real-ip'] || req.ip || req.socket.remoteAddress; - const userAgent: string = req.headers['user-agent'] || 'unknown'; - const ip = req.headers['x-forwarded-for'] || req.headers['x-real-ip'] || req.ip || req.socket.remoteAddress; - - const payload = { ...body, userAgent, ip }; + const { user, tokens } = await registerUser({ ...body, userAgent, ip }); - const result = await registerUser(payload); + setAuthCookies(res, tokens); - const { user, tokens } = result; - const { accessToken, refreshToken, csrfToken } = tokens; - - return res - .status(200) - .cookie('access-token', accessToken, { - ...CookieOptions, - maxAge: ACCESS_AGE, - }) - .cookie('refresh-token', refreshToken, { - ...CookieOptions, - maxAge: REFRESH_AGE, - }) - .cookie('csrf-token', csrfToken, { - ...CookieOptions, - httpOnly: false, - maxAge: CSRF_AGE, - }) - .json({ + return res.status(201).json({ + message: 'Account created successfully', + data: { user: { - id: user._id, email: user.email, username: user.username, - displayName: user.displayName, - avatar: user.avatarUrl, + displayName: user.displayName ?? null, + avatarUrl: user.avatarUrl ?? null, }, - }); + }, + }); }; export const loginController = async (req: Request, res: Response) => { const body = req.validatedBody as LoginInput; - const userAgent: string = req.headers['user-agent'] || 'unknown'; - const ip = req.socket.remoteAddress || req.headers['x-forwarded-for'] || req.headers['x-real-ip'] || req.ip; + const userAgent = req.headers['user-agent'] || 'unknown'; + const ip = + req.socket.remoteAddress || req.headers['x-forwarded-for'] || req.headers['x-real-ip'] || req.ip; - const payload = { ...body, userAgent, ip }; + const { user, tokens } = await loginUser({ ...body, userAgent, ip }); - const result = await loginUser(payload); - const { user, tokens } = result; - const { accessToken, refreshToken, csrfToken } = tokens; + setAuthCookies(res, tokens); - return res - .status(200) - .cookie('access-token', accessToken, { - ...CookieOptions, - maxAge: ACCESS_AGE, - }) - .cookie('refresh-token', refreshToken, { - ...CookieOptions, - maxAge: REFRESH_AGE, - }) - .cookie('csrf-token', csrfToken, { - ...CookieOptions, - httpOnly: false, - maxAge: CSRF_AGE, - }) - .json({ - status: 'success', - data: { - user: { - id: user._id, - email: user.email, - username: user.username, - displayName: user.displayName, - avatar: user.avatarUrl, - accountStatus: user.accountStatus, - }, + return res.status(200).json({ + message: 'Logged in successfully', + data: { + user: { + email: user.email, + username: user.username, + displayName: user.displayName ?? null, + avatarUrl: user.avatarUrl ?? null, + accountStatus: user.accountStatus, }, - }); + }, + }); }; export const forgotPasswordController = async (req: Request, res: Response) => { - const payload = req.validatedBody as ForgetPasswordInput; - await createPasswordResetRequest(payload.email); - return res.status(200).json({ - status: 'success', - message: 'If an account with that email exists, a reset link has been sent.', - }); + const { email } = req.validatedBody as ForgetPasswordInput; + await createPasswordResetRequest(email); + return sendSuccess(res, null, 'If an account with that email exists, a reset link has been sent.'); }; export const resetPasswordController = async (req: Request, res: Response) => { - const { token, password } = req.validatedBody as { - token: string; - password: string; - }; + const { token, password } = req.validatedBody as { token: string; password: string }; await resetPassword(token, password); - return res.status(200).json({ - status: 'success', - message: 'Password updated. Please log in with your new password.', - }); + return sendSuccess(res, null, 'Password updated. Please log in with your new password.'); }; export const refreshTokenController = async (req: Request, res: Response) => { const reqRefreshToken = req.cookies['refresh-token']; - const userAgent: string = req.headers['user-agent'] || 'unknown'; - const ip = req.headers['x-forwarded-for'] || req.headers['x-real-ip'] || req.ip || req.socket.remoteAddress; + const userAgent = req.headers['user-agent'] || 'unknown'; + const ip = + req.headers['x-forwarded-for'] || req.headers['x-real-ip'] || req.ip || req.socket.remoteAddress; + if (!reqRefreshToken) { - throw new UnauthenticatedError('No refresh token, Authentication failed'); + throw new UnauthenticatedError('No refresh token, authentication failed'); } - const result = await refreshTokens(reqRefreshToken, userAgent, ip); - const { accessToken, refreshToken, csrfToken } = result; - return res - .status(200) - .cookie('access-token', accessToken, { - ...CookieOptions, - maxAge: ACCESS_AGE, - }) - .cookie('refresh-token', refreshToken, { - ...CookieOptions, - maxAge: REFRESH_AGE, - }) - .cookie('csrf-token', csrfToken, { - ...CookieOptions, - httpOnly: false, - maxAge: CSRF_AGE, - }) - .json({ message: 'Tokens refreshed' }); + const tokens = await refreshTokens(reqRefreshToken, userAgent, ip); + setAuthCookies(res, tokens); + + return sendSuccess(res, null, 'Tokens refreshed'); }; export const emailVerificationController = async (req: Request, res: Response) => { - const userId = req?.user!.id; - + const userId = req.user!.id; await sendEmailVerification(userId); - return res.status(200).json({ - message: 'Verification email sent successfully', - }); + return sendSuccess(res, null, 'Verification email sent successfully'); }; export const verifyEmailController = async (req: Request, res: Response) => { const { verificationToken } = req.validatedBody as VerifyEmailInput; - await verifyEmail(verificationToken); - return res.status(200).json({ - message: 'Email verified successfully', - }); + return sendSuccess(res, null, 'Email verified successfully'); }; export const verifyEmailChangeController = async (req: Request, res: Response) => { const { verificationToken, code } = req.validatedBody as VerifyUpdateEmailInput; - const currentSessionId = req?.sessionId; + const currentSessionId = req.sessionId; await verifyUpdateEmail(verificationToken, code, currentSessionId); - return res.status(200).json({ - message: 'Email change verified successfully', - }); + return sendSuccess(res, null, 'Email change verified successfully'); }; export const logoutController = async (req: Request, res: Response) => { const refreshToken = req.cookies['refresh-token']; - await logoutUser(refreshToken); return res @@ -197,5 +147,5 @@ export const logoutController = async (req: Request, res: Response) => { .clearCookie('refresh-token') .clearCookie('csrf-token') .status(200) - .json({ message: 'Logged out successfully' }); + .json({ message: 'Logged out successfully', data: null }); }; diff --git a/src/modules/auth/auth.service.ts b/src/modules/auth/auth.service.ts index d5261c7..ae34ed7 100644 --- a/src/modules/auth/auth.service.ts +++ b/src/modules/auth/auth.service.ts @@ -1,6 +1,6 @@ import jwt from 'jsonwebtoken'; import bcrypt from 'bcrypt'; -import { RESET_EXP_MIN } from 'constants/authConsts.js'; +import { RESET_EXP_MIN } from '@constants/authConsts.js'; import { UserModel, type User } from '@models/User.js'; import { SessionModel, type Session } from '@models/Session.js'; import { @@ -30,27 +30,19 @@ import { createSessionPayload } from './utils/createSessionPayload.js'; import { assignFreePlan } from '@modules/subscription/subscription.service.js'; import { withTransaction } from '@db/withTransaction.js'; +import type { SignOutput, RefreshTokenOutput } from '@app-types/Auth.js'; + +// ─── Internal input types ────────────────────────────────────────────────────────── + type LoginInputWithMeta = LoginInput & { userAgent: string; ip: string | string[] | undefined; }; -type SignOutput = { - user: User; - tokens: { - accessToken: string; - refreshToken: string; - csrfToken: string; - }; -}; + type RegisterInputWithMeta = RegisterInput & { userAgent: string; ip: string | string[] | undefined; }; -interface RefreshTokenOutput { - accessToken: string; - refreshToken: string; - csrfToken: string; -} export async function registerUser(input: RegisterInputWithMeta): Promise { const { email, password, name, username, userAgent, ip } = input; @@ -97,7 +89,16 @@ export async function registerUser(input: RegisterInputWithMeta): Promise ], { session } ); - return { user, tokens }; + return { + user: { + email: user.email, + username: user.username, + displayName: user.displayName ?? null, + avatarUrl: user.avatarUrl ?? null, + accountStatus: user.accountStatus, + }, + tokens, + }; }); } diff --git a/src/modules/contextProfile/contextProfile.controller.ts b/src/modules/contextProfile/contextProfile.controller.ts index d7a030d..51d5303 100644 --- a/src/modules/contextProfile/contextProfile.controller.ts +++ b/src/modules/contextProfile/contextProfile.controller.ts @@ -1,32 +1,24 @@ -import { Request, Response } from "express"; +import { Request, Response } from 'express'; import { createContextProfileService, getContextProfileService, listContextProfilesService, -} from "./contextProfile.service.js"; -import { CreateContextProfileInput } from "@validation/contextProfile.schema.js"; +} from './contextProfile.service.js'; +import { CreateContextProfileInput } from '@validation/contextProfile.schema.js'; +import { sendSuccess } from '@shared/response.js'; export async function createContextProfileController(req: Request, res: Response) { const payload = req.validatedBody as CreateContextProfileInput; const context = await createContextProfileService(req.user!.id, payload); - - res.status(201).json({ data: context }); + return sendSuccess(res, context, 'Context profile created successfully', 201); } export async function getContextProfileController(req: Request, res: Response) { - const context = await getContextProfileService( - req.user!.id, - req.params.contextId - ); - - res.json({ data: context }); + const context = await getContextProfileService(req.user!.id, req.params.contextId); + return sendSuccess(res, context, 'Context profile retrieved successfully'); } -export async function listContextProfilesController( - req: Request, - res: Response -) { +export async function listContextProfilesController(req: Request, res: Response) { const contexts = await listContextProfilesService(req.user!.id, req.query); - - res.json({ data: contexts }); + return sendSuccess(res, contexts, 'Context profiles retrieved successfully'); } diff --git a/src/modules/contextProfile/contextProfile.service.ts b/src/modules/contextProfile/contextProfile.service.ts index 82bac98..c25fcd9 100644 --- a/src/modules/contextProfile/contextProfile.service.ts +++ b/src/modules/contextProfile/contextProfile.service.ts @@ -1,50 +1,45 @@ -import mongoose from 'mongoose'; import { BadRequestError, NotFoundError } from '@middleware/error/index.js'; import { ContextProfileModel, ContextScope, GenreType } from '@models/ContextProfile.js'; import { ProjectModel } from '@models/Project.js'; -import { NARRATION_PROFILES } from 'constants/narrationProfiles.js'; +import { NARRATION_PROFILES } from '@constants/narrationProfiles.js'; import type { CreateContextProfileInput } from '@validation/contextProfile.schema.js'; +import { withTransaction } from '@db/withTransaction.js'; +import { + sanitizeContextProfileResponse, + sanitizeContextProfilesResponse, +} from '@utils/sanitizers/sanitizeContextProfileResponse.js'; export async function getContextProfileService(userId: string, contextId: string) { - const context = await ContextProfileModel.findOne({ - _id: contextId, - userId, - }); - + const context = await ContextProfileModel.findOne({ _id: contextId, userId }); if (!context) throw new NotFoundError('Context not found'); - return context; + return sanitizeContextProfileResponse(context); } export async function listContextProfilesService(userId: string, query: any) { const filter: any = { userId }; - if (query.scope) filter.scope = query.scope; if (query.projectId) filter.projectId = query.projectId; - return ContextProfileModel.find(filter).sort({ updatedAt: -1 }); + const contexts = await ContextProfileModel.find(filter).sort({ updatedAt: -1 }); + return sanitizeContextProfilesResponse(contexts); } export async function createContextProfileService(userId: string, payload: CreateContextProfileInput) { - const session = await mongoose.startSession(); - session.startTransaction(); - - try { - const makeGlobal = payload.makeGlobal === true; + const makeGlobal = payload.makeGlobal === true; - if (!makeGlobal && !payload.projectId) { - throw new BadRequestError('projectId is required when creating a non-global context'); - } + if (!makeGlobal && !payload.projectId) { + throw new BadRequestError('projectId is required when creating a non-global context'); + } - if (makeGlobal && payload.setAsProjectDefault) { - throw new BadRequestError('Global context cannot be set as project default'); - } + if (makeGlobal && payload.setAsProjectDefault) { + throw new BadRequestError('Global context cannot be set as project default'); + } + return withTransaction(async (session) => { let project = null; if (!makeGlobal && payload.projectId) { project = await ProjectModel.findOne({ _id: payload.projectId, userId }).session(session); - if (!project) { - throw new NotFoundError('Project not found'); - } + if (!project) throw new NotFoundError('Project not found'); } const narrationProfile = NARRATION_PROFILES[payload.genre as GenreType]; @@ -75,12 +70,7 @@ export async function createContextProfileService(userId: string, payload: Creat if (!makeGlobal && payload.setAsProjectDefault && project) { await ContextProfileModel.updateMany( - { - userId, - projectId: project._id, - _id: { $ne: context._id }, - isDefaultForProject: true, - }, + { userId, projectId: project._id, _id: { $ne: context._id }, isDefaultForProject: true }, { $set: { isDefaultForProject: false } } ).session(session); @@ -91,12 +81,6 @@ export async function createContextProfileService(userId: string, payload: Creat await project.save({ session }); } - await session.commitTransaction(); - return context; - } catch (err) { - await session.abortTransaction(); - throw err; - } finally { - session.endSession(); - } + return sanitizeContextProfileResponse(context); + }); } diff --git a/src/modules/narration/narration.controller.ts b/src/modules/narration/narration.controller.ts index c5bbd83..ff0bfa3 100644 --- a/src/modules/narration/narration.controller.ts +++ b/src/modules/narration/narration.controller.ts @@ -20,20 +20,14 @@ import { UpdateNarrationSegmentsInput, } from '@validation/narration.schema.js'; import { paginationResponse } from '@utils/paginationResponse.js'; +import { sendSuccess, sendPaginated } from '@shared/response.js'; +import { BadRequestError, NotFoundError } from '@middleware/error/index.js'; export const getAllNarrationsForStoryController = async (req: Request, res: Response) => { const userId = req.user!.id; const { storyId } = req.params; - const pagination = req?.pagination!; - const sorting = req?.sorting!; - - const [narrations, total] = await getAllNarrationsForStory(userId, storyId, pagination, sorting); - const paginationRes = paginationResponse(pagination, total as number); - - return res.status(200).json({ - data: narrations, - pagination: paginationRes, - }); + const narrations = await getAllNarrationsForStory(userId, storyId); + return sendSuccess(res, narrations, 'Narrations retrieved successfully'); }; export const getAllDeletedNarrationsController = async (req: Request, res: Response) => { @@ -41,99 +35,58 @@ export const getAllDeletedNarrationsController = async (req: Request, res: Respo const { storyId } = req.params; const pagination = req?.pagination!; const sorting = req?.sorting!; - const [narrations, total] = await getAllDeletedNarrations(userId, storyId, pagination, sorting); - - const paginationRes = paginationResponse(pagination, total as number); - - return res.status(200).json({ - data: narrations, - pagination: paginationRes, - }); + return sendPaginated(res, narrations as any[], paginationResponse(pagination, total as number), 'Deleted narrations retrieved successfully'); }; -// Single narration controllers - export const getActiveNarrationController = async (req: Request, res: Response) => { const userId = req.user!.id; const { storyId } = req.params; - const narration = await getActiveNarration(userId, storyId); - if (!narration) { - return res.status(404).json({ - message: 'No active narration found for this story', - }); + throw new NotFoundError('No active narration found for this story'); } - - return res.status(200).json({ - narration, - }); + return sendSuccess(res, narration, 'Active narration retrieved successfully'); }; export const getNarrationByIdController = async (req: Request, res: Response) => { const userId = req.user!.id; const { narrationId } = req.params; - const narration = await getNarrationById(userId, narrationId); - if (!narration) { - return res.status(404).json({ - message: 'Narration not found', - }); + throw new NotFoundError('Narration not found'); } - - return res.status(200).json({ - narration, - }); + return sendSuccess(res, narration, 'Narration retrieved successfully'); }; export const generateNarrationController = async (req: Request, res: Response) => { const userId = req.user!.id; const { storyId } = req.params; - const narration = await generateNarration(userId, storyId); - - return res.status(201).json({ - message: 'Narration generated successfully', - narration, - }); + return sendSuccess(res, narration, 'Narration generated successfully', 201); }; export const regenerateNarrationController = async (req: Request, res: Response) => { const userId = req.user!.id; const { storyId } = req.params; const { extraPrompt } = req.validatedBody as RegenerateNarrationInput; - const narration = await regenerateNarration(userId, storyId, extraPrompt); - - return res.status(201).json({ - message: 'Narration regenerated successfully', - narration, - }); + return sendSuccess(res, narration, 'Narration regenerated successfully', 201); }; export const createEmptyNarrationController = async (req: Request, res: Response) => { const userId = req.user!.id; const { storyId } = req.params; const narration = await createEmptyNarration(userId, storyId); - return res.status(201).json({ - message: 'Empty narration created successfully', - narration, - }); + return sendSuccess(res, narration, 'Empty narration created successfully', 201); }; export const uploadNarrationJSONController = async (req: Request, res: Response) => { const userId = req.user!.id; const { storyId } = req.params; const payload = req.validatedBody as UploadNarrationJSONInput; - const narration = await createNarrationFromJSON(userId, storyId, payload.narrationSegments); - - return res.status(201).json({ - message: 'Narration uploaded successfully', - narration, - }); + return sendSuccess(res, narration, 'Narration uploaded successfully', 201); }; export const uploadNarrationFileController = async (req: Request, res: Response) => { @@ -141,69 +94,41 @@ export const uploadNarrationFileController = async (req: Request, res: Response) const { storyId } = req.params; if (!req.file) { - return res.status(400).json({ - message: 'No file uploaded', - }); + throw new BadRequestError('No file uploaded'); } const narration = await uploadNarrationJSONFromFile(userId, storyId, req.file.path); - - return res.status(201).json({ - message: 'Narration file uploaded successfully', - narration, - }); + return sendSuccess(res, narration, 'Narration file uploaded successfully', 201); }; export const updateNarrationSegmentsController = async (req: Request, res: Response) => { const userId = req.user!.id; const { storyId, narrationId } = req.params; const payload = req.validatedBody as UpdateNarrationSegmentsInput; - const narration = await updateNarration(userId, storyId, narrationId, payload.narrationSegments); - if (!narration) { - return res.status(404).json({ - message: 'Narration not found', - }); + throw new NotFoundError('Narration not found'); } - - return res.status(200).json({ - message: 'Narration updated successfully', - narration, - }); + return sendSuccess(res, narration, 'Narration updated successfully'); }; export const deleteNarrationController = async (req: Request, res: Response) => { const userId = req.user!.id; const { narrationId } = req.params; - - const narration = await softDeleteNarration(userId, narrationId); - - return res.status(200).json({ - message: 'Narration deleted successfully', - }); + await softDeleteNarration(userId, narrationId); + return sendSuccess(res, null, 'Narration deleted successfully'); }; export const restoreNarrationController = async (req: Request, res: Response) => { const userId = req.user!.id; const { narrationId } = req.params; - const narration = await restoreNarration(userId, narrationId); - - return res.status(200).json({ - message: 'Narration restored successfully', - narration, - }); + return sendSuccess(res, narration, 'Narration restored successfully'); }; export const switchActiveNarrationController = async (req: Request, res: Response) => { const userId = req.user!.id; const { narrationId } = req.params; - const narration = await switchActiveNarration(userId, narrationId); - - return res.status(200).json({ - message: 'Active narration switched successfully', - narration, - }); + return sendSuccess(res, narration, 'Active narration switched successfully'); }; diff --git a/src/modules/narration/narration.routes.ts b/src/modules/narration/narration.routes.ts index 3ac4aa4..00155b3 100644 --- a/src/modules/narration/narration.routes.ts +++ b/src/modules/narration/narration.routes.ts @@ -40,7 +40,6 @@ router.get( router.get( '/story/:storyId/deleted', validateParams(storyIdParamSchema), - paginationAndSortingMiddleware, asyncHandler(getAllDeletedNarrationsController) ); diff --git a/src/modules/narration/narration.service.ts b/src/modules/narration/narration.service.ts index 2d2d82f..ff04da5 100644 --- a/src/modules/narration/narration.service.ts +++ b/src/modules/narration/narration.service.ts @@ -8,7 +8,7 @@ import safeParseJSON from '@utils/safeParseJSON.js'; import { buildStoryNarrationPrompt } from '@libs/ai/prompts/narrationPrompt.js'; import { openRouterAI } from '@libs/ai/clients/openAI.js'; import { BadRequestError, ConflictError, NotFoundError } from '@middleware/error/index.js'; -import { Pagination, Sorting } from 'types/Pagination.js'; +import type { Pagination, Sorting } from '@app-types/Pagination.js'; import { withTransaction } from '@db/withTransaction.js'; import { validateNarrationOwnership } from 'validators/validateNarrationOwnership.js'; import { assertHasActiveScenes } from 'domain/assertions/assertSceneState.js'; @@ -23,35 +23,18 @@ import { assertNarrationFitsTime } from 'domain/assertions/assertNarrationFitsTi import { hashSceneOrder } from '@utils/hashSceneOrder.js'; import { assertCharacterFits } from 'domain/assertions/assertCharacterFits.js'; import { Types } from 'mongoose'; +import { sanitizeNarrationsResponse } from '@utils/sanitizers/sanitizeNarrationResponse.js'; -export async function getAllNarrationsForStory( - userId: string, - storyId: string, - pagination: Pagination, - sorting: Sorting -) { - const { page, limit, skip } = pagination; - - const sortOptions: Record = {}; - sortOptions[sorting.sortBy || 'version'] = sorting.sortOrder || -1; - - const [narrations, total] = await Promise.all([ - StoryNarrationModel.find({ - userId, - storyId, - deletedAt: { $exists: false }, - }) - .sort(sortOptions) - .skip(skip) - .limit(limit), - StoryNarrationModel.countDocuments({ - userId, - storyId, - deletedAt: { $exists: false }, - }), - ]); +export async function getAllNarrationsForStory(userId: string, storyId: string) { + const narrations = await StoryNarrationModel.find({ + userId, + storyId, + deletedAt: { $exists: false }, + }) + .sort({ version: -1 }) + .populate('activeAudioAssetId'); - return [narrations, total]; + return sanitizeNarrationsResponse(narrations); } export async function getAllDeletedNarrations( @@ -91,8 +74,11 @@ export async function getAllNarrationForSceneOrder(userId: string, storyId: stri storyId, sceneOrderHash, deletedAt: { $exists: false }, - }); - return narration; + }).populate('activeAudioAssetId'); + + const sanitizedResponse = sanitizeNarrationsResponse([narration as StoryNarration]); + + return sanitizedResponse; } // For single narration @@ -102,13 +88,16 @@ export async function getActiveNarration(userId: string, storyId: string) { storyId, active: true, deletedAt: { $exists: false }, - }); + }).populate('activeAudioAssetId'); return narration; } export async function getNarrationById(userId: string, narrationId: string) { - const narration = await validateNarrationOwnership(userId, narrationId); + const narration = await StoryNarrationModel.findOne({ + _id: narrationId, + userId, + }).populate('activeAudioAssetId'); return narration; } diff --git a/src/modules/project/project.controller.ts b/src/modules/project/project.controller.ts index eb4a006..451fd73 100644 --- a/src/modules/project/project.controller.ts +++ b/src/modules/project/project.controller.ts @@ -4,6 +4,7 @@ import { archiveManyProjectsByIds, createProject, createProjectContextProfile, + updateProjectContextProfile, deleteAllProjects, deleteManyProjectsByIds, deleteProjectById, @@ -31,38 +32,36 @@ import { UpdateProjectInput, UpdateManyIdsInput, CreateProjectContextInput, + UpdateProjectContextInput, } from '@validation/project.schema.js'; import { paginationResponse } from '@utils/paginationResponse.js'; +import { sendSuccess, sendPaginated } from '@shared/response.js'; export const getProjectsController = async (req: Request, res: Response) => { const pagination = req?.pagination!; const sorting = req?.sorting!; const userId = req.user!.id; const [projects, total] = await getProjects(userId, pagination, sorting); - const paginationRes = paginationResponse(pagination, total as number); - return res.status(200).json({ - items: projects, - pagination: { - ...paginationRes, - }, - }); + + return sendPaginated( + res, + projects as any[], + paginationResponse(pagination, total as number), + 'Projects retrieved successfully' + ); }; export const getDraftProjectsController = async (req: Request, res: Response) => { const pagination = req.pagination!; const sorting = req.sorting!; const userId = req.user!.id; - const [projects, total] = await getDraftProjects(userId, pagination, sorting); - - const paginationRes = paginationResponse(pagination, total as number); - - return res.status(200).json({ - items: projects, - pagination: { - ...paginationRes, - }, - }); + return sendPaginated( + res, + projects as any[], + paginationResponse(pagination, total as number), + 'Draft projects retrieved successfully' + ); }; export const getDeletedProjectsController = async (req: Request, res: Response) => { @@ -70,124 +69,104 @@ export const getDeletedProjectsController = async (req: Request, res: Response) const sorting = req?.sorting!; const userId = req.user!.id; const [projects, total] = await getDeletedProjects(userId, pagination, sorting); - const paginationRes = paginationResponse(pagination, total as number); - return res.status(200).json({ - items: projects, - pagination: { - ...paginationRes, - }, - }); + return sendPaginated( + res, + projects as any[], + paginationResponse(pagination, total as number), + 'Deleted projects retrieved successfully' + ); }; + export const getArchivedProjectsController = async (req: Request, res: Response) => { const pagination = req?.pagination!; const sorting = req?.sorting!; const userId = req.user!.id; const [projects, total] = await getArchivedProjects(userId, pagination, sorting); - const paginationRes = paginationResponse(pagination, total as number); - return res.status(200).json({ - items: projects, - pagination: { - ...paginationRes, - }, - }); + return sendPaginated( + res, + projects as any[], + paginationResponse(pagination, total as number), + 'Archived projects retrieved successfully' + ); }; export const archiveAllProjectsController = async (req: Request, res: Response) => { const userId = req.user!.id; - const result = await archiveAllProjects(userId); - - return res.status(200).json(result); + return sendSuccess(res, result, 'All projects archived successfully'); }; export const unarchiveAllProjectsController = async (req: Request, res: Response) => { const userId = req.user!.id; - const result = await unarchiveAllProjects(userId); - - return res.status(200).json(result); + return sendSuccess(res, result, 'All projects unarchived successfully'); }; export const deleteAllProjectsController = async (req: Request, res: Response) => { const userId = req.user!.id; - const result = await deleteAllProjects(userId); - - return res.status(200).json(result); + return sendSuccess(res, result, 'All projects deleted successfully'); }; export const permanentDeleteAllProjectsController = async (req: Request, res: Response) => { const userId = req.user!.id; - const result = await permanentDeleteAllProjects(userId); - - return res.status(200).json(result); + return sendSuccess(res, result, 'All projects permanently deleted'); }; export const restoreAllProjectsController = async (req: Request, res: Response) => { const userId = req.user!.id; - const result = await restoreAllProjects(userId); - - return res.status(200).json(result); + return sendSuccess(res, result, 'All projects restored successfully'); }; -// Many or Bulk export const deleteManyProjectsController = async (req: Request, res: Response) => { const { projectIds } = req.validatedBody as UpdateManyIdsInput; const userId = req.user!.id; - const result = await deleteManyProjectsByIds(projectIds, userId); - - return res.status(200).json(result); + return sendSuccess(res, result, 'Projects deleted successfully'); }; export const permanentDeleteManyProjectsController = async (req: Request, res: Response) => { const { projectIds } = req.validatedBody as UpdateManyIdsInput; const userId = req.user!.id; - const result = await permanentDeleteManyProjects(projectIds, userId); - - return res.status(200).json(result); + return sendSuccess(res, result, 'Projects permanently deleted'); }; export const restoreManyProjectsController = async (req: Request, res: Response) => { const { projectIds } = req.validatedBody as UpdateManyIdsInput; const userId = req.user!.id; const restoredProjects = await restoreManyProjectsByIds(projectIds, userId); - - return res.status(200).json(restoredProjects); + return sendSuccess(res, restoredProjects, 'Projects restored successfully'); }; export const archiveManyProjectsController = async (req: Request, res: Response) => { const { projectIds } = req.validatedBody as UpdateManyIdsInput; const userId = req.user!.id; - const result = await archiveManyProjectsByIds(projectIds, userId); - - return res.status(200).json(result); + return sendSuccess(res, result, 'Projects archived successfully'); }; export const unarchiveManyProjectsController = async (req: Request, res: Response) => { const { projectIds } = req.validatedBody as UpdateManyIdsInput; const userId = req.user!.id; const unarchivedProjects = await unarchiveManyProjectsByIds(projectIds, userId); - - return res.status(200).json(unarchivedProjects); + return sendSuccess(res, unarchivedProjects, 'Projects unarchived successfully'); }; export const postProjectController = async (req: Request, res: Response) => { const input = req.validatedBody as CreateProjectInput; const userId = req.user!.id; const newProject = await createProject(userId, input); - return res.status(201).json(newProject); + return sendSuccess(res, newProject, 'Project created successfully', 201); }; export const getProjectByIdController = async (req: Request, res: Response) => { const projectId = req.params.projectId as Types.ObjectId | string; const userId = req.user!.id; const project = await getProjectById(projectId, userId); - return res.status(200).json(project); + return sendSuccess(res, project, 'Project retrieved successfully'); }; export const createProjectContextProfileController = async (req: Request, res: Response) => { @@ -195,7 +174,15 @@ export const createProjectContextProfileController = async (req: Request, res: R const payload = req.validatedBody as CreateProjectContextInput; const userId = req.user!.id; const newProject = await createProjectContextProfile(userId, projectId, payload); - return res.status(201).json(newProject); + return sendSuccess(res, newProject, 'Project context profile created successfully', 201); +}; + +export const updateProjectContextProfileController = async (req: Request, res: Response) => { + const projectId = req.params.projectId; + const payload = req.validatedBody as UpdateProjectContextInput; + const userId = req.user!.id; + const updatedProject = await updateProjectContextProfile(userId, projectId, payload); + return sendSuccess(res, updatedProject, 'Project context profile updated successfully'); }; export const updateProjectByIdController = async (req: Request, res: Response) => { @@ -203,23 +190,21 @@ export const updateProjectByIdController = async (req: Request, res: Response) = const updates = req.validatedBody as UpdateProjectInput; const userId = req.user!.id; const updatedProject = await updateProjectById(projectId, userId, updates); - return res.status(200).json(updatedProject); + return sendSuccess(res, updatedProject, 'Project updated successfully'); }; export const deleteProjectByIdController = async (req: Request, res: Response) => { const projectId = req.params.projectId as Types.ObjectId | string; const userId = req.user!.id; const response = await deleteProjectById(projectId, userId); - return res.status(200).json(response); + return sendSuccess(res, response, 'Project deleted successfully'); }; export const permanentDeleteProjectByIdController = async (req: Request, res: Response) => { const projectId = req.params.projectId as Types.ObjectId | string; const userId = req.user!.id; - const result = await permanentDeleteProjectById(projectId, userId); - - return res.status(200).json(result); + return sendSuccess(res, result, 'Project permanently deleted'); }; export const updateProjectStatusController = async (req: Request, res: Response) => { @@ -227,7 +212,7 @@ export const updateProjectStatusController = async (req: Request, res: Response) const { status } = req.body; const userId = req.user!.id; const updatedProject = await updateProjectStatus(projectId, userId, status); - return res.status(200).json(updatedProject); + return sendSuccess(res, updatedProject, 'Project status updated successfully'); }; export const updateProjectVisibilityController = async (req: Request, res: Response) => { @@ -235,19 +220,19 @@ export const updateProjectVisibilityController = async (req: Request, res: Respo const { visibility } = req.body; const userId = req.user!.id; const updatedProject = await updateProjectVisibility(projectId, userId, visibility); - return res.status(200).json(updatedProject); + return sendSuccess(res, updatedProject, 'Project visibility updated successfully'); }; export const restoreProjectByIdController = async (req: Request, res: Response) => { const projectId = req.params.projectId as Types.ObjectId | string; const userId = req.user!.id; const restoredProject = await restoreProjectById(projectId, userId); - return res.status(200).json(restoredProject); + return sendSuccess(res, restoredProject, 'Project restored successfully'); }; export const unarchiveProjectByIdController = async (req: Request, res: Response) => { const projectId = req.params.projectId as Types.ObjectId | string; const userId = req.user!.id; const unarchivedProject = await unarchiveProjectById(projectId, userId); - return res.status(200).json(unarchivedProject); + return sendSuccess(res, unarchivedProject, 'Project unarchived successfully'); }; diff --git a/src/modules/project/project.routes.ts b/src/modules/project/project.routes.ts index 5ea1f98..72b071d 100644 --- a/src/modules/project/project.routes.ts +++ b/src/modules/project/project.routes.ts @@ -3,6 +3,7 @@ import { archiveAllProjectsController, archiveManyProjectsController, createProjectContextProfileController, + updateProjectContextProfileController, deleteAllProjectsController, deleteManyProjectsController, deleteProjectByIdController, @@ -32,6 +33,7 @@ import { createProjectSchema, projectIdParamSchema, updateManyIdsSchema, + updateProjectContextProfileSchema, updateProjectSchema, updateProjectStatusSchema, updateProjectVisibilitySchema, @@ -81,6 +83,12 @@ router.post( validateBody(createProjectContextProfileSchema), asyncHandler(createProjectContextProfileController) ); +router.patch( + '/:projectId/context-profile', + validateParams(projectIdParamSchema), + validateBody(updateProjectContextProfileSchema), + asyncHandler(updateProjectContextProfileController) +); router.patch( '/:projectId', validateParams(projectIdParamSchema), diff --git a/src/modules/project/project.service.ts b/src/modules/project/project.service.ts index 4516d08..e25decd 100644 --- a/src/modules/project/project.service.ts +++ b/src/modules/project/project.service.ts @@ -7,17 +7,19 @@ import { import type { CreateProjectContextInput, CreateProjectInput, + UpdateProjectContextInput, UpdateProjectInput, } from '@validation/project.schema.js'; import { ProjectModel, ProjectType } from '@models/Project.js'; -import { sanitizeProjectResponse, sanitizeProjects } from '@utils/sanitizeProjectResponse.js'; +import { sanitizeProjectResponse, sanitizeProjects } from '@utils/sanitizers/sanitizeProjectResponse.js'; import mongoose, { Types } from 'mongoose'; -import { Pagination, Sorting } from '../../types/Pagination.js'; +import type { Pagination, Sorting } from '@app-types/Pagination.js'; import { ACTIVE_STATUSES } from './rules/projectStatus.js'; import { transitionManyProjectsByIds } from './utils/transitionManyProjectsByIds.js'; import { transitionProjectById } from './utils/transitionProjectById.js'; import { ContextProfileModel, ContextScope, GenreType } from '@models/ContextProfile.js'; -import { NARRATION_PROFILES } from 'constants/narrationProfiles.js'; +import { NARRATION_PROFILES } from '@constants/narrationProfiles.js'; +import { withTransaction } from '@db/withTransaction.js'; export async function getProjects(userId: Types.ObjectId | string, pagination: Pagination, sorting: Sorting) { const filter = { userId, status: { $eq: 'active' } }; @@ -374,6 +376,58 @@ export async function createProjectContextProfile( // TODO:createUpdatedContextProfile function +export async function updateProjectContextProfile( + userId: string, + projectId: string, + payload: UpdateProjectContextInput +) { + return withTransaction(async (session) => { + const project = await ProjectModel.findOne({ _id: projectId, userId }).session(session); + if (!project) throw new NotFoundError('Project not found'); + + const narrationProfile = NARRATION_PROFILES[payload.genre as GenreType]; + + const [newContext] = await ContextProfileModel.create( + [ + { + userId, + projectId, + name: payload.name, + description: payload.description, + genre: payload.genre, + mood: payload.mood, + style: payload.style, + narrativeScope: payload.narrativeScope, + environment: payload.environment, + worldRules: payload.worldRules, + narrativeConstraints: payload.narrativeConstraints, + characters: payload.characters, + forbiddenElements: payload.forbiddenElements, + narrationProfile, + scope: ContextScope.PROJECT, + isDefaultForProject: true, + lastUsedAt: new Date(), + }, + ], + { session } + ); + + // Demote the previous default + if (project.defaultContextProfileId) { + await ContextProfileModel.updateOne( + { _id: project.defaultContextProfileId }, + { $set: { isDefaultForProject: false } }, + { session } + ); + } + + project.defaultContextProfileId = newContext._id; + await project.save({ session }); + + return sanitizeProjectResponse({ project, type: 'getProjectById' }); + }); +} + export async function updateProjectById( projectId: Types.ObjectId | string, userId: Types.ObjectId | string, diff --git a/src/modules/project/rules/projectStatus.ts b/src/modules/project/rules/projectStatus.ts index 5c6c4aa..8e97327 100644 --- a/src/modules/project/rules/projectStatus.ts +++ b/src/modules/project/rules/projectStatus.ts @@ -1,14 +1,11 @@ +export { type ProjectStatus, type TransitionableManyProjectStatus } from '@app-types/Project.js'; +import type { ProjectStatus } from '@app-types/Project.js'; + export const ACTIVE_STATUSES: ['active', 'draft'] = ['active', 'draft']; export const NON_DELETED_STATUSES: ['active', 'draft', 'archive'] = ['active', 'draft', 'archive']; -export type ProjectStatus = 'draft' | 'active' | 'archive' | 'delete'; -export type TransitionableManyProjectStatus = ProjectStatus[]; - -export function canTransition( - from: 'draft' | 'active' | 'archive' | 'delete', - to: 'draft' | 'active' | 'archive' | 'delete' -) { - const allowed = { +export function canTransition(from: ProjectStatus, to: ProjectStatus) { + const allowed: Record = { draft: ['active', 'delete'], active: ['archive', 'delete'], archive: ['active', 'delete'], diff --git a/src/modules/project/utils/transitionProjectById.ts b/src/modules/project/utils/transitionProjectById.ts index c59cdb8..423cd18 100644 --- a/src/modules/project/utils/transitionProjectById.ts +++ b/src/modules/project/utils/transitionProjectById.ts @@ -1,5 +1,5 @@ import { BadRequestError, ConflictError, NotFoundError } from "@middleware/error/index.js"; -import { sanitizeProjectResponse } from "@utils/sanitizeProjectResponse.js"; +import { sanitizeProjectResponse } from "@utils/sanitizers/sanitizeProjectResponse.js"; import { canTransition, ProjectStatus } from "../rules/projectStatus.js"; import { ProjectModel } from "@models/Project.js"; import { Types } from "mongoose"; diff --git a/src/modules/sceneAssets/sceneAssets.controller.ts b/src/modules/sceneAssets/sceneAssets.controller.ts index 0f395d8..b53e5da 100644 --- a/src/modules/sceneAssets/sceneAssets.controller.ts +++ b/src/modules/sceneAssets/sceneAssets.controller.ts @@ -19,6 +19,7 @@ import { permanentDeleteAsset, forceDeleteActiveAsset, generateVideoAsset, + generateImageAsset, } from './sceneAssets.service.js'; import type { BulkDeleteAssetsInput, @@ -26,23 +27,18 @@ import type { SetActiveAssetInput, } from '@validation/sceneAssets.schema.js'; import { paginationResponse } from '@utils/paginationResponse.js'; +import { sendSuccess, sendPaginated } from '@shared/response.js'; +import { BadRequestError } from '@middleware/error/index.js'; + +// ==================== ALL OPERATIONS ==================== -// All Op controllers export const getAllAssetsController = async (req: Request, res: Response) => { const userId = req.user!.id; const { sceneId } = req.params; const pagination = req?.pagination; const sorting = req?.sorting; - const [assets, total] = await getAllAssetsForScene(userId, sceneId, pagination, sorting); - - const paginationRes = paginationResponse(pagination, total as number); - - res.status(200).json({ - message: 'Assets retrieved successfully', - data: assets, - pagination: paginationRes, - }); + return sendPaginated(res, assets as any[], paginationResponse(pagination, total as number), 'Assets retrieved successfully'); }; export const getAllDeletedAssetsController = async (req: Request, res: Response) => { @@ -50,152 +46,96 @@ export const getAllDeletedAssetsController = async (req: Request, res: Response) const { sceneId } = req.params; const pagination = req?.pagination; const sorting = req?.sorting; - const [assets, total] = await getAllDeletedAssets(userId, sceneId, pagination, sorting); - - const paginationRes = paginationResponse(pagination, total as number); - - res.status(200).json({ - message: 'Deleted assets retrieved successfully', - data: assets, - pagination: paginationRes, - }); + return sendPaginated(res, assets as any[], paginationResponse(pagination, total as number), 'Deleted assets retrieved successfully'); }; export const restoreAllDeletedAssetsController = async (req: Request, res: Response) => { const userId = req.user!.id; const { sceneId } = req.params; - const result = await restoreAllDeletedAssets(userId, sceneId); - - res.status(200).json({ - message: 'All deleted assets restored successfully', - restoredCount: result.restoredCount, - }); + return sendSuccess(res, { restoredCount: result.restoredCount }, 'All deleted assets restored successfully'); }; export const softDeleteAllAssetsController = async (req: Request, res: Response) => { const userId = req.user!.id; const { sceneId } = req.params; - const result = await softDeleteAllAssetsForScene(userId, sceneId); - - res.status(200).json({ - message: 'All assets safe deleted successfully', - deletedCount: result.deletedCount, - }); + return sendSuccess(res, { deletedCount: result.deletedCount }, 'All assets soft deleted successfully'); }; export const permanentDeleteAllAssetsController = async (req: Request, res: Response) => { const userId = req.user!.id; const { sceneId } = req.params; const result = await permanentDeleteAllAssetsForScene(userId, sceneId); - res.status(200).json({ - message: 'All assets deleted successfully', - deletedCount: result.deletedCount, - }); + return sendSuccess(res, { deletedCount: result.deletedCount }, 'All assets permanently deleted successfully'); }; export const getAssetCountController = async (req: Request, res: Response) => { const userId = req.user!.id; const { sceneId } = req.params; - const count = await getAssetCount(userId, sceneId); - - res.status(200).json({ - message: 'Asset count retrieved successfully', - count, - }); + return sendSuccess(res, { count }, 'Asset count retrieved successfully'); }; -// Bulk Op controllers +// ==================== BULK OPERATIONS ==================== + export const softBulkDeleteAssetsController = async (req: Request, res: Response) => { const userId = req.user!.id; const { sceneId } = req.params; const { assetIds } = req.validatedBody as BulkDeleteAssetsInput; - const result = await softBulkDeleteAssets(userId, sceneId, assetIds); - - res.status(200).json({ - message: 'Assets safe deleted successfully', - deletedCount: result.deletedCount, - }); + return sendSuccess(res, { deletedCount: result.deletedCount }, 'Assets soft deleted successfully'); }; export const permanentBulkDeleteAssetsController = async (req: Request, res: Response) => { const userId = req.user!.id; const { sceneId } = req.params; const { assetIds } = req.validatedBody as BulkDeleteAssetsInput; - const result = await permanentBulkDeleteAssets(userId, sceneId, assetIds); - - res.status(200).json({ - message: 'Assets safe deleted successfully', - deletedCount: result.deletedCount, - }); + return sendSuccess(res, { deletedCount: result.deletedCount }, 'Assets permanently deleted successfully'); }; export const bulkRestoreAssetsController = async (req: Request, res: Response) => { const userId = req.user!.id; const { sceneId } = req.params; const { assetIds } = req.validatedBody as BulkRestoreAssetsInput; - const result = await bulkRestoreAssets(userId, sceneId, assetIds); - - res.status(200).json({ - message: 'Assets restored successfully', - data: result, - }); + return sendSuccess(res, result, 'Assets restored successfully'); }; -// Single Op controllers +// ==================== SINGLE OPERATIONS ==================== + export const getAssetByIdController = async (req: Request, res: Response) => { const userId = req.user!.id; const { assetId } = req.params; - const asset = await getAssetById(userId, assetId); - - res.status(200).json({ - message: 'Asset retrieved successfully', - data: asset, - }); + return sendSuccess(res, asset, 'Asset retrieved successfully'); }; export const getActiveAssetController = async (req: Request, res: Response) => { const userId = req.user!.id; const { sceneId } = req.params; - const asset = await getActiveAssetForScene(userId, sceneId); - - if (!asset) { - return res.status(200).json({ - message: 'No active asset found for this scene', - data: null, - }); - } - - res.status(200).json({ - message: 'Active asset retrieved successfully', - data: asset, - }); + return sendSuccess( + res, + asset ?? null, + asset ? 'Active asset retrieved successfully' : 'No active asset found for this scene', + ); }; export const generateVideoAssetController = async (req: Request, res: Response) => { const userId = req.user!.id; const { sceneId } = req.params; const response = await generateVideoAsset(userId, sceneId); - res.status(201).json({ - message: 'Video asset generated successfully', - data: { - sceneId, - filename: response.url, - }, - }); + return sendSuccess(res, { sceneId, filename: response.url }, 'Video asset generated successfully', 201); }; export const generateImageAssetController = async (req: Request, res: Response) => { const userId = req.user!.id; const { sceneId } = req.params; + const response = await generateImageAsset(userId, sceneId); + return sendSuccess(res, response, 'Image asset generation started successfully', 201); }; export const uploadVideoAssetController = async (req: Request, res: Response) => { @@ -203,18 +143,10 @@ export const uploadVideoAssetController = async (req: Request, res: Response) => const { sceneId } = req.params; const file = req.file; if (!file) { - return res.status(400).json({ message: 'No video file uploaded' }); + throw new BadRequestError('No video file uploaded'); } - const response = await uploadVideoAsset(userId, sceneId, file); - - res.status(201).json({ - message: 'Video asset uploaded successfully', - data: { - sceneId, - filename: response.videoUrl, - }, - }); + return sendSuccess(res, response, 'Video asset uploaded successfully', 201); }; export const uploadImageAssetController = async (req: Request, res: Response) => { @@ -222,73 +154,44 @@ export const uploadImageAssetController = async (req: Request, res: Response) => const { sceneId } = req.params; const file = req.file; if (!file) { - return res.status(400).json({ message: 'No image file uploaded' }); + throw new BadRequestError('No image file uploaded'); } - const response = await uploadImageAsset(userId, sceneId, file); - - res.status(201).json({ - message: 'Image asset uploaded successfully', - data: { - sceneId, - filename: file.originalname, - }, - }); + return sendSuccess(res, response, 'Image asset uploaded successfully', 201); }; export const setActiveAssetController = async (req: Request, res: Response) => { const userId = req.user!.id; const { sceneId } = req.params; const { assetId } = req.validatedBody as SetActiveAssetInput; - const asset = await setActiveAsset(userId, sceneId, assetId); - - res.status(200).json({ - message: 'Active asset set successfully', - data: asset, - }); + return sendSuccess(res, asset, 'Active asset set successfully'); }; export const softDeleteAssetController = async (req: Request, res: Response) => { const userId = req.user!.id; const { assetId } = req.params; - const asset = await softDeleteAsset(userId, assetId); - res.status(200).json({ - message: 'Asset safe deleted successfully', - data: asset, - }); + return sendSuccess(res, asset, 'Asset soft deleted successfully'); }; export const permanentDeleteAssetController = async (req: Request, res: Response) => { const userId = req.user!.id; const { assetId } = req.params; const asset = await permanentDeleteAsset(userId, assetId); - res.status(200).json({ - message: 'Asset deleted successfully', - data: asset, - }); + return sendSuccess(res, asset, 'Asset permanently deleted successfully'); }; export const forceDeleteActiveAssetController = async (req: Request, res: Response) => { const userId = req.user!.id; const { assetId } = req.params; - await forceDeleteActiveAsset(userId, assetId); - res.status(200).json({ - message: 'Asset deleted successfully', - data: true, - }); + return sendSuccess(res, null, 'Asset force deleted successfully'); }; export const restoreAssetController = async (req: Request, res: Response) => { const userId = req.user!.id; const { assetId } = req.params; - const asset = await restoreAsset(userId, assetId); - - res.status(200).json({ - message: 'Asset restored successfully', - data: asset, - }); + return sendSuccess(res, asset, 'Asset restored successfully'); }; diff --git a/src/modules/sceneAssets/sceneAssets.private.routes.ts b/src/modules/sceneAssets/sceneAssets.private.routes.ts index 28d0857..d3a372e 100644 --- a/src/modules/sceneAssets/sceneAssets.private.routes.ts +++ b/src/modules/sceneAssets/sceneAssets.private.routes.ts @@ -83,7 +83,7 @@ router.post( '/:sceneId/permanent-bulk-delete', validateParams(sceneIdParamSchema), validateBody(bulkDeleteAssetsSchema), - asyncHandler(permanentDeleteAllAssetsController) + asyncHandler(permanentBulkDeleteAssetsController) ); router.post( diff --git a/src/modules/sceneAssets/sceneAssets.service.ts b/src/modules/sceneAssets/sceneAssets.service.ts index cb12143..194ea81 100644 --- a/src/modules/sceneAssets/sceneAssets.service.ts +++ b/src/modules/sceneAssets/sceneAssets.service.ts @@ -3,7 +3,7 @@ import { SceneAssetModel, SceneAsset } from '@models/SceneAssets.js'; import { SceneModel } from '@models/Scene.js'; import { NotFoundError, BadRequestError, ConflictError } from '@middleware/error/index.js'; import mongoose, { ClientSession } from 'mongoose'; -import type { Pagination, Sorting } from 'types/Pagination.js'; +import type { Pagination, Sorting } from '@app-types/Pagination.js'; import { getVideoDuration } from '@utils/getVideoDuration.js'; import { assertFeaturePermission } from '@modules/featurePermission/featurePermission.service.js'; import { getCreditCost } from '@utils/getCreditCost.js'; @@ -18,6 +18,8 @@ import { assertHasNonDeletedAssets, } from 'domain/assertions/assertAssetState.js'; import { withTransaction } from '@db/withTransaction.js'; +import { removeTempFile } from '@utils/file.js'; +import { uploadFile } from '@libs/aws/s3.js'; // Get the next version number for an asset in a scene async function getNextVersionNumber(sceneId: string, session?: ClientSession): Promise { @@ -371,7 +373,31 @@ export async function generateVideoAsset( export async function generateImageAsset(userId: string, sceneId: string) { const scene = await validateSceneOwnership(userId, sceneId); - // Placeholder logic for image generation + const user = await validateUser(userId); + + // if (user.planEndsAt && user.planEndsAt <= new Date()) { + // throw new BadRequestError('Plan has expired. Please renew to generate new assets.'); + // } + const generatedImageUrl = `https://media.istockphoto.com/id/1363689354/photo/aerial-view-on-green-pine-forest.webp?s=1024x1024&w=is&k=20&c=PSCjwZKiHtwE3YroyuUosYDT3eVNjjd5G9_8s5LkuBs=`; + const asset = new SceneAssetModel({ + userId: user._id, + sceneId, + type: 'image', + url: generatedImageUrl, + visibility: 'public', + generationSource: 'ai', + status: 'ready', + version: await getNextVersionNumber(sceneId), + }); + await asset.save(); + + scene.activeAssetId = asset._id; + scene.status = 'ready'; + await scene.save(); + + await new Promise((resolve) => setTimeout(resolve, 5000)); + + return asset; } export async function uploadVideoAsset( @@ -385,34 +411,38 @@ export async function uploadVideoAsset( try { duration = await getVideoDuration(file.path); } catch { - await fs.unlink(file.path); + await removeTempFile(file.path); throw new BadRequestError('Invalid or corrupted video file'); } - console.log('Video duration:', duration, 'Scene duration:', scene.duration); - console.log('Difference:', Math.abs(duration - (scene.duration || 0))); - - if (scene.duration !== undefined && Math.abs(duration - scene.duration) > 0.25) { - await fs.unlink(file.path); + if (scene.duration !== undefined && Math.abs(duration - scene.duration) < 0.25) { + await removeTempFile(file.path); throw new BadRequestError('Video duration does not match existing scene duration and cannot be uploaded'); } - // TODO: Add video to cloud storage here and get the URL - const videoUrl = `/uploads/videos/${file.filename}`; - const asset = new SceneAssetModel({ + + const fileBuffer = await fs.readFile(file.path); + const key = `uploads/videos/${userId}/${Date.now()}.${file.originalname.split('.').pop()}`; + const url = await uploadFile({ + buffer: fileBuffer, + key, + contentType: file.mimetype, + }); + await removeTempFile(file.path); + + const asset = await SceneAssetModel.create({ userId, sceneId, type: 'video', - url: videoUrl, - visibility: 'public', + url, + visibility: 'private', format: file.mimetype.split('/')[1] || undefined, version: await getNextVersionNumber(sceneId), duration, }); await asset.save(); - - await fs.unlink(file.path); - - return { asset, videoUrl }; + scene.activeAssetId = asset._id; + await scene.save(); + return { asset, videoUrl: url }; } export async function uploadImageAsset( @@ -420,22 +450,29 @@ export async function uploadImageAsset( sceneId: string, file: Express.Multer.File ): Promise { - await validateSceneOwnership(userId, sceneId); - //TODO: Add Image to cloud storage and get URL - const imageUrl = `/uploads/images/${file.filename}`; - const asset = new SceneAssetModel({ + const scene = await validateSceneOwnership(userId, sceneId); + + const { buffer, mimetype } = file; + const key = `uploads/images/${userId}/${Date.now()}.webp`; + + const assetUrl = await uploadFile({ + buffer, + key, + contentType: mimetype, + }); + + const asset = await SceneAssetModel.create({ userId, sceneId, type: 'image', - url: imageUrl, - visibility: 'public', + url: assetUrl, + visibility: 'private', format: file.mimetype.split('/')[1] || undefined, version: await getNextVersionNumber(sceneId), }); await asset.save(); - - await fs.unlink(file.path); - + scene.activeAssetId = asset._id; + await scene.save(); return asset; } diff --git a/src/modules/scenes/scenes.controller.ts b/src/modules/scenes/scenes.controller.ts index 772b6b8..d531e38 100644 --- a/src/modules/scenes/scenes.controller.ts +++ b/src/modules/scenes/scenes.controller.ts @@ -12,6 +12,8 @@ import { regenerateScene, generateAllScenes, regenerateAllScenes, + createScenesFromJSON, + uploadScenesJSONFromFile, moveSceneByOne, getSceneCount, softdeleteAllScenes, @@ -34,114 +36,106 @@ import type { GenerateSceneInput, RegenerateSceneInput, GenerateAllScenesInput, + UploadScenesJSONInput, BulkRestoreInput, DurationInput, } from '@validation/scenes.schema.js'; +import { sendSuccess } from '@shared/response.js'; +import { BadRequestError } from '@middleware/error/index.js'; + +// ==================== ALL SCENES CONTROLLERS ==================== -// All SCENES CONTROLLERS export const getAllStoryScenesController = async (req: Request, res: Response) => { const userId = req.user!.id; const storyId = req.params.storyId; - const scenes = await getAllScenesForStory(userId, storyId); - - res.status(200).json({ - message: 'Scenes retrieved successfully', - data: scenes, - }); + return sendSuccess(res, scenes, 'Scenes retrieved successfully'); }; export const getAllInactiveStoryScenesController = async (req: Request, res: Response) => { const userId = req.user!.id; const storyId = req.params.storyId; const scenes = await getAllInactiveScenesForStory(userId, storyId); - res.status(200).json({ - message: 'Inactive scenes retrieved successfully', - data: scenes, - }); + return sendSuccess(res, scenes, 'Inactive scenes retrieved successfully'); }; export const getAllDeletedScenesController = async (req: Request, res: Response) => { const userId = req.user!.id; const storyId = req.params.storyId; - const scenes = await getAllDeletedScenes(userId, storyId); - - res.status(200).json({ - message: 'Scenes retrieved successfully', - data: scenes, - }); + return sendSuccess(res, scenes, 'Deleted scenes retrieved successfully'); }; export const softDeleteAllScenesController = async (req: Request, res: Response) => { const userId = req.user!.id; const storyId = req.params.storyId; const scenes = await softdeleteAllScenes(userId, storyId); - res.status(200).json({ - message: 'All scenes soft deleted successfully', - data: scenes, - }); + return sendSuccess(res, scenes, 'All scenes soft deleted successfully'); }; export const permanentDeleteAllScenesController = async (req: Request, res: Response) => { const userId = req.user!.id; const storyId = req.params.storyId; const deletedCount = await permanentDeleteAllScenes(userId, storyId); - res.status(200).json({ - message: 'All deleted scenes permanently deleted successfully', - data: { deletedCount }, - }); + return sendSuccess(res, { deletedCount }, 'All deleted scenes permanently deleted successfully'); }; export const restoreAllDeletedScenesController = async (req: Request, res: Response) => { const userId = req.user!.id; const storyId = req.params.storyId; const scenes = await restoreAllDeletedScenes(userId, storyId); - res.status(200).json({ - message: 'All deleted scenes restored successfully', - data: scenes, - }); + return sendSuccess(res, scenes, 'All deleted scenes restored successfully'); }; export const generateScenesController = async (req: Request, res: Response) => { const userId = req.user!.id; const storyId = req.params.storyId; const { total } = req.validatedBody as GenerateAllScenesInput; - const scenes = await generateAllScenes(userId, storyId, total); - - res.status(200).json({ - message: 'Scenes generated successfully', - data: scenes, - }); + return sendSuccess(res, scenes, 'Scenes generated successfully'); }; export const regenerateScenesController = async (req: Request, res: Response) => { const userId = req.user!.id; const storyId = req.params.storyId; const { extraPrompt } = (req.validatedBody as RegenerateSceneInput) || {}; - const scenes = await regenerateAllScenes(userId, storyId, extraPrompt); + return sendSuccess(res, scenes, 'Scenes regenerated successfully'); +}; - res.status(200).json({ - message: 'Scenes regenerated successfully', - data: scenes, - }); +export const uploadScenesJSONController = async (req: Request, res: Response) => { + const userId = req.user!.id; + const storyId = req.params.storyId; + const payload = req.validatedBody as UploadScenesJSONInput; + const scenes = await createScenesFromJSON(userId, storyId, payload.scenes); + return sendSuccess(res, scenes, 'Scenes uploaded successfully', 201); }; -// BULK SCENES CONTROLLERS +export const uploadScenesFileController = async (req: Request, res: Response) => { + const userId = req.user!.id; + const storyId = req.params.storyId; + + if (!req.file) { + throw new BadRequestError('No file uploaded'); + } + + const fileSource = req.file.buffer ?? req.file.path; + if (!fileSource) { + throw new BadRequestError('Invalid uploaded file payload'); + } + + const scenes = await uploadScenesJSONFromFile(userId, storyId, fileSource); + return sendSuccess(res, scenes, 'Scenes file uploaded successfully', 201); +}; + +// ==================== BULK SCENES CONTROLLERS ==================== export const bulkReorderController = async (req: Request, res: Response) => { const userId = req.user!.id; const storyId = req.params.storyId; const payload = req.validatedBody as BulkReorderInput; - const scenes = await bulkReorder(userId, storyId, payload); - - res.status(200).json({ - message: 'Scenes reordered successfully', - data: scenes, - }); + return sendSuccess(res, scenes, 'Scenes reordered successfully'); }; export const bulkRestoreScenesController = async (req: Request, res: Response) => { @@ -149,10 +143,7 @@ export const bulkRestoreScenesController = async (req: Request, res: Response) = const storyId = req.params.storyId; const { sceneIds } = req.validatedBody as BulkRestoreInput; const restoredScenes = await bulkRestoreScenes(userId, storyId, sceneIds); - res.status(200).json({ - message: 'Scenes restored successfully', - data: restoredScenes, - }); + return sendSuccess(res, restoredScenes, 'Scenes restored successfully'); }; export const bulkSoftDeleteScenesController = async (req: Request, res: Response) => { @@ -160,10 +151,7 @@ export const bulkSoftDeleteScenesController = async (req: Request, res: Response const storyId = req.params.storyId; const { sceneIds } = req.validatedBody as BulkRestoreInput; const deletedScenes = await bulkSoftdeleteScenes(userId, storyId, sceneIds); - res.status(200).json({ - message: 'Scenes soft deleted successfully', - data: deletedScenes, - }); + return sendSuccess(res, deletedScenes, 'Scenes soft deleted successfully'); }; export const bulkPermanentDeleteScenesController = async (req: Request, res: Response) => { @@ -171,76 +159,48 @@ export const bulkPermanentDeleteScenesController = async (req: Request, res: Res const storyId = req.params.storyId; const { sceneIds } = req.validatedBody as BulkRestoreInput; const deletedCount = await bulkPermanentDeleteScenes(userId, storyId, sceneIds); - res.status(200).json({ - message: 'Scenes permanently deleted successfully', - data: { deletedCount }, - }); + return sendSuccess(res, { deletedCount }, 'Scenes permanently deleted successfully'); }; -// SINGLE SCENE CONTROLLERS +// ==================== SINGLE SCENE CONTROLLERS ==================== export const getSceneByIdController = async (req: Request, res: Response) => { const userId = req.user!.id; const { storyId, sceneId } = req.params; - const scene = await getSceneById(userId, storyId, sceneId); - - res.status(200).json({ - message: 'Scene retrieved successfully', - data: scene, - }); + return sendSuccess(res, scene, 'Scene retrieved successfully'); }; export const createSceneController = async (req: Request, res: Response) => { const userId = req.user!.id; const storyId = req.params.storyId; const payload = req.validatedBody as CreateSceneInput; - const scene = await createScene(userId, storyId, payload, payload.position); - - res.status(201).json({ - message: 'Scene created successfully', - data: scene, - }); + return sendSuccess(res, scene, 'Scene created successfully', 201); }; export const generateSingleSceneController = async (req: Request, res: Response) => { const userId = req.user!.id; const storyId = req.params.storyId; const payload = req.validatedBody as GenerateSceneInput; - const scene = await generateSceneWithAI(userId, storyId, payload); - - res.status(201).json({ - message: 'Scene generated successfully', - data: scene, - }); + return sendSuccess(res, scene, 'Scene generated successfully', 201); }; export const regenerateSceneController = async (req: Request, res: Response) => { const userId = req.user!.id; const sceneId = req.params.sceneId; const payload = req.validatedBody as RegenerateSceneInput; - const scene = await regenerateScene(userId, sceneId, payload); - - res.status(200).json({ - message: 'Scene regenerated successfully', - data: scene, - }); + return sendSuccess(res, scene, 'Scene regenerated successfully'); }; export const updateSceneController = async (req: Request, res: Response) => { const userId = req.user!.id; const sceneId = req.params.sceneId; const payload = req.validatedBody as UpdateSceneInput; - const scene = await updateScene(userId, sceneId, payload); - - res.status(200).json({ - message: 'Scene updated successfully', - data: scene, - }); + return sendSuccess(res, scene, 'Scene updated successfully'); }; export const updateSceneDurationController = async (req: Request, res: Response) => { @@ -249,87 +209,55 @@ export const updateSceneDurationController = async (req: Request, res: Response) const storyId = req.params.storyId; const { duration } = req.validatedBody as DurationInput; const scene = await updateSceneDuration(userId, storyId, sceneId, duration); - res.status(200).json({ - message: 'Scene duration updated successfully', - data: scene, - }); + return sendSuccess(res, scene, 'Scene duration updated successfully'); }; export const softDeleteSceneController = async (req: Request, res: Response) => { const userId = req.user!.id; const sceneId = req.params.sceneId; - const deleted = await softDeleteScene(userId, sceneId); - - res.status(200).json({ - message: 'Scene deleted successfully', - data: { deleted }, - }); + return sendSuccess(res, { deleted }, 'Scene deleted successfully'); }; export const permanentDeleteSceneController = async (req: Request, res: Response) => { const userId = req.user!.id; const sceneId = req.params.sceneId; const deleted = await permanentDeleteScene(userId, sceneId); - res.status(200).json({ - message: 'Scene permanently deleted successfully', - data: { deleted }, - }); + return sendSuccess(res, { deleted }, 'Scene permanently deleted successfully'); }; export const restoreSceneController = async (req: Request, res: Response) => { const userId = req.user!.id; const sceneId = req.params.sceneId; - const scene = await restoreScene(userId, sceneId); - - res.status(200).json({ - message: 'Scene restored successfully', - data: scene, - }); + return sendSuccess(res, scene, 'Scene restored successfully'); }; export const reactivateSceneController = async (req: Request, res: Response) => { const userId = req.user!.id; const sceneId = req.params.sceneId; const scene = await reactivateScene(userId, sceneId); - res.status(200).json({ - message: 'Scene reactivated successfully', - data: scene, - }); + return sendSuccess(res, scene, 'Scene reactivated successfully'); }; export const deactivateSceneController = async (req: Request, res: Response) => { const userId = req.user!.id; const sceneId = req.params.sceneId; const scene = await deactivateScene(userId, sceneId); - res.status(200).json({ - message: 'Scene deactivated successfully', - data: scene, - }); + return sendSuccess(res, scene, 'Scene deactivated successfully'); }; export const moveSceneController = async (req: Request, res: Response) => { const userId = req.user!.id; const sceneId = req.params.sceneId; const { direction } = req.validatedBody as MoveSceneInput; - const scene = await moveSceneByOne(userId, sceneId, direction); - - res.status(200).json({ - message: 'Scene moved successfully', - data: scene, - }); + return sendSuccess(res, scene, 'Scene moved successfully'); }; export const getSceneCountController = async (req: Request, res: Response) => { const userId = req.user!.id; const storyId = req.params.storyId; - const count = await getSceneCount(userId, storyId); - - res.status(200).json({ - message: 'Scene count retrieved successfully', - data: { count }, - }); + return sendSuccess(res, { count }, 'Scene count retrieved successfully'); }; diff --git a/src/modules/scenes/scenes.private.routes.ts b/src/modules/scenes/scenes.private.routes.ts index 5c2e119..b86a210 100644 --- a/src/modules/scenes/scenes.private.routes.ts +++ b/src/modules/scenes/scenes.private.routes.ts @@ -14,8 +14,10 @@ import { generateSceneSchema, regenerateSceneSchema, generateAllScenesSchema, + uploadScenesJSONSchema, durationSchema, } from '@validation/scenes.schema.js'; +import { scenesJSONUpload } from '@middleware/multer/scenesJSONUpload.js'; import { getAllStoryScenesController, @@ -37,6 +39,8 @@ import { permanentDeleteSceneController, generateScenesController, regenerateScenesController, + uploadScenesJSONController, + uploadScenesFileController, generateSingleSceneController, regenerateSceneController, getSceneCountController, @@ -128,6 +132,20 @@ router.post( asyncHandler(regenerateScenesController) ); +router.post( + '/:storyId/upload-json', + validateParams(storyIdParamSchema), + validateBody(uploadScenesJSONSchema), + asyncHandler(uploadScenesJSONController) +); + +router.post( + '/:storyId/upload-file', + validateParams(storyIdParamSchema), + scenesJSONUpload, + asyncHandler(uploadScenesFileController) +); + router.get( '/:storyId/scene/:sceneId', validateParams(sceneAndStoryParamSchema), diff --git a/src/modules/scenes/scenes.service.ts b/src/modules/scenes/scenes.service.ts index 5af28b0..f98003e 100644 --- a/src/modules/scenes/scenes.service.ts +++ b/src/modules/scenes/scenes.service.ts @@ -1,3 +1,4 @@ +import fs from 'fs/promises'; import safeParseJSON from '@utils/safeParseJSON.js'; import { SceneModel, Scene } from '@models/Scene.js'; import { StoryModel } from '@models/Story.js'; @@ -16,6 +17,7 @@ import type { RegenerateSceneInput, GenerateSceneInput, DurationInput, + UploadSceneItemInput, } from '@validation/scenes.schema.js'; import { singleScenePrompt } from '@libs/ai/prompts/singleScenePrompt.js'; import { openRouterAI } from '@libs/ai/clients/openAI.js'; @@ -30,12 +32,10 @@ import { assertSceneIsDeleted, assertSceneNotDeleted, } from 'domain/assertions/assertSceneState.js'; -import { - validateSceneOwnership, - validateStorySceneOwnership, -} from 'validators/validateSceneOwnership.js'; -import e from 'express'; +import { validateSceneOwnership, validateStorySceneOwnership } from 'validators/validateSceneOwnership.js'; import { validateUser } from 'validators/validateUser.js'; +import type { SanitizedScene } from '@utils/sanitizers/sanitizeScenesResponse.js'; +import { sanitizeScenesResponse } from '@utils/sanitizers/sanitizeScenesResponse.js'; // -> Ordering Helpers async function getNextOrderValue(storyId: string, session?: ClientSession): Promise { @@ -105,7 +105,7 @@ export async function getSceneCount(userId: string, storyId: string): Promise { +export async function getAllScenesForStory(userId: string, storyId: string): Promise { await validateStoryOwnership(userId, storyId); const scenes = await SceneModel.find({ @@ -113,30 +113,43 @@ export async function getAllScenesForStory(userId: string, storyId: string): Pro userId, active: true, deletedAt: { $exists: false }, - }).sort({ order: 1 }); + }) + .populate('activeAssetId') + .sort({ order: 1 }); + + const resScenes = sanitizeScenesResponse(scenes); - return scenes; + return resScenes; } -export async function getAllInactiveScenesForStory(userId: string, storyId: string): Promise { +export async function getAllInactiveScenesForStory( + userId: string, + storyId: string +): Promise { await validateStoryOwnership(userId, storyId); const scenes = await SceneModel.find({ storyId, userId, active: false, deletedAt: { $exists: false }, - }).sort({ order: 1 }); - return scenes; + }) + .populate('activeAssetId') + .sort({ order: 1 }); + const resScenes = sanitizeScenesResponse(scenes); + return resScenes; } -export async function getAllDeletedScenes(userId: string, storyId: string): Promise { +export async function getAllDeletedScenes(userId: string, storyId: string): Promise { await validateStoryOwnership(userId, storyId); const scenes = await SceneModel.find({ storyId, userId, deletedAt: { $exists: true }, - }).sort({ order: 1 }); - return scenes; + }) + .populate('activeAssetId') + .sort({ order: 1 }); + const resScenes = sanitizeScenesResponse(scenes); + return resScenes; } export async function generateAllScenes(userId: string, storyId: string, total: number): Promise { @@ -221,6 +234,88 @@ export async function generateAllScenes(userId: string, storyId: string, total: }); } +export async function createScenesFromJSON( + userId: string, + storyId: string, + scenes: UploadSceneItemInput[] +): Promise { + return withTransaction(async (session) => { + await validateStoryOwnership(userId, storyId, session); + + if (!Array.isArray(scenes) || scenes.length === 0) { + throw new BadRequestError('Invalid scenes: expected a non-empty array'); + } + + const existing = await SceneModel.find( + { storyId, userId, deletedAt: { $exists: false } }, + { _id: 1 } + ).session(session); + + if (existing.length > 0) { + const deactivateOps = existing.map((doc, i) => ({ + updateOne: { + filter: { _id: doc._id }, + update: { + $set: { + active: false, + order: -(Date.now() * 1000 + i), + }, + }, + }, + })); + + await SceneModel.bulkWrite(deactivateOps, { session }); + } + + const scenesToCreate = scenes.map((scene, index) => ({ + userId, + storyId, + order: (index + 1) * SCENE_ORDER_GAP, + title: scene.title, + description: scene.description, + authorType: 'user' as const, + imagePrompt: scene.imagePrompt, + videoPrompt: scene.videoPrompt, + duration: scene.duration, + active: true, + })); + + const createdScenes = (await SceneModel.insertMany(scenesToCreate, { + session, + ordered: true, + })) as Scene[]; + + return createdScenes; + }); +} + +export async function uploadScenesJSONFromFile( + userId: string, + storyId: string, + fileSource: Buffer | string +): Promise { + let parsed: any; + + try { + const fileContent = + typeof fileSource === 'string' ? await fs.readFile(fileSource, 'utf-8') : fileSource.toString('utf-8'); + + if (!fileContent) { + throw new BadRequestError('Uploaded file is empty'); + } + + parsed = JSON.parse(fileContent); + } catch (err) { + throw new BadRequestError('Invalid JSON file format', err); + } + + if (!parsed || !Array.isArray(parsed.scenes)) { + throw new BadRequestError('Invalid JSON structure. Expected { scenes: [...] }'); + } + + return createScenesFromJSON(userId, storyId, parsed.scenes as UploadSceneItemInput[]); +} + export async function regenerateAllScenes( userId: string, storyId: string, diff --git a/src/modules/story/story.controller.ts b/src/modules/story/story.controller.ts index 1f32e7d..83e13e1 100644 --- a/src/modules/story/story.controller.ts +++ b/src/modules/story/story.controller.ts @@ -14,6 +14,7 @@ import { getProjectStories, getStoryById, getUserStories, + listStoryContextProfilesService, regenerateStory, restoreStory, setStoryContextService, @@ -29,19 +30,15 @@ import { UpdateStoryInput, WriteContentInput, } from '@validation/story.schema.js'; +import { sendSuccess, sendPaginated } from '@shared/response.js'; +import { ConflictError } from '@middleware/error/index.js'; export const getUserStoriesController = async (req: Request, res: Response) => { const userId = req.user!.id; const pagination = req?.pagination!; const sorting = req?.sorting!; const [stories, total] = await getUserStories(userId, pagination, sorting); - const paginationRes = paginationResponse(pagination, total as number); - return res.status(200).json({ - items: stories, - pagination: { - ...paginationRes, - }, - }); + return sendPaginated(res, stories as any[], paginationResponse(pagination, total as number), 'Stories retrieved successfully'); }; export const getUserDeletedStoriesController = async (req: Request, res: Response) => { @@ -49,13 +46,7 @@ export const getUserDeletedStoriesController = async (req: Request, res: Respons const pagination = req?.pagination!; const sorting = req?.sorting!; const [stories, total] = await getUserDeletedStories(userId, pagination, sorting); - const paginationRes = paginationResponse(pagination, total as number); - return res.status(200).json({ - items: stories, - pagination: { - ...paginationRes, - }, - }); + return sendPaginated(res, stories as any[], paginationResponse(pagination, total as number), 'Deleted stories retrieved successfully'); }; export const getUserArchivedStoriesController = async (req: Request, res: Response) => { @@ -63,13 +54,7 @@ export const getUserArchivedStoriesController = async (req: Request, res: Respon const pagination = req?.pagination!; const sorting = req?.sorting!; const [stories, total] = await getUserArchivedStories(userId, pagination, sorting); - const paginationRes = paginationResponse(pagination, total as number); - return res.status(200).json({ - items: stories, - pagination: { - ...paginationRes, - }, - }); + return sendPaginated(res, stories as any[], paginationResponse(pagination, total as number), 'Archived stories retrieved successfully'); }; export const getProjectStoriesController = async (req: Request, res: Response) => { @@ -78,13 +63,7 @@ export const getProjectStoriesController = async (req: Request, res: Response) = const pagination = req?.pagination!; const sorting = req?.sorting!; const [stories, total] = await getProjectStories(userId, projectId, pagination, sorting); - const paginationRes = paginationResponse(pagination, total as number); - return res.status(200).json({ - items: stories, - pagination: { - ...paginationRes, - }, - }); + return sendPaginated(res, stories as any[], paginationResponse(pagination, total as number), 'Project stories retrieved successfully'); }; export const getProjectDeletedStoriesController = async (req: Request, res: Response) => { @@ -93,13 +72,7 @@ export const getProjectDeletedStoriesController = async (req: Request, res: Resp const pagination = req?.pagination!; const sorting = req?.sorting!; const [stories, total] = await getProjectDeletedStories(userId, projectId, pagination, sorting); - const paginationRes = paginationResponse(pagination, total as number); - return res.status(200).json({ - items: stories, - pagination: { - ...paginationRes, - }, - }); + return sendPaginated(res, stories as any[], paginationResponse(pagination, total as number), 'Project deleted stories retrieved successfully'); }; export const getProjectArchivedStoriesController = async (req: Request, res: Response) => { @@ -108,35 +81,22 @@ export const getProjectArchivedStoriesController = async (req: Request, res: Res const pagination = req?.pagination!; const sorting = req?.sorting!; const [stories, total] = await getProjectArchivedStories(userId, projectId, pagination, sorting); - const paginationRes = paginationResponse(pagination, total as number); - return res.status(200).json({ - items: stories, - pagination: { - ...paginationRes, - }, - }); + return sendPaginated(res, stories as any[], paginationResponse(pagination, total as number), 'Project archived stories retrieved successfully'); }; export const createStoryController = async (req: Request, res: Response) => { const userId = req.user!.id; const projectId = req.params.projectId; const payload = req.validatedBody as CreateStoryInput; - const story = await createStory(userId, projectId, payload); - - return res.status(201).json({ - message: 'Story created successfully', - story, - }); + return sendSuccess(res, story, 'Story created successfully', 201); }; export const getStoryByIdController = async (req: Request, res: Response) => { const userId = req.user!.id; const storyId = req.params.storyId; const story = await getStoryById(userId, storyId); - return res.status(200).json({ - story, - }); + return sendSuccess(res, story, 'Story retrieved successfully'); }; export const addStoryContextController = async (req: Request, res: Response) => { @@ -144,141 +104,95 @@ export const addStoryContextController = async (req: Request, res: Response) => const storyId = req.params.storyId; const { context } = req.validatedBody as AddStoryContextInput; const result = await addStoryContextService(userId, storyId, context); - res.status(201).json({ - message: 'Story context profile added', - data: result, - }); + return sendSuccess(res, result, 'Story context profile added', 201); +}; + +export const listStoryContextProfilesController = async (req: Request, res: Response) => { + const userId = req.user!.id; + const storyId = req.params.storyId; + const contexts = await listStoryContextProfilesService(userId, storyId); + return sendSuccess(res, contexts, 'Story context profiles retrieved successfully'); }; export async function setStoryContextController(req: Request, res: Response) { const userId = req.user!.id; const payload = req.validatedBody as SetStoryContextInput; - const result = await setStoryContextService(userId, req.params.storyId, payload); - - res.status(200).json({ - message: 'Story context updated', - data: result, - }); + return sendSuccess(res, result, 'Story context updated'); } export const writeContentController = async (req: Request, res: Response) => { const userId = req.user!.id; const storyId = req.params.storyId; const payload = req.validatedBody as WriteContentInput; - const story = await writeContent(userId, storyId, payload); - return res.status(200).json({ - message: 'Content added successfully', - data: story, - }); + return sendSuccess(res, story, 'Content added successfully'); }; export const generateStoryController = async (req: Request, res: Response) => { const userId = req.user!.id; const storyId = req.params.storyId; - const response = await generateStory(userId, storyId); - return res.status(200).json({ - message: 'Story generated successfully', - data: response, - }); + return sendSuccess(res, response, 'Story generated successfully'); }; export const regenerateStoryController = async (req: Request, res: Response) => { const userId = req.user!.id; const storyId = req.params.storyId; const extraPrompt = req.validatedBody as RegenerateStoryInput; - const story = await regenerateStory(userId, storyId, extraPrompt); - - return res.status(200).json({ - message: 'Story regeneration initiated', - data: story, - }); + return sendSuccess(res, story, 'Story regeneration initiated'); }; export const updateStoryController = async (req: Request, res: Response) => { const userId = req.user!.id; const storyId = req.params.storyId; const payload = req.validatedBody as UpdateStoryInput; - const story = await updateStory(userId, storyId, payload); - - return res.status(200).json({ - message: 'Story updated successfully', - story, - }); + return sendSuccess(res, story, 'Story updated successfully'); }; export const softdeleteStoryController = async (req: Request, res: Response) => { const userId = req.user!.id; const storyId = req.params.storyId; - const response = await softdeleteStory(userId, storyId); if (!response) { - return res.status(409).json({ - message: 'Story could not be deleted', - }); + throw new ConflictError('Story could not be deleted'); } - return res.status(200).json({ - message: 'Story deleted successfully', - data: { deleted: response }, - }); + return sendSuccess(res, { deleted: response }, 'Story deleted successfully'); }; export const permanentDeleteStoryController = async (req: Request, res: Response) => { const userId = req.user!.id; const storyId = req.params.storyId; - const response = await permanentDeleteStory(userId, storyId); if (!response) { - return res.status(409).json({ - message: 'Story could not be deleted', - }); + throw new ConflictError('Story could not be permanently deleted'); } - return res.status(200).json({ - message: 'Story deleted successfully', - data: { deleted: response }, - }); + return sendSuccess(res, { deleted: response }, 'Story permanently deleted successfully'); }; export const restoreStoryController = async (req: Request, res: Response) => { const userId = req.user!.id; const storyId = req.params.storyId; - const story = await restoreStory(userId, storyId); - return res.status(200).json({ - message: 'Story restored successfully', - data: story, - }); + return sendSuccess(res, story, 'Story restored successfully'); }; export const archiveStoryStatusController = async (req: Request, res: Response) => { const userId = req.user!.id; const storyId = req.params.storyId; - const response = await archiveStory(userId, storyId); - return res.status(200).json({ - message: 'Story archived successfully', - story: response, - }); + return sendSuccess(res, response, 'Story archived successfully'); }; export const unarchiveStoryController = async (req: Request, res: Response) => { const userId = req.user!.id; const storyId = req.params.storyId; - const response = await unarchiveStory(userId, storyId); - return res.status(200).json({ - message: 'Story unarchived successfully', - ...response, - }); + return sendSuccess(res, response, 'Story unarchived successfully'); }; -export const rollbackStoryController = async (req: Request, res: Response) => { - const userId = req.user!.id; - const storyId = req.params.storyId; - +export const rollbackStoryController = async (_req: Request, _res: Response) => { // to be implemented }; diff --git a/src/modules/story/story.private.routes.ts b/src/modules/story/story.private.routes.ts index e1c429b..ee5c38c 100644 --- a/src/modules/story/story.private.routes.ts +++ b/src/modules/story/story.private.routes.ts @@ -19,6 +19,7 @@ import { writeContentController, setStoryContextController, addStoryContextController, + listStoryContextProfilesController, } from './story.controller.js'; import { paginationAndSortingMiddleware } from '@middleware/request/paginationAndSorting.js'; import { asyncHandler } from '@utils/asyncHandler.js'; @@ -67,6 +68,11 @@ router.post( asyncHandler(createStoryController) ); router.get('/:storyId', validateParams(storyIdParamSchema), asyncHandler(getStoryByIdController)); +router.get( + '/:storyId/context-profiles', + validateParams(storyIdParamSchema), + asyncHandler(listStoryContextProfilesController) +); router.post( '/:storyId/context-profile', validateBody(addStoryContextSchema), diff --git a/src/modules/story/story.service.ts b/src/modules/story/story.service.ts index fd72b0d..0d58e01 100644 --- a/src/modules/story/story.service.ts +++ b/src/modules/story/story.service.ts @@ -9,11 +9,11 @@ import { RegenerateStoryInput, SetStoryContextInput, } from '@validation/story.schema.js'; -import { NARRATION_PROFILES } from 'constants/narrationProfiles.js'; -import { openRouterAI } from 'libs/ai/clients/openAI.js'; +import { NARRATION_PROFILES } from '@constants/narrationProfiles.js'; +import { openRouterAI } from '@libs/ai/clients/openAI.js'; import { generateStoryPrompt } from '@libs/ai/prompts/generateStoryPrompt.js'; -import { generateStoryRegenerationPrompt } from 'libs/ai/prompts/generateStoryRegenerationPrompt.js'; -import { Pagination, Sorting } from 'types/Pagination.js'; +import { generateStoryRegenerationPrompt } from '@libs/ai/prompts/generateStoryRegenerationPrompt.js'; +import type { Pagination, Sorting } from '@app-types/Pagination.js'; import { isSameContextContract } from 'domain/policies/isSameContextContract.js'; import { validateStoryOwnership } from 'validators/validateStoryOwnership.js'; import { withTransaction } from '@db/withTransaction.js'; @@ -23,6 +23,7 @@ import { assertStoryNotDeleted, } from 'domain/assertions/assertStoryState.js'; import { consumeCredits } from '@modules/credit/credit.service.js'; +import { sanitizeStoryResponse, sanitizeStoriesResponse } from '@utils/sanitizers/sanitizeStoryResponse.js'; export async function getUserStories(userId: string, pagination: Pagination, sorting: Sorting) { const [stories, total] = await Promise.all([ @@ -168,6 +169,7 @@ export async function addStoryContextService( { userId, projectId: story.projectId, + storyId: story._id, name: context.name, description: context.description, genre: context.genre, @@ -204,6 +206,11 @@ export async function addStoryContextService( }); } +export async function listStoryContextProfilesService(userId: string, storyId: string) { + const story = await validateStoryOwnership(userId, storyId); + return ContextProfileModel.find({ storyId: story._id, userId }).sort({ createdAt: -1 }); +} + export async function setStoryContextService(userId: string, storyId: string, payload: SetStoryContextInput) { return withTransaction(async (session) => { const story = await validateStoryOwnership(userId, storyId, session); @@ -308,7 +315,6 @@ export async function generateStory(userId: string, storyId: string) { const story = await validateStoryOwnership(userId, storyId, session); const contextProfile = await ContextProfileModel.findById(story.contextProfileId).session(session); - console.log(userId) const prompt = generateStoryPrompt({ title: story.title, description: story.description, diff --git a/src/modules/user/user.controller.ts b/src/modules/user/user.controller.ts index 23fd8d7..a5ce712 100644 --- a/src/modules/user/user.controller.ts +++ b/src/modules/user/user.controller.ts @@ -6,8 +6,8 @@ import { UpdatePasswordType, UpdatePrivacySettingsType, UpdateProfileType, -} from "@validation/user.schema.js"; -import type { NextFunction, Request, Response } from "express"; +} from '@validation/user.schema.js'; +import type { Request, Response } from 'express'; import { deactivateAccount, deleteAccount, @@ -26,176 +26,124 @@ import { updatePassword, updatePrivacySettings, updateProfile, -} from "./user.service.js"; +} from './user.service.js'; +import { sendSuccess } from '@shared/response.js'; +import { BadRequestError } from '@middleware/error/index.js'; export const getProfileController = async (req: Request, res: Response) => { const userId = req.user!.id; const user = await getProfile(userId); - return res.status(200).json({ - id: user._id, - email: user.email, - username: user.username, - displayName: user.displayName, - avatarUrl: user.avatarUrl, - bio: user.bio, - plan: user.currentPlan, - emailVerified: user.emailVerified, - links: user.links, - usage: user.usage, - }); + return sendSuccess(res, user, 'Profile retrieved successfully'); }; export const updateProfileController = async (req: Request, res: Response) => { const userId = req.user!.id; const updateData = req.validatedBody as UpdateProfileType; - const updatedUser = await updateProfile(userId, updateData); - return res.status(200).json(updatedUser); + return sendSuccess(res, updatedUser, 'Profile updated successfully'); }; export const updateAvatarController = async (req: Request, res: Response) => { const userId = req.user!.id; const avatarData = req.file; const updatedUser = await updateAvatar(userId, avatarData); - return res.status(200).json(updatedUser); + return sendSuccess(res, updatedUser, 'Avatar updated successfully'); }; -export const deleteAvatarController = async ( - req: Request, - res: Response, - next: NextFunction -) => { +export const deleteAvatarController = async (req: Request, res: Response) => { const userId = req.user!.id; await deleteAvatar(userId); - return res.status(204).send({ - message: "Avatar deleted successfully", - }); + return sendSuccess(res, null, 'Avatar deleted successfully'); }; export const getSettingsController = async (req: Request, res: Response) => { const userId = req.user!.id; const user = await getSettings(userId); - return res.status(200).json(user); + return sendSuccess(res, user, 'Settings retrieved successfully'); }; export const getSecurityController = async (req: Request, res: Response) => { const userId = req.user!.id; const user = await getSecurity(userId); - return res.status(200).json(user); + return sendSuccess(res, user, 'Security info retrieved successfully'); }; export const getSessionsController = async (req: Request, res: Response) => { const userId = req.user!.id; const sessionId = req.sessionId!; const sessions = await getSessions(userId, sessionId); - return res.status(200).json(sessions); + return sendSuccess(res, sessions, 'Sessions retrieved successfully'); }; export const getBillingController = async (req: Request, res: Response) => { const userId = req.user!.id; const billingInfo = await getBilling(userId); - return res.status(200).json(billingInfo); + return sendSuccess(res, billingInfo, 'Billing info retrieved successfully'); }; -export const updateNotificationsController = async ( - req: Request, - res: Response -) => { +export const updateNotificationsController = async (req: Request, res: Response) => { const userId = req.user!.id; const notificationPrefs = req.validatedBody as UpdateNotificationsType; - const updatedUser = await updateNotifications(userId, notificationPrefs); - return res.status(200).json({ - id: updatedUser._id, - notificationPrefs: updatedUser.notificationPrefs, - }); + return sendSuccess(res, updatedUser, 'Notification preferences updated successfully'); }; -export const updatePrivacySettingsController = async ( - req: Request, - res: Response -) => { +export const updatePrivacySettingsController = async (req: Request, res: Response) => { const userId = req.user!.id; const privacyPrefs = req.validatedBody as UpdatePrivacySettingsType; const updatedUser = await updatePrivacySettings(userId, privacyPrefs); - return res.status(200).json({ - id: updatedUser._id, - privacyPrefs: updatedUser.privacyPrefs, - }); + return sendSuccess(res, updatedUser, 'Privacy settings updated successfully'); }; export const updatePasswordController = async (req: Request, res: Response) => { const userId = req.user!.id; - const { currentPassword, newPassword } = - req.validatedBody as UpdatePasswordType; - - // TODO : Ask user if wanted to remove all sessions except current + const { currentPassword, newPassword } = req.validatedBody as UpdatePasswordType; await updatePassword(userId, currentPassword, newPassword); - return res.status(200).json({ - message: "Password updated successfully", - }); + return sendSuccess(res, null, 'Password updated successfully'); }; export const updateEmailController = async (req: Request, res: Response) => { const userId = req.user!.id; const { newEmail } = req.validatedBody as UpdateEmailType; - await updateEmail(userId, newEmail); - return res.status(200).json({ - message: "Email update initiated. Please verify your new email address.", - }); + return sendSuccess(res, null, 'Email update initiated. Please verify your new email address.'); }; export const deleteSessionController = async (req: Request, res: Response) => { const userId = req.user!.id; const { sessionId } = req.validatedParams as DeleteSessionParamsType; const currentSession = req.sessionId!; + if (currentSession === sessionId) { - return res - .status(400) - .json({ message: "Cannot delete current active session" }); + throw new BadRequestError('Cannot delete current active session'); } + await deleteSession(userId, sessionId); - return res.status(204).json(); + return sendSuccess(res, null, 'Session deleted successfully'); }; -export const deleteAllSessionsController = async ( - req: Request, - res: Response -) => { +export const deleteAllSessionsController = async (req: Request, res: Response) => { const { removeCurrent } = req.validatedBody as DeleteAllSessionsType; const userId = req.user!.id; const currentSession = req.sessionId!; await deleteAllSessions(userId, currentSession, removeCurrent); - return res.status(204).json(); + return sendSuccess(res, null, 'All sessions deleted successfully'); }; -export const deactivateAccountController = async ( - req: Request, - res: Response -) => { +export const deactivateAccountController = async (req: Request, res: Response) => { const userId = req.user!.id; await deactivateAccount(userId); - - return res.status(200).json({ - message: "Account deactivated successfully", - }); + return sendSuccess(res, null, 'Account deactivated successfully'); }; -export const reactivateAccountController = async ( - req: Request, - res: Response -) => { +export const reactivateAccountController = async (req: Request, res: Response) => { const userId = req.user!.id; const updatedUser = await reactivateAccount(userId); - return res.status(200).json({ - user: updatedUser, - message: "Account reactivated successfully", - }); + return sendSuccess(res, updatedUser, 'Account reactivated successfully'); }; export const deleteAccountController = async (req: Request, res: Response) => { const userId = req.user!.id; await deleteAccount(userId); - return res.status(204).json(); + return sendSuccess(res, null, 'Account deleted successfully'); }; diff --git a/src/modules/user/user.service.ts b/src/modules/user/user.service.ts index e58b81e..cf22c93 100644 --- a/src/modules/user/user.service.ts +++ b/src/modules/user/user.service.ts @@ -8,23 +8,24 @@ import { } from '@middleware/error/index.js'; import { SessionModel } from '@models/Session.js'; import { type User, UserModel } from '@models/User.js'; -import { sanitizeUserResponse } from '@utils/sanitizeUserResponse.js'; +import { sanitizeUserResponse } from '@utils/sanitizers/sanitizeUserResponse.js'; import { UpdateNotificationsType, UpdatePrivacySettingsType } from '@validation/user.schema.js'; import { generateVerificationToken } from '@utils/tokens.js'; import sendUpdateEmailLink from '@utils/emails/sender/sendUpdateEmailLink.js'; import sendOldEmailVerificationForEmailUpdate from '@utils/emails/sender/sendOldEmailVerificationForEmailUpdate.js'; import { withTransaction } from '@db/withTransaction.js'; +import { deleteFile, uploadFile } from '@libs/aws/s3.js'; -export const getProfile = async (userId: string): Promise => { - const user = await UserModel.findById(userId) - .select('-passwordHash -emailVerificationToken -resetPasswordToken -createdAt -updatedAt') - .catch((err) => { - throw new InternalServerError('Could not fetch user profile', err.message); - }); +export const getProfile = async (userId: string): Promise> => { + const user = await UserModel.findById(userId).catch((err) => { + throw new InternalServerError('Could not fetch user profile', err.message); + }); if (!user) { throw new NotFoundError('User not found'); } - return user; + + const resUser = sanitizeUserResponse(user, 'profile'); + return resUser; }; export const updateProfile = async (userId: string, updateData: Partial): Promise> => { @@ -46,12 +47,27 @@ export const updateAvatar = async ( if (!avatarData) { throw new BadRequestError('Avatar file not found'); } - const { filename, path } = avatarData; + const { buffer, mimetype } = avatarData; + + const existingUser = await UserModel.findById(userId); + + if (!existingUser) { + throw new NotFoundError('User not found'); + } + + const key = `avatars/${userId}/${Date.now()}`; + + const avatarUrl = await uploadFile({ + buffer, + key, + contentType: mimetype, + }); - //TODO: Add logic to move the file from temp to cloud storage like s3 or similar - // For now, we will just use the filename as is - const avatarUrl = `${path}/${filename}`; + if (existingUser.avatarUrl) { + const oldKey = existingUser.avatarUrl.replace(`${process.env.CDN_URL}/`, ''); + await deleteFile(oldKey); + } const user = await UserModel.findByIdAndUpdate(userId, { avatarUrl: avatarUrl }, { new: true }); if (!user) { throw new NotFoundError('User not found'); @@ -67,16 +83,14 @@ export const deleteAvatar = async (userId: string): Promise => { } const oldAvatarUrl = user.avatarUrl; - /** TODO: - * Retrieves the current avatar URL from the user object before updating it. - * This variable stores the old avatar URL to enable cleanup of the previous avatar file - * from cloud storage if a new avatar is uploaded during the update process. - * If no avatar currently exists, this will be undefined or null, and the cleanup step should be skipped. - */ if (!oldAvatarUrl) { return; } + deleteFile(oldAvatarUrl.replace(`${process.env.CDN_URL}/`, '')).catch((err) => { + console.error('Failed to delete old avatar from S3', oldAvatarUrl, err); + }); + await UserModel.findByIdAndUpdate(userId, { $unset: { avatarUrl: '' } }, { new: true }); return; }; diff --git a/src/routes/api.ts b/src/routes/api.ts index 0096905..e4b5248 100644 --- a/src/routes/api.ts +++ b/src/routes/api.ts @@ -8,14 +8,15 @@ import { default as contextProfileRouter } from '@modules/contextProfile/context import { default as scenesRouter } from '@modules/scenes/scenes.private.routes.js'; import { default as narrationRouter } from '@modules/narration/narration.routes.js'; import { default as sceneAssetsRouter } from '@modules/sceneAssets/sceneAssets.private.routes.js'; +import { default as audioRouter } from '@modules/audio/audio.routes.js'; import { csrfMiddleware } from '@middleware/security/requireCsrf.js'; import { requireActiveAccount } from '@middleware/security/requireActiveAccount.js'; const apiRouter = Router(); -// private routes apiRouter.use('/auth', authRouter); +// private routes apiRouter.use(authMiddleware, csrfMiddleware); apiRouter.use('/user', userRouter); apiRouter.use(requireActiveAccount); @@ -25,5 +26,6 @@ apiRouter.use('/context-profiles', contextProfileRouter); apiRouter.use('/scenes', scenesRouter); apiRouter.use('/assets', sceneAssetsRouter); apiRouter.use('/narrations', narrationRouter); +apiRouter.use('/audio', audioRouter); export default apiRouter; diff --git a/src/routes/index.ts b/src/routes/index.ts index 3b66256..9df1c40 100644 --- a/src/routes/index.ts +++ b/src/routes/index.ts @@ -23,10 +23,14 @@ AppRouter.use((_req, res, next) => { res.setHeader('X-Debug-Server', process.pid.toString()); next(); }); +AppRouter.use((_req, res, next) => { + res.setHeader('Cache-Control', 'no-store'); + next(); +}); // Health route AppRouter.get('/health', (_req: Request, res: Response) => { - res.status(200).json({ status: 'ok' }); + res.status(200).json({ message: 'Server is healthy', data: { status: 'ok' } }); }); AppRouter.use('/api', apiRouter); diff --git a/src/server.ts b/src/server.ts index 66481a0..1a1ad43 100644 --- a/src/server.ts +++ b/src/server.ts @@ -15,8 +15,7 @@ app.use( app.use(AppRouter); const startServer = async () => { - try { - // Wait for DB first + try { await connectDB(); app.listen(process.env.PORT, () => { console.log(`🚀 Server running on port ${process.env.PORT}`); @@ -25,7 +24,7 @@ const startServer = async () => { } catch (error) { const message = error instanceof Error ? error.message : String(error); console.error("❌ Failed to start server:", message); - process.exit(1); // stop app + process.exit(1); } }; diff --git a/src/shared/index.ts b/src/shared/index.ts new file mode 100644 index 0000000..0791ae8 --- /dev/null +++ b/src/shared/index.ts @@ -0,0 +1,2 @@ +export { sendSuccess, sendPaginated } from './response.js'; +export type { ApiResponse, PaginatedApiResponse } from './response.js'; diff --git a/src/shared/response.ts b/src/shared/response.ts new file mode 100644 index 0000000..05ec04e --- /dev/null +++ b/src/shared/response.ts @@ -0,0 +1,81 @@ +import type { Response } from 'express'; + +export interface ApiResponse { + message: string; + data: T; +} + +export interface PaginatedApiResponse extends ApiResponse { + pagination: { + page: number; + limit: number; + total: number; + totalPages: number; + hasNext: boolean; + hasPrev: boolean; + }; +} + +export function sanitizeResponseData(data: any): any { + if (data === null || data === undefined) { + return data; + } + + if (Array.isArray(data)) { + return data.map((item) => sanitizeResponseData(item)); + } + + if (data instanceof Date) { + return data; + } + + if (typeof data === 'object') { + if (typeof data.toHexString === 'function') { + return data.toString(); + } + + const plainObj = typeof data.toJSON === 'function' ? data.toJSON() : data; + + if (typeof plainObj !== 'object' || plainObj === null || plainObj instanceof Date) { + return plainObj; + } + + const sanitizedObj: any = {}; + + for (const [key, value] of Object.entries(plainObj)) { + if (key === '_id') { + continue; + } + if (key === '__v') { + continue; + } + sanitizedObj[key] = sanitizeResponseData(value); + } + + if ('_id' in plainObj && !('id' in plainObj)) { + sanitizedObj.id = sanitizeResponseData(plainObj._id); + } + + return sanitizedObj; + } + + return data; +} + +export function sendSuccess(res: Response, data: T, message = 'Success', status = 200): Response { + const sanitizedData = sanitizeResponseData(data); + const body: ApiResponse = { message, data: sanitizedData as T }; + return res.status(status).json(body); +} + +export function sendPaginated( + res: Response, + data: T[], + pagination: PaginatedApiResponse['pagination'], + message = 'Success', + status = 200 +): Response { + const sanitizedData = sanitizeResponseData(data); + const body: PaginatedApiResponse = { message, data: sanitizedData as T[], pagination }; + return res.status(status).json(body); +} diff --git a/src/types/Audio.ts b/src/types/Audio.ts new file mode 100644 index 0000000..e41e111 --- /dev/null +++ b/src/types/Audio.ts @@ -0,0 +1,18 @@ +// ── AudioAsset sanitized response ───────────────────────────────────────────── + +export interface SanitizedAudioAsset { + id: string; + narrationId?: string; + type: 'narration' | 'background' | 'effect'; + url: string; + prompt?: string; + generationSource: 'ai' | 'user'; + status: string; + voiceId?: string; + duration?: number; + version?: number; + isActive: boolean; + deletedAt?: string; + createdAt: string; + updatedAt: string; +} diff --git a/src/types/Auth.ts b/src/types/Auth.ts new file mode 100644 index 0000000..c265e71 --- /dev/null +++ b/src/types/Auth.ts @@ -0,0 +1,23 @@ +// ── Auth response types ─────────────────────────────────────────────────────── + +/** Safe user shape returned to controllers after register/login. Never includes _id. */ +export type SignOutput = { + user: { + email: string; + username: string; + displayName?: string | null; + avatarUrl?: string | null; + accountStatus: string; + }; + tokens: { + accessToken: string; + refreshToken: string; + csrfToken: string; + }; +}; + +export interface RefreshTokenOutput { + accessToken: string; + refreshToken: string; + csrfToken: string; +} diff --git a/src/types/ContextProfile.ts b/src/types/ContextProfile.ts new file mode 100644 index 0000000..1737cbf --- /dev/null +++ b/src/types/ContextProfile.ts @@ -0,0 +1,21 @@ +// ── ContextProfile sanitized response ───────────────────────────────────────── + +export interface SanitizedContextProfile { + id: string; + name: string; + description?: string; + scope: string; + genre: string; + mood: string; + style: string; + narrativeScope?: string; + environment: unknown; + worldRules?: string; + narrativeConstraints?: string; + characters?: unknown[]; + forbiddenElements?: unknown[]; + isDefaultForProject: boolean; + lastUsedAt?: Date; + createdAt: Date; + updatedAt: Date; +} diff --git a/src/types/Error.ts b/src/types/Error.ts new file mode 100644 index 0000000..6715a3f --- /dev/null +++ b/src/types/Error.ts @@ -0,0 +1 @@ +export type { ErrorCode } from '@middleware/error/errorCodes.js'; diff --git a/src/types/Project.ts b/src/types/Project.ts new file mode 100644 index 0000000..58ab2aa --- /dev/null +++ b/src/types/Project.ts @@ -0,0 +1,21 @@ +// ── Project status ──────────────────────────────────────────────────────────── + +export type ProjectStatus = 'draft' | 'active' | 'archive' | 'delete'; +export type TransitionableManyProjectStatus = ProjectStatus[]; + +// ── Sanitized response shapes ───────────────────────────────────────────────── + +export interface SanitizedProjectList { + id: string; + title: string; + description?: string; + visibility: string; + status: string; + createdAt: Date; + updatedAt: Date; +} + +export interface SanitizedProjectDetail extends SanitizedProjectList { + defaultContextProfileId?: unknown; + generationCounts?: unknown; +} diff --git a/src/types/Scene.ts b/src/types/Scene.ts new file mode 100644 index 0000000..d42a3f2 --- /dev/null +++ b/src/types/Scene.ts @@ -0,0 +1,33 @@ +// ── Scene generation modes ──────────────────────────────────────────────────── + +export type SingleSceneMode = 'generate' | 'variation' | 'regenerate'; +export type BatchSceneMode = 'generate' | 'regenerate'; + +// ── Sanitized response shape ────────────────────────────────────────────────── + +export interface SanitizedScene { + id: string; + storyId: string; + order: number; + title?: string; + description: string; + status: 'not-generated' | 'generating' | 'ready' | 'error'; + narrativeRole: 'intro' | 'transition' | 'climax' | 'outro' | 'standard'; + authorType: 'ai' | 'user'; + duration?: number; + active: boolean; + deletedAt?: string; + createdAt: string; + updatedAt: string; + activeAsset: { + id: string; + type: 'image' | 'video'; + url: string; + thumbnailUrl?: string; + duration?: number; + status: 'not-generated' | 'generating' | 'ready' | 'error'; + format: string | undefined; + width?: number; + height?: number; + } | null; +} diff --git a/src/types/SceneAsset.ts b/src/types/SceneAsset.ts new file mode 100644 index 0000000..9e5da21 --- /dev/null +++ b/src/types/SceneAsset.ts @@ -0,0 +1,23 @@ +import type { AssetFormat } from '@constants/sceneAssetConsts.js'; + +// ── SceneAsset sanitized response ───────────────────────────────────────────── + +export interface SanitizedSceneAsset { + id: string; + sceneId: string; + type: 'image' | 'video'; + url: string; + thumbnailUrl?: string; + visibility: 'private' | 'public'; + status: 'not-generated' | 'generating' | 'ready' | 'error'; + prompt?: string; + generationSource: 'ai' | 'user'; + version: number; + format?: AssetFormat; + width?: number; + height?: number; + duration?: number; + deletedAt?: string; + createdAt: string; + updatedAt: string; +} diff --git a/src/types/Story.ts b/src/types/Story.ts new file mode 100644 index 0000000..e052356 --- /dev/null +++ b/src/types/Story.ts @@ -0,0 +1,23 @@ +// ── Story sanitized response ────────────────────────────────────────────────── + +export interface SanitizedStory { + id: string; + projectId?: string; + contextProfileId?: string | null; + title: string; + description?: string; + platform?: string; + intent?: string; + timeLimit?: number; + status: string; + content?: { + body?: string; + summary?: string; + keywords?: string[]; + tags?: string[]; + authorType?: 'ai' | 'user'; + contentStatus?: string; + }; + createdAt: Date; + updatedAt: Date; +} diff --git a/src/types/express.d.ts b/src/types/express.d.ts index d2b67e1..1c2e7c5 100644 --- a/src/types/express.d.ts +++ b/src/types/express.d.ts @@ -1,6 +1,6 @@ -import { type User } from '@models/User.ts'; // whatever your user type is +import { type User } from '@models/User.js'; import type { Pagination, Sorting } from '@middleware/request/paginationAndSorting.js'; -import { type AccountStatus, Role } from '@constants/userConsts.ts'; +import { type AccountStatus, Role } from '@constants/userConsts.js'; type AuthenticatedUser = { id: string; diff --git a/src/types/index.ts b/src/types/index.ts index c27e895..e69e3a1 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,3 +1,27 @@ +// ── Shared application types ────────────────────────────────────────────────── +// Central barrel — import app types from here or from their specific file. + +export type { SignOutput, RefreshTokenOutput } from './Auth.js'; + +export type { + ProjectStatus, + TransitionableManyProjectStatus, + SanitizedProjectList, + SanitizedProjectDetail, +} from './Project.js'; + +export type { SanitizedStory } from './Story.js'; + +export type { SingleSceneMode, BatchSceneMode, SanitizedScene } from './Scene.js'; + +export type { SanitizedSceneAsset } from './SceneAsset.js'; + +export type { SanitizedAudioAsset } from './Audio.js'; + +export type { SanitizedContextProfile } from './ContextProfile.js'; + +export type { ErrorCode } from './Error.js'; + export type StoryContent = { summary?: string; body?: string; @@ -5,8 +29,6 @@ export type StoryContent = { tags?: string[]; }; -export type Plan = 'free' | 'pro_basic' | 'pro_standard' | 'premium_standard' | 'premium_best'; - export type AIMode = | 'story' | 'scenes' @@ -16,3 +38,7 @@ export type AIMode = | 'image_image' | 'video_image' | 'video_text'; + +export type Plan = 'free' | 'pro_basic' | 'pro_standard' | 'premium_standard' | 'premium_best'; + +export type UserReturnType = 'profile' | 'settings' | 'security' | 'billing' | 'account'; diff --git a/src/utils/file.ts b/src/utils/file.ts new file mode 100644 index 0000000..efeed18 --- /dev/null +++ b/src/utils/file.ts @@ -0,0 +1,9 @@ +import fs from 'fs/promises'; + +export async function removeTempFile(path: string) { + try { + await fs.unlink(path); + } catch (err) { + console.error('Temp file cleanup failed:', err); + } +} diff --git a/src/utils/getVideoDuration.ts b/src/utils/getVideoDuration.ts index bd2102e..bf10432 100644 --- a/src/utils/getVideoDuration.ts +++ b/src/utils/getVideoDuration.ts @@ -1,7 +1,7 @@ import { InternalServerError } from '@middleware/error/index.js'; import ffmpeg from 'fluent-ffmpeg'; -export function getVideoDuration(filePath: string): Promise { +export function getVideoDuration(filePath: string): Promise { return new Promise((resolve, reject) => { ffmpeg.ffprobe(filePath, (err, metadata) => { if (err) { diff --git a/src/utils/logger.ts b/src/utils/logger.ts index b36a398..f89ece1 100644 --- a/src/utils/logger.ts +++ b/src/utils/logger.ts @@ -1,6 +1,6 @@ import pino from "pino"; -const isProduction = process.env.NODE_ENV === "production"; +const isProduction = process.env.NODE_ENV !== "development"; const logger = pino({ level: process.env.LOG_LEVEL || "info", diff --git a/src/utils/paginationResponse.ts b/src/utils/paginationResponse.ts index 73aa1a8..82b5fa9 100644 --- a/src/utils/paginationResponse.ts +++ b/src/utils/paginationResponse.ts @@ -1,4 +1,4 @@ -import { Pagination } from 'types/Pagination.js'; +import type { Pagination } from '@app-types/Pagination.js'; export function paginationResponse(pagination: Pagination, totalItems: number) { return { diff --git a/src/utils/sanitizeProjectResponse.ts b/src/utils/sanitizeProjectResponse.ts deleted file mode 100644 index a4870f6..0000000 --- a/src/utils/sanitizeProjectResponse.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { Project } from '@models/Project.js'; - -interface ProjectResponse { - project: Project; - type: 'getProjects' | 'getProjectById'; -} - -const sanitizeProjectResponse = ({ project, type = 'getProjectById' }: ProjectResponse) => { - switch (type) { - case 'getProjects': - return { - _id: project._id, - title: project.title, - description: project.description, - visibility: project.visibility, - status: project.status, - createdAt: project.createdAt, - updatedAt: project.updatedAt, - }; - case 'getProjectById': - return { - _id: project._id, - title: project.title, - description: project.description, - visibility: project.visibility, - status: project.status, - defaultContextProfileId: project.defaultContextProfileId, - contextProfileId: project.defaultContextProfileId, - generationCounts: project.generationCounts, - createdAt: project.createdAt, - updatedAt: project.updatedAt, - }; - default: - return project; - } -}; - -const sanitizeProjects = (projects: Project[]) => { - return projects.map((project) => sanitizeProjectResponse({ project, type: 'getProjects' })); -}; - -export { sanitizeProjectResponse, sanitizeProjects }; diff --git a/src/utils/sanitizers/index.ts b/src/utils/sanitizers/index.ts new file mode 100644 index 0000000..e94fc74 --- /dev/null +++ b/src/utils/sanitizers/index.ts @@ -0,0 +1,33 @@ +// Barrel export for all response sanitizers + +export { sanitizeUserResponse } from './sanitizeUserResponse.js'; +export type { UserReturnType } from '@app-types/index.js'; + +export { sanitizeProjectResponse, sanitizeProjects } from './sanitizeProjectResponse.js'; +export type { SanitizedProjectList, SanitizedProjectDetail } from '@app-types/Project.js'; + +export { sanitizeScenesResponse } from './sanitizeScenesResponse.js'; +export type { SanitizedScene } from '@app-types/Scene.js'; + +export { sanitizeNarrationsResponse } from './sanitizeNarrationResponse.js'; + +export { + sanitizeContextProfileResponse, + sanitizeContextProfilesResponse, +} from './sanitizeContextProfileResponse.js'; +export type { SanitizedContextProfile } from '@app-types/ContextProfile.js'; + +export { sanitizeStoryResponse, sanitizeStoriesResponse } from './sanitizeStoryResponse.js'; +export type { SanitizedStory } from '@app-types/Story.js'; + +export { + sanitizeAudioAssetResponse, + sanitizeAudioAssetsResponse, +} from './sanitizeAudioAssetResponse.js'; +export type { SanitizedAudioAsset } from '@app-types/Audio.js'; + +export { + sanitizeSceneAssetResponse, + sanitizeSceneAssetsResponse, +} from './sanitizeSceneAssetResponse.js'; +export type { SanitizedSceneAsset } from '@app-types/SceneAsset.js'; diff --git a/src/utils/sanitizers/sanitizeAudioAssetResponse.ts b/src/utils/sanitizers/sanitizeAudioAssetResponse.ts new file mode 100644 index 0000000..d0ce6f2 --- /dev/null +++ b/src/utils/sanitizers/sanitizeAudioAssetResponse.ts @@ -0,0 +1,30 @@ +import type { SanitizedAudioAsset } from '@app-types/Audio.js'; +import type { AudioAsset } from '@models/AudioAsset.js'; + +export type { SanitizedAudioAsset }; + +/** + * Sanitizes an AudioAsset document — never exposes userId or storyId. + */ +export function sanitizeAudioAssetResponse(asset: AudioAsset): SanitizedAudioAsset { + return { + id: asset._id.toString(), + narrationId: asset.narrationId?.toString(), + type: asset.type, + url: asset.url, + prompt: asset.prompt, + generationSource: asset.generationSource, + status: asset.status, + voiceId: asset.voiceId, + duration: asset.duration, + version: asset.version, + isActive: asset.activeNarration ?? false, + deletedAt: asset.deletedAt?.toISOString(), + createdAt: asset.createdAt.toISOString(), + updatedAt: asset.updatedAt.toISOString(), + }; +} + +export function sanitizeAudioAssetsResponse(assets: AudioAsset[]): SanitizedAudioAsset[] { + return assets.map(sanitizeAudioAssetResponse); +} diff --git a/src/utils/sanitizers/sanitizeContextProfileResponse.ts b/src/utils/sanitizers/sanitizeContextProfileResponse.ts new file mode 100644 index 0000000..9fcaf4c --- /dev/null +++ b/src/utils/sanitizers/sanitizeContextProfileResponse.ts @@ -0,0 +1,35 @@ +import type { SanitizedContextProfile } from '@app-types/ContextProfile.js'; +import type { ContextProfile } from '@models/ContextProfile.js'; + +export type { SanitizedContextProfile }; + +/** + * Sanitizes a ContextProfile document — never exposes userId or projectId. + */ +export function sanitizeContextProfileResponse(context: ContextProfile): SanitizedContextProfile { + return { + id: context._id.toString(), + name: context.name, + description: context.description, + scope: context.scope, + genre: context.genre, + mood: context.mood, + style: context.style, + narrativeScope: context.narrativeScope, + environment: context.environment, + worldRules: context.worldRules, + narrativeConstraints: context.narrativeConstraints, + characters: context.characters, + forbiddenElements: context.forbiddenElements, + isDefaultForProject: context.isDefaultForProject ?? false, + lastUsedAt: context.lastUsedAt, + createdAt: context.createdAt, + updatedAt: context.updatedAt, + }; +} + +export function sanitizeContextProfilesResponse( + contexts: ContextProfile[] +): SanitizedContextProfile[] { + return contexts.map(sanitizeContextProfileResponse); +} diff --git a/src/utils/sanitizers/sanitizeNarrationResponse.ts b/src/utils/sanitizers/sanitizeNarrationResponse.ts new file mode 100644 index 0000000..a9bce6a --- /dev/null +++ b/src/utils/sanitizers/sanitizeNarrationResponse.ts @@ -0,0 +1,49 @@ +import { StoryNarration } from '@models/Narration.js'; +import { AudioAsset } from '@models/AudioAsset.js'; + +export function sanitizeNarrationsResponse(narrations: StoryNarration[]) { + return narrations.map((narration) => { + const audio = narration.activeAudioAssetId as unknown as AudioAsset | null; + + return { + id: narration._id.toString(), + storyId: narration.storyId.toString(), + + sceneOrder: narration.sceneOrder.map((id) => id.toString()), + sceneOrderHash: narration.sceneOrderHash, + + totalDuration: narration.totalDuration, + + narrationSegments: narration.narrationSegments.map((seg) => ({ + startTime: seg.startTime, + endTime: seg.endTime, + duration: seg.duration, + targetWordCount: seg.targetWordCount, + minWords: seg.minWords, + maxWords: seg.maxWords, + narration: seg.narration, + character: seg.character, + })), + + version: narration.version, + active: narration.active, + + status: narration.status, + source: narration.source, + + createdAt: narration.createdAt.toISOString(), + updatedAt: narration.updatedAt.toISOString(), + + activeAudioAsset: audio + ? { + id: audio._id.toString(), + url: audio.url, + status: audio.status, + duration: audio.duration, + voiceId: audio.voiceId, + type: audio.type, + } + : null, + }; + }); +} diff --git a/src/utils/sanitizers/sanitizeProjectResponse.ts b/src/utils/sanitizers/sanitizeProjectResponse.ts new file mode 100644 index 0000000..19d49f8 --- /dev/null +++ b/src/utils/sanitizers/sanitizeProjectResponse.ts @@ -0,0 +1,62 @@ +import type { SanitizedProjectList, SanitizedProjectDetail } from '@app-types/Project.js'; +import type { Project } from '@models/Project.js'; + +export type { SanitizedProjectList, SanitizedProjectDetail }; + +const sanitizeProjectResponse = ({ + project, + type = 'getProjectById', +}: { + project: Project; + type: 'getProjects' | 'getProjectById'; +}): SanitizedProjectList | SanitizedProjectDetail => { + switch (type) { + case 'getProjects': + return { + id: project._id.toString(), + title: project.title, + description: project.description, + visibility: project.visibility, + status: project.status, + createdAt: project.createdAt, + updatedAt: project.updatedAt, + }; + + case 'getProjectById': + return { + id: project._id.toString(), + title: project.title, + description: project.description, + visibility: project.visibility, + status: project.status, + defaultContextProfileId: project.defaultContextProfileId, + generationCounts: project.generationCounts, + createdAt: project.createdAt, + updatedAt: project.updatedAt, + }; + + default: + return { + id: project._id.toString(), + title: project.title, + description: project.description, + visibility: project.visibility, + status: project.status, + createdAt: project.createdAt, + updatedAt: project.updatedAt, + }; + } +}; + +const sanitizeProjects = (projects: Project[]): SanitizedProjectList[] => + projects.map((project) => ({ + id: project._id.toString(), + title: project.title, + description: project.description, + visibility: project.visibility, + status: project.status, + createdAt: project.createdAt, + updatedAt: project.updatedAt, + })); + +export { sanitizeProjectResponse, sanitizeProjects }; diff --git a/src/utils/sanitizers/sanitizeSceneAssetResponse.ts b/src/utils/sanitizers/sanitizeSceneAssetResponse.ts new file mode 100644 index 0000000..27f8277 --- /dev/null +++ b/src/utils/sanitizers/sanitizeSceneAssetResponse.ts @@ -0,0 +1,33 @@ +import type { SanitizedSceneAsset } from '@app-types/SceneAsset.js'; +import type { SceneAsset } from '@models/SceneAssets.js'; + +export type { SanitizedSceneAsset }; + +/** + * Sanitizes a SceneAsset document — never exposes userId. + */ +export function sanitizeSceneAssetResponse(asset: SceneAsset): SanitizedSceneAsset { + return { + id: asset._id.toString(), + sceneId: asset.sceneId.toString(), + type: asset.type, + url: asset.url, + thumbnailUrl: asset.thumbnailUrl, + visibility: asset.visibility, + status: asset.status, + prompt: asset.prompt, + generationSource: asset.generationSource, + version: asset.version, + format: asset.format, + width: asset.width, + height: asset.height, + duration: asset.duration, + deletedAt: asset.deletedAt?.toISOString(), + createdAt: asset.createdAt.toISOString(), + updatedAt: asset.updatedAt.toISOString(), + }; +} + +export function sanitizeSceneAssetsResponse(assets: SceneAsset[]): SanitizedSceneAsset[] { + return assets.map(sanitizeSceneAssetResponse); +} diff --git a/src/utils/sanitizers/sanitizeScenesResponse.ts b/src/utils/sanitizers/sanitizeScenesResponse.ts new file mode 100644 index 0000000..38ca706 --- /dev/null +++ b/src/utils/sanitizers/sanitizeScenesResponse.ts @@ -0,0 +1,49 @@ +import type { SanitizedScene } from '@app-types/Scene.js'; +import type { Scene } from '@models/Scene.js'; +import type { SceneAsset } from '@models/SceneAssets.js'; + +export type { SanitizedScene }; + +export function sanitizeScenesResponse(scenes: Scene[]): SanitizedScene[] { + return scenes.map((scene) => { + const asset = scene.activeAssetId as unknown as SceneAsset | null; + + return { + id: scene._id.toString(), + storyId: scene.storyId.toString(), + order: scene.order, + + title: scene.title, + description: scene.description, + imagePrompt: scene.imagePrompt, + videoPrompt: scene.videoPrompt, + + status: scene.status, + imageStatus: scene.status, // alias: same as status for backwards compat + narrativeRole: scene.narrativeRole, + authorType: scene.authorType, + + duration: scene.duration, + + active: scene.active, + deletedAt: scene.deletedAt?.toISOString(), + + createdAt: scene.createdAt.toISOString(), + updatedAt: scene.updatedAt.toISOString(), + + activeAsset: asset + ? { + id: asset._id.toString(), + type: asset.type, + url: asset.url, + thumbnailUrl: asset.thumbnailUrl, + duration: asset.duration, + status: asset.status, + format: asset.format, + width: asset.width, + height: asset.height, + } + : null, + }; + }); +} diff --git a/src/utils/sanitizers/sanitizeStoryResponse.ts b/src/utils/sanitizers/sanitizeStoryResponse.ts new file mode 100644 index 0000000..34ef648 --- /dev/null +++ b/src/utils/sanitizers/sanitizeStoryResponse.ts @@ -0,0 +1,37 @@ +import type { SanitizedStory } from '@app-types/Story.js'; +import type { Story } from '@models/Story.js'; + +export type { SanitizedStory }; + +/** + * Sanitizes a Story document — never exposes userId. + */ +export function sanitizeStoryResponse(story: Story): SanitizedStory { + return { + id: story._id.toString(), + projectId: story.projectId?.toString(), + contextProfileId: story.contextProfileId?.toString() ?? null, + title: story.title, + description: story.description, + platform: story.platform, + intent: story.intent, + timeLimit: story.timeLimit, + status: story.status, + content: story.content + ? { + body: story.content.body, + summary: story.content.summary, + keywords: story.content.keywords, + tags: story.content.tags, + authorType: story.content.authorType, + contentStatus: story.content.contentStatus, + } + : undefined, + createdAt: story.createdAt, + updatedAt: story.updatedAt, + }; +} + +export function sanitizeStoriesResponse(stories: Story[]): SanitizedStory[] { + return stories.map(sanitizeStoryResponse); +} diff --git a/src/utils/sanitizeUserResponse.ts b/src/utils/sanitizers/sanitizeUserResponse.ts similarity index 53% rename from src/utils/sanitizeUserResponse.ts rename to src/utils/sanitizers/sanitizeUserResponse.ts index e24ef54..cf1d3a1 100644 --- a/src/utils/sanitizeUserResponse.ts +++ b/src/utils/sanitizers/sanitizeUserResponse.ts @@ -1,36 +1,70 @@ import type { User } from '@models/User.js'; +import type { UserReturnType } from '@app-types/index.js'; -type UserReturnType = 'profile' | 'settings' | 'security' | 'billing' | 'account'; - +/** + * Sanitizes a User document before sending it to the frontend. + * Never exposes: userId (_id as raw ObjectId), passwordHash, passwordReset, + * emailVerification, pendingEmailChange, changeHistory, or any internal fields. + */ export const sanitizeUserResponse = (user: User, type: UserReturnType) => { switch (type) { case 'profile': return { - _id: user._id, + id: user._id.toString(), + email: user.email, username: user.username, - displayName: user.displayName, - avatarUrl: user.avatarUrl ?? null, + displayName: user.displayName ?? null, bio: user.bio ?? null, - links: user.links ?? {}, - plan: user.currentPlan, + avatarUrl: user.avatarUrl ?? null, + + role: user.role, + emailVerified: user.emailVerified, - usage: user.usage, + phoneVerified: user.phoneVerified, + twoFactorEnabled: user.twoFactorEnabled, + accountStatus: user.accountStatus, + billingStatus: user.billingStatus, + cancelAtPeriodEnd: user.cancelAtPeriodEnd, + + links: { + website: user.links?.website ?? null, + youtube: user.links?.youtube ?? null, + twitter: user.links?.twitter ?? null, + instagram: user.links?.instagram ?? null, + linkedin: user.links?.linkedin ?? null, + facebook: user.links?.facebook ?? null, + github: user.links?.github ?? null, + }, + + oauthProviders: user.oauthProviders ?? [], + + notificationPrefs: { + emailOnJobComplete: user.notificationPrefs?.emailOnJobComplete ?? true, + inApp: user.notificationPrefs?.inApp ?? true, + marketingEmails: user.notificationPrefs?.marketingEmails ?? false, + }, + + privacyPrefs: { + profileVisibility: user.privacyPrefs?.profileVisibility ?? 'private', + showEmailOnProfile: user.privacyPrefs?.showEmailOnProfile ?? false, + showLinksOnProfile: user.privacyPrefs?.showLinksOnProfile ?? true, + }, + + createdAt: user.createdAt, }; case 'settings': return { - _id: user._id, email: user.email, username: user.username, - displayName: user.displayName, + displayName: user.displayName ?? null, avatarUrl: user.avatarUrl ?? null, bio: user.bio ?? null, plan: user.currentPlan, privacyPrefs: user.privacyPrefs ?? {}, notificationPrefs: user.notificationPrefs ?? {}, - usage: user.usage, links: user.links ?? {}, }; @@ -56,23 +90,23 @@ export const sanitizeUserResponse = (user: User, type: UserReturnType) => { currentPeriodEnd: user.currentPeriodEnd ?? null, trialEndsAt: user.trialEndsAt ?? null, cancelAtPeriodEnd: user.cancelAtPeriodEnd ?? false, - usage: user.usage, }; case 'account': return { - _id: user._id, + id: user._id.toString(), email: user.email, username: user.username, - displayName: user.displayName, + displayName: user.displayName ?? null, avatarUrl: user.avatarUrl ?? null, role: user.role, - status: user.accountStatus, // enum: active, suspended, banned, deleted + accountStatus: user.accountStatus, createdAt: user.createdAt, }; + default: return { - _id: user._id, + id: user._id.toString(), username: user.username, displayName: user.displayName ?? null, avatarUrl: user.avatarUrl ?? null, diff --git a/src/validation/narration.schema.ts b/src/validation/narration.schema.ts index fd4c0c8..8a65b5a 100644 --- a/src/validation/narration.schema.ts +++ b/src/validation/narration.schema.ts @@ -1,9 +1,6 @@ import { z } from 'zod'; +import { MAX_NARRATION_LENGTH } from '@constants/narrationConsts.js'; -// Constants -const MAX_NARRATION_LENGTH = 20000; - -// Narration segment schema export const narrationSegmentSchema = z .object({ startTime: z.number().min(0, 'Start time must be non-negative'), diff --git a/src/validation/project.schema.ts b/src/validation/project.schema.ts index 115e678..eee8c6e 100644 --- a/src/validation/project.schema.ts +++ b/src/validation/project.schema.ts @@ -106,6 +106,9 @@ export const createProjectContextProfileSchema = z.discriminatedUnion('mode', [ useGlobalProjectContextSchema, ]); +export const updateProjectContextProfileSchema = newProjectContextSchema.shape.data; + export type ProjectIdParam = z.infer; export type UpdateManyIdsInput = z.infer; export type CreateProjectContextInput = z.infer; +export type UpdateProjectContextInput = z.infer; diff --git a/src/validation/scenes.schema.ts b/src/validation/scenes.schema.ts index cec0b4a..4010164 100644 --- a/src/validation/scenes.schema.ts +++ b/src/validation/scenes.schema.ts @@ -72,6 +72,45 @@ export const generateAllScenesSchema = z }) .strict(); +export const uploadSceneItemSchema = z + .object({ + title: z + .string() + .max(MAX_SCENE_TITLE_LENGTH, `Title cannot exceed ${MAX_SCENE_TITLE_LENGTH} characters`) + .trim() + .optional(), + description: z + .string() + .min(1, 'Description is required') + .max(MAX_SCENE_DESCRIPTION_LENGTH, `Description cannot exceed ${MAX_SCENE_DESCRIPTION_LENGTH} characters`) + .trim(), + imagePrompt: z + .string() + .min(1, 'Image prompt is required') + .max(MAX_SCENE_PROMPT_LENGTH, `Image prompt cannot exceed ${MAX_SCENE_PROMPT_LENGTH} characters`) + .trim(), + videoPrompt: z + .string() + .min(1, 'Video prompt is required') + .max(MAX_SCENE_PROMPT_LENGTH, `Video prompt cannot exceed ${MAX_SCENE_PROMPT_LENGTH} characters`) + .trim(), + duration: z + .number() + .min(MIN_SCENE_DURATION, `Duration must be at least ${MIN_SCENE_DURATION} second`) + .max(MAX_SCENE_DURATION, `Duration cannot exceed ${MAX_SCENE_DURATION} seconds`) + .optional(), + }) + .strict(); + +export const uploadScenesJSONSchema = z + .object({ + scenes: z + .array(uploadSceneItemSchema) + .min(1, 'At least one scene is required') + .max(MAX_SCENES_PER_STORY, `Cannot upload more than ${MAX_SCENES_PER_STORY} scenes`), + }) + .strict(); + export const updateSceneSchema = z .object({ title: z @@ -206,6 +245,8 @@ export type SceneAndStoryParam = z.infer; export type CreateSceneInput = z.infer; export type GenerateAllScenesInput = z.infer; +export type UploadSceneItemInput = z.infer; +export type UploadScenesJSONInput = z.infer; export type UpdateSceneInput = z.infer; export type DurationInput = z.infer; diff --git a/src/validation/user.schema.ts b/src/validation/user.schema.ts index 671dee8..08f29b0 100644 --- a/src/validation/user.schema.ts +++ b/src/validation/user.schema.ts @@ -5,21 +5,33 @@ import { z } from "zod"; Body Schemas -------------------------*/ +const urlField = z + .string() + .refine((val) => { + try { + const url = new URL(val); + return url.protocol === "http:" || url.protocol === "https:"; + } catch { + return false; + } + }, { message: "Invalid URL" }) + .optional(); + export const updateProfileSchema = z.object({ displayName: z.string().trim().min(1).max(80).optional(), bio: z.string().max(160).optional(), - links: z - .object({ - website: z.string().url().optional(), - youtube: z.string().url().optional(), - twitter: z.string().url().optional(), - instagram: z.string().url().optional(), - linkedin: z.string().url().optional(), - facebook: z.string().url().optional(), - github: z.string().url().optional(), - }) - .strict() - .optional(), + + links: z.object({ + website: urlField, + youtube: urlField, + twitter: urlField, + instagram: urlField, + linkedin: urlField, + facebook: urlField, + github: urlField, + }) + .strict() + .optional(), }); export const updateAvatarSchema = z diff --git a/tsconfig.json b/tsconfig.json index 0b89747..233c7e2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -27,6 +27,8 @@ "@constants/*": ["constants/*"], "@security/*": ["security/*"], "@domain/*": ["domain/*"], + "@shared/*": ["shared/*"], + "@app-types/*": ["types/*"] } }, "include": ["src", "dist"]