Compare commits
14 Commits
621d2bff2d
...
supabase
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a38edfbc07 | ||
|
|
6c2e80ecc1 | ||
|
|
c28c338de4 | ||
|
|
906f0376d2 | ||
|
|
52c3b9c871 | ||
|
|
ea985c21a9 | ||
|
|
c063c1c5c4 | ||
|
|
297641ee2d | ||
|
|
2c2ee18fa3 | ||
|
|
c24a845999 | ||
|
|
be2e22100f | ||
|
|
e2e18d1084 | ||
|
|
ac4c86aaa9 | ||
|
|
2c498a62ee |
@@ -46,7 +46,7 @@ jobs:
|
|||||||
org.opencontainers.image.revision=${{ env.GITHUB_SHA }}
|
org.opencontainers.image.revision=${{ env.GITHUB_SHA }}
|
||||||
org.opencontainers.image.vendor=Orebolt.cz
|
org.opencontainers.image.vendor=Orebolt.cz
|
||||||
org.opencontainers.image.ref.name=${{ env.GITHUB_REF }}
|
org.opencontainers.image.ref.name=${{ env.GITHUB_REF }}
|
||||||
org.opencontainers.image.title=ESN Code Scanner App
|
org.opencontainers.image.title=ScanWave
|
||||||
|
|
||||||
- name: Run Trivy vulnerability scanner
|
- name: Run Trivy vulnerability scanner
|
||||||
uses: aquasecurity/trivy-action@0.24.0
|
uses: aquasecurity/trivy-action@0.24.0
|
||||||
|
|||||||
12
docker-compose-prod.yml
Normal file
12
docker-compose-prod.yml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
services:
|
||||||
|
app:
|
||||||
|
image: ${DOCKER_REGISTRY}/${DOCKER_USER}/${DOCKER_IMAGE}:latest
|
||||||
|
restart: unless-stopped
|
||||||
|
env_file: .env
|
||||||
|
labels:
|
||||||
|
- "traefik.enable=true"
|
||||||
|
- "traefik.http.routers.scan-wave.rule=Host(`scanwave.orebolt.cz`)"
|
||||||
|
- "traefik.http.routers.scan-wave.tls.certresolver=leresolver"
|
||||||
|
- "traefik.http.routers.scan-wave.entrypoints=websecure"
|
||||||
|
- "traefik.http.services.scan-wave.loadbalancer.server.port=3000"
|
||||||
|
- "traefik.http.routers.scan-wave.middlewares=hsts"
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: ${DOCKER_REGISTRY}/${DOCKER_USER}/esn-code-scanner-app:latest
|
image: ${DOCKER_REGISTRY}/${DOCKER_USER}/${DOCKER_IAMGE}:latest
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
448
package-lock.json
generated
448
package-lock.json
generated
@@ -1,21 +1,24 @@
|
|||||||
{
|
{
|
||||||
"name": "esn-code-scanner",
|
"name": "scan-wave",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "esn-code-scanner",
|
"name": "scan-wave",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@supabase/ssr": "^0.6.1",
|
"@supabase/ssr": "^0.6.1",
|
||||||
"@supabase/supabase-js": "^2.50.0",
|
"@supabase/supabase-js": "^2.50.0",
|
||||||
"@sveltejs/adapter-node": "^5.2.12",
|
"@sveltejs/adapter-node": "^5.2.12",
|
||||||
"googleapis": "^150.0.1",
|
"googleapis": "^150.0.1",
|
||||||
"papaparse": "^5.5.3"
|
"papaparse": "^5.5.3",
|
||||||
|
"qrcode": "^1.5.4",
|
||||||
|
"quoted-printable": "^1.0.1",
|
||||||
|
"simple-icons": "^15.3.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@sveltejs/kit": "^2.16.0",
|
"@sveltejs/kit": "^2.22.0",
|
||||||
"@sveltejs/vite-plugin-svelte": "^5.0.0",
|
"@sveltejs/vite-plugin-svelte": "^5.0.0",
|
||||||
"@tailwindcss/typography": "^0.5.15",
|
"@tailwindcss/typography": "^0.5.15",
|
||||||
"@tailwindcss/vite": "^4.0.0",
|
"@tailwindcss/vite": "^4.0.0",
|
||||||
@@ -27,7 +30,7 @@
|
|||||||
"svelte-check": "^4.0.0",
|
"svelte-check": "^4.0.0",
|
||||||
"tailwindcss": "^4.0.0",
|
"tailwindcss": "^4.0.0",
|
||||||
"typescript": "^5.0.0",
|
"typescript": "^5.0.0",
|
||||||
"vite": "^6.2.6"
|
"vite-plugin-devtools-json": "^0.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@ampproject/remapping": {
|
"node_modules/@ampproject/remapping": {
|
||||||
@@ -55,6 +58,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"aix"
|
"aix"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
@@ -71,6 +75,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"android"
|
"android"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
@@ -87,6 +92,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"android"
|
"android"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
@@ -103,6 +109,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"android"
|
"android"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
@@ -119,6 +126,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"darwin"
|
"darwin"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
@@ -135,6 +143,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"darwin"
|
"darwin"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
@@ -151,6 +160,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"freebsd"
|
"freebsd"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
@@ -167,6 +177,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"freebsd"
|
"freebsd"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
@@ -183,6 +194,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"linux"
|
"linux"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
@@ -199,6 +211,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"linux"
|
"linux"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
@@ -215,6 +228,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"linux"
|
"linux"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
@@ -231,6 +245,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"linux"
|
"linux"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
@@ -247,6 +262,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"linux"
|
"linux"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
@@ -263,6 +279,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"linux"
|
"linux"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
@@ -279,6 +296,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"linux"
|
"linux"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
@@ -295,6 +313,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"linux"
|
"linux"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
@@ -311,6 +330,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"linux"
|
"linux"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
@@ -327,6 +347,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"netbsd"
|
"netbsd"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
@@ -343,6 +364,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"netbsd"
|
"netbsd"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
@@ -359,6 +381,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"openbsd"
|
"openbsd"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
@@ -375,6 +398,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"openbsd"
|
"openbsd"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
@@ -391,6 +415,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"sunos"
|
"sunos"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
@@ -407,6 +432,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"win32"
|
"win32"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
@@ -423,6 +449,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"win32"
|
"win32"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
@@ -439,6 +466,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"win32"
|
"win32"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
@@ -991,15 +1019,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@sveltejs/kit": {
|
"node_modules/@sveltejs/kit": {
|
||||||
"version": "2.21.0",
|
"version": "2.22.0",
|
||||||
"resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-2.21.0.tgz",
|
"resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-2.22.0.tgz",
|
||||||
"integrity": "sha512-kvu4h9qXduiPk1Q1oqFKDLFGu/7mslEYbVaqpbBcBxjlRJnvNCFwEvEwKt0Mx9TtSi8J77xRelvJobrGlst4nQ==",
|
"integrity": "sha512-DJm0UxVgzXq+1MUfiJK4Ridk7oIQsIets6JwHiEl97sI6nXScfXe+BeqNhzB7jQIVBb3BM51U4hNk8qQxRXBAA==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@sveltejs/acorn-typescript": "^1.0.5",
|
"@sveltejs/acorn-typescript": "^1.0.5",
|
||||||
"@types/cookie": "^0.6.0",
|
"@types/cookie": "^0.6.0",
|
||||||
"acorn": "^8.14.1",
|
"acorn": "^8.14.1",
|
||||||
"cookie": "^0.7.0",
|
"cookie": "^0.6.0",
|
||||||
"devalue": "^5.1.0",
|
"devalue": "^5.1.0",
|
||||||
"esm-env": "^1.2.2",
|
"esm-env": "^1.2.2",
|
||||||
"kleur": "^4.1.5",
|
"kleur": "^4.1.5",
|
||||||
@@ -1007,7 +1035,8 @@
|
|||||||
"mrmime": "^2.0.0",
|
"mrmime": "^2.0.0",
|
||||||
"sade": "^1.8.1",
|
"sade": "^1.8.1",
|
||||||
"set-cookie-parser": "^2.6.0",
|
"set-cookie-parser": "^2.6.0",
|
||||||
"sirv": "^3.0.0"
|
"sirv": "^3.0.0",
|
||||||
|
"vitefu": "^1.0.6"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"svelte-kit": "svelte-kit.js"
|
"svelte-kit": "svelte-kit.js"
|
||||||
@@ -1016,9 +1045,9 @@
|
|||||||
"node": ">=18.13"
|
"node": ">=18.13"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@sveltejs/vite-plugin-svelte": "^3.0.0 || ^4.0.0-next.1 || ^5.0.0",
|
"@sveltejs/vite-plugin-svelte": "^3.0.0 || ^4.0.0-next.1 || ^5.0.0 || ^6.0.0-next.0",
|
||||||
"svelte": "^4.0.0 || ^5.0.0-next.0",
|
"svelte": "^4.0.0 || ^5.0.0-next.0",
|
||||||
"vite": "^5.0.3 || ^6.0.0"
|
"vite": "^5.0.3 || ^6.0.0 || ^7.0.0-beta.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@sveltejs/vite-plugin-svelte": {
|
"node_modules/@sveltejs/vite-plugin-svelte": {
|
||||||
@@ -1415,6 +1444,30 @@
|
|||||||
"node": ">= 14"
|
"node": ">= 14"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"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==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/ansi-styles": {
|
||||||
|
"version": "4.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
||||||
|
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"color-convert": "^2.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/aria-query": {
|
"node_modules/aria-query": {
|
||||||
"version": "5.3.2",
|
"version": "5.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.2.tgz",
|
||||||
@@ -1497,6 +1550,15 @@
|
|||||||
"url": "https://github.com/sponsors/ljharb"
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/camelcase": {
|
||||||
|
"version": "5.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
|
||||||
|
"integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/chokidar": {
|
"node_modules/chokidar": {
|
||||||
"version": "4.0.3",
|
"version": "4.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz",
|
||||||
@@ -1523,6 +1585,17 @@
|
|||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/cliui": {
|
||||||
|
"version": "6.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",
|
||||||
|
"integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"string-width": "^4.2.0",
|
||||||
|
"strip-ansi": "^6.0.0",
|
||||||
|
"wrap-ansi": "^6.2.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/clsx": {
|
"node_modules/clsx": {
|
||||||
"version": "2.1.1",
|
"version": "2.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz",
|
||||||
@@ -1532,6 +1605,24 @@
|
|||||||
"node": ">=6"
|
"node": ">=6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/color-convert": {
|
||||||
|
"version": "2.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
|
||||||
|
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"color-name": "~1.1.4"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=7.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/color-name": {
|
||||||
|
"version": "1.1.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
|
||||||
|
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/commondir": {
|
"node_modules/commondir": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
|
||||||
@@ -1539,9 +1630,9 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/cookie": {
|
"node_modules/cookie": {
|
||||||
"version": "0.7.2",
|
"version": "0.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz",
|
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz",
|
||||||
"integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",
|
"integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 0.6"
|
"node": ">= 0.6"
|
||||||
@@ -1586,6 +1677,15 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/decamelize": {
|
||||||
|
"version": "1.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
|
||||||
|
"integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/deepmerge": {
|
"node_modules/deepmerge": {
|
||||||
"version": "4.3.1",
|
"version": "4.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz",
|
||||||
@@ -1611,6 +1711,12 @@
|
|||||||
"integrity": "sha512-maua5KUiapvEwiEAe+XnlZ3Rh0GD+qI1J/nb9vrJc3muPXvcF/8gXYTWF76+5DAqHyDUtOIImEuo0YKE9mshVw==",
|
"integrity": "sha512-maua5KUiapvEwiEAe+XnlZ3Rh0GD+qI1J/nb9vrJc3muPXvcF/8gXYTWF76+5DAqHyDUtOIImEuo0YKE9mshVw==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/dijkstrajs": {
|
||||||
|
"version": "1.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.3.tgz",
|
||||||
|
"integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/dunder-proto": {
|
"node_modules/dunder-proto": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
|
||||||
@@ -1634,6 +1740,12 @@
|
|||||||
"safe-buffer": "^5.0.1"
|
"safe-buffer": "^5.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/emoji-regex": {
|
||||||
|
"version": "8.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
|
||||||
|
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/enhanced-resolve": {
|
"node_modules/enhanced-resolve": {
|
||||||
"version": "5.18.1",
|
"version": "5.18.1",
|
||||||
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.1.tgz",
|
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.1.tgz",
|
||||||
@@ -1684,6 +1796,7 @@
|
|||||||
"integrity": "sha512-8pgjLUcUjcgDg+2Q4NYXnPbo/vncAY4UmyaCm0jZevERqCHZIaWwdJHkf8XQtu4AxSKCdvrUbT0XUr1IdZzI8Q==",
|
"integrity": "sha512-8pgjLUcUjcgDg+2Q4NYXnPbo/vncAY4UmyaCm0jZevERqCHZIaWwdJHkf8XQtu4AxSKCdvrUbT0XUr1IdZzI8Q==",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"esbuild": "bin/esbuild"
|
"esbuild": "bin/esbuild"
|
||||||
},
|
},
|
||||||
@@ -1782,6 +1895,19 @@
|
|||||||
"node": "^12.20 || >= 14.13"
|
"node": "^12.20 || >= 14.13"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/find-up": {
|
||||||
|
"version": "4.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
|
||||||
|
"integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"locate-path": "^5.0.0",
|
||||||
|
"path-exists": "^4.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/formdata-polyfill": {
|
"node_modules/formdata-polyfill": {
|
||||||
"version": "4.0.10",
|
"version": "4.0.10",
|
||||||
"resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
|
"resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
|
||||||
@@ -1845,6 +1971,15 @@
|
|||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/get-caller-file": {
|
||||||
|
"version": "2.0.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
|
||||||
|
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
|
||||||
|
"license": "ISC",
|
||||||
|
"engines": {
|
||||||
|
"node": "6.* || 8.* || >= 10.*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/get-intrinsic": {
|
"node_modules/get-intrinsic": {
|
||||||
"version": "1.3.0",
|
"version": "1.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
|
||||||
@@ -2029,6 +2164,15 @@
|
|||||||
"url": "https://github.com/sponsors/ljharb"
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/is-fullwidth-code-point": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/is-module": {
|
"node_modules/is-module": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz",
|
||||||
@@ -2328,6 +2472,18 @@
|
|||||||
"integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==",
|
"integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/locate-path": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"p-locate": "^4.1.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/lodash.castarray": {
|
"node_modules/lodash.castarray": {
|
||||||
"version": "4.4.0",
|
"version": "4.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/lodash.castarray/-/lodash.castarray-4.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/lodash.castarray/-/lodash.castarray-4.4.0.tgz",
|
||||||
@@ -2441,6 +2597,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"nanoid": "bin/nanoid.cjs"
|
"nanoid": "bin/nanoid.cjs"
|
||||||
},
|
},
|
||||||
@@ -2498,12 +2655,57 @@
|
|||||||
"url": "https://github.com/sponsors/ljharb"
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/p-limit": {
|
||||||
|
"version": "2.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
|
||||||
|
"integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"p-try": "^2.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/p-locate": {
|
||||||
|
"version": "4.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
|
||||||
|
"integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"p-limit": "^2.2.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/p-try": {
|
||||||
|
"version": "2.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
|
||||||
|
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/papaparse": {
|
"node_modules/papaparse": {
|
||||||
"version": "5.5.3",
|
"version": "5.5.3",
|
||||||
"resolved": "https://registry.npmjs.org/papaparse/-/papaparse-5.5.3.tgz",
|
"resolved": "https://registry.npmjs.org/papaparse/-/papaparse-5.5.3.tgz",
|
||||||
"integrity": "sha512-5QvjGxYVjxO59MGU2lHVYpRWBBtKHnlIAcSe1uNFCkkptUh63NFRj0FJQm7nR67puEruUci/ZkjmEFrjCAyP4A==",
|
"integrity": "sha512-5QvjGxYVjxO59MGU2lHVYpRWBBtKHnlIAcSe1uNFCkkptUh63NFRj0FJQm7nR67puEruUci/ZkjmEFrjCAyP4A==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/path-exists": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
|
||||||
|
"integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/path-parse": {
|
"node_modules/path-parse": {
|
||||||
"version": "1.0.7",
|
"version": "1.0.7",
|
||||||
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
|
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
|
||||||
@@ -2528,6 +2730,15 @@
|
|||||||
"url": "https://github.com/sponsors/jonschlinkert"
|
"url": "https://github.com/sponsors/jonschlinkert"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/pngjs": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10.13.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/postcss": {
|
"node_modules/postcss": {
|
||||||
"version": "8.5.3",
|
"version": "8.5.3",
|
||||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.3.tgz",
|
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.3.tgz",
|
||||||
@@ -2547,6 +2758,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"nanoid": "^3.3.8",
|
"nanoid": "^3.3.8",
|
||||||
"picocolors": "^1.1.1",
|
"picocolors": "^1.1.1",
|
||||||
@@ -2676,6 +2888,23 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/qrcode": {
|
||||||
|
"version": "1.5.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.5.4.tgz",
|
||||||
|
"integrity": "sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"dijkstrajs": "^1.0.1",
|
||||||
|
"pngjs": "^5.0.0",
|
||||||
|
"yargs": "^15.3.1"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"qrcode": "bin/qrcode"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10.13.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/qs": {
|
"node_modules/qs": {
|
||||||
"version": "6.14.0",
|
"version": "6.14.0",
|
||||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz",
|
"resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz",
|
||||||
@@ -2691,6 +2920,18 @@
|
|||||||
"url": "https://github.com/sponsors/ljharb"
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/quoted-printable": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/quoted-printable/-/quoted-printable-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-cihC68OcGiQOjGiXuo5Jk6XHANTHl1K4JLk/xlEJRTIXfy19Sg6XzB95XonYgr+1rB88bCpr7WZE7D7AlZow4g==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"utf8": "^2.1.0"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"quoted-printable": "bin/quoted-printable"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/readdirp": {
|
"node_modules/readdirp": {
|
||||||
"version": "4.1.2",
|
"version": "4.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz",
|
||||||
@@ -2705,6 +2946,21 @@
|
|||||||
"url": "https://paulmillr.com/funding/"
|
"url": "https://paulmillr.com/funding/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/require-directory": {
|
||||||
|
"version": "2.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
|
||||||
|
"integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/require-main-filename": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
|
||||||
|
"license": "ISC"
|
||||||
|
},
|
||||||
"node_modules/resolve": {
|
"node_modules/resolve": {
|
||||||
"version": "1.22.10",
|
"version": "1.22.10",
|
||||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz",
|
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz",
|
||||||
@@ -2796,6 +3052,12 @@
|
|||||||
],
|
],
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/set-blocking": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==",
|
||||||
|
"license": "ISC"
|
||||||
|
},
|
||||||
"node_modules/set-cookie-parser": {
|
"node_modules/set-cookie-parser": {
|
||||||
"version": "2.7.1",
|
"version": "2.7.1",
|
||||||
"resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.1.tgz",
|
"resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.1.tgz",
|
||||||
@@ -2874,6 +3136,25 @@
|
|||||||
"url": "https://github.com/sponsors/ljharb"
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/simple-icons": {
|
||||||
|
"version": "15.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/simple-icons/-/simple-icons-15.3.0.tgz",
|
||||||
|
"integrity": "sha512-wcaQWT4FOMQ59qe+9zNJpby286UPr8rNDuRzlXzBSu/cKECEzwvCFgCmaWUNGbpBzjeYk6WykzmOmAyGKTe/Kg==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/simple-icons"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/simple-icons"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "CC0-1.0",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.12.18"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/sirv": {
|
"node_modules/sirv": {
|
||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/sirv/-/sirv-3.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/sirv/-/sirv-3.0.1.tgz",
|
||||||
@@ -2897,6 +3178,32 @@
|
|||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/string-width": {
|
||||||
|
"version": "4.2.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
|
||||||
|
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"emoji-regex": "^8.0.0",
|
||||||
|
"is-fullwidth-code-point": "^3.0.0",
|
||||||
|
"strip-ansi": "^6.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/strip-ansi": {
|
||||||
|
"version": "6.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
||||||
|
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"ansi-regex": "^5.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/supports-preserve-symlinks-flag": {
|
"node_modules/supports-preserve-symlinks-flag": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
|
||||||
@@ -2958,6 +3265,13 @@
|
|||||||
"typescript": ">=5.0.0"
|
"typescript": ">=5.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/svelte-kit": {
|
||||||
|
"version": "1.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/svelte-kit/-/svelte-kit-1.2.0.tgz",
|
||||||
|
"integrity": "sha512-RRaOHBhpDv4g2v9tcq8iNw055Pt0MlLps6JVA7/40f4KAbtztXSI4T6MZYbHRirO708urfAAMx6Qow+tQfCHug==",
|
||||||
|
"hasInstallScript": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/tailwindcss": {
|
"node_modules/tailwindcss": {
|
||||||
"version": "4.1.7",
|
"version": "4.1.7",
|
||||||
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.7.tgz",
|
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.7.tgz",
|
||||||
@@ -2998,6 +3312,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.13.tgz",
|
"resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.13.tgz",
|
||||||
"integrity": "sha512-mEwzpUgrLySlveBwEVDMKk5B57bhLPYovRfPAXD5gA/98Opn0rCDj3GtLwFvCvH5RK9uPCExUROW5NjDwvqkxw==",
|
"integrity": "sha512-mEwzpUgrLySlveBwEVDMKk5B57bhLPYovRfPAXD5gA/98Opn0rCDj3GtLwFvCvH5RK9uPCExUROW5NjDwvqkxw==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fdir": "^6.4.4",
|
"fdir": "^6.4.4",
|
||||||
"picomatch": "^4.0.2"
|
"picomatch": "^4.0.2"
|
||||||
@@ -3024,6 +3339,14 @@
|
|||||||
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==",
|
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/tslib": {
|
||||||
|
"version": "2.8.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
|
||||||
|
"integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "0BSD",
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
"node_modules/typescript": {
|
"node_modules/typescript": {
|
||||||
"version": "5.8.3",
|
"version": "5.8.3",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz",
|
||||||
@@ -3050,6 +3373,12 @@
|
|||||||
"integrity": "sha512-XdVKMF4SJ0nP/O7XIPB0JwAEuT9lDIYnNsK8yGVe43y0AWoKeJNdv3ZNWh7ksJ6KqQFjOO6ox/VEitLnaVNufw==",
|
"integrity": "sha512-XdVKMF4SJ0nP/O7XIPB0JwAEuT9lDIYnNsK8yGVe43y0AWoKeJNdv3ZNWh7ksJ6KqQFjOO6ox/VEitLnaVNufw==",
|
||||||
"license": "BSD"
|
"license": "BSD"
|
||||||
},
|
},
|
||||||
|
"node_modules/utf8": {
|
||||||
|
"version": "2.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/utf8/-/utf8-2.1.2.tgz",
|
||||||
|
"integrity": "sha512-QXo+O/QkLP/x1nyi54uQiG0XrODxdysuQvE5dtVqv7F5K2Qb6FsN+qbr6KhF5wQ20tfcV3VQp0/2x1e1MRSPWg==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/util-deprecate": {
|
"node_modules/util-deprecate": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||||
@@ -3057,11 +3386,26 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/uuid": {
|
||||||
|
"version": "11.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.0.tgz",
|
||||||
|
"integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==",
|
||||||
|
"dev": true,
|
||||||
|
"funding": [
|
||||||
|
"https://github.com/sponsors/broofa",
|
||||||
|
"https://github.com/sponsors/ctavan"
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"bin": {
|
||||||
|
"uuid": "dist/esm/bin/uuid"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/vite": {
|
"node_modules/vite": {
|
||||||
"version": "6.3.5",
|
"version": "6.3.5",
|
||||||
"resolved": "https://registry.npmjs.org/vite/-/vite-6.3.5.tgz",
|
"resolved": "https://registry.npmjs.org/vite/-/vite-6.3.5.tgz",
|
||||||
"integrity": "sha512-cZn6NDFE7wdTpINgs++ZJ4N49W2vRp8LCKrn3Ob1kYNtOo21vfDoaV5GzBfLU4MovSAB8uNRm4jgzVQZ+mBzPQ==",
|
"integrity": "sha512-cZn6NDFE7wdTpINgs++ZJ4N49W2vRp8LCKrn3Ob1kYNtOo21vfDoaV5GzBfLU4MovSAB8uNRm4jgzVQZ+mBzPQ==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"esbuild": "^0.25.0",
|
"esbuild": "^0.25.0",
|
||||||
"fdir": "^6.4.4",
|
"fdir": "^6.4.4",
|
||||||
@@ -3131,6 +3475,19 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/vite-plugin-devtools-json": {
|
||||||
|
"version": "0.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/vite-plugin-devtools-json/-/vite-plugin-devtools-json-0.2.0.tgz",
|
||||||
|
"integrity": "sha512-K7PoaWOEJECZ1n3VbhJXsUAX2PsO0xY7KFMM/Leh7tUev0M5zi+lz+vnVVdCK17IOK9Jp9rdzHXc08cnQirGbg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"uuid": "^11.1.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"vite": "^2.7.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/vitefu": {
|
"node_modules/vitefu": {
|
||||||
"version": "1.0.6",
|
"version": "1.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/vitefu/-/vitefu-1.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/vitefu/-/vitefu-1.0.6.tgz",
|
||||||
@@ -3174,6 +3531,26 @@
|
|||||||
"webidl-conversions": "^3.0.0"
|
"webidl-conversions": "^3.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/which-module": {
|
||||||
|
"version": "2.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz",
|
||||||
|
"integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==",
|
||||||
|
"license": "ISC"
|
||||||
|
},
|
||||||
|
"node_modules/wrap-ansi": {
|
||||||
|
"version": "6.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
|
||||||
|
"integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"ansi-styles": "^4.0.0",
|
||||||
|
"string-width": "^4.1.0",
|
||||||
|
"strip-ansi": "^6.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/ws": {
|
"node_modules/ws": {
|
||||||
"version": "8.18.2",
|
"version": "8.18.2",
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.18.2.tgz",
|
"resolved": "https://registry.npmjs.org/ws/-/ws-8.18.2.tgz",
|
||||||
@@ -3195,6 +3572,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/y18n": {
|
||||||
|
"version": "4.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
|
||||||
|
"integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
|
||||||
|
"license": "ISC"
|
||||||
|
},
|
||||||
"node_modules/yallist": {
|
"node_modules/yallist": {
|
||||||
"version": "5.0.0",
|
"version": "5.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz",
|
||||||
@@ -3205,6 +3588,41 @@
|
|||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/yargs": {
|
||||||
|
"version": "15.4.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz",
|
||||||
|
"integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"cliui": "^6.0.0",
|
||||||
|
"decamelize": "^1.2.0",
|
||||||
|
"find-up": "^4.1.0",
|
||||||
|
"get-caller-file": "^2.0.1",
|
||||||
|
"require-directory": "^2.1.1",
|
||||||
|
"require-main-filename": "^2.0.0",
|
||||||
|
"set-blocking": "^2.0.0",
|
||||||
|
"string-width": "^4.2.0",
|
||||||
|
"which-module": "^2.0.0",
|
||||||
|
"y18n": "^4.0.0",
|
||||||
|
"yargs-parser": "^18.1.2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/yargs-parser": {
|
||||||
|
"version": "18.1.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz",
|
||||||
|
"integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"camelcase": "^5.0.0",
|
||||||
|
"decamelize": "^1.2.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/zimmerframe": {
|
"node_modules/zimmerframe": {
|
||||||
"version": "1.1.2",
|
"version": "1.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/zimmerframe/-/zimmerframe-1.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/zimmerframe/-/zimmerframe-1.1.2.tgz",
|
||||||
|
|||||||
11
package.json
11
package.json
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "esn-code-scanner",
|
"name": "scan-wave",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
"lint": "prettier --check ."
|
"lint": "prettier --check ."
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@sveltejs/kit": "^2.16.0",
|
"@sveltejs/kit": "^2.22.0",
|
||||||
"@sveltejs/vite-plugin-svelte": "^5.0.0",
|
"@sveltejs/vite-plugin-svelte": "^5.0.0",
|
||||||
"@tailwindcss/typography": "^0.5.15",
|
"@tailwindcss/typography": "^0.5.15",
|
||||||
"@tailwindcss/vite": "^4.0.0",
|
"@tailwindcss/vite": "^4.0.0",
|
||||||
@@ -26,13 +26,16 @@
|
|||||||
"svelte-check": "^4.0.0",
|
"svelte-check": "^4.0.0",
|
||||||
"tailwindcss": "^4.0.0",
|
"tailwindcss": "^4.0.0",
|
||||||
"typescript": "^5.0.0",
|
"typescript": "^5.0.0",
|
||||||
"vite": "^6.2.6"
|
"vite-plugin-devtools-json": "^0.2.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@supabase/ssr": "^0.6.1",
|
"@supabase/ssr": "^0.6.1",
|
||||||
"@supabase/supabase-js": "^2.50.0",
|
"@supabase/supabase-js": "^2.50.0",
|
||||||
"@sveltejs/adapter-node": "^5.2.12",
|
"@sveltejs/adapter-node": "^5.2.12",
|
||||||
"googleapis": "^150.0.1",
|
"googleapis": "^150.0.1",
|
||||||
"papaparse": "^5.5.3"
|
"papaparse": "^5.5.3",
|
||||||
|
"qrcode": "^1.5.4",
|
||||||
|
"quoted-printable": "^1.0.1",
|
||||||
|
"simple-icons": "^15.3.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { google } from 'googleapis';
|
import { google } from 'googleapis';
|
||||||
import { env } from '$env/dynamic/private';
|
import { env } from '$env/dynamic/private';
|
||||||
|
import quotedPrintable from 'quoted-printable'; // tiny, zero-dep package
|
||||||
|
|
||||||
export const scopes = ['https://www.googleapis.com/auth/gmail.send'];
|
export const scopes = ['https://www.googleapis.com/auth/gmail.send'];
|
||||||
|
|
||||||
@@ -27,21 +28,73 @@ export async function exchangeCodeForTokens(code: string) {
|
|||||||
|
|
||||||
export async function sendGmail(
|
export async function sendGmail(
|
||||||
refreshToken: string,
|
refreshToken: string,
|
||||||
{ to, subject, text }: { to: string; subject: string; text: string }
|
{ to, subject, text, qr_code }: { to: string; subject: string; text: string; qr_code: string }
|
||||||
) {
|
) {
|
||||||
const oauth = getOAuthClient();
|
const oauth = getOAuthClient();
|
||||||
oauth.setCredentials({ refresh_token: refreshToken });
|
oauth.setCredentials({ refresh_token: refreshToken });
|
||||||
|
|
||||||
const gmail = google.gmail({ version: 'v1', auth: oauth });
|
const gmail = google.gmail({ version: 'v1', auth: oauth });
|
||||||
const raw = Buffer
|
|
||||||
.from(
|
const message_html =
|
||||||
[`To: ${to}`,
|
`<!DOCTYPE html>
|
||||||
'Content-Type: text/plain; charset="UTF-8"',
|
<html lang="en">
|
||||||
'Content-Transfer-Encoding: 7bit',
|
<head>
|
||||||
|
<style>
|
||||||
|
@import url('https://fonts.googleapis.com/css2?family=Lato&display=swap');
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body style="font-family: 'Lato', sans-serif; background-color: #f9f9f9; padding: 20px; margin: 0;">
|
||||||
|
<div style="max-width: 600px; margin: auto; background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.05);">
|
||||||
|
<p style="white-space: pre-line;font-size: 16px; line-height: 1.5; color: #333;">${text}</p>
|
||||||
|
<img src="cid:qrCode1" alt="QR Code" style="display: block; margin: 20px auto; max-width: 50%; min-width: 200px; height: auto;" />
|
||||||
|
<div style="width: 100%; display: flex; flex-direction: row; justify-content: space-between">
|
||||||
|
<div style="height: 4px; width: 20%; background: #00aeef;"></div>
|
||||||
|
<div style="height: 4px; width: 20%; background: #ec008c;"></div>
|
||||||
|
<div style="height: 4px; width: 20%; background: #7ac143;"></div>
|
||||||
|
<div style="height: 4px; width: 20%; background: #f47b20;"></div>
|
||||||
|
<div style="height: 4px; width: 20%; background: #2e3192;"></div>
|
||||||
|
</div>
|
||||||
|
<div style="font-size: 12px; color: #999; padding-top: 0px; margin-top: 10px; line-height: 1.5; ">
|
||||||
|
<p>This email has been generated with the help of *insert software name*</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>`;
|
||||||
|
|
||||||
|
|
||||||
|
const boundary = 'BOUNDARY';
|
||||||
|
const nl = '\r\n'; // RFC-5322 line ending
|
||||||
|
|
||||||
|
const htmlQP = quotedPrintable.encode(message_html);
|
||||||
|
const qrLines = qr_code.replace(/.{1,76}/g, '$&' + nl);
|
||||||
|
|
||||||
|
const rawParts = [
|
||||||
|
'MIME-Version: 1.0',
|
||||||
|
`To: ${to}`,
|
||||||
`Subject: ${subject}`,
|
`Subject: ${subject}`,
|
||||||
|
`Content-Type: multipart/related; boundary="${boundary}"`,
|
||||||
'',
|
'',
|
||||||
text].join('\n'))
|
`--${boundary}`,
|
||||||
.toString('base64url');
|
'Content-Type: text/html; charset="UTF-8"',
|
||||||
|
'Content-Transfer-Encoding: quoted-printable',
|
||||||
|
'',
|
||||||
|
htmlQP,
|
||||||
|
'',
|
||||||
|
`--${boundary}`,
|
||||||
|
'Content-Type: image/png',
|
||||||
|
'Content-Transfer-Encoding: base64',
|
||||||
|
'Content-ID: <qrCode1>',
|
||||||
|
'Content-Disposition: inline; filename="qr.png"',
|
||||||
|
'',
|
||||||
|
qrLines,
|
||||||
|
'',
|
||||||
|
`--${boundary}--`,
|
||||||
|
''
|
||||||
|
];
|
||||||
|
|
||||||
|
const rawMessage = rawParts.join(nl);
|
||||||
|
|
||||||
|
const raw = Buffer.from(rawMessage).toString('base64url');
|
||||||
|
|
||||||
await gmail.users.messages.send({
|
await gmail.users.messages.send({
|
||||||
userId: 'me',
|
userId: 'me',
|
||||||
|
|||||||
@@ -1,20 +1,24 @@
|
|||||||
<script>
|
<script>
|
||||||
import { invalidate } from '$app/navigation'
|
import { invalidate } from '$app/navigation';
|
||||||
import { onMount } from 'svelte'
|
import { onMount } from 'svelte';
|
||||||
import "../app.css";
|
import '../app.css';
|
||||||
|
|
||||||
let { data, children } = $props()
|
let { data, children } = $props();
|
||||||
let { session, supabase } = $derived(data)
|
let { session, supabase } = $derived(data);
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
const { data } = supabase.auth.onAuthStateChange((_, newSession) => {
|
const { data } = supabase.auth.onAuthStateChange((_, newSession) => {
|
||||||
if (newSession?.expires_at !== session?.expires_at) {
|
if (newSession?.expires_at !== session?.expires_at) {
|
||||||
invalidate('supabase:auth')
|
invalidate('supabase:auth');
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
return () => data.subscription.unsubscribe()
|
return () => data.subscription.unsubscribe();
|
||||||
})
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<svelte:head>
|
||||||
|
<title>ScanWave</title>
|
||||||
|
</svelte:head>
|
||||||
|
|
||||||
{@render children()}
|
{@render children()}
|
||||||
@@ -3,9 +3,11 @@
|
|||||||
<div class="mb-8">
|
<div class="mb-8">
|
||||||
<img class="w-32 h-auto" src="/qr-code.png" alt="">
|
<img class="w-32 h-auto" src="/qr-code.png" alt="">
|
||||||
</div>
|
</div>
|
||||||
<h1 class="text-3xl font-bold text-center mb-2">ESN Scanner App</h1>
|
<h1 class="text-3xl font-bold text-center mb-2">ScanWave</h1>
|
||||||
<h2 class="text-lg text-gray-600 text-center mb-8">Make entrance to your events a breeze.</h2>
|
<h2 class="text-lg text-gray-600 text-center mb-8">Make entrance to your events a breeze.</h2>
|
||||||
<div class="flex space-x-4 w-full justify-center">
|
<div class="flex space-x-4 w-full justify-center">
|
||||||
<a href="/private/home" class="w-64 py-2 bg-blue-600 text-white rounded-lg text-center hover:bg-blue-700 transition">Get started</a>
|
<a href="/private/home" class="bg-blue-600 hover:bg-blue-700 text-white font-bold py-3 px-8 rounded-full shadow-none border border-gray-300 w-64 text-center transition">
|
||||||
|
Get started
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,15 +2,20 @@
|
|||||||
// Add any navbar logic here if needed
|
// Add any navbar logic here if needed
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<nav class="bg-white border-b border-gray-300 text-gray-900 p-4 flex items-center justify-between">
|
<nav class="bg-gray-50 border-b border-gray-300 text-gray-900 p-2">
|
||||||
<div class="font-bold text-lg">ESN Scanner</div>
|
<div class="container max-w-2xl mx-auto p-2">
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
|
<div class="font-bold text-lg">ScanWave</div>
|
||||||
|
|
||||||
<ul class="flex space-x-4">
|
<ul class="flex space-x-4">
|
||||||
<li><a href="/private/home" class="hover:underline">Home</a></li>
|
<li><a href="/private/home" class="hover:underline">Home</a></li>
|
||||||
<li><a href="/private/scanner" class="hover:underline">Scanner</a></li>
|
<li><a href="/private/scanner" class="hover:underline">Scanner</a></li>
|
||||||
<li><a href="/private/creator" class="hover:underline">Creator</a></li>
|
<li><a href="/private/events" class="hover:underline">Events</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<div class="container p-2 bg-white ">
|
<div class="container max-w-2xl mx-auto p-2 bg-white">
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -36,13 +36,13 @@ export const GET: RequestHandler = async ({ url }) => {
|
|||||||
|
|
||||||
/* ───────────── POST ───────────── */
|
/* ───────────── POST ───────────── */
|
||||||
export const POST: RequestHandler = async ({ request }) => {
|
export const POST: RequestHandler = async ({ request }) => {
|
||||||
const { action, refreshToken, to, subject, text } = await request.json();
|
const { action, refreshToken, to, subject, text, qr_code } = await request.json();
|
||||||
|
|
||||||
/* send e-mail */
|
/* send e-mail */
|
||||||
if (action === 'send') {
|
if (action === 'send') {
|
||||||
if (!refreshToken) return new Response('Missing token', { status: 401 });
|
if (!refreshToken) return new Response('Missing token', { status: 401 });
|
||||||
try {
|
try {
|
||||||
await sendGmail(refreshToken, { to, subject, text });
|
await sendGmail(refreshToken, { to, subject, text, qr_code });
|
||||||
return json({ ok: true });
|
return json({ ok: true });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return new Response((err as Error).message, { status: 500 });
|
return new Response((err as Error).message, { status: 500 });
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ import Papa from 'papaparse';
|
|||||||
import { fail } from '@sveltejs/kit';
|
import { fail } from '@sveltejs/kit';
|
||||||
|
|
||||||
export async function load({ locals }) {
|
export async function load({ locals }) {
|
||||||
console.log("▶️ fetching events…");
|
|
||||||
|
|
||||||
const { data: events, error } = await locals.supabase
|
const { data: events, error } = await locals.supabase
|
||||||
.from('events')
|
.from('events')
|
||||||
.select('*')
|
.select('*')
|
||||||
@@ -23,8 +21,6 @@ export async function load({ locals }) {
|
|||||||
export const actions = {
|
export const actions = {
|
||||||
create: async (event) => {
|
create: async (event) => {
|
||||||
const formData = await event.request.formData();
|
const formData = await event.request.formData();
|
||||||
console.log(Array.from(formData.entries()));
|
|
||||||
console.log('create_event date', formData.get("date"), formData.get("name"), formData.get("description"));
|
|
||||||
let { data: new_event, error } = await event.locals.supabase.rpc("create_event",
|
let { data: new_event, error } = await event.locals.supabase.rpc("create_event",
|
||||||
{
|
{
|
||||||
"p_name": formData.get('name'),
|
"p_name": formData.get('name'),
|
||||||
@@ -51,8 +47,6 @@ export const actions = {
|
|||||||
parsedRows.shift();
|
parsedRows.shift();
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('Parsed rows:', parsedRows);
|
|
||||||
|
|
||||||
// Map each row to an object with keys: name, surname, email
|
// Map each row to an object with keys: name, surname, email
|
||||||
const participants = parsedRows.map((row: string[]) => ({
|
const participants = parsedRows.map((row: string[]) => ({
|
||||||
name: row[0],
|
name: row[0],
|
||||||
@@ -60,8 +54,6 @@ export const actions = {
|
|||||||
email: row[2]
|
email: row[2]
|
||||||
}));
|
}));
|
||||||
|
|
||||||
console.log('Mapped participants:', participants);
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
participants,
|
participants,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,15 +7,14 @@
|
|||||||
|
|
||||||
let { data, form } = $props();
|
let { data, form } = $props();
|
||||||
|
|
||||||
let new_event = $state({});
|
let event = $state({});
|
||||||
let participants = $state([]);
|
let participants = $state([]);
|
||||||
let subject = $state('');
|
let email = $state({'body': '', 'subject': ''});
|
||||||
let body = $state('');
|
let authorized = $state(false);
|
||||||
|
|
||||||
// Update events and participants from the form data
|
$effect(() => {
|
||||||
$effect( () => {
|
|
||||||
if (form && form.new_event) {
|
if (form && form.new_event) {
|
||||||
new_event = form.new_event;
|
event = form.new_event;
|
||||||
}
|
}
|
||||||
if (form && form.participants) {
|
if (form && form.participants) {
|
||||||
participants = form.participants;
|
participants = form.participants;
|
||||||
@@ -31,36 +30,34 @@
|
|||||||
StepOverview
|
StepOverview
|
||||||
];
|
];
|
||||||
|
|
||||||
// State variable for current step
|
let step: number = $state(0);
|
||||||
let step = $state(0);
|
|
||||||
|
// let stepConditions = $derived([
|
||||||
|
// authorized,
|
||||||
|
// !!new_event?.name,
|
||||||
|
// !!participants?.length,
|
||||||
|
// !!subject && !!body
|
||||||
|
// ]);
|
||||||
|
|
||||||
|
// for debugging purpouses
|
||||||
|
let stepConditions = [
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true
|
||||||
|
];
|
||||||
|
|
||||||
// Helper to go to next/previous step (optional)
|
|
||||||
function nextStep() {
|
function nextStep() {
|
||||||
if (step < steps.length - 1) step += 1;
|
if (step < steps.length - 1) step += 1;
|
||||||
console.log(step);
|
|
||||||
}
|
}
|
||||||
function prevStep() {
|
function prevStep() {
|
||||||
if (step > 0) step -= 1;
|
if (step > 0) step -= 1;
|
||||||
console.log(step);
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- Render the current step component -->
|
<div class="flex items-center justify-between mb-4 mt-2">
|
||||||
{#if step == 0}
|
|
||||||
<StepConnectGoogle />
|
|
||||||
{:else if step == 1}
|
|
||||||
<StepCreateEvent events={data.events} {new_event} />
|
|
||||||
{:else if step == 2}
|
|
||||||
<StepUploadFiles {participants} />
|
|
||||||
{:else if step == 3}
|
|
||||||
<StepCraftEmail bind:subject bind:body />
|
|
||||||
{:else if step == 4}
|
|
||||||
<StepOverview {new_event} {participants} {subject} {body} />
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
<div class="flex items-center justify-between mt-4">
|
|
||||||
<button
|
<button
|
||||||
on:click={prevStep}
|
onclick={prevStep}
|
||||||
disabled={step === 0}
|
disabled={step === 0}
|
||||||
class="min-w-[100px] py-2 px-4 bg-white border border-gray-300 text-gray-700 rounded hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed transition"
|
class="min-w-[100px] py-2 px-4 bg-white border border-gray-300 text-gray-700 rounded hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed transition"
|
||||||
>
|
>
|
||||||
@@ -70,10 +67,28 @@
|
|||||||
Step {step + 1} of {steps.length}
|
Step {step + 1} of {steps.length}
|
||||||
</span>
|
</span>
|
||||||
<button
|
<button
|
||||||
on:click={nextStep}
|
onclick={nextStep}
|
||||||
disabled={step === steps.length - 1}
|
disabled={step === steps.length - 1 || !stepConditions[step]}
|
||||||
class="min-w-[100px] py-2 px-4 bg-white border border-gray-300 text-gray-700 rounded hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed transition"
|
class="min-w-[100px] py-2 px-4 bg-white border border-gray-300 text-gray-700 rounded hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed transition"
|
||||||
>
|
>
|
||||||
Next
|
Next
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{#if step == 0}
|
||||||
|
<StepConnectGoogle bind:authorized />
|
||||||
|
{:else if step == 1}
|
||||||
|
<StepCreateEvent {event} />
|
||||||
|
{:else if step == 2}
|
||||||
|
<StepUploadFiles {participants} />
|
||||||
|
{:else if step == 3}
|
||||||
|
<StepCraftEmail bind:email />
|
||||||
|
{:else if step == 4}
|
||||||
|
<StepOverview
|
||||||
|
{data}
|
||||||
|
{event}
|
||||||
|
{participants}
|
||||||
|
{email}
|
||||||
|
{stepConditions}
|
||||||
|
/>
|
||||||
|
{/if}
|
||||||
|
|||||||
110
src/routes/private/creator/emailtest/+page.svelte
Normal file
110
src/routes/private/creator/emailtest/+page.svelte
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import { onMount } from 'svelte';
|
||||||
|
import { goto } from '$app/navigation';
|
||||||
|
|
||||||
|
let to = '';
|
||||||
|
let subject = '';
|
||||||
|
let body = '';
|
||||||
|
let qrcode_b64 = '';
|
||||||
|
let loading = false;
|
||||||
|
let error = '';
|
||||||
|
let success = '';
|
||||||
|
let authorized = false;
|
||||||
|
let refreshToken = '';
|
||||||
|
|
||||||
|
async function validateToken(token: string): Promise<boolean> {
|
||||||
|
if (!token) return false;
|
||||||
|
const res = await fetch('/private/api/gmail', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: { 'Content-Type': 'application/json' },
|
||||||
|
body: JSON.stringify({ action: 'validate', refreshToken: token })
|
||||||
|
});
|
||||||
|
if (!res.ok) return false;
|
||||||
|
const data = await res.json();
|
||||||
|
return !!data.valid;
|
||||||
|
}
|
||||||
|
|
||||||
|
onMount(async () => {
|
||||||
|
refreshToken = localStorage.getItem('gmail_refresh_token') ?? '';
|
||||||
|
authorized = await validateToken(refreshToken);
|
||||||
|
});
|
||||||
|
|
||||||
|
const connect = () => goto('/private/api/gmail?action=auth');
|
||||||
|
|
||||||
|
async function sendTestEmail() {
|
||||||
|
error = '';
|
||||||
|
success = '';
|
||||||
|
loading = true;
|
||||||
|
try {
|
||||||
|
const r = await fetch('/private/api/gmail', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: { 'Content-Type': 'application/json' },
|
||||||
|
body: JSON.stringify({
|
||||||
|
action: 'send',
|
||||||
|
to,
|
||||||
|
subject,
|
||||||
|
text: body,
|
||||||
|
qr_code: qrcode_b64,
|
||||||
|
refreshToken
|
||||||
|
})
|
||||||
|
});
|
||||||
|
if (r.ok) {
|
||||||
|
success = 'Email sent!';
|
||||||
|
to = subject = body = qrcode_b64 = '';
|
||||||
|
} else {
|
||||||
|
error = await r.text();
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
error = e.message || 'Unknown error';
|
||||||
|
}
|
||||||
|
loading = false;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="max-w-lg mx-auto bg-white border border-gray-300 rounded p-8 mt-8 shadow">
|
||||||
|
<h2 class="text-2xl font-semibold mb-6 text-center">Test Email Sender</h2>
|
||||||
|
{#if !authorized}
|
||||||
|
<div class="mb-4 flex items-center justify-between">
|
||||||
|
<p class="text-gray-700">Google not connected.</p>
|
||||||
|
<button class="btn bg-blue-600 hover:bg-blue-700 text-white font-semibold py-2 px-4 rounded ml-auto" on:click={connect}>
|
||||||
|
Connect Google
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
{:else}
|
||||||
|
<form on:submit|preventDefault={sendTestEmail} class="space-y-4">
|
||||||
|
<label class="block">
|
||||||
|
<span class="text-gray-700">To</span>
|
||||||
|
<input type="email" class="mt-1 block w-full border border-gray-300 rounded px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-200" bind:value={to} required />
|
||||||
|
</label>
|
||||||
|
<label class="block">
|
||||||
|
<span class="text-gray-700">Subject</span>
|
||||||
|
<input type="text" class="mt-1 block w-full border border-gray-300 rounded px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-200" bind:value={subject} required />
|
||||||
|
</label>
|
||||||
|
<label class="block">
|
||||||
|
<span class="text-gray-700">Body</span>
|
||||||
|
<textarea class="mt-1 block w-full border border-gray-300 rounded px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-200 resize-none" rows="6" bind:value={body} required></textarea>
|
||||||
|
</label>
|
||||||
|
<label class="block">
|
||||||
|
<span class="text-gray-700">QR Code (base64, data:image/png;base64,...)</span>
|
||||||
|
<input type="text" class="mt-1 block w-full border border-gray-300 rounded px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-200 font-mono text-xs" bind:value={qrcode_b64} placeholder="Paste base64 image string here" required />
|
||||||
|
</label>
|
||||||
|
<button type="submit" class="w-full py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition" disabled={loading}>
|
||||||
|
{#if loading}
|
||||||
|
<svg class="animate-spin h-5 w-5 mr-2 inline-block text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
||||||
|
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
|
||||||
|
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8v8z"></path>
|
||||||
|
</svg>
|
||||||
|
Sending...
|
||||||
|
{:else}
|
||||||
|
Send Test Email
|
||||||
|
{/if}
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
{/if}
|
||||||
|
{#if error}
|
||||||
|
<div class="rounded border-l-4 border-red-500 bg-red-100 p-4 text-red-700 mt-4">{error}</div>
|
||||||
|
{/if}
|
||||||
|
{#if success}
|
||||||
|
<div class="rounded border-l-4 border-green-500 bg-green-100 p-4 text-green-700 mt-4">{success}</div>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
125
src/routes/private/creator/finish/+page.svelte
Normal file
125
src/routes/private/creator/finish/+page.svelte
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import { page } from '$app/state';
|
||||||
|
import { onMount } from 'svelte';
|
||||||
|
import QRCode from 'qrcode';
|
||||||
|
|
||||||
|
let { data } = $props();
|
||||||
|
let session_storage_id = page.url.searchParams.get('data');
|
||||||
|
let all_data = {};
|
||||||
|
|
||||||
|
const StepStatus = {
|
||||||
|
Loading: 'loading',
|
||||||
|
Waiting: 'waiting',
|
||||||
|
Success: 'success',
|
||||||
|
Failure: 'failure'
|
||||||
|
} as const;
|
||||||
|
type StepStatus = (typeof StepStatus)[keyof typeof StepStatus];
|
||||||
|
let supabase_status: StepStatus = $state(StepStatus.Waiting);
|
||||||
|
let email_status: StepStatus = $state(StepStatus.Waiting);
|
||||||
|
|
||||||
|
onMount(async () => {
|
||||||
|
if (!session_storage_id) {
|
||||||
|
console.error('No session storage ID provided in the URL');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
all_data = JSON.parse(sessionStorage.getItem(session_storage_id) || '{}');
|
||||||
|
|
||||||
|
supabase_status = StepStatus.Loading;
|
||||||
|
try {
|
||||||
|
const { result } = await insert_data_supabase(all_data.participants, all_data.event);
|
||||||
|
supabase_status = StepStatus.Success;
|
||||||
|
// Now send emails
|
||||||
|
email_status = StepStatus.Loading;
|
||||||
|
let allSuccess = true;
|
||||||
|
for (const obj of result) {
|
||||||
|
let qr_code = await dataToBase64(obj.id);
|
||||||
|
const payload = {
|
||||||
|
action: 'send',
|
||||||
|
to: obj.email,
|
||||||
|
subject: all_data.email.subject,
|
||||||
|
text: all_data.email.body,
|
||||||
|
qr_code: qr_code,
|
||||||
|
refreshToken: localStorage.getItem('gmail_refresh_token')
|
||||||
|
};
|
||||||
|
const res = await fetch('/private/api/gmail', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: { 'Content-Type': 'application/json' },
|
||||||
|
body: JSON.stringify(payload)
|
||||||
|
});
|
||||||
|
if (!res.ok) {
|
||||||
|
allSuccess = false;
|
||||||
|
console.error('Failed to send email to', obj.email, await res.text());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
email_status = allSuccess ? StepStatus.Success : StepStatus.Failure;
|
||||||
|
} catch (e) {
|
||||||
|
supabase_status = StepStatus.Failure;
|
||||||
|
email_status = StepStatus.Failure;
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
async function dataToBase64(data: string): Promise<string> {
|
||||||
|
try {
|
||||||
|
const url = await QRCode.toDataURL(data);
|
||||||
|
const parts = url.split(',');
|
||||||
|
const base64 = parts[1];
|
||||||
|
return base64;
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function insert_data_supabase(participants, event) {
|
||||||
|
const names = participants.map((p) => p.name);
|
||||||
|
const surnames = participants.map((p) => p.surname);
|
||||||
|
const emails = participants.map((p) => p.email);
|
||||||
|
const {
|
||||||
|
data: { user },
|
||||||
|
error: authError
|
||||||
|
} = await data.supabase.auth.getUser();
|
||||||
|
const { data: user_profile, error: profileError } = await data.supabase
|
||||||
|
.from('profiles')
|
||||||
|
.select('*, section:sections (id, name)')
|
||||||
|
.eq('id', user?.id)
|
||||||
|
.single();
|
||||||
|
const { data: result, error: qrCodeError } = await data.supabase.rpc('create_qrcodes_bulk', {
|
||||||
|
p_section_id: user_profile?.section.id,
|
||||||
|
p_event_id: event.id,
|
||||||
|
p_names: names,
|
||||||
|
p_surnames: surnames,
|
||||||
|
p_emails: emails
|
||||||
|
});
|
||||||
|
|
||||||
|
return { result };
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- Creating Database Entries -->
|
||||||
|
<div class="mb-4 rounded border border-gray-300 bg-white p-4">
|
||||||
|
<h2 class="mb-2 text-xl font-bold">Creating database entries</h2>
|
||||||
|
{#if supabase_status === StepStatus.Waiting}
|
||||||
|
<span class="text-black-600">Waiting...</span>
|
||||||
|
{:else if supabase_status === StepStatus.Loading}
|
||||||
|
<span class="text-black-600">Creating entries...</span>
|
||||||
|
{:else if supabase_status === StepStatus.Success}
|
||||||
|
<span class="text-green-600">Database entries created successfully.</span>
|
||||||
|
{:else if supabase_status === StepStatus.Failure}
|
||||||
|
<span class="text-red-600">Failed to create database entries.</span>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Sending Emails -->
|
||||||
|
<div class="rounded border border-gray-300 bg-white p-4">
|
||||||
|
<h2 class="mb-2 text-xl font-bold">Sending emails</h2>
|
||||||
|
{#if email_status === StepStatus.Waiting}
|
||||||
|
<span class="text-black-600">Waiting...</span>
|
||||||
|
{:else if email_status === StepStatus.Loading}
|
||||||
|
<span class="text-black-600">Sending emails...</span>
|
||||||
|
{:else if email_status === StepStatus.Success}
|
||||||
|
<span class="text-green-600">Emails sent successfully.</span>
|
||||||
|
{:else if email_status === StepStatus.Failure}
|
||||||
|
<span class="text-red-600">Failed to send emails.</span>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
@@ -2,8 +2,10 @@
|
|||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { goto } from '$app/navigation';
|
import { goto } from '$app/navigation';
|
||||||
|
|
||||||
|
export let authorized = false;
|
||||||
|
|
||||||
let refreshToken = '';
|
let refreshToken = '';
|
||||||
let authorized = false;
|
let loading = true;
|
||||||
|
|
||||||
let to = '';
|
let to = '';
|
||||||
let subject = '';
|
let subject = '';
|
||||||
@@ -22,30 +24,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
console.log("on mount");
|
|
||||||
refreshToken = localStorage.getItem('gmail_refresh_token') ?? '';
|
refreshToken = localStorage.getItem('gmail_refresh_token') ?? '';
|
||||||
|
loading = true;
|
||||||
authorized = await validateToken(refreshToken);
|
authorized = await validateToken(refreshToken);
|
||||||
|
loading = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
/* ⇢ redirects straight to Google via server 302 */
|
/* ⇢ redirects straight to Google via server 302 */
|
||||||
const connect = () => goto('/private/api/gmail?action=auth');
|
const connect = () => goto('/private/api/gmail?action=auth');
|
||||||
|
|
||||||
async function sendEmail() {
|
|
||||||
const r = await fetch('/private/api/gmail', {
|
|
||||||
method: 'POST',
|
|
||||||
headers: { 'Content-Type': 'application/json' },
|
|
||||||
body: JSON.stringify({
|
|
||||||
action: 'send',
|
|
||||||
to,
|
|
||||||
subject,
|
|
||||||
text: body,
|
|
||||||
refreshToken
|
|
||||||
})
|
|
||||||
});
|
|
||||||
r.ok ? alert('Sent!') : alert(await r.text());
|
|
||||||
to = subject = body = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
async function disconnect() {
|
async function disconnect() {
|
||||||
if (!confirm('Disconnect Google account?')) return;
|
if (!confirm('Disconnect Google account?')) return;
|
||||||
await fetch('/private/api/gmail', {
|
await fetch('/private/api/gmail', {
|
||||||
@@ -59,11 +46,30 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if !authorized}
|
<div class="mb-4 rounded border border-gray-300 bg-white p-4">
|
||||||
<section class="space-y-4">
|
{#if loading}
|
||||||
<p>You haven’t connected your Google account yet.</p>
|
<div class="flex items-center space-x-2">
|
||||||
<button class="btn" on:click={connect}>Connect Google</button>
|
<svg class="animate-spin h-5 w-5 text-gray-500" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
||||||
|
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
|
||||||
|
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8v8z"></path>
|
||||||
|
</svg>
|
||||||
|
<span>Checking Google connection...</span>
|
||||||
|
</div>
|
||||||
|
{:else}
|
||||||
|
{#if !authorized}
|
||||||
|
<section class="flex items-center justify-between w-full">
|
||||||
|
<p class="mr-4">You haven’t connected your Google account yet.</p>
|
||||||
|
<button class="btn bg-blue-600 hover:bg-blue-700 text-white font-semibold py-2 px-4 rounded ml-auto" on:click={connect}>
|
||||||
|
Connect Google
|
||||||
|
</button>
|
||||||
</section>
|
</section>
|
||||||
{:else}
|
{:else}
|
||||||
Your connection is good, proceed to next step
|
<div class="flex items-center space-x-2 text-green-600">
|
||||||
{/if}
|
<svg class="h-5 w-5" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" />
|
||||||
|
</svg>
|
||||||
|
<span>Your connection to Google is good, proceed to next step</span>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
export let subject = '';
|
export let email: { subject: string, body: string } = { subject: '', body: '' };
|
||||||
export let body = '';
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<form class="flex flex-col space-y-4 bg-white p-8 rounded border border-gray-300 w-full shadow-none">
|
<form class="flex flex-col space-y-4 bg-white p-8 rounded border border-gray-300 w-full shadow-none">
|
||||||
@@ -9,7 +8,7 @@
|
|||||||
Subject
|
Subject
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
bind:value={subject}
|
bind:value={email.subject}
|
||||||
class="mt-1 px-3 py-2 border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-200"
|
class="mt-1 px-3 py-2 border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-200"
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
@@ -17,7 +16,7 @@
|
|||||||
<label class="flex flex-col text-gray-700">
|
<label class="flex flex-col text-gray-700">
|
||||||
Body
|
Body
|
||||||
<textarea
|
<textarea
|
||||||
bind:value={body}
|
bind:value={email.body}
|
||||||
class="mt-1 px-3 py-2 border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-200 resize-none"
|
class="mt-1 px-3 py-2 border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-200 resize-none"
|
||||||
rows="6"
|
rows="6"
|
||||||
required
|
required
|
||||||
|
|||||||
@@ -1,12 +1,21 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { enhance } from '$app/forms';
|
import { enhance } from '$app/forms';
|
||||||
|
|
||||||
let { events, new_event } = $props();
|
let { event } = $props();
|
||||||
|
let loading = $state(false);
|
||||||
|
|
||||||
|
function handleEnhance() {
|
||||||
|
loading = true;
|
||||||
|
|
||||||
|
return async ({ update }) => {
|
||||||
|
await update();
|
||||||
|
loading = false;
|
||||||
|
};
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<form method="POST" action="?/create" use:enhance class="flex flex-col space-y-4 bg-white p-8 rounded border border-gray-300 w-full shadow-none">
|
<form method="POST" action="?/create" use:enhance={handleEnhance} class="flex flex-col space-y-4 bg-white p-8 rounded border border-gray-300 w-full shadow-none">
|
||||||
<h2 class="text-2xl font-semibold text-center mb-4">Create Event</h2>
|
<h2 class="text-2xl font-semibold text-center mb-4">Create Event</h2>
|
||||||
<label class="flex flex-col text-gray-700">
|
<label class="flex flex-col text-gray-700">
|
||||||
Name
|
Name
|
||||||
@@ -43,12 +52,20 @@
|
|||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
{#if Object.keys(new_event).length > 0}
|
{#if Object.keys(event).length === 0}
|
||||||
|
<div class="mt-4 rounded border-l-4 border-gray-500 bg-gray-100 p-4 text-gray-700">
|
||||||
|
{#if loading}
|
||||||
|
<strong>Loading...</strong>
|
||||||
|
{:else}
|
||||||
|
<strong>No event created yet...</strong>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
{:else}
|
||||||
<div class="rounded border-l-4 border-green-500 bg-green-100 p-4 text-green-700 mt-4">
|
<div class="rounded border-l-4 border-green-500 bg-green-100 p-4 text-green-700 mt-4">
|
||||||
<ol>
|
<ol>
|
||||||
<li><strong>{new_event.name}</strong></li>
|
<li><strong>{event.name}</strong></li>
|
||||||
<li>{new_event.date}</li>
|
<li>{event.date}</li>
|
||||||
<li>{new_event.description}</li>
|
<li>{event.description}</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
59
src/routes/private/creator/steps/StepFinal.svelte
Normal file
59
src/routes/private/creator/steps/StepFinal.svelte
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import QRCode from 'qrcode';
|
||||||
|
|
||||||
|
const StepState = {
|
||||||
|
Waiting: 'waiting',
|
||||||
|
Processing: 'processing',
|
||||||
|
FinishedSuccess: 'finished_success',
|
||||||
|
FinishedFail: 'finished_fail'
|
||||||
|
};
|
||||||
|
|
||||||
|
let qr_codes_state = $state(StepState.Processing);
|
||||||
|
let emails_state = $state(StepState.FinishedSuccess);
|
||||||
|
|
||||||
|
// Inserts all participants into the database and returns their assigned IDs.
|
||||||
|
async function insert_data_supabase(data, participants, new_event) {
|
||||||
|
const names = participants.map((p) => p.name);
|
||||||
|
const surnames = participants.map((p) => p.surname);
|
||||||
|
const emails = participants.map((p) => p.email);
|
||||||
|
const {
|
||||||
|
data: { user },
|
||||||
|
error: authError
|
||||||
|
} = await data.supabase.auth.getUser();
|
||||||
|
const { data: user_profile, error: profileError } = await data.supabase
|
||||||
|
.from('profiles')
|
||||||
|
.select('*, section:sections (id, name)')
|
||||||
|
.eq('id', user?.id)
|
||||||
|
.single();
|
||||||
|
const { data: result, error: qrCodeError } = await data.supabase.rpc('create_qrcodes_bulk', {
|
||||||
|
p_section_id: user_profile?.section.id,
|
||||||
|
p_event_id: new_event.id,
|
||||||
|
p_names: names,
|
||||||
|
p_surnames: surnames,
|
||||||
|
p_emails: emails
|
||||||
|
});
|
||||||
|
|
||||||
|
return { result };
|
||||||
|
}
|
||||||
|
|
||||||
|
// Creates a base64 interpretation of the ticket ID
|
||||||
|
function createB64QRCode(data) {
|
||||||
|
QRCode.toDataURL('I am a pony!')
|
||||||
|
.then((url) => {
|
||||||
|
const parts = url.split(',');
|
||||||
|
return { base64data: parts[1] };
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function sendEmail(email, subject, body, qr_code_base64) {
|
||||||
|
// Here you would implement the logic to send the email.
|
||||||
|
// This is a placeholder function.
|
||||||
|
console.log(`Sending email to ${email} with subject "${subject}" and body "${body}"`);
|
||||||
|
console.log(`QR Code Base64: ${qr_code_base64}`);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
Pl
|
||||||
@@ -1,35 +1,78 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
let { new_event, participants, subject, body } = $props();
|
import { goto } from '$app/navigation';
|
||||||
|
|
||||||
|
let { data, event, participants, email, stepConditions } = $props();
|
||||||
|
|
||||||
|
function redirectToFinish() {
|
||||||
|
// Generate a random variable name
|
||||||
|
const varName = 'event_' + Math.random().toString(36).substr(2, 9);
|
||||||
|
// Save the data to sessionStorage
|
||||||
|
sessionStorage.setItem(
|
||||||
|
varName,
|
||||||
|
JSON.stringify({ event, participants, email })
|
||||||
|
);
|
||||||
|
// Redirect with the variable name as a query parameter
|
||||||
|
goto(`/private/creator/finish?data=${encodeURIComponent(varName)}`);
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- New Event Overview -->
|
<!-- New Event Overview -->
|
||||||
<div class="bg-white border border-gray-300 rounded p-6 mb-6">
|
<div class="mb-4 rounded border border-gray-300 bg-white p-4">
|
||||||
<h2 class="text-xl font-bold mb-2">Event Overview</h2>
|
<h2 class="mb-2 text-xl font-bold">Event Overview</h2>
|
||||||
<ul class="space-y-1">
|
<ul class="space-y-1">
|
||||||
<li><span class="font-semibold">Name:</span> {new_event.name}</li>
|
<li><span class="font-semibold">Name:</span> {event.name}</li>
|
||||||
<li><span class="font-semibold">Date:</span> {new_event.date}</li>
|
<li><span class="font-semibold">Date:</span> {event.date}</li>
|
||||||
<li><span class="font-semibold">Description:</span> {new_event.description}</li>
|
<li><span class="font-semibold">Description:</span> {event.description}</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Email Overview -->
|
<!-- Email Overview -->
|
||||||
<div class="bg-white border border-gray-300 rounded p-6 mb-6">
|
<div class="mb-4 rounded border border-gray-300 bg-white p-4">
|
||||||
<h2 class="text-xl font-bold mb-2">Email Preview</h2>
|
<h2 class="mb-2 text-xl font-bold">Email Preview</h2>
|
||||||
<div class="mb-2"><span class="font-semibold">Subject:</span> {subject}</div>
|
<div class="mb-2"><span class="font-semibold">Subject:</span> {email.subject}</div>
|
||||||
<div class="whitespace-pre-line border rounded p-2 bg-gray-50 text-gray-700"><span class="font-semibold">Body:</span>
|
<div class="rounded border bg-gray-50 p-2 whitespace-pre-line text-gray-700">
|
||||||
<div class="mt-1">{body}</div>
|
<span class="font-semibold"></span>
|
||||||
|
<div>{email.body}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Participants Overview -->
|
<!-- Participants Overview -->
|
||||||
<div class="bg-white border border-gray-300 rounded p-6">
|
<div class="rounded border border-gray-300 bg-white p-4">
|
||||||
<h2 class="text-xl font-bold mb-2">Participants ({participants.length})</h2>
|
<h2 class="mb-2 text-xl font-bold">Participants ({participants.length})</h2>
|
||||||
<ul class="space-y-1">
|
<ul class="space-y-1">
|
||||||
{#each participants as p}
|
{#each participants.slice(0, 10) as p}
|
||||||
<li class="flex items-center gap-2 border-b last:border-b-0 pb-1">
|
<li class="flex items-center gap-2 border-b pb-1 last:border-b-0">
|
||||||
<span class="font-semibold">{p.name} {p.surname}</span>
|
<span class="font-semibold">{p.name} {p.surname}</span>
|
||||||
<span class="font-mono text-xs text-gray-600">{p.email}</span>
|
<span class="flex-1"></span>
|
||||||
|
<span class="text-right font-mono text-xs text-gray-600">{p.email}</span>
|
||||||
</li>
|
</li>
|
||||||
{/each}
|
{/each}
|
||||||
</ul>
|
</ul>
|
||||||
|
<p class="mt-2 text-sm text-gray-500">Note: Only the first 10 participants are shown.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button
|
||||||
|
onclick={redirectToFinish}
|
||||||
|
class="mt-4 w-full rounded bg-blue-600 px-4 py-3 font-bold text-white
|
||||||
|
transition-colors duration-200 hover:bg-blue-700
|
||||||
|
disabled:cursor-not-allowed disabled:bg-gray-300 disabled:text-gray-500"
|
||||||
|
disabled={!stepConditions.every(Boolean)}
|
||||||
|
>
|
||||||
|
Generate QR codes and send
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<div class="mt-2 space-y-1">
|
||||||
|
{#if !stepConditions[0]}
|
||||||
|
<p class="text-sm text-red-500">Please provide an event name before proceeding.</p>
|
||||||
|
{/if}
|
||||||
|
{#if !stepConditions[1]}
|
||||||
|
<p class="text-sm text-red-500">Please add at least one participant before proceeding.</p>
|
||||||
|
{/if}
|
||||||
|
{#if !stepConditions[2]}
|
||||||
|
<p class="text-sm text-red-500">Please provide an email subject before proceeding.</p>
|
||||||
|
{/if}
|
||||||
|
{#if !stepConditions[3]}
|
||||||
|
<p class="text-sm text-red-500">Please provide an email body before proceeding.</p>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
@@ -2,11 +2,26 @@
|
|||||||
import { enhance } from '$app/forms';
|
import { enhance } from '$app/forms';
|
||||||
|
|
||||||
let { participants = [] } = $props();
|
let { participants = [] } = $props();
|
||||||
|
let loading = $state(false);
|
||||||
|
|
||||||
|
function handleEnhance() {
|
||||||
|
loading = true;
|
||||||
|
|
||||||
|
return async ({ update }) => {
|
||||||
|
await update();
|
||||||
|
loading = false;
|
||||||
|
};
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<form method="POST" action="?/participants" use:enhance enctype="multipart/form-data" class="flex flex-col space-y-4 bg-white p-8 rounded border border-gray-300 w-full shadow-none">
|
<form
|
||||||
<h2 class="text-2xl font-semibold text-center mb-4">Upload Participants</h2>
|
method="POST"
|
||||||
|
action="?/participants"
|
||||||
|
use:enhance={handleEnhance}
|
||||||
|
enctype="multipart/form-data"
|
||||||
|
class="flex w-full flex-col space-y-4 rounded border border-gray-300 bg-white p-8 shadow-none"
|
||||||
|
>
|
||||||
|
<h2 class="mb-4 text-center text-2xl font-semibold">Upload Participants</h2>
|
||||||
<label class="flex flex-col text-gray-700">
|
<label class="flex flex-col text-gray-700">
|
||||||
CSV File
|
CSV File
|
||||||
<input
|
<input
|
||||||
@@ -14,30 +29,34 @@
|
|||||||
name="participants"
|
name="participants"
|
||||||
id="participants"
|
id="participants"
|
||||||
accept=".csv"
|
accept=".csv"
|
||||||
class="mt-1 px-3 py-2 border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-200"
|
class="mt-1 rounded border border-gray-300 px-3 py-2 focus:ring-2 focus:ring-blue-200 focus:outline-none"
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
class="w-full py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition"
|
class="w-full rounded bg-blue-600 py-2 text-white transition hover:bg-blue-700"
|
||||||
>
|
>
|
||||||
Submit
|
Submit
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
{#if participants.length === 0}
|
{#if participants.length === 0}
|
||||||
<p class="text-gray-500 mt-4">No participants added yet.</p>
|
<div class="mt-4 rounded border-l-4 border-gray-500 bg-gray-100 p-4 text-gray-700">
|
||||||
{/if}
|
{#if loading}
|
||||||
|
<strong>Loading...</strong>
|
||||||
{#if participants.length > 0}
|
{:else}
|
||||||
<div class="rounded border-l-4 border-green-500 bg-green-50 p-4 text-green-700 mt-4">
|
<strong>No participants yet...</strong>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
{:else}
|
||||||
|
<div class="mt-4 rounded border-l-4 border-green-500 bg-green-50 p-4 text-green-700">
|
||||||
<ul class="space-y-2">
|
<ul class="space-y-2">
|
||||||
{#each participants as p, i}
|
{#each participants as p, i}
|
||||||
<li class="flex items-center justify-between border-b pb-1">
|
<li class="flex items-center justify-between border-b pb-1">
|
||||||
<div>
|
<div>
|
||||||
<div class="font-semibold">{p.name} {p.surname}</div>
|
<div class="font-semibold">{p.name} {p.surname}</div>
|
||||||
<div class="text-xs font-mono text-gray-600">{p.email}</div>
|
<div class="font-mono text-xs text-gray-600">{p.email}</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
{/each}
|
{/each}
|
||||||
|
|||||||
7
src/routes/private/events/+page.server.ts
Normal file
7
src/routes/private/events/+page.server.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
export async function load({ locals }) {
|
||||||
|
const { data: events, error } = await locals.supabase
|
||||||
|
.from('events')
|
||||||
|
.select('*')
|
||||||
|
.order('date', { ascending: false });
|
||||||
|
return { events };
|
||||||
|
}
|
||||||
25
src/routes/private/events/+page.svelte
Normal file
25
src/routes/private/events/+page.svelte
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
export let data;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<h1 class="text-2xl font-bold mb-4 mt-2 text-center">All Events</h1>
|
||||||
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 max-w-2xl mx-auto">
|
||||||
|
{#each data.events as event}
|
||||||
|
<a
|
||||||
|
href={`/private/events/event?id=${event.id}`}
|
||||||
|
class="block border border-gray-300 rounded bg-white p-4 shadow-none transition cursor-pointer hover:border-blue-500 group"
|
||||||
|
>
|
||||||
|
<div class="flex flex-col gap-1">
|
||||||
|
<span class="font-semibold text-lg text-black-700 group-hover:underline">{event.name}</span>
|
||||||
|
<span class="text-gray-500 text-sm">{event.date}</span>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<a
|
||||||
|
href="/private/creator"
|
||||||
|
class="fixed bottom-6 left-1/2 -translate-x-1/2 z-50 bg-blue-600 hover:bg-blue-700 text-white font-bold py-3 px-8 rounded-full shadow-none border border-gray-300"
|
||||||
|
>
|
||||||
|
New Event
|
||||||
|
</a>
|
||||||
13
src/routes/private/events/event/+page.server.ts
Normal file
13
src/routes/private/events/event/+page.server.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
export async function load({ locals, url }) {
|
||||||
|
const event_id = url.searchParams.get('id');
|
||||||
|
const { data: event_data, error: eventError } = await locals.supabase
|
||||||
|
.from('events')
|
||||||
|
.select('*')
|
||||||
|
.eq('id', event_id)
|
||||||
|
.single()
|
||||||
|
const { data: participants, error: participantsError } = await locals.supabase
|
||||||
|
.from('participants')
|
||||||
|
.select('*, scanned_by:profiles (id, display_name)')
|
||||||
|
.eq('event', event_id)
|
||||||
|
return {event_data, participants};
|
||||||
|
}
|
||||||
95
src/routes/private/events/event/+page.svelte
Normal file
95
src/routes/private/events/event/+page.svelte
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
let { data } = $props();
|
||||||
|
|
||||||
|
const scannedCount = data.participants.filter((p) => p.scanned).length;
|
||||||
|
const notScannedCount = data.participants.length - scannedCount;
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<h1 class="mt-2 mb-4 text-center text-2xl font-bold">Event Overview</h1>
|
||||||
|
|
||||||
|
<div class="mb-2 rounded border border-gray-300 bg-white p-4">
|
||||||
|
<div class="flex flex-col gap-1">
|
||||||
|
<span class="text-black-700 text-lg font-semibold">{data.event_data.name}</span>
|
||||||
|
<span class="text-black-500 text-sm">{data.event_data.date}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-2 flex items-center rounded border border-gray-300 bg-white p-4">
|
||||||
|
<div class="flex flex-1 items-center justify-center gap-2">
|
||||||
|
<svg
|
||||||
|
class="inline h-4 w-4 text-green-600"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width="2"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
>
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" />
|
||||||
|
</svg>
|
||||||
|
<span class="text-sm text-gray-700">Scanned ({scannedCount})</span>
|
||||||
|
</div>
|
||||||
|
<div class="mx-4 h-8 w-px bg-gray-300"></div>
|
||||||
|
<div class="flex flex-1 items-center justify-center gap-2">
|
||||||
|
<svg
|
||||||
|
class="inline h-4 w-4 text-red-600"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width="2"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
>
|
||||||
|
<circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2" fill="none" />
|
||||||
|
<line x1="8" y1="8" x2="16" y2="16" stroke="currentColor" stroke-width="2" />
|
||||||
|
<line x1="16" y1="8" x2="8" y2="16" stroke="currentColor" stroke-width="2" />
|
||||||
|
</svg>
|
||||||
|
<span class="text-sm text-gray-700">Not scanned ({notScannedCount})</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="rounded border border-gray-300 bg-white p-4">
|
||||||
|
<h2 class="mb-2 rounded text-xl font-bold">Participants ({data.participants.length})</h2>
|
||||||
|
<ul class="space-y-1">
|
||||||
|
{#each data.participants as p}
|
||||||
|
<li class="flex items-center gap-2 border-b pb-1 last:border-b-0">
|
||||||
|
{#if p.scanned}
|
||||||
|
<svg
|
||||||
|
title="Scanned"
|
||||||
|
class="mr-2 inline h-4 w-4 text-green-600"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width="2"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
>
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" />
|
||||||
|
</svg>
|
||||||
|
{:else}
|
||||||
|
<svg
|
||||||
|
title="Not scanned"
|
||||||
|
class="mr-2 inline h-4 w-4 text-red-600"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width="2"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
>
|
||||||
|
<circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2" fill="none" />
|
||||||
|
<line x1="8" y1="8" x2="16" y2="16" stroke="currentColor" stroke-width="2" />
|
||||||
|
<line x1="16" y1="8" x2="8" y2="16" stroke="currentColor" stroke-width="2" />
|
||||||
|
</svg>
|
||||||
|
{/if}
|
||||||
|
<span class="font-semibold">{p.name} {p.surname}</span>
|
||||||
|
<span class="flex-1"></span>
|
||||||
|
{#if p.scanned_by}
|
||||||
|
<div class="flex flex-row items-end ml-2">
|
||||||
|
<span class="mr-1 text-xs text-gray-500">
|
||||||
|
{new Date(p.scanned_at).toLocaleTimeString([], {
|
||||||
|
hour: '2-digit',
|
||||||
|
minute: '2-digit',
|
||||||
|
hour12: false
|
||||||
|
})}
|
||||||
|
</span>
|
||||||
|
<span class="text-xs text-gray-500">by {p.scanned_by.display_name}</span>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
</li>
|
||||||
|
{/each}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
@@ -7,13 +7,45 @@
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="user-profile">
|
<h1 class="mt-2 mb-4 text-center text-2xl font-bold">User Profile</h1>
|
||||||
<h2 class="mb-2 text-2xl font-bold">Currently logged in</h2>
|
|
||||||
<p><strong>Username:</strong> {data.user?.user_metadata.display_name}</p>
|
<div class="mb-4 rounded border border-gray-300 bg-white p-6">
|
||||||
<p><strong>Email:</strong> {data.user?.email}</p>
|
<div class="flex flex-col gap-2">
|
||||||
<p><strong>Section:</strong> {data.user_profile?.section.name}</p>
|
<div class="flex items-center gap-3 mb-4">
|
||||||
<p><strong>Position:</strong> {data.user_profile?.section_position}</p>
|
<div class="h-12 w-12 rounded-full bg-gray-200 flex items-center justify-center text-xl font-bold text-gray-600">
|
||||||
|
{data.user?.user_metadata.display_name?.[0] ?? "U"}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span class="text-lg font-semibold text-gray-800">{data.user?.user_metadata.display_name}</span>
|
||||||
|
<div class="text-sm text-gray-500">{data.user?.email}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col gap-1">
|
||||||
|
<div>
|
||||||
|
<span class="font-medium text-gray-700">Section:</span>
|
||||||
|
<span class="text-gray-900">{data.user_profile?.section.name ?? "N/A"}</span>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span class="font-medium text-gray-700">Position:</span>
|
||||||
|
<span class="text-gray-900">{data.user_profile?.section_position ?? "N/A"}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<h2 class="text-lg mb-2 mt-4">User guide</h2>
|
||||||
|
<p class="text-gray-700 text-sm leading-relaxed">
|
||||||
|
To scan a QR code, head over to Scanner in the top right corner. Click on Start scanning and allow camera permissions.
|
||||||
|
If you close and open your browser and your camera is stuck, simply refresh the page or click Stop scanning and then Start scanning again.
|
||||||
|
When you scan a QR code, a request is sent to the server to get the user's personal information and to mark their tickets as scanned.
|
||||||
|
</p>
|
||||||
|
<h2 class="text-lg mb-2 mt-4">Administrator guide</h2>
|
||||||
|
<p class="text-gray-700 text-sm leading-relaxed">
|
||||||
|
You can view events
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button class="mt-4 rounded bg-red-500 px-4 py-2 text-white hover:bg-red-600">
|
|
||||||
<a href="/auth/signout">Sign out</a>
|
<a
|
||||||
</button>
|
href="/auth/signout"
|
||||||
|
class="fixed bottom-6 left-1/2 -translate-x-1/2 z-50 bg-red-500 hover:bg-red-600 text-white font-semibold py-3 px-8 rounded-full shadow-none border border-gray-300 transition"
|
||||||
|
>
|
||||||
|
Sign out
|
||||||
|
</a>
|
||||||
|
|||||||
@@ -12,11 +12,10 @@
|
|||||||
|
|
||||||
$effect(() => {
|
$effect(() => {
|
||||||
if (scanned_id === "") return;
|
if (scanned_id === "") return;
|
||||||
console.log('New QR code found:', scanned_id);
|
|
||||||
scan_state = ScanState.scanning;
|
scan_state = ScanState.scanning;
|
||||||
|
|
||||||
data.supabase
|
data.supabase
|
||||||
.from('qrcodes')
|
.from('participants')
|
||||||
.select(`*, event ( id, name ), scanned_by ( id, display_name )`)
|
.select(`*, event ( id, name ), scanned_by ( id, display_name )`)
|
||||||
.eq('id', scanned_id)
|
.eq('id', scanned_id)
|
||||||
.then( response => {
|
.then( response => {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { onMount } from 'svelte';
|
import { onMount, onDestroy } from 'svelte';
|
||||||
import {
|
import {
|
||||||
Html5QrcodeScanner,
|
Html5QrcodeScanner,
|
||||||
type Html5QrcodeResult,
|
type Html5QrcodeResult,
|
||||||
@@ -37,6 +37,12 @@
|
|||||||
);
|
);
|
||||||
scanner.render(onScanSuccess, onScanFailure);
|
scanner.render(onScanSuccess, onScanFailure);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onDestroy(() => {
|
||||||
|
if (scanner) {
|
||||||
|
scanner.clear().catch(() => {});
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="qr-scanner" class="w-full h-full max-w-none overflow-hidden rounded-sm"></div>
|
<div id="qr-scanner" class="w-full h-full max-w-none overflow-hidden rounded-sm"></div>
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import tailwindcss from '@tailwindcss/vite';
|
import tailwindcss from '@tailwindcss/vite';
|
||||||
import { sveltekit } from '@sveltejs/kit/vite';
|
import { sveltekit } from '@sveltejs/kit/vite';
|
||||||
import { defineConfig } from 'vite';
|
import { defineConfig } from 'vite';
|
||||||
|
import devtoolsJson from 'vite-plugin-devtools-json';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [tailwindcss(), sveltekit()]
|
plugins: [tailwindcss(), sveltekit(), devtoolsJson()]
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user