diff --git a/.env.production b/.env.production index 59ab93b..3a724cb 100644 --- a/.env.production +++ b/.env.production @@ -1,3 +1,6 @@ +ORIGIN=http://localhost:4174 node build PUBLIC_BASE_URL=http://expense-api-container:8080 -// PUBLIC_BASE_URL=http://localhost:8080 -PUBLIC_IMAGE_SERVICE_URL=https://cdn.costventures.works/ \ No newline at end of file +# PUBLIC_BASE_URL=http://localhost:8080 +PUBLIC_IMAGE_SERVICE_URL=https://cdn.costventures.works/ +# PUBLIC_IMAGE_SERVICE_URL=http://localhost:8082/ +BODY_SIZE_LIMIT=8388608 \ No newline at end of file diff --git a/inlang.config.js b/inlang.config.js index 3022fc3..15f15aa 100644 --- a/inlang.config.js +++ b/inlang.config.js @@ -12,7 +12,7 @@ export async function defineConfig(env) { ); const { default: sdkPlugin } = await env.$import( - 'https://cdn.jsdelivr.net/npm/@inlang/sdk-js-plugin@0.7.1/dist/index.js' + 'https://cdn.jsdelivr.net/npm/@inlang/sdk-js-plugin@0.8.1/dist/index.js' ); return { diff --git a/package.json b/package.json index ec2ef86..b5e1748 100644 --- a/package.json +++ b/package.json @@ -22,21 +22,21 @@ "docker:stop": "docker stop expense-ui-container && docker rm expense-ui-container" }, "devDependencies": { - "@inlang/sdk-js": "^0.7.1", + "@inlang/sdk-js": "^0.8.1", "@skeletonlabs/skeleton": "1.9.0", "@steeze-ui/heroicons": "^2.2.3", "@sveltejs/adapter-node": "1.3.1", - "@sveltejs/kit": "1.22.2", - "@tailwindcss/forms": "0.5.3", + "@sveltejs/kit": "1.22.3", + "@tailwindcss/forms": "0.5.4", "@types/lodash": "^4.14.195", - "@types/node": "20.4.1", + "@types/node": "20.4.2", "@typescript-eslint/eslint-plugin": "5.61.0", "@typescript-eslint/parser": "5.60.1", "autoprefixer": "10.4.14", "eslint": "8.44.0", "eslint-config-prettier": "8.8.0", "eslint-plugin-svelte": "2.32.2", - "postcss": "8.4.25", + "postcss": "8.4.26", "postcss-load-config": "4.0.1", "prettier": "2.8.8", "prettier-plugin-svelte": "2.10.1", @@ -45,7 +45,7 @@ "svelte-check": "3.4.6", "svelte-flag-icons": "^0.5.5", "svelte-swipe": "^1.9.2", - "tailwindcss": "3.3.2", + "tailwindcss": "3.3.3", "tslib": "2.6.0", "typescript": "5.1.6", "vite": "4.4.3" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4027b67..1179254 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -29,8 +29,8 @@ dependencies: devDependencies: '@inlang/sdk-js': - specifier: ^0.7.1 - version: 0.7.1(@sveltejs/kit@1.22.2)(esbuild@0.18.11)(svelte@3.59.2) + specifier: ^0.8.1 + version: 0.8.1(@sveltejs/kit@1.22.3)(esbuild@0.18.11)(svelte@3.59.2) '@skeletonlabs/skeleton': specifier: 1.9.0 version: 1.9.0(svelte@3.59.2) @@ -39,19 +39,19 @@ devDependencies: version: 2.2.3 '@sveltejs/adapter-node': specifier: 1.3.1 - version: 1.3.1(@sveltejs/kit@1.22.2) + version: 1.3.1(@sveltejs/kit@1.22.3) '@sveltejs/kit': - specifier: 1.22.2 - version: 1.22.2(svelte@3.59.2)(vite@4.4.3) + specifier: 1.22.3 + version: 1.22.3(svelte@3.59.2)(vite@4.4.3) '@tailwindcss/forms': - specifier: 0.5.3 - version: 0.5.3(tailwindcss@3.3.2) + specifier: 0.5.4 + version: 0.5.4(tailwindcss@3.3.3) '@types/lodash': specifier: ^4.14.195 version: 4.14.195 '@types/node': - specifier: 20.4.1 - version: 20.4.1 + specifier: 20.4.2 + version: 20.4.2 '@typescript-eslint/eslint-plugin': specifier: 5.61.0 version: 5.61.0(@typescript-eslint/parser@5.60.1)(eslint@8.44.0)(typescript@5.1.6) @@ -60,7 +60,7 @@ devDependencies: version: 5.60.1(eslint@8.44.0)(typescript@5.1.6) autoprefixer: specifier: 10.4.14 - version: 10.4.14(postcss@8.4.25) + version: 10.4.14(postcss@8.4.26) eslint: specifier: 8.44.0 version: 8.44.0 @@ -71,11 +71,11 @@ devDependencies: specifier: 2.32.2 version: 2.32.2(eslint@8.44.0)(svelte@3.59.2) postcss: - specifier: 8.4.25 - version: 8.4.25 + specifier: 8.4.26 + version: 8.4.26 postcss-load-config: specifier: 4.0.1 - version: 4.0.1(postcss@8.4.25) + version: 4.0.1(postcss@8.4.26) prettier: specifier: 2.8.8 version: 2.8.8 @@ -90,7 +90,7 @@ devDependencies: version: 1.0.25 svelte-check: specifier: 3.4.6 - version: 3.4.6(postcss-load-config@4.0.1)(postcss@8.4.25)(svelte@3.59.2) + version: 3.4.6(postcss-load-config@4.0.1)(postcss@8.4.26)(svelte@3.59.2) svelte-flag-icons: specifier: ^0.5.5 version: 0.5.5(svelte@3.59.2) @@ -98,8 +98,8 @@ devDependencies: specifier: ^1.9.2 version: 1.9.2(svelte@3.59.2) tailwindcss: - specifier: 3.3.2 - version: 3.3.2 + specifier: 3.3.3 + version: 3.3.3 tslib: specifier: 2.6.0 version: 2.6.0 @@ -108,7 +108,7 @@ devDependencies: version: 5.1.6 vite: specifier: 4.4.3 - version: 4.4.3(@types/node@20.4.1) + version: 4.4.3(@types/node@20.4.2) packages: @@ -417,16 +417,18 @@ packages: - esbuild dev: true - /@inlang/sdk-js@0.7.1(@sveltejs/kit@1.22.2)(esbuild@0.18.11)(svelte@3.59.2): - resolution: {integrity: sha512-PfcyuAd3DsdwtEGDSR5iwrGWIn1ulanJ7HcVhB4rFLvYJhgm8AelxHMJOnF72skM8yEI3gkWUaLGdfLf9s5Nwg==} + /@inlang/sdk-js@0.8.1(@sveltejs/kit@1.22.3)(esbuild@0.18.11)(svelte@3.59.2): + resolution: {integrity: sha512-qivuSBuRFXmjusR/leWilVO4lYc11FYhDB3C4Wi4uqMroGEqopeRwOgI60vC7IBte3SeJYBnttNoUp6hEP/uIQ==} engines: {node: '>=18'} peerDependencies: '@sveltejs/kit': ^1.0.0 - svelte: ^3.0.0 || ^4.0.0 + svelte: ^3.54.0 || ^4.0.0 dependencies: '@inlang/core': 0.9.2(esbuild@0.18.11) - '@sveltejs/kit': 1.22.2(svelte@3.59.2)(vite@4.4.3) + '@sveltejs/kit': 1.22.3(svelte@3.59.2)(vite@4.4.3) svelte: 3.59.2 + ts-morph: 19.0.0 + typescript: 5.1.6 transitivePeerDependencies: - esbuild dev: true @@ -579,7 +581,7 @@ packages: svelte: 3.59.2 dev: false - /@sveltejs/adapter-node@1.3.1(@sveltejs/kit@1.22.2): + /@sveltejs/adapter-node@1.3.1(@sveltejs/kit@1.22.3): resolution: {integrity: sha512-A0VgRQDCDPzdLNoiAbcOxGw4zT1Mc+n1LwT1OmO350R7WxrEqdMUChPPOd1iMfIDWlP4ie6E2d/WQf5es2d4Zw==} peerDependencies: '@sveltejs/kit': ^1.0.0 @@ -587,12 +589,12 @@ packages: '@rollup/plugin-commonjs': 25.0.2(rollup@3.26.0) '@rollup/plugin-json': 6.0.0(rollup@3.26.0) '@rollup/plugin-node-resolve': 15.1.0(rollup@3.26.0) - '@sveltejs/kit': 1.22.2(svelte@3.59.2)(vite@4.4.3) + '@sveltejs/kit': 1.22.3(svelte@3.59.2)(vite@4.4.3) rollup: 3.26.0 dev: true - /@sveltejs/kit@1.22.2(svelte@3.59.2)(vite@4.4.3): - resolution: {integrity: sha512-T6GY5jSfQgoDnNPNqAuDi9IK+ZW0TspzTV16UAN6GTsxbri67DGVIbw7QOXPg8FMrZQMmda1AtAxPMfXbOqCgw==} + /@sveltejs/kit@1.22.3(svelte@3.59.2)(vite@4.4.3): + resolution: {integrity: sha512-IpHD5wvuoOIHYaHQUBJ1zERD2Iz+fB/rBXhXjl8InKw6X4VKE9BSus+ttHhE7Ke+Ie9ecfilzX8BnWE3FeQyng==} engines: {node: ^16.14 || >=18} hasBin: true requiresBuild: true @@ -613,7 +615,7 @@ packages: sirv: 2.0.3 svelte: 3.59.2 undici: 5.22.1 - vite: 4.4.3(@types/node@20.4.1) + vite: 4.4.3(@types/node@20.4.2) transitivePeerDependencies: - supports-color dev: true @@ -629,7 +631,7 @@ packages: '@sveltejs/vite-plugin-svelte': 2.4.2(svelte@3.59.2)(vite@4.4.3) debug: 4.3.4 svelte: 3.59.2 - vite: 4.4.3(@types/node@20.4.1) + vite: 4.4.3(@types/node@20.4.2) transitivePeerDependencies: - supports-color dev: true @@ -648,19 +650,28 @@ packages: magic-string: 0.30.0 svelte: 3.59.2 svelte-hmr: 0.15.2(svelte@3.59.2) - vite: 4.4.3(@types/node@20.4.1) + vite: 4.4.3(@types/node@20.4.2) vitefu: 0.2.4(vite@4.4.3) transitivePeerDependencies: - supports-color dev: true - /@tailwindcss/forms@0.5.3(tailwindcss@3.3.2): - resolution: {integrity: sha512-y5mb86JUoiUgBjY/o6FJSFZSEttfb3Q5gllE4xoKjAAD+vBrnIhE4dViwUuow3va8mpH4s9jyUbUbrRGoRdc2Q==} + /@tailwindcss/forms@0.5.4(tailwindcss@3.3.3): + resolution: {integrity: sha512-YAm12D3R7/9Mh4jFbYSMnsd6jG++8KxogWgqs7hbdo/86aWjjlIEvL7+QYdVELmAI0InXTpZqFIg5e7aDVWI2Q==} peerDependencies: tailwindcss: '>=3.0.0 || >= 3.0.0-alpha.1' dependencies: mini-svg-data-uri: 1.4.4 - tailwindcss: 3.3.2 + tailwindcss: 3.3.3 + dev: true + + /@ts-morph/common@0.20.0: + resolution: {integrity: sha512-7uKjByfbPpwuzkstL3L5MQyuXPSKdoNG93Fmi2JoDcTf3pEP731JdRFAduRVkOs8oqxPsXKA+ScrWkdQ8t/I+Q==} + dependencies: + fast-glob: 3.3.0 + minimatch: 7.4.6 + mkdirp: 2.1.6 + path-browserify: 1.0.1 dev: true /@types/cookie@0.5.1: @@ -679,8 +690,8 @@ packages: resolution: {integrity: sha512-Hwx9EUgdwf2GLarOjQp5ZH8ZmblzcbTBC2wtQWNKARBSxM9ezRIAUpeDTgoQRAFB0+8CNWXVA9+MaSOzOF3nPg==} dev: true - /@types/node@20.4.1: - resolution: {integrity: sha512-JIzsAvJeA/5iY6Y/OxZbv1lUcc8dNSE77lb2gnBH+/PJ3lFR1Ccvgwl5JWnHAkNHcRsT0TbpVOsiMKZ1F/yyJg==} + /@types/node@20.4.2: + resolution: {integrity: sha512-Dd0BYtWgnWJKwO1jkmTrzofjK2QXXcai0dmtzvIBhcA+RsG5h8R3xlyta0kGOZRNfL9GuRtb1knmPEhQrePCEw==} dev: true /@types/pug@2.0.6: @@ -927,7 +938,7 @@ packages: engines: {node: '>=8'} dev: true - /autoprefixer@10.4.14(postcss@8.4.25): + /autoprefixer@10.4.14(postcss@8.4.26): resolution: {integrity: sha512-FQzyfOsTlwVzjHxKEqRIAdJx9niO6VCBCoEwax/VLSoQF29ggECcPuBqUMZ+u8jCZOPSy8b8/8KnuFbp0SaFZQ==} engines: {node: ^10 || ^12 || >=14} hasBin: true @@ -939,7 +950,7 @@ packages: fraction.js: 4.2.0 normalize-range: 0.1.2 picocolors: 1.0.0 - postcss: 8.4.25 + postcss: 8.4.26 postcss-value-parser: 4.2.0 dev: true @@ -1043,6 +1054,10 @@ packages: fsevents: 2.3.2 dev: true + /code-block-writer@12.0.0: + resolution: {integrity: sha512-q4dMFMlXtKR3XNBHyMHt/3pwYNA69EDk00lloMOaaUMKPUXBw6lpXtbu3MMVG6/uOihGnRDOlkyqsONEUj60+w==} + dev: true + /color-convert@2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} engines: {node: '>=7.0.0'} @@ -1230,9 +1245,9 @@ packages: eslint: 8.44.0 esutils: 2.0.3 known-css-properties: 0.27.0 - postcss: 8.4.25 - postcss-load-config: 3.1.4(postcss@8.4.25) - postcss-safe-parser: 6.0.0(postcss@8.4.25) + postcss: 8.4.26 + postcss-load-config: 3.1.4(postcss@8.4.26) + postcss-safe-parser: 6.0.0(postcss@8.4.26) postcss-selector-parser: 6.0.13 semver: 7.5.3 svelte: 3.59.2 @@ -1765,6 +1780,13 @@ packages: brace-expansion: 2.0.1 dev: true + /minimatch@7.4.6: + resolution: {integrity: sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw==} + engines: {node: '>=10'} + dependencies: + brace-expansion: 2.0.1 + dev: true + /minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} dev: true @@ -1776,6 +1798,12 @@ packages: minimist: 1.2.8 dev: true + /mkdirp@2.1.6: + resolution: {integrity: sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A==} + engines: {node: '>=10'} + hasBin: true + dev: true + /mri@1.2.0: resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} engines: {node: '>=4'} @@ -1879,6 +1907,10 @@ packages: callsites: 3.1.0 dev: true + /path-browserify@1.0.1: + resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} + dev: true + /path-exists@4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} @@ -1922,29 +1954,29 @@ packages: engines: {node: '>= 6'} dev: true - /postcss-import@15.1.0(postcss@8.4.25): + /postcss-import@15.1.0(postcss@8.4.26): resolution: {integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==} engines: {node: '>=14.0.0'} peerDependencies: postcss: ^8.0.0 dependencies: - postcss: 8.4.25 + postcss: 8.4.26 postcss-value-parser: 4.2.0 read-cache: 1.0.0 resolve: 1.22.2 dev: true - /postcss-js@4.0.1(postcss@8.4.25): + /postcss-js@4.0.1(postcss@8.4.26): resolution: {integrity: sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==} engines: {node: ^12 || ^14 || >= 16} peerDependencies: postcss: ^8.4.21 dependencies: camelcase-css: 2.0.1 - postcss: 8.4.25 + postcss: 8.4.26 dev: true - /postcss-load-config@3.1.4(postcss@8.4.25): + /postcss-load-config@3.1.4(postcss@8.4.26): resolution: {integrity: sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==} engines: {node: '>= 10'} peerDependencies: @@ -1957,11 +1989,11 @@ packages: optional: true dependencies: lilconfig: 2.1.0 - postcss: 8.4.25 + postcss: 8.4.26 yaml: 1.10.2 dev: true - /postcss-load-config@4.0.1(postcss@8.4.25): + /postcss-load-config@4.0.1(postcss@8.4.26): resolution: {integrity: sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA==} engines: {node: '>= 14'} peerDependencies: @@ -1974,36 +2006,36 @@ packages: optional: true dependencies: lilconfig: 2.1.0 - postcss: 8.4.25 + postcss: 8.4.26 yaml: 2.3.1 dev: true - /postcss-nested@6.0.1(postcss@8.4.25): + /postcss-nested@6.0.1(postcss@8.4.26): resolution: {integrity: sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==} engines: {node: '>=12.0'} peerDependencies: postcss: ^8.2.14 dependencies: - postcss: 8.4.25 + postcss: 8.4.26 postcss-selector-parser: 6.0.13 dev: true - /postcss-safe-parser@6.0.0(postcss@8.4.25): + /postcss-safe-parser@6.0.0(postcss@8.4.26): resolution: {integrity: sha512-FARHN8pwH+WiS2OPCxJI8FuRJpTVnn6ZNFiqAM2aeW2LwTHWWmWgIyKC6cUo0L8aeKiF/14MNvnpls6R2PBeMQ==} engines: {node: '>=12.0'} peerDependencies: postcss: ^8.3.3 dependencies: - postcss: 8.4.25 + postcss: 8.4.26 dev: true - /postcss-scss@4.0.6(postcss@8.4.25): + /postcss-scss@4.0.6(postcss@8.4.26): resolution: {integrity: sha512-rLDPhJY4z/i4nVFZ27j9GqLxj1pwxE80eAzUNRMXtcpipFYIeowerzBgG3yJhMtObGEXidtIgbUpQ3eLDsf5OQ==} engines: {node: '>=12.0'} peerDependencies: postcss: ^8.4.19 dependencies: - postcss: 8.4.25 + postcss: 8.4.26 dev: true /postcss-selector-parser@6.0.13: @@ -2018,8 +2050,8 @@ packages: resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} dev: true - /postcss@8.4.25: - resolution: {integrity: sha512-7taJ/8t2av0Z+sQEvNzCkpDynl0tX3uJMCODi6nT3PfASC7dYCWV9aQ+uiCf+KBD4SEFcu+GvJdGdwzQ6OSjCw==} + /postcss@8.4.26: + resolution: {integrity: sha512-jrXHFF8iTloAenySjM/ob3gSj7pCu0Ji49hnjqzsgSRa50hkWCKD0HQ+gMNJkW38jBI68MpAAg7ZWwHwX8NMMw==} engines: {node: ^10 || ^12 || >=14} dependencies: nanoid: 3.3.6 @@ -2278,7 +2310,7 @@ packages: svelte: 3.59.2 dev: false - /svelte-check@3.4.6(postcss-load-config@4.0.1)(postcss@8.4.25)(svelte@3.59.2): + /svelte-check@3.4.6(postcss-load-config@4.0.1)(postcss@8.4.26)(svelte@3.59.2): resolution: {integrity: sha512-OBlY8866Zh1zHQTkBMPS6psPi7o2umTUyj6JWm4SacnIHXpWFm658pG32m3dKvKFL49V4ntAkfFHKo4ztH07og==} hasBin: true peerDependencies: @@ -2291,7 +2323,7 @@ packages: picocolors: 1.0.0 sade: 1.8.1 svelte: 3.59.2 - svelte-preprocess: 5.0.4(postcss-load-config@4.0.1)(postcss@8.4.25)(svelte@3.59.2)(typescript@5.1.6) + svelte-preprocess: 5.0.4(postcss-load-config@4.0.1)(postcss@8.4.26)(svelte@3.59.2)(typescript@5.1.6) typescript: 5.1.6 transitivePeerDependencies: - '@babel/core' @@ -2317,8 +2349,8 @@ packages: eslint-scope: 7.2.0 eslint-visitor-keys: 3.4.1 espree: 9.6.0 - postcss: 8.4.25 - postcss-scss: 4.0.6(postcss@8.4.25) + postcss: 8.4.26 + postcss-scss: 4.0.6(postcss@8.4.26) svelte: 3.59.2 dev: true @@ -2339,7 +2371,7 @@ packages: svelte: 3.59.2 dev: true - /svelte-preprocess@5.0.4(postcss-load-config@4.0.1)(postcss@8.4.25)(svelte@3.59.2)(typescript@5.1.6): + /svelte-preprocess@5.0.4(postcss-load-config@4.0.1)(postcss@8.4.26)(svelte@3.59.2)(typescript@5.1.6): resolution: {integrity: sha512-ABia2QegosxOGsVlsSBJvoWeXy1wUKSfF7SWJdTjLAbx/Y3SrVevvvbFNQqrSJw89+lNSsM58SipmZJ5SRi5iw==} engines: {node: '>= 14.10.0'} requiresBuild: true @@ -2380,8 +2412,8 @@ packages: '@types/pug': 2.0.6 detect-indent: 6.1.0 magic-string: 0.27.0 - postcss: 8.4.25 - postcss-load-config: 4.0.1(postcss@8.4.25) + postcss: 8.4.26 + postcss-load-config: 4.0.1(postcss@8.4.26) sorcery: 0.11.0 strip-indent: 3.0.0 svelte: 3.59.2 @@ -2400,8 +2432,8 @@ packages: resolution: {integrity: sha512-vzSyuGr3eEoAtT/A6bmajosJZIUWySzY2CzB3w2pgPvnkUjGqlDnsNnA0PMO+mMAhuyMul6C2uuZzY6ELSkzyA==} engines: {node: '>= 8'} - /tailwindcss@3.3.2: - resolution: {integrity: sha512-9jPkMiIBXvPc2KywkraqsUfbfj+dHDb+JPWtSJa9MLFdrPyazI7q6WX2sUrm7R9eVR7qqv3Pas7EvQFzxKnI6w==} + /tailwindcss@3.3.3: + resolution: {integrity: sha512-A0KgSkef7eE4Mf+nKJ83i75TMyq8HqY3qmFIJSWy8bNt0v1lG7jUcpGpoTFxAwYcWOphcTBLPPJg+bDfhDf52w==} engines: {node: '>=14.0.0'} hasBin: true dependencies: @@ -2419,13 +2451,12 @@ packages: normalize-path: 3.0.0 object-hash: 3.0.0 picocolors: 1.0.0 - postcss: 8.4.25 - postcss-import: 15.1.0(postcss@8.4.25) - postcss-js: 4.0.1(postcss@8.4.25) - postcss-load-config: 4.0.1(postcss@8.4.25) - postcss-nested: 6.0.1(postcss@8.4.25) + postcss: 8.4.26 + postcss-import: 15.1.0(postcss@8.4.26) + postcss-js: 4.0.1(postcss@8.4.26) + postcss-load-config: 4.0.1(postcss@8.4.26) + postcss-nested: 6.0.1(postcss@8.4.26) postcss-selector-parser: 6.0.13 - postcss-value-parser: 4.2.0 resolve: 1.22.2 sucrase: 3.32.0 transitivePeerDependencies: @@ -2470,6 +2501,13 @@ packages: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} dev: true + /ts-morph@19.0.0: + resolution: {integrity: sha512-D6qcpiJdn46tUqV45vr5UGM2dnIEuTGNxVhg0sk5NX11orcouwj6i1bMqZIz2mZTZB1Hcgy7C3oEVhAT+f6mbQ==} + dependencies: + '@ts-morph/common': 0.20.0 + code-block-writer: 12.0.0 + dev: true + /tslib@1.14.1: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} dev: true @@ -2534,7 +2572,7 @@ packages: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} dev: true - /vite@4.4.3(@types/node@20.4.1): + /vite@4.4.3(@types/node@20.4.2): resolution: {integrity: sha512-IMnXQXXWgLi5brBQx/4WzDxdzW0X3pjO4nqFJAuNvwKtxzAmPzFE1wszW3VDpAGQJm3RZkm/brzRdyGsnwgJIA==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -2562,9 +2600,9 @@ packages: terser: optional: true dependencies: - '@types/node': 20.4.1 + '@types/node': 20.4.2 esbuild: 0.18.11 - postcss: 8.4.25 + postcss: 8.4.26 rollup: 3.26.0 optionalDependencies: fsevents: 2.3.2 @@ -2578,7 +2616,7 @@ packages: vite: optional: true dependencies: - vite: 4.4.3(@types/node@20.4.1) + vite: 4.4.3(@types/node@20.4.2) dev: true /which@2.0.2: diff --git a/src/app.html b/src/app.html index a34aec1..632446f 100644 --- a/src/app.html +++ b/src/app.html @@ -4,6 +4,12 @@ Costventures + + %sveltekit.head% diff --git a/src/components/debtOverview/_CoveredDebtsPercentage.svelte b/src/components/debtOverview/_CoveredDebtsPercentage.svelte index f0112ec..9d46902 100644 --- a/src/components/debtOverview/_CoveredDebtsPercentage.svelte +++ b/src/components/debtOverview/_CoveredDebtsPercentage.svelte @@ -3,7 +3,6 @@ import { ProgressRadial, popup, type PopupSettings } from '@skeletonlabs/skeleton'; export let coveredDebtsPercentage: string; - console.log(coveredDebtsPercentage); const popupHover: PopupSettings = { event: 'hover', diff --git a/src/components/general/_LanguageSelector.svelte b/src/components/general/_LanguageSelector.svelte index 5c7680c..45c53a0 100644 --- a/src/components/general/_LanguageSelector.svelte +++ b/src/components/general/_LanguageSelector.svelte @@ -29,7 +29,6 @@ const switchLanguageHandler = async (e: MouseEvent) => { const value = (e.target as HTMLButtonElement).value; - console.log(`Switching language to: ${value}`); await switchLanguage(value); // Switch language titles for the current language @@ -42,7 +41,6 @@ // TODO: This is not working yet, why the fuck does Skeleton not propagate the hover event for listitems?????? const preloadLanguageHandler = async (e: CustomEvent) => { const language = (e.target as HTMLButtonElement).value; - console.log(`Preloading language: ${language}`); await loadResource(language); }; diff --git a/src/components/landingPage/signup/_SignUpComponent.svelte b/src/components/landingPage/signup/_SignUpComponent.svelte index 773402e..3e47732 100644 --- a/src/components/landingPage/signup/_SignUpComponent.svelte +++ b/src/components/landingPage/signup/_SignUpComponent.svelte @@ -41,7 +41,8 @@ // Fetch the image as a Blob object and append it to the form data if ($imageUrl !== '') { - const blob = await fetch($imageUrl).then((r) => r.blob()); + const blobPromise = await fetch($imageUrl); + const blob = await blobPromise.blob(); formData.append('profilePicture', blob); } diff --git a/src/components/tripDetails/Modal/_CostItemCostAllocation.svelte b/src/components/tripDetails/Modal/_CostItemCostAllocation.svelte index 198e685..019fe47 100644 --- a/src/components/tripDetails/Modal/_CostItemCostAllocation.svelte +++ b/src/components/tripDetails/Modal/_CostItemCostAllocation.svelte @@ -10,10 +10,10 @@ selectAllPeople, validateCostAllocation } from '$utils'; + import { i } from '@inlang/sdk-js'; import { RadioGroup, RadioItem } from '@skeletonlabs/skeleton'; import { Check, InformationCircle, XMark } from '@steeze-ui/heroicons'; import { Icon } from '@steeze-ui/svelte-icon'; - import { i } from '@inlang/sdk-js'; export let users: Array; export let usersInvolved: Array; diff --git a/src/components/tripDetails/Modal/_CostItemPaidyBy.svelte b/src/components/tripDetails/Modal/_CostItemPaidyBy.svelte index 65ee690..4ac06b8 100644 --- a/src/components/tripDetails/Modal/_CostItemPaidyBy.svelte +++ b/src/components/tripDetails/Modal/_CostItemPaidyBy.svelte @@ -2,16 +2,17 @@ import { costPaidByValid } from '$stores'; import type { CostPaidForUser } from '$userDomain'; import { validatePaidBy } from '$utils'; + import { i } from '@inlang/sdk-js'; import { Check, InformationCircle, XMark } from '@steeze-ui/heroicons'; import { Icon } from '@steeze-ui/svelte-icon'; import { createEventDispatcher } from 'svelte'; - import { i } from '@inlang/sdk-js'; export let users: Array; export let paidBy: string; $: costPaidByValid.set(validatePaidBy()); - $: isAnyParticipentNotAccepted = users.some((user) => !user.hasAcceptedInvite); + $: isAnyParticipentNotAccepted = + users.length !== 1 && users.some((user) => !user.hasAcceptedInvite); const dispatch = createEventDispatcher(); function changeSelectedValue(event: any) { diff --git a/src/hooks.server.ts b/src/hooks.server.ts index 0c1cb45..d5d4cff 100644 --- a/src/hooks.server.ts +++ b/src/hooks.server.ts @@ -22,6 +22,17 @@ const unauthorizedRoutes = [ '/inlang/ko.json' // Inlang API for Korean ]; +const resetCookieResponse = () => { + const response = new Response('Redirect', { status: 303, headers: { Location: '/login' } }); + response.headers.set('Set-Cookie', 'token=; Path=/; Expires=Thu, 01 Jan 1970 00:00:00 GMT'); + response.headers.set( + 'Set-Cookie', + 'refreshToken=; Path=/; Expires=Thu, 01 Jan 1970 00:00:00 GMT' + ); + + return response; +}; + export const handle: Handle = async ({ event, resolve }) => { console.log(`Internal request: ${event.url.pathname}, ${Date.now()}}`); @@ -64,14 +75,7 @@ export const handle: Handle = async ({ event, resolve }) => { if (!refreshTokenResponse.ok) { // Delete the cookies and redirect to login page - const response = new Response('Redirect', { status: 303, headers: { Location: '/login' } }); - response.headers.set('Set-Cookie', 'token=; Path=/; Expires=Thu, 01 Jan 1970 00:00:00 GMT'); - response.headers.set( - 'Set-Cookie', - 'refreshToken=; Path=/; Expires=Thu, 01 Jan 1970 00:00:00 GMT' - ); - - return response; + return resetCookieResponse(); } const { token: newToken, refreshToken: newRefreshToken } = await refreshTokenResponse.json(); @@ -80,23 +84,23 @@ export const handle: Handle = async ({ event, resolve }) => { event.cookies.set('refreshToken', newRefreshToken, { path: '/' }); token = newToken; - event.request.headers.set('Authorization', `Bearer ${token}`); - const response = await resolve(event); - return response; + const response = await resolve(event); + return response.status === 401 ? resetCookieResponse() : response; }; // By default SvelteKit does not send the Authorization header to the API // since it is not a same-origin request. This hook will add the Authorization // header to the request if the request is going to the API. (rip 1 hour of my time) -export const handleFetch: HandleFetch = ({ event, request, fetch }) => { +export const handleFetch: HandleFetch = async ({ event, request, fetch }) => { const url = new URL(request.url); console.log(`Outgoing request to ${url}`); - if (PUBLIC_BASE_URL === url.origin) { + if (PUBLIC_BASE_URL === url.origin && !unauthorizedRoutes.includes(url.pathname)) { request.headers.set('Authorization', event.request.headers.get('Authorization') ?? ''); } - return fetch(request); + const response = await fetch(request); + return response.status === 401 ? resetCookieResponse() : response; }; diff --git a/src/routes/(app)/profile/+page.svelte b/src/routes/(app)/profile/+page.svelte index 0cce78d..448d4ee 100644 --- a/src/routes/(app)/profile/+page.svelte +++ b/src/routes/(app)/profile/+page.svelte @@ -5,8 +5,6 @@ import { calculateDate } from '$utils'; import { i, language } from '@inlang/sdk-js'; import { Avatar } from '@skeletonlabs/skeleton'; - import { Check, Pencil } from '@steeze-ui/heroicons'; - import { Icon } from '@steeze-ui/svelte-icon'; export let data; @@ -45,6 +43,7 @@ {i('profile.title')} +
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 2db78ec..e7007ad 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -21,3 +21,5 @@ Please do not delete it (inlang will recreate it if needed). --> // Set floating ui defaults storePopup.set({ computePosition, autoUpdate, offset, shift, flip, arrow }); + + diff --git a/src/routes/api/users/+server.ts b/src/routes/api/users/+server.ts index a16a1fa..b217b80 100644 --- a/src/routes/api/users/+server.ts +++ b/src/routes/api/users/+server.ts @@ -28,3 +28,29 @@ export const GET: RequestHandler = async ({ fetch }) => { }); } }; + +export const PATCH: RequestHandler = async ({ fetch, request }) => { + const initialBody = await request.json(); + + try { + const response = await fetch(`${PUBLIC_BASE_URL}/api/v1/users`, { + method: 'PATCH', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(initialBody) + }); + + if (response.ok) { + return json({ error: false, errorCode: '' }); + } + + const body = await response.json(); + return json({ error: true, errorCode: body.errorCode }); + } catch (exception) { + return json({ + error: true, + errorCode: 'EM-000' + }); + } +}; diff --git a/src/routes/api/users/register/+server.ts b/src/routes/api/users/register/+server.ts index 8c7fff9..1c2ed30 100644 --- a/src/routes/api/users/register/+server.ts +++ b/src/routes/api/users/register/+server.ts @@ -2,6 +2,11 @@ import { PUBLIC_BASE_URL } from '$env/static/public'; import { json } from '@sveltejs/kit'; import type { RequestHandler } from './$types'; +interface ResponseType { + errorMessage: string; + errorCode: string; +} + export const POST: RequestHandler = async ({ fetch, request }) => { // Get multipart form data const formData = await request.formData(); @@ -18,9 +23,10 @@ export const POST: RequestHandler = async ({ fetch, request }) => { return json({ error: false, errorCode: '' }); } - const body = await response.json(); + const body = (await response.json()) as ResponseType; return json({ error: true, errorCode: body.errorCode }); } catch (exception) { + console.error(exception); return json({ error: true, errorCode: 'EM-000' }); } }; diff --git a/svelte.config.js b/svelte.config.js index 1c5db2d..dfa365e 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -21,6 +21,9 @@ const config = { precompress: true, polyfill: false }), + csrf: { + checkOrigin: false + }, alias: { $components: './src/components', $icons: './src/icons',