From 1a37a7d5b81ae15ff22f86c6fb245d9e2551e6a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Pe=CC=81ault?= Date: Mon, 24 Jan 2022 22:18:09 +0100 Subject: [PATCH] Update npm packages and code for newest SvelteKit updates --- package.json | 12 +- pnpm-lock.yaml | 243 ++++++++++++++++++++-------------------- src/routes/api/swell.ts | 14 +-- 3 files changed, 132 insertions(+), 137 deletions(-) diff --git a/package.json b/package.json index cf5dcec..6040e0b 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "dependencies": { "animejs": "^3.2.1", "dayjs": "^1.10.7", - "embla-carousel": "^5.0.1", + "embla-carousel": "^6.1.1", "focus-visible": "^5.2.0", "sanitize.css": "^13.0.0" }, @@ -30,17 +30,17 @@ "@sveltejs/adapter-vercel": "next", "@sveltejs/kit": "next", "@types/animejs": "^3.1.4", - "@typescript-eslint/eslint-plugin": "^5.9.1", - "@typescript-eslint/parser": "^5.9.1", + "@typescript-eslint/eslint-plugin": "^5.10.0", + "@typescript-eslint/parser": "^5.10.0", "eslint": "^8.7.0", "eslint-plugin-svelte3": "^3.4.0", - "sass": "^1.48.0", + "sass": "^1.49.0", "svelte": "^3.46.2", "svelte-check": "^2.3.0", - "svelte-preprocess": "^4.10.1", + "svelte-preprocess": "^4.10.2", "swell-node": "^4.0.9", "tslib": "^2.3.1", - "typescript": "^4.5.4" + "typescript": "^4.5.5" }, "type": "module", "browserslist": [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 45de2c8..3eee0e5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,47 +6,47 @@ specifiers: '@sveltejs/adapter-vercel': next '@sveltejs/kit': next '@types/animejs': ^3.1.4 - '@typescript-eslint/eslint-plugin': ^5.9.1 - '@typescript-eslint/parser': ^5.9.1 + '@typescript-eslint/eslint-plugin': ^5.10.0 + '@typescript-eslint/parser': ^5.10.0 animejs: ^3.2.1 dayjs: ^1.10.7 - embla-carousel: ^5.0.1 + embla-carousel: ^6.1.1 eslint: ^8.7.0 eslint-plugin-svelte3: ^3.4.0 focus-visible: ^5.2.0 sanitize.css: ^13.0.0 - sass: ^1.48.0 + sass: ^1.49.0 svelte: ^3.46.2 svelte-check: ^2.3.0 - svelte-preprocess: ^4.10.1 + svelte-preprocess: ^4.10.2 swell-node: ^4.0.9 tslib: ^2.3.1 - typescript: ^4.5.4 + typescript: ^4.5.5 dependencies: animejs: 3.2.1 dayjs: 1.10.7 - embla-carousel: 5.0.1 + embla-carousel: 6.1.1 focus-visible: 5.2.0 sanitize.css: 13.0.0 devDependencies: - '@sveltejs/adapter-cloudflare': 1.0.0-next.7 - '@sveltejs/adapter-node': 1.0.0-next.61 - '@sveltejs/adapter-vercel': 1.0.0-next.36 - '@sveltejs/kit': 1.0.0-next.232_sass@1.48.0+svelte@3.46.2 + '@sveltejs/adapter-cloudflare': 1.0.0-next.8 + '@sveltejs/adapter-node': 1.0.0-next.67 + '@sveltejs/adapter-vercel': 1.0.0-next.39 + '@sveltejs/kit': 1.0.0-next.241_sass@1.49.0+svelte@3.46.2 '@types/animejs': 3.1.4 - '@typescript-eslint/eslint-plugin': 5.9.1_bbe74534e31a8c21f1b3522447c55341 - '@typescript-eslint/parser': 5.9.1_eslint@8.7.0+typescript@4.5.4 + '@typescript-eslint/eslint-plugin': 5.10.0_706fb07ce74b1db611f19a02ad2ce784 + '@typescript-eslint/parser': 5.10.0_eslint@8.7.0+typescript@4.5.5 eslint: 8.7.0 eslint-plugin-svelte3: 3.4.0_eslint@8.7.0+svelte@3.46.2 - sass: 1.48.0 + sass: 1.49.0 svelte: 3.46.2 - svelte-check: 2.3.0_sass@1.48.0+svelte@3.46.2 - svelte-preprocess: 4.10.1_29e62301fc182049204f5f6a0272225d + svelte-check: 2.3.0_sass@1.49.0+svelte@3.46.2 + svelte-preprocess: 4.10.2_7185e5bbca9941e8a76052fa3c9acf72 swell-node: 4.0.9 tslib: 2.3.1 - typescript: 4.5.4 + typescript: 4.5.5 packages: @@ -111,35 +111,35 @@ packages: picomatch: 2.3.1 dev: true - /@sveltejs/adapter-cloudflare/1.0.0-next.7: - resolution: {integrity: sha512-P2rq+Tdvv9IKX4SVrIRqgZ2DnjmpPjp/bhAISs6cgbMzc2AmLMCeN++DXAZAVWugIjF1freLmtXcCl3/0HByNg==} + /@sveltejs/adapter-cloudflare/1.0.0-next.8: + resolution: {integrity: sha512-uje8eUfP1xrMEdKczvjl0rpu7WTZZrZCBTgH2sTSYYiAqpCevsmJNZ9Lgh5U5a4BYBYGVvAcYdh8nzoddxOZkw==} dependencies: esbuild: 0.13.15 dev: true - /@sveltejs/adapter-node/1.0.0-next.61: - resolution: {integrity: sha512-QiH/VBlRuQfw3x9yCrhXPqHvynqA1ai2izDlvc+ZxdWjah5vjds0P6EoP0g4VOJUFKtttQVnGNQrXMUA87T2dw==} + /@sveltejs/adapter-node/1.0.0-next.67: + resolution: {integrity: sha512-+LuLn91xARZsRANiQNIIDpMMncUTnP2pJc8tyL+FdpVvs5UtlvkYJpeCBPFqjjseRpIIbi8Slu89GCdrRXBDUg==} dependencies: tiny-glob: 0.2.9 dev: true - /@sveltejs/adapter-vercel/1.0.0-next.36: - resolution: {integrity: sha512-IpvxBb5n9k5l6nikwq8mCeBg0VtSqAt7AY/PSujwjGs5KqYx3CrVu/Cyj4b0dyCO2Yyt2dr2QjS/R2R42PRBeA==} + /@sveltejs/adapter-vercel/1.0.0-next.39: + resolution: {integrity: sha512-YOPGKIILm26h22GN4/iliXce61aTG3Dq5hX8xpDx0cNuCocv0OoLfIqiGpdyJ9NIMpjwXmpVoL4+nV+yh2wcSA==} dependencies: esbuild: 0.13.15 dev: true - /@sveltejs/kit/1.0.0-next.232_sass@1.48.0+svelte@3.46.2: - resolution: {integrity: sha512-STQ0hnJozIop8k9I313nwVasBIQ45Z2K1pUOkDVjCSOGijgsj+De5q0prQBtL1ZlqqisfkYlOf8W9gvDSyTLEA==} + /@sveltejs/kit/1.0.0-next.241_sass@1.49.0+svelte@3.46.2: + resolution: {integrity: sha512-KuRXJEoSPloGxv3HYniZT2u04zwkYFk1lE1pLOyX96D5Po8CxIhBJlSo3YjTBNJ+AbN5a3T2zxLSw6azecdd7Q==} engines: {node: '>=14.13'} hasBin: true peerDependencies: svelte: ^3.44.0 dependencies: - '@sveltejs/vite-plugin-svelte': 1.0.0-next.34_svelte@3.46.2+vite@2.7.12 + '@sveltejs/vite-plugin-svelte': 1.0.0-next.35_svelte@3.46.2+vite@2.7.13 sade: 1.8.1 svelte: 3.46.2 - vite: 2.7.12_sass@1.48.0 + vite: 2.7.13_sass@1.49.0 transitivePeerDependencies: - diff-match-patch - less @@ -148,8 +148,8 @@ packages: - supports-color dev: true - /@sveltejs/vite-plugin-svelte/1.0.0-next.34_svelte@3.46.2+vite@2.7.12: - resolution: {integrity: sha512-qZH2jndijrdkvevgbO7OH3iQsviM5Kz7h5APiNP4yEMZTrwq9bifzYvco6BprwtPvLb5wYlRVFZUOdusY6AovQ==} + /@sveltejs/vite-plugin-svelte/1.0.0-next.35_svelte@3.46.2+vite@2.7.13: + resolution: {integrity: sha512-PuhI+1L6xqn5gc6jiK4mHmeS8kf3c1E+IaAsJclHbZTNiPQdC5SiTM3cV0FAA4zhwHmXV6pjt8rRHRx8ouFv3g==} engines: {node: ^14.13.1 || >= 16} peerDependencies: diff-match-patch: ^1.0.5 @@ -163,10 +163,9 @@ packages: debug: 4.3.3 kleur: 4.1.4 magic-string: 0.25.7 - require-relative: 0.8.7 svelte: 3.46.2 svelte-hmr: 0.14.9_svelte@3.46.2 - vite: 2.7.12_sass@1.48.0 + vite: 2.7.13_sass@1.49.0 transitivePeerDependencies: - supports-color dev: true @@ -179,8 +178,8 @@ packages: resolution: {integrity: sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==} dev: true - /@types/node/17.0.9: - resolution: {integrity: sha512-5dNBXu/FOER+EXnyah7rn8xlNrfMOQb/qXnw4NQgLkCygKBKhdmF/CA5oXVOKZLBEahw8s2WP9LxIcN/oDDRgQ==} + /@types/node/17.0.10: + resolution: {integrity: sha512-S/3xB4KzyFxYGCppyDt68yzBU9ysL88lSdIah4D6cptdcltc4NCPCAMc0+PCpg/lLIyC7IPvj2Z52OJWeIUkog==} dev: true /@types/pug/2.0.6: @@ -190,11 +189,11 @@ packages: /@types/sass/1.43.1: resolution: {integrity: sha512-BPdoIt1lfJ6B7rw35ncdwBZrAssjcwzI5LByIrYs+tpXlj/CAkuVdRsgZDdP4lq5EjyWzwxZCqAoFyHKFwp32g==} dependencies: - '@types/node': 17.0.9 + '@types/node': 17.0.10 dev: true - /@typescript-eslint/eslint-plugin/5.9.1_bbe74534e31a8c21f1b3522447c55341: - resolution: {integrity: sha512-Xv9tkFlyD4MQGpJgTo6wqDqGvHIRmRgah/2Sjz1PUnJTawjHWIwBivUE9x0QtU2WVii9baYgavo/bHjrZJkqTw==} + /@typescript-eslint/eslint-plugin/5.10.0_706fb07ce74b1db611f19a02ad2ce784: + resolution: {integrity: sha512-XXVKnMsq2fuu9K2KsIxPUGqb6xAImz8MEChClbXmE3VbveFtBUU5bzM6IPVWqzyADIgdkS2Ws/6Xo7W2TeZWjQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: '@typescript-eslint/parser': ^5.0.0 @@ -204,42 +203,24 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/experimental-utils': 5.9.1_eslint@8.7.0+typescript@4.5.4 - '@typescript-eslint/parser': 5.9.1_eslint@8.7.0+typescript@4.5.4 - '@typescript-eslint/scope-manager': 5.9.1 - '@typescript-eslint/type-utils': 5.9.1_eslint@8.7.0+typescript@4.5.4 + '@typescript-eslint/parser': 5.10.0_eslint@8.7.0+typescript@4.5.5 + '@typescript-eslint/scope-manager': 5.10.0 + '@typescript-eslint/type-utils': 5.10.0_eslint@8.7.0+typescript@4.5.5 + '@typescript-eslint/utils': 5.10.0_eslint@8.7.0+typescript@4.5.5 debug: 4.3.3 eslint: 8.7.0 functional-red-black-tree: 1.0.1 ignore: 5.2.0 regexpp: 3.2.0 semver: 7.3.5 - tsutils: 3.21.0_typescript@4.5.4 - typescript: 4.5.4 + tsutils: 3.21.0_typescript@4.5.5 + typescript: 4.5.5 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/experimental-utils/5.9.1_eslint@8.7.0+typescript@4.5.4: - resolution: {integrity: sha512-cb1Njyss0mLL9kLXgS/eEY53SZQ9sT519wpX3i+U457l2UXRDuo87hgKfgRazmu9/tQb0x2sr3Y0yrU+Zz0y+w==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - dependencies: - '@types/json-schema': 7.0.9 - '@typescript-eslint/scope-manager': 5.9.1 - '@typescript-eslint/types': 5.9.1 - '@typescript-eslint/typescript-estree': 5.9.1_typescript@4.5.4 - eslint: 8.7.0 - eslint-scope: 5.1.1 - eslint-utils: 3.0.0_eslint@8.7.0 - transitivePeerDependencies: - - supports-color - - typescript - dev: true - - /@typescript-eslint/parser/5.9.1_eslint@8.7.0+typescript@4.5.4: - resolution: {integrity: sha512-PLYO0AmwD6s6n0ZQB5kqPgfvh73p0+VqopQQLuNfi7Lm0EpfKyDalchpVwkE+81k5HeiRrTV/9w1aNHzjD7C4g==} + /@typescript-eslint/parser/5.10.0_eslint@8.7.0+typescript@4.5.5: + resolution: {integrity: sha512-pJB2CCeHWtwOAeIxv8CHVGJhI5FNyJAIpx5Pt72YkK3QfEzt6qAlXZuyaBmyfOdM62qU0rbxJzNToPTVeJGrQw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -248,26 +229,26 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 5.9.1 - '@typescript-eslint/types': 5.9.1 - '@typescript-eslint/typescript-estree': 5.9.1_typescript@4.5.4 + '@typescript-eslint/scope-manager': 5.10.0 + '@typescript-eslint/types': 5.10.0 + '@typescript-eslint/typescript-estree': 5.10.0_typescript@4.5.5 debug: 4.3.3 eslint: 8.7.0 - typescript: 4.5.4 + typescript: 4.5.5 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/scope-manager/5.9.1: - resolution: {integrity: sha512-8BwvWkho3B/UOtzRyW07ffJXPaLSUKFBjpq8aqsRvu6HdEuzCY57+ffT7QoV4QXJXWSU1+7g3wE4AlgImmQ9pQ==} + /@typescript-eslint/scope-manager/5.10.0: + resolution: {integrity: sha512-tgNgUgb4MhqK6DoKn3RBhyZ9aJga7EQrw+2/OiDk5hKf3pTVZWyqBi7ukP+Z0iEEDMF5FDa64LqODzlfE4O/Dg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.9.1 - '@typescript-eslint/visitor-keys': 5.9.1 + '@typescript-eslint/types': 5.10.0 + '@typescript-eslint/visitor-keys': 5.10.0 dev: true - /@typescript-eslint/type-utils/5.9.1_eslint@8.7.0+typescript@4.5.4: - resolution: {integrity: sha512-tRSpdBnPRssjlUh35rE9ug5HrUvaB9ntREy7gPXXKwmIx61TNN7+l5YKgi1hMKxo5NvqZCfYhA5FvyuJG6X6vg==} + /@typescript-eslint/type-utils/5.10.0_eslint@8.7.0+typescript@4.5.5: + resolution: {integrity: sha512-TzlyTmufJO5V886N+hTJBGIfnjQDQ32rJYxPaeiyWKdjsv2Ld5l8cbS7pxim4DeNs62fKzRSt8Q14Evs4JnZyQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: '*' @@ -276,22 +257,22 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/experimental-utils': 5.9.1_eslint@8.7.0+typescript@4.5.4 + '@typescript-eslint/utils': 5.10.0_eslint@8.7.0+typescript@4.5.5 debug: 4.3.3 eslint: 8.7.0 - tsutils: 3.21.0_typescript@4.5.4 - typescript: 4.5.4 + tsutils: 3.21.0_typescript@4.5.5 + typescript: 4.5.5 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/types/5.9.1: - resolution: {integrity: sha512-SsWegWudWpkZCwwYcKoDwuAjoZXnM1y2EbEerTHho19Hmm+bQ56QG4L4jrtCu0bI5STaRTvRTZmjprWlTw/5NQ==} + /@typescript-eslint/types/5.10.0: + resolution: {integrity: sha512-wUljCgkqHsMZbw60IbOqT/puLfyqqD5PquGiBo1u1IS3PLxdi3RDGlyf032IJyh+eQoGhz9kzhtZa+VC4eWTlQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/typescript-estree/5.9.1_typescript@4.5.4: - resolution: {integrity: sha512-gL1sP6A/KG0HwrahVXI9fZyeVTxEYV//6PmcOn1tD0rw8VhUWYeZeuWHwwhnewnvEMcHjhnJLOBhA9rK4vmb8A==} + /@typescript-eslint/typescript-estree/5.10.0_typescript@4.5.5: + resolution: {integrity: sha512-x+7e5IqfwLwsxTdliHRtlIYkgdtYXzE0CkFeV6ytAqq431ZyxCFzNMNR5sr3WOlIG/ihVZr9K/y71VHTF/DUQA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: typescript: '*' @@ -299,23 +280,41 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 5.9.1 - '@typescript-eslint/visitor-keys': 5.9.1 + '@typescript-eslint/types': 5.10.0 + '@typescript-eslint/visitor-keys': 5.10.0 debug: 4.3.3 globby: 11.1.0 is-glob: 4.0.3 semver: 7.3.5 - tsutils: 3.21.0_typescript@4.5.4 - typescript: 4.5.4 + tsutils: 3.21.0_typescript@4.5.5 + typescript: 4.5.5 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/visitor-keys/5.9.1: - resolution: {integrity: sha512-Xh37pNz9e9ryW4TVdwiFzmr4hloty8cFj8GTWMXh3Z8swGwyQWeCcNgF0hm6t09iZd6eiZmIf4zHedQVP6TVtg==} + /@typescript-eslint/utils/5.10.0_eslint@8.7.0+typescript@4.5.5: + resolution: {integrity: sha512-IGYwlt1CVcFoE2ueW4/ioEwybR60RAdGeiJX/iDAw0t5w0wK3S7QncDwpmsM70nKgGTuVchEWB8lwZwHqPAWRg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + dependencies: + '@types/json-schema': 7.0.9 + '@typescript-eslint/scope-manager': 5.10.0 + '@typescript-eslint/types': 5.10.0 + '@typescript-eslint/typescript-estree': 5.10.0_typescript@4.5.5 + eslint: 8.7.0 + eslint-scope: 5.1.1 + eslint-utils: 3.0.0_eslint@8.7.0 + transitivePeerDependencies: + - supports-color + - typescript + dev: true + + /@typescript-eslint/visitor-keys/5.10.0: + resolution: {integrity: sha512-GMxj0K1uyrFLPKASLmZzCuSddmjZVbVj3Ouy5QVuIGKZopxvOr24JsS7gruz6C3GExE01mublZ3mIBOaon9zuQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.9.1 + '@typescript-eslint/types': 5.10.0 eslint-visitor-keys: 3.2.0 dev: true @@ -415,8 +414,8 @@ packages: supports-color: 7.2.0 dev: true - /chokidar/3.5.2: - resolution: {integrity: sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==} + /chokidar/3.5.3: + resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} engines: {node: '>= 8.10.0'} dependencies: anymatch: 3.1.2 @@ -493,8 +492,8 @@ packages: esutils: 2.0.3 dev: true - /embla-carousel/5.0.1: - resolution: {integrity: sha512-pFvUI9mI/pxU92+4VDkPx0yP4Bs3VqJuRX/aw6ESYJdRBtzLx+6X2kXMu9aXK+SwO2zYsD2WURb1SeBaAv6zQA==} + /embla-carousel/6.1.1: + resolution: {integrity: sha512-viRoyGYrUALxX/2g6P4bU+Q3lQPeeUt2StcMq3Ketn6lmNOVc7q7cKwiBVqXV+aEIqe/EgCLQZNajewrRKR+Pg==} dev: false /es6-promise/3.3.1: @@ -1163,7 +1162,7 @@ packages: dependencies: nanoid: 3.2.0 picocolors: 1.0.0 - source-map-js: 1.0.1 + source-map-js: 1.0.2 dev: true /prelude-ls/1.2.1: @@ -1192,17 +1191,13 @@ packages: engines: {node: '>=8'} dev: true - /require-relative/0.8.7: - resolution: {integrity: sha1-eZlTn8ngR6N5KPoZb44VY9q9Nt4=} - dev: true - /resolve-from/4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} dev: true - /resolve/1.21.0: - resolution: {integrity: sha512-3wCbTpk5WJlyE4mSOtDLhqQmGFi0/TD9VPwmiolnk8U0wRgMEktqCXd3vy5buTO3tljvalNvKrjHEfrd2WpEKA==} + /resolve/1.22.0: + resolution: {integrity: sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==} hasBin: true dependencies: is-core-module: 2.8.1 @@ -1229,8 +1224,8 @@ packages: glob: 7.2.0 dev: true - /rollup/2.64.0: - resolution: {integrity: sha512-+c+lbw1lexBKSMb1yxGDVfJ+vchJH3qLbmavR+awDinTDA2C5Ug9u7lkOzj62SCu0PKUExsW36tpgW7Fmpn3yQ==} + /rollup/2.66.0: + resolution: {integrity: sha512-L6mKOkdyP8HK5kKJXaiWG7KZDumPJjuo1P+cfyHOJPNNTK3Moe7zCH5+fy7v8pVmHXtlxorzaBjvkBMB23s98g==} engines: {node: '>=10.0.0'} hasBin: true optionalDependencies: @@ -1263,14 +1258,14 @@ packages: resolution: {integrity: sha512-ZRwKbh/eQ6w9vmTjkuG0Ioi3HBwPFce0O+v//ve+aOq1oeCy7jMV2qzzAlpsNuqpqCBjjriM1lbtZbF/Q8jVyA==} dev: false - /sass/1.48.0: - resolution: {integrity: sha512-hQi5g4DcfjcipotoHZ80l7GNJHGqQS5LwMBjVYB/TaT0vcSSpbgM8Ad7cgfsB2M0MinbkEQQPO9+sjjSiwxqmw==} + /sass/1.49.0: + resolution: {integrity: sha512-TVwVdNDj6p6b4QymJtNtRS2YtLJ/CqZriGg0eIAbAKMlN8Xy6kbv33FsEZSF7FufFFM705SQviHjjThfaQ4VNw==} engines: {node: '>=8.9.0'} hasBin: true dependencies: - chokidar: 3.5.2 + chokidar: 3.5.3 immutable: 4.0.0 - source-map-js: 1.0.1 + source-map-js: 1.0.2 dev: true /semver/7.3.5: @@ -1308,8 +1303,8 @@ packages: sourcemap-codec: 1.4.8 dev: true - /source-map-js/1.0.1: - resolution: {integrity: sha512-4+TN2b3tqOCd/kaGRJ/sTYA0tR0mdXx26ipdolxcwtJVqEnqNYvlCAt1q3ypy4QMlYus+Zh34RNtYLoq2oQ4IA==} + /source-map-js/1.0.2: + resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} engines: {node: '>=0.10.0'} dev: true @@ -1353,13 +1348,13 @@ packages: engines: {node: '>= 0.4'} dev: true - /svelte-check/2.3.0_sass@1.48.0+svelte@3.46.2: + /svelte-check/2.3.0_sass@1.49.0+svelte@3.46.2: resolution: {integrity: sha512-SBKdJyUmxzPmJf/ZPqDSQOoa9JzOcgEpV7u3UaYcgVn7fA0veZ3FA5JgLU8KYtf84Gp6guBVcrC7XKLjJa5SXQ==} hasBin: true peerDependencies: svelte: ^3.24.0 dependencies: - chokidar: 3.5.2 + chokidar: 3.5.3 fast-glob: 3.2.11 import-fresh: 3.3.0 minimist: 1.2.5 @@ -1367,8 +1362,8 @@ packages: sade: 1.8.1 source-map: 0.7.3 svelte: 3.46.2 - svelte-preprocess: 4.10.1_29e62301fc182049204f5f6a0272225d - typescript: 4.5.4 + svelte-preprocess: 4.10.2_7185e5bbca9941e8a76052fa3c9acf72 + typescript: 4.5.5 transitivePeerDependencies: - '@babel/core' - coffeescript @@ -1390,20 +1385,20 @@ packages: svelte: 3.46.2 dev: true - /svelte-preprocess/4.10.1_29e62301fc182049204f5f6a0272225d: - resolution: {integrity: sha512-NSNloaylf+o9UeyUR2KvpdxrAyMdHl3U7rMnoP06/sG0iwJvlUM4TpMno13RaNqovh4AAoGsx1jeYcIyuGUXMw==} + /svelte-preprocess/4.10.2_7185e5bbca9941e8a76052fa3c9acf72: + resolution: {integrity: sha512-aPpkCreSo8EL/y8kJSa1trhiX0oyAtTjlNNM7BNjRAsMJ8Yy2LtqHt0zyd4pQPXt+D4PzbO3qTjjio3kwOxDlA==} engines: {node: '>= 9.11.2'} requiresBuild: true peerDependencies: '@babel/core': ^7.10.2 coffeescript: ^2.5.1 - less: ^3.11.3 + less: ^3.11.3 || ^4.0.0 node-sass: '*' postcss: ^7 || ^8 postcss-load-config: ^2.1.0 || ^3.0.0 pug: ^3.0.0 sass: ^1.26.8 - stylus: ^0.54.7 + stylus: ^0.55.0 sugarss: ^2.0.0 svelte: ^3.23.0 typescript: ^4.5.2 @@ -1435,11 +1430,11 @@ packages: '@types/sass': 1.43.1 detect-indent: 6.1.0 magic-string: 0.25.7 - sass: 1.48.0 + sass: 1.49.0 sorcery: 0.10.0 strip-indent: 3.0.0 svelte: 3.46.2 - typescript: 4.5.4 + typescript: 4.5.5 dev: true /svelte/3.46.2: @@ -1478,14 +1473,14 @@ packages: resolution: {integrity: sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==} dev: true - /tsutils/3.21.0_typescript@4.5.4: + /tsutils/3.21.0_typescript@4.5.5: resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} peerDependencies: typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' dependencies: tslib: 1.14.1 - typescript: 4.5.4 + typescript: 4.5.5 dev: true /type-check/0.4.0: @@ -1500,8 +1495,8 @@ packages: engines: {node: '>=10'} dev: true - /typescript/4.5.4: - resolution: {integrity: sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==} + /typescript/4.5.5: + resolution: {integrity: sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==} engines: {node: '>=4.2.0'} hasBin: true dev: true @@ -1516,8 +1511,8 @@ packages: resolution: {integrity: sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==} dev: true - /vite/2.7.12_sass@1.48.0: - resolution: {integrity: sha512-KvPYToRQWhRfBeVkyhkZ5hASuHQkqZUUdUcE3xyYtq5oYEPIJ0h9LWiWTO6v990glmSac2cEPeYeXzpX5Z6qKQ==} + /vite/2.7.13_sass@1.49.0: + resolution: {integrity: sha512-Mq8et7f3aK0SgSxjDNfOAimZGW9XryfHRa/uV0jseQSilg+KhYDSoNb9h1rknOy6SuMkvNDLKCYAYYUMCE+IgQ==} engines: {node: '>=12.2.0'} hasBin: true peerDependencies: @@ -1534,9 +1529,9 @@ packages: dependencies: esbuild: 0.13.15 postcss: 8.4.5 - resolve: 1.21.0 - rollup: 2.64.0 - sass: 1.48.0 + resolve: 1.22.0 + rollup: 2.66.0 + sass: 1.49.0 optionalDependencies: fsevents: 2.3.2 dev: true diff --git a/src/routes/api/swell.ts b/src/routes/api/swell.ts index ba49f38..c8708d9 100644 --- a/src/routes/api/swell.ts +++ b/src/routes/api/swell.ts @@ -21,16 +21,16 @@ export async function get ({ url, body }) { /** * POST request */ -export async function post ({ headers, url, body, params, ...rest }) { +export async function post ({ request, params }) { try { - const bodyParsed = JSON.parse(Buffer.from(body).toString()) - const { action, cartId, productId } = bodyParsed + const body = await request.json() + const { action, cartId, productId } = body let result = {} - if (bodyParsed) { + if (body) { switch (action) { case 'getProducts': { - result = await getProducts(bodyParsed.category) + result = await getProducts(body.category) break } case 'getProduct': { @@ -46,11 +46,11 @@ export async function post ({ headers, url, body, params, ...rest }) { break } case 'addToCart': { - result = await addToCart(cartId, productId, bodyParsed.quantity) + result = await addToCart(cartId, productId, body.quantity) break } case 'updateCartItem': { - result = await updateCartItem(cartId, productId, bodyParsed.quantity) + result = await updateCartItem(cartId, productId, body.quantity) break } case 'removeCartItem': {