From 09ed4c487d1a96129715d86524279263646ee211 Mon Sep 17 00:00:00 2001
From: Florian BOUILLON
Date: Thu, 20 Jul 2023 17:41:16 +0200
Subject: [PATCH] feat: first version
Signed-off-by: Florian BOUILLON
---
.github/workflows/build_and_check.yml | 1 -
.../spc_94f36546799342789aa1fe32dea23879.yml | 8 -
.../env_776870492ea845feb9ba8db60dfad2cd.yml | 14 -
...baf994467f850b2f5eb10e34a1d922a1554245.yml | 16 -
.../env_e53abedcd2be412c9c501073a658bedd.yml | 11 -
.../req_1515365089cb432182dbaea37363c652.yml | 25 -
.../req_1f22118c14924c109a0e570fd06332c4.yml | 35 -
.../req_3756d11c98a94741a5b2a06077b6d39f.yml | 23 -
.../req_701b1740deeb45dbb7dc94b8a2b322b7.yml | 23 -
.../req_86619e03d7094a9eb7f7ca35c7e520c2.yml | 23 -
.../req_d687fdb8d20f4a93b7d721acbdbe8f53.yml | 23 -
.../req_f64c7df01b9c4364860fe06f7ebd74bf.yml | 41 -
.../req_fa536693954e46088f9d0da033bf2f9c.yml | 23 -
.../fld_eb864538a51541fb95eca9ea362b686c.yml | 10 -
.../uts_b1a00bf2496c4cff93b7a7b2871927a9.yml | 6 -
.../wrk_3cc2135f64d540d5937412dae4d8aa07.yml | 8 -
Dockerfile | 36 +-
Dockerfile.static | 38 +
astro.config.mjs | 36 +-
cypress/README.md | 5 +
nginx.conf | 52 +
package-lock.json | 1349 ++++++++---------
package.json | 17 +-
public/logo.svg | 5 -
src/assets/README.md | 7 +
src/assets/layouts/Base/favicon.png | Bin 0 -> 1957 bytes
src/assets/layouts/Base/favicon.svg | 9 +
src/components/Favicon/Favicon.astro | 24 +
src/components/Favicon/Manifest.ts | 33 +
src/components/Passthrough/Passthrough.astro | 4 +
.../utils.ts} | 5 -
src/components/Picture.astro.tmp | 42 +
src/components/README.md | 3 +
src/content/README.md | 5 +
src/content/config.ts | 20 +-
.../docs/errors/unauthorized-access.md | 23 -
src/env.d.ts | 17 +-
src/layouts/Base.astro | 25 +
src/layouts/Layout.astro | 40 +-
src/layouts/README.md | 7 +
src/libs/AstroUtils.ts | 5 +
src/libs/AuthUtils.ts | 9 -
src/libs/CookieManager.ts | 57 -
src/libs/FilesUtils.ts | 20 -
src/libs/HTTP/StatusCode.ts | 218 +++
src/libs/README.md | 2 +-
src/libs/RateLimiter.ts | 74 -
src/libs/gcodeUtils.ts | 93 --
src/libs/validateAuth.ts | 123 --
src/middleware/README.md | 9 +
src/middleware/apiAuth.ts | 52 -
src/middleware/apiRateLimit.ts | 18 -
src/middleware/index.ts | 4 +-
src/models/APIKey/APIKeyDao.ts | 79 -
src/models/APIKey/index.ts | 8 -
src/models/Client.ts | 18 -
src/models/Config/ConfigDao.ts | 83 -
src/models/Config/index.ts | 11 -
src/models/DaoFactory.ts | 13 -
src/models/Session/SessionDao.ts | 52 -
src/models/Session/index.ts | 3 -
src/models/User/UserDao.ts | 71 -
src/models/User/index.ts | 7 -
src/pages/README.md | 5 +
src/pages/account/login.astro | 66 -
src/pages/account/register.astro | 45 -
src/pages/admin.astro | 59 -
src/pages/api/v1/slice/[configId].ts | 262 ----
.../configs/[configId]/files/[fileName].ts | 24 -
.../api/v1/users/[userId]/configs/index.ts | 45 -
src/pages/api/v1/users/[userId]/keys/index.ts | 20 -
src/pages/api/v1/users/index.ts | 17 -
src/pages/docs/[...page].astro | 24 -
src/pages/index.astro | 6 +-
tailwind.config.cjs | 7 +-
tests/README.md | 5 +
tests/basic.test.ts | 26 +-
tests/libs/authUtils.test.ts | 22 -
tests/libs/gcodeUtilts.test.ts | 50 -
tests/libs/rateLimit.test.ts | 122 --
80 files changed, 1171 insertions(+), 2755 deletions(-)
delete mode 100755 .insomnia/ApiSpec/spc_94f36546799342789aa1fe32dea23879.yml
delete mode 100755 .insomnia/Environment/env_776870492ea845feb9ba8db60dfad2cd.yml
delete mode 100755 .insomnia/Environment/env_d9baf994467f850b2f5eb10e34a1d922a1554245.yml
delete mode 100755 .insomnia/Environment/env_e53abedcd2be412c9c501073a658bedd.yml
delete mode 100755 .insomnia/Request/req_1515365089cb432182dbaea37363c652.yml
delete mode 100755 .insomnia/Request/req_1f22118c14924c109a0e570fd06332c4.yml
delete mode 100755 .insomnia/Request/req_3756d11c98a94741a5b2a06077b6d39f.yml
delete mode 100755 .insomnia/Request/req_701b1740deeb45dbb7dc94b8a2b322b7.yml
delete mode 100755 .insomnia/Request/req_86619e03d7094a9eb7f7ca35c7e520c2.yml
delete mode 100755 .insomnia/Request/req_d687fdb8d20f4a93b7d721acbdbe8f53.yml
delete mode 100755 .insomnia/Request/req_f64c7df01b9c4364860fe06f7ebd74bf.yml
delete mode 100755 .insomnia/Request/req_fa536693954e46088f9d0da033bf2f9c.yml
delete mode 100755 .insomnia/RequestGroup/fld_eb864538a51541fb95eca9ea362b686c.yml
delete mode 100755 .insomnia/UnitTestSuite/uts_b1a00bf2496c4cff93b7a7b2871927a9.yml
delete mode 100755 .insomnia/Workspace/wrk_3cc2135f64d540d5937412dae4d8aa07.yml
create mode 100644 Dockerfile.static
create mode 100644 cypress/README.md
create mode 100644 nginx.conf
delete mode 100644 public/logo.svg
create mode 100644 src/assets/README.md
create mode 100644 src/assets/layouts/Base/favicon.png
create mode 100644 src/assets/layouts/Base/favicon.svg
create mode 100644 src/components/Favicon/Favicon.astro
create mode 100644 src/components/Favicon/Manifest.ts
create mode 100644 src/components/Passthrough/Passthrough.astro
rename src/components/{Passthrough.astro => Passthrough/utils.ts} (70%)
create mode 100644 src/components/Picture.astro.tmp
create mode 100644 src/components/README.md
create mode 100644 src/content/README.md
delete mode 100644 src/content/docs/errors/unauthorized-access.md
create mode 100644 src/layouts/Base.astro
create mode 100644 src/layouts/README.md
create mode 100644 src/libs/AstroUtils.ts
delete mode 100644 src/libs/AuthUtils.ts
delete mode 100644 src/libs/CookieManager.ts
delete mode 100644 src/libs/FilesUtils.ts
delete mode 100644 src/libs/RateLimiter.ts
delete mode 100644 src/libs/gcodeUtils.ts
delete mode 100644 src/libs/validateAuth.ts
create mode 100644 src/middleware/README.md
delete mode 100644 src/middleware/apiAuth.ts
delete mode 100644 src/middleware/apiRateLimit.ts
delete mode 100644 src/models/APIKey/APIKeyDao.ts
delete mode 100644 src/models/APIKey/index.ts
delete mode 100644 src/models/Client.ts
delete mode 100644 src/models/Config/ConfigDao.ts
delete mode 100644 src/models/Config/index.ts
delete mode 100644 src/models/Session/SessionDao.ts
delete mode 100644 src/models/Session/index.ts
delete mode 100644 src/models/User/UserDao.ts
delete mode 100644 src/models/User/index.ts
create mode 100644 src/pages/README.md
delete mode 100644 src/pages/account/login.astro
delete mode 100644 src/pages/account/register.astro
delete mode 100644 src/pages/admin.astro
delete mode 100644 src/pages/api/v1/slice/[configId].ts
delete mode 100644 src/pages/api/v1/users/[userId]/configs/[configId]/files/[fileName].ts
delete mode 100644 src/pages/api/v1/users/[userId]/configs/index.ts
delete mode 100644 src/pages/api/v1/users/[userId]/keys/index.ts
delete mode 100644 src/pages/api/v1/users/index.ts
delete mode 100644 src/pages/docs/[...page].astro
create mode 100644 tests/README.md
delete mode 100644 tests/libs/authUtils.test.ts
delete mode 100644 tests/libs/gcodeUtilts.test.ts
delete mode 100644 tests/libs/rateLimit.test.ts
diff --git a/.github/workflows/build_and_check.yml b/.github/workflows/build_and_check.yml
index e4c62fc..e8c93c9 100644
--- a/.github/workflows/build_and_check.yml
+++ b/.github/workflows/build_and_check.yml
@@ -28,7 +28,6 @@ jobs:
- name: Check
run: npm run check
-
- name: Test
run : |
npm run start &
diff --git a/.insomnia/ApiSpec/spc_94f36546799342789aa1fe32dea23879.yml b/.insomnia/ApiSpec/spc_94f36546799342789aa1fe32dea23879.yml
deleted file mode 100755
index 25418b3..0000000
--- a/.insomnia/ApiSpec/spc_94f36546799342789aa1fe32dea23879.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-_id: spc_94f36546799342789aa1fe32dea23879
-type: ApiSpec
-parentId: wrk_3cc2135f64d540d5937412dae4d8aa07
-modified: 1687897230775
-created: 1686699516083
-fileName: New Document
-contents: ""
-contentType: yaml
diff --git a/.insomnia/Environment/env_776870492ea845feb9ba8db60dfad2cd.yml b/.insomnia/Environment/env_776870492ea845feb9ba8db60dfad2cd.yml
deleted file mode 100755
index 9a40f18..0000000
--- a/.insomnia/Environment/env_776870492ea845feb9ba8db60dfad2cd.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-_id: env_776870492ea845feb9ba8db60dfad2cd
-type: Environment
-parentId: env_d9baf994467f850b2f5eb10e34a1d922a1554245
-modified: 1687972720998
-created: 1687972311428
-name: Production
-data:
- BASE_URL: https://slicer.fi3d.fr
-dataPropertyOrder:
- "&":
- - BASE_URL
-color: null
-isPrivate: false
-metaSortKey: 1687972311428
diff --git a/.insomnia/Environment/env_d9baf994467f850b2f5eb10e34a1d922a1554245.yml b/.insomnia/Environment/env_d9baf994467f850b2f5eb10e34a1d922a1554245.yml
deleted file mode 100755
index 8cf4947..0000000
--- a/.insomnia/Environment/env_d9baf994467f850b2f5eb10e34a1d922a1554245.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-_id: env_d9baf994467f850b2f5eb10e34a1d922a1554245
-type: Environment
-parentId: wrk_3cc2135f64d540d5937412dae4d8aa07
-modified: 1687898302664
-created: 1686699516087
-name: Base Environment
-data:
- BASE_URL: http://localhost:3000
- API_KEY: cb021190-a2fd-4234-99c1-684391e785f7
-dataPropertyOrder:
- "&":
- - BASE_URL
- - API_KEY
-color: null
-isPrivate: false
-metaSortKey: 1686699516087
diff --git a/.insomnia/Environment/env_e53abedcd2be412c9c501073a658bedd.yml b/.insomnia/Environment/env_e53abedcd2be412c9c501073a658bedd.yml
deleted file mode 100755
index 2e0e4a3..0000000
--- a/.insomnia/Environment/env_e53abedcd2be412c9c501073a658bedd.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-_id: env_e53abedcd2be412c9c501073a658bedd
-type: Environment
-parentId: env_d9baf994467f850b2f5eb10e34a1d922a1554245
-modified: 1687972824301
-created: 1687972816648
-name: Development
-data: {}
-dataPropertyOrder: null
-color: null
-isPrivate: false
-metaSortKey: 1687972816648
diff --git a/.insomnia/Request/req_1515365089cb432182dbaea37363c652.yml b/.insomnia/Request/req_1515365089cb432182dbaea37363c652.yml
deleted file mode 100755
index 78520ae..0000000
--- a/.insomnia/Request/req_1515365089cb432182dbaea37363c652.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-_id: req_1515365089cb432182dbaea37363c652
-type: Request
-parentId: wrk_3cc2135f64d540d5937412dae4d8aa07
-modified: 1687979177027
-created: 1687383219272
-url: "{{ _.BASE_URL
- }}/api/v1/users/648f81f857503c7d29465318/configs/64936bd944de499b5483bf15/fil\
- es/config.ini"
-name: Get a file
-description: ""
-method: GET
-body: {}
-parameters: []
-headers: []
-authentication:
- type: bearer
- token: "{{ _.API_KEY }}"
-metaSortKey: -1686699516056.5
-isPrivate: false
-settingStoreCookies: true
-settingSendCookies: true
-settingDisableRenderRequestBody: false
-settingEncodeUrl: true
-settingRebuildPath: true
-settingFollowRedirects: global
diff --git a/.insomnia/Request/req_1f22118c14924c109a0e570fd06332c4.yml b/.insomnia/Request/req_1f22118c14924c109a0e570fd06332c4.yml
deleted file mode 100755
index 34bf2e0..0000000
--- a/.insomnia/Request/req_1f22118c14924c109a0e570fd06332c4.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-_id: req_1f22118c14924c109a0e570fd06332c4
-type: Request
-parentId: wrk_3cc2135f64d540d5937412dae4d8aa07
-modified: 1687979408498
-created: 1687382885330
-url: "{{ _.BASE_URL }}/api/v1/users/648f81f857503c7d29465318/configs"
-name: Create new config
-description: ""
-method: POST
-body:
- mimeType: application/json
- text: ""
-parameters:
- - id: pair_c7979be1d7bd4c219d0f613f4c778810
- name: algo
- value: filament_used_g * 5
- description: ""
- - id: pair_2c62d697fa13486dbe27897c6f44fbd2
- name: scale
- value: "2"
- description: ""
-headers:
- - name: Content-Type
- value: application/json
-authentication:
- type: bearer
- token: "{{ _.API_KEY }}"
-metaSortKey: -1686699516069
-isPrivate: false
-settingStoreCookies: true
-settingSendCookies: true
-settingDisableRenderRequestBody: false
-settingEncodeUrl: true
-settingRebuildPath: true
-settingFollowRedirects: global
diff --git a/.insomnia/Request/req_3756d11c98a94741a5b2a06077b6d39f.yml b/.insomnia/Request/req_3756d11c98a94741a5b2a06077b6d39f.yml
deleted file mode 100755
index 36a5946..0000000
--- a/.insomnia/Request/req_3756d11c98a94741a5b2a06077b6d39f.yml
+++ /dev/null
@@ -1,23 +0,0 @@
-_id: req_3756d11c98a94741a5b2a06077b6d39f
-type: Request
-parentId: fld_eb864538a51541fb95eca9ea362b686c
-modified: 1687979889111
-created: 1687979867093
-url: "{{ _.BASE_URL }}/api/v1/users"
-name: update
-description: ""
-method: PATCH
-body: {}
-parameters: []
-headers: []
-authentication:
- type: bearer
- token: "{{ _.API_KEY }}"
-metaSortKey: -1686859546747.625
-isPrivate: false
-settingStoreCookies: true
-settingSendCookies: true
-settingDisableRenderRequestBody: false
-settingEncodeUrl: true
-settingRebuildPath: true
-settingFollowRedirects: global
diff --git a/.insomnia/Request/req_701b1740deeb45dbb7dc94b8a2b322b7.yml b/.insomnia/Request/req_701b1740deeb45dbb7dc94b8a2b322b7.yml
deleted file mode 100755
index e7e603a..0000000
--- a/.insomnia/Request/req_701b1740deeb45dbb7dc94b8a2b322b7.yml
+++ /dev/null
@@ -1,23 +0,0 @@
-_id: req_701b1740deeb45dbb7dc94b8a2b322b7
-type: Request
-parentId: fld_eb864538a51541fb95eca9ea362b686c
-modified: 1687979892209
-created: 1687979842182
-url: "{{ _.BASE_URL }}/api/v1/users"
-name: create
-description: ""
-method: POST
-body: {}
-parameters: []
-headers: []
-authentication:
- type: bearer
- token: "{{ _.API_KEY }}"
-metaSortKey: -1687339638708.5
-isPrivate: false
-settingStoreCookies: true
-settingSendCookies: true
-settingDisableRenderRequestBody: false
-settingEncodeUrl: true
-settingRebuildPath: true
-settingFollowRedirects: global
diff --git a/.insomnia/Request/req_86619e03d7094a9eb7f7ca35c7e520c2.yml b/.insomnia/Request/req_86619e03d7094a9eb7f7ca35c7e520c2.yml
deleted file mode 100755
index 4d932ae..0000000
--- a/.insomnia/Request/req_86619e03d7094a9eb7f7ca35c7e520c2.yml
+++ /dev/null
@@ -1,23 +0,0 @@
-_id: req_86619e03d7094a9eb7f7ca35c7e520c2
-type: Request
-parentId: fld_eb864538a51541fb95eca9ea362b686c
-modified: 1687979887280
-created: 1687979869709
-url: "{{ _.BASE_URL }}/api/v1/users"
-name: delete
-description: ""
-method: DELETE
-body: {}
-parameters: []
-headers: []
-authentication:
- type: bearer
- token: "{{ _.API_KEY }}"
-metaSortKey: -1686779531420.8125
-isPrivate: false
-settingStoreCookies: true
-settingSendCookies: true
-settingDisableRenderRequestBody: false
-settingEncodeUrl: true
-settingRebuildPath: true
-settingFollowRedirects: global
diff --git a/.insomnia/Request/req_d687fdb8d20f4a93b7d721acbdbe8f53.yml b/.insomnia/Request/req_d687fdb8d20f4a93b7d721acbdbe8f53.yml
deleted file mode 100755
index 5f7dd6b..0000000
--- a/.insomnia/Request/req_d687fdb8d20f4a93b7d721acbdbe8f53.yml
+++ /dev/null
@@ -1,23 +0,0 @@
-_id: req_d687fdb8d20f4a93b7d721acbdbe8f53
-type: Request
-parentId: fld_eb864538a51541fb95eca9ea362b686c
-modified: 1687979809503
-created: 1687979761323
-url: "{{ _.BASE_URL }}/api/v1/users"
-name: list
-description: ""
-method: GET
-body: {}
-parameters: []
-headers: []
-authentication:
- type: bearer
- token: "{{ _.API_KEY }}"
-metaSortKey: -1687979761323
-isPrivate: false
-settingStoreCookies: true
-settingSendCookies: true
-settingDisableRenderRequestBody: false
-settingEncodeUrl: true
-settingRebuildPath: true
-settingFollowRedirects: global
diff --git a/.insomnia/Request/req_f64c7df01b9c4364860fe06f7ebd74bf.yml b/.insomnia/Request/req_f64c7df01b9c4364860fe06f7ebd74bf.yml
deleted file mode 100755
index 659a31f..0000000
--- a/.insomnia/Request/req_f64c7df01b9c4364860fe06f7ebd74bf.yml
+++ /dev/null
@@ -1,41 +0,0 @@
-_id: req_f64c7df01b9c4364860fe06f7ebd74bf
-type: Request
-parentId: wrk_3cc2135f64d540d5937412dae4d8aa07
-modified: 1687972521892
-created: 1686699516094
-url: "{{ _.BASE_URL }}/api/v1/slice/64936ba744de499b5483bf0a"
-name: Slice an object
-description: ""
-method: POST
-body:
- mimeType: application/octet-stream
- fileName: C:\Users\micro\Downloads\toad_6cm.STL
-parameters:
- - id: pair_c7979be1d7bd4c219d0f613f4c778810
- name: algo
- value: filament_used_g * 0.5
- description: ""
- - id: pair_2c62d697fa13486dbe27897c6f44fbd2
- name: scale
- value: "0.1"
- description: ""
- disabled: true
- - id: pair_ea7d519d6ad443edb3926a6831a9abbc
- name: scale-to-fit
- value: 179,179,179
- description: ""
- disabled: true
-headers:
- - name: Content-Type
- value: model/stl
-authentication:
- type: bearer
- token: cb021190-a2fd-4234-99c1-684391e785f7
-metaSortKey: -1686699516094
-isPrivate: false
-settingStoreCookies: true
-settingSendCookies: true
-settingDisableRenderRequestBody: false
-settingEncodeUrl: true
-settingRebuildPath: true
-settingFollowRedirects: global
diff --git a/.insomnia/Request/req_fa536693954e46088f9d0da033bf2f9c.yml b/.insomnia/Request/req_fa536693954e46088f9d0da033bf2f9c.yml
deleted file mode 100755
index b9218df..0000000
--- a/.insomnia/Request/req_fa536693954e46088f9d0da033bf2f9c.yml
+++ /dev/null
@@ -1,23 +0,0 @@
-_id: req_fa536693954e46088f9d0da033bf2f9c
-type: Request
-parentId: fld_eb864538a51541fb95eca9ea362b686c
-modified: 1687979848643
-created: 1687979848643
-url: "{{ _.BASE_URL }}/api/v1/users"
-name: read
-description: ""
-method: GET
-body: {}
-parameters: []
-headers: []
-authentication:
- type: bearer
- token: "{{ _.API_KEY }}"
-metaSortKey: -1687019577401.25
-isPrivate: false
-settingStoreCookies: true
-settingSendCookies: true
-settingDisableRenderRequestBody: false
-settingEncodeUrl: true
-settingRebuildPath: true
-settingFollowRedirects: global
diff --git a/.insomnia/RequestGroup/fld_eb864538a51541fb95eca9ea362b686c.yml b/.insomnia/RequestGroup/fld_eb864538a51541fb95eca9ea362b686c.yml
deleted file mode 100755
index 8d22cf7..0000000
--- a/.insomnia/RequestGroup/fld_eb864538a51541fb95eca9ea362b686c.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-_id: fld_eb864538a51541fb95eca9ea362b686c
-type: RequestGroup
-parentId: wrk_3cc2135f64d540d5937412dae4d8aa07
-modified: 1687979686748
-created: 1687979675228
-name: Users
-description: ""
-environment: {}
-environmentPropertyOrder: null
-metaSortKey: -1687299590688.0625
diff --git a/.insomnia/UnitTestSuite/uts_b1a00bf2496c4cff93b7a7b2871927a9.yml b/.insomnia/UnitTestSuite/uts_b1a00bf2496c4cff93b7a7b2871927a9.yml
deleted file mode 100755
index 0bbcd4b..0000000
--- a/.insomnia/UnitTestSuite/uts_b1a00bf2496c4cff93b7a7b2871927a9.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-_id: uts_b1a00bf2496c4cff93b7a7b2871927a9
-type: UnitTestSuite
-parentId: wrk_3cc2135f64d540d5937412dae4d8aa07
-modified: 1686699516095
-created: 1686699516095
-name: Example Test Suite
diff --git a/.insomnia/Workspace/wrk_3cc2135f64d540d5937412dae4d8aa07.yml b/.insomnia/Workspace/wrk_3cc2135f64d540d5937412dae4d8aa07.yml
deleted file mode 100755
index bdc521c..0000000
--- a/.insomnia/Workspace/wrk_3cc2135f64d540d5937412dae4d8aa07.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-_id: wrk_3cc2135f64d540d5937412dae4d8aa07
-type: Workspace
-parentId: null
-modified: 1686699516082
-created: 1686699516082
-name: New Document
-description: ""
-scope: design
diff --git a/Dockerfile b/Dockerfile
index 23f72e9..0e823b5 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,13 +1,9 @@
-# This Dockerfile allows you to run Astro using @astro/node integration
+# This Dockerfile allows you to run AstroJS in server mode
#########
# Build #
#########
-FROM node:20-alpine as BUILD_IMAGE
-
-# External deps (for node-gyp add: "python3 make g++")
-# git is used to install the npm packages with git deps
-RUN apk add --no-cache git
+FROM docker.io/node:20-alpine as BUILD_IMAGE
# run as non root user
USER node
@@ -27,36 +23,17 @@ ADD --chown=node:node . .
# build
RUN npm run build
+# remove dev deps
RUN npm prune --omit=dev
##############
# Production #
##############
-FROM node:20-slim as PROD_IMAGE
+FROM docker.io/node:20-alpine as PROD_IMAGE
# inform software to be in production
ENV NODE_ENV=production
ENV HOST=0.0.0.0
-ENV ASTRO_TELEMETRY_DISABLED=true
-
-# Download & Install Slic3r
-# RUN apt-get update \
-# && apt-get install -y --no-install-recommends \
-# slic3r \
-# && rm -rf /var/lib/apt/lists/*
-# ENV SLICER_PATH slic3r
-
-# Download & install PrusaSlicer
-RUN apt-get update \
- && apt-get install -y --no-install-recommends \
- prusa-slicer bzip2 libglu1-mesa-dev libegl-dev \
- && apt-get remove prusa-slicer -y \
- && rm -rf /var/lib/apt/lists/*
-ADD https://github.com/prusa3d/PrusaSlicer/releases/download/version_2.6.0/PrusaSlicer-2.6.0+linux-x64-GTK3-202306191220.tar.bz2 ./
-RUN tar -xvf PrusaSlicer-2.6.0+linux-x64-GTK3-202306191220.tar.bz2 -C /opt
-
-ENV PATH /opt/PrusaSlicer-2.6.0+linux-x64-GTK3-202306191220/bin:$PATH
-ENV SLICER_PATH prusa-slicer
# run as non root user
USER node
@@ -64,11 +41,6 @@ USER node
# go to work folder
WORKDIR /home/node
-# download & Install Bambu Studio
-# ADD --chown=node:node https://github.com/bambulab/BambuStudio/releases/download/v01.05.00.61/Bambu_Studio_linux_fedora_v01.05.00.61_20230314200047.AppImage ./
-# ENV SLICER_PATH /home/node/Bambu_Studio_linux_fedora_v01.05.00.61_20230314200047.AppImage
-# RUN chmod +x /home/node/Bambu_Studio_linux_fedora_v01.05.00.61_20230314200047.AppImage
-
# copy from build image
COPY --chown=node:node --from=BUILD_IMAGE /home/node/node_modules ./node_modules
COPY --chown=node:node --from=BUILD_IMAGE /home/node/dist ./dist
diff --git a/Dockerfile.static b/Dockerfile.static
new file mode 100644
index 0000000..c842299
--- /dev/null
+++ b/Dockerfile.static
@@ -0,0 +1,38 @@
+# This Dockerfile allows you to run Astro in a static container (no server side)
+
+#########
+# Build #
+#########
+FROM docker.io/node:20-alpine as BUILD_IMAGE
+
+# run as non root user
+USER node
+
+# go to user repository
+WORKDIR /home/node
+
+# Add package json
+ADD --chown=node:node package.json package-lock.json ./
+
+# install dependencies from package lock
+RUN npm ci
+
+# Add project files
+ADD --chown=node:node . .
+
+# build
+RUN npm run build
+
+##############
+# Production #
+##############
+FROM docker.io/nginx:1-alpine
+
+# go to NGINX folder
+WORKDIR /usr/share/nginx/html
+
+# Copy the nginx config
+ADD ./.docker/nginx.conf /etc/nginx/nginx.conf
+
+# Copy dist fro mthe build image
+COPY --from=BUILD_IMAGE /home/node/dist ./
diff --git a/astro.config.mjs b/astro.config.mjs
index f118839..2c61c0c 100644
--- a/astro.config.mjs
+++ b/astro.config.mjs
@@ -2,22 +2,30 @@ import { defineConfig } from 'astro/config'
import tailwind from "@astrojs/tailwind"
import node from "@astrojs/node"
+// const faviconHook = {
+// name: 'Favicon',
+// hooks: {
+// "astro:build:setup": async () => {
+// await Manifest.create('./src/assets/favicon.png', {
+// name: 'Template'
+// })
+// }
+// }
+// }
+
// https://astro.build/config
export default defineConfig({
- site: 'https://print.dzeio.com',
integrations: [tailwind()],
+ compressHTML: true,
build: {
- assets: 'assets'
+ assets: 'assets',
+ inlineStylesheets: 'auto',
+ split: true
},
server: {
- port: 3000,
host: true
},
trailingSlash: 'never',
- output: 'server',
- adapter: node({
- mode: "standalone"
- }),
vite: {
server: {
watch: {
@@ -25,5 +33,15 @@ export default defineConfig({
usePolling: !!process.env.WSL_DISTRO_NAME
}
}
- }
-})
+ },
+ experimental: {
+ assets: true
+ },
+
+ // Customizable depending on goal
+ output: 'server',
+ adapter: node({
+ mode: "standalone"
+ }),
+ site: 'https://print.dzeio.com',
+ })
diff --git a/cypress/README.md b/cypress/README.md
new file mode 100644
index 0000000..a4e8982
--- /dev/null
+++ b/cypress/README.md
@@ -0,0 +1,5 @@
+# Cypress
+
+Hold End2End tests
+
+currently WIP
diff --git a/nginx.conf b/nginx.conf
new file mode 100644
index 0000000..ef76d3b
--- /dev/null
+++ b/nginx.conf
@@ -0,0 +1,52 @@
+worker_processes 1;
+
+events {
+ worker_connections 1024;
+}
+
+http {
+ server {
+ listen 3000;
+ listen [::]:3000;
+
+ server_name _;
+
+ root /usr/share/nginx/html;
+ index index.html index.htm;
+ include /etc/nginx/mime.types;
+
+ gzip on;
+ gzip_min_length 1000;
+ gzip_proxied expired no-cache no-store private auth;
+ gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
+
+ error_page 404 /404.html;
+ error_page 500 502 503 504 /500.html;
+
+ location / {
+ try_files $uri $uri.html /$uri /index.html;
+ }
+
+ # Plausible script
+ location /js/index.js {
+ # Change this if you use a different variant of the script
+ proxy_pass https://plausible.io/js/script.js;
+ proxy_set_header Host plausible.io;
+
+ # Tiny, negligible performance improvement. Very optional.
+ proxy_buffering on;
+ }
+
+ # Plausible script
+ location /api/event {
+ proxy_pass https://plausible.io/api/event;
+ proxy_set_header Host plausible.io;
+ proxy_buffering on;
+ proxy_http_version 1.1;
+
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ proxy_set_header X-Forwarded-Host $host;
+ }
+ }
+}
diff --git a/package-lock.json b/package-lock.json
index 18a93c0..972de31 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,10 @@
{
"name": "@fi3d/slicer-as-a-service",
- "version": "0.0.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@fi3d/slicer-as-a-service",
- "version": "0.0.1",
"dependencies": {
"@astrojs/node": "^5",
"@astrojs/tailwind": "^3",
@@ -14,17 +12,10 @@
"@dzeio/object-util": "^1",
"@dzeio/url-manager": "^1",
"astro": "^2",
- "bcryptjs": "^2",
- "jsonwebtoken": "^9",
- "lucide-astro": "^0.256.1",
- "mathjs": "^11",
- "mongoose": "^7",
+ "lucide-astro": "^0.261.0",
"tailwindcss": "^3"
},
"devDependencies": {
- "@tailwindcss/typography": "^0.5.9",
- "@types/bcryptjs": "^2",
- "@types/jsonwebtoken": "^9",
"@types/node": "^20",
"@vitest/coverage-v8": "^0.32.2",
"cypress": "^12",
@@ -55,9 +46,9 @@
}
},
"node_modules/@astrojs/compiler": {
- "version": "1.5.2",
- "resolved": "https://registry.npmjs.org/@astrojs/compiler/-/compiler-1.5.2.tgz",
- "integrity": "sha512-EZ3d5UTqN71N2zE3VdzVJeM+dM+pu0wV/jOi6g2VDU21LQTWozafsFMpbcLE/ksmTmbQM90/Tnn19/IR9fWGUw=="
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/@astrojs/compiler/-/compiler-1.6.0.tgz",
+ "integrity": "sha512-vxuzp09jAW/ZQ8C4Itf6/OsF76TNjBQC06FNpcayKOzxYkCGHTLh7+0lF4ywmG/fDgSc+f1x7kKxxEKl4nqXvQ=="
},
"node_modules/@astrojs/internal-helpers": {
"version": "0.1.1",
@@ -192,33 +183,33 @@
}
},
"node_modules/@babel/compat-data": {
- "version": "7.22.5",
- "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.5.tgz",
- "integrity": "sha512-4Jc/YuIaYqKnDDz892kPIledykKg12Aw1PYX5i/TY28anJtacvM1Rrr8wbieB9GfEJwlzqT0hUEao0CxEebiDA==",
+ "version": "7.22.9",
+ "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.9.tgz",
+ "integrity": "sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ==",
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/core": {
- "version": "7.22.5",
- "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.5.tgz",
- "integrity": "sha512-SBuTAjg91A3eKOvD+bPEz3LlhHZRNu1nFOVts9lzDJTXshHTjII0BAtDS3Y2DAkdZdDKWVZGVwkDfc4Clxn1dg==",
+ "version": "7.22.9",
+ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.9.tgz",
+ "integrity": "sha512-G2EgeufBcYw27U4hhoIwFcgc1XU7TlXJ3mv04oOv1WCuo900U/anZSPzEqNjwdjgffkk2Gs0AN0dW1CKVLcG7w==",
"dependencies": {
"@ampproject/remapping": "^2.2.0",
"@babel/code-frame": "^7.22.5",
- "@babel/generator": "^7.22.5",
- "@babel/helper-compilation-targets": "^7.22.5",
- "@babel/helper-module-transforms": "^7.22.5",
- "@babel/helpers": "^7.22.5",
- "@babel/parser": "^7.22.5",
+ "@babel/generator": "^7.22.9",
+ "@babel/helper-compilation-targets": "^7.22.9",
+ "@babel/helper-module-transforms": "^7.22.9",
+ "@babel/helpers": "^7.22.6",
+ "@babel/parser": "^7.22.7",
"@babel/template": "^7.22.5",
- "@babel/traverse": "^7.22.5",
+ "@babel/traverse": "^7.22.8",
"@babel/types": "^7.22.5",
"convert-source-map": "^1.7.0",
"debug": "^4.1.0",
"gensync": "^1.0.0-beta.2",
"json5": "^2.2.2",
- "semver": "^6.3.0"
+ "semver": "^6.3.1"
},
"engines": {
"node": ">=6.9.0"
@@ -229,17 +220,17 @@
}
},
"node_modules/@babel/core/node_modules/semver": {
- "version": "6.3.0",
- "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
- "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
"bin": {
"semver": "bin/semver.js"
}
},
"node_modules/@babel/generator": {
- "version": "7.22.5",
- "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.5.tgz",
- "integrity": "sha512-+lcUbnTRhd0jOewtFSedLyiPsD5tswKkbgcezOqqWFUVNEwoUTlpPOBmvhG7OXWLR4jMdv0czPGH5XbflnD1EA==",
+ "version": "7.22.9",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.9.tgz",
+ "integrity": "sha512-KtLMbmicyuK2Ak/FTCJVbDnkN1SlT8/kceFTiuDiiRUUSMnHMidxSCdG4ndkTOHHpoomWe/4xkvHkEOncwjYIw==",
"dependencies": {
"@babel/types": "^7.22.5",
"@jridgewell/gen-mapping": "^0.3.2",
@@ -262,15 +253,15 @@
}
},
"node_modules/@babel/helper-compilation-targets": {
- "version": "7.22.5",
- "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.5.tgz",
- "integrity": "sha512-Ji+ywpHeuqxB8WDxraCiqR0xfhYjiDE/e6k7FuIaANnoOFxAHskHChz4vA1mJC9Lbm01s1PVAGhQY4FUKSkGZw==",
+ "version": "7.22.9",
+ "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.9.tgz",
+ "integrity": "sha512-7qYrNM6HjpnPHJbopxmb8hSPoZ0gsX8IvUS32JGVoy+pU9e5N0nLr1VjJoR6kA4d9dmGLxNYOjeB8sUDal2WMw==",
"dependencies": {
- "@babel/compat-data": "^7.22.5",
+ "@babel/compat-data": "^7.22.9",
"@babel/helper-validator-option": "^7.22.5",
- "browserslist": "^4.21.3",
+ "browserslist": "^4.21.9",
"lru-cache": "^5.1.1",
- "semver": "^6.3.0"
+ "semver": "^6.3.1"
},
"engines": {
"node": ">=6.9.0"
@@ -280,9 +271,9 @@
}
},
"node_modules/@babel/helper-compilation-targets/node_modules/semver": {
- "version": "6.3.0",
- "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
- "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
"bin": {
"semver": "bin/semver.js"
}
@@ -330,21 +321,21 @@
}
},
"node_modules/@babel/helper-module-transforms": {
- "version": "7.22.5",
- "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.5.tgz",
- "integrity": "sha512-+hGKDt/Ze8GFExiVHno/2dvG5IdstpzCq0y4Qc9OJ25D4q3pKfiIP/4Vp3/JvhDkLKsDK2api3q3fpIgiIF5bw==",
+ "version": "7.22.9",
+ "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.9.tgz",
+ "integrity": "sha512-t+WA2Xn5K+rTeGtC8jCsdAH52bjggG5TKRuRrAGNM/mjIbO4GxvlLMFOEz9wXY5I2XQ60PMFsAG2WIcG82dQMQ==",
"dependencies": {
"@babel/helper-environment-visitor": "^7.22.5",
"@babel/helper-module-imports": "^7.22.5",
"@babel/helper-simple-access": "^7.22.5",
- "@babel/helper-split-export-declaration": "^7.22.5",
- "@babel/helper-validator-identifier": "^7.22.5",
- "@babel/template": "^7.22.5",
- "@babel/traverse": "^7.22.5",
- "@babel/types": "^7.22.5"
+ "@babel/helper-split-export-declaration": "^7.22.6",
+ "@babel/helper-validator-identifier": "^7.22.5"
},
"engines": {
"node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0"
}
},
"node_modules/@babel/helper-plugin-utils": {
@@ -367,9 +358,9 @@
}
},
"node_modules/@babel/helper-split-export-declaration": {
- "version": "7.22.5",
- "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.5.tgz",
- "integrity": "sha512-thqK5QFghPKWLhAV321lxF95yCg2K3Ob5yw+M3VHWfdia0IkPXUtoLH8x/6Fh486QUvzhb8YOWHChTVen2/PoQ==",
+ "version": "7.22.6",
+ "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz",
+ "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==",
"dependencies": {
"@babel/types": "^7.22.5"
},
@@ -402,12 +393,12 @@
}
},
"node_modules/@babel/helpers": {
- "version": "7.22.5",
- "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.22.5.tgz",
- "integrity": "sha512-pSXRmfE1vzcUIDFQcSGA5Mr+GxBV9oiRKDuDxXvWQQBCh8HoIjs/2DlDB7H8smac1IVrB9/xdXj2N3Wol9Cr+Q==",
+ "version": "7.22.6",
+ "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.22.6.tgz",
+ "integrity": "sha512-YjDs6y/fVOYFV8hAf1rxd1QvR9wJe1pDBZ2AREKq/SDayfPzgk0PBnVuTCE5X1acEpMMNOVUqoe+OwiZGJ+OaA==",
"dependencies": {
"@babel/template": "^7.22.5",
- "@babel/traverse": "^7.22.5",
+ "@babel/traverse": "^7.22.6",
"@babel/types": "^7.22.5"
},
"engines": {
@@ -428,9 +419,9 @@
}
},
"node_modules/@babel/parser": {
- "version": "7.22.5",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.5.tgz",
- "integrity": "sha512-DFZMC9LJUG9PLOclRC32G63UXwzqS2koQC8dkx+PLdmt1xSePYpbT/NbsrJy8Q/muXz7o/h/d4A7Fuyixm559Q==",
+ "version": "7.22.7",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.7.tgz",
+ "integrity": "sha512-7NF8pOkHP5o2vpmGgNGcfAeCvOYhGLyA3Z4eBQkT1RJlWu47n63bCs93QfJ2hIAFCil7L5P2IWhs1oToVgrL0Q==",
"bin": {
"parser": "bin/babel-parser.js"
},
@@ -470,17 +461,6 @@
"@babel/core": "^7.0.0-0"
}
},
- "node_modules/@babel/runtime": {
- "version": "7.22.5",
- "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.5.tgz",
- "integrity": "sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA==",
- "dependencies": {
- "regenerator-runtime": "^0.13.11"
- },
- "engines": {
- "node": ">=6.9.0"
- }
- },
"node_modules/@babel/template": {
"version": "7.22.5",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.5.tgz",
@@ -495,17 +475,17 @@
}
},
"node_modules/@babel/traverse": {
- "version": "7.22.5",
- "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.5.tgz",
- "integrity": "sha512-7DuIjPgERaNo6r+PZwItpjCZEa5vyw4eJGufeLxrPdBXBoLcCJCIasvK6pK/9DVNrLZTLFhUGqaC6X/PA007TQ==",
+ "version": "7.22.8",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.8.tgz",
+ "integrity": "sha512-y6LPR+wpM2I3qJrsheCTwhIinzkETbplIgPBbwvqPKc+uljeA5gP+3nP8irdYt1mjQaDnlIcG+dw8OjAco4GXw==",
"dependencies": {
"@babel/code-frame": "^7.22.5",
- "@babel/generator": "^7.22.5",
+ "@babel/generator": "^7.22.7",
"@babel/helper-environment-visitor": "^7.22.5",
"@babel/helper-function-name": "^7.22.5",
"@babel/helper-hoist-variables": "^7.22.5",
- "@babel/helper-split-export-declaration": "^7.22.5",
- "@babel/parser": "^7.22.5",
+ "@babel/helper-split-export-declaration": "^7.22.6",
+ "@babel/parser": "^7.22.7",
"@babel/types": "^7.22.5",
"debug": "^4.1.0",
"globals": "^11.1.0"
@@ -592,22 +572,22 @@
}
},
"node_modules/@dzeio/logger": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/@dzeio/logger/-/logger-3.2.0.tgz",
- "integrity": "sha512-ovU8iB1j00uvPbcyA/Q3dCkVSvUCq+ki843kW0p/gLZXwevrO+uA/AD4bwrv7tJB46ryo1FQl6V0fsfJ2HUo9w==",
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/@dzeio/logger/-/logger-3.2.1.tgz",
+ "integrity": "sha512-CuXsgKjip39rKrtdVYWQNJSJOQEwcMr60vifErCRjs6WUWaB1u1uR4H87uoKyWLv8EJKUWgVm59VXJF/NWJ6mw==",
"dependencies": {
"colorette": "^2.0.20"
}
},
"node_modules/@dzeio/object-util": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/@dzeio/object-util/-/object-util-1.6.0.tgz",
- "integrity": "sha512-6alYWBJUj6iK5jnl8t890PK9n9J2BMcOB0aovSgiUyJxpe/RkNgv8Sba8i6GTkOA0pEgxF6OuR5wvGVrD9Szyw=="
+ "version": "1.6.1",
+ "resolved": "https://registry.npmjs.org/@dzeio/object-util/-/object-util-1.6.1.tgz",
+ "integrity": "sha512-iIf/b9KgoI6BCeJtlxAeqXAeH2tfADy4a322vafhR/YRvNCeT2dkFStsynRAobYvl1lcbGd2DGOhQa/KMGE5hg=="
},
"node_modules/@dzeio/url-manager": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@dzeio/url-manager/-/url-manager-1.1.0.tgz",
- "integrity": "sha512-LkslGBDHKw4l92grgvy4hTn6z93PQ+AKiQ6Brq6hiteVYtghTZWK4+IU+xX13C+8McB1eM+iuJIPHC9hTL4hfQ==",
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@dzeio/url-manager/-/url-manager-1.1.2.tgz",
+ "integrity": "sha512-rIEikEY/l1lQ6an4+Do5zwhavp2+YmW0L0u/2wBYC1xF7lzRALfFLVQD1nlqPfcsjNFymWeYJzt5yyQPUUBlmw==",
"dependencies": {
"@dzeio/object-util": "^1.5.0"
}
@@ -972,6 +952,18 @@
"node": ">=8"
}
},
+ "node_modules/@jest/schemas": {
+ "version": "29.6.0",
+ "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.0.tgz",
+ "integrity": "sha512-rxLjXyJBTL4LQeJW3aKo0M/+GkCOXsO+8i9Iu7eDb6KwtP65ayoDsitrdPBtujxQ88k4wI2FNYfa6TOGwSn6cQ==",
+ "dev": true,
+ "dependencies": {
+ "@sinclair/typebox": "^0.27.8"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
"node_modules/@jridgewell/gen-mapping": {
"version": "0.3.3",
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz",
@@ -1053,16 +1045,16 @@
}
},
"node_modules/@pkgr/utils": {
- "version": "2.4.1",
- "resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.4.1.tgz",
- "integrity": "sha512-JOqwkgFEyi+OROIyq7l4Jy28h/WwhDnG/cPkXG2Z1iFbubB6jsHW1NDvmyOzTBxHr3yg68YGirmh1JUgMqa+9w==",
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.4.2.tgz",
+ "integrity": "sha512-POgTXhjrTfbTV63DiFXav4lBHiICLKKwDeaKn9Nphwj7WH6m0hMMCaJkMyRWjgtPFyRKRVoMXXjczsTQRDEhYw==",
"dependencies": {
"cross-spawn": "^7.0.3",
- "fast-glob": "^3.2.12",
+ "fast-glob": "^3.3.0",
"is-glob": "^4.0.3",
"open": "^9.1.0",
"picocolors": "^1.0.0",
- "tslib": "^2.5.0"
+ "tslib": "^2.6.0"
},
"engines": {
"node": "^12.20.0 || ^14.18.0 || >=16.0.0"
@@ -1080,20 +1072,11 @@
"escalade": "^3.1.1"
}
},
- "node_modules/@tailwindcss/typography": {
- "version": "0.5.9",
- "resolved": "https://registry.npmjs.org/@tailwindcss/typography/-/typography-0.5.9.tgz",
- "integrity": "sha512-t8Sg3DyynFysV9f4JDOVISGsjazNb48AeIYQwcL+Bsq5uf4RYL75C1giZ43KISjeDGBaTN3Kxh7Xj/vRSMJUUg==",
- "dev": true,
- "dependencies": {
- "lodash.castarray": "^4.4.0",
- "lodash.isplainobject": "^4.0.6",
- "lodash.merge": "^4.6.2",
- "postcss-selector-parser": "6.0.10"
- },
- "peerDependencies": {
- "tailwindcss": ">=3.0.0 || insiders"
- }
+ "node_modules/@sinclair/typebox": {
+ "version": "0.27.8",
+ "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz",
+ "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==",
+ "dev": true
},
"node_modules/@types/babel__core": {
"version": "7.20.1",
@@ -1132,12 +1115,6 @@
"@babel/types": "^7.20.7"
}
},
- "node_modules/@types/bcryptjs": {
- "version": "2.4.2",
- "resolved": "https://registry.npmjs.org/@types/bcryptjs/-/bcryptjs-2.4.2.tgz",
- "integrity": "sha512-LiMQ6EOPob/4yUL66SZzu6Yh77cbzJFYll+ZfaPiPPFswtIlA/Fs1MzdKYA7JApHU49zQTbJGX3PDmCpIdDBRQ==",
- "dev": true
- },
"node_modules/@types/chai": {
"version": "4.3.5",
"resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.5.tgz",
@@ -1162,11 +1139,11 @@
}
},
"node_modules/@types/hast": {
- "version": "2.3.4",
- "resolved": "https://registry.npmjs.org/@types/hast/-/hast-2.3.4.tgz",
- "integrity": "sha512-wLEm0QvaoawEDoTRwzTXp4b4jpwiJDvR5KMnFnVodm3scufTlBOWRD6N1OBf9TZMhjlNsSfcO5V+7AF4+Vy+9g==",
+ "version": "2.3.5",
+ "resolved": "https://registry.npmjs.org/@types/hast/-/hast-2.3.5.tgz",
+ "integrity": "sha512-SvQi0L/lNpThgPoleH53cdjB3y9zpLlVjRbqB3rH8hx1jiRSBGAhyjV3H+URFjNVRqt2EdYNrbZE5IsGlNfpRg==",
"dependencies": {
- "@types/unist": "*"
+ "@types/unist": "^2"
}
},
"node_modules/@types/istanbul-lib-coverage": {
@@ -1180,21 +1157,12 @@
"resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.30.tgz",
"integrity": "sha512-sqm9g7mHlPY/43fcSNrCYfOeX9zkTTK+euO5E6+CVijSMm5tTjkVdwdqRkY3ljjIAf8679vps5jKUoJBCLsMDA=="
},
- "node_modules/@types/jsonwebtoken": {
- "version": "9.0.2",
- "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz",
- "integrity": "sha512-drE6uz7QBKq1fYqqoFKTDRdFCPHd5TCub75BM+D+cMx7NU9hUz7SESLfC2fSCXVFMO5Yj8sOWHuGqPgjc+fz0Q==",
- "dev": true,
- "dependencies": {
- "@types/node": "*"
- }
- },
"node_modules/@types/mdast": {
- "version": "3.0.11",
- "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.11.tgz",
- "integrity": "sha512-Y/uImid8aAwrEA24/1tcRZwpxX3pIFTSilcNDKSPn+Y2iDywSEachzRuvgAYYLR3wpGXAsMbv5lvKLDZLeYPAw==",
+ "version": "3.0.12",
+ "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.12.tgz",
+ "integrity": "sha512-DT+iNIRNX884cx0/Q1ja7NyUPpZuv0KPyL5rGNxm1WC1OtHstl7n4Jb7nk+xacNShQMbczJjt8uFzznpp6kYBg==",
"dependencies": {
- "@types/unist": "*"
+ "@types/unist": "^2"
}
},
"node_modules/@types/ms": {
@@ -1203,17 +1171,18 @@
"integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA=="
},
"node_modules/@types/nlcst": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/@types/nlcst/-/nlcst-1.0.0.tgz",
- "integrity": "sha512-3TGCfOcy8R8mMQ4CNSNOe3PG66HttvjcLzCoOpvXvDtfWOTi+uT/rxeOKm/qEwbM4SNe1O/PjdiBK2YcTjU4OQ==",
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@types/nlcst/-/nlcst-1.0.1.tgz",
+ "integrity": "sha512-aVIyXt6pZiiMOtVByE4Y0gf+BLm1Cxc4ZLSK8VRHn1CgkO+kXbQwN/EBhQmhPdBMjFJCMBKtmNW2zWQuFywz8Q==",
"dependencies": {
- "@types/unist": "*"
+ "@types/unist": "^2"
}
},
"node_modules/@types/node": {
- "version": "20.3.2",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-20.3.2.tgz",
- "integrity": "sha512-vOBLVQeCQfIcF/2Y7eKFTqrMnizK5lRNQ7ykML/5RuwVXVWxYkgwS7xbt4B6fKCUPgbSL5FSsjHQpaGQP/dQmw=="
+ "version": "20.4.2",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.2.tgz",
+ "integrity": "sha512-Dd0BYtWgnWJKwO1jkmTrzofjK2QXXcai0dmtzvIBhcA+RsG5h8R3xlyta0kGOZRNfL9GuRtb1knmPEhQrePCEw==",
+ "devOptional": true
},
"node_modules/@types/parse5": {
"version": "6.0.3",
@@ -1238,23 +1207,9 @@
"dev": true
},
"node_modules/@types/unist": {
- "version": "2.0.6",
- "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.6.tgz",
- "integrity": "sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ=="
- },
- "node_modules/@types/webidl-conversions": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.0.tgz",
- "integrity": "sha512-xTE1E+YF4aWPJJeUzaZI5DRntlkY3+BCVJi0axFptnjGmAoWxkyREIh/XMrfxVLejwQxMCfDXdICo0VLxThrog=="
- },
- "node_modules/@types/whatwg-url": {
- "version": "8.2.2",
- "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-8.2.2.tgz",
- "integrity": "sha512-FtQu10RWgn3D9U4aazdwIE2yzphmTJREDqNdODHrbrZmmMqI0vMheC/6NE/J1Yveaj8H+ela+YwWTjq5PGmuhA==",
- "dependencies": {
- "@types/node": "*",
- "@types/webidl-conversions": "*"
- }
+ "version": "2.0.7",
+ "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.7.tgz",
+ "integrity": "sha512-cputDpIbFgLUaGQn6Vqg3/YsJwxUwHLO13v3i5ouxT4lat0khip9AEWxtERujXV9wxIB1EyF97BSJFt6vpdI8g=="
},
"node_modules/@types/yargs-parser": {
"version": "21.0.0",
@@ -1272,9 +1227,9 @@
}
},
"node_modules/@vitest/coverage-v8": {
- "version": "0.32.2",
- "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-0.32.2.tgz",
- "integrity": "sha512-/+V3nB3fyeuuSeKxCfi6XmWjDIxpky7AWSkGVfaMjAk7di8igBwRsThLjultwIZdTDH1RAxpjmCXEfSqsMFZOA==",
+ "version": "0.32.4",
+ "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-0.32.4.tgz",
+ "integrity": "sha512-itiCYY3TmWEK+5wnFBoNr0ZA+adACp7Op1r2TeX5dPOgU2See7+Gx2NlK2lVMHVxfPsu5z9jszKa3i//eR+hqg==",
"dev": true,
"dependencies": {
"@ampproject/remapping": "^2.2.1",
@@ -1285,7 +1240,7 @@
"istanbul-reports": "^3.1.5",
"magic-string": "^0.30.0",
"picocolors": "^1.0.0",
- "std-env": "^3.3.2",
+ "std-env": "^3.3.3",
"test-exclude": "^6.0.0",
"v8-to-istanbul": "^9.1.0"
},
@@ -1297,13 +1252,13 @@
}
},
"node_modules/@vitest/expect": {
- "version": "0.32.2",
- "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.32.2.tgz",
- "integrity": "sha512-6q5yzweLnyEv5Zz1fqK5u5E83LU+gOMVBDuxBl2d2Jfx1BAp5M+rZgc5mlyqdnxquyoiOXpXmFNkcGcfFnFH3Q==",
+ "version": "0.32.4",
+ "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.32.4.tgz",
+ "integrity": "sha512-m7EPUqmGIwIeoU763N+ivkFjTzbaBn0n9evsTOcde03ugy2avPs3kZbYmw3DkcH1j5mxhMhdamJkLQ6dM1bk/A==",
"dev": true,
"dependencies": {
- "@vitest/spy": "0.32.2",
- "@vitest/utils": "0.32.2",
+ "@vitest/spy": "0.32.4",
+ "@vitest/utils": "0.32.4",
"chai": "^4.3.7"
},
"funding": {
@@ -1311,55 +1266,54 @@
}
},
"node_modules/@vitest/runner": {
- "version": "0.32.2",
- "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.32.2.tgz",
- "integrity": "sha512-06vEL0C1pomOEktGoLjzZw+1Fb+7RBRhmw/06WkDrd1akkT9i12su0ku+R/0QM69dfkIL/rAIDTG+CSuQVDcKw==",
+ "version": "0.32.4",
+ "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.32.4.tgz",
+ "integrity": "sha512-cHOVCkiRazobgdKLnczmz2oaKK9GJOw6ZyRcaPdssO1ej+wzHVIkWiCiNacb3TTYPdzMddYkCgMjZ4r8C0JFCw==",
"dev": true,
"dependencies": {
- "@vitest/utils": "0.32.2",
- "concordance": "^5.0.4",
+ "@vitest/utils": "0.32.4",
"p-limit": "^4.0.0",
- "pathe": "^1.1.0"
+ "pathe": "^1.1.1"
},
"funding": {
"url": "https://opencollective.com/vitest"
}
},
"node_modules/@vitest/snapshot": {
- "version": "0.32.2",
- "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-0.32.2.tgz",
- "integrity": "sha512-JwhpeH/PPc7GJX38vEfCy9LtRzf9F4er7i4OsAJyV7sjPwjj+AIR8cUgpMTWK4S3TiamzopcTyLsZDMuldoi5A==",
+ "version": "0.32.4",
+ "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-0.32.4.tgz",
+ "integrity": "sha512-IRpyqn9t14uqsFlVI2d7DFMImGMs1Q9218of40bdQQgMePwVdmix33yMNnebXcTzDU5eiV3eUsoxxH5v0x/IQA==",
"dev": true,
"dependencies": {
"magic-string": "^0.30.0",
- "pathe": "^1.1.0",
- "pretty-format": "^27.5.1"
+ "pathe": "^1.1.1",
+ "pretty-format": "^29.5.0"
},
"funding": {
"url": "https://opencollective.com/vitest"
}
},
"node_modules/@vitest/spy": {
- "version": "0.32.2",
- "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.32.2.tgz",
- "integrity": "sha512-Q/ZNILJ4ca/VzQbRM8ur3Si5Sardsh1HofatG9wsJY1RfEaw0XKP8IVax2lI1qnrk9YPuG9LA2LkZ0EI/3d4ug==",
+ "version": "0.32.4",
+ "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.32.4.tgz",
+ "integrity": "sha512-oA7rCOqVOOpE6rEoXuCOADX7Lla1LIa4hljI2MSccbpec54q+oifhziZIJXxlE/CvI2E+ElhBHzVu0VEvJGQKQ==",
"dev": true,
"dependencies": {
- "tinyspy": "^2.1.0"
+ "tinyspy": "^2.1.1"
},
"funding": {
"url": "https://opencollective.com/vitest"
}
},
"node_modules/@vitest/utils": {
- "version": "0.32.2",
- "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.32.2.tgz",
- "integrity": "sha512-lnJ0T5i03j0IJaeW73hxe2AuVnZ/y1BhhCOuIcl9LIzXnbpXJT9Lrt6brwKHXLOiA7MZ6N5hSJjt0xE1dGNCzQ==",
+ "version": "0.32.4",
+ "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.32.4.tgz",
+ "integrity": "sha512-Gwnl8dhd1uJ+HXrYyV0eRqfmk9ek1ASE/LWfTCuWMw+d07ogHqp4hEAV28NiecimK6UY9DpSEPh+pXBA5gtTBg==",
"dev": true,
"dependencies": {
"diff-sequences": "^29.4.3",
"loupe": "^2.3.6",
- "pretty-format": "^27.5.1"
+ "pretty-format": "^29.5.0"
},
"funding": {
"url": "https://opencollective.com/vitest"
@@ -1388,9 +1342,9 @@
"integrity": "sha512-/yrv59IEnmh655z1oeDnGcvMYwnEzNzHLgeYcQCkhYX0xBvYWrAuefoiLcPBUkMpJsb46bqQ6Yv4pwTTQ4d3Qg=="
},
"node_modules/acorn": {
- "version": "8.9.0",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.9.0.tgz",
- "integrity": "sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ==",
+ "version": "8.10.0",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz",
+ "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==",
"bin": {
"acorn": "bin/acorn"
},
@@ -1621,11 +1575,11 @@
}
},
"node_modules/astro": {
- "version": "2.7.1",
- "resolved": "https://registry.npmjs.org/astro/-/astro-2.7.1.tgz",
- "integrity": "sha512-W7KbiHPIWM9tmjAUza8iQtalbNnpRcbtKgEZ7zc/+vOpuvcmSHxkYVar+VhLf2ZuwBIDjgaF9M8ScQ2B1oobAA==",
+ "version": "2.8.5",
+ "resolved": "https://registry.npmjs.org/astro/-/astro-2.8.5.tgz",
+ "integrity": "sha512-qfPUKLpZ9lVi5Hc5MrzyekUUx54AyrEphW5eetNQj/+d0iodHEneZXFDzZxTEsk3rL8Y2Y9pYFXJPmQB3eahUA==",
"dependencies": {
- "@astrojs/compiler": "^1.5.0",
+ "@astrojs/compiler": "^1.5.3",
"@astrojs/internal-helpers": "^0.1.1",
"@astrojs/language-server": "^1.0.0",
"@astrojs/markdown-remark": "^2.2.1",
@@ -1678,6 +1632,7 @@
"vfile": "^5.3.7",
"vite": "^4.3.9",
"vitefu": "^0.2.4",
+ "which-pm": "^2.0.0",
"yargs-parser": "^21.1.1",
"zod": "^3.20.6"
},
@@ -1818,11 +1773,6 @@
"tweetnacl": "^0.14.3"
}
},
- "node_modules/bcryptjs": {
- "version": "2.4.3",
- "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz",
- "integrity": "sha512-V/Hy/X9Vt7f3BbPJEi8BdVFMByHi+jNXrYkW3huaybV/kQ0KJg0Y6PkEMbn+zeT+i+SiKZ/HMqJGIIt4LZDqNQ=="
- },
"node_modules/big-integer": {
"version": "1.6.51",
"resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz",
@@ -1884,12 +1834,6 @@
"integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==",
"dev": true
},
- "node_modules/blueimp-md5": {
- "version": "2.19.0",
- "resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.19.0.tgz",
- "integrity": "sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==",
- "dev": true
- },
"node_modules/boxen": {
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/boxen/-/boxen-6.2.1.tgz",
@@ -2037,14 +1981,6 @@
"node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
}
},
- "node_modules/bson": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/bson/-/bson-5.3.0.tgz",
- "integrity": "sha512-ukmCZMneMlaC5ebPHXIkP8YJzNl5DC41N5MAIvKDqLggdao342t4McltoJBQfQya/nHBWAcSsYRqlXPoQkTJag==",
- "engines": {
- "node": ">=14.20.1"
- }
- },
"node_modules/buffer": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
@@ -2078,11 +2014,6 @@
"node": "*"
}
},
- "node_modules/buffer-equal-constant-time": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",
- "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA=="
- },
"node_modules/bundle-name": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-3.0.0.tgz",
@@ -2159,9 +2090,9 @@
}
},
"node_modules/caniuse-lite": {
- "version": "1.0.30001509",
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001509.tgz",
- "integrity": "sha512-2uDDk+TRiTX5hMcUYT/7CSyzMZxjfGu0vAUjS2g0LSD8UoXOv0LtpH4LxGMemsiPq6LCVIUjNwVM0erkOkGCDA==",
+ "version": "1.0.30001517",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001517.tgz",
+ "integrity": "sha512-Vdhm5S11DaFVLlyiKu4hiUTkpZu+y1KA/rZZqVQfOD5YdDT/eQKlkt7NaE0WGOFgX32diqt9MiP9CAiFeRklaA==",
"funding": [
{
"type": "opencollective",
@@ -2534,42 +2465,11 @@
"node": ">=4.0.0"
}
},
- "node_modules/complex.js": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/complex.js/-/complex.js-2.1.1.tgz",
- "integrity": "sha512-8njCHOTtFFLtegk6zQo0kkVX1rngygb/KQI6z1qZxlFI3scluC+LVTCFbrkWjBv4vvLlbQ9t88IPMC6k95VTTg==",
- "engines": {
- "node": "*"
- },
- "funding": {
- "type": "patreon",
- "url": "https://www.patreon.com/infusion"
- }
- },
"node_modules/concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="
},
- "node_modules/concordance": {
- "version": "5.0.4",
- "resolved": "https://registry.npmjs.org/concordance/-/concordance-5.0.4.tgz",
- "integrity": "sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==",
- "dev": true,
- "dependencies": {
- "date-time": "^3.1.0",
- "esutils": "^2.0.3",
- "fast-diff": "^1.2.0",
- "js-string-escape": "^1.0.1",
- "lodash": "^4.17.15",
- "md5-hex": "^3.0.1",
- "semver": "^7.3.2",
- "well-known-symbols": "^2.0.0"
- },
- "engines": {
- "node": ">=10.18.0 <11 || >=12.14.0 <13 || >=14"
- }
- },
"node_modules/convert-source-map": {
"version": "1.9.0",
"resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz",
@@ -2614,13 +2514,13 @@
}
},
"node_modules/cypress": {
- "version": "12.16.0",
- "resolved": "https://registry.npmjs.org/cypress/-/cypress-12.16.0.tgz",
- "integrity": "sha512-mwv1YNe48hm0LVaPgofEhGCtLwNIQEjmj2dJXnAkY1b4n/NE9OtgPph4TyS+tOtYp5CKtRmDvBzWseUXQTjbTg==",
+ "version": "12.17.1",
+ "resolved": "https://registry.npmjs.org/cypress/-/cypress-12.17.1.tgz",
+ "integrity": "sha512-eKfBgO6t8waEyhegL4gxD7tcI6uTCGttu+ZU7y9Hq8BlpMztd7iLeIF4AJFAnbZH1xjX+wwgg4cRKFNSvv3VWQ==",
"dev": true,
"hasInstallScript": true,
"dependencies": {
- "@cypress/request": "^2.88.10",
+ "@cypress/request": "^2.88.11",
"@cypress/xvfb": "^1.2.4",
"@types/node": "^14.14.31",
"@types/sinonjs__fake-timers": "8.1.1",
@@ -2657,7 +2557,7 @@
"pretty-bytes": "^5.6.0",
"proxy-from-env": "1.0.0",
"request-progress": "^3.0.0",
- "semver": "^7.3.2",
+ "semver": "^7.5.3",
"supports-color": "^8.1.1",
"tmp": "~0.2.1",
"untildify": "^4.0.0",
@@ -2671,9 +2571,9 @@
}
},
"node_modules/cypress/node_modules/@types/node": {
- "version": "14.18.52",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.52.tgz",
- "integrity": "sha512-DGhiXKOHSFVVm+PJD+9Y0ObxXLeG6qwc0HoOn+ooQKeNNu+T2mEJCM5UBDUREKAggl9MHYjb5E71PAmx6MbzIg==",
+ "version": "14.18.53",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.53.tgz",
+ "integrity": "sha512-soGmOpVBUq+gaBMwom1M+krC/NNbWlosh4AtGA03SyWNDiqSKtwp7OulO1M6+mg8YkHMvJ/y0AkCeO8d1hNb7A==",
"dev": true
},
"node_modules/cypress/node_modules/ansi-styles": {
@@ -2877,22 +2777,10 @@
"node": ">=0.10"
}
},
- "node_modules/date-time": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/date-time/-/date-time-3.1.0.tgz",
- "integrity": "sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==",
- "dev": true,
- "dependencies": {
- "time-zone": "^1.0.0"
- },
- "engines": {
- "node": ">=6"
- }
- },
"node_modules/dayjs": {
- "version": "1.11.8",
- "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.8.tgz",
- "integrity": "sha512-LcgxzFoWMEPO7ggRv1Y2N31hUf2R0Vj7fuy/m+Bg1K8rr+KAs1AEy4y9jd5DXe8pbHgX+srkHNS7TH6Q6ZhYeQ==",
+ "version": "1.11.9",
+ "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.9.tgz",
+ "integrity": "sha512-QvzAURSbQ0pKdIye2txOzNaHmxtUBXerpY0FJsFXUMKbIZeFm5ht1LS/jFsrncjnmtv8HsG0W2g6c0zUjZWmpA==",
"dev": true
},
"node_modules/debug": {
@@ -2911,11 +2799,6 @@
}
}
},
- "node_modules/decimal.js": {
- "version": "10.4.3",
- "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz",
- "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA=="
- },
"node_modules/decode-named-character-reference": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.0.2.tgz",
@@ -3129,28 +3012,20 @@
"safer-buffer": "^2.1.0"
}
},
- "node_modules/ecdsa-sig-formatter": {
- "version": "1.0.11",
- "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz",
- "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==",
- "dependencies": {
- "safe-buffer": "^5.0.1"
- }
- },
"node_modules/ee-first": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
},
"node_modules/electron-to-chromium": {
- "version": "1.4.442",
- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.442.tgz",
- "integrity": "sha512-RkrZF//Ya+0aJq2NM3OdisNh5ZodZq1rdXOS96G8DdDgpDKqKE81yTbbQ3F/4CKm1JBPsGu1Lp/akkna2xO06Q=="
+ "version": "1.4.466",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.466.tgz",
+ "integrity": "sha512-TSkRvbXRXD8BwhcGlZXDsbI2lRoP8dvqR7LQnqQNk9KxXBc4tG8O+rTuXgTyIpEdiqSGKEBSqrxdqEntnjNncA=="
},
"node_modules/emmet": {
- "version": "2.4.4",
- "resolved": "https://registry.npmjs.org/emmet/-/emmet-2.4.4.tgz",
- "integrity": "sha512-v8Mwpjym55CS3EjJgiCLWUB3J2HSR93jhzXW325720u8KvYxdI2voYLstW3pHBxFz54H6jFjayR9G4LfTG0q+g==",
+ "version": "2.4.5",
+ "resolved": "https://registry.npmjs.org/emmet/-/emmet-2.4.5.tgz",
+ "integrity": "sha512-xOiVNINJFh0dMik+KzXSEYbAnFLTnadEzanxj7+F15uIf6avQwu3uPa1wI/8AFtOWKZ8lHg7TjC83wXcPhgOPw==",
"dependencies": {
"@emmetio/abbreviation": "^2.3.3",
"@emmetio/css-abbreviation": "^2.1.8"
@@ -3244,11 +3119,6 @@
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
"integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="
},
- "node_modules/escape-latex": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/escape-latex/-/escape-latex-1.2.0.tgz",
- "integrity": "sha512-nV5aVWW1K0wEiUIEdZ4erkGGH8mDxGyxSeqPzRNtWP7ataw+/olFObw7hujFWlVjNsaDFw5VZ5NzVSIqRgfTiw=="
- },
"node_modules/escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
@@ -3274,15 +3144,6 @@
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.0.tgz",
"integrity": "sha512-s6ceX0NFiU/vKPiKvFdR83U1Zffu7upwZsGwpoqfg5rbbq1l50WQ5hCeIvM6E6oD4shUHCYMsiFPns4Jk0YfMQ=="
},
- "node_modules/esutils": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
- "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
"node_modules/etag": {
"version": "1.8.1",
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
@@ -3399,16 +3260,10 @@
"node >=0.6.0"
]
},
- "node_modules/fast-diff": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz",
- "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==",
- "dev": true
- },
"node_modules/fast-glob": {
- "version": "3.2.12",
- "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz",
- "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==",
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.0.tgz",
+ "integrity": "sha512-ChDuvbOypPuNjO8yIDf36x7BlZX1smcUMTTcyoIjycexOxd6DFsKsg21qVBzEmr3G7fUKIRy2/psii+CIUt7FA==",
"dependencies": {
"@nodelib/fs.stat": "^2.0.2",
"@nodelib/fs.walk": "^1.2.3",
@@ -3996,11 +3851,6 @@
"node": ">=10"
}
},
- "node_modules/ip": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz",
- "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ=="
- },
"node_modules/is-binary-path": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
@@ -4320,28 +4170,14 @@
"integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==",
"dev": true
},
- "node_modules/javascript-natural-sort": {
- "version": "0.7.1",
- "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz",
- "integrity": "sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw=="
- },
"node_modules/jiti": {
- "version": "1.18.2",
- "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.18.2.tgz",
- "integrity": "sha512-QAdOptna2NYiSSpv0O/BwoHBSmz4YhpzJHyi+fnMRTXFjp7B8i/YG5Z8IfusxB1ufjcD2Sre1F3R+nX3fvy7gg==",
+ "version": "1.19.1",
+ "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.19.1.tgz",
+ "integrity": "sha512-oVhqoRDaBXf7sjkll95LHVS6Myyyb1zaunVwk4Z0+WPSW4gjS0pl01zYKHScTuyEhQsFxV5L4DR5r+YqSyqyyg==",
"bin": {
"jiti": "bin/jiti.js"
}
},
- "node_modules/js-string-escape": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz",
- "integrity": "sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==",
- "dev": true,
- "engines": {
- "node": ">= 0.8"
- }
- },
"node_modules/js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
@@ -4415,21 +4251,6 @@
"graceful-fs": "^4.1.6"
}
},
- "node_modules/jsonwebtoken": {
- "version": "9.0.0",
- "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.0.tgz",
- "integrity": "sha512-tuGfYXxkQGDPnLJ7SibiQgVgeDgfbPq2k2ICcbgqW8WxWLBAxKQM/ZCu/IT8SOSwmaYl4dpTFCW5xZv7YbbWUw==",
- "dependencies": {
- "jws": "^3.2.2",
- "lodash": "^4.17.21",
- "ms": "^2.1.1",
- "semver": "^7.3.8"
- },
- "engines": {
- "node": ">=12",
- "npm": ">=6"
- }
- },
"node_modules/jsprim": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/jsprim/-/jsprim-2.0.2.tgz",
@@ -4445,33 +4266,6 @@
"verror": "1.10.0"
}
},
- "node_modules/jwa": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz",
- "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==",
- "dependencies": {
- "buffer-equal-constant-time": "1.0.1",
- "ecdsa-sig-formatter": "1.0.11",
- "safe-buffer": "^5.0.1"
- }
- },
- "node_modules/jws": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz",
- "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==",
- "dependencies": {
- "jwa": "^1.4.1",
- "safe-buffer": "^5.0.1"
- }
- },
- "node_modules/kareem": {
- "version": "2.5.1",
- "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.5.1.tgz",
- "integrity": "sha512-7jFxRVm+jD+rkq3kY0iZDJfsO2/t4BBPeEb2qKn2lR/9KhuksYk5hxzfRYWMPV8P/x2d0kHD306YyWLzjjH+uA==",
- "engines": {
- "node": ">=12.0.0"
- }
- },
"node_modules/kind-of": {
"version": "6.0.3",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
@@ -4707,24 +4501,7 @@
"node_modules/lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
- "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
- },
- "node_modules/lodash.castarray": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/lodash.castarray/-/lodash.castarray-4.4.0.tgz",
- "integrity": "sha512-aVx8ztPv7/2ULbArGJ2Y42bG1mEQ5mGjpdvrbJcJFU3TbYybe+QlLS4pst9zV52ymy2in1KpFPiZnAOATxD4+Q==",
- "dev": true
- },
- "node_modules/lodash.isplainobject": {
- "version": "4.0.6",
- "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz",
- "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==",
- "dev": true
- },
- "node_modules/lodash.merge": {
- "version": "4.6.2",
- "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
- "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",
+ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"dev": true
},
"node_modules/lodash.once": {
@@ -4969,20 +4746,20 @@
}
},
"node_modules/lucide-astro": {
- "version": "0.256.1",
- "resolved": "https://registry.npmjs.org/lucide-astro/-/lucide-astro-0.256.1.tgz",
- "integrity": "sha512-BACdrK5pG/OEgcVy8lzpr1NOAdfRtMLLuLDY3qlu+StHh9iZrDtI8x1EQKku2T3cviFvZlhD2nX5olfnFgCtNw==",
+ "version": "0.261.1",
+ "resolved": "https://registry.npmjs.org/lucide-astro/-/lucide-astro-0.261.1.tgz",
+ "integrity": "sha512-C41QGMcQ2WJq/mAAXVNf2U/UCljKoO4uOie1Gek8C+bRDwrfAh4cClxGT2STge0XJa9eFkWhxcROleMrL8SqUQ==",
"peerDependencies": {
"astro": "^2.7.1"
}
},
"node_modules/magic-string": {
- "version": "0.30.0",
- "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.0.tgz",
- "integrity": "sha512-LA+31JYDJLs82r2ScLrlz1GjSgu66ZV518eyWT+S8VhyQn/JL0u9MeBOvQMGYiPk1DBiSN9DDMOcXvigJZaViQ==",
+ "version": "0.30.1",
+ "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.1.tgz",
+ "integrity": "sha512-mbVKXPmS0z0G4XqFDCTllmDQ6coZzn94aMlb0o/A4HEHJCKcanlDZwYJgwnkmgD3jyWhUgj9VsPrfd972yPffA==",
"dev": true,
"dependencies": {
- "@jridgewell/sourcemap-codec": "^1.4.13"
+ "@jridgewell/sourcemap-codec": "^1.4.15"
},
"engines": {
"node": ">=12"
@@ -5004,9 +4781,9 @@
}
},
"node_modules/make-dir/node_modules/semver": {
- "version": "6.3.0",
- "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
- "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
"dev": true,
"bin": {
"semver": "bin/semver.js"
@@ -5021,40 +4798,6 @@
"url": "https://github.com/sponsors/wooorm"
}
},
- "node_modules/mathjs": {
- "version": "11.8.2",
- "resolved": "https://registry.npmjs.org/mathjs/-/mathjs-11.8.2.tgz",
- "integrity": "sha512-ZePu0oDbM0vuFExikIMY/9syjo/jbgNbX6ti+iMdaALDuxciMCsXIslGDBEn7QCpCWYBiVCYmc0lsmk5bwHBdQ==",
- "dependencies": {
- "@babel/runtime": "^7.22.5",
- "complex.js": "^2.1.1",
- "decimal.js": "^10.4.3",
- "escape-latex": "^1.2.0",
- "fraction.js": "^4.2.0",
- "javascript-natural-sort": "^0.7.1",
- "seedrandom": "^3.0.5",
- "tiny-emitter": "^2.1.0",
- "typed-function": "^4.1.0"
- },
- "bin": {
- "mathjs": "bin/cli.js"
- },
- "engines": {
- "node": ">= 14"
- }
- },
- "node_modules/md5-hex": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-3.0.1.tgz",
- "integrity": "sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==",
- "dev": true,
- "dependencies": {
- "blueimp-md5": "^2.10.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
"node_modules/mdast-util-definitions": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/mdast-util-definitions/-/mdast-util-definitions-5.1.2.tgz",
@@ -5269,12 +5012,6 @@
"url": "https://opencollective.com/unified"
}
},
- "node_modules/memory-pager": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz",
- "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==",
- "optional": true
- },
"node_modules/merge-stream": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
@@ -5910,92 +5647,6 @@
"ufo": "^1.1.2"
}
},
- "node_modules/mongodb": {
- "version": "5.6.0",
- "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-5.6.0.tgz",
- "integrity": "sha512-z8qVs9NfobHJm6uzK56XBZF8XwM9H294iRnB7wNjF0SnY93si5HPziIJn+qqvUR5QOff/4L0gCD6SShdR/GtVQ==",
- "dependencies": {
- "bson": "^5.3.0",
- "mongodb-connection-string-url": "^2.6.0",
- "socks": "^2.7.1"
- },
- "engines": {
- "node": ">=14.20.1"
- },
- "optionalDependencies": {
- "saslprep": "^1.0.3"
- },
- "peerDependencies": {
- "@aws-sdk/credential-providers": "^3.201.0",
- "mongodb-client-encryption": ">=2.3.0 <3",
- "snappy": "^7.2.2"
- },
- "peerDependenciesMeta": {
- "@aws-sdk/credential-providers": {
- "optional": true
- },
- "mongodb-client-encryption": {
- "optional": true
- },
- "snappy": {
- "optional": true
- }
- }
- },
- "node_modules/mongodb-connection-string-url": {
- "version": "2.6.0",
- "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-2.6.0.tgz",
- "integrity": "sha512-WvTZlI9ab0QYtTYnuMLgobULWhokRjtC7db9LtcVfJ+Hsnyr5eo6ZtNAt3Ly24XZScGMelOcGtm7lSn0332tPQ==",
- "dependencies": {
- "@types/whatwg-url": "^8.2.1",
- "whatwg-url": "^11.0.0"
- }
- },
- "node_modules/mongoose": {
- "version": "7.3.1",
- "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-7.3.1.tgz",
- "integrity": "sha512-6289bmSIhvR8xMHsYe2/CuzN7wHK+2RHcK7idDdzniCPC5zix5JH0Hc4k3CmXlr/9zQ2250gUQiUWtvDB0vF1Q==",
- "dependencies": {
- "bson": "^5.3.0",
- "kareem": "2.5.1",
- "mongodb": "5.6.0",
- "mpath": "0.9.0",
- "mquery": "5.0.0",
- "ms": "2.1.3",
- "sift": "16.0.1"
- },
- "engines": {
- "node": ">=14.20.1"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/mongoose"
- }
- },
- "node_modules/mongoose/node_modules/ms": {
- "version": "2.1.3",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
- "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
- },
- "node_modules/mpath": {
- "version": "0.9.0",
- "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.9.0.tgz",
- "integrity": "sha512-ikJRQTk8hw5DEoFVxHG1Gn9T/xcjtdnOKIU1JTmGjZZlg9LST2mBLmcX3/ICIbgJydT2GOc15RnNy5mHmzfSew==",
- "engines": {
- "node": ">=4.0.0"
- }
- },
- "node_modules/mquery": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/mquery/-/mquery-5.0.0.tgz",
- "integrity": "sha512-iQMncpmEK8R8ncT8HJGsGc9Dsp8xcgYMVSbs5jgnm1lFHTZqMJTUWTDx1LBO8+mK3tPNZWFLBghQEIOULSTHZg==",
- "dependencies": {
- "debug": "4.x"
- },
- "engines": {
- "node": ">=14.0.0"
- }
- },
"node_modules/mri": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz",
@@ -6049,9 +5700,9 @@
}
},
"node_modules/node-releases": {
- "version": "2.0.12",
- "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.12.tgz",
- "integrity": "sha512-QzsYKWhXTWx8h1kIvqfnC++o0pEmpRQA/aenALsL2F4pqNVr7YzcdMlDij5WBnwftRbJCNJL/O7zdKaxKPHqgQ=="
+ "version": "2.0.13",
+ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz",
+ "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ=="
},
"node_modules/normalize-path": {
"version": "3.0.0",
@@ -6192,9 +5843,9 @@
}
},
"node_modules/ora/node_modules/chalk": {
- "version": "5.2.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.2.0.tgz",
- "integrity": "sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA==",
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz",
+ "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==",
"engines": {
"node": "^12.17.0 || ^14.13 || >=16.0.0"
},
@@ -6550,9 +6201,9 @@
"dev": true
},
"node_modules/postcss": {
- "version": "8.4.24",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.24.tgz",
- "integrity": "sha512-M0RzbcI0sO/XJNucsGjvWU9ERWxb/ytp1w6dKtxTKgixdtQDq4rmx/g8W1hnaheq9jgwL/oyEdH5Bc4WwJKMqg==",
+ "version": "8.4.26",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.26.tgz",
+ "integrity": "sha512-jrXHFF8iTloAenySjM/ob3gSj7pCu0Ji49hnjqzsgSRa50hkWCKD0HQ+gMNJkW38jBI68MpAAg7ZWwHwX8NMMw==",
"funding": [
{
"type": "opencollective",
@@ -6656,7 +6307,7 @@
"postcss": "^8.2.14"
}
},
- "node_modules/postcss-nested/node_modules/postcss-selector-parser": {
+ "node_modules/postcss-selector-parser": {
"version": "6.0.13",
"resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.13.tgz",
"integrity": "sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ==",
@@ -6668,19 +6319,6 @@
"node": ">=4"
}
},
- "node_modules/postcss-selector-parser": {
- "version": "6.0.10",
- "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz",
- "integrity": "sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==",
- "dev": true,
- "dependencies": {
- "cssesc": "^3.0.0",
- "util-deprecate": "^1.0.2"
- },
- "engines": {
- "node": ">=4"
- }
- },
"node_modules/postcss-value-parser": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz",
@@ -6742,26 +6380,17 @@
}
},
"node_modules/pretty-format": {
- "version": "27.5.1",
- "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz",
- "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==",
+ "version": "29.6.1",
+ "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.1.tgz",
+ "integrity": "sha512-7jRj+yXO0W7e4/tSJKoR7HRIHLPPjtNaUGG2xxKQnGvPNRkgWcQ0AZX6P4KBRJN4FcTBWb3sa7DVUJmocYuoog==",
"dev": true,
"dependencies": {
- "ansi-regex": "^5.0.1",
+ "@jest/schemas": "^29.6.0",
"ansi-styles": "^5.0.0",
- "react-is": "^17.0.1"
+ "react-is": "^18.0.0"
},
"engines": {
- "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0"
- }
- },
- "node_modules/pretty-format/node_modules/ansi-regex": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
- "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
- "dev": true,
- "engines": {
- "node": ">=8"
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
}
},
"node_modules/pretty-format/node_modules/ansi-styles": {
@@ -6839,6 +6468,7 @@
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz",
"integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==",
+ "dev": true,
"engines": {
"node": ">=6"
}
@@ -6886,9 +6516,9 @@
}
},
"node_modules/react-is": {
- "version": "17.0.2",
- "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
- "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==",
+ "version": "18.2.0",
+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz",
+ "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==",
"dev": true
},
"node_modules/read-cache": {
@@ -6923,11 +6553,6 @@
"node": ">=8.10.0"
}
},
- "node_modules/regenerator-runtime": {
- "version": "0.13.11",
- "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz",
- "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg=="
- },
"node_modules/rehype": {
"version": "12.0.1",
"resolved": "https://registry.npmjs.org/rehype/-/rehype-12.0.1.tgz",
@@ -7195,9 +6820,9 @@
}
},
"node_modules/rollup": {
- "version": "3.25.3",
- "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.25.3.tgz",
- "integrity": "sha512-ZT279hx8gszBj9uy5FfhoG4bZx8c+0A1sbqtr7Q3KNWIizpTdDEPZbV2xcbvHsnFp4MavCQYZyzApJ+virB8Yw==",
+ "version": "3.26.3",
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.26.3.tgz",
+ "integrity": "sha512-7Tin0C8l86TkpcMtXvQu6saWH93nhG3dGQ1/+l5V2TDMceTxO7kDiK6GzbfLWNNxqJXm591PcEZUozZm51ogwQ==",
"bin": {
"rollup": "dist/bin/rollup"
},
@@ -7377,18 +7002,6 @@
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
"dev": true
},
- "node_modules/saslprep": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.3.tgz",
- "integrity": "sha512-/MY/PEMbk2SuY5sScONwhUDsV2p77Znkb/q3nSVstq/yQzYJOH/Azh29p9oJLsl3LnQwSvZDKagDGBsBwSooag==",
- "optional": true,
- "dependencies": {
- "sparse-bitfield": "^3.0.3"
- },
- "engines": {
- "node": ">=6"
- }
- },
"node_modules/sass-formatter": {
"version": "0.7.6",
"resolved": "https://registry.npmjs.org/sass-formatter/-/sass-formatter-0.7.6.tgz",
@@ -7409,15 +7022,10 @@
"node": ">=4"
}
},
- "node_modules/seedrandom": {
- "version": "3.0.5",
- "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz",
- "integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg=="
- },
"node_modules/semver": {
- "version": "7.5.3",
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz",
- "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==",
+ "version": "7.5.4",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
+ "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"dependencies": {
"lru-cache": "^6.0.0"
},
@@ -7555,11 +7163,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
- "node_modules/sift": {
- "version": "16.0.1",
- "resolved": "https://registry.npmjs.org/sift/-/sift-16.0.1.tgz",
- "integrity": "sha512-Wv6BjQ5zbhW7VFefWusVP33T/EM0vYikCaQ2qR8yULbsilAT8/wQaXvuQ3ptGLpoKx+lihJE3y2UTgKDyyNHZQ=="
- },
"node_modules/siginfo": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz",
@@ -7623,28 +7226,6 @@
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true
},
- "node_modules/smart-buffer": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz",
- "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==",
- "engines": {
- "node": ">= 6.0.0",
- "npm": ">= 3.0.0"
- }
- },
- "node_modules/socks": {
- "version": "2.7.1",
- "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz",
- "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==",
- "dependencies": {
- "ip": "^2.0.0",
- "smart-buffer": "^4.2.0"
- },
- "engines": {
- "node": ">= 10.13.0",
- "npm": ">= 3.0.0"
- }
- },
"node_modules/source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
@@ -7671,15 +7252,6 @@
"url": "https://github.com/sponsors/wooorm"
}
},
- "node_modules/sparse-bitfield": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz",
- "integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==",
- "optional": true,
- "dependencies": {
- "memory-pager": "^1.0.2"
- }
- },
"node_modules/sprintf-js": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
@@ -7843,9 +7415,9 @@
}
},
"node_modules/sucrase": {
- "version": "3.32.0",
- "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.32.0.tgz",
- "integrity": "sha512-ydQOU34rpSyj2TGyz4D2p8rbktIOZ8QY9s+DGLvFU1i5pWJE8vkpruCjGCMHsdXwnD7JDcS+noSwM/a7zyNFDQ==",
+ "version": "3.34.0",
+ "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.34.0.tgz",
+ "integrity": "sha512-70/LQEZ07TEcxiU2dz51FKaE6hCTWC6vr7FOk3Gr0U60C3shtAN+H+BFr9XlYe5xqf3RA8nrc+VIwzCfnxuXJw==",
"dependencies": {
"@jridgewell/gen-mapping": "^0.3.2",
"commander": "^4.0.0",
@@ -7917,9 +7489,9 @@
}
},
"node_modules/tailwindcss": {
- "version": "3.3.2",
- "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.3.2.tgz",
- "integrity": "sha512-9jPkMiIBXvPc2KywkraqsUfbfj+dHDb+JPWtSJa9MLFdrPyazI7q6WX2sUrm7R9eVR7qqv3Pas7EvQFzxKnI6w==",
+ "version": "3.3.3",
+ "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.3.3.tgz",
+ "integrity": "sha512-A0KgSkef7eE4Mf+nKJ83i75TMyq8HqY3qmFIJSWy8bNt0v1lG7jUcpGpoTFxAwYcWOphcTBLPPJg+bDfhDf52w==",
"dependencies": {
"@alloc/quick-lru": "^5.2.0",
"arg": "^5.0.2",
@@ -7941,7 +7513,6 @@
"postcss-load-config": "^4.0.1",
"postcss-nested": "^6.0.1",
"postcss-selector-parser": "^6.0.11",
- "postcss-value-parser": "^4.2.0",
"resolve": "^1.22.2",
"sucrase": "^3.32.0"
},
@@ -7964,18 +7535,6 @@
"node": ">=10.13.0"
}
},
- "node_modules/tailwindcss/node_modules/postcss-selector-parser": {
- "version": "6.0.13",
- "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.13.tgz",
- "integrity": "sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ==",
- "dependencies": {
- "cssesc": "^3.0.0",
- "util-deprecate": "^1.0.2"
- },
- "engines": {
- "node": ">=4"
- }
- },
"node_modules/test-exclude": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz",
@@ -8021,20 +7580,6 @@
"integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==",
"dev": true
},
- "node_modules/time-zone": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/time-zone/-/time-zone-1.0.0.tgz",
- "integrity": "sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==",
- "dev": true,
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/tiny-emitter": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
- "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q=="
- },
"node_modules/tinybench": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.5.0.tgz",
@@ -8122,17 +7667,6 @@
"node": ">=0.8"
}
},
- "node_modules/tr46": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz",
- "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==",
- "dependencies": {
- "punycode": "^2.1.1"
- },
- "engines": {
- "node": ">=12"
- }
- },
"node_modules/trim-lines": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz",
@@ -8226,18 +7760,10 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/typed-function": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/typed-function/-/typed-function-4.1.0.tgz",
- "integrity": "sha512-DGwUl6cioBW5gw2L+6SMupGwH/kZOqivy17E4nsh1JI9fKF87orMmlQx3KISQPmg3sfnOUGlwVkroosvgddrlg==",
- "engines": {
- "node": ">= 14"
- }
- },
"node_modules/typescript": {
- "version": "5.1.5",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.5.tgz",
- "integrity": "sha512-FOH+WN/DQjUvN6WgW+c4Ml3yi0PH+a/8q+kNIfRehv1wLhWONedw85iu+vQ39Wp49IzTJEsZ2lyLXpBF7mkF1g==",
+ "version": "5.1.6",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz",
+ "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
@@ -8534,13 +8060,13 @@
}
},
"node_modules/vite": {
- "version": "4.3.9",
- "resolved": "https://registry.npmjs.org/vite/-/vite-4.3.9.tgz",
- "integrity": "sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==",
+ "version": "4.4.5",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.5.tgz",
+ "integrity": "sha512-4m5kEtAWHYr0O1Fu7rZp64CfO1PsRGZlD3TAB32UmQlpd7qg15VF7ROqGN5CyqN7HFuwr7ICNM2+fDWRqFEKaA==",
"dependencies": {
- "esbuild": "^0.17.5",
- "postcss": "^8.4.23",
- "rollup": "^3.21.0"
+ "esbuild": "^0.18.10",
+ "postcss": "^8.4.26",
+ "rollup": "^3.25.2"
},
"bin": {
"vite": "bin/vite.js"
@@ -8548,12 +8074,16 @@
"engines": {
"node": "^14.18.0 || >=16.0.0"
},
+ "funding": {
+ "url": "https://github.com/vitejs/vite?sponsor=1"
+ },
"optionalDependencies": {
"fsevents": "~2.3.2"
},
"peerDependencies": {
"@types/node": ">= 14",
"less": "*",
+ "lightningcss": "^1.21.0",
"sass": "*",
"stylus": "*",
"sugarss": "*",
@@ -8566,6 +8096,9 @@
"less": {
"optional": true
},
+ "lightningcss": {
+ "optional": true
+ },
"sass": {
"optional": true
},
@@ -8581,15 +8114,15 @@
}
},
"node_modules/vite-node": {
- "version": "0.32.2",
- "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.32.2.tgz",
- "integrity": "sha512-dTQ1DCLwl2aEseov7cfQ+kDMNJpM1ebpyMMMwWzBvLbis8Nla/6c9WQcqpPssTwS6Rp/+U6KwlIj8Eapw4bLdA==",
+ "version": "0.32.4",
+ "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.32.4.tgz",
+ "integrity": "sha512-L2gIw+dCxO0LK14QnUMoqSYpa9XRGnTTTDjW2h19Mr+GR0EFj4vx52W41gFXfMLqpA00eK4ZjOVYo1Xk//LFEw==",
"dev": true,
"dependencies": {
"cac": "^6.7.14",
"debug": "^4.3.4",
- "mlly": "^1.2.0",
- "pathe": "^1.1.0",
+ "mlly": "^1.4.0",
+ "pathe": "^1.1.1",
"picocolors": "^1.0.0",
"vite": "^3.0.0 || ^4.0.0"
},
@@ -8603,6 +8136,372 @@
"url": "https://opencollective.com/vitest"
}
},
+ "node_modules/vite/node_modules/@esbuild/android-arm": {
+ "version": "0.18.15",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.15.tgz",
+ "integrity": "sha512-wlkQBWb79/jeEEoRmrxt/yhn5T1lU236OCNpnfRzaCJHZ/5gf82uYx1qmADTBWE0AR/v7FiozE1auk2riyQd3w==",
+ "cpu": [
+ "arm"
+ ],
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/android-arm64": {
+ "version": "0.18.15",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.15.tgz",
+ "integrity": "sha512-NI/gnWcMl2kXt1HJKOn2H69SYn4YNheKo6NZt1hyfKWdMbaGadxjZIkcj4Gjk/WPxnbFXs9/3HjGHaknCqjrww==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/android-x64": {
+ "version": "0.18.15",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.15.tgz",
+ "integrity": "sha512-FM9NQamSaEm/IZIhegF76aiLnng1kEsZl2eve/emxDeReVfRuRNmvT28l6hoFD9TsCxpK+i4v8LPpEj74T7yjA==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/darwin-arm64": {
+ "version": "0.18.15",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.15.tgz",
+ "integrity": "sha512-XmrFwEOYauKte9QjS6hz60FpOCnw4zaPAb7XV7O4lx1r39XjJhTN7ZpXqJh4sN6q60zbP6QwAVVA8N/wUyBH/w==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/darwin-x64": {
+ "version": "0.18.15",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.15.tgz",
+ "integrity": "sha512-bMqBmpw1e//7Fh5GLetSZaeo9zSC4/CMtrVFdj+bqKPGJuKyfNJ5Nf2m3LknKZTS+Q4oyPiON+v3eaJ59sLB5A==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/freebsd-arm64": {
+ "version": "0.18.15",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.15.tgz",
+ "integrity": "sha512-LoTK5N3bOmNI9zVLCeTgnk5Rk0WdUTrr9dyDAQGVMrNTh9EAPuNwSTCgaKOKiDpverOa0htPcO9NwslSE5xuLA==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/freebsd-x64": {
+ "version": "0.18.15",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.15.tgz",
+ "integrity": "sha512-62jX5n30VzgrjAjOk5orYeHFq6sqjvsIj1QesXvn5OZtdt5Gdj0vUNJy9NIpjfdNdqr76jjtzBJKf+h2uzYuTQ==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/linux-arm": {
+ "version": "0.18.15",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.15.tgz",
+ "integrity": "sha512-dT4URUv6ir45ZkBqhwZwyFV6cH61k8MttIwhThp2BGiVtagYvCToF+Bggyx2VI57RG4Fbt21f9TmXaYx0DeUJg==",
+ "cpu": [
+ "arm"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/linux-arm64": {
+ "version": "0.18.15",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.15.tgz",
+ "integrity": "sha512-BWncQeuWDgYv0jTNzJjaNgleduV4tMbQjmk/zpPh/lUdMcNEAxy+jvneDJ6RJkrqloG7tB9S9rCrtfk/kuplsQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/linux-ia32": {
+ "version": "0.18.15",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.15.tgz",
+ "integrity": "sha512-JPXORvgHRHITqfms1dWT/GbEY89u848dC08o0yK3fNskhp0t2TuNUnsrrSgOdH28ceb1hJuwyr8R/1RnyPwocw==",
+ "cpu": [
+ "ia32"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/linux-loong64": {
+ "version": "0.18.15",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.15.tgz",
+ "integrity": "sha512-kArPI0DopjJCEplsVj/H+2Qgzz7vdFSacHNsgoAKpPS6W/Ndh8Oe24HRDQ5QCu4jHgN6XOtfFfLpRx3TXv/mEg==",
+ "cpu": [
+ "loong64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/linux-mips64el": {
+ "version": "0.18.15",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.15.tgz",
+ "integrity": "sha512-b/tmngUfO02E00c1XnNTw/0DmloKjb6XQeqxaYuzGwHe0fHVgx5/D6CWi+XH1DvkszjBUkK9BX7n1ARTOst59w==",
+ "cpu": [
+ "mips64el"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/linux-ppc64": {
+ "version": "0.18.15",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.15.tgz",
+ "integrity": "sha512-KXPY69MWw79QJkyvUYb2ex/OgnN/8N/Aw5UDPlgoRtoEfcBqfeLodPr42UojV3NdkoO4u10NXQdamWm1YEzSKw==",
+ "cpu": [
+ "ppc64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/linux-riscv64": {
+ "version": "0.18.15",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.15.tgz",
+ "integrity": "sha512-komK3NEAeeGRnvFEjX1SfVg6EmkfIi5aKzevdvJqMydYr9N+pRQK0PGJXk+bhoPZwOUgLO4l99FZmLGk/L1jWg==",
+ "cpu": [
+ "riscv64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/linux-s390x": {
+ "version": "0.18.15",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.15.tgz",
+ "integrity": "sha512-632T5Ts6gQ2WiMLWRRyeflPAm44u2E/s/TJvn+BP6M5mnHSk93cieaypj3VSMYO2ePTCRqAFXtuYi1yv8uZJNA==",
+ "cpu": [
+ "s390x"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/linux-x64": {
+ "version": "0.18.15",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.15.tgz",
+ "integrity": "sha512-MsHtX0NgvRHsoOtYkuxyk4Vkmvk3PLRWfA4okK7c+6dT0Fu4SUqXAr9y4Q3d8vUf1VWWb6YutpL4XNe400iQ1g==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/netbsd-x64": {
+ "version": "0.18.15",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.15.tgz",
+ "integrity": "sha512-djST6s+jQiwxMIVQ5rlt24JFIAr4uwUnzceuFL7BQT4CbrRtqBPueS4GjXSiIpmwVri1Icj/9pFRJ7/aScvT+A==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/openbsd-x64": {
+ "version": "0.18.15",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.15.tgz",
+ "integrity": "sha512-naeRhUIvhsgeounjkF5mvrNAVMGAm6EJWiabskeE5yOeBbLp7T89tAEw0j5Jm/CZAwyLe3c67zyCWH6fsBLCpw==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/sunos-x64": {
+ "version": "0.18.15",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.15.tgz",
+ "integrity": "sha512-qkT2+WxyKbNIKV1AEhI8QiSIgTHMcRctzSaa/I3kVgMS5dl3fOeoqkb7pW76KwxHoriImhx7Mg3TwN/auMDsyQ==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/win32-arm64": {
+ "version": "0.18.15",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.15.tgz",
+ "integrity": "sha512-HC4/feP+pB2Vb+cMPUjAnFyERs+HJN7E6KaeBlFdBv799MhD+aPJlfi/yk36SED58J9TPwI8MAcVpJgej4ud0A==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/win32-ia32": {
+ "version": "0.18.15",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.15.tgz",
+ "integrity": "sha512-ovjwoRXI+gf52EVF60u9sSDj7myPixPxqzD5CmkEUmvs+W9Xd0iqISVBQn8xcx4ciIaIVlWCuTbYDOXOnOL44Q==",
+ "cpu": [
+ "ia32"
+ ],
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/win32-x64": {
+ "version": "0.18.15",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.15.tgz",
+ "integrity": "sha512-imUxH9a3WJARyAvrG7srLyiK73XdX83NXQkjKvQ+7vPh3ZxoLrzvPkQKKw2DwZ+RV2ZB6vBfNHP8XScAmQC3aA==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/esbuild": {
+ "version": "0.18.15",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.15.tgz",
+ "integrity": "sha512-3WOOLhrvuTGPRzQPU6waSDWrDTnQriia72McWcn6UCi43GhCHrXH4S59hKMeez+IITmdUuUyvbU9JIp+t3xlPQ==",
+ "hasInstallScript": true,
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "optionalDependencies": {
+ "@esbuild/android-arm": "0.18.15",
+ "@esbuild/android-arm64": "0.18.15",
+ "@esbuild/android-x64": "0.18.15",
+ "@esbuild/darwin-arm64": "0.18.15",
+ "@esbuild/darwin-x64": "0.18.15",
+ "@esbuild/freebsd-arm64": "0.18.15",
+ "@esbuild/freebsd-x64": "0.18.15",
+ "@esbuild/linux-arm": "0.18.15",
+ "@esbuild/linux-arm64": "0.18.15",
+ "@esbuild/linux-ia32": "0.18.15",
+ "@esbuild/linux-loong64": "0.18.15",
+ "@esbuild/linux-mips64el": "0.18.15",
+ "@esbuild/linux-ppc64": "0.18.15",
+ "@esbuild/linux-riscv64": "0.18.15",
+ "@esbuild/linux-s390x": "0.18.15",
+ "@esbuild/linux-x64": "0.18.15",
+ "@esbuild/netbsd-x64": "0.18.15",
+ "@esbuild/openbsd-x64": "0.18.15",
+ "@esbuild/sunos-x64": "0.18.15",
+ "@esbuild/win32-arm64": "0.18.15",
+ "@esbuild/win32-ia32": "0.18.15",
+ "@esbuild/win32-x64": "0.18.15"
+ }
+ },
"node_modules/vitefu": {
"version": "0.2.4",
"resolved": "https://registry.npmjs.org/vitefu/-/vitefu-0.2.4.tgz",
@@ -8617,35 +8516,34 @@
}
},
"node_modules/vitest": {
- "version": "0.32.2",
- "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.32.2.tgz",
- "integrity": "sha512-hU8GNNuQfwuQmqTLfiKcqEhZY72Zxb7nnN07koCUNmntNxbKQnVbeIS6sqUgR3eXSlbOpit8+/gr1KpqoMgWCQ==",
+ "version": "0.32.4",
+ "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.32.4.tgz",
+ "integrity": "sha512-3czFm8RnrsWwIzVDu/Ca48Y/M+qh3vOnF16czJm98Q/AN1y3B6PBsyV8Re91Ty5s7txKNjEhpgtGPcfdbh2MZg==",
"dev": true,
"dependencies": {
"@types/chai": "^4.3.5",
"@types/chai-subset": "^1.3.3",
"@types/node": "*",
- "@vitest/expect": "0.32.2",
- "@vitest/runner": "0.32.2",
- "@vitest/snapshot": "0.32.2",
- "@vitest/spy": "0.32.2",
- "@vitest/utils": "0.32.2",
- "acorn": "^8.8.2",
+ "@vitest/expect": "0.32.4",
+ "@vitest/runner": "0.32.4",
+ "@vitest/snapshot": "0.32.4",
+ "@vitest/spy": "0.32.4",
+ "@vitest/utils": "0.32.4",
+ "acorn": "^8.9.0",
"acorn-walk": "^8.2.0",
"cac": "^6.7.14",
"chai": "^4.3.7",
- "concordance": "^5.0.4",
"debug": "^4.3.4",
"local-pkg": "^0.4.3",
"magic-string": "^0.30.0",
- "pathe": "^1.1.0",
+ "pathe": "^1.1.1",
"picocolors": "^1.0.0",
- "std-env": "^3.3.2",
+ "std-env": "^3.3.3",
"strip-literal": "^1.0.1",
"tinybench": "^2.5.0",
"tinypool": "^0.5.0",
"vite": "^3.0.0 || ^4.0.0",
- "vite-node": "0.32.2",
+ "vite-node": "0.32.4",
"why-is-node-running": "^2.2.2"
},
"bin": {
@@ -8786,35 +8684,6 @@
"url": "https://github.com/sponsors/wooorm"
}
},
- "node_modules/webidl-conversions": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz",
- "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==",
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/well-known-symbols": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/well-known-symbols/-/well-known-symbols-2.0.0.tgz",
- "integrity": "sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==",
- "dev": true,
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/whatwg-url": {
- "version": "11.0.0",
- "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz",
- "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==",
- "dependencies": {
- "tr46": "^3.0.0",
- "webidl-conversions": "^7.0.0"
- },
- "engines": {
- "node": ">=12"
- }
- },
"node_modules/which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
diff --git a/package.json b/package.json
index b623bd8..c167e47 100644
--- a/package.json
+++ b/package.json
@@ -1,13 +1,11 @@
{
"name": "@fi3d/slicer-as-a-service",
- "version": "0.0.1",
"type": "module",
"private": true,
"scripts": {
"dev": "astro dev",
"start": "node ./dist/server/entry.mjs",
"build": "astro build",
- "astro": "astro",
"check": "npm run check:astro && npm run check:typescript",
"check:astro": "astro check",
"check:typescript": "tsc --noEmit",
@@ -22,20 +20,13 @@
"@dzeio/object-util": "^1",
"@dzeio/url-manager": "^1",
"astro": "^2",
- "bcryptjs": "^2",
- "jsonwebtoken": "^9",
- "lucide-astro": "^0.256.1",
- "mathjs": "^11",
- "mongoose": "^7",
- "tailwindcss": "^3"
+ "lucide-astro": "^0.262.0",
+ "tailwindcss": "^4"
},
"devDependencies": {
- "@tailwindcss/typography": "^0.5.9",
- "@types/bcryptjs": "^2",
- "@types/jsonwebtoken": "^9",
"@types/node": "^20",
- "@vitest/coverage-v8": "^0.32.2",
+ "@vitest/coverage-v8": "^0.33.0",
"cypress": "^12",
- "vitest": "^0.32.2"
+ "vitest": "^0.33.0"
}
}
diff --git a/public/logo.svg b/public/logo.svg
deleted file mode 100644
index 3977715..0000000
--- a/public/logo.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/src/assets/README.md b/src/assets/README.md
new file mode 100644
index 0000000..900a88b
--- /dev/null
+++ b/src/assets/README.md
@@ -0,0 +1,7 @@
+# Assets
+
+Contains images that can be imported directly into the application
+
+# Folder Architecture
+
+- /assets/[path to element from src]/[folder named as the element]/[assets of the element].[ext]
diff --git a/src/assets/layouts/Base/favicon.png b/src/assets/layouts/Base/favicon.png
new file mode 100644
index 0000000000000000000000000000000000000000..74f9272398f60862ee4e99e6221cd1ffdfc58aad
GIT binary patch
literal 1957
zcmV;W2U_@vP)#wD&s;mA!4UXeDj^j9v<2a7vIF92uj^j9v<2a7vl#L#t1?0e`z;vLO
zalVIvjlde?e4P$F2ebuFITwsmM))Z~XRjgK}A&3Tz~N!?&l6%4K!Ba30|sy=$7L
zT4E)7h8B>K+d>PdKoK>SlHR~Cgummvrrp2^ise=z#u4CZU{q)k6&MLz8CpbIV(b7#
z9%_rMtrQFf{v-TwUoABQL)A*JKx`wx%|O4I%eNz)GE>8w#Oi|~z_HqBJ2iJXaL3YZ^S
zKn7yeTuAx>dkKF>r%n5S{tESxD=~}!*CQK1u`vj^F0_d5h@k_-Je0<)y%3xV93uR1
zo;4i?M(18DIa2fyU>^2n&phdgY+pMW`I7K=alPs5+-s#lD5C8vYbvZ=tjJS9naIiTZHny+Lzy@Tsu1S=3v5+i5_l`V7=hgWI=ixurDz{2*mw8r0>fEMNa-7Z!I3)|P$1UgnKYuG`7>|#Y40cHYcD(8{p
zQEZvAhSPydl=Fy^m(ZVo&rhIZIB-x|$BQZJru10YzP6Km=>1SxOJVF{MVSIDY+uWe
z%1`=RO`@=iS@I70!~cvFdPXDX1Dbl?PNApNSlGUHl76)NR9RCY>|#Zj0xWD_%a9GG
zwEv@t+r^GzVf&huLDyIVT@7y+v#@>rO7;=v3j=*Y?P8&)01K5z$)6;H92UV
zZlJRn7?Ok5Xt1z-?FIVeq}L)k$vrt~O+~0Fz~ZghCg4C$*LpLj>(ruQ-Xyk)_Lb*h
z%S8ry+kmrk)SQSABY=hN>tEo#9Iy8o^2n;qJcB%fVioP{4F&Db8|dCaf$U-$%)(|U
zy-`8?93$;fL>J47h3#uUFhD_jZ{Rlr{iU^wSw;J*W&5s|mksor+QlpvfmYGJG&_LB
zu3%~HVivZq7Ni2T=!@K;+T|#nUCb)lSCc_mUNx~8%H0lZ%HcXy(cX6Kjd=1;$?(7bAm8Nu7Wf8n
z=KP54$!iC7%7Zb;!PhuoB66TKm2@}V?xWYK*VGb>xg;O%b^@;gcL9@$J49?X1^}~x
zhk&&tdol`U7t4cM(Y_7>tAYE0@u36;W(05tvZko!kcu|C*bt77_H_tY1>A|um(DQ;
zBTlLHbgr{#?P48mUt55M$cB*9J(H1hhZdy%qKq!K4q2IBM#;~(6&VFQ4SWzA3}i3BJ3)hTE3z=!O|hbFO+kigN0}!$_H@w-Jc4|-JrsSB
zt>G5nzJNL!hQ%DeS+W(l8)*zHPD8@Z?&_f96~p`+miMW?yZ8t20`kEL4PV_Te#o7z
z!7ioisu4OyP!@KE7EpsNp#`KR#tyJ8w166H2rVEjF?N9OLkp-vE3hWCh(_RKY~l-~
zO|NMd+Ud+@!Z&!=bfIdAm56Z)0Gp64X;_H_k%*2MH-bPuyRwbS9k>;E7x_F~Uu5%U
z20E{dgG3{lLa`U8rKE}Dhv5}e{^syV#8sm)^fz3LzoIZ6*%WGTh^5qa%?zUR!A&0N
zv7F1~q~uAYA^t`z*4^OHc#&1QUnmHxp
zb80vKVZ8B6%~EQ2fTzMqb1Ya$^~T?WSjL
+
+
+
diff --git a/src/components/Favicon/Favicon.astro b/src/components/Favicon/Favicon.astro
new file mode 100644
index 0000000..a75bbb6
--- /dev/null
+++ b/src/components/Favicon/Favicon.astro
@@ -0,0 +1,24 @@
+---
+import { getImage } from 'astro:assets'
+
+export interface Props {
+ svg: ImageMetadata
+ png: ImageMetadata
+ icoPath?: string
+}
+
+if (Astro.props.icoPath !== '/favicon.ico') {
+ console.warn('It is recommanded that the ICO file should be located at /favicon.ico')
+
+}
+
+const appleTouch = await getImage({src: Astro.props.png, width: 180, height: 180})
+---
+
+<>
+
+
+
+
+
+>
diff --git a/src/components/Favicon/Manifest.ts b/src/components/Favicon/Manifest.ts
new file mode 100644
index 0000000..25b62e3
--- /dev/null
+++ b/src/components/Favicon/Manifest.ts
@@ -0,0 +1,33 @@
+import { getImage } from 'astro:assets'
+
+export default class Manifest {
+ static async create(baseImage, options) {
+ const [
+ i192,
+ i512
+ ] = await Promise.all([
+ getImage({src: baseImage, format: 'png', width: 192, height: 192}),
+ getImage({src: baseImage, format: 'png', width: 512, height: 512})
+ ])
+ return JSON.stringify({
+ name: options.name,
+ short_name: options.name,
+ icons: [
+ {
+ src: i192.src,
+ sizes: "192x192",
+ type: "image/png"
+ },
+ {
+ src: i512.src,
+ sizes: "512x512",
+ type: "image/png"
+ }
+ ],
+ theme_color: options.color ?? "#fff",
+ background_color: options.color ?? "#fff",
+ display: "standalone"
+ }
+ )
+ }
+}
diff --git a/src/components/Passthrough/Passthrough.astro b/src/components/Passthrough/Passthrough.astro
new file mode 100644
index 0000000..913319e
--- /dev/null
+++ b/src/components/Passthrough/Passthrough.astro
@@ -0,0 +1,4 @@
+---
+const json = JSON.stringify(Astro.props)
+---
+
diff --git a/src/components/Passthrough.astro b/src/components/Passthrough/utils.ts
similarity index 70%
rename from src/components/Passthrough.astro
rename to src/components/Passthrough/utils.ts
index 09b4011..d7ddd67 100644
--- a/src/components/Passthrough.astro
+++ b/src/components/Passthrough/utils.ts
@@ -1,4 +1,3 @@
----
/**
* note: you MUST only pass simple items that can go in JSON format natively
*/
@@ -9,7 +8,3 @@ export function load(): T {
}
return JSON.parse(tag.innerText)
}
-
-const json = JSON.stringify(Astro.props)
----
-
diff --git a/src/components/Picture.astro.tmp b/src/components/Picture.astro.tmp
new file mode 100644
index 0000000..c06f65e
--- /dev/null
+++ b/src/components/Picture.astro.tmp
@@ -0,0 +1,42 @@
+---
+import { LocalImageProps, RemoteImageProps, getImage } from 'astro:assets'
+import AstroUtils from '../libs/AstroUtils'
+type ImageProps = LocalImageProps | RemoteImageProps
+export type Props = ImageProps
+
+const res = await AstroUtils.wrap(async () => {
+ const image = Astro.props.src
+ const ext = typeof image === 'string' ? image.substring(image.lastIndexOf('.')) : image.format
+ if (ext === 'svg') {
+ return {
+ format: 'raw',
+ props: {
+ ...Astro.props,
+ src: typeof image === 'string' ? image : image.src
+ }
+ }
+ }
+
+ const avif = await getImage({src: Astro.props.src, format: 'avif'})
+ const webp = await getImage({src: Astro.props.src, format: 'webp'})
+ const orig = await getImage({src: Astro.props.src, format: ext})
+
+ return {
+ format: 'new',
+ avif,
+ webp,
+ orig
+ }
+})
+
+---
+
+{res.format === 'new' && (
+
+
+
+
+
+) || (
+
+)}
diff --git a/src/components/README.md b/src/components/README.md
new file mode 100644
index 0000000..4eac215
--- /dev/null
+++ b/src/components/README.md
@@ -0,0 +1,3 @@
+# Components
+
+Contains big elements that can be reused by themselve
diff --git a/src/content/README.md b/src/content/README.md
new file mode 100644
index 0000000..8f497fa
--- /dev/null
+++ b/src/content/README.md
@@ -0,0 +1,5 @@
+# Content
+
+Contains raw content for pages.
+
+Mostly some static pages or blog posts.
diff --git a/src/content/config.ts b/src/content/config.ts
index f385343..98dff2e 100644
--- a/src/content/config.ts
+++ b/src/content/config.ts
@@ -1,15 +1,15 @@
// 1. Import utilities from `astro:content`
-import { defineCollection, z } from 'astro:content'
+// import { defineCollection, z } from 'astro:content'
// 2. Define your collection(s)
-const docsCollection = defineCollection({
- type: 'content',
- schema: z.object({
- title: z.string()
- })
-})
+// const docsCollection = defineCollection({
+// type: 'content',
+// schema: z.object({
+// title: z.string()
+// })
+// })
// 3. Export a single `collections` object to register your collection(s)
// This key should match your collection directory name in "src/content"
-export const collections = {
- 'docs': docsCollection,
-};
+// export const collections = {
+// 'docs': docsCollection,
+// };
diff --git a/src/content/docs/errors/unauthorized-access.md b/src/content/docs/errors/unauthorized-access.md
deleted file mode 100644
index 9151889..0000000
--- a/src/content/docs/errors/unauthorized-access.md
+++ /dev/null
@@ -1,23 +0,0 @@
----
-title: 'Unauthorized Access Error'
----
-
-# Unauthorized Access Error
-
-## Possible Errors
-
-### Permission Error
-
-You need to have an API key with the correct permission to use the specified resource
-
-### Missing API Key
-
-To have access to most of the API Urls you need to have n API key in your headers like the following
-
-```http
-Authorization: Bearer 935b6640-25fe-402e-8b18-e60de88bc0da
-```
-
-### Cookies not found
-
-An alternative to the API Key is to have your cookies set, this is mostly for in browser and will only work while being connected on the website
diff --git a/src/env.d.ts b/src/env.d.ts
index 29062a2..d2b0679 100644
--- a/src/env.d.ts
+++ b/src/env.d.ts
@@ -1,13 +1,11 @@
///
-///
+///
///
+/**
+ * Environment variables declaration
+ */
interface ImportMetaEnv {
- PRUSASLICER_PATH?: string
- BAMBUSTUDIO_PATH?: string
- MONGODB?: string
- PRIVATE_KEY?: string
- PUBLIC_KEY?: string
}
interface ImportMeta {
@@ -16,11 +14,10 @@ interface ImportMeta {
declare namespace App {
+ /**
+ * Middlewares variables
+ */
interface Locals {
- /**
- * authentification key is the api key or the session token
- */
- authKey?: string
responseBuilder: ResponseBuilder
}
}
diff --git a/src/layouts/Base.astro b/src/layouts/Base.astro
new file mode 100644
index 0000000..2e1d94c
--- /dev/null
+++ b/src/layouts/Base.astro
@@ -0,0 +1,25 @@
+---
+export interface Props {
+ title: string
+}
+
+import Favicon from '../components/Favicon/Favicon.astro'
+import IconSVG from '../assets/layouts/Base/favicon.svg'
+import IconPNG from '../assets/layouts/Base/favicon.png'
+
+const { title } = Astro.props;
+---
+
+
+
+
+
+
+
+
+ {title}
+
+
+
+
+
diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro
index 837ba37..8c0007a 100644
--- a/src/layouts/Layout.astro
+++ b/src/layouts/Layout.astro
@@ -1,37 +1,11 @@
---
-import { WifiOff } from 'lucide-astro'
-export interface Props {
- title: string;
-}
+import Base, { type Props as BaseProps } from './Base.astro'
-const { title } = Astro.props;
+export interface Props extends BaseProps {}
---
-
-
-
-
-
-
-
-
- {title}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
diff --git a/src/layouts/README.md b/src/layouts/README.md
new file mode 100644
index 0000000..56e0a11
--- /dev/null
+++ b/src/layouts/README.md
@@ -0,0 +1,7 @@
+# Layouts
+
+Application different layouts they should extends `Base.astro` if added and also pass the parameters of Base.astro to the page
+
+## Base.astro
+
+This is the base file for each path of the application, executed for each paths
diff --git a/src/libs/AstroUtils.ts b/src/libs/AstroUtils.ts
new file mode 100644
index 0000000..240fbe3
--- /dev/null
+++ b/src/libs/AstroUtils.ts
@@ -0,0 +1,5 @@
+export default class AstroUtils {
+ public static async wrap(fn: () => T | Promise) {
+ return await fn()
+ }
+}
diff --git a/src/libs/AuthUtils.ts b/src/libs/AuthUtils.ts
deleted file mode 100644
index 867f269..0000000
--- a/src/libs/AuthUtils.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import bcryptjs from 'bcryptjs'
-
-export function hashPassword(password: string): Promise {
- return bcryptjs.hash(password, 10)
-}
-
-export function comparePassword(password: string, hash: string): Promise {
- return bcryptjs.compare(password, hash)
-}
diff --git a/src/libs/CookieManager.ts b/src/libs/CookieManager.ts
deleted file mode 100644
index bb347eb..0000000
--- a/src/libs/CookieManager.ts
+++ /dev/null
@@ -1,57 +0,0 @@
-export default class CookieManager {
- private cookies: Record = {}
- public constructor(data?: string | Record) {
- if (typeof data === 'string') {
- data.split(';').forEach((keyValuePair) => {
- const [key, value] = keyValuePair.split('=')
- if (!key || !value) {
- return
- }
- this.cookies[key.trim()] = value.trim().replace(/%3B/g, ';')
- })
- } else if (typeof data === 'object') {
- this.cookies = data
- }
- }
-
- public static addCookie(res: ResponseInit & { readonly headers: Headers; }, cookie: {
- key: string
- value: string
- expire?: string
- maxAge?: number
- domain?: string
- path?: string
- secure?: boolean
- httpOnly?: boolean
- sameSite?: 'Lax' | 'None' | 'Strict'}
- ) {
- const items: Array = [`${cookie.key}=${cookie.value.replace(/;/g, '%3B')}`]
- if (cookie.expire) {
- items.push(`Expires=${cookie.expire}`)
- }
- if (cookie.maxAge) {
- items.push(`Max-Age=${cookie.maxAge}`)
- }
- if (cookie.domain) {
- items.push(`Domain=${cookie.domain}`)
- }
- if (cookie.path) {
- items.push(`Path=${cookie.path}`)
- }
- if (cookie.secure) {
- items.push('Secure')
- }
- if (cookie.httpOnly) {
- items.push('HttpOnly')
- }
- if (cookie.sameSite) {
- items.push(`SameSite=${cookie.sameSite}`)
- }
- res.headers.append('Set-Cookie', items.join('; '))
- }
-
- public get(key: string): string | undefined {
- return this.cookies[key]
- }
-
-}
diff --git a/src/libs/FilesUtils.ts b/src/libs/FilesUtils.ts
deleted file mode 100644
index 6660a33..0000000
--- a/src/libs/FilesUtils.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import { promises as fs } from 'node:fs'
-
-/**
- * File manipulation utility class
- */
-export default class FilesUtils {
- /**
- * heck if a file/folder exists at the specified location
- * @param path the path to check
- * @returns if the file exists or not
- */
- public static async exists(path: string): Promise {
- try {
- await fs.stat(path)
- return true
- } catch {
- return false
- }
- }
-}
diff --git a/src/libs/HTTP/StatusCode.ts b/src/libs/HTTP/StatusCode.ts
index 4bb9c46..31dc45d 100644
--- a/src/libs/HTTP/StatusCode.ts
+++ b/src/libs/HTTP/StatusCode.ts
@@ -1,70 +1,288 @@
+/**
+ * HTTP Status code
+ *
+ * Following https://developer.mozilla.org/en-US/docs/Web/HTTP/Status an extension of the RFC9110
+ */
enum StatusCode {
+
+ /****************
+ * 1xx Requests *
+ ****************/
+ /**
+ * This interim response indicates that the client should continue the request or ignore the response if the request is already finished.
+ */
CONTINUE = 100,
+ /**
+ * This code is sent in response to an Upgrade request header from the client and indicates the protocol the server is switching to.
+ */
SWITCHING_PROTOCOLS,
+ /**
+ * This code indicates that the server has received and is processing the request, but no response is available yet.
+ */
PROCESSING,
+ /**
+ * This status code is primarily intended to be used with the Link header, letting the user agent start preloading resources while the server prepares a response.
+ */
EARLY_HINTS,
+ /****************
+ * 2xx Requests *
+ ****************/
+
+ /**
+ * The request succeeded. The result meaning of "success" depends on the HTTP method:
+ * - `GET`: The resource has been fetched and transmitted in the message body.
+ * - `HEAD`: The representation headers are included in the response without any message body.
+ * - `PUT` or `POST`: The resource describing the result of the action is transmitted in the message body.
+ * - `TRACE`: The message body contains the request message as received by the server.
+ */
OK = 200,
+ /**
+ * The request succeeded, and a new resource was created as a result. This is typically the response sent after `POST` requests, or some `PUT` requests.
+ */
CREATED,
+ /**
+ * The request has been received but not yet acted upon. It is noncommittal, since there is no way in HTTP to later send an asynchronous response indicating the outcome of the request. It is intended for cases where another process or server handles the request, or for batch processing.
+ */
ACCEPTED,
+ /**
+ * This response code means the returned metadata is not exactly the same as is available from the origin server, but is collected from a local or a third-party copy. This is mostly used for mirrors or backups of another resource. Except for that specific case, the `200 OK` response is preferred to this status.
+ */
NON_AUTHORITATIVE_INFORMATION,
+ /**
+ * There is no content to send for this request, but the headers may be useful. The user agent may update its cached headers for this resource with the new ones.
+ */
NO_CONTENT,
+ /**
+ * Tells the user agent to reset the document which sent this request.
+ */
RESET_CONTENT,
+ /**
+ * This response code is used when the Range header is sent from the client to request only part of a resource.
+ */
PARTIAL_CONTENT,
+ /**
+ * Conveys information about multiple resources, for situations where multiple status codes might be appropriate.
+ */
MULTI_STATUS,
+ /**
+ * Used inside a `` response element to avoid repeatedly enumerating the internal members of multiple bindings to the same collection.
+ */
ALREADY_REPORTED,
+ /**
+ * The server has fulfilled a `GET` request for the resource, and the response is a representation of the result of one or more instance-manipulations applied to the current instance.
+ */
IM_USED = 226,
+ /****************
+ * 3xx Requests *
+ ****************/
+
+ /**
+ * The request has more than one possible response. The user agent or user should choose one of them. (There is no standardized way of choosing one of the responses, but HTML links to the possibilities are recommended so the user can pick.)
+ */
MULTIPLE_CHOICES = 300,
+ /**
+ * The URL of the requested resource has been changed permanently. The new URL is given in the response.
+ */
MOVED_PERMANENTLY,
+ /**
+ * This response code means that the URI of requested resource has been changed temporarily. Further changes in the URI might be made in the future. Therefore, this same URI should be used by the client in future requests.
+ */
FOUND,
+ /**
+ * The server sent this response to direct the client to get the requested resource at another URI with a GET request.
+ */
SEE_OTHER,
+ /**
+ * This is used for caching purposes. It tells the client that the response has not been modified, so the client can continue to use the same cached version of the response.
+ */
NOT_MODIFIED,
+ /**
+ * Defined in a previous version of the HTTP specification to indicate that a requested response must be accessed by a proxy. It has been deprecated due to security concerns regarding in-band configuration of a proxy.
+ */
USE_PROXY,
+ /**
+ * This response code is no longer used; it is just reserved. It was used in a previous version of the HTTP/1.1 specification.
+ */
// UNUSED
+ /**
+ * The server sends this response to direct the client to get the requested resource at another URI with the same method that was used in the prior request. This has the same semantics as the `302 Found` HTTP response code, with the exception that the user agent must not change the HTTP method used: if a `POST` was used in the first request, a `POST` must be used in the second request.
+ */
TEMPORARY_REDIRECT = 307,
+ /**
+ * This means that the resource is now permanently located at another URI, specified by the `Location:` HTTP Response header. This has the same semantics as the `301 Moved Permanently` HTTP response code, with the exception that the user agent must not change the HTTP method used: if a `POST` was used in the first request, a `POST` must be used in the second request.
+ */
PERMANENT_REDIRECT,
+ /****************
+ * 4xx Requests *
+ ****************/
+
+ /**
+ * The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
+ */
BAD_REQUEST = 400,
+ /**
+ * Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response.
+ */
UNAUTHORIZED,
+ /**
+ * This response code is reserved for future use. The initial aim for creating this code was using it for digital payment systems, however this status code is used very rarely and no standard convention exists.
+ */
PAYMENT_REQUIRED,
+ /**
+ * The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike `401 Unauthorized`, the client's identity is known to the server.
+ */
FORBIDDEN,
+ /**
+ * The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of `403 Forbidden` to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web.
+ */
NOT_FOUND,
+ /**
+ * The request method is known by the server but is not supported by the target resource. For example, an API may not allow calling `DELETE` to remove a resource.
+ */
METHOD_NOT_ALLOWED,
+ /**
+ * This response is sent when the web server, after performing server-driven content negotiation, doesn't find any content that conforms to the criteria given by the user agent.
+ */
NOT_ACCEPTABLE,
+ /**
+ * This is similar to `401 Unauthorized` but authentication is needed to be done by a proxy.
+ */
PROXY_AUTHENTIFICATION_REQUIRED,
+ /**
+ * This response is sent on an idle connection by some servers, even without any previous request by the client. It means that the server would like to shut down this unused connection. This response is used much more since some browsers, like Chrome, Firefox 27+, or IE9, use HTTP pre-connection mechanisms to speed up surfing. Also note that some servers merely shut down the connection without sending this message.
+ */
REQUEST_TIMEOUT,
+ /**
+ * This response is sent when a request conflicts with the current state of the server.
+ */
CONFLICT,
+ /**
+ * This response is sent when the requested content has been permanently deleted from server, with no forwarding address. Clients are expected to remove their caches and links to the resource. The HTTP specification intends this status code to be used for "limited-time, promotional services". APIs should not feel compelled to indicate resources that have been deleted with this status code.
+ */
GONE,
+ /**
+ * Server rejected the request because the `Content-Length` header field is not defined and the server requires it.
+ */
LENGTH_REQUIRED,
+ /**
+ * The client has indicated preconditions in its headers which the server does not meet.
+ */
PRECONDITION_FAILED,
+ /**
+ * Request entity is larger than limits defined by server. The server might close the connection or return an `Retry-After` header field.
+ */
PAYLOAD_TOO_LARGE,
+ /**
+ * The URI requested by the client is longer than the server is willing to interpret.
+ */
URI_TOO_LONG,
+ /**
+ * The media format of the requested data is not supported by the server, so the server is rejecting the request.
+ */
UNSUPPORTED_MEDIA_TYPE,
+ /**
+ * The range specified by the `Range` header field in the request cannot be fulfilled. It's possible that the range is outside the size of the target URI's data.
+ */
RANGE_NOT_SATISFIABLE,
+ /**
+ * This response code means the expectation indicated by the `Expect` request header field cannot be met by the server.
+ */
EXPECTATION_FAILED,
+ /**
+ * The server refuses the attempt to brew coffee with a teapot.
+ */
IM_A_TEAPOT,
+ /**
+ * The request was directed at a server that is not able to produce a response. This can be sent by a server that is not configured to produce responses for the combination of scheme and authority that are included in the request URI.
+ */
MIDIRECTED_REQUEST = 421,
+ /**
+ * The request was well-formed but was unable to be followed due to semantic errors.
+ */
UNPROCESSABLE_CONTENT,
+ /**
+ * The resource that is being accessed is locked.
+ */
LOCKED,
+ /**
+ * The request failed due to failure of a previous request.
+ */
FAILED_DEPENDENCY,
+ /**
+ * Indicates that the server is unwilling to risk processing a request that might be replayed.
+ */
TOO_EARLY,
+ /**
+ * The server refuses to perform the request using the current protocol but might be willing to do so after the client upgrades to a different protocol. The server sends an `Upgrade` header in a 426 response to indicate the required protocol(s).
+ */
UPGRADE_REQUIRED,
+ /**
+ * The origin server requires the request to be conditional. This response is intended to prevent the 'lost update' problem, where a client `GET`s a resource's state, modifies it and `PUT`s it back to the server, when meanwhile a third party has modified the state on the server, leading to a conflict.
+ */
PRECONDITION_REQUIRED = 428,
+ /**
+ * The user has sent too many requests in a given amount of time ("rate limiting").
+ */
TOO_MANY_REQUESTS,
+ /**
+ * The server is unwilling to process the request because its header fields are too large. The request may be resubmitted after reducing the size of the request header fields.
+ */
REQUEST_HEADER_FIELDS_TOO_LARGE = 431,
+ /**
+ * The user agent requested a resource that cannot legally be provided, such as a web page censored by a government.
+ */
UNAVAILABLE_OR_LEGAL_REASONS = 451,
+ /****************
+ * 5xx Requests *
+ ****************/
+
+ /**
+ * The server has encountered a situation it does not know how to handle.
+ */
INTERNAL_SERVER_ERROR = 500,
+ /**
+ * The request method is not supported by the server and cannot be handled. The only methods that servers are required to support (and therefore that must not return this code) are `GET` and `HEAD`.
+ */
NOT_IMPLEMENTED,
+ /**
+ * This error response means that the server, while working as a gateway to get a response needed to handle the request, got an invalid response.
+ */
BAD_GATEWAY,
+ /**
+ * The server is not ready to handle the request. Common causes are a server that is down for maintenance or that is overloaded. Note that together with this response, a user-friendly page explaining the problem should be sent. This response should be used for temporary conditions and the `Retry-After` HTTP header should, if possible, contain the estimated time before the recovery of the service. The webmaster must also take care about the caching-related headers that are sent along with this response, as these temporary condition responses should usually not be cached.
+ */
SERVICE_UNAVAILABLE,
+ /**
+ * This error response is given when the server is acting as a gateway and cannot get a response in time.
+ */
GATEWAY_TIMEOUT,
+ /**
+ * The HTTP version used in the request is not supported by the server.
+ */
HTTP_VERSION_NOT_SUPPORTED,
+ /**
+ * The server has an internal configuration error: the chosen variant resource is configured to engage in transparent content negotiation itself, and is therefore not a proper end point in the negotiation process.
+ */
VARIANT_ALSO_NEGOTIATES,
+ /**
+ * The method could not be performed on the resource because the server is unable to store the representation needed to successfully complete the request.
+ */
INSUFFICIENT_STORAGE,
+ /**
+ * The server detected an infinite loop while processing the request.
+ */
LOOP_DETECTED,
+ /**
+ * Further extensions to the request are required for the server to fulfill it.
+ */
NOT_EXTENDED = 510,
+ /**
+ * Indicates that the client needs to authenticate to gain network access.
+ */
NETWORK_AUTHENTIFICATION_REQUIRED,
}
diff --git a/src/libs/README.md b/src/libs/README.md
index 2834616..ac4f233 100644
--- a/src/libs/README.md
+++ b/src/libs/README.md
@@ -1,3 +1,3 @@
# Libs
-Globally independent objects/classes/functions that MUST be unit testable by themselve
+Globally independent objects/classes/functions that SHOULD be unit testable by themselve
diff --git a/src/libs/RateLimiter.ts b/src/libs/RateLimiter.ts
deleted file mode 100644
index 88350df..0000000
--- a/src/libs/RateLimiter.ts
+++ /dev/null
@@ -1,74 +0,0 @@
-import StatusCode from './HTTP/StatusCode'
-import { buildRFC7807 } from './RFCs/RFC7807'
-import ResponseBuilder from './ResponseBuilder'
-
-interface StorageItem {
- pointsRemaining: number
- timeReset: number
-}
-
-export interface RateLimitHeaders {
- "Retry-After"?: string,
- "X-RateLimit-Limit": string,
- "X-RateLimit-Remaining": string,
- "X-RateLimit-Reset": string
-}
-
-export default class RateLimiter {
-
- /**
- * number of points that can be used per {timeSpan}
- */
- public static points = 10
-
- /**
- * timeSpan in seconds
- */
- public static timeSpan = 60
-
- private static instance: RateLimiter = new RateLimiter()
- public static getInstance(): RateLimiter {
- return this.instance
- }
-
- private storage: Record = {}
-
- public constructor(
- private points = RateLimiter.points,
- private timeSpan = RateLimiter.timeSpan
- ) {}
-
- public consume(key: string, value: number = 1): Response | RateLimitHeaders {
- let item = this.storage[key]
- const now = (new Date().getTime() / 1000)
- if (!item) {
- item = {
- pointsRemaining: this.points,
- timeReset: now + this.timeSpan
- }
- }
- if (item.timeReset <= now) {
- item.timeReset = now + this.timeSpan
- item.pointsRemaining = this.points
- }
- item.pointsRemaining -= value
- this.storage[key] = item
- const headers: RateLimitHeaders = {
- "X-RateLimit-Limit": this.points.toFixed(0),
- "X-RateLimit-Remaining": Math.max(item.pointsRemaining, 0).toFixed(0),
- "X-RateLimit-Reset": item.timeReset.toFixed(0)
- }
- if (item.pointsRemaining < 0) {
- const res = new ResponseBuilder()
- const resp = buildRFC7807({
- type: '/docs/error/rate-limited',
- status: StatusCode.TOO_MANY_REQUESTS,
- title: 'You are being rate limited as you have done too many requests to the server'
- }, res)
- res.addHeader('Retry-After', (item.timeReset - now).toFixed(0))
- res.addHeaders(headers as any)
- return resp
- }
- return headers
- }
-}
diff --git a/src/libs/gcodeUtils.ts b/src/libs/gcodeUtils.ts
deleted file mode 100644
index de3b1a3..0000000
--- a/src/libs/gcodeUtils.ts
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- * try to parse a GCode config string into a number
- * @param str the string to try parsing
- * @returns a number if parsing happened correctly or undefined
- */
-function parseNumber(str: string): number | undefined {
- if (!/^-?(\d|\.)+$/g.test(str)) {
- return undefined
- }
- const float = parseFloat(str)
- const int = parseInt(str, 10)
- if (isNaN(int)) {
- return undefined
- }
- if (int !== float) {
- return float
- }
- return int
-}
-
-/**
- * decode a print time to a number of seconds
- * @param text the text to decode
- * @returns the number of seconds in the text
- */
-function decodeTime(text: string): number {
- let timeInSec = 0
- for (const it of text.split(' ')) {
- const lastChar = it.charAt(it.length - 1)
- const time = parseInt(it.slice(0, it.length - 1), 10)
- switch (lastChar) {
- case 'm':
- timeInSec += time * 60
- break;
- case 's':
- timeInSec += time
- break;
- case 'h':
- timeInSec += time * 60 * 60
- break;
- case 'd':
- timeInSec += time * 60 * 60 * 24
- break;
- default:
- throw new Error(`error parsing time ${it} (${time})`)
- }
- }
- return timeInSec
-}
-
-export function getParams(data: string) {
- // get the configuration lines
- const lines = data.split('\n').filter((it) => it.startsWith(';') && it.includes('='))
- // create the config object
- const obj: Record = {}
- // loop through each config
- for (const line of lines) {
- // get its key and value
- const [key, value] = line.slice(1).split(/ *= */, 2).map((it) => it.trim())
- // sip if it has no key or value
- if (!key || !value) {
- continue
- }
- // process the key
- let realKey = key
- // replace spaces by _
- .replace(/ /g, '_')
- // remove unparseable characters
- .replace(/\[|\]|\(|\)/g, '')
- // process the value
- const realValue = parseNumber(value) ?? value
- // add an offset if the key is already cited
- let offset = 0
- while (obj[`${realKey}${offset > 0 ? `_${offset}` : ''}`] && obj[`${realKey}${offset > 0 ? `_${offset}` : ''}`] !== realValue) {
- offset++
- }
- // chnge the key to add the offset
- if (offset > 0) {
- realKey = `${realKey}_${offset}`
- }
- // detect key collisions (it will never happens with the while above)
- // if (obj[realKey] && obj[realKey] !== realValue) {
- // throw new Error(`Key collision ${key}=${realValue} ${realKey}=${obj[realKey]}`)
- // }
- // set the value to the key
- obj[realKey] = realValue
- // transform the time to a number of seconds
- if (realKey === 'estimated_printing_time_normal_mode') {
- obj['estimated_printing_time_seconds'] = decodeTime(value)
- }
- }
- return obj
-}
diff --git a/src/libs/validateAuth.ts b/src/libs/validateAuth.ts
deleted file mode 100644
index 12e7795..0000000
--- a/src/libs/validateAuth.ts
+++ /dev/null
@@ -1,123 +0,0 @@
-import DaoFactory from '../models/DaoFactory'
-import CookieManager from './CookieManager'
-import { buildRFC7807 } from './RFCs/RFC7807'
-
-export interface Permission {
- name: string
- /**
- * if set it will be usable by users
- *
- * else only users with the `admin.` prefix in the key can run it
- */
- api: boolean
-
- /**
- * if set to true it will pass if a cookie authenticate a valid user
- */
- cookie: boolean
-}
-
-/**
- * validate the authentification
- * @param request the request
- * @param permission the permission to validate
- * @returns a Response if the request is invalid, null otherwise
- *
- * TODO: implement rate limiting
- * http/2.0 429 TOO MANY REQUESTS
- * Content-Type: application/json+problem
- * X-RateLimit-Limit: 1000 // number of request you cn make until hitting the rate limit
- * X-RateLimit-Remaining: 0 // number of request remaining until the rate limit is atteined
- * X-RateLimit-Reset: 123456789 // EPOCH time when the rate limit reset
- * X-RateLimit-Reset-After: 9 // Number of seconds before the remaining Rate reset
- */
-export async function validateAuth(request: Request, permission: Permission): Promise {
- const apiKeyHeader = request.headers.get('Authorization')
- const cookieHeader = request.headers.get('Cookie')
- if (apiKeyHeader) {
- const apiKey = apiKeyHeader.slice(apiKeyHeader.lastIndexOf(' ') + 1)
- const dao = await DaoFactory.get('apiKey').findOne({
- key: apiKey
- })
- const perm = permission.name.split('.')
- const match = dao?.permissions.find((it) => {
- const itSplit = it.split('.')
- if (itSplit[0] === 'admin') {
- itSplit.shift()
- }
- for (let idx = 0; idx < itSplit.length; idx++) {
- const permissionLayer = itSplit[idx]
- const requestPermissionLayer = perm[idx]
- if (permissionLayer === '*') {
- return true
- } else if (permissionLayer !== requestPermissionLayer) {
- return false
- }
- }
- return itSplit.length === perm.length
- // return it.endsWith(permission.name)
- })
- if (match && (permission.api || match.startsWith('admin.'))) {
- return apiKey
- } else if (permission.api) {
- return buildRFC7807({
- type: '/docs/errors/unauthorized-access',
- status: 401,
- title: 'Unauthorized access',
- details: `you are missing the permission "${permission.name}" or is not an admin`
- })
- }
- } else if (permission.api && !permission.cookie) {
- return buildRFC7807({
- type: '/docs/errors/unauthorized-access',
- status: 401,
- title: 'Unauthorized access',
- details: `You MUST define an API key fo use this endpoint`
- })
- }
-
- if (cookieHeader && permission.cookie) {
- // TODO: make a better cookie implementation
- const cookies = new CookieManager(cookieHeader)
- const userCookie = cookies.get('userId')
- if (!userCookie) {
- return buildRFC7807({
- type: '/docs/errors/unauthorized-access',
- status: 401,
- title: 'Unauthorized access',
- details: `you must be connected to use this endpoint (missing the userId cookie)`
- })
- }
- const dao = await DaoFactory.get('user').get(userCookie)
- if (!dao) {
- return buildRFC7807({
- type: '/docs/errors/unauthorized-access',
- status: 401,
- title: 'Unauthorized access',
- details: `the user does not exists`
- })
- }
- return userCookie
- } else if (!permission.api && permission.cookie) {
- return buildRFC7807({
- type: '/docs/errors/unauthorized-access',
- status: 401,
- title: 'Unauthorized access',
- details: `You MUST be connected to your account to use this endpoint`
- })
- } else if (permission.api && permission.cookie) {
- return buildRFC7807({
- type: '/docs/errors/unauthorized-access',
- status: 401,
- title: 'Unauthorized access',
- details: `You must be connected or use an API key to access this endpoint`
- })
- }
- return buildRFC7807({
- type: '/docs/errors/page-not-found',
- status: 404,
- title: 'Page not found',
- details: `the following endpoint does not exists`
- })
-
-}
diff --git a/src/middleware/README.md b/src/middleware/README.md
new file mode 100644
index 0000000..5ccdf5c
--- /dev/null
+++ b/src/middleware/README.md
@@ -0,0 +1,9 @@
+# Middlewares
+
+This folder contains middlewares for the SSR pages/endpoints
+
+They are run for every paths independent of the middleware and in the specified order of the `index.ts`
+
+## locals
+
+You can pass variables to other middlewares and endpoints by adding a variable in `locals` and in `App.Locals` in `env.d.ts`
diff --git a/src/middleware/apiAuth.ts b/src/middleware/apiAuth.ts
deleted file mode 100644
index 89c3ad7..0000000
--- a/src/middleware/apiAuth.ts
+++ /dev/null
@@ -1,52 +0,0 @@
-import { objectLoop } from '@dzeio/object-util'
-import URLManager from '@dzeio/url-manager'
-import { defineMiddleware } from "astro/middleware"
-import { buildRFC7807 } from '../libs/RFCs/RFC7807'
-import { Permission, validateAuth } from '../libs/validateAuth'
-
-const endpointsPermissions: Record = {
- '/api/v1/users/[userId]/configs/[configId]/files/[fileName]': {
- api: true,
- cookie: true,
- name: 'configs.get'
- },
- '/api/v1/slice/[configId]': {
- api: true,
- cookie: true,
- name: 'slice.slice'
- }
-}
-
-function objectFind(obj: object, fn: (value: any, key: any) => boolean): {key: string, value: any} | null {
- let res: {key: string, value: any} | null = null
- objectLoop(obj, (value, key) => {
- const tmp = fn(value, key)
- if (tmp) {
- res = {
- key, value
- }
- }
- return !tmp
- })
- return res
-}
-
-// `context` and `next` are automatically typed
-export default defineMiddleware(async (context, next) => {
- if (!context.request.url.includes('api')) {
- return next()
- }
- const permission = objectFind(endpointsPermissions, (_, key) => new URLManager(key).toString(context.params as any) === context.url.pathname)
- if (!permission) {
- return buildRFC7807({
- type: 'idk'
- })
- }
- const auth = await validateAuth(context.request, permission.value)
- if (typeof auth === 'object') {
- return auth
- }
- context.locals.authKey = auth
-
- return next()
-})
diff --git a/src/middleware/apiRateLimit.ts b/src/middleware/apiRateLimit.ts
deleted file mode 100644
index 9620e0e..0000000
--- a/src/middleware/apiRateLimit.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { defineMiddleware } from "astro/middleware"
-import RateLimiter from '../libs/RateLimiter'
-
-// `context` and `next` are automatically typed
-export default defineMiddleware(async ({ request, locals }, next) => {
- if (!request.url.includes('api')) {
- return next()
- }
-
- const limit = RateLimiter.getInstance().consume(locals.authKey as string)
-
- if ('status' in limit) {
- return limit
- }
- locals.responseBuilder.addHeaders(limit)
-
- return next()
-})
diff --git a/src/middleware/index.ts b/src/middleware/index.ts
index bb0b03b..db3224e 100644
--- a/src/middleware/index.ts
+++ b/src/middleware/index.ts
@@ -1,7 +1,5 @@
import { sequence } from "astro/middleware"
-import apiAuth from './apiAuth'
-import apiRateLimit from './apiRateLimit'
import responseBuilder from './responseBuilder'
-export const onRequest = sequence(responseBuilder, apiAuth, apiRateLimit)
+export const onRequest = sequence(responseBuilder)
diff --git a/src/models/APIKey/APIKeyDao.ts b/src/models/APIKey/APIKeyDao.ts
deleted file mode 100644
index 7841add..0000000
--- a/src/models/APIKey/APIKeyDao.ts
+++ /dev/null
@@ -1,79 +0,0 @@
-import { objectOmit } from '@dzeio/object-util'
-import mongoose from 'mongoose'
-import type APIKey from '.'
-import Client from '../Client'
-import Dao from '../Dao'
-
-export default class APIKeyDao extends Dao {
-
- // @ts-expect-error typing fix
- private model = mongoose.models['APIKey'] as null ?? mongoose.model('APIKey', new mongoose.Schema({
- user: { type: String, required: true },
- key: { type: String, required: true, unique: true, index: true},
- permissions: [{ type: String }]
- }, {
- timestamps: true
- }))
-
- public async create(obj: Omit): Promise {
- await Client.get()
- return this.fromSource(await this.model.create(obj))
- }
-
- public async findAll(query?: Partial | undefined): Promise {
- await Client.get()
- try {
- if (query?.id) {
- const item = await this.model.findById(new mongoose.Types.ObjectId(query.id))
- if (!item) {
- return []
- }
- return [this.fromSource(item)]
- }
- const resp = await this.model.find(query ? this.toSource(query as APIKey) : {})
- return resp.map(this.fromSource)
- } catch (e) {
- console.error(e)
- return []
- }
-
- }
-
- public async update(obj: APIKey): Promise {
- await Client.get()
-
- const query = await this.model.updateOne({
- _id: new mongoose.Types.ObjectId(obj.id)
- }, this.toSource(obj))
- if (query.matchedCount >= 1) {
- obj.updated = new Date()
- return obj
- }
- return null
- // return this.fromSource()
- }
-
- public async delete(obj: APIKey): Promise {
- await Client.get()
- const res = await this.model.deleteOne({
- _id: new mongoose.Types.ObjectId(obj.id)
- })
- return res.deletedCount > 0
- }
-
- private toSource(obj: APIKey): Omit {
- return objectOmit(obj, 'id', 'updated', 'created')
- }
-
- private fromSource(doc: mongoose.Document): APIKey {
- return {
- id: doc._id.toString(),
- user: doc.get('user'),
- key: doc.get('key'),
- permissions: doc.get('permissions') ?? [],
- updated: doc.get('updatedAt'),
- created: doc.get('createdAt')
- }
- }
-
-}
diff --git a/src/models/APIKey/index.ts b/src/models/APIKey/index.ts
deleted file mode 100644
index d6428e6..0000000
--- a/src/models/APIKey/index.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-export default interface APIKey {
- id: string
- user: string
- key: string
- permissions: Array
- created: Date
- updated: Date
-}
diff --git a/src/models/Client.ts b/src/models/Client.ts
deleted file mode 100644
index 799002e..0000000
--- a/src/models/Client.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import mongoose from 'mongoose'
-
-export default class Client {
-
- private static connectionString = import.meta.env.MONGODB
- private static client = false
- public static async get() {
- if (!this.connectionString) {
- throw new Error('Can\'t connect to the database, missing the connection string')
- }
- if (!this.client) {
- console.log(this.connectionString)
- mongoose.connect(this.connectionString)
- this.client = true
- }
- return this.client
- }
-}
diff --git a/src/models/Config/ConfigDao.ts b/src/models/Config/ConfigDao.ts
deleted file mode 100644
index bb77dd4..0000000
--- a/src/models/Config/ConfigDao.ts
+++ /dev/null
@@ -1,83 +0,0 @@
-import { objectOmit } from '@dzeio/object-util'
-import mongoose from 'mongoose'
-import type Config from '.'
-import Client from '../Client'
-import Dao from '../Dao'
-
-export default class ConfigDao extends Dao {
-
- // @ts-expect-error typing fix
- private model = mongoose.models['Config'] as null ?? mongoose.model('Config', new mongoose.Schema({
- user: { type: String, required: true },
- type: { type: String, required: true},
- files: [{
- name: { type: String, unique: true, required: true},
- data: { type: Buffer, required: true }
- }]
- }, {
- timestamps: true
- }))
-
-
- public async create(obj: Omit): Promise {
- await Client.get()
- return this.fromSource(await this.model.create(obj))
- }
-
- public async findAll(query?: Partial | undefined): Promise {
- await Client.get()
- try {
- if (query?.id) {
- const item = await this.model.findById(new mongoose.Types.ObjectId(query.id))
- if (!item) {
- return []
- }
- return [this.fromSource(item)]
- }
- const resp = await this.model.find(query ? this.toSource(query as Config) : {})
- return resp.map(this.fromSource)
- } catch (e) {
- console.error(e)
- return []
- }
-
- }
-
- public async update(obj: Config): Promise {
- await Client.get()
-
- const query = await this.model.updateOne({
- _id: new mongoose.Types.ObjectId(obj.id)
- }, this.toSource(obj))
- if (query.matchedCount >= 1) {
- obj.updated = new Date()
- return obj
- }
- return null
- // return this.fromSource()
- }
-
- public async delete(obj: Config): Promise {
- await Client.get()
- const res = await this.model.deleteOne({
- _id: new mongoose.Types.ObjectId(obj.id)
- })
- return res.deletedCount > 0
- }
-
- private toSource(obj: Config): Omit {
- return objectOmit(obj, 'id', 'updated', 'created')
- }
-
- private fromSource(doc: mongoose.Document): Config {
- return {
- id: doc._id.toString(),
- user: doc.get('user'),
- type: doc.get('type'),
- files: doc.get('files') ?? [],
- updated: doc.get('updatedAt'),
- created: doc.get('createdAt')
- }
- }
-
-}
diff --git a/src/models/Config/index.ts b/src/models/Config/index.ts
deleted file mode 100644
index 26a5b9e..0000000
--- a/src/models/Config/index.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-export default interface Config {
- id: string
- user: string
- type: 'prusa'
- files: Array<{
- name: string
- data: Buffer
- }>
- created: Date
- updated: Date
-}
diff --git a/src/models/DaoFactory.ts b/src/models/DaoFactory.ts
index 68077a6..960b057 100644
--- a/src/models/DaoFactory.ts
+++ b/src/models/DaoFactory.ts
@@ -1,8 +1,3 @@
-import APIKeyDao from './APIKey/APIKeyDao'
-import ConfigDao from './Config/ConfigDao'
-import SessionDao from './Session/SessionDao'
-import UserDao from './User/UserDao'
-
/**
* TODO:
* Add to `DaoItem` your model name
@@ -15,10 +10,6 @@ import UserDao from './User/UserDao'
* Touch this interface to define which key is linked to which Dao
*/
interface DaoItem {
- config: ConfigDao
- user: UserDao
- apiKey: APIKeyDao
- session: SessionDao
}
/**
@@ -57,10 +48,6 @@ export default class DaoFactory {
*/
private static initDao(item: keyof DaoItem): any | undefined {
switch (item) {
- case 'config': return new ConfigDao()
- case 'user': return new UserDao()
- case 'apiKey': return new APIKeyDao()
- case 'session': return new SessionDao()
default: return undefined
}
}
diff --git a/src/models/Session/SessionDao.ts b/src/models/Session/SessionDao.ts
deleted file mode 100644
index fecbf6e..0000000
--- a/src/models/Session/SessionDao.ts
+++ /dev/null
@@ -1,52 +0,0 @@
-import jwt, { SignOptions } from 'jsonwebtoken'
-import type Session from '.'
-import CookieManager from '../../libs/CookieManager'
-
-export interface SessionOptions {
- cookieName: string
- security: SignOptions
- key?: string
- privateKey?: string
- publicKey?: string
-}
-
-
-export default class SessionDao {
-
- private options: SessionOptions = {
- cookieName: 'session',
- security: {
- algorithm: 'ES512'
- },
- privateKey: import.meta.env.PRIVATE_KEY ?? '',
- publicKey: import.meta.env.PUBLIC_KEY ?? ''
- }
-
- public getSession(req: Request): Session | null {
- const cookie = new CookieManager(req.headers.get('Cookie') ?? '').get(this.options.cookieName)
- if (!cookie) {
- return null
- }
- try {
- return jwt.verify(cookie, (this.options.publicKey || this.options.key) as string) as Session
- } catch {
- return null
- }
- }
-
- public setSession(session: Session, res: ResponseInit & { readonly headers: Headers; }) {
- const token = jwt.sign(session, (this.options.privateKey || this.options.key) as string, this.options.security)
- CookieManager.addCookie(res, {
- key: this.options.cookieName,
- value: token,
- httpOnly: true,
- path: '/',
- secure: true,
- sameSite: 'Strict',
- maxAge: 365000
- })
- }
-
- public removeSession(_res: ResponseInit & { readonly headers: Headers; }) {
- }
-}
diff --git a/src/models/Session/index.ts b/src/models/Session/index.ts
deleted file mode 100644
index df263da..0000000
--- a/src/models/Session/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export default interface Session {
- userId: string
-}
diff --git a/src/models/User/UserDao.ts b/src/models/User/UserDao.ts
deleted file mode 100644
index 4151aaa..0000000
--- a/src/models/User/UserDao.ts
+++ /dev/null
@@ -1,71 +0,0 @@
-import { objectOmit } from '@dzeio/object-util'
-import mongoose from 'mongoose'
-import type User from '.'
-import Client from '../Client'
-import Dao from '../Dao'
-
-export default class UserDao extends Dao {
-
- // @ts-expect-error typing fix
- private model = mongoose.models['User'] as null ?? mongoose.model('User', new mongoose.Schema({
- email: { type: String, required: true },
- password: { type: String, required: true }
- }, {
- timestamps: true
- }))
-
- public async create(obj: Omit): Promise {
- await Client.get()
- return this.fromSource(await this.model.create(obj))
- }
-
- public async findAll(query?: Partial | undefined): Promise {
- await Client.get()
- if (query?.id) {
- const item = await this.model.findById(new mongoose.Types.ObjectId(query.id))
- if (!item) {
- return []
- }
- return [this.fromSource(item)]
- }
- const resp = await this.model.find(query ? this.toSource(query as User) : {})
- return resp.map(this.fromSource)
-
- }
-
- public async update(obj: User): Promise {
- await Client.get()
-
- const query = await this.model.updateOne({
- _id: new mongoose.Types.ObjectId(obj.id)
- }, this.toSource(obj))
- if (query.matchedCount >= 1) {
- obj.updated = new Date()
- return obj
- }
- return null
- // return this.fromSource()
- }
-
- public async delete(obj: User): Promise {
- await Client.get()
- const res = await this.model.deleteOne({
- _id: new mongoose.Types.ObjectId(obj.id)
- })
- return res.deletedCount > 0
- }
-
- private toSource(obj: User): Omit {
- return objectOmit(obj, 'id', 'updated', 'created')
- }
-
- private fromSource(doc: mongoose.Document): User {
- return {
- id: doc._id.toString(),
- email: doc.get('email'),
- password: doc.get('password'),
- updated: doc.get('updatedAt'),
- created: doc.get('createdAt')
- }
- }
-}
diff --git a/src/models/User/index.ts b/src/models/User/index.ts
deleted file mode 100644
index 70e8c57..0000000
--- a/src/models/User/index.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-export default interface User {
- id: string
- email: string
- password: string
- created: Date
- updated: Date
-}
diff --git a/src/pages/README.md b/src/pages/README.md
new file mode 100644
index 0000000..8f497fa
--- /dev/null
+++ b/src/pages/README.md
@@ -0,0 +1,5 @@
+# Content
+
+Contains raw content for pages.
+
+Mostly some static pages or blog posts.
diff --git a/src/pages/account/login.astro b/src/pages/account/login.astro
deleted file mode 100644
index 54ae1fe..0000000
--- a/src/pages/account/login.astro
+++ /dev/null
@@ -1,66 +0,0 @@
----
-import URLManager from '@dzeio/url-manager'
-import Layout from '../../layouts/Layout.astro'
-import DaoFactory from '../../models/DaoFactory'
-import { comparePassword } from '../../libs/AuthUtils'
-import Passthrough from '../../components/Passthrough.astro'
-
-const logout = typeof new URLManager(Astro.url).query('logout') === 'string'
-
-if (logout) {
- DaoFactory.get('session').removeSession(Astro.response)
-}
-
-// DaoFactory.get('session').removeSession(Astro.response)
-
-let connected = false
-const sessionDao = DaoFactory.get('session')
-if (sessionDao.getSession(Astro.request) && !logout) {
- connected = true
-}
-
-if (!connected && Astro.request.method === 'POST') {
- const form = await Astro.request.formData()
- const email = form.get('email') as string
- const password = form.get('password') as string
-
- const account = await DaoFactory.get('user').findOne({
- email
- })
-
- if (account) {
- const valid = await comparePassword(password, account.password)
- if (valid) {
- DaoFactory.get('session').setSession({
- userId: account.id
- }, Astro.response)
- connected = true
- }
- }
-}
-
----
-
-
-
-
-
-
-
-
-
diff --git a/src/pages/account/register.astro b/src/pages/account/register.astro
deleted file mode 100644
index f64ec4f..0000000
--- a/src/pages/account/register.astro
+++ /dev/null
@@ -1,45 +0,0 @@
----
-import Layout from '../../layouts/Layout.astro'
-import { hashPassword } from '../../libs/AuthUtils'
-import DaoFactory from '../../models/DaoFactory'
-
-let errorMessage: string | undefined
-
-if (Astro.request.method === 'POST') {
- const form = await Astro.request.formData()
- const email = form.get('email') as string
- const password = form.get('password') as string
-
- const user = await DaoFactory.get('user').create({
- email: email,
- password: await hashPassword(password)
- })
-
- if (!user) {
- errorMessage = 'User already exists'
- return
- }
-
- DaoFactory.get('session').setSession({
- userId: user.id
- }, Astro.response)
-
-}
-
----
-
-
-
- {errorMessage && (
-
- {errorMessage}
-
- )}
-
-
-
diff --git a/src/pages/admin.astro b/src/pages/admin.astro
deleted file mode 100644
index 0d85eb3..0000000
--- a/src/pages/admin.astro
+++ /dev/null
@@ -1,59 +0,0 @@
----
-import Passthrough from '../components/Passthrough.astro'
-import Layout from '../layouts/Layout.astro'
-import DaoFactory from '../models/DaoFactory'
-
-const session = DaoFactory.get('session').getSession(Astro.request)
-
-if (!session) {
- return Astro.redirect('/')
-}
-
-const user = await DaoFactory.get('user').get(session.userId)
-const list = await DaoFactory.get('apiKey').findAll({
- user: user!.id
-})
-const configs = await DaoFactory.get('config').findAll({
- user: user!.id
-})
-const userId = user?.id ?? 'unknown'
-
----
-
-
-
- {user?.id}
-
-
-
-
-
-
diff --git a/src/pages/api/v1/slice/[configId].ts b/src/pages/api/v1/slice/[configId].ts
deleted file mode 100644
index 0d2be4f..0000000
--- a/src/pages/api/v1/slice/[configId].ts
+++ /dev/null
@@ -1,262 +0,0 @@
-import Logger from '@dzeio/logger'
-import { objectMap, objectOmit } from '@dzeio/object-util'
-import URLManager from '@dzeio/url-manager'
-import type { APIRoute } from 'astro'
-import { evaluate } from 'mathjs'
-import { spawn } from 'node:child_process'
-import fs from 'node:fs/promises'
-import os from 'node:os'
-import path from 'node:path'
-import StatusCode from '../../../../libs/HTTP/StatusCode'
-import { buildRFC7807 } from '../../../../libs/RFCs/RFC7807'
-import { getParams } from '../../../../libs/gcodeUtils'
-import DaoFactory from '../../../../models/DaoFactory'
-
-interface SliceError {
- code: number
- output: Array
-}
-
-let tmpDir: string
-
-/**
- * body is the stl
- * query
- * price: algorithm from settings
- * adionnal settings from https://manual.slic3r.org/advanced/command-line
- */
-export const post: APIRoute = async ({ params, request, locals }) => {
- if (!tmpDir) {
- tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), 'saas-'))
- }
-
- const configId = params.configId ?? 'undefined'
- const config = await DaoFactory.get('config').get(configId)
-
- if (!config) {
- return buildRFC7807({
- type: '/docs/errors/missing-config',
- status: StatusCode.NOT_FOUND,
- title: 'The configuration does not exists',
- details: `The configuration ${configId} does not exists`
- })
- }
-
- const input = new Uint8Array(Buffer.from(await request.arrayBuffer()))
-
- if (input.length <= 0) {
- return buildRFC7807({
- type: '/docs/errors/missing-input-file',
- status: StatusCode.BAD_REQUEST,
- title: 'You are missing the STL file',
- details: `To process a file you need to input the file binary datas as the only body in your request`
- })
- }
-
- const query = new URLManager(request.url).query()
-
- const processId = (Math.random() * 1000000).toFixed(0)
- const logger = new Logger(`process-${processId}`)
- const processFolder = `${tmpDir}/${processId}`
- const pouet = await fs.mkdir(processFolder, { recursive: true })
-
- logger.log('poeut', pouet)
-
- logger.log('started processing request')
-
- logger.log('writing configs to dir')
- for (const file of config.files) {
- await fs.writeFile(`${processFolder}/${file.name}`, file.data)
- }
-
-
- const overrides = objectOmit(query, 'algo')
-
- const stlPath = `${processFolder}/input.stl`
- const gcodePath = `${processFolder}/output.gcode`
-
- logger.log('writing STL to filesystem')
- // write input
- await fs.writeFile(stlPath, input, {
- encoding: null
- })
-
- // additionnal parameters
- let additionnalParams = objectMap(overrides, (value, key) => `--${(key as string).replace(/_/g, '-')} ${value}`).join(' ')
-
-
- let slicerPath: string
- let slicerCommand: string
-
- if (config.type === 'prusa' || true) {
- slicerPath = import.meta.env.PRUSASLICER_PATH ?? 'prusa-slicer'
- additionnalParams += ' --export-gcode --loglevel 4'
- slicerCommand = `${path.normalize(stlPath)} --load ${path.normalize(`${processFolder}/config.ini`)} --output ${path.normalize(gcodePath)} ${additionnalParams}`
- }
-
-
- // TODO: check if it does work on a linux environment
- // TODO: Externalise IO for the different slicers
- try {
- logger.log('Running', slicerPath, slicerCommand)
- await new Promise((res, rej) => {
- const logs: Array = []
- const slicer = spawn(`"${slicerPath}"`, slicerCommand.split(' '), {
- shell: true
- })
- const log = (data: Buffer) => {
- const line = `${data.toString('utf-8')}`
- logger.log(line)
- logs.push(line)
- }
- slicer.stdout.on('data', log)
- slicer.stderr.on('data', log)
-
- slicer.on('spawn', () => {
- logs.push('Process spawned')
- logger.log('Process spawned')
- })
-
- slicer.on('error', (err) => {
- logs.push('Process error')
- logger.log('Process error')
- logger.log('error', err)
- logs.push(err.toString())
- rej(err)
- })
-
- slicer.on('close', (code, signal) => {
- logs.push('Process closed')
- logger.log('Process closed')
- logs.push(`with code ${code}`)
- logger.log(`with code ${code}`)
- logs.push(`and signal ${signal}`)
- logger.log(`and signal ${signal}`)
- if (typeof code === 'number' && code !== 0) {
- rej({
- code: code,
- output: logs
- } as SliceError)
- return
- }
- res()
- })
- })
- } catch (e: any) {
- const err = e as SliceError
- logger.log('request finished in error :(', processId)
- const line = err.toString()
- logger.error('error', err, typeof err)
- if (err.code === 3221226505 || line.includes('Objects could not fit on the bed')) {
- await fs.rm(stlPath)
- return buildRFC7807({
- type: '/docs/errors/object-too-large',
- status: StatusCode.PAYLOAD_TOO_LARGE,
- title: 'Object is too large',
- details: 'The STL you are trying to compile is too large for the configuration you chose'
- }, locals.responseBuilder)
- } else if (line.includes('No such file')) {
- await fs.rm(stlPath)
- return buildRFC7807({
- type: '/docs/errors/missing-config-file',
- status: StatusCode.NOT_FOUND,
- title: 'Configuration file is missing',
- details: `the configuration file "${configId}" is not available on the remote server`
- }, locals.responseBuilder)
- } else if (line.includes('Unknown option')) {
- await fs.rm(stlPath)
- return buildRFC7807({
- type: '/docs/errors/slicer-option-unknown',
- status: 400,
- title: ' config override doew not exists',
- details: 'an override does not exists, please contact an administrator or refer to the documentation'
- }, locals.responseBuilder)
- } else if (
- line.includes('is not recognized as an internal or external command') ||
- line.includes('.dll was not loaded')
- ) {
- await fs.rm(stlPath)
- return buildRFC7807({
- type: '/docs/errors/slicer-not-found',
- status: StatusCode.SERVICE_UNAVAILABLE,
- title: 'the slicer used to process this file has not been found',
- details: 'the server has a misconfiguration meaning that we can\'t process the request, please contact an administrator',
- additionnalInfo: line.includes('dll') ? 'Missing DLL' : 'Slicer not found '
- }, locals.responseBuilder)
- } else if (line.includes('ETIMEDOUT')) {
- await fs.rm(stlPath)
- return buildRFC7807({
- type: '/docs/errors/timed-out-slicing',
- status: StatusCode.PAYLOAD_TOO_LARGE,
- title: 'Timed out slicing file',
- detail: `The file you are trying to process takes too long to be processed`,
- processingTimeoutMillis: 60000
- }, locals.responseBuilder)
- }
- return buildRFC7807({
- type: '/docs/errors/general-input-output-error',
- status: StatusCode.INTERNAL_SERVER_ERROR,
- title: 'General I/O error',
- details: 'A server error make it impossible to slice the file, please contact an administrator with the json error',
- fileId: processId,
- config: configId,
- // fileSize: req.body.length,
- overrides: overrides,
- serverMessage:
- err.output.map((line) => line.replace(new RegExp(stlPath), `***FILE***`).replace(new RegExp(processFolder), ''))
- }, locals.responseBuilder)
- }
- const gcode = await fs.readFile(gcodePath, 'utf-8')
- await fs.rm(processFolder, { recursive: true, force: true })
- logger.log('Getting parameters')
- const gcodeParams = getParams(gcode)
- let price: string | undefined
- if (query?.algo) {
- let algo = decodeURI(query.algo as string)
- // objectLoop(params, (value, key) => {
- // if (typeof value !== 'number') {
- // return
- // }
- // while (algo.includes(key)) {
- // algo = algo.replace(key, value.toString())
- // }
- // })
- try {
- logger.log('Evaluating Alogrithm')
- const tmp = evaluate(algo, gcodeParams)
- if (typeof tmp === 'number') {
- price = tmp.toFixed(2)
- } else {
- return buildRFC7807({
- type: '/docs/errors/algorithm-error',
- status: 500,
- title: 'Algorithm compilation error',
- details: 'It seems the algorithm resolution failed',
- algorithm: algo,
- algorithmError: 'Algorithm return a Unit',
- parameters: gcodeParams
- }, locals.responseBuilder)
- }
- } catch (e) {
- logger.dir(e)
- return buildRFC7807({
- type: '/docs/errors/algorithm-error',
- status: 500,
- title: 'Algorithm compilation error',
- details: 'It seems the algorithm resolution failed',
- algorithm: algo,
- algorithmError: e,
- parameters: gcodeParams
- }, locals.responseBuilder)
- }
- }
- logger.log('request successfull :)')
- return locals.responseBuilder
- .body({
- price: price ? parseFloat(price) : undefined,
- ...getParams(gcode),
- gcode
- })
- .status(200)
- .build()
-}
diff --git a/src/pages/api/v1/users/[userId]/configs/[configId]/files/[fileName].ts b/src/pages/api/v1/users/[userId]/configs/[configId]/files/[fileName].ts
deleted file mode 100644
index b4472af..0000000
--- a/src/pages/api/v1/users/[userId]/configs/[configId]/files/[fileName].ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import type { APIRoute } from 'astro'
-import { buildRFC7807 } from '../../../../../../../../libs/RFCs/RFC7807'
-import DaoFactory from '../../../../../../../../models/DaoFactory'
-
-export const get: APIRoute = async ({ params, locals }) => {
- const configId = params.configId as string
- const fileName = params.fileName as string
-
-
- const dao = await DaoFactory.get('config').get(configId)
-
- if (!dao) {
- return buildRFC7807({
- title: 'Config does not exists :('
- })
- }
-
- const file = dao.files.find((it) => it.name === fileName)
-
- return locals.responseBuilder
- .status(200)
- .body(file?.data)
- .build()
-}
diff --git a/src/pages/api/v1/users/[userId]/configs/index.ts b/src/pages/api/v1/users/[userId]/configs/index.ts
deleted file mode 100644
index 6640c3f..0000000
--- a/src/pages/api/v1/users/[userId]/configs/index.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-import { objectOmit } from '@dzeio/object-util'
-import type { APIRoute } from 'astro'
-import StatusCode from '../../../../../../libs/HTTP/StatusCode'
-import { buildRFC7807 } from '../../../../../../libs/RFCs/RFC7807'
-import DaoFactory from '../../../../../../models/DaoFactory'
-
-export const post: APIRoute = async ({ params, request, locals }) => {
- const userId = params.userId as string
-
- const body = request.body
-
- if (!body) {
- return buildRFC7807({
- title: 'Missing config file'
- })
- }
-
- const reader = body.getReader()
-
- const chunks: Array = []
-
- let finished= false
- do {
- const { done, value } = await reader.read()
- finished = done
- if (value) {
- chunks.push(value)
- }
- } while (!finished)
-
- const buffer = Buffer.concat(chunks)
-
- const dao = await DaoFactory.get('config').create({
- user: userId,
- type: 'prusa',
- files: [{
- name: 'config.ini',
- data: buffer
- }]
- })
- return locals.responseBuilder
- .status(StatusCode.CREATED)
- .body(objectOmit(dao ?? {}, 'files'))
- .build()
-}
diff --git a/src/pages/api/v1/users/[userId]/keys/index.ts b/src/pages/api/v1/users/[userId]/keys/index.ts
deleted file mode 100644
index ac5df30..0000000
--- a/src/pages/api/v1/users/[userId]/keys/index.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import type { APIRoute } from 'astro'
-import crypto from 'node:crypto'
-import StatusCode from '../../../../../../libs/HTTP/StatusCode'
-import DaoFactory from '../../../../../../models/DaoFactory'
-
-export const post: APIRoute = async ({ params, locals }) => {
- const userId = params.userId as string
-
- const dao = await DaoFactory.get('apiKey').create({
- user: userId,
- key: crypto.randomUUID(),
- permissions: [
- 'admin.user.list'
- ]
- })
- return locals.responseBuilder
- .status(StatusCode.CREATED)
- .body(dao)
- .build()
-}
diff --git a/src/pages/api/v1/users/index.ts b/src/pages/api/v1/users/index.ts
deleted file mode 100644
index fb605ec..0000000
--- a/src/pages/api/v1/users/index.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import type { APIRoute } from 'astro'
-import StatusCode from '../../../../libs/HTTP/StatusCode'
-import { buildRFC7807 } from '../../../../libs/RFCs/RFC7807'
-
-export const get: APIRoute = async ({ locals }) => {
- return locals.responseBuilder
- .status(200)
- .body({iam: true})
- .build()
-}
-
-export const options: APIRoute = async () => {
- return buildRFC7807({
- status: StatusCode.METHOD_NOT_ALLOWED,
- details: 'Allowed methods: "GET"'
- })
-}
diff --git a/src/pages/docs/[...page].astro b/src/pages/docs/[...page].astro
deleted file mode 100644
index ee918fb..0000000
--- a/src/pages/docs/[...page].astro
+++ /dev/null
@@ -1,24 +0,0 @@
----
-import Layout from '../../layouts/Layout.astro'
-import { getEntry } from 'astro:content'
-import StatusCode from '../../libs/HTTP/StatusCode'
-
-const page = Astro.params.page
-
-let Result: any
-
-const entry = await getEntry('docs', page as any)
-if (!entry) {
- Astro.response.status = StatusCode.NOT_FOUND
-} else {
- const { Content } = await entry.render()
- Result = Content
-}
----
-
-
-
- {Result && }
-
-
-
diff --git a/src/pages/index.astro b/src/pages/index.astro
index c4ddee8..86aac1f 100644
--- a/src/pages/index.astro
+++ b/src/pages/index.astro
@@ -1,5 +1,5 @@
---
-import Layout from '../layouts/Layout.astro';
+import Layout from '../layouts/Layout.astro'
---
@@ -9,9 +9,5 @@ import Layout from '../layouts/Layout.astro';
To get started, open the directory src/pages
in your project.
Code Challenge: Tweak the "Welcome to Astro" message above.
-
diff --git a/tailwind.config.cjs b/tailwind.config.cjs
index 3cc3d69..b1ac738 100644
--- a/tailwind.config.cjs
+++ b/tailwind.config.cjs
@@ -1,10 +1,9 @@
+// const defaultTheme = require('tailwindcss/defaultTheme')
+
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}'],
theme: {
extend: {},
- },
- plugins: [
- require('@tailwindcss/typography'),
- ],
+ }
}
diff --git a/tests/README.md b/tests/README.md
new file mode 100644
index 0000000..3d14726
--- /dev/null
+++ b/tests/README.md
@@ -0,0 +1,5 @@
+# Tests
+
+Old Unit tests for each elements
+
+the paths should correspond to the base folder from `src`
diff --git a/tests/basic.test.ts b/tests/basic.test.ts
index 7f548ad..6c43f34 100644
--- a/tests/basic.test.ts
+++ b/tests/basic.test.ts
@@ -1,5 +1,4 @@
-import { assert, expect, test } from 'vitest'
-import { comparePassword, hashPassword } from '../src/libs/AuthUtils'
+import { expect, test } from 'vitest'
// Edit an assertion and save to see HMR in action
@@ -8,26 +7,3 @@ test('Math.sqrt()', () => {
expect(Math.sqrt(144)).toBe(12);
expect(Math.sqrt(2)).toBe(Math.SQRT2);
});
-
-test('JSON', () => {
- const input = {
- foo: 'hello',
- bar: 'world',
- };
-
- const output = JSON.stringify(input);
-
- expect(output).eq('{"foo":"hello","bar":"world"}');
- assert.deepEqual(JSON.parse(output), input, 'matches original');
-});
-
-test('auth util', async () => {
- const password = 'pouet'
-
- const out1 = await hashPassword(password)
- expect(out1).not.toBe(password)
- const out2 = await hashPassword(password)
- expect(out2).not.toBe(out1)
- expect(await comparePassword(password, out1)).toBe(true)
- expect(await comparePassword(password, out2)).toBe(true)
-})
diff --git a/tests/libs/authUtils.test.ts b/tests/libs/authUtils.test.ts
deleted file mode 100644
index c3dbb74..0000000
--- a/tests/libs/authUtils.test.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { describe, expect, it } from 'vitest'
-import { comparePassword, hashPassword } from '../../src/libs/AuthUtils'
-
-
-describe('AuthUtils', () => {
- it('should hash the password', async () => {
- expect(await hashPassword('test')).toBeDefined()
- })
-
- it('should compared succeffully password', async () => {
- const pass = 'test'
- const hash = await hashPassword(pass)
- expect(await comparePassword(pass, hash)).toBe(true)
- })
-
- it('should not generate twice the same hash', async () => {
- const pass = 'test'
- const hash1 = await hashPassword(pass)
- const hash2 = await hashPassword(pass)
- expect(hash1).not.toBe(hash2)
- })
-})
diff --git a/tests/libs/gcodeUtilts.test.ts b/tests/libs/gcodeUtilts.test.ts
deleted file mode 100644
index 1453f35..0000000
--- a/tests/libs/gcodeUtilts.test.ts
+++ /dev/null
@@ -1,50 +0,0 @@
-import { describe, expect, it } from 'vitest'
-import { getParams } from '../../src/libs/gcodeUtils'
-
-
-describe('gcodeUtils', () => {
- it('should get parameters', () => {
- const gcode = `
-balfs
-dgfdf
-sd
-httphq
-estimated_printing_time_normal_modewef
-
-; test=a
-fgd
-;test =b
-;test= c
-;test = d
-;number=1.12
-;number2=-1
-;invalid=
-;invalid
-;estimated_printing_time_normal_mode=1d 1h 1m 1s
-
-sdffgaf
-fgsdf
-g
-sfd
-hh
-ehf
-`
- expect(getParams(gcode)).toEqual({
- test: 'a',
- test_1: 'b',
- test_2: 'c',
- test_3: 'd',
- number: 1.12,
- number2: -1,
- estimated_printing_time_normal_mode: '1d 1h 1m 1s',
- estimated_printing_time_seconds: 90061
- })
- })
-
- it('should get parameters', () => {
- const gcode = `
-;estimated_printing_time_normal_mode=1w 1d 1h 1m 1s
-`
- expect(() => getParams(gcode)).toThrow(/1w/g)
- })
-})
diff --git a/tests/libs/rateLimit.test.ts b/tests/libs/rateLimit.test.ts
deleted file mode 100644
index 3eed7d4..0000000
--- a/tests/libs/rateLimit.test.ts
+++ /dev/null
@@ -1,122 +0,0 @@
-import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
-import RateLimiter from '../../src/libs/RateLimiter'
-
-
-// Mock Response
-vi.stubGlobal('Response', class {
- public constructor(
- public body?: any,
- public init?: any
- ) {}
-})
-
-describe('Rate Limit', () => {
- beforeEach(() => {
- vi.useFakeTimers()
- })
-
-
- it('should work with global variant', () => {
- const now1 = new Date(1000)
- vi.setSystemTime(now1)
- const limit = RateLimiter.getInstance()
-
- const result1 = limit.consume('key')
- expect(result1).toEqual({
- "X-RateLimit-Limit": '10',
- "X-RateLimit-Remaining": '9',
- "X-RateLimit-Reset": '61'
- })
- const limit2 = RateLimiter.getInstance()
- const result2 = limit2.consume('key')
- expect(result2).toEqual({
- "X-RateLimit-Limit": '10',
- "X-RateLimit-Remaining": '8',
- "X-RateLimit-Reset": '61'
- })
- })
-
- it('should consume points', () => {
- const now1 = new Date(1000)
- vi.setSystemTime(now1)
- const limit = new RateLimiter(2, 10)
-
- const result1 = limit.consume('key')
- expect(result1).toEqual({
- "X-RateLimit-Limit": '2',
- "X-RateLimit-Remaining": '1',
- "X-RateLimit-Reset": '11'
- })
- const result2 = limit.consume('key')
- expect(result2).toEqual({
- "X-RateLimit-Limit": '2',
- "X-RateLimit-Remaining": '0',
- "X-RateLimit-Reset": '11'
- })
- })
-
- it('should rate limit', () => {
- const now1 = new Date(1000)
- vi.setSystemTime(now1)
- const limit = new RateLimiter(1, 10)
-
- const result1 = limit.consume('key')
- expect(result1).toEqual({
- "X-RateLimit-Limit": '1',
- "X-RateLimit-Remaining": '0',
- "X-RateLimit-Reset": '11'
- })
- const result2 = limit.consume('key')
- expect(result2).instanceOf(Response)
- const result3 = limit.consume('key')
- expect(result3).instanceOf(Response)
- })
-
- it('should reset after some time', () => {
- const now1 = new Date(1000)
- vi.setSystemTime(now1)
- const limit = new RateLimiter(2, 10)
-
- const result1 = limit.consume('key')
- expect(result1).toEqual({
- "X-RateLimit-Limit": '2',
- "X-RateLimit-Remaining": '1',
- "X-RateLimit-Reset": '11'
- })
- const result2 = limit.consume('key')
- expect(result2).toEqual({
- "X-RateLimit-Limit": '2',
- "X-RateLimit-Remaining": '0',
- "X-RateLimit-Reset": '11'
- })
-
-
- const result3 = limit.consume('key')
- expect(result3).instanceOf(Response)
-
- const now2 = new Date(11000)
- vi.setSystemTime(now2)
- const result4 = limit.consume('key')
- expect(result4).toEqual({
- "X-RateLimit-Limit": '2',
- "X-RateLimit-Remaining": '1',
- "X-RateLimit-Reset": '21'
- })
-
-
- const result5 = limit.consume('key')
- expect(result5).toEqual({
- "X-RateLimit-Limit": '2',
- "X-RateLimit-Remaining": '0',
- "X-RateLimit-Reset": '21'
- })
-
-
- const result6 = limit.consume('key')
- expect(result6).instanceOf(Response)
- })
-
- afterEach(() => {
- vi.useRealTimers()
- })
-})