diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 63b115f..bbde8c4 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -8,8 +8,8 @@ on: workflow_dispatch: env: - codex_version: v0.1.6 - circuit_version: v0.1.6 + codex_version: v0.1.7 + circuit_version: v0.1.7 marketplace_address: "0xfE822Df439d987849a90B64a4C0e26a297DBD47F" eth_provider: "https://rpc.testnet.codex.storage" VITE_CODEX_API_URL: ${{ secrets.VITE_CODEX_API_URL }} diff --git a/e2e/download.spec.ts b/e2e/download.spec.ts new file mode 100644 index 0000000..ae7899e --- /dev/null +++ b/e2e/download.spec.ts @@ -0,0 +1,32 @@ +import { test, expect } from '@playwright/test'; +import { readFileSync } from 'fs'; +import path, { dirname } from 'path'; +import { fileURLToPath } from 'url'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); + +test('download a file', async ({ page, browserName }) => { + // https://github.com/microsoft/playwright/issues/13037 + test.skip(browserName.toLowerCase() !== 'chromium', + `Test only for chromium!`); + + await page.goto('/dashboard'); + await page.locator('div').getByTestId("upload").setInputFiles([ + path.join(__dirname, "assets", 'chatgpt.jpg'), + ]); + await page.context().grantPermissions(["clipboard-read", "clipboard-write"]); + await page.locator('.files-fileActions > button:nth-child(3)').first().click(); + await page.getByRole('button', { name: 'Copy CID' }).click(); + const handle = await page.evaluateHandle(() => navigator.clipboard.readText()); + const cid = await handle.jsonValue() + await page.locator('.sheets-container > .backdrop').click(); + await page.getByPlaceholder('CID').click(); + await page.getByPlaceholder('CID').fill(cid); + const page1Promise = page.waitForEvent('popup'); + const downloadPromise = page.waitForEvent('download'); + await page.locator('div').filter({ hasText: /^Download a fileDownload$/ }).getByRole('button').click(); + const page1 = await page1Promise; + const download = await downloadPromise; + expect(await download.failure()).toBeNull() +}); \ No newline at end of file diff --git a/e2e/settings.spec.ts b/e2e/settings.spec.ts index 256bcb9..f1f16a9 100644 --- a/e2e/settings.spec.ts +++ b/e2e/settings.spec.ts @@ -12,12 +12,14 @@ test('update the URL with wrong URL applies', async ({ page }) => { await page.goto('/dashboard'); await page.getByRole('link', { name: 'Settings' }).click(); await page.getByLabel('Codex client node URL').click(); - + await page.getByLabel('Codex client node URL').fill('hello'); + await expect.soft(page.getByText("The URL is not valid")).toBeVisible() + await expect.soft(page.locator(".settings-url-button")).toBeDisabled() await page.getByLabel('Codex client node URL').fill('http://127.0.0.1:8079'); + await expect.soft(page.getByText("The URL is not valid")).not.toBeVisible() + await expect.soft(page.locator(".settings-url-button")).not.toBeDisabled() await page.getByRole('button', { name: 'Save changes' }).nth(1).click(); - await expect.soft(page.getByText("Cannot retrieve the data")).toBeVisible() - await page.getByLabel('Codex client node URL').fill('http://127.0.0.1:8080'); await page.getByRole('button', { name: 'Save changes' }).nth(1).click(); }) \ No newline at end of file diff --git a/e2e/storage-requests.spec.ts b/e2e/storage-requests.spec.ts index 322c6c0..3db89ab 100644 --- a/e2e/storage-requests.spec.ts +++ b/e2e/storage-requests.spec.ts @@ -30,7 +30,7 @@ test('select a uploaded cid when creating a storage request', async ({ page }) = await page.getByRole('link', { name: 'Purchases' }).click(); await page.getByRole('button', { name: 'Storage Request' }).click(); await page.getByPlaceholder('Select or type your CID').click(); - await page.getByText('N/A0').click(); + await page.locator('.dropdown-option').nth(1).click(); await expect(page.getByText('button[disabled]')).not.toBeVisible(); }) diff --git a/package-lock.json b/package-lock.json index 427b7ec..b83d1c7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "@codex-storage/marketplace-ui", - "version": "0.0.6", + "version": "0.0.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@codex-storage/marketplace-ui", - "version": "0.0.6", + "version": "0.0.7", "license": "MIT", "dependencies": { - "@codex-storage/marketplace-ui-components": "^0.0.20", + "@codex-storage/marketplace-ui-components": "^0.0.24", "@codex-storage/sdk-js": "^0.0.8", "@sentry/browser": "^8.32.0", "@sentry/react": "^8.31.0", @@ -374,9 +374,9 @@ "dev": true }, "node_modules/@codex-storage/marketplace-ui-components": { - "version": "0.0.20", - "resolved": "https://registry.npmjs.org/@codex-storage/marketplace-ui-components/-/marketplace-ui-components-0.0.20.tgz", - "integrity": "sha512-nclmhFgseWV6p6hZJg5fPZR0voBOpZcPP79S6jaGWAgrDWogrBFVO4Axhwb9kdenJusIHUsuwG4pAu0r9ylb5w==", + "version": "0.0.24", + "resolved": "https://registry.npmjs.org/@codex-storage/marketplace-ui-components/-/marketplace-ui-components-0.0.24.tgz", + "integrity": "sha512-7YVpy70zC1rHxpUjFOt+gkhj1Rt9wG1Ls4hNtUzR4lFrICvCC8m4EuUg37FlgjTt2H9eLpVt1b090Wyz+CKeng==", "dependencies": { "lucide-react": "^0.441.0" }, @@ -620,12 +620,12 @@ } }, "node_modules/@playwright/test": { - "version": "1.48.0", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.48.0.tgz", - "integrity": "sha512-W5lhqPUVPqhtc/ySvZI5Q8X2ztBOUgZ8LbAFy0JQgrXZs2xaILrUcNO3rQjwbLPfGK13+rZsDa1FpG+tqYkT5w==", + "version": "1.48.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.48.1.tgz", + "integrity": "sha512-s9RtWoxkOLmRJdw3oFvhFbs9OJS0BzrLUc8Hf6l2UdCNd1rqeEyD4BhCJkvzeEoD1FsK4mirsWwGerhVmYKtZg==", "dev": true, "dependencies": { - "playwright": "1.48.0" + "playwright": "1.48.1" }, "bin": { "playwright": "cli.js" @@ -843,97 +843,97 @@ ] }, "node_modules/@sentry-internal/browser-utils": { - "version": "8.34.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/browser-utils/-/browser-utils-8.34.0.tgz", - "integrity": "sha512-4AcYOzPzD1tL5eSRQ/GpKv5enquZf4dMVUez99/Bh3va8qiJrNP55AcM7UzZ7WZLTqKygIYruJTU5Zu2SpEAPQ==", + "version": "8.35.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/browser-utils/-/browser-utils-8.35.0.tgz", + "integrity": "sha512-uj9nwERm7HIS13f/Q52hF/NUS5Al8Ma6jkgpfYGeppYvU0uSjPkwMogtqoJQNbOoZg973tV8qUScbcWY616wNA==", "dependencies": { - "@sentry/core": "8.34.0", - "@sentry/types": "8.34.0", - "@sentry/utils": "8.34.0" + "@sentry/core": "8.35.0", + "@sentry/types": "8.35.0", + "@sentry/utils": "8.35.0" }, "engines": { "node": ">=14.18" } }, "node_modules/@sentry-internal/feedback": { - "version": "8.34.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/feedback/-/feedback-8.34.0.tgz", - "integrity": "sha512-aYSM2KPUs0FLPxxbJCFSwCYG70VMzlT04xepD1Y/tTlPPOja/02tSv2tyOdZbv8Uw7xslZs3/8Lhj74oYcTBxw==", + "version": "8.35.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/feedback/-/feedback-8.35.0.tgz", + "integrity": "sha512-7bjSaUhL0bDArozre6EiIhhdWdT/1AWNWBC1Wc5w1IxEi5xF7nvF/FfvjQYrONQzZAI3HRxc45J2qhLUzHBmoQ==", "dependencies": { - "@sentry/core": "8.34.0", - "@sentry/types": "8.34.0", - "@sentry/utils": "8.34.0" + "@sentry/core": "8.35.0", + "@sentry/types": "8.35.0", + "@sentry/utils": "8.35.0" }, "engines": { "node": ">=14.18" } }, "node_modules/@sentry-internal/replay": { - "version": "8.34.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/replay/-/replay-8.34.0.tgz", - "integrity": "sha512-EoMh9NYljNewZK1quY23YILgtNdGgrkzJ9TPsj6jXUG0LZ0Q7N7eFWd0xOEDBvFxrmI3cSXF1i4d1sBb+eyKRw==", + "version": "8.35.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/replay/-/replay-8.35.0.tgz", + "integrity": "sha512-3wkW03vXYMyWtTLxl9yrtkV+qxbnKFgfASdoGWhXzfLjycgT6o4/04eb3Gn71q9aXqRwH17ISVQbVswnRqMcmA==", "dependencies": { - "@sentry-internal/browser-utils": "8.34.0", - "@sentry/core": "8.34.0", - "@sentry/types": "8.34.0", - "@sentry/utils": "8.34.0" + "@sentry-internal/browser-utils": "8.35.0", + "@sentry/core": "8.35.0", + "@sentry/types": "8.35.0", + "@sentry/utils": "8.35.0" }, "engines": { "node": ">=14.18" } }, "node_modules/@sentry-internal/replay-canvas": { - "version": "8.34.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/replay-canvas/-/replay-canvas-8.34.0.tgz", - "integrity": "sha512-x8KhZcCDpbKHqFOykYXiamX6x0LRxv6N1OJHoH+XCrMtiDBZr4Yo30d/MaS6rjmKGMtSRij30v+Uq+YWIgxUrg==", + "version": "8.35.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/replay-canvas/-/replay-canvas-8.35.0.tgz", + "integrity": "sha512-TUrH6Piv19kvHIiRyIuapLdnuwxk/Un/l1WDCQfq7mK9p1Pac0FkQ7Uufjp6zY3lyhDDZQ8qvCS4ioCMibCwQg==", "dependencies": { - "@sentry-internal/replay": "8.34.0", - "@sentry/core": "8.34.0", - "@sentry/types": "8.34.0", - "@sentry/utils": "8.34.0" + "@sentry-internal/replay": "8.35.0", + "@sentry/core": "8.35.0", + "@sentry/types": "8.35.0", + "@sentry/utils": "8.35.0" }, "engines": { "node": ">=14.18" } }, "node_modules/@sentry/browser": { - "version": "8.34.0", - "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-8.34.0.tgz", - "integrity": "sha512-3HHG2NXxzHq1lVmDy2uRjYjGNf9NsJsTPlOC70vbQdOb+S49EdH/XMPy+J3ruIoyv6Cu0LwvA6bMOM6rHZOgNQ==", + "version": "8.35.0", + "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-8.35.0.tgz", + "integrity": "sha512-WHfI+NoZzpCsmIvtr6ChOe7yWPLQyMchPnVhY3Z4UeC70bkYNdKcoj/4XZbX3m0D8+71JAsm0mJ9s9OC3Ue6MQ==", "dependencies": { - "@sentry-internal/browser-utils": "8.34.0", - "@sentry-internal/feedback": "8.34.0", - "@sentry-internal/replay": "8.34.0", - "@sentry-internal/replay-canvas": "8.34.0", - "@sentry/core": "8.34.0", - "@sentry/types": "8.34.0", - "@sentry/utils": "8.34.0" + "@sentry-internal/browser-utils": "8.35.0", + "@sentry-internal/feedback": "8.35.0", + "@sentry-internal/replay": "8.35.0", + "@sentry-internal/replay-canvas": "8.35.0", + "@sentry/core": "8.35.0", + "@sentry/types": "8.35.0", + "@sentry/utils": "8.35.0" }, "engines": { "node": ">=14.18" } }, "node_modules/@sentry/core": { - "version": "8.34.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-8.34.0.tgz", - "integrity": "sha512-adrXCTK/zsg5pJ67lgtZqdqHvyx6etMjQW3P82NgWdj83c8fb+zH+K79Z47pD4zQjX0ou2Ws5nwwi4wJbz4bfA==", + "version": "8.35.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-8.35.0.tgz", + "integrity": "sha512-Ci0Nmtw5ETWLqQJGY4dyF+iWh7PWKy6k303fCEoEmqj2czDrKJCp7yHBNV0XYbo00prj2ZTbCr6I7albYiyONA==", "dependencies": { - "@sentry/types": "8.34.0", - "@sentry/utils": "8.34.0" + "@sentry/types": "8.35.0", + "@sentry/utils": "8.35.0" }, "engines": { "node": ">=14.18" } }, "node_modules/@sentry/react": { - "version": "8.34.0", - "resolved": "https://registry.npmjs.org/@sentry/react/-/react-8.34.0.tgz", - "integrity": "sha512-gIgzhj7h67C+Sdq2ul4fOSK142Gf0uV99bqHRdtIiUlXw9yjzZQY5TKTtzbOaevn7qBJ0xrRKtIRUbOBMl0clw==", - "dependencies": { - "@sentry/browser": "8.34.0", - "@sentry/core": "8.34.0", - "@sentry/types": "8.34.0", - "@sentry/utils": "8.34.0", + "version": "8.35.0", + "resolved": "https://registry.npmjs.org/@sentry/react/-/react-8.35.0.tgz", + "integrity": "sha512-8Y+s4pE9hvT2TwSo5JS/Enw2cNFlwiLcJDNGCj/Hho+FePFYA59hbN06ouTHWARnO+swANHKZQj24Wp57p1/tg==", + "dependencies": { + "@sentry/browser": "8.35.0", + "@sentry/core": "8.35.0", + "@sentry/types": "8.35.0", + "@sentry/utils": "8.35.0", "hoist-non-react-statics": "^3.3.2" }, "engines": { @@ -944,19 +944,19 @@ } }, "node_modules/@sentry/types": { - "version": "8.34.0", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-8.34.0.tgz", - "integrity": "sha512-zLRc60CzohGCo6zNsNeQ9JF3SiEeRE4aDCP9fDDdIVCOKovS+mn1rtSip0qd0Vp2fidOu0+2yY0ALCz1A3PJSQ==", + "version": "8.35.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-8.35.0.tgz", + "integrity": "sha512-AVEZjb16MlYPifiDDvJ19dPQyDn0jlrtC1PHs6ZKO+Rzyz+2EX2BRdszvanqArldexPoU1p5Bn2w81XZNXThBA==", "engines": { "node": ">=14.18" } }, "node_modules/@sentry/utils": { - "version": "8.34.0", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-8.34.0.tgz", - "integrity": "sha512-W1KoRlFUjprlh3t86DZPFxLfM6mzjRzshVfMY7vRlJFymBelJsnJ3A1lPeBZM9nCraOSiw6GtOWu6k5BAkiGIg==", + "version": "8.35.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-8.35.0.tgz", + "integrity": "sha512-MdMb6+uXjqND7qIPWhulubpSeHzia6HtxeJa8jYI09OCvIcmNGPydv/Gx/LZBwosfMHrLdTWcFH7Y7aCxrq7cg==", "dependencies": { - "@sentry/types": "8.34.0" + "@sentry/types": "8.35.0" }, "engines": { "node": ">=14.18" @@ -984,9 +984,9 @@ } }, "node_modules/@tanstack/react-query": { - "version": "5.59.14", - "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.59.14.tgz", - "integrity": "sha512-2cM4x3Ka4Thl7/wnjf++EMGA2Is/RgPynn83D4kfGiJOGSjb5T2D3EEOlC8Nt6U2htLS3imOXjOSMEjC3K7JNg==", + "version": "5.59.15", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.59.15.tgz", + "integrity": "sha512-QbVlAkTI78wB4Mqgf2RDmgC0AOiJqer2c5k9STOOSXGv1S6ZkY37r/6UpE8DbQ2Du0ohsdoXgFNEyv+4eDoPEw==", "dependencies": { "@tanstack/query-core": "5.59.13" }, @@ -999,12 +999,12 @@ } }, "node_modules/@tanstack/react-router": { - "version": "1.67.0", - "resolved": "https://registry.npmjs.org/@tanstack/react-router/-/react-router-1.67.0.tgz", - "integrity": "sha512-8AmtDpJZpoC+TnHf9qS0FbRz7qnLkQ336Oi6fyhfbHH+BPvf27tlj+YxbVrt7sVrdvI8n3AZveUGx38/JUkLDQ==", + "version": "1.75.0", + "resolved": "https://registry.npmjs.org/@tanstack/react-router/-/react-router-1.75.0.tgz", + "integrity": "sha512-iELqrMjlE/Y2JeOkvTfrPPKovrvtj1M+PTESfNfNv26Ja1efotcx0hEXiClmT7KYIlVBf0TowI5GUBNWGArm6A==", "dependencies": { "@tanstack/history": "1.61.1", - "@tanstack/react-store": "^0.5.5", + "@tanstack/react-store": "^0.5.6", "tiny-invariant": "^1.3.3", "tiny-warning": "^1.0.3" }, @@ -1016,7 +1016,7 @@ "url": "https://github.com/sponsors/tannerlinsley" }, "peerDependencies": { - "@tanstack/router-generator": "1.65.0", + "@tanstack/router-generator": "1.74.2", "react": ">=18", "react-dom": ">=18" }, @@ -1027,8 +1027,9 @@ } }, "node_modules/@tanstack/react-store": { - "version": "0.5.5", - "license": "MIT", + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/@tanstack/react-store/-/react-store-0.5.6.tgz", + "integrity": "sha512-SitIpS5jTj28DajjLpWbIX+YetmJL+6PRY0DKKiCGBKfYIqj3ryODQYF3jB3SNoR9ifUA/jFkqbJdBKFtWd+AQ==", "dependencies": { "@tanstack/store": "0.5.5", "use-sync-external-store": "^1.2.2" @@ -1065,9 +1066,9 @@ } }, "node_modules/@tanstack/router-generator": { - "version": "1.65.0", - "resolved": "https://registry.npmjs.org/@tanstack/router-generator/-/router-generator-1.65.0.tgz", - "integrity": "sha512-N2H2cHBbUNLqx/ySd5g0R1GR8gGc4UagoBWmQKaTD5gHjFwWojJhigllZlQN4U1nxZLb4yJ3eJYuxRQZCoqaJw==", + "version": "1.74.2", + "resolved": "https://registry.npmjs.org/@tanstack/router-generator/-/router-generator-1.74.2.tgz", + "integrity": "sha512-S69fXvYcL+tQsO5Fe9ju/XVa/hZvk4pCaWbtoR2MNjIgR2RmjiFKOgXYeLRMNom/IpP/HAQmQ3m1DwU9jjSUKA==", "devOptional": true, "dependencies": { "@tanstack/virtual-file-routes": "^1.64.0", @@ -1552,9 +1553,9 @@ } }, "node_modules/@tanstack/router-plugin": { - "version": "1.66.1", - "resolved": "https://registry.npmjs.org/@tanstack/router-plugin/-/router-plugin-1.66.1.tgz", - "integrity": "sha512-0oeO4x1AKwL9lP9WMJ4ysVcNCUdXHffjFKBWYaEt1Cj2RkWgaWXtSzgg3dhFFemYgn/Zm1NOGQlA4f6/q/PPZw==", + "version": "1.76.0", + "resolved": "https://registry.npmjs.org/@tanstack/router-plugin/-/router-plugin-1.76.0.tgz", + "integrity": "sha512-5JY1NeNbxi7jamTKTAWLyyC9t4Y9Ol+vFZB84h6F1K1BkxqeWQTCJuXMYCY3KawSd7xy2mVT/BgDyZ0AS5hKAA==", "dev": true, "dependencies": { "@babel/core": "^7.25.8", @@ -1565,7 +1566,7 @@ "@babel/template": "^7.25.7", "@babel/traverse": "^7.25.7", "@babel/types": "^7.25.8", - "@tanstack/router-generator": "^1.65.0", + "@tanstack/router-generator": "^1.74.2", "@tanstack/virtual-file-routes": "^1.64.0", "@types/babel__core": "^7.20.5", "@types/babel__generator": "^7.6.8", @@ -1602,7 +1603,8 @@ }, "node_modules/@tanstack/store": { "version": "0.5.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@tanstack/store/-/store-0.5.5.tgz", + "integrity": "sha512-EOSrgdDAJExbvRZEQ/Xhh9iZchXpMN+ga1Bnk8Nmygzs8TfiE6hbzThF+Pr2G19uHL6+DTDTHhJ8VQiOd7l4tA==", "funding": { "type": "github", "url": "https://github.com/sponsors/tannerlinsley" @@ -1695,9 +1697,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.7.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz", - "integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==", + "version": "22.7.8", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.8.tgz", + "integrity": "sha512-a922jJy31vqR5sk+kAdIENJjHblqcZ4RmERviFsER4WJcEONqxKcjNOlk0q7OUfrF5sddT+vng070cdfMlrPLg==", "dev": true, "dependencies": { "undici-types": "~6.19.2" @@ -1728,16 +1730,16 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.9.0.tgz", - "integrity": "sha512-Y1n621OCy4m7/vTXNlCbMVp87zSd7NH0L9cXD8aIpOaNlzeWxIK4+Q19A68gSmTNRZn92UjocVUWDthGxtqHFg==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.11.0.tgz", + "integrity": "sha512-KhGn2LjW1PJT2A/GfDpiyOfS4a8xHQv2myUagTM5+zsormOmBlYsnQ6pobJ8XxJmh6hnHwa2Mbe3fPrDJoDhbA==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.9.0", - "@typescript-eslint/type-utils": "8.9.0", - "@typescript-eslint/utils": "8.9.0", - "@typescript-eslint/visitor-keys": "8.9.0", + "@typescript-eslint/scope-manager": "8.11.0", + "@typescript-eslint/type-utils": "8.11.0", + "@typescript-eslint/utils": "8.11.0", + "@typescript-eslint/visitor-keys": "8.11.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -1761,15 +1763,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.9.0.tgz", - "integrity": "sha512-U+BLn2rqTTHnc4FL3FJjxaXptTxmf9sNftJK62XLz4+GxG3hLHm/SUNaaXP5Y4uTiuYoL5YLy4JBCJe3+t8awQ==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.11.0.tgz", + "integrity": "sha512-lmt73NeHdy1Q/2ul295Qy3uninSqi6wQI18XwSpm8w0ZbQXUpjCAWP1Vlv/obudoBiIjJVjlztjQ+d/Md98Yxg==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "8.9.0", - "@typescript-eslint/types": "8.9.0", - "@typescript-eslint/typescript-estree": "8.9.0", - "@typescript-eslint/visitor-keys": "8.9.0", + "@typescript-eslint/scope-manager": "8.11.0", + "@typescript-eslint/types": "8.11.0", + "@typescript-eslint/typescript-estree": "8.11.0", + "@typescript-eslint/visitor-keys": "8.11.0", "debug": "^4.3.4" }, "engines": { @@ -1789,13 +1791,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.9.0.tgz", - "integrity": "sha512-bZu9bUud9ym1cabmOYH9S6TnbWRzpklVmwqICeOulTCZ9ue2/pczWzQvt/cGj2r2o1RdKoZbuEMalJJSYw3pHQ==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.11.0.tgz", + "integrity": "sha512-Uholz7tWhXmA4r6epo+vaeV7yjdKy5QFCERMjs1kMVsLRKIrSdM6o21W2He9ftp5PP6aWOVpD5zvrvuHZC0bMQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.9.0", - "@typescript-eslint/visitor-keys": "8.9.0" + "@typescript-eslint/types": "8.11.0", + "@typescript-eslint/visitor-keys": "8.11.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1806,13 +1808,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.9.0.tgz", - "integrity": "sha512-JD+/pCqlKqAk5961vxCluK+clkppHY07IbV3vett97KOV+8C6l+CPEPwpUuiMwgbOz/qrN3Ke4zzjqbT+ls+1Q==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.11.0.tgz", + "integrity": "sha512-ItiMfJS6pQU0NIKAaybBKkuVzo6IdnAhPFZA/2Mba/uBjuPQPet/8+zh5GtLHwmuFRShZx+8lhIs7/QeDHflOg==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "8.9.0", - "@typescript-eslint/utils": "8.9.0", + "@typescript-eslint/typescript-estree": "8.11.0", + "@typescript-eslint/utils": "8.11.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -1830,9 +1832,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.9.0.tgz", - "integrity": "sha512-SjgkvdYyt1FAPhU9c6FiYCXrldwYYlIQLkuc+LfAhCna6ggp96ACncdtlbn8FmnG72tUkXclrDExOpEYf1nfJQ==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.11.0.tgz", + "integrity": "sha512-tn6sNMHf6EBAYMvmPUaKaVeYvhUsrE6x+bXQTxjQRp360h1giATU0WvgeEys1spbvb5R+VpNOZ+XJmjD8wOUHw==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1843,13 +1845,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.9.0.tgz", - "integrity": "sha512-9iJYTgKLDG6+iqegehc5+EqE6sqaee7kb8vWpmHZ86EqwDjmlqNNHeqDVqb9duh+BY6WCNHfIGvuVU3Tf9Db0g==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.11.0.tgz", + "integrity": "sha512-yHC3s1z1RCHoCz5t06gf7jH24rr3vns08XXhfEqzYpd6Hll3z/3g23JRi0jM8A47UFKNc3u/y5KIMx8Ynbjohg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.9.0", - "@typescript-eslint/visitor-keys": "8.9.0", + "@typescript-eslint/types": "8.11.0", + "@typescript-eslint/visitor-keys": "8.11.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -1883,15 +1885,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.9.0.tgz", - "integrity": "sha512-PKgMmaSo/Yg/F7kIZvrgrWa1+Vwn036CdNUvYFEkYbPwOH4i8xvkaRlu148W3vtheWK9ckKRIz7PBP5oUlkrvQ==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.11.0.tgz", + "integrity": "sha512-CYiX6WZcbXNJV7UNB4PLDIBtSdRmRI/nb0FMyqHPTQD1rMjA0foPLaPUV39C/MxkTd/QKSeX+Gb34PPsDVC35g==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.9.0", - "@typescript-eslint/types": "8.9.0", - "@typescript-eslint/typescript-estree": "8.9.0" + "@typescript-eslint/scope-manager": "8.11.0", + "@typescript-eslint/types": "8.11.0", + "@typescript-eslint/typescript-estree": "8.11.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1905,12 +1907,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.9.0.tgz", - "integrity": "sha512-Ht4y38ubk4L5/U8xKUBfKNYGmvKvA1CANoxiTRMM+tOLk3lbF3DvzZCxJCRSE+2GdCMSh6zq9VZJc3asc1XuAA==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.11.0.tgz", + "integrity": "sha512-EaewX6lxSjRJnc+99+dqzTeoDZUfyrA52d2/HRrkI830kgovWsmIiTfmr0NZorzqic7ga+1bS60lRBUgR3n/Bw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.9.0", + "@typescript-eslint/types": "8.11.0", "eslint-visitor-keys": "^3.4.3" }, "engines": { @@ -1927,13 +1929,14 @@ "license": "ISC" }, "node_modules/@vitejs/plugin-react": { - "version": "4.3.1", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.3.3.tgz", + "integrity": "sha512-NooDe9GpHGqNns1i8XDERg0Vsg5SSYRhRxxyTGogUdkdNt47jal+fbuYi+Yfq6pzRCKXyoPcWisfxE6RIM3GKA==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/core": "^7.24.5", - "@babel/plugin-transform-react-jsx-self": "^7.24.5", - "@babel/plugin-transform-react-jsx-source": "^7.24.1", + "@babel/core": "^7.25.2", + "@babel/plugin-transform-react-jsx-self": "^7.24.7", + "@babel/plugin-transform-react-jsx-source": "^7.24.7", "@types/babel__core": "^7.20.5", "react-refresh": "^0.14.2" }, @@ -2393,9 +2396,9 @@ } }, "node_modules/eslint-plugin-react-refresh": { - "version": "0.4.12", - "resolved": "https://registry.npmjs.org/eslint-plugin-react-refresh/-/eslint-plugin-react-refresh-0.4.12.tgz", - "integrity": "sha512-9neVjoGv20FwYtCP6CB1dzR1vr57ZDNOXst21wd2xJ/cTlM2xLq0GWVlSNTdMn/4BtP6cHYBMCSp1wFBJ9jBsg==", + "version": "0.4.13", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-refresh/-/eslint-plugin-react-refresh-0.4.13.tgz", + "integrity": "sha512-f1EppwrpJRWmqDTyvAyomFVDYRtrS7iTEqv3nokETnMiMzs2SSTmKRTACce4O2p4jYyowiSMvpdwC/RLcMFhuQ==", "dev": true, "peerDependencies": { "eslint": ">=7" @@ -3221,12 +3224,12 @@ } }, "node_modules/playwright": { - "version": "1.48.0", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.48.0.tgz", - "integrity": "sha512-qPqFaMEHuY/ug8o0uteYJSRfMGFikhUysk8ZvAtfKmUK3kc/6oNl/y3EczF8OFGYIi/Ex2HspMfzYArk6+XQSA==", + "version": "1.48.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.48.1.tgz", + "integrity": "sha512-j8CiHW/V6HxmbntOfyB4+T/uk08tBy6ph0MpBXwuoofkSnLmlfdYNNkFTYD6ofzzlSqLA1fwH4vwvVFvJgLN0w==", "dev": true, "dependencies": { - "playwright-core": "1.48.0" + "playwright-core": "1.48.1" }, "bin": { "playwright": "cli.js" @@ -3239,9 +3242,9 @@ } }, "node_modules/playwright-core": { - "version": "1.48.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.48.0.tgz", - "integrity": "sha512-RBvzjM9rdpP7UUFrQzRwR8L/xR4HyC1QXMzGYTbf1vjw25/ya9NRAVnXi/0fvFopjebvyPzsmoK58xxeEOaVvA==", + "version": "1.48.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.48.1.tgz", + "integrity": "sha512-Yw/t4VAFX/bBr1OzwCuOMZkY1Cnb4z/doAFSwf4huqAGWmf9eMNjmK7NiOljCdLmxeRYcGPPmcDgU0zOlzP0YA==", "dev": true, "bin": { "playwright-core": "cli.js" @@ -3499,9 +3502,9 @@ } }, "node_modules/sass-embedded": { - "version": "1.79.5", - "resolved": "https://registry.npmjs.org/sass-embedded/-/sass-embedded-1.79.5.tgz", - "integrity": "sha512-QFdalnjGFkbNvb6/uQGmP4OIN+GQ5/R77eu0PsXduDB1YP5JW5DSWFVDAyK6l6C54P+3J3eXkjuPYC0mcwX+AA==", + "version": "1.80.3", + "resolved": "https://registry.npmjs.org/sass-embedded/-/sass-embedded-1.80.3.tgz", + "integrity": "sha512-aTxTl4ToSAWg7ILFgAe+kMenj+zNlwHmHK/ZNPrOM8+HTef1Q6zuxolptYLijmHdZHKSMOkWYHgo5MMN6+GIyg==", "dev": true, "dependencies": { "@bufbuild/protobuf": "^2.0.0", @@ -3519,32 +3522,32 @@ "node": ">=16.0.0" }, "optionalDependencies": { - "sass-embedded-android-arm": "1.79.5", - "sass-embedded-android-arm64": "1.79.5", - "sass-embedded-android-ia32": "1.79.5", - "sass-embedded-android-riscv64": "1.79.5", - "sass-embedded-android-x64": "1.79.5", - "sass-embedded-darwin-arm64": "1.79.5", - "sass-embedded-darwin-x64": "1.79.5", - "sass-embedded-linux-arm": "1.79.5", - "sass-embedded-linux-arm64": "1.79.5", - "sass-embedded-linux-ia32": "1.79.5", - "sass-embedded-linux-musl-arm": "1.79.5", - "sass-embedded-linux-musl-arm64": "1.79.5", - "sass-embedded-linux-musl-ia32": "1.79.5", - "sass-embedded-linux-musl-riscv64": "1.79.5", - "sass-embedded-linux-musl-x64": "1.79.5", - "sass-embedded-linux-riscv64": "1.79.5", - "sass-embedded-linux-x64": "1.79.5", - "sass-embedded-win32-arm64": "1.79.5", - "sass-embedded-win32-ia32": "1.79.5", - "sass-embedded-win32-x64": "1.79.5" + "sass-embedded-android-arm": "1.80.3", + "sass-embedded-android-arm64": "1.80.3", + "sass-embedded-android-ia32": "1.80.3", + "sass-embedded-android-riscv64": "1.80.3", + "sass-embedded-android-x64": "1.80.3", + "sass-embedded-darwin-arm64": "1.80.3", + "sass-embedded-darwin-x64": "1.80.3", + "sass-embedded-linux-arm": "1.80.3", + "sass-embedded-linux-arm64": "1.80.3", + "sass-embedded-linux-ia32": "1.80.3", + "sass-embedded-linux-musl-arm": "1.80.3", + "sass-embedded-linux-musl-arm64": "1.80.3", + "sass-embedded-linux-musl-ia32": "1.80.3", + "sass-embedded-linux-musl-riscv64": "1.80.3", + "sass-embedded-linux-musl-x64": "1.80.3", + "sass-embedded-linux-riscv64": "1.80.3", + "sass-embedded-linux-x64": "1.80.3", + "sass-embedded-win32-arm64": "1.80.3", + "sass-embedded-win32-ia32": "1.80.3", + "sass-embedded-win32-x64": "1.80.3" } }, "node_modules/sass-embedded-android-arm": { - "version": "1.79.5", - "resolved": "https://registry.npmjs.org/sass-embedded-android-arm/-/sass-embedded-android-arm-1.79.5.tgz", - "integrity": "sha512-gYtpQAE2uNFa5IBKBIzUq5ETDS6gnVRmhP5j+N5JGrOThYaGPcG4KrjlU9R3BfCmc7zP5WvlHFZsxSz+2JRT2w==", + "version": "1.80.3", + "resolved": "https://registry.npmjs.org/sass-embedded-android-arm/-/sass-embedded-android-arm-1.80.3.tgz", + "integrity": "sha512-i87crav7sfShzY7AyUneXvs4SWdJ93QlYIpo/2OQPTJV5MjJF8wUp0o9NT8Oo6sUJ26kfgsb64FwqQh1wO5uBg==", "cpu": [ "arm" ], @@ -3558,9 +3561,9 @@ } }, "node_modules/sass-embedded-android-arm64": { - "version": "1.79.5", - "resolved": "https://registry.npmjs.org/sass-embedded-android-arm64/-/sass-embedded-android-arm64-1.79.5.tgz", - "integrity": "sha512-pq1RJTENkRmEUMLiVuSGYwuLk8zXovWzrjQxlWZTF/Jn5F7Ypi/3v5huMmgJF5n+etsxjio1PN1idaQ5tPLBmg==", + "version": "1.80.3", + "resolved": "https://registry.npmjs.org/sass-embedded-android-arm64/-/sass-embedded-android-arm64-1.80.3.tgz", + "integrity": "sha512-uaEKdi+PaFc1V87vj2eCUB8B2ThNvEYYu9Qs5sCtx1atEQDtvp/smHYlXOVrg2M4+g2YASkDBQewyk+auZtG0g==", "cpu": [ "arm64" ], @@ -3574,9 +3577,9 @@ } }, "node_modules/sass-embedded-android-ia32": { - "version": "1.79.5", - "resolved": "https://registry.npmjs.org/sass-embedded-android-ia32/-/sass-embedded-android-ia32-1.79.5.tgz", - "integrity": "sha512-CgJZjLxYRkgjTP/76WumLlF7+1aW0LA+DSEJhkVaCxe5avndRCmPrNcX0PrtYSDvUgeQDvY7xF+fT9QXN1+NgQ==", + "version": "1.80.3", + "resolved": "https://registry.npmjs.org/sass-embedded-android-ia32/-/sass-embedded-android-ia32-1.80.3.tgz", + "integrity": "sha512-XCa4Se7vqWuV5tFLZuYWidPLUCeK7n1AgugircJl/9QPThCGZ2mSRF0Ipj3lv+Qw4GG9kkhCqJIrksTGbSFypw==", "cpu": [ "ia32" ], @@ -3590,9 +3593,9 @@ } }, "node_modules/sass-embedded-android-riscv64": { - "version": "1.79.5", - "resolved": "https://registry.npmjs.org/sass-embedded-android-riscv64/-/sass-embedded-android-riscv64-1.79.5.tgz", - "integrity": "sha512-OLbdmDSM/eOjO01PUYbS54BQOCM/HHHHWk/4M8HHdxwF3ojy5eqQaA63R1YQ3IJvLEE7dnudofOXmL01B5+yvQ==", + "version": "1.80.3", + "resolved": "https://registry.npmjs.org/sass-embedded-android-riscv64/-/sass-embedded-android-riscv64-1.80.3.tgz", + "integrity": "sha512-Dn3hYh5rchfivnPrHoff2pWutuFYJRddzEXcjfb0JhgF7JmTA/6Dxaym0pqVpS1RmYDiAYnmoX5OeFtEkdVytA==", "cpu": [ "riscv64" ], @@ -3606,9 +3609,9 @@ } }, "node_modules/sass-embedded-android-x64": { - "version": "1.79.5", - "resolved": "https://registry.npmjs.org/sass-embedded-android-x64/-/sass-embedded-android-x64-1.79.5.tgz", - "integrity": "sha512-UbXxk/rdR3aVBkB7Fh/eAUL7oUADWgQrYpLe9Xu5A0gmthw0/zo/pu7kweBSrbgHnPfWIt/uxwmW4eEAmqqZWQ==", + "version": "1.80.3", + "resolved": "https://registry.npmjs.org/sass-embedded-android-x64/-/sass-embedded-android-x64-1.80.3.tgz", + "integrity": "sha512-QWOTHKPznYJnrP3HrlFYnAQOZ/c2am4ctK1cFIMtjQNGaFra8z94LZSQzAd6eeu6mITKwQbJuff36RpICZpgHA==", "cpu": [ "x64" ], @@ -3622,9 +3625,9 @@ } }, "node_modules/sass-embedded-darwin-arm64": { - "version": "1.79.5", - "resolved": "https://registry.npmjs.org/sass-embedded-darwin-arm64/-/sass-embedded-darwin-arm64-1.79.5.tgz", - "integrity": "sha512-qeEl9XhYetZSY1j4nqvh3hB8tfYOAGsOQyVOCaxyX1bubMRSGPvPNIyftm14QzK7EDrE/K/0+FwCvflarOV4NQ==", + "version": "1.80.3", + "resolved": "https://registry.npmjs.org/sass-embedded-darwin-arm64/-/sass-embedded-darwin-arm64-1.80.3.tgz", + "integrity": "sha512-NqJXHzZGqVOarr36X5MIv0UCQHYVhOFXGe7kDhNqMQCiNApkVydseB5TM1C2lVaiWy2JaseRD/dUNS/o2ICKXw==", "cpu": [ "arm64" ], @@ -3638,9 +3641,9 @@ } }, "node_modules/sass-embedded-darwin-x64": { - "version": "1.79.5", - "resolved": "https://registry.npmjs.org/sass-embedded-darwin-x64/-/sass-embedded-darwin-x64-1.79.5.tgz", - "integrity": "sha512-y4pvkYCQhgruxlncub/2j+cZSmlpsZX9Rp1aTRIKvlNagqFStYzFZ6kX3CErlfCEAMYwRVEhP8z/OOoDqnjaZA==", + "version": "1.80.3", + "resolved": "https://registry.npmjs.org/sass-embedded-darwin-x64/-/sass-embedded-darwin-x64-1.80.3.tgz", + "integrity": "sha512-6dmNn+oNxXE5uGThfAsHgz7Jg1oDhXHHQyPAnIIaMOM5dXv0D/nLmrlFbFajK0HtbzGaTVBTE6wkJwjASuP0Uw==", "cpu": [ "x64" ], @@ -3654,9 +3657,9 @@ } }, "node_modules/sass-embedded-linux-arm": { - "version": "1.79.5", - "resolved": "https://registry.npmjs.org/sass-embedded-linux-arm/-/sass-embedded-linux-arm-1.79.5.tgz", - "integrity": "sha512-rX6qAR8pE1pevYhGzbCpGFexdH4z6QMnw3IeiCNmkpJ4zMXNEN336xl6SZN0xaPiGuNDhUFcq0wgSq3RDKS5vQ==", + "version": "1.80.3", + "resolved": "https://registry.npmjs.org/sass-embedded-linux-arm/-/sass-embedded-linux-arm-1.80.3.tgz", + "integrity": "sha512-nZ7Y8gZgr+/fYrbsX3L8BfIafWXGVBcc0gKLoujad+axlFGv1MetO17S3vzrOQ1wuhjvDLVxceA/jtcta1qxoA==", "cpu": [ "arm" ], @@ -3670,9 +3673,9 @@ } }, "node_modules/sass-embedded-linux-arm64": { - "version": "1.79.5", - "resolved": "https://registry.npmjs.org/sass-embedded-linux-arm64/-/sass-embedded-linux-arm64-1.79.5.tgz", - "integrity": "sha512-kiUbrLiNAA7vOe6kpdukRhCad1u7ebwhB0ZE63+IgF5HFZ/Qo6GkhHIrVM9AfeLxUT3N6Z4BNtgdcRa9na4Pwg==", + "version": "1.80.3", + "resolved": "https://registry.npmjs.org/sass-embedded-linux-arm64/-/sass-embedded-linux-arm64-1.80.3.tgz", + "integrity": "sha512-a9IILen4I6oFFb5qMHOiFqIAoztPuvJ6VHNaFbktP8SUvH4FX63ZutR/qKisN9DoudzSXMZijv/aG/bTh0Kccw==", "cpu": [ "arm64" ], @@ -3686,9 +3689,9 @@ } }, "node_modules/sass-embedded-linux-ia32": { - "version": "1.79.5", - "resolved": "https://registry.npmjs.org/sass-embedded-linux-ia32/-/sass-embedded-linux-ia32-1.79.5.tgz", - "integrity": "sha512-12pj3fBV0+VAX/RI6uYFxi/MoUoihRKP7iVpo9MaT/m+EtvN6mYsDpi/T4pTq2dKQYljoaFq8Rb6tR+FinS1zg==", + "version": "1.80.3", + "resolved": "https://registry.npmjs.org/sass-embedded-linux-ia32/-/sass-embedded-linux-ia32-1.80.3.tgz", + "integrity": "sha512-yKy4N0L9WfGokpBMHOhxzaS3jyzrHUg1+5Idi6J88onwxfpEhqOgdMcoqgOqvryMPrmKN7kW5d3iNpUYOniPnw==", "cpu": [ "ia32" ], @@ -3702,9 +3705,9 @@ } }, "node_modules/sass-embedded-linux-musl-arm": { - "version": "1.79.5", - "resolved": "https://registry.npmjs.org/sass-embedded-linux-musl-arm/-/sass-embedded-linux-musl-arm-1.79.5.tgz", - "integrity": "sha512-EHFrbTgRymEFTf3JnjHzC24PO0WHFjLUEWUJqSuWKZw0+BCL7120MvYIrfkYymPp5UYk+STIjj+Fd9dYSWBrAg==", + "version": "1.80.3", + "resolved": "https://registry.npmjs.org/sass-embedded-linux-musl-arm/-/sass-embedded-linux-musl-arm-1.80.3.tgz", + "integrity": "sha512-yB7iSoS/phNHKFsZRW0rTRwoCTtOBELG/UYpIa2qATWZsDASSjdBitGsKS3nEliweveuGIVlUqG2kUKaq9M39g==", "cpu": [ "arm" ], @@ -3718,9 +3721,9 @@ } }, "node_modules/sass-embedded-linux-musl-arm64": { - "version": "1.79.5", - "resolved": "https://registry.npmjs.org/sass-embedded-linux-musl-arm64/-/sass-embedded-linux-musl-arm64-1.79.5.tgz", - "integrity": "sha512-Qg1HuQ+ebz3wfPT7xty2G8BpDLXdyfMk7WqKd+X1DlFEcY/kcNapwMVFXS2fCYTTR3gcbIZ4p7eUiQySlkj93A==", + "version": "1.80.3", + "resolved": "https://registry.npmjs.org/sass-embedded-linux-musl-arm64/-/sass-embedded-linux-musl-arm64-1.80.3.tgz", + "integrity": "sha512-mw4BPe42wlAwg6vgmGkg+MDDyXZBexvAWC+QigtfMjTVHuSAB527UVWhIyv4jAkKLp71mPowsXXsfa4UHzyBaA==", "cpu": [ "arm64" ], @@ -3734,9 +3737,9 @@ } }, "node_modules/sass-embedded-linux-musl-ia32": { - "version": "1.79.5", - "resolved": "https://registry.npmjs.org/sass-embedded-linux-musl-ia32/-/sass-embedded-linux-musl-ia32-1.79.5.tgz", - "integrity": "sha512-2qdsGIcdCnpsw8Ijuq8uk4RifxV/lTd1mqjrfge7AfFBtQIExbxZoYBtbSrcY63ONa+UWEf9Z1p6rZ3QySKWlg==", + "version": "1.80.3", + "resolved": "https://registry.npmjs.org/sass-embedded-linux-musl-ia32/-/sass-embedded-linux-musl-ia32-1.80.3.tgz", + "integrity": "sha512-eyg5L9IFisCYYMXEZ/56X8k8wdhpfK06/j9MFAINE9U4C5NxQXrVWmMTEqgyfpmca8hziBlvbRrjdquteyXWfw==", "cpu": [ "ia32" ], @@ -3750,9 +3753,9 @@ } }, "node_modules/sass-embedded-linux-musl-riscv64": { - "version": "1.79.5", - "resolved": "https://registry.npmjs.org/sass-embedded-linux-musl-riscv64/-/sass-embedded-linux-musl-riscv64-1.79.5.tgz", - "integrity": "sha512-wrc6s8YQt95koSkaLoP5HtvAAKxTPWqYZVxnoqp2bHgkKWlr4ymJll9vMcdU3//VxTgJbuH83U5ajzNCtHd0NQ==", + "version": "1.80.3", + "resolved": "https://registry.npmjs.org/sass-embedded-linux-musl-riscv64/-/sass-embedded-linux-musl-riscv64-1.80.3.tgz", + "integrity": "sha512-0VThiW7Gwo5UNgKyETYID6F2prHvOCH8fQQKM0sS/JSbTu1poTwD35yEptVxBpiTvyWwxI7K5Cbn0gtxobaqzA==", "cpu": [ "riscv64" ], @@ -3766,9 +3769,9 @@ } }, "node_modules/sass-embedded-linux-musl-x64": { - "version": "1.79.5", - "resolved": "https://registry.npmjs.org/sass-embedded-linux-musl-x64/-/sass-embedded-linux-musl-x64-1.79.5.tgz", - "integrity": "sha512-1J6JrGpVp07GsBEzEGj/9u6UkVUuga2U7kpfkQxIdYOLmXmXmni6zNx89VehaP7X5OSscwJc/Zufh++6VcRQHw==", + "version": "1.80.3", + "resolved": "https://registry.npmjs.org/sass-embedded-linux-musl-x64/-/sass-embedded-linux-musl-x64-1.80.3.tgz", + "integrity": "sha512-ALSKlhTQdNS0cayyaXD8huNd+DRjWgCjDqyjvwSgemfLL+wtmVCO8h9rGu1MCwR8GHP6ceZCT2fBmjfcGHk0DQ==", "cpu": [ "x64" ], @@ -3782,9 +3785,9 @@ } }, "node_modules/sass-embedded-linux-riscv64": { - "version": "1.79.5", - "resolved": "https://registry.npmjs.org/sass-embedded-linux-riscv64/-/sass-embedded-linux-riscv64-1.79.5.tgz", - "integrity": "sha512-G45UKRAUgvxXhLROowTgVmyIVyGtRZoCMVH1vPi0EG5SePy43AkhjQVaUb6Ol6lfRRNpQqBFKw3UabxaMCM0Ow==", + "version": "1.80.3", + "resolved": "https://registry.npmjs.org/sass-embedded-linux-riscv64/-/sass-embedded-linux-riscv64-1.80.3.tgz", + "integrity": "sha512-/1JvuQi137BNO7iTvNNraGYEt9mh3ch44cabJBTxLn3IZV5vNblENI+Hrj9J8/VWIsJumwPQGZSUrMbZcgB0tg==", "cpu": [ "riscv64" ], @@ -3798,9 +3801,9 @@ } }, "node_modules/sass-embedded-linux-x64": { - "version": "1.79.5", - "resolved": "https://registry.npmjs.org/sass-embedded-linux-x64/-/sass-embedded-linux-x64-1.79.5.tgz", - "integrity": "sha512-EOk6pULzxM9b5B8uuuZbQXqfg2BQheAovQeYAw4ueHikaFoESOfaA8OG4kl0v1m5v5tKqAHOjy7xFhtpbEpqEw==", + "version": "1.80.3", + "resolved": "https://registry.npmjs.org/sass-embedded-linux-x64/-/sass-embedded-linux-x64-1.80.3.tgz", + "integrity": "sha512-ISQUnl9oFA0PFPtgOpgotfKQ8guUBIYcTpkHEF9lQ4PyFIxkXppk5CwQ8l0VQcQaKhOD2HQAucoqM51U7FABqA==", "cpu": [ "x64" ], @@ -3814,9 +3817,9 @@ } }, "node_modules/sass-embedded-win32-arm64": { - "version": "1.79.5", - "resolved": "https://registry.npmjs.org/sass-embedded-win32-arm64/-/sass-embedded-win32-arm64-1.79.5.tgz", - "integrity": "sha512-KdkJOmJSe5lhR4Kxn522GbZo4jRUnQ+V4JQSaIbyxKndBpD81NGPYhDs0ikpJciqrwbmiBxVD5Qqeim6B1gdxA==", + "version": "1.80.3", + "resolved": "https://registry.npmjs.org/sass-embedded-win32-arm64/-/sass-embedded-win32-arm64-1.80.3.tgz", + "integrity": "sha512-RFT/OsWHVagPYa/9v+KfVM99QgzwzwnT2maapRfulEH39v0uPGOIFNXmnhaN3E5gNLIjIn3CTnR9KjTC145E8Q==", "cpu": [ "arm64" ], @@ -3830,9 +3833,9 @@ } }, "node_modules/sass-embedded-win32-ia32": { - "version": "1.79.5", - "resolved": "https://registry.npmjs.org/sass-embedded-win32-ia32/-/sass-embedded-win32-ia32-1.79.5.tgz", - "integrity": "sha512-1YX4TVw6j3eqxRyPK3t45V5WSyAzql6EgKIEtjPQ0+ByRyqLRuHXlotHPX6KOcc0rA3LMUHmdskN1o08sRIDhA==", + "version": "1.80.3", + "resolved": "https://registry.npmjs.org/sass-embedded-win32-ia32/-/sass-embedded-win32-ia32-1.80.3.tgz", + "integrity": "sha512-Is0eeX+UlWW7yPfDqc2Z2n9ql2rkA1uDaAkbHWWx5APc8CKYtds1w4B3Tyoy6lHnopEifgzgsnp6QSyOHHzPBg==", "cpu": [ "ia32" ], @@ -3846,9 +3849,9 @@ } }, "node_modules/sass-embedded-win32-x64": { - "version": "1.79.5", - "resolved": "https://registry.npmjs.org/sass-embedded-win32-x64/-/sass-embedded-win32-x64-1.79.5.tgz", - "integrity": "sha512-8Tj9hBpOd6e+j23uTDecFb1ezQhvjQ+jvgKdVg9VlvwKUWmEStnHKA0x1uIQTThIM3dLCsYe63b/wX43gP8tBA==", + "version": "1.80.3", + "resolved": "https://registry.npmjs.org/sass-embedded-win32-x64/-/sass-embedded-win32-x64-1.80.3.tgz", + "integrity": "sha512-wehVA0atPloc6NKof/ctpW0agM+k7kiBLIpQs3/mi9FAlmTjxNnvntBPZIbl8n7AAExiLEir+x/LHC0yGhTfkg==", "cpu": [ "x64" ], @@ -4113,7 +4116,8 @@ }, "node_modules/use-sync-external-store": { "version": "1.2.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.2.tgz", + "integrity": "sha512-PElTlVMwpblvbNqQ82d2n6RjStvdSoNe9FG28kNfz3WiXilJm4DdNkEzRhCZuIDwY8U08WVihhGR5iRqAwfDiw==", "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0" } diff --git a/package.json b/package.json index 0f2c8ea..12161c7 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "type": "git", "url": "https://github.com/codex-storage/codex-marketplace-ui" }, - "version": "0.0.6", + "version": "0.0.7", "type": "module", "scripts": { "dev": "vite --host 127.0.0.1 --port 5173", @@ -24,7 +24,7 @@ "React" ], "dependencies": { - "@codex-storage/marketplace-ui-components": "^0.0.20", + "@codex-storage/marketplace-ui-components": "^0.0.24", "@codex-storage/sdk-js": "^0.0.8", "@sentry/browser": "^8.32.0", "@sentry/react": "^8.31.0", diff --git a/src/components/CodexUrllSettings/CodexUrlSettings.tsx b/src/components/CodexUrllSettings/CodexUrlSettings.tsx index 5ca6419..31bfe5d 100644 --- a/src/components/CodexUrllSettings/CodexUrlSettings.tsx +++ b/src/components/CodexUrllSettings/CodexUrlSettings.tsx @@ -6,6 +6,7 @@ import { CodexSdk } from "../../sdk/codex"; export function CodexUrlSettings() { const queryClient = useQueryClient(); const [url, setUrl] = useState(CodexSdk.url); + const [isInvalid, setIsInvalid] = useState(false); const [toast, setToast] = useState({ time: 0, message: "" }); const { mutateAsync } = useMutation({ mutationFn: (url: string) => CodexSdk.updateURL(url), @@ -17,23 +18,37 @@ export function CodexUrlSettings() { }); const onChange = (e: React.FormEvent) => { - const value = e.currentTarget.value; - if (value) { - setUrl(value); - } + const element = e.currentTarget; + const value = element.value; + + setUrl(value); + setIsInvalid(!element.checkValidity()); }; - const onClick = () => mutateAsync(url); + const onClick = () => { + if (isInvalid === false) { + mutateAsync(url); + } + }; return ( <> - - +
+ +
+ ); diff --git a/src/components/Download/Download.tsx b/src/components/Download/Download.tsx index 5ba8b44..e6b19af 100644 --- a/src/components/Download/Download.tsx +++ b/src/components/Download/Download.tsx @@ -7,7 +7,7 @@ export function Download() { const [cid, setCid] = useState(""); const onDownload = () => { const url = CodexSdk.url() + "/api/codex/v1/data/"; - window.open(url + cid + "/network", "_target"); + window.open(url + cid + "/network/stream", "_target"); }; const onCidChange = (e: ChangeEvent) => diff --git a/src/components/Peers/PeerCountryCell.tsx b/src/components/Peers/PeerCountryCell.tsx index 48e8419..0737655 100644 --- a/src/components/Peers/PeerCountryCell.tsx +++ b/src/components/Peers/PeerCountryCell.tsx @@ -1,6 +1,5 @@ import { Cell } from "@codex-storage/marketplace-ui-components"; import { PeerPin } from "./types"; -import { countriesCoordinates } from "./countries"; import { useQuery } from "@tanstack/react-query"; import "./PeerCountryCell.css"; import { useEffect } from "react"; @@ -23,11 +22,9 @@ export function PeerCountryCell({ address, onPinAdd }: Props) { queryFn: () => { const [ip] = address.split(":"); - return fetch(import.meta.env.VITE_GEO_IP_URL + "/" + ip) - .then((res) => res.json()) - .then((json) => - countriesCoordinates.find((c) => c.iso === json.country) - ); + return fetch(import.meta.env.VITE_GEO_IP_URL + "/json?ip=" + ip).then( + (res) => res.json() + ); }, refetchOnMount: true, @@ -51,8 +48,8 @@ export function PeerCountryCell({ address, onPinAdd }: Props) { useEffect(() => { if (data) { onPinAdd({ - lat: parseFloat(data.lat), - lng: parseFloat(data.lng), + lat: data.latitude, + lng: data.longitude, }); } }, [data]); @@ -62,8 +59,8 @@ export function PeerCountryCell({ address, onPinAdd }: Props) {
{data ? ( <> - {!!data && getFlagEmoji(data.iso)} - {data?.name} + {!!data && getFlagEmoji(data.country_iso)} + {data?.country} ) : ( {address} diff --git a/src/components/Peers/countries.ts b/src/components/Peers/countries.ts deleted file mode 100644 index 3d001d8..0000000 --- a/src/components/Peers/countries.ts +++ /dev/null @@ -1,1563 +0,0 @@ -export const countriesCoordinates = [ - { - "iso": "AF", - "lat": "33", - "lng": "65", - "name": "Afghanistan" - }, - { - "iso": "AX", - "lat": "60.116667", - "lng": "19.9", - "name": "Åland Islands" - }, - { - "iso": "AL", - "lat": "41", - "lng": "20", - "name": "Albania" - }, - { - "iso": "DZ", - "lat": "28", - "lng": "3", - "name": "Algeria" - }, - { - "iso": "AS", - "lat": "-14.3333", - "lng": "-170", - "name": "American Samoa" - }, - { - "iso": "AD", - "lat": "42.5", - "lng": "1.6", - "name": "Andorra" - }, - { - "iso": "AO", - "lat": "-12.5", - "lng": "18.5", - "name": "Angola" - }, - { - "iso": "AI", - "lat": "18.25", - "lng": "-63.1667", - "name": "Anguilla" - }, - { - "iso": "AQ", - "lat": "-90", - "lng": "0", - "name": "Antarctica" - }, - { - "iso": "AG", - "lat": "17.05", - "lng": "-61.8", - "name": "Antigua and Barbuda" - }, - { - "iso": "AR", - "lat": "-34", - "lng": "-64", - "name": "Argentina" - }, - { - "iso": "AM", - "lat": "40", - "lng": "45", - "name": "Armenia" - }, - { - "iso": "AW", - "lat": "12.5", - "lng": "-69.9667", - "name": "Aruba" - }, - { - "iso": "AU", - "lat": "-27", - "lng": "133", - "name": "Australia" - }, - { - "iso": "AT", - "lat": "47.3333", - "lng": "13.3333", - "name": "Austria" - }, - { - "iso": "AZ", - "lat": "40.5", - "lng": "47.5", - "name": "Azerbaijan" - }, - { - "iso": "BS", - "lat": "24.25", - "lng": "-76", - "name": "Bahamas" - }, - { - "iso": "BH", - "lat": "26", - "lng": "50.55", - "name": "Bahrain" - }, - { - "iso": "BD", - "lat": "24", - "lng": "90", - "name": "Bangladesh" - }, - { - "iso": "BB", - "lat": "13.1667", - "lng": "-59.5333", - "name": "Barbados" - }, - { - "iso": "BY", - "lat": "53", - "lng": "28", - "name": "Belarus" - }, - { - "iso": "BE", - "lat": "50.8333", - "lng": "4", - "name": "Belgium" - }, - { - "iso": "BZ", - "lat": "17.25", - "lng": "-88.75", - "name": "Belize" - }, - { - "iso": "BJ", - "lat": "9.5", - "lng": "2.25", - "name": "Benin" - }, - { - "iso": "BM", - "lat": "32.3333", - "lng": "-64.75", - "name": "Bermuda" - }, - { - "iso": "BT", - "lat": "27.5", - "lng": "90.5", - "name": "Bhutan" - }, - { - "iso": "Plurinational State of", - "lat": "68", - "lng": "-17" - }, - { - "iso": "BO", - "lat": "-17", - "lng": "-65", - "name": "Bolivia, Plurinational State of" - }, - { - "iso": "Sint Eustatius and Saba", - "lat": "535", - "lng": "12.183333" - }, - { - "iso": "BA", - "lat": "44", - "lng": "18", - "name": "Bosnia and Herzegovina" - }, - { - "iso": "BW", - "lat": "-22", - "lng": "24", - "name": "Botswana" - }, - { - "iso": "BV", - "lat": "-54.4333", - "lng": "3.4", - "name": "Bouvet Island" - }, - { - "iso": "BR", - "lat": "-10", - "lng": "-55", - "name": "Brazil" - }, - { - "iso": "IO", - "lat": "-6", - "lng": "71.5", - "name": "British Indian Ocean Territory" - }, - { - "iso": "BN", - "lat": "4.5", - "lng": "114.6667", - "name": "Brunei Darussalam" - }, - { - "iso": "BN", - "lat": "4.5", - "lng": "114.6667", - "name": "Brunei Darussalam" - }, - { - "iso": "BG", - "lat": "43", - "lng": "25", - "name": "Bulgaria" - }, - { - "iso": "BF", - "lat": "13", - "lng": "-2", - "name": "Burkina Faso" - }, - { - "iso": "MM", - "lat": "22", - "lng": "98", - "name": "Myanmar" - }, - { - "iso": "BI", - "lat": "-3.5", - "lng": "30", - "name": "Burundi" - }, - { - "iso": "KH", - "lat": "13", - "lng": "105", - "name": "Cambodia" - }, - { - "iso": "CM", - "lat": "6", - "lng": "12", - "name": "Cameroon" - }, - { - "iso": "CA", - "lat": "60", - "lng": "-95", - "name": "Canada" - }, - { - "iso": "CV", - "lat": "16", - "lng": "-24", - "name": "Cape Verde" - }, - { - "iso": "KY", - "lat": "19.5", - "lng": "-80.5", - "name": "Cayman Islands" - }, - { - "iso": "CF", - "lat": "7", - "lng": "21", - "name": "Central African Republic" - }, - { - "iso": "TD", - "lat": "15", - "lng": "19", - "name": "Chad" - }, - { - "iso": "CL", - "lat": "-30", - "lng": "-71", - "name": "Chile" - }, - { - "iso": "CN", - "lat": "35", - "lng": "105", - "name": "China" - }, - { - "iso": "CX", - "lat": "-10.5", - "lng": "105.6667", - "name": "Christmas Island" - }, - { - "iso": "CC", - "lat": "-12.5", - "lng": "96.8333", - "name": "Cocos (Keeling) Islands" - }, - { - "iso": "CO", - "lat": "4", - "lng": "-72", - "name": "Colombia" - }, - { - "iso": "KM", - "lat": "-12.1667", - "lng": "44.25", - "name": "Comoros" - }, - { - "iso": "the Democratic Republic of the", - "lat": "180", - "lng": "0" - }, - { - "iso": "CG", - "lat": "-1", - "lng": "15", - "name": "Congo" - }, - { - "iso": "CK", - "lat": "-21.2333", - "lng": "-159.7667", - "name": "Cook Islands" - }, - { - "iso": "CR", - "lat": "10", - "lng": "-84", - "name": "Costa Rica" - }, - { - "iso": "CI", - "lat": "8", - "lng": "-5", - "name": "Côte d'Ivoire" - }, - { - "iso": "HR", - "lat": "45.1667", - "lng": "15.5", - "name": "Croatia" - }, - { - "iso": "CU", - "lat": "21.5", - "lng": "-80", - "name": "Cuba" - }, - { - "iso": "CW", - "lat": "12.166667", - "lng": "-68.966667", - "name": "Curaçao" - }, - { - "iso": "CY", - "lat": "35", - "lng": "33", - "name": "Cyprus" - }, - { - "iso": "CZ", - "lat": "49.75", - "lng": "15.5", - "name": "Czech Republic" - }, - { - "iso": "DK", - "lat": "56", - "lng": "10", - "name": "Denmark" - }, - { - "iso": "DJ", - "lat": "11.5", - "lng": "43", - "name": "Djibouti" - }, - { - "iso": "DM", - "lat": "15.4167", - "lng": "-61.3333", - "name": "Dominica" - }, - { - "iso": "DO", - "lat": "19", - "lng": "-70.6667", - "name": "Dominican Republic" - }, - { - "iso": "EC", - "lat": "-2", - "lng": "-77.5", - "name": "Ecuador" - }, - { - "iso": "EG", - "lat": "27", - "lng": "30", - "name": "Egypt" - }, - { - "iso": "SV", - "lat": "13.8333", - "lng": "-88.9167", - "name": "El Salvador" - }, - { - "iso": "GQ", - "lat": "2", - "lng": "10", - "name": "Equatorial Guinea" - }, - { - "iso": "ER", - "lat": "15", - "lng": "39", - "name": "Eritrea" - }, - { - "iso": "EE", - "lat": "59", - "lng": "26", - "name": "Estonia" - }, - { - "iso": "ET", - "lat": "8", - "lng": "38", - "name": "Ethiopia" - }, - { - "iso": "FK", - "lat": "-51.75", - "lng": "-59", - "name": "Falkland Islands (Malvinas)" - }, - { - "iso": "FO", - "lat": "62", - "lng": "-7", - "name": "Faroe Islands" - }, - { - "iso": "FJ", - "lat": "-18", - "lng": "175", - "name": "Fiji" - }, - { - "iso": "FI", - "lat": "64", - "lng": "26", - "name": "Finland" - }, - { - "iso": "FR", - "lat": "46", - "lng": "2", - "name": "France" - }, - { - "iso": "GF", - "lat": "4", - "lng": "-53", - "name": "French Guiana" - }, - { - "iso": "PF", - "lat": "-15", - "lng": "-140", - "name": "French Polynesia" - }, - { - "iso": "TF", - "lat": "-43", - "lng": "67", - "name": "French Southern Territories" - }, - { - "iso": "GA", - "lat": "-1", - "lng": "11.75", - "name": "Gabon" - }, - { - "iso": "GM", - "lat": "13.4667", - "lng": "-16.5667", - "name": "Gambia" - }, - { - "iso": "GE", - "lat": "42", - "lng": "43.5", - "name": "Georgia" - }, - { - "iso": "DE", - "lat": "51", - "lng": "9", - "name": "Germany" - }, - { - "iso": "GH", - "lat": "8", - "lng": "-2", - "name": "Ghana" - }, - { - "iso": "GI", - "lat": "36.1833", - "lng": "-5.3667", - "name": "Gibraltar" - }, - { - "iso": "GR", - "lat": "39", - "lng": "22", - "name": "Greece" - }, - { - "iso": "GL", - "lat": "72", - "lng": "-40", - "name": "Greenland" - }, - { - "iso": "GD", - "lat": "12.1167", - "lng": "-61.6667", - "name": "Grenada" - }, - { - "iso": "GP", - "lat": "16.25", - "lng": "-61.5833", - "name": "Guadeloupe" - }, - { - "iso": "GU", - "lat": "13.4667", - "lng": "144.7833", - "name": "Guam" - }, - { - "iso": "GT", - "lat": "15.5", - "lng": "-90.25", - "name": "Guatemala" - }, - { - "iso": "GG", - "lat": "49.5", - "lng": "-2.56", - "name": "Guernsey" - }, - { - "iso": "GW", - "lat": "12", - "lng": "-15", - "name": "Guinea-Bissau" - }, - { - "iso": "GN", - "lat": "11", - "lng": "-10", - "name": "Guinea" - }, - { - "iso": "GY", - "lat": "5", - "lng": "-59", - "name": "Guyana" - }, - { - "iso": "HT", - "lat": "19", - "lng": "-72.4167", - "name": "Haiti" - }, - { - "iso": "HM", - "lat": "-53.1", - "lng": "72.5167", - "name": "Heard Island and McDonald Islands" - }, - { - "iso": "VA", - "lat": "41.9", - "lng": "12.45", - "name": "Holy See (Vatican City State)" - }, - { - "iso": "HN", - "lat": "15", - "lng": "-86.5", - "name": "Honduras" - }, - { - "iso": "HK", - "lat": "22.25", - "lng": "114.1667", - "name": "Hong Kong" - }, - { - "iso": "HU", - "lat": "47", - "lng": "20", - "name": "Hungary" - }, - { - "iso": "IS", - "lat": "65", - "lng": "-18", - "name": "Iceland" - }, - { - "iso": "IN", - "lat": "20", - "lng": "77", - "name": "India" - }, - { - "iso": "ID", - "lat": "-5", - "lng": "120", - "name": "Indonesia" - }, - { - "iso": "Islamic Republic of", - "lat": "364", - "lng": "32" - }, - { - "iso": "IQ", - "lat": "33", - "lng": "44", - "name": "Iraq" - }, - { - "iso": "IE", - "lat": "53", - "lng": "-8", - "name": "Ireland" - }, - { - "iso": "IM", - "lat": "54.23", - "lng": "-4.55", - "name": "Isle of Man" - }, - { - "iso": "IL", - "lat": "31.5", - "lng": "34.75", - "name": "Israel" - }, - { - "iso": "IT", - "lat": "42.8333", - "lng": "12.8333", - "name": "Italy" - }, - { - "iso": "CI", - "lat": "8", - "lng": "-5", - "name": "Côte d'Ivoire" - }, - { - "iso": "JM", - "lat": "18.25", - "lng": "-77.5", - "name": "Jamaica" - }, - { - "iso": "JP", - "lat": "36", - "lng": "138", - "name": "Japan" - }, - { - "iso": "JE", - "lat": "49.21", - "lng": "-2.13", - "name": "Jersey" - }, - { - "iso": "JO", - "lat": "31", - "lng": "36", - "name": "Jordan" - }, - { - "iso": "KZ", - "lat": "48", - "lng": "68", - "name": "Kazakhstan" - }, - { - "iso": "KE", - "lat": "1", - "lng": "38", - "name": "Kenya" - }, - { - "iso": "KI", - "lat": "1.4167", - "lng": "173", - "name": "Kiribati" - }, - { - "iso": "Democratic People's Republic of", - "lat": "408", - "lng": "40" - }, - { - "iso": "Republic of", - "lat": "410", - "lng": "37" - }, - { - "iso": "XK", - "lat": "42.583333", - "lng": "21" - }, - { - "iso": "KW", - "lat": "29.3375", - "lng": "47.6581", - "name": "Kuwait" - }, - { - "iso": "KG", - "lat": "41", - "lng": "75", - "name": "Kyrgyzstan" - }, - { - "iso": "LA", - "lat": "18", - "lng": "105", - "name": "Lao People's Democratic Republic" - }, - { - "iso": "LV", - "lat": "57", - "lng": "25", - "name": "Latvia" - }, - { - "iso": "LB", - "lat": "33.8333", - "lng": "35.8333", - "name": "Lebanon" - }, - { - "iso": "LS", - "lat": "-29.5", - "lng": "28.5", - "name": "Lesotho" - }, - { - "iso": "LR", - "lat": "6.5", - "lng": "-9.5", - "name": "Liberia" - }, - { - "iso": "LY", - "lat": "25", - "lng": "17", - "name": "Libya" - }, - { - "iso": "LY", - "lat": "25", - "lng": "17", - "name": "Libya" - }, - { - "iso": "LI", - "lat": "47.1667", - "lng": "9.5333", - "name": "Liechtenstein" - }, - { - "iso": "LT", - "lat": "56", - "lng": "24", - "name": "Lithuania" - }, - { - "iso": "LU", - "lat": "49.75", - "lng": "6.1667", - "name": "Luxembourg" - }, - { - "iso": "MO", - "lat": "22.1667", - "lng": "113.55", - "name": "Macao" - }, - { - "iso": "the former Yugoslav Republic of", - "lat": "807", - "lng": "41.8333" - }, - { - "iso": "MG", - "lat": "-20", - "lng": "47", - "name": "Madagascar" - }, - { - "iso": "MW", - "lat": "-13.5", - "lng": "34", - "name": "Malawi" - }, - { - "iso": "MY", - "lat": "2.5", - "lng": "112.5", - "name": "Malaysia" - }, - { - "iso": "MV", - "lat": "3.25", - "lng": "73", - "name": "Maldives" - }, - { - "iso": "ML", - "lat": "17", - "lng": "-4", - "name": "Mali" - }, - { - "iso": "MT", - "lat": "35.8333", - "lng": "14.5833", - "name": "Malta" - }, - { - "iso": "MH", - "lat": "9", - "lng": "168", - "name": "Marshall Islands" - }, - { - "iso": "MQ", - "lat": "14.6667", - "lng": "-61", - "name": "Martinique" - }, - { - "iso": "MR", - "lat": "20", - "lng": "-12", - "name": "Mauritania" - }, - { - "iso": "MU", - "lat": "-20.2833", - "lng": "57.55", - "name": "Mauritius" - }, - { - "iso": "YT", - "lat": "-12.8333", - "lng": "45.1667", - "name": "Mayotte" - }, - { - "iso": "MX", - "lat": "23", - "lng": "-102", - "name": "Mexico" - }, - { - "iso": "Federated States of", - "lat": "583", - "lng": "6.9167" - }, - { - "iso": "Republic of", - "lat": "498", - "lng": "47" - }, - { - "iso": "MC", - "lat": "43.7333", - "lng": "7.4", - "name": "Monaco" - }, - { - "iso": "MN", - "lat": "46", - "lng": "105", - "name": "Mongolia" - }, - { - "iso": "ME", - "lat": "42", - "lng": "19", - "name": "Montenegro" - }, - { - "iso": "MS", - "lat": "16.75", - "lng": "-62.2", - "name": "Montserrat" - }, - { - "iso": "MA", - "lat": "32", - "lng": "-5", - "name": "Morocco" - }, - { - "iso": "MD", - "lat": "46.9804", - "lng": "28.3897", - "name": "Moldova" - }, - { - "iso": "MZ", - "lat": "-18.25", - "lng": "35", - "name": "Mozambique" - }, - { - "iso": "MM", - "lat": "22", - "lng": "98", - "name": "Myanmar" - }, - { - "iso": "NA", - "lat": "-22", - "lng": "17", - "name": "Namibia" - }, - { - "iso": "NR", - "lat": "-0.5333", - "lng": "166.9167", - "name": "Nauru" - }, - { - "iso": "NP", - "lat": "28", - "lng": "84", - "name": "Nepal" - }, - { - "iso": "AN", - "lat": "12.25", - "lng": "-68.75" - }, - { - "iso": "NL", - "lat": "52.5", - "lng": "5.75", - "name": "Netherlands" - }, - { - "iso": "NC", - "lat": "-21.5", - "lng": "165.5", - "name": "New Caledonia" - }, - { - "iso": "NZ", - "lat": "-41", - "lng": "174", - "name": "New Zealand" - }, - { - "iso": "NI", - "lat": "13", - "lng": "-85", - "name": "Nicaragua" - }, - { - "iso": "NE", - "lat": "16", - "lng": "8", - "name": "Niger" - }, - { - "iso": "NG", - "lat": "10", - "lng": "8", - "name": "Nigeria" - }, - { - "iso": "NU", - "lat": "-19.0333", - "lng": "-169.8667", - "name": "Niue" - }, - { - "iso": "NF", - "lat": "-29.0333", - "lng": "167.95", - "name": "Norfolk Island" - }, - { - "iso": "MP", - "lat": "15.2", - "lng": "145.75", - "name": "Northern Mariana Islands" - }, - { - "iso": "NO", - "lat": "62", - "lng": "10", - "name": "Norway" - }, - { - "iso": "OM", - "lat": "21", - "lng": "57", - "name": "Oman" - }, - { - "iso": "PK", - "lat": "30", - "lng": "70", - "name": "Pakistan" - }, - { - "iso": "PW", - "lat": "7.5", - "lng": "134.5", - "name": "Palau" - }, - { - "iso": "Occupied", - "lat": "275", - "lng": "32" - }, - { - "iso": "PA", - "lat": "9", - "lng": "-80", - "name": "Panama" - }, - { - "iso": "PG", - "lat": "-6", - "lng": "147", - "name": "Papua New Guinea" - }, - { - "iso": "PY", - "lat": "-23", - "lng": "-58", - "name": "Paraguay" - }, - { - "iso": "PE", - "lat": "-10", - "lng": "-76", - "name": "Peru" - }, - { - "iso": "PH", - "lat": "13", - "lng": "122", - "name": "Philippines" - }, - { - "iso": "PN", - "lat": "-24.7", - "lng": "-127.4", - "name": "Pitcairn" - }, - { - "iso": "PL", - "lat": "52", - "lng": "20", - "name": "Poland" - }, - { - "iso": "PT", - "lat": "39.5", - "lng": "-8", - "name": "Portugal" - }, - { - "iso": "PR", - "lat": "18.25", - "lng": "-66.5", - "name": "Puerto Rico" - }, - { - "iso": "QA", - "lat": "25.5", - "lng": "51.25", - "name": "Qatar" - }, - { - "iso": "RE", - "lat": "-21.1", - "lng": "55.6", - "name": "Réunion" - }, - { - "iso": "RO", - "lat": "46", - "lng": "25", - "name": "Romania" - }, - { - "iso": "RU", - "lat": "60", - "lng": "100", - "name": "Russian Federation" - }, - { - "iso": "RU", - "lat": "60", - "lng": "100", - "name": "Russian Federation" - }, - { - "iso": "RW", - "lat": "-2", - "lng": "30", - "name": "Rwanda" - }, - { - "iso": "BL", - "lat": "17.897728", - "lng": "-62.834244", - "name": "Saint Barthélemy" - }, - { - "iso": "Ascension and Tristan da Cunha", - "lat": "654", - "lng": "-15.9333" - }, - { - "iso": "KN", - "lat": "17.3333", - "lng": "-62.75", - "name": "Saint Kitts and Nevis" - }, - { - "iso": "LC", - "lat": "13.8833", - "lng": "-61.1333", - "name": "Saint Lucia" - }, - { - "iso": "MF", - "lat": "18.075278", - "lng": "-63.06", - "name": "Saint Martin (French part)" - }, - { - "iso": "PM", - "lat": "46.8333", - "lng": "-56.3333", - "name": "Saint Pierre and Miquelon" - }, - { - "iso": "VC", - "lat": "13.25", - "lng": "-61.2", - "name": "Saint Vincent and the Grenadines" - }, - { - "iso": "VC", - "lat": "13.25", - "lng": "-61.2", - "name": "Saint Vincent and the Grenadines" - }, - { - "iso": "WS", - "lat": "-13.5833", - "lng": "-172.3333", - "name": "Samoa" - }, - { - "iso": "SM", - "lat": "43.7667", - "lng": "12.4167", - "name": "San Marino" - }, - { - "iso": "ST", - "lat": "1", - "lng": "7", - "name": "Sao Tome and Principe" - }, - { - "iso": "SA", - "lat": "25", - "lng": "45", - "name": "Saudi Arabia" - }, - { - "iso": "SN", - "lat": "14", - "lng": "-14", - "name": "Senegal" - }, - { - "iso": "RS", - "lat": "44", - "lng": "21", - "name": "Serbia" - }, - { - "iso": "SC", - "lat": "-4.5833", - "lng": "55.6667", - "name": "Seychelles" - }, - { - "iso": "SL", - "lat": "8.5", - "lng": "-11.5", - "name": "Sierra Leone" - }, - { - "iso": "SG", - "lat": "1.3667", - "lng": "103.8", - "name": "Singapore" - }, - { - "iso": "SX", - "lat": "18.033333", - "lng": "-63.05", - "name": "Sint Maarten (Dutch part)" - }, - { - "iso": "SK", - "lat": "48.6667", - "lng": "19.5", - "name": "Slovakia" - }, - { - "iso": "SI", - "lat": "46", - "lng": "15", - "name": "Slovenia" - }, - { - "iso": "SB", - "lat": "-8", - "lng": "159", - "name": "Solomon Islands" - }, - { - "iso": "SO", - "lat": "10", - "lng": "49", - "name": "Somalia" - }, - { - "iso": "ZA", - "lat": "-29", - "lng": "24", - "name": "South Africa" - }, - { - "iso": "GS", - "lat": "-54.5", - "lng": "-37", - "name": "South Georgia and the South Sandwich Islands" - }, - { - "iso": "KR", - "lat": "37", - "lng": "127.5", - "name": "Korea, Republic of" - }, - { - "iso": "SS", - "lat": "8", - "lng": "30", - "name": "South Sudan" - }, - { - "iso": "ES", - "lat": "40", - "lng": "-4", - "name": "Spain" - }, - { - "iso": "LK", - "lat": "7", - "lng": "81", - "name": "Sri Lanka" - }, - { - "iso": "VC", - "lat": "13.25", - "lng": "-61.2", - "name": "Saint Vincent and the Grenadines" - }, - { - "iso": "SD", - "lat": "15", - "lng": "30", - "name": "Sudan" - }, - { - "iso": "SR", - "lat": "4", - "lng": "-56", - "name": "Suriname" - }, - { - "iso": "SJ", - "lat": "78", - "lng": "20", - "name": "Svalbard and Jan Mayen" - }, - { - "iso": "SZ", - "lat": "-26.5", - "lng": "31.5", - "name": "Swaziland" - }, - { - "iso": "SE", - "lat": "62", - "lng": "15", - "name": "Sweden" - }, - { - "iso": "CH", - "lat": "47", - "lng": "8", - "name": "Switzerland" - }, - { - "iso": "SY", - "lat": "35", - "lng": "38", - "name": "Syrian Arab Republic" - }, - { - "iso": "TW", - "lat": "23.5", - "lng": "121", - "name": "Taiwan, Province of China" - }, - { - "iso": "TJ", - "lat": "39", - "lng": "71", - "name": "Tajikistan" - }, - { - "iso": "United Republic of", - "lat": "834", - "lng": "-6" - }, - { - "iso": "TH", - "lat": "15", - "lng": "100", - "name": "Thailand" - }, - { - "iso": "TL", - "lat": "-8.55", - "lng": "125.5167", - "name": "Timor-Leste" - }, - { - "iso": "TG", - "lat": "8", - "lng": "1.1667", - "name": "Togo" - }, - { - "iso": "TK", - "lat": "-9", - "lng": "-172", - "name": "Tokelau" - }, - { - "iso": "TO", - "lat": "-20", - "lng": "-175", - "name": "Tonga" - }, - { - "iso": "TT", - "lat": "11", - "lng": "-61", - "name": "Trinidad and Tobago" - }, - { - "iso": "TN", - "lat": "34", - "lng": "9", - "name": "Tunisia" - }, - { - "iso": "TR", - "lat": "39", - "lng": "35", - "name": "Turkey" - }, - { - "iso": "TM", - "lat": "40", - "lng": "60", - "name": "Turkmenistan" - }, - { - "iso": "TC", - "lat": "21.75", - "lng": "-71.5833", - "name": "Turks and Caicos Islands" - }, - { - "iso": "TV", - "lat": "-8", - "lng": "178", - "name": "Tuvalu" - }, - { - "iso": "UG", - "lat": "1", - "lng": "32", - "name": "Uganda" - }, - { - "iso": "UA", - "lat": "49", - "lng": "32", - "name": "Ukraine" - }, - { - "iso": "AE", - "lat": "24", - "lng": "54", - "name": "United Arab Emirates" - }, - { - "iso": "GB", - "lat": "54", - "lng": "-2", - "name": "United Kingdom" - }, - { - "iso": "UM", - "lat": "19.2833", - "lng": "166.6", - "name": "United States Minor Outlying Islands" - }, - { - "iso": "US", - "lat": "38", - "lng": "-97", - "name": "United States" - }, - { - "iso": "UY", - "lat": "-33", - "lng": "-56", - "name": "Uruguay" - }, - { - "iso": "UZ", - "lat": "41", - "lng": "64", - "name": "Uzbekistan" - }, - { - "iso": "VU", - "lat": "-16", - "lng": "167", - "name": "Vanuatu" - }, - { - "iso": "Bolivarian Republic of", - "lat": "862", - "lng": "8" - }, - { - "iso": "VE", - "lat": "8", - "lng": "-66", - "name": "Venezuela, Bolivarian Republic of" - }, - { - "iso": "VN", - "lat": "16", - "lng": "106", - "name": "Viet Nam" - }, - { - "iso": "VN", - "lat": "16", - "lng": "106", - "name": "Viet Nam" - }, - { - "iso": "British", - "lat": "92", - "lng": "18.5" - }, - { - "iso": "U.S.", - "lat": "850", - "lng": "18.3333" - }, - { - "iso": "WF", - "lat": "-13.3", - "lng": "-176.2", - "name": "Wallis and Futuna" - }, - { - "iso": "EH", - "lat": "24.5", - "lng": "-13", - "name": "Western Sahara" - }, - { - "iso": "YE", - "lat": "15", - "lng": "48", - "name": "Yemen" - }, - { - "iso": "ZM", - "lat": "-15", - "lng": "30", - "name": "Zambia" - }, - { - "iso": "ZW", - "lat": "-20", - "lng": "30", - "name": "Zimbabwe" - } -] \ No newline at end of file diff --git a/src/proxy.ts b/src/proxy.ts index 04a8f54..0340507 100644 --- a/src/proxy.ts +++ b/src/proxy.ts @@ -7,7 +7,6 @@ import { UploadResponse, } from "@codex-storage/sdk-js"; import { CodexSdk as Sdk } from "./sdk/codex"; -import { WebStorage } from "./utils/web-storage"; import { FilesStorage } from "./utils/file-storage"; import { PurchaseStorage } from "./utils/purchases-storage"; @@ -16,15 +15,58 @@ class CodexDataMock extends CodexData { file: File, onProgress?: (loaded: number, total: number) => void ): UploadResponse { + // const url = CodexSdk.url() + "/api/codex/v1/data"; + + // const xhr = new XMLHttpRequest(); + + // const promise = new Promise>((resolve) => { + // xhr.upload.onprogress = (evt) => { + // if (evt.lengthComputable) { + // onProgress?.(evt.loaded, evt.total); + // } + // }; + + // xhr.open("POST", url, true); + // xhr.setRequestHeader("Content-Disposition", "attachment; filename=\"" + file.name + "\"") + // xhr.send(file); + + // xhr.onload = function () { + // if (xhr.status != 200) { + // resolve({ + // error: true, + // data: new CodexError(xhr.responseText, { + // code: xhr.status, + // }), + // }); + // } else { + // resolve({ error: false, data: xhr.response }); + // } + // }; + + // xhr.onerror = function () { + // resolve({ + // error: true, + // data: new CodexError("Something went wrong during the file upload."), + // }); + // }; + // }); + + // return { + // result: promise, + // abort: () => { + // xhr.abort(); + // }, + // }; const { result, abort } = super.upload(file, onProgress); return { abort, result: result.then((safe) => { if (!safe.error) { - return WebStorage.set(safe.data, { - type: file.type, + return FilesStorage.set(safe.data, { + mimetype: file.type, name: file.name, + uploadedAt: new Date().toJSON(), }).then(() => safe); }