diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..c0387dd --- /dev/null +++ b/.env.example @@ -0,0 +1,5 @@ +DATABASE_PATH=local.db +POLL_INTERVAL_SECONDS=180 +MANUAL_RUN_COOLDOWN_SECONDS=30 +MAX_ATTEMPTS=3 +HISTORY_RETENTION_DAYS=7 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..23be534 --- /dev/null +++ b/.gitignore @@ -0,0 +1,25 @@ +node_modules + +# Output +.output +.vercel +.netlify +.wrangler +/.svelte-kit +/build + +# OS +.DS_Store +Thumbs.db + +# Env +.env +.env.* +!.env.example +!.env.test + +# Vite +vite.config.js.timestamp-* +vite.config.ts.timestamp-* +# SQLite +*.db diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..b6f27f1 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +engine-strict=true diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..0243576 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,10 @@ +# Package Managers +package-lock.json +pnpm-lock.yaml +yarn.lock +bun.lock +bun.lockb + +# Miscellaneous +/static/ +/drizzle/ diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..4d5e64f --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["svelte.svelte-vscode", "esbenp.prettier-vscode", "dbaeumer.vscode-eslint"] +} diff --git a/README.md b/README.md index 0414ad6..9a88702 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ There is also a small web page that shows each project's file tree, sync status, ## Status -Planning. See: +In development. The sync core and database layer are built and tested against simulated SharePoint and ACC. The real SharePoint/ACC connections and the web UI are next. See: - [docs/design.md](docs/design.md): architecture, interfaces, data model and build order - [docs/access-setup.md](docs/access-setup.md): what IT and the ACC admin need to set up diff --git a/docs/access-setup.md b/docs/access-setup.md index 1230951..9e5a772 100644 --- a/docs/access-setup.md +++ b/docs/access-setup.md @@ -19,13 +19,13 @@ The tool only ever reads from SharePoint, so no write permission is needed. ## Autodesk / ACC (ask the ACC account admin) -1. **Create an APS app** at → *My Apps*. +1. **Create an APS app** at → _My Apps_. - App type: **Server-to-Server** (app-only). - API access: **Data Management API**. - Send us the **Client ID** and **Client Secret**. 2. **In ACC Account Admin → Custom Integrations, add the APS app's Client ID** so it can access the account's projects. 3. **Possibly: a service user.** Some ACC Docs operations may need to run "as" a user, i.e. an account that is a project member with edit/upload permission on the target folder. We'll confirm this during the build spikes before asking for it. -4. **For each project:** tell us which ACC project, and which folder under *Project Files*, is the sync root. +4. **For each project:** tell us which ACC project, and which folder under _Project Files_, is the sync root. ## For the build spikes diff --git a/docs/design.md b/docs/design.md index ea6f434..b561737 100644 --- a/docs/design.md +++ b/docs/design.md @@ -2,19 +2,19 @@ ## Goals and constraints -| Decision | Choice | -| --- | --- | -| Direction | One-way, SharePoint → ACC | -| Latency | Poll every ~3 min (configurable); "Run now" for immediate sync | -| Operations | Create, update (new ACC version), rename, move, delete | -| Scope | Many projects per server; each project is a 1:1 pair of SharePoint root ↔ ACC root | -| ACC ownership | Only touch ACC items this tool created; hand-added ACC content is left alone | -| Ignored files | Temp/lock/system files are skipped silently (not issues) | -| Retries | 3 attempts across runs, then surface as an issue | -| Files | Small/medium documents; no large Revit models | -| Hosting | One Docker container (Portainer), SQLite on a volume | -| Credentials | One Microsoft app registration + one APS app, shared by all projects | -| UI access | Viewing and "Run now" are open (behind VPN). Adding, editing or resetting projects requires the single admin login from env | +| Decision | Choice | +| ------------- | --------------------------------------------------------------------------------------------------------------------------- | +| Direction | One-way, SharePoint → ACC | +| Latency | Poll every ~3 min (configurable); "Run now" for immediate sync | +| Operations | Create, update (new ACC version), rename, move, delete | +| Scope | Many projects per server; each project is a 1:1 pair of SharePoint root ↔ ACC root | +| ACC ownership | Only touch ACC items this tool created; hand-added ACC content is left alone | +| Ignored files | Temp/lock/system files are skipped silently (not issues) | +| Retries | 3 attempts across runs, then surface as an issue | +| Files | Small/medium documents; no large Revit models | +| Hosting | One Docker container (Portainer), SQLite on a volume | +| Credentials | One Microsoft app registration + one APS app, shared by all projects | +| UI access | Viewing and "Run now" are open (behind VPN). Adding, editing or resetting projects requires the single admin login from env | ## Architecture @@ -39,8 +39,8 @@ The sync logic is plain TypeScript with no SvelteKit imports. SvelteKit hosts it ### Each run has two phases -1. **Ingest.** Read changes from SharePoint since the project's saved cursor and write them to `items` as the *desired* state (name, parent, content tag, deleted flag). Save the new cursor in the same transaction. Nothing touches ACC in this phase. -2. **Reconcile.** For every item whose desired state differs from its *synced* state, work out the operation and apply it to ACC. On success, copy desired → synced. On failure, increment `attempt_count` and record the error. +1. **Ingest.** Read changes from SharePoint since the project's saved cursor and write them to `items` as the _desired_ state (name, parent, content tag, deleted flag). Save the new cursor in the same transaction. Nothing touches ACC in this phase. +2. **Reconcile.** For every item whose desired state differs from its _synced_ state, work out the operation and apply it to ACC. On success, copy desired → synced. On failure, increment `attempt_count` and record the error. This split gives us several things without extra code: @@ -48,15 +48,15 @@ This split gives us several things without extra code: - **Crash safety.** If the container dies mid-run, the cursor is already saved and the pending work is still in the database. - **Inferred renames and moves.** Graph delta only reports "this item now looks like X". The operation comes from comparing that to what we last synced: -| Desired vs synced | Operation | -| --- | --- | -| no target id yet | create (folder) / upload (file) | -| `deleted` | delete | -| name differs | rename | -| parent differs | move | -| content tag differs | upload new version | +| Desired vs synced | Operation | +| ------------------- | ------------------------------- | +| no target id yet | create (folder) / upload (file) | +| `deleted` | delete | +| name differs | rename | +| parent differs | move | +| content tag differs | upload new version | - A single change can need more than one of these, for example a move plus a rename. +A single change can need more than one of these, for example a move plus a rename. **Order within reconcile:** folder creates and moves from shallowest to deepest, then files, then deletes. That way a destination folder always exists before anything moves into it. @@ -66,69 +66,38 @@ Graph delta for SharePoint only works at the **drive root**, not on subfolders. An item whose new parent is outside the root counts as deleted. That covers "removed from the root = deleted in ACC". -**Safety rule:** if the project's root folder itself disappears or moves, the project is paused with a project-level issue and **nothing is deleted**. That is almost always a mistake, not an intent to wipe ACC. +**Safety rule:** if the project's root folder is deleted, or is missing from a full listing, the project is paused with a project-level issue and **nothing is deleted**. That is almost always a mistake, not an intent to wipe ACC. Moving or renaming the root within the same library is harmless, because projects track it by ID. + +**Restored folders:** a folder delete cascades "deleted" to everything stored under it. If a deleted folder later reappears, its contents may not be reported one by one, so ingest asks for one follow-up **full listing** in the same run, which brings them back. ## Interfaces (ports) -These are sketches; final signatures get settled during the build. +The source of truth is [`src/lib/server/sync/core/ports.ts`](../src/lib/server/sync/core/ports.ts): -```ts -// sync/core/ports.ts - -export interface SourceItem { - sourceId: string; - parentSourceId: string | null; - name: string; - isFolder: boolean; - contentTag: string | null; // Graph cTag; changes only when content changes - modifiedAt: Date; - size: number | null; -} - -export type SourceChange = - | { kind: 'upsert'; item: SourceItem } - | { kind: 'delete'; sourceId: string }; - -export interface ChangeSource { - /** Changes since `cursor` (null = full enumeration), with the cursor to save. */ - getChanges(root: SourceRoot, cursor: string | null): Promise<{ changes: SourceChange[]; cursor: string }>; - download(root: SourceRoot, sourceId: string): Promise<{ stream: ReadableStream; size: number }>; -} - -export interface TargetRef { id: string; isFolder: boolean } - -export interface DocumentTarget { - createFolder(parentId: string, name: string): Promise; - uploadFile(parentId: string, name: string, content: FileContent): Promise; - uploadVersion(ref: TargetRef, name: string, content: FileContent): Promise; - rename(ref: TargetRef, name: string): Promise; - /** May return a new ref if the target can only move by copy + delete. */ - move(ref: TargetRef, newParentId: string): Promise; - delete(ref: TargetRef): Promise; - /** Bring back a previously deleted item (keeps history where possible). */ - restore(ref: TargetRef, parentId: string, name: string, content?: FileContent): Promise; -} - -export interface IgnorePolicy { - isIgnored(name: string, isFolder: boolean): boolean; -} -``` +- `ChangeSource` (SharePoint): `getChanges(root, cursor)` returns changes, the next cursor and whether it was a full listing. `download(root, id)` returns the file content. +- `DocumentTarget` (ACC): `createFolder`, `uploadFile`, `uploadVersion`, `rename`, `move`, `delete`, `restore`. +- `IgnorePolicy`: decides which names are skipped. Repositories are split by consumer (interface segregation): -- `ProjectRepository`: CRUD, cursor, pause and reset -- `ItemRepository`: desired/synced state, pending diff query, tree query for the UI -- `RunRepository`: start/finish runs, record events, prune old history +- `ProjectRepository`: create, pause/resume, first-synced and last-run stamps, reset +- `ItemRepository`: load a project's items, commit an ingest with its cursor (atomically), save reconcile results +- `RunRepository`: start/finish runs, record events, list history, prune old history + +Adapters throw `ServiceUnavailableError` for outages (network, auth, throttling that outlasted retries). The run stops early and no item is charged an attempt; any other error counts against the item that hit it. Both fallback strategies, move-by-copy and restore-by-reupload, live **inside the ACC adapter**. They are ACC-specific details, so the engine never branches on them. ### Coordinator -`SyncCoordinator.requestRun(projectId, trigger)` is the only way a run starts, whether from the scheduler or from "Run now". It holds one in-process lock per project and returns one of: +`SyncCoordinator` is the only way a run starts. It holds one in-process lock per project. `requestManualRun(projectId)` ("Run now") returns one of: - `started` -- `already-running` (the caller attaches to the current run) -- `{ cooldown: secondsLeft }` (the last manual run was less than 30 s ago) +- `already-running` (the page just shows the run in progress) +- `cooldown` with `retryAfterSeconds` (the last manual request for this project was under 30 s ago) +- `unavailable` with a reason (unknown, disabled or paused project) + +`runScheduledPass()` is what the timer calls. An `IntervalScheduler` drives it, and the history-pruning job, without ever overlapping a task with itself. The scheduler goes through enabled projects one at a time, and one failing project never blocks the others. Graph and APS clients share one HTTP layer that handles `429`/`Retry-After` and backoff, because rate limits apply per app, not per project. @@ -145,7 +114,7 @@ items PK (project_id, source_id) -- desired (from SharePoint) parent_source_id, name, is_folder, content_tag, source_modified_at, size, deleted -- synced (what ACC has) - target_id, synced_parent_target_id, synced_name, synced_content_tag, synced_at + target_id, synced_parent_source_id, synced_name, synced_content_tag, synced_deleted, synced_at -- bookkeeping status ('synced' | 'pending' | 'failed' | 'deleted') attempt_count, last_error, last_attempt_at @@ -153,12 +122,15 @@ items PK (project_id, source_id) runs id, project_id, trigger ('schedule' | 'manual'), started_at, finished_at outcome ('success' | 'partial' | 'failed'), error - created, updated, renamed, moved, deleted, failed -- counts + created, updated, renamed, moved, deleted, restored, failed -- counts run_events - id, run_id, project_id, source_id, path, action, outcome, message, at + id, run_id, project_id, source_id, path, action, message, at + -- action: created | updated | renamed | moved | deleted | restored | failed ``` +The synced parent is stored as a SharePoint ID, so "was it moved?" is a plain comparison with the desired parent. The ACC folder to move into is looked up from the parent item when needed. + - IDs are stored, not paths, so renaming a root folder doesn't break a project. Display paths are shown in the UI only. - **Issues** = items with `status = 'failed'`, plus a project-level issue when it is paused or its latest run failed outright (bad auth, root missing). - A nightly job deletes `runs` and `run_events` older than `HISTORY_RETENTION_DAYS`. `items` is current state, so it is never pruned. @@ -168,13 +140,13 @@ run_events ## UI -| Route | Who | What | -| --- | --- | --- | -| `/` | anyone | Projects list: status, last run, open issue count | -| `/projects/[id]` | anyone | File tree with status badges and last update time, an issues panel and a "Run now" button | -| `/projects/[id]/history` | anyone | Runs from the last 7 days, expandable to per-file events | -| `/admin/login` | — | Single admin login | -| `/admin/projects/new`, `/admin/projects/[id]` | admin | Add/edit project (paste SharePoint URL and pick ACC folder; server resolves and checks the IDs), enable/disable, reset | +| Route | Who | What | +| --------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------- | +| `/` | anyone | Projects list: status, last run, open issue count | +| `/projects/[id]` | anyone | File tree with status badges and last update time, an issues panel and a "Run now" button | +| `/projects/[id]/history` | anyone | Runs from the last 7 days, expandable to per-file events | +| `/admin/login` | — | Single admin login | +| `/admin/projects/new`, `/admin/projects/[id]` | admin | Add/edit project (paste SharePoint URL and pick ACC folder; server resolves and checks the IDs), enable/disable, reset | - The status pages read only from SQLite. They never call SharePoint or ACC. - While a run is active, the project page refreshes its data every few seconds. @@ -192,25 +164,34 @@ MAX_ATTEMPTS=3 HISTORY_RETENTION_DAYS=7 ``` -Env is validated with `zod` at startup; the server refuses to start on bad config. Run exactly **one** replica, because the locks live in-process. +Env vars are declared and validated with `zod` in `src/env.ts` (SvelteKit's `defineEnvVars`); the server refuses to start on bad config. Only the variables in use so far are declared; the Graph, APS and admin ones get added along with the code that reads them. Run exactly **one** replica, because the locks live in-process. ## Source layout ``` +src/env.ts # env var declarations + validation src/lib/server/ - config.ts # zod-validated env - container.ts # composition root: the only place adapters are chosen + container.ts # (todo) composition root: the only place adapters are chosen sync/ - core/ # ports, SyncEngine, reconcile planner, IgnorePolicy (pure TS) - coordinator.ts # locks, cooldown, scheduler loop, retention job + core/ # pure TS, no SvelteKit imports + model.ts ports.ts errors.ts + ingest.ts # SharePoint changes → desired state + plan.ts # desired vs synced → action, status, work order + reconciler.ts # applies actions to ACC + engine.ts # one run of one project + tree.ts ignore.ts + coordinator.ts # per-project lock + manual cooldown + scheduler.ts # non-overlapping interval tasks + testing/ # FakeDrive, FakeAcc, harness (real engine + in-memory SQLite) adapters/ - graph/ # GraphChangeSource, auth (msal-node) - aps/ # ApsDocumentTarget, auth, upload flow - sqlite/ # Drizzle schema + repositories - http/ # shared fetch wrapper: retry, backoff, Retry-After - auth/ # admin session cookie -src/hooks.server.ts # init → container → coordinator.start(); admin route guard -src/routes/ # UI + sqlite/ # Drizzle schema, migrations runner, repositories + graph/ # (todo) GraphChangeSource, auth (msal-node) + aps/ # (todo) ApsDocumentTarget, auth, upload flow + http/ # (todo) shared fetch wrapper: retry, backoff, Retry-After + auth/ # (todo) admin session cookie +drizzle/ # generated SQL migrations (npm run db:generate) +src/hooks.server.ts # (todo) init → container → scheduler; admin route guard +src/routes/ # (todo) UI ``` ## Open questions (resolved by spikes) @@ -224,11 +205,11 @@ src/routes/ # UI 0. **Access requests:** start now; they're the slowest part. See [access-setup.md](access-setup.md). 1. **Spikes** against a sandbox ACC project and test SharePoint site. Answer the open questions above and record the results here. -2. **Scaffold:** SvelteKit + adapter-node, TypeScript strict, Drizzle + better-sqlite3, zod, Vitest, ESLint/Prettier, Dockerfile. -3. **Core:** ports, IgnorePolicy, reconcile planner and SyncEngine, unit-tested against in-memory fakes. Most of the logic lives here. -4. **SQLite repositories** and migrations. +2. ✅ **Scaffold:** SvelteKit 3 + adapter-node, TypeScript strict, Drizzle + better-sqlite3, zod, Vitest, ESLint/Prettier. (Dockerfile moves to step 9.) +3. ✅ **Core:** ports, IgnorePolicy, ingest, planner, reconciler and SyncEngine, tested against FakeDrive/FakeAcc. +4. ✅ **SQLite repositories** and migrations. 5. **GraphChangeSource.** 6. **ApsDocumentTarget**, including the fallbacks chosen in step 1. -7. **Coordinator:** scheduler, locks, cooldown, retention job, hooked into `init`. +7. **Wiring:** ✅ coordinator, scheduler. Still to do: composition root, `init` hook, retention job schedule. 8. **UI:** status pages, Run now, admin login, project add/edit/reset. 9. **Ship:** Docker image, Portainer stack file, runbook. diff --git a/drizzle.config.ts b/drizzle.config.ts new file mode 100644 index 0000000..f002316 --- /dev/null +++ b/drizzle.config.ts @@ -0,0 +1,10 @@ +import { defineConfig } from 'drizzle-kit'; + +export default defineConfig({ + schema: './src/lib/server/adapters/sqlite/schema.ts', + out: './drizzle', + dialect: 'sqlite', + dbCredentials: { url: process.env.DATABASE_PATH ?? 'local.db' }, + verbose: true, + strict: true +}); diff --git a/drizzle/0000_init.sql b/drizzle/0000_init.sql new file mode 100644 index 0000000..a0f5be2 --- /dev/null +++ b/drizzle/0000_init.sql @@ -0,0 +1,76 @@ +CREATE TABLE `items` ( + `project_id` text NOT NULL, + `source_id` text NOT NULL, + `parent_source_id` text NOT NULL, + `name` text NOT NULL, + `is_folder` integer NOT NULL, + `content_tag` text, + `source_modified_at` integer NOT NULL, + `size` integer, + `deleted` integer NOT NULL, + `target_id` text, + `synced_parent_source_id` text, + `synced_name` text, + `synced_content_tag` text, + `synced_deleted` integer NOT NULL, + `synced_at` integer, + `status` text NOT NULL, + `attempt_count` integer DEFAULT 0 NOT NULL, + `last_error` text, + `last_attempt_at` integer, + PRIMARY KEY(`project_id`, `source_id`), + FOREIGN KEY (`project_id`) REFERENCES `projects`(`id`) ON UPDATE no action ON DELETE cascade +); +--> statement-breakpoint +CREATE INDEX `items_project_status` ON `items` (`project_id`,`status`);--> statement-breakpoint +CREATE TABLE `projects` ( + `id` text PRIMARY KEY NOT NULL, + `name` text NOT NULL, + `enabled` integer DEFAULT true NOT NULL, + `paused_reason` text, + `sp_site_id` text NOT NULL, + `sp_drive_id` text NOT NULL, + `sp_root_item_id` text NOT NULL, + `sp_display_path` text NOT NULL, + `acc_hub_id` text NOT NULL, + `acc_project_id` text NOT NULL, + `acc_root_folder_id` text NOT NULL, + `acc_display_path` text NOT NULL, + `delta_cursor` text, + `first_synced_at` integer, + `last_run_at` integer, + `created_at` integer NOT NULL +); +--> statement-breakpoint +CREATE TABLE `run_events` ( + `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL, + `run_id` text NOT NULL, + `project_id` text NOT NULL, + `source_id` text NOT NULL, + `path` text NOT NULL, + `action` text NOT NULL, + `message` text, + `at` integer NOT NULL, + FOREIGN KEY (`run_id`) REFERENCES `runs`(`id`) ON UPDATE no action ON DELETE cascade +); +--> statement-breakpoint +CREATE INDEX `run_events_run` ON `run_events` (`run_id`);--> statement-breakpoint +CREATE TABLE `runs` ( + `id` text PRIMARY KEY NOT NULL, + `project_id` text NOT NULL, + `trigger` text NOT NULL, + `started_at` integer NOT NULL, + `finished_at` integer, + `outcome` text, + `error` text, + `created` integer DEFAULT 0 NOT NULL, + `updated` integer DEFAULT 0 NOT NULL, + `renamed` integer DEFAULT 0 NOT NULL, + `moved` integer DEFAULT 0 NOT NULL, + `deleted` integer DEFAULT 0 NOT NULL, + `restored` integer DEFAULT 0 NOT NULL, + `failed` integer DEFAULT 0 NOT NULL, + FOREIGN KEY (`project_id`) REFERENCES `projects`(`id`) ON UPDATE no action ON DELETE cascade +); +--> statement-breakpoint +CREATE INDEX `runs_project_started` ON `runs` (`project_id`,`started_at`); \ No newline at end of file diff --git a/drizzle/meta/0000_snapshot.json b/drizzle/meta/0000_snapshot.json new file mode 100644 index 0000000..a30678e --- /dev/null +++ b/drizzle/meta/0000_snapshot.json @@ -0,0 +1,542 @@ +{ + "version": "6", + "dialect": "sqlite", + "id": "a7309db7-6811-48f5-bb28-822a92adf5d5", + "prevId": "00000000-0000-0000-0000-000000000000", + "tables": { + "items": { + "name": "items", + "columns": { + "project_id": { + "name": "project_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "parent_source_id": { + "name": "parent_source_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "is_folder": { + "name": "is_folder", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "content_tag": { + "name": "content_tag", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_modified_at": { + "name": "source_modified_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "size": { + "name": "size", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "deleted": { + "name": "deleted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "target_id": { + "name": "target_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "synced_parent_source_id": { + "name": "synced_parent_source_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "synced_name": { + "name": "synced_name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "synced_content_tag": { + "name": "synced_content_tag", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "synced_deleted": { + "name": "synced_deleted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "synced_at": { + "name": "synced_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "attempt_count": { + "name": "attempt_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "last_error": { + "name": "last_error", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "last_attempt_at": { + "name": "last_attempt_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "items_project_status": { + "name": "items_project_status", + "columns": [ + "project_id", + "status" + ], + "isUnique": false + } + }, + "foreignKeys": { + "items_project_id_projects_id_fk": { + "name": "items_project_id_projects_id_fk", + "tableFrom": "items", + "tableTo": "projects", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "items_project_id_source_id_pk": { + "columns": [ + "project_id", + "source_id" + ], + "name": "items_project_id_source_id_pk" + } + }, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "projects": { + "name": "projects", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "enabled": { + "name": "enabled", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "paused_reason": { + "name": "paused_reason", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sp_site_id": { + "name": "sp_site_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "sp_drive_id": { + "name": "sp_drive_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "sp_root_item_id": { + "name": "sp_root_item_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "sp_display_path": { + "name": "sp_display_path", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "acc_hub_id": { + "name": "acc_hub_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "acc_project_id": { + "name": "acc_project_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "acc_root_folder_id": { + "name": "acc_root_folder_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "acc_display_path": { + "name": "acc_display_path", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "delta_cursor": { + "name": "delta_cursor", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "first_synced_at": { + "name": "first_synced_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "last_run_at": { + "name": "last_run_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "run_events": { + "name": "run_events", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": true + }, + "run_id": { + "name": "run_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "project_id": { + "name": "project_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "action": { + "name": "action", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "message": { + "name": "message", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "at": { + "name": "at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "run_events_run": { + "name": "run_events_run", + "columns": [ + "run_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "run_events_run_id_runs_id_fk": { + "name": "run_events_run_id_runs_id_fk", + "tableFrom": "run_events", + "tableTo": "runs", + "columnsFrom": [ + "run_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "runs": { + "name": "runs", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "project_id": { + "name": "project_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "trigger": { + "name": "trigger", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "started_at": { + "name": "started_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "finished_at": { + "name": "finished_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "outcome": { + "name": "outcome", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "error": { + "name": "error", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created": { + "name": "created", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "updated": { + "name": "updated", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "renamed": { + "name": "renamed", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "moved": { + "name": "moved", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "deleted": { + "name": "deleted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "restored": { + "name": "restored", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "failed": { + "name": "failed", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + } + }, + "indexes": { + "runs_project_started": { + "name": "runs_project_started", + "columns": [ + "project_id", + "started_at" + ], + "isUnique": false + } + }, + "foreignKeys": { + "runs_project_id_projects_id_fk": { + "name": "runs_project_id_projects_id_fk", + "tableFrom": "runs", + "tableTo": "projects", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + } + }, + "views": {}, + "enums": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "internal": { + "indexes": {} + } +} \ No newline at end of file diff --git a/drizzle/meta/_journal.json b/drizzle/meta/_journal.json new file mode 100644 index 0000000..c154d4a --- /dev/null +++ b/drizzle/meta/_journal.json @@ -0,0 +1,13 @@ +{ + "version": "7", + "dialect": "sqlite", + "entries": [ + { + "idx": 0, + "version": "6", + "when": 1792725790862, + "tag": "0000_init", + "breakpoints": true + } + ] +} \ No newline at end of file diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..7c66ec7 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,42 @@ +import prettier from 'eslint-config-prettier'; +import path from 'node:path'; +import js from '@eslint/js'; +import svelte from 'eslint-plugin-svelte'; +import { defineConfig, includeIgnoreFile } from 'eslint/config'; +import globals from 'globals'; +import ts from 'typescript-eslint'; + +const gitignorePath = path.resolve(import.meta.dirname, '.gitignore'); + +export default defineConfig( + includeIgnoreFile(gitignorePath), + js.configs.recommended, + ts.configs.recommended, + svelte.configs.recommended, + prettier, + svelte.configs.prettier, + { + languageOptions: { globals: { ...globals.browser, ...globals.node } }, + rules: { + // typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects. + // see: https://typescript-eslint.io/troubleshooting/faqs/eslint/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors + 'no-undef': 'off' + } + }, + { + files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'], + languageOptions: { + parserOptions: { + projectService: true, + extraFileExtensions: ['.svelte'], + parser: ts.parser + } + } + }, + { + rules: { + // Allow `const { omitted, ...rest } = obj` to drop fields. + '@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }] + } + } +); diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..deaa1c8 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,4969 @@ +{ + "name": "sharepoint-acc-sync", + "version": "0.0.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "sharepoint-acc-sync", + "version": "0.0.1", + "dependencies": { + "better-sqlite3": "^13.0.2", + "zod": "^4.6.7" + }, + "devDependencies": { + "@eslint/js": "^10.0.1", + "@sveltejs/adapter-node": "^6.0.0", + "@sveltejs/kit": "^3.0.0", + "@sveltejs/vite-plugin-svelte": "^7.2.0", + "@types/better-sqlite3": "^9.6.0", + "@types/node": "^24", + "drizzle-kit": "^0.31.10", + "drizzle-orm": "^0.45.2", + "eslint": "^10.4.1", + "eslint-config-prettier": "^10.1.8", + "eslint-plugin-svelte": "^3.19.0", + "globals": "^17.6.0", + "prettier": "^3.8.3", + "prettier-plugin-svelte": "^4.1.0", + "svelte": "^5.57.1", + "svelte-check": "^4.6.0", + "typescript": "^6.0.3", + "typescript-eslint": "^8.60.1", + "vite": "^8.3.0", + "vitest": "^4.1.8" + } + }, + "node_modules/@cacheable/memory": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@cacheable/memory/-/memory-2.2.0.tgz", + "integrity": "sha512-CTLKqLItRCEixEAewD3/j9DB3/o96gpTPD4eJ1v+DGOlxZRZncRQkGYqqnAGCscYd6RNeXfGeiuCphsPtqyIfQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cacheable/utils": "^2.5.0", + "@keyv/bigmap": "^1.3.1", + "hookified": "^1.15.1", + "keyv": "^5.6.0" + } + }, + "node_modules/@cacheable/utils": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@cacheable/utils/-/utils-2.5.0.tgz", + "integrity": "sha512-buipgOVDkkPXNR5+xBpDw7Zk2n1EvU7qBJCNUcL7rhQ//kfpOXPAvQ511Os0vpLYJ1pZnvudNytkQt2hst3wqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "hashery": "^1.5.1", + "keyv": "^5.6.0" + } + }, + "node_modules/@drizzle-team/brocli": { + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/@drizzle-team/brocli/-/brocli-0.10.2.tgz", + "integrity": "sha512-z33Il7l5dKjUgGULTqBsQBQwckHh5AbIuxhdsIxDDiZAzBOrZO6q9ogcWC65kU382AfynTfgNumVcNIjuIua6w==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/@esbuild-kit/core-utils": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/@esbuild-kit/core-utils/-/core-utils-3.3.2.tgz", + "integrity": "sha512-sPRAnw9CdSsRmEtnsl2WXWdyquogVpB3yZ3dgwJfe8zrOzTsV7cJvmwrKVa+0ma5BoiGJ+BoqkMvawbayKUsqQ==", + "deprecated": "Merged into tsx: https://tsx.hirok.io", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "~0.18.20", + "source-map-support": "^0.5.21" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/android-arm": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz", + "integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/android-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz", + "integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/android-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz", + "integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/darwin-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz", + "integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/darwin-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz", + "integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/freebsd-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz", + "integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/freebsd-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz", + "integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-arm": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz", + "integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz", + "integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-ia32": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz", + "integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-loong64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz", + "integrity": "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-mips64el": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz", + "integrity": "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-ppc64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz", + "integrity": "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-riscv64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz", + "integrity": "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-s390x": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz", + "integrity": "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz", + "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/netbsd-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz", + "integrity": "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/openbsd-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz", + "integrity": "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/sunos-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz", + "integrity": "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/win32-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz", + "integrity": "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/win32-ia32": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz", + "integrity": "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/win32-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz", + "integrity": "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/esbuild": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", + "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.18.20", + "@esbuild/android-arm64": "0.18.20", + "@esbuild/android-x64": "0.18.20", + "@esbuild/darwin-arm64": "0.18.20", + "@esbuild/darwin-x64": "0.18.20", + "@esbuild/freebsd-arm64": "0.18.20", + "@esbuild/freebsd-x64": "0.18.20", + "@esbuild/linux-arm": "0.18.20", + "@esbuild/linux-arm64": "0.18.20", + "@esbuild/linux-ia32": "0.18.20", + "@esbuild/linux-loong64": "0.18.20", + "@esbuild/linux-mips64el": "0.18.20", + "@esbuild/linux-ppc64": "0.18.20", + "@esbuild/linux-riscv64": "0.18.20", + "@esbuild/linux-s390x": "0.18.20", + "@esbuild/linux-x64": "0.18.20", + "@esbuild/netbsd-x64": "0.18.20", + "@esbuild/openbsd-x64": "0.18.20", + "@esbuild/sunos-x64": "0.18.20", + "@esbuild/win32-arm64": "0.18.20", + "@esbuild/win32-ia32": "0.18.20", + "@esbuild/win32-x64": "0.18.20" + } + }, + "node_modules/@esbuild-kit/esm-loader": { + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/@esbuild-kit/esm-loader/-/esm-loader-2.6.5.tgz", + "integrity": "sha512-FxEMIkJKnodyA1OaCUoEvbYRkoZlLZ4d/eXFu9Fh8CbBBgP5EmZxrfTRyN0qpXZ4vOvqnE5YdRdcrmUUXuU+dA==", + "deprecated": "Merged into tsx: https://tsx.hirok.io", + "dev": true, + "license": "MIT", + "dependencies": { + "@esbuild-kit/core-utils": "^3.3.2", + "get-tsconfig": "^4.7.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz", + "integrity": "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.2.tgz", + "integrity": "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.2.tgz", + "integrity": "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.2.tgz", + "integrity": "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.2.tgz", + "integrity": "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.2.tgz", + "integrity": "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.2.tgz", + "integrity": "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.2.tgz", + "integrity": "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.2.tgz", + "integrity": "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.2.tgz", + "integrity": "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.2.tgz", + "integrity": "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.2.tgz", + "integrity": "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.2.tgz", + "integrity": "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.2.tgz", + "integrity": "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.2.tgz", + "integrity": "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.2.tgz", + "integrity": "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.2.tgz", + "integrity": "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.2.tgz", + "integrity": "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.2.tgz", + "integrity": "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.2.tgz", + "integrity": "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.2.tgz", + "integrity": "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.2.tgz", + "integrity": "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.2.tgz", + "integrity": "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.2.tgz", + "integrity": "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.2.tgz", + "integrity": "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.2.tgz", + "integrity": "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.10.1.tgz", + "integrity": "sha512-cuadcxVFE8sDK6iWJbs8Sn0av2Nrh2QSGQhVlBW9AaAHqHwjWsZHT8LJ4hFGPh7ASBV2deFdM7H/DPjulmh8rg==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.23.5", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.5.tgz", + "integrity": "sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^3.0.5", + "debug": "^4.3.1", + "minimatch": "^10.2.4" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.7.0.tgz", + "integrity": "sha512-DObd/KKUsU+FaFv4PLxSRenpXfQWmPXXP3pPZ6/K1PCrMu2vQpMDMuQe/BqYeoLcz8ro0bVDF1RxOJgfVEdhUw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^1.2.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/core": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-1.2.1.tgz", + "integrity": "sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/js": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-10.0.1.tgz", + "integrity": "sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "eslint": "^10.0.0" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "node_modules/@eslint/object-schema": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-3.0.5.tgz", + "integrity": "sha512-vqTaUEgxzm+YDSdElad6PiRoX4t8VGDjCtt05zn4nU810UIx/uNEV7/lZJ6KwFThKZOzOxzXy48da+No7HZaMw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.7.3.tgz", + "integrity": "sha512-IkO+/KEUvwbVpiURZg+P7zF74z5Jxe0UgJxVni+RtoHQ6IZieXaO02kmadomap/q+l6bc/jdPGGqTjhuZnuz1Q==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^1.2.1", + "levn": "^0.4.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@humanfs/core": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.2.tgz", + "integrity": "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/types": "^0.15.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.8", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.8.tgz", + "integrity": "sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.2", + "@humanfs/types": "^0.15.0", + "@humanwhocodes/retry": "^0.4.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/types": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/@humanfs/types/-/types-0.15.0.tgz", + "integrity": "sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@keyv/bigmap": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@keyv/bigmap/-/bigmap-1.3.1.tgz", + "integrity": "sha512-WbzE9sdmQtKy8vrNPa9BRnwZh5UF4s1KTmSK0KUVLo3eff5BlQNNWDnFOouNpKfPKDnms9xynJjsMYjMaT/aFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "hashery": "^1.4.0", + "hookified": "^1.15.0" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "keyv": "^5.6.0" + } + }, + "node_modules/@keyv/serialize": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@keyv/serialize/-/serialize-1.1.1.tgz", + "integrity": "sha512-dXn3FZhPv0US+7dtJsIi2R+c7qWYiReoEh5zUntWCf4oSpMNib8FDhSoed6m3QyZdx5hK7iLFkYk3rNxwt8vTA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@oxc-project/types": { + "version": "0.155.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.155.0.tgz", + "integrity": "sha512-SeE8JPwW1xs1tHeNycjUtUBdhorRa8o4jlvjwk49R7/Z291i+4DQa7JJIgOm/TaYQZx+QrPQbVJ/9c8dMIZN8Q==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/oxc-project" + } + }, + "node_modules/@polka/url": { + "version": "1.0.0-next.29", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.29.tgz", + "integrity": "sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww==", + "dev": true, + "license": "MIT" + }, + "node_modules/@rolldown/binding-android-arm-eabi": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.15.tgz", + "integrity": "sha512-aLcgK9gIJ3YRvrrtfSBbRa27F5WrpiTaPulnFpsHPxpUHgFlSgnU4854MHwoRGEBhfRJDWCS2WQ7lIjskE9Olw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.15.tgz", + "integrity": "sha512-xD7DdZCrbThKuxNg7ooQmvp07ys4J/pnSEMTG3/OdOWl6daC67m/Q4fL78sRHMxTH/N4fGUbYhcPM0MF5WFHkg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.15.tgz", + "integrity": "sha512-m2WuQ6r0B4OTYxyPpNLtXaMRbRDUbG8YQV2Q3KTdSSK8Th6KHCnC8jVCJt8bvYeSB5WivkkNbc85mKadaSdOxA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.15.tgz", + "integrity": "sha512-5RtnsHM36nodM9WbMy+zip0LGS/G+y5wro5RHrpOlr4ac24+1zSi9kiV2MP1myZeZ/ifEHfulQcWjnAXzc2C2A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.15.tgz", + "integrity": "sha512-g3l09pyFqhu+135JKkbkwiKGQmwU5hUMUPJ4VdBADvuqR8d33L6H578rh8m7rtxbdp+VmX/+nzI7nvhSZlzpUQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.15.tgz", + "integrity": "sha512-nIe3VugI97nGQtspPxDqA4sXMUpeiocKIP/CqpY/u/vgbT+alX+cVxu1C/oVBPKg4feNTmYovE91v4DgXvXNwQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.15.tgz", + "integrity": "sha512-iTBjXx+B5QSvgI89lJfmqh4wTh8NabR1YZIIN3hNx4zSG0EVfVqkOvLulNpG4251pbd6/IAmZ/LefVk1Y4rPhw==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.15.tgz", + "integrity": "sha512-uN26XOnVR7rqQupG3V9oAG2EGGatWjcJHOeDOHUFCh4TBWmP2tHTFoVN13aYbwfm0aHqJAEmcwhAu6sooIjfqQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.15.tgz", + "integrity": "sha512-9nWkcdd+H+XhaA3fQIwpHnKIrfx/PQ6rO0pivr78Og07tXlUlctBBJoEYLPfhTmCR/QxEVdn6uPjHV5SymPhdw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.15.tgz", + "integrity": "sha512-Ggh0ciFjLwIusLSLz7LZYEaGdxOAUJXI+Qu5JCbhPJJHEt8vP+IjRATTJheiJsdzzTYgUiHUiw3X1Ea3ZpMBdA==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.15.tgz", + "integrity": "sha512-FHg60rS6DBePAYZ9X9F67x+JObFdmgn6tupA1C/a3B+CufFmTD4mX+e8M75tCiAO3foR/6xwVBI0KQiI7sn/rw==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.15.tgz", + "integrity": "sha512-/cvV/7v5VGz/moiz0XKRj2dE8DzsKyhIu1KpOvJGPjRywg3yscON889UGvAe8zfiJLHup7VLjBduoGWi3HusWQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.15.tgz", + "integrity": "sha512-MyzC5Hrv/sm+Z7TSGKP/j8001RO2xQm1zOpCNVL4j0cY/VhBZviludA2YFQ7i4lH6ZAXxQm0lcMdBzM+99mE7w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.15.tgz", + "integrity": "sha512-+PgYiS+AH5omy6L45ZLxybasauJaj3M8buoT83D+nzPmCayXlxUV9hydhciCKVyIg0B/v0BtXPDE1uGqNwCPpg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.15.tgz", + "integrity": "sha512-HFZd2QNQYn1JbIi+Hpd7H+r/lkWxcfIu28nirZ6eCn2LafuvmExMlb/P96Sfx5tf7pPArw39IdhmCF8vmV+NhQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", + "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@standard-schema/spec": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz", + "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@sveltejs/acorn-typescript": { + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/@sveltejs/acorn-typescript/-/acorn-typescript-1.0.13.tgz", + "integrity": "sha512-wgKggnhZVL9Bfx1OaKKTrYY9BFRk6C8UAkQNUcIv1+llzYrIqy+RZm5HPKzn0NpEBvTVhTqB4kQyllZywsRBRQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^8.9.0" + } + }, + "node_modules/@sveltejs/adapter-node": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@sveltejs/adapter-node/-/adapter-node-6.0.0.tgz", + "integrity": "sha512-s7muM4JmJ75OZ8o0G4VRhrEKdi8twuEm3t2o/qQsdlm12hKaX7S/CuUBuw3n983wB/IFBSpzG2ugX0xdGzbKwg==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@sveltejs/kit": "^3.0.0-next.0" + } + }, + "node_modules/@sveltejs/kit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-3.1.0.tgz", + "integrity": "sha512-JTWlq2HQlkqx6vIoxhC0R6sc4WVqbQoRyEmr5YlqKmiYbzY1U3awtSWTmjMLlS056a49AmkQR6rnNANXIE8B0Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rolldown/pluginutils": "^1.0.1", + "@standard-schema/spec": "^1.1.0", + "cookie": "^2.0.1", + "devalue": "^5.9.4", + "esm-env": "^1.2.2", + "magic-string": "^1.2.3", + "mrmime": "^2.0.1", + "sirv": "^3.0.2" + }, + "bin": { + "svelte-kit": "svelte-kit.js" + }, + "engines": { + "node": ">=22.17" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0", + "@sveltejs/vite-plugin-svelte": "^7.0.0", + "svelte": "^5.57.1", + "typescript": "^6.0.0", + "vite": "^8.0.12" + }, + "peerDependenciesMeta": { + "@opentelemetry/api": { + "optional": true + }, + "typescript": { + "optional": true + } + } + }, + "node_modules/@sveltejs/load-config": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@sveltejs/load-config/-/load-config-0.2.3.tgz", + "integrity": "sha512-VT3qmUb8pRV2QrZjd8iAmtg8lf4W0TIjZbvXtz5MKei/q96teWZgGJyyidJzOjzZzvdq616eSRVeMYIQChUTAQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 18.0.0" + } + }, + "node_modules/@sveltejs/vite-plugin-svelte": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-7.3.1.tgz", + "integrity": "sha512-ZPsLN8B1e/En+Ak5s4V7srFDT532oS0qieLsQwu63NGKsS+iAjoO2Js1BochlHlglcU+Pt7WAO3C5Ee+4f6gVA==", + "dev": true, + "license": "MIT", + "dependencies": { + "deepmerge": "^4.3.1", + "magic-string": "^1.0.0", + "obug": "^2.1.0", + "vitefu": "^1.1.2" + }, + "engines": { + "node": "^20.19 || ^22.12 || >=24" + }, + "peerDependencies": { + "svelte": "^5.46.4", + "vite": "^8.0.0-beta.7 || ^8.0.0" + } + }, + "node_modules/@types/better-sqlite3": { + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/@types/better-sqlite3/-/better-sqlite3-9.6.0.tgz", + "integrity": "sha512-ZEEwBSgMu7GYJOynoagg5X9JbxfL6dTJDsgViJIqh67jV44kyOr9RXfmFjLK5rzC4MWssP06t9hu/JwGDnUbCg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/chai": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", + "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/deep-eql": "*", + "assertion-error": "^2.0.1" + } + }, + "node_modules/@types/deep-eql": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", + "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/esrecurse": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@types/esrecurse/-/esrecurse-4.3.1.tgz", + "integrity": "sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "24.19.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.19.2.tgz", + "integrity": "sha512-93d49wCWJkCyN87MxLpNN6KXPCwFw7bVUg79mGUV1OS40JGWwVCr8n61DXCSqz7CV6/VfPkb7xec7uP2M+QHWQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": ">=7.24.0 <7.24.7" + } + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.72.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.72.0.tgz", + "integrity": "sha512-aysKgysPX9XOv/dk95UkvUDe++Q3n3dJPG9CEWT3RUccxfkPJ+Qn6nhKPDhZXU6Ofo9kgwGWwKyQCnZIXTgngg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.12.2", + "@typescript-eslint/scope-manager": "8.72.0", + "@typescript-eslint/type-utils": "8.72.0", + "@typescript-eslint/utils": "8.72.0", + "@typescript-eslint/visitor-keys": "8.72.0", + "ignore": "^7.0.5", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.72.0", + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "7.0.13", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.13.tgz", + "integrity": "sha512-2E8Q6rh+1RRSq/YdaGsNfXsEZy9FVqv6BSSrkmZJP7BnaoPnRfKL+YaofPvP+5rzdk144qSm6i4+hvPgUcbV4Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "8.72.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.72.0.tgz", + "integrity": "sha512-0O+x3ynciD6zuXb1CKSu165haQV6ey53DKhHHUnujP7U+XlltJG+/keT0Xhd1HXCze+IHf7Tvt39ovyepX/LNw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/scope-manager": "8.72.0", + "@typescript-eslint/types": "8.72.0", + "@typescript-eslint/typescript-estree": "8.72.0", + "@typescript-eslint/visitor-keys": "8.72.0", + "debug": "^4.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/project-service": { + "version": "8.72.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.72.0.tgz", + "integrity": "sha512-bzHngBbmIgzj6TsTjVUCntGx6FFLgE7mPjpO0PzHycOaZHXqS43XnrkFIHRS16LLr/xO6FHSXG3GJFo/F4bSBQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/tsconfig-utils": "^8.72.0", + "@typescript-eslint/types": "^8.72.0", + "debug": "^4.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.72.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.72.0.tgz", + "integrity": "sha512-JewPyJOYcXBSAS7PIgufscHOwZqhTGyBRiQJhhuDln66tMchxvvt7nJ90JKKIoOelmdHA3kAQbm9cEUHc4JSEA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.72.0", + "@typescript-eslint/visitor-keys": "8.72.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.72.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.72.0.tgz", + "integrity": "sha512-0vbxCf7xLVPSjcOdm6eQbgViH8EDJ8xnl1laLT9yoqSz2YmcSfSg5Vdl0JUvZf6rcuJ0ZivJIuMD4edTg8obaA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.72.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.72.0.tgz", + "integrity": "sha512-gEXxmmbSTSOVTC37IYYvremOM31v+UN2W772bJxmVYPhAOPSUxtacyb7wkm1EhkYKU6KzFJsdU44DCV4to0LWw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.72.0", + "@typescript-eslint/typescript-estree": "8.72.0", + "@typescript-eslint/utils": "8.72.0", + "debug": "^4.4.3", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "8.72.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.72.0.tgz", + "integrity": "sha512-Adfoy59kxNEjT5E5fnyrp7GpHYuWs8ONbdohu4ez6IU46qDq8LltG90tLmkucZB2uhYL8mqBjtXqGd8yhfjXqQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.72.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.72.0.tgz", + "integrity": "sha512-gwLfFgWcw15tN2KXDCJvxEOQjPn+P3j/n3eSqkZ5sX4VpW9Cosodr+tWwBZRvJT3TcKx6HnPRGZMCNAiP1Xhug==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/project-service": "8.72.0", + "@typescript-eslint/tsconfig-utils": "8.72.0", + "@typescript-eslint/types": "8.72.0", + "@typescript-eslint/visitor-keys": "8.72.0", + "debug": "^4.4.3", + "minimatch": "^10.2.2", + "semver": "^7.7.3", + "tinyglobby": "^0.2.15", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.72.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.72.0.tgz", + "integrity": "sha512-0up3oArJZBYnzOaEXKo8DmI43QvMZyPoFEt9LWzRJcyl/RcJjfKKPebknN1VbTgXBf3M/KggUh5uUMdURLnseg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.9.1", + "@typescript-eslint/scope-manager": "8.72.0", + "@typescript-eslint/types": "8.72.0", + "@typescript-eslint/typescript-estree": "8.72.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.72.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.72.0.tgz", + "integrity": "sha512-E2mroviasaWecDzTGiGMtuEguuLVOeRggnrIn93CJuxYJzQBHbyymlT08aVQydbBal5538o+JkBKXh2sRuCyIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.72.0", + "eslint-visitor-keys": "^5.0.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@vitest/expect": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.1.11.tgz", + "integrity": "sha512-VX2x5vNJXET47KAFzwERI+KRMtTTCSWTfSMKsW7JsUsXV4psq++e3DvZpuTDOpHcxytiDs6p2nhVb2tVDiiUYw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@standard-schema/spec": "^1.1.0", + "@types/chai": "^5.2.2", + "@vitest/spy": "4.1.11", + "@vitest/utils": "4.1.11", + "chai": "^6.2.2", + "tinyrainbow": "^3.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/mocker": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.1.11.tgz", + "integrity": "sha512-2XJVD55d1o5AZous5CCGKS74g/riOj9odEt2bQpCVZeblHyHdnMeFl4jl0XjU21stf4mbjUkew2eXQZt65g5CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "4.1.11", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.21" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@vitest/mocker/node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/@vitest/pretty-format": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.1.11.tgz", + "integrity": "sha512-yiZzPbGTS9Sr/JpFl8zHrcIkAofNbFV6k21vIgQN/cY/oxZeXhJv5sc/MBJ5jFKWmWs+oJHw0UXLZjmf931+Vw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^3.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.1.11.tgz", + "integrity": "sha512-LztvUgdwMNJMIkj3hQnnxiC2Xy1zNxq928W/xhjCLaNCzqTZOudjwbQf6v9IntZGPw132i2Lq2rgTRZHD3JHNw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "4.1.11", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.1.11.tgz", + "integrity": "sha512-pN7ikn1ON7h8ee4gIAp4AzyK+zBtJPzVbqOgu5LCEh4VaJVbPQcgYQYJIMGQPXVeJJq1fnfazis7a5pFNPahog==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "4.1.11", + "@vitest/utils": "4.1.11", + "magic-string": "^0.30.21", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot/node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/@vitest/spy": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.1.11.tgz", + "integrity": "sha512-apNa/prQy2qCeywhnixOHPRCgGNhvg7T4Dapfl1GahLp/R+uhBm5cPyFoNVyqsNd2h1nJxL6BqqdIjiABL60YA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.1.11.tgz", + "integrity": "sha512-zTCVGpyFsGWBhllOyKlTw/vnr6D9qxsfSDyfbyZmTyjHw5N/VuvzHpHoQjm2ZJzn4RJgx5w4r7V0er69CmLgPQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "4.1.11", + "convert-source-map": "^2.0.0", + "tinyrainbow": "^3.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/acorn": { + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.19.0.tgz", + "integrity": "sha512-oJlA3XiRm7Cyk6qFD2Jn8ak9B7jSy0qy00ADO3+8dpT0LSjFihQYv4C02LFCSYJV3Q37xYwwRy5m+IpIiUzqWw==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz", + "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/aria-query": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.1.tgz", + "integrity": "sha512-Z/ZeOgVl7bcSYZ/u/rh0fOpvEpq//LZmdbkXyc7syVzjPAhfOa9ebsdTSjEBDU4vs5nC98Kfduj1uFo0qyET3g==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/axobject-query": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz", + "integrity": "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/better-sqlite3": { + "version": "13.0.3", + "resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-13.0.3.tgz", + "integrity": "sha512-RbOBxmLBG8uvFUc15X9+9SFemKcQ0WBuISBVkpuiaUB2qblC8UWlHEjdWVoZ8AdhSwmoEgsiXKfopX0CQxaACQ==", + "license": "MIT", + "dependencies": { + "node-addon-api": "^8.0.0" + }, + "engines": { + "node": ">=22" + } + }, + "node_modules/brace-expansion": { + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", + "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/cacheable": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/cacheable/-/cacheable-2.5.0.tgz", + "integrity": "sha512-60cyAOytib/OzBw1JNSoSV/boK1AtHryDIjvVBk7XbN4ugfkM3+Sry7fEjNgPMGgOjuaZPAp8ruZ0Cxafwyq9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cacheable/memory": "^2.2.0", + "@cacheable/utils": "^2.5.0", + "hookified": "^1.15.0", + "keyv": "^5.6.0", + "qified": "^0.10.1" + } + }, + "node_modules/chai": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-6.3.0.tgz", + "integrity": "sha512-XWAtwJ6OHO+tj0EKCs0Y2UamnyOxseZWltU4x2U2wh8g4AigdjwvtUjvLP2tqkA/avxHEtzxNaqGq/YGNwckKg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cookie": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-2.0.1.tgz", + "integrity": "sha512-yuToqVvRrj6pfDXREyQAAv8SkAEk/8GS3jQRTiUMm66TVtBYmqQeoEjL2Lmq8Rpo6271vH76InTChTitEAm65w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=22" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true, + "license": "MIT", + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/devalue": { + "version": "5.9.4", + "resolved": "https://registry.npmjs.org/devalue/-/devalue-5.9.4.tgz", + "integrity": "sha512-sPAT4pztbu6586/hrhOnMKS17IJrvg12mXiSPSS3W5qDeN2RGgvZ0diZCm31dBbnevfVmujNO3IM2wrS4Y2Rhg==", + "dev": true, + "license": "MIT" + }, + "node_modules/drizzle-kit": { + "version": "0.31.11", + "resolved": "https://registry.npmjs.org/drizzle-kit/-/drizzle-kit-0.31.11.tgz", + "integrity": "sha512-YCYqxTLIB2OCqf6w9/Vef13baBVbwQIPcbT4Y56AfO6B9ajZhDhD8Jkveg/hJvT/iuMloKD/IYYkyMMNhr7Kqg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@drizzle-team/brocli": "^0.10.2", + "@esbuild-kit/esm-loader": "^2.5.5", + "esbuild": "^0.25.4", + "tsx": "^4.21.0" + }, + "bin": { + "drizzle-kit": "bin.cjs" + } + }, + "node_modules/drizzle-kit/node_modules/@esbuild/aix-ppc64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz", + "integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/drizzle-kit/node_modules/@esbuild/android-arm": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz", + "integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/drizzle-kit/node_modules/@esbuild/android-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz", + "integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/drizzle-kit/node_modules/@esbuild/android-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz", + "integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/drizzle-kit/node_modules/@esbuild/darwin-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz", + "integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/drizzle-kit/node_modules/@esbuild/darwin-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz", + "integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/drizzle-kit/node_modules/@esbuild/freebsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz", + "integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/drizzle-kit/node_modules/@esbuild/freebsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz", + "integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/drizzle-kit/node_modules/@esbuild/linux-arm": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz", + "integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/drizzle-kit/node_modules/@esbuild/linux-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz", + "integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/drizzle-kit/node_modules/@esbuild/linux-ia32": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz", + "integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/drizzle-kit/node_modules/@esbuild/linux-loong64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz", + "integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/drizzle-kit/node_modules/@esbuild/linux-mips64el": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz", + "integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/drizzle-kit/node_modules/@esbuild/linux-ppc64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz", + "integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/drizzle-kit/node_modules/@esbuild/linux-riscv64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz", + "integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/drizzle-kit/node_modules/@esbuild/linux-s390x": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz", + "integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/drizzle-kit/node_modules/@esbuild/linux-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz", + "integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/drizzle-kit/node_modules/@esbuild/netbsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz", + "integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/drizzle-kit/node_modules/@esbuild/netbsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz", + "integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/drizzle-kit/node_modules/@esbuild/openbsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz", + "integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/drizzle-kit/node_modules/@esbuild/openbsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz", + "integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/drizzle-kit/node_modules/@esbuild/openharmony-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz", + "integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/drizzle-kit/node_modules/@esbuild/sunos-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz", + "integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/drizzle-kit/node_modules/@esbuild/win32-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz", + "integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/drizzle-kit/node_modules/@esbuild/win32-ia32": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz", + "integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/drizzle-kit/node_modules/@esbuild/win32-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz", + "integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/drizzle-kit/node_modules/esbuild": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz", + "integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.25.12", + "@esbuild/android-arm": "0.25.12", + "@esbuild/android-arm64": "0.25.12", + "@esbuild/android-x64": "0.25.12", + "@esbuild/darwin-arm64": "0.25.12", + "@esbuild/darwin-x64": "0.25.12", + "@esbuild/freebsd-arm64": "0.25.12", + "@esbuild/freebsd-x64": "0.25.12", + "@esbuild/linux-arm": "0.25.12", + "@esbuild/linux-arm64": "0.25.12", + "@esbuild/linux-ia32": "0.25.12", + "@esbuild/linux-loong64": "0.25.12", + "@esbuild/linux-mips64el": "0.25.12", + "@esbuild/linux-ppc64": "0.25.12", + "@esbuild/linux-riscv64": "0.25.12", + "@esbuild/linux-s390x": "0.25.12", + "@esbuild/linux-x64": "0.25.12", + "@esbuild/netbsd-arm64": "0.25.12", + "@esbuild/netbsd-x64": "0.25.12", + "@esbuild/openbsd-arm64": "0.25.12", + "@esbuild/openbsd-x64": "0.25.12", + "@esbuild/openharmony-arm64": "0.25.12", + "@esbuild/sunos-x64": "0.25.12", + "@esbuild/win32-arm64": "0.25.12", + "@esbuild/win32-ia32": "0.25.12", + "@esbuild/win32-x64": "0.25.12" + } + }, + "node_modules/drizzle-orm": { + "version": "0.45.4", + "resolved": "https://registry.npmjs.org/drizzle-orm/-/drizzle-orm-0.45.4.tgz", + "integrity": "sha512-NiM1YZpJ2UxyeE67DpDDZ+Tsw4YLX3trSlkNT7Tm9eKoUNb1LvaAaQzXgYQsWs+AQ9TUmmwMmBOCXuqqxUWKKQ==", + "dev": true, + "license": "Apache-2.0", + "peerDependencies": { + "@aws-sdk/client-rds-data": ">=3", + "@cloudflare/workers-types": ">=4", + "@electric-sql/pglite": ">=0.2.0", + "@libsql/client": ">=0.10.0", + "@libsql/client-wasm": ">=0.10.0", + "@neondatabase/serverless": ">=0.10.0", + "@netlify/db": ">=0.4.0", + "@op-engineering/op-sqlite": ">=2", + "@opentelemetry/api": "^1.4.1", + "@planetscale/database": ">=1.13", + "@prisma/client": "*", + "@tidbcloud/serverless": "*", + "@types/better-sqlite3": "*", + "@types/pg": "*", + "@types/sql.js": "*", + "@upstash/redis": ">=1.34.7", + "@vercel/postgres": ">=0.8.0", + "@xata.io/client": "*", + "better-sqlite3": ">=7", + "bun-types": "*", + "expo-sqlite": ">=14.0.0", + "gel": ">=2", + "knex": "*", + "kysely": "*", + "mysql2": ">=2", + "pg": ">=8", + "postgres": ">=3", + "sql.js": ">=1", + "sqlite3": ">=5" + }, + "peerDependenciesMeta": { + "@aws-sdk/client-rds-data": { + "optional": true + }, + "@cloudflare/workers-types": { + "optional": true + }, + "@electric-sql/pglite": { + "optional": true + }, + "@libsql/client": { + "optional": true + }, + "@libsql/client-wasm": { + "optional": true + }, + "@neondatabase/serverless": { + "optional": true + }, + "@netlify/db": { + "optional": true + }, + "@op-engineering/op-sqlite": { + "optional": true + }, + "@opentelemetry/api": { + "optional": true + }, + "@planetscale/database": { + "optional": true + }, + "@prisma/client": { + "optional": true + }, + "@tidbcloud/serverless": { + "optional": true + }, + "@types/better-sqlite3": { + "optional": true + }, + "@types/pg": { + "optional": true + }, + "@types/sql.js": { + "optional": true + }, + "@upstash/redis": { + "optional": true + }, + "@vercel/postgres": { + "optional": true + }, + "@xata.io/client": { + "optional": true + }, + "better-sqlite3": { + "optional": true + }, + "bun-types": { + "optional": true + }, + "expo-sqlite": { + "optional": true + }, + "gel": { + "optional": true + }, + "knex": { + "optional": true + }, + "kysely": { + "optional": true + }, + "mysql2": { + "optional": true + }, + "pg": { + "optional": true + }, + "postgres": { + "optional": true + }, + "prisma": { + "optional": true + }, + "sql.js": { + "optional": true + }, + "sqlite3": { + "optional": true + } + } + }, + "node_modules/es-module-lexer": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.3.2.tgz", + "integrity": "sha512-poHGpORABojJJucnV9KbOavETW8lBVnphkW77ER5/BQ5Fz7oXSoCNek7IH3vR5nRjdsEz926ibFYX8KtLQmdyw==", + "dev": true, + "license": "MIT" + }, + "node_modules/esbuild": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.2.tgz", + "integrity": "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.28.2", + "@esbuild/android-arm": "0.28.2", + "@esbuild/android-arm64": "0.28.2", + "@esbuild/android-x64": "0.28.2", + "@esbuild/darwin-arm64": "0.28.2", + "@esbuild/darwin-x64": "0.28.2", + "@esbuild/freebsd-arm64": "0.28.2", + "@esbuild/freebsd-x64": "0.28.2", + "@esbuild/linux-arm": "0.28.2", + "@esbuild/linux-arm64": "0.28.2", + "@esbuild/linux-ia32": "0.28.2", + "@esbuild/linux-loong64": "0.28.2", + "@esbuild/linux-mips64el": "0.28.2", + "@esbuild/linux-ppc64": "0.28.2", + "@esbuild/linux-riscv64": "0.28.2", + "@esbuild/linux-s390x": "0.28.2", + "@esbuild/linux-x64": "0.28.2", + "@esbuild/netbsd-arm64": "0.28.2", + "@esbuild/netbsd-x64": "0.28.2", + "@esbuild/openbsd-arm64": "0.28.2", + "@esbuild/openbsd-x64": "0.28.2", + "@esbuild/openharmony-arm64": "0.28.2", + "@esbuild/sunos-x64": "0.28.2", + "@esbuild/win32-arm64": "0.28.2", + "@esbuild/win32-ia32": "0.28.2", + "@esbuild/win32-x64": "0.28.2" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "10.13.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.13.0.tgz", + "integrity": "sha512-UohDjD4zSzEwhf58M3O7vc/ycc8O1I7dNlhtD0WxE8Px8EHNJKtUwzBqrzeGhisRuv2ag4sAYswszCJRgKXYUg==", + "dev": true, + "license": "MIT", + "workspaces": [ + "packages/*" + ], + "dependencies": { + "@eslint-community/eslint-utils": "^4.8.0", + "@eslint-community/regexpp": "^4.12.2", + "@eslint/config-array": "^0.23.5", + "@eslint/config-helpers": "^0.7.0", + "@eslint/core": "^1.2.1", + "@eslint/plugin-kit": "^0.7.3", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "ajv": "^6.14.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^9.1.2", + "eslint-visitor-keys": "^5.0.1", + "espree": "^11.2.0", + "esquery": "^1.7.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "11.1.5 || >11.1.6 <12", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "minimatch": "^10.2.5", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + } + }, + "node_modules/eslint-config-prettier": { + "version": "10.1.8", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.8.tgz", + "integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==", + "dev": true, + "license": "MIT", + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "funding": { + "url": "https://opencollective.com/eslint-config-prettier" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-plugin-svelte": { + "version": "3.23.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-svelte/-/eslint-plugin-svelte-3.23.1.tgz", + "integrity": "sha512-+w86Jlx4IRUuuvtqD6j4njql+akx+81JnpvbN5de3AV5iq2SexvST/Jr51CiTlKeY0i+vhoKjPO/ywFKIP75sA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.6.1", + "@jridgewell/sourcemap-codec": "^1.5.0", + "esutils": "^2.0.3", + "globals": "^16.0.0", + "known-css-properties": "^0.37.0", + "postcss": "^8.4.49", + "postcss-load-config": "^3.1.4", + "postcss-safe-parser": "^7.0.0", + "semver": "^7.6.3", + "svelte-eslint-parser": "^1.7.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://github.com/sponsors/ota-meshi" + }, + "peerDependencies": { + "eslint": "^8.57.1 || ^9.0.0 || ^10.0.0", + "svelte": "^3.37.0 || ^4.0.0 || ^5.0.0" + }, + "peerDependenciesMeta": { + "svelte": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-svelte/node_modules/globals": { + "version": "16.5.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-16.5.0.tgz", + "integrity": "sha512-c/c15i26VrJ4IRt5Z89DnIzCGDn9EcebibhAOjw5ibqEHsE1wLUgkPn9RDmNcUKyU87GeaL633nyJ+pplFR2ZQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint-scope": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-9.1.2.tgz", + "integrity": "sha512-xS90H51cKw0jltxmvmHy2Iai1LIqrfbw57b79w/J7MfvDfkIkFZ+kj6zC3BjtUwh150HsSSdxXZcsuv72miDFQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@types/esrecurse": "^4.3.1", + "@types/estree": "^1.0.8", + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", + "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esm-env": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/esm-env/-/esm-env-1.2.2.tgz", + "integrity": "sha512-Epxrv+Nr/CaL4ZcFGPJIYLWFom+YeV1DqMLHJoEd9SYRxNbaFruBwfEX/kkHUJf55j2+TUbmDcmuilbP1TmXHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/espree": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-11.2.0.tgz", + "integrity": "sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.16.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^5.0.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", + "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrap": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/esrap/-/esrap-2.4.0.tgz", + "integrity": "sha512-CQPcneEHw/czj32uwQC52nYnax8H4SXt25FCM+LIwGZ49cMIxpOj3bP8wmzcI+Z0HIy5KkClaPhRLfCySzwHPA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15" + }, + "peerDependencies": { + "@typescript-eslint/types": "^8.2.0" + }, + "peerDependenciesMeta": { + "@typescript-eslint/types": { + "optional": true + } + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expect-type": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.4.0.tgz", + "integrity": "sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/file-entry-cache": { + "version": "11.1.5", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-11.1.5.tgz", + "integrity": "sha512-+PFTHITI08JIGhnNpGNI8T8inUpgZfk3GNEqfT9R2zZV2iFXg3CvqzSl/uEhs7TSGujYRELEANyDvS8Fj7+S7Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^6.1.23" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "6.1.23", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-6.1.23.tgz", + "integrity": "sha512-f++BY9pTk+983xK1FLzlLpmM0i0z+jHmx3QESGkURMXujQZz1k5wzwX6hjnQ8goaD0B+sYnDK1yZ6MTyZfUaqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "cacheable": "^2.5.0", + "flatted": "^3.4.2", + "hookified": "^1.15.0" + } + }, + "node_modules/flatted": { + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.4.tgz", + "integrity": "sha512-5+ybhBZANEJxaH3X5evAFatUxLfEHSr7n6kYJ+1Qd0mUqr4eu9gIf6GDbWHf8RJijHrjjO8G+la14SlL2SeS1Q==", + "dev": true, + "license": "ISC" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/get-tsconfig": { + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.14.3.tgz", + "integrity": "sha512-++QEw4DIY7WGoukz+/+A/8dGYPT9l9yIadnmSgZ8Rjr3YVSVDipQSO9CdnJo9ePqFqUUqh+wk9uIaoiAwsiPkA==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "17.13.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-17.13.0.tgz", + "integrity": "sha512-RwMTC61u7hrG3ZJMkZQOK4JLJrKS8QtoTii63EmWvFXHqycY9FObBJQCbsLxSO8kjKhWE5kV1GC+Vb1g3RI0Zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/hashery": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/hashery/-/hashery-1.5.1.tgz", + "integrity": "sha512-iZyKG96/JwPz1N55vj2Ie2vXbhu440zfUfJvSwEqEbeLluk7NnapfGqa7LH0mOsnDxTF85Mx8/dyR6HfqcbmbQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "hookified": "^1.15.0" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/hookified": { + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/hookified/-/hookified-1.15.1.tgz", + "integrity": "sha512-MvG/clsADq1GPM2KGo2nyfaWVyn9naPiXrqIe4jYjXNZQt238kWyOGrsyc/DmRAQ+Re6yeo6yX/yoNCG5KAEVg==", + "dev": true, + "license": "MIT" + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-reference": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.3.tgz", + "integrity": "sha512-ixkJoqQvAP88E6wLydLGGqCJsrFUnqoH6HnaczB8XmDH1oaWU+xxdptvikTgaEhtZ53Ky6YXiBuUI2WXLMCwjw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.6" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/keyv": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-5.6.0.tgz", + "integrity": "sha512-CYDD3SOtsHtyXeEORYRx2qBtpDJFjRTGXUtmNEMGyzYOKj1TE3tycdlho7kA1Ufx9OYWZzg52QFBGALTirzDSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@keyv/serialize": "^1.1.1" + } + }, + "node_modules/known-css-properties": { + "version": "0.37.0", + "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.37.0.tgz", + "integrity": "sha512-JCDrsP4Z1Sb9JwG0aJ8Eo2r7k4Ou5MwmThS/6lcIe1ICyb7UBJKGRIUUdqc2ASdE/42lgz6zFUnzAIhtXnBVrQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lightningcss": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz", + "integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.33.0", + "lightningcss-darwin-arm64": "1.33.0", + "lightningcss-darwin-x64": "1.33.0", + "lightningcss-freebsd-x64": "1.33.0", + "lightningcss-linux-arm-gnueabihf": "1.33.0", + "lightningcss-linux-arm64-gnu": "1.33.0", + "lightningcss-linux-arm64-musl": "1.33.0", + "lightningcss-linux-x64-gnu": "1.33.0", + "lightningcss-linux-x64-musl": "1.33.0", + "lightningcss-win32-arm64-msvc": "1.33.0", + "lightningcss-win32-x64-msvc": "1.33.0" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.33.0.tgz", + "integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.33.0.tgz", + "integrity": "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.33.0.tgz", + "integrity": "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.33.0.tgz", + "integrity": "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.33.0.tgz", + "integrity": "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.33.0.tgz", + "integrity": "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.33.0.tgz", + "integrity": "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.33.0.tgz", + "integrity": "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.33.0.tgz", + "integrity": "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.33.0.tgz", + "integrity": "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.33.0.tgz", + "integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lilconfig": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", + "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/locate-character": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-character/-/locate-character-3.0.0.tgz", + "integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==", + "dev": true, + "license": "MIT" + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/magic-string": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.4.3.tgz", + "integrity": "sha512-z12OxmaPGE0F4xlpGdjuAUckipLpQlTAuAmyGhNoD7ODpYUzvDfvtxUbjM/jwznyP178oju/KDdyi220wNJ0RQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.6.0" + } + }, + "node_modules/minimatch": { + "version": "10.2.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.8" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/mri": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", + "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/mrmime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.1.tgz", + "integrity": "sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-addon-api": { + "version": "8.9.2", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-8.9.2.tgz", + "integrity": "sha512-VijLXbi3UACN69I0JVXJsX4tjACjNoQDgv2gTF6sx2wWEi8tkSg2eX8p5gSIFi8z2+DL3oHmY6OyKce38SDolg==", + "license": "MIT", + "engines": { + "node": "^18 || ^20 || >= 21" + } + }, + "node_modules/obug": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/obug/-/obug-2.2.1.tgz", + "integrity": "sha512-XrsrhT5sybtKI6wakr2SPOlGZWWYbUXZ7a0jT8/QOeAPau+1X/bSegNe5YR75oJmEZQbKningirmGOEJCIk61Q==", + "dev": true, + "funding": [ + "https://github.com/sponsors/sxzz", + "https://opencollective.com/debug" + ], + "license": "MIT", + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.31.tgz", + "integrity": "sha512-YUbWYCgErwnMAVkjUnYa+KlMBzGpHwiIt/DE7f0G33AuX2LH9UcTk6KgWxd3zRU+pN3u/C+Xl3EnMLM4Hea7Sg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.20", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-load-config": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-3.1.4.tgz", + "integrity": "sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==", + "dev": true, + "license": "MIT", + "dependencies": { + "lilconfig": "^2.0.5", + "yaml": "^1.10.2" + }, + "engines": { + "node": ">= 10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + "peerDependencies": { + "postcss": ">=8.0.9", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "postcss": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "node_modules/postcss-load-config/node_modules/yaml": { + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.3.tgz", + "integrity": "sha512-vIYeF1u3CjlhAFekPPAk2h/Kv4T3mAkMox5OymRiJQB0spDP10LHvt+K7G9Ny6NuuMAb25/6n1qyUjAcGNf/AA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 6" + } + }, + "node_modules/postcss-safe-parser": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/postcss-safe-parser/-/postcss-safe-parser-7.1.0.tgz", + "integrity": "sha512-1WzZxRLaAFwEh6Do+zyGpjWV3nGJNxxhuh7Ubu/q1ICImMgZJnLwhoaEpRbG4pJppp2Y1ncL9ffA2f+LhrefQg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss-safe-parser" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "engines": { + "node": ">=18.0" + }, + "peerDependencies": { + "postcss": "^8.4.31" + } + }, + "node_modules/postcss-scss": { + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/postcss-scss/-/postcss-scss-4.0.9.tgz", + "integrity": "sha512-AjKOeiwAitL/MXxQW2DliT28EKukvvbEWx3LBmJIRN8KfBGZbRTxNYW0kSqi1COiTZ57nZ9NW06S6ux//N1c9A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss-scss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "engines": { + "node": ">=12.0" + }, + "peerDependencies": { + "postcss": "^8.4.29" + } + }, + "node_modules/postcss-selector-parser": { + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.7.tgz", + "integrity": "sha512-wWBro/7hJ40ye6TPiXkUQoXKCw23xSsjriUvqd7Uls9Sso3oLiON1flc18cCdnjgCRXw4fBVqUJJeOdDTh3P3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "3.9.10", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.10.tgz", + "integrity": "sha512-skGHTH1Yb9QvaTC4hWnRTzEYtCpApF0UMBPz+t/0ZPzP8ihefo/btKd+QA7pUE0fEwA1SbS/NmhyEcstdXOIdA==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-plugin-svelte": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/prettier-plugin-svelte/-/prettier-plugin-svelte-4.1.1.tgz", + "integrity": "sha512-wXvbXMjSvb4C9ENWTHXyd+ihakKCsJ6rJhLP6/8HFNj4GkZr48jqL9PoKsl2sk7SyCZRTnJ7O2TTowUpOxP/KA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20" + }, + "peerDependencies": { + "prettier": "^3.0.0", + "svelte": "^5.0.0" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/qified": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/qified/-/qified-0.10.1.tgz", + "integrity": "sha512-+Owyggi9IxT1ePKGafcI87ubSmxol6smwJ+RAHDQlx9+9cPwFWDiKFFCPuWhr9ignlGpZ9vDQLw67N4dcTVFEA==", + "dev": true, + "license": "MIT", + "dependencies": { + "hookified": "^2.1.1" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/qified/node_modules/hookified": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/hookified/-/hookified-2.2.0.tgz", + "integrity": "sha512-p/LgFzRN5FeoD3DLS6bkUapeye6E4SI6yJs6KetENd18S+FBthqYq2amJUWpt5z0EQwwHemidjY5OqJGEKm5uA==", + "dev": true, + "license": "MIT" + }, + "node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, + "node_modules/rolldown": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.15.tgz", + "integrity": "sha512-6odND+fel5zVw3I4Yc2e69gvguDnX0CAAGiNDZSq4ik5WUcaLrkD2GLuog0XcODbor31hZ5ayEMgVDno+KPV5g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oxc-project/types": "=0.155.0", + "@rolldown/pluginutils": "^1.0.0" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm-eabi": "1.2.15", + "@rolldown/binding-android-arm64": "1.2.15", + "@rolldown/binding-darwin-arm64": "1.2.15", + "@rolldown/binding-darwin-x64": "1.2.15", + "@rolldown/binding-freebsd-x64": "1.2.15", + "@rolldown/binding-linux-arm-gnueabihf": "1.2.15", + "@rolldown/binding-linux-arm64-gnu": "1.2.15", + "@rolldown/binding-linux-arm64-musl": "1.2.15", + "@rolldown/binding-linux-ppc64-gnu": "1.2.15", + "@rolldown/binding-linux-s390x-gnu": "1.2.15", + "@rolldown/binding-linux-x64-gnu": "1.2.15", + "@rolldown/binding-linux-x64-musl": "1.2.15", + "@rolldown/binding-openharmony-arm64": "1.2.15", + "@rolldown/binding-win32-arm64-msvc": "1.2.15", + "@rolldown/binding-win32-x64-msvc": "1.2.15" + } + }, + "node_modules/sade": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz", + "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==", + "dev": true, + "license": "MIT", + "dependencies": { + "mri": "^1.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/semver": { + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true, + "license": "ISC" + }, + "node_modules/sirv": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/sirv/-/sirv-3.0.2.tgz", + "integrity": "sha512-2wcC/oGxHis/BoHkkPwldgiPSYcpZK3JU28WoMVv55yHJgcZ8rlXvuG9iZggz+sU1d4bRgIGASwyWqjxu3FM0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@polka/url": "^1.0.0-next.24", + "mrmime": "^2.0.0", + "totalist": "^3.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-js": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz", + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true, + "license": "MIT" + }, + "node_modules/std-env": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.3.0.tgz", + "integrity": "sha512-OtU/EgQ1kIm5KwqQpBC6ZEMXrZRui11w8zgfTWp8cdO9B8OaPsbA8bTHO2P+HNo1VlUTGMVBwPhydu6poeXiag==", + "dev": true, + "license": "MIT" + }, + "node_modules/svelte": { + "version": "5.57.2", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-5.57.2.tgz", + "integrity": "sha512-1YiPCAXT0Ct6g1vOMmSLa0Nsc3QRMvtDF32ihgglGVrugIuIK38RyDiFNXVDhtQ81TJjSO57NdMw6DyYLqSGDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/remapping": "^2.3.5", + "@jridgewell/sourcemap-codec": "^1.6.0", + "@sveltejs/acorn-typescript": "^1.0.13", + "@types/estree": "^1.0.9", + "acorn": "^8.18.0", + "aria-query": "5.3.1", + "axobject-query": "^4.1.0", + "clsx": "^2.1.1", + "devalue": "^5.9.2", + "esm-env": "^1.2.1", + "esrap": "^2.3.6", + "is-reference": "^3.0.3", + "locate-character": "^3.0.0", + "magic-string": "^0.30.11", + "zimmerframe": "^1.1.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/svelte-check": { + "version": "4.7.7", + "resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-4.7.7.tgz", + "integrity": "sha512-Ge2IMdeTpbJuzNFGRiiMg0RWgbScysKQu7xwcyFJ22+DU9F5nPX51+Q3gHmGqRxYQMx2knreVWt5oCtfe0vf2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.25", + "@sveltejs/load-config": "^0.2.3", + "chokidar": "^4.0.1", + "fdir": "^6.2.0", + "picocolors": "^1.0.0", + "sade": "^1.7.4" + }, + "bin": { + "svelte-check": "bin/svelte-check" + }, + "engines": { + "node": ">= 18.0.0" + }, + "peerDependencies": { + "svelte": "^4.0.0 || ^5.0.0-next.0", + "typescript": "^5.0.0 || ^6.0.0" + } + }, + "node_modules/svelte-eslint-parser": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/svelte-eslint-parser/-/svelte-eslint-parser-1.9.0.tgz", + "integrity": "sha512-aKdKQAZP7MobfVcQNyy5Yk0QjlC9m5T1lTS0qA7+0EIsFzFX3WgbGHfb8267QK+4hI8Az9+2f+hk5sp39op8sg==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-scope": "^8.2.0", + "eslint-visitor-keys": "^4.0.0", + "espree": "^10.0.0", + "postcss": "^8.4.49", + "postcss-scss": "^4.0.9", + "postcss-selector-parser": "^7.0.0", + "semver": "^7.7.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0", + "pnpm": "10.34.6" + }, + "funding": { + "url": "https://github.com/sponsors/ota-meshi" + }, + "peerDependencies": { + "svelte": "^3.37.0 || ^4.0.0 || ^5.0.0" + }, + "peerDependenciesMeta": { + "svelte": { + "optional": true + } + } + }, + "node_modules/svelte-eslint-parser/node_modules/eslint-scope": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", + "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/svelte-eslint-parser/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/svelte-eslint-parser/node_modules/espree": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", + "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.15.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/svelte/node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/tinybench": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyexec": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.3.1.tgz", + "integrity": "sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyrainbow": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-3.2.0.tgz", + "integrity": "sha512-LgO3D9yZJjApUiuUfl9iFAwrtaX4+lok3wJIqttGoKCHlWUqHqbQpnxCf82L8FjgKsh4iGo78hqJwgL8F6To2A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/totalist": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz", + "integrity": "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/ts-api-utils": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.5.0.tgz", + "integrity": "sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, + "node_modules/tsx": { + "version": "4.23.15", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.23.15.tgz", + "integrity": "sha512-Yiex1Ovn8z2xPpOWckIiysV1SSyRMY9BkLF++q0yKiDxCqRhosKfMg3janKkiLBwZ5c/YryloKwGZcrEmtwxKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "~0.28.0" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/typescript": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", + "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/typescript-eslint": { + "version": "8.72.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.72.0.tgz", + "integrity": "sha512-r26Fkc8As+mZvqp7SLsMmNFyYUup/6CjK7/eHBHmhOw6GH6n6YFxHVFrG0jN1c5CMpDzelLPxvgeCOzx7BjN+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.72.0", + "@typescript-eslint/parser": "8.72.0", + "@typescript-eslint/typescript-estree": "8.72.0", + "@typescript-eslint/utils": "8.72.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/undici-types": { + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.24.6.tgz", + "integrity": "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==", + "dev": true, + "license": "MIT" + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true, + "license": "MIT" + }, + "node_modules/vite": { + "version": "8.3.5", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.3.5.tgz", + "integrity": "sha512-z1YpjieJ9g0ebTmQpLBv/oq9E3F9EIlOe+7LahW8SrE3LTiG3udBRUXQOlYXP9b+IC2q2phHeVxj9xGlw34OEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "lightningcss": "^1.33.0", + "picomatch": "^4.0.7", + "postcss": "^8.5.30", + "rolldown": "~1.2.14", + "tinyglobby": "^0.2.17" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.7.1 || ^0.8.0", + "esbuild": "^0.27.0 || ^0.28.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vitefu": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-1.1.3.tgz", + "integrity": "sha512-ub4okH7Z5KLjb6hDyjqrGXqWtWvoYdU3IGm/NorpgHncKoLTCfRIbvlhBm7r0YstIaQRYlp4yEbFqDcKSzXSSg==", + "dev": true, + "license": "MIT", + "workspaces": [ + "tests/deps/*", + "tests/projects/*", + "tests/projects/workspace/packages/*" + ], + "peerDependencies": { + "vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "vite": { + "optional": true + } + } + }, + "node_modules/vitest": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-4.1.11.tgz", + "integrity": "sha512-fhACrNXUidIbGSBr5FlbuBkO7VWC1ZyLl0DO4CU2DrQoAPxX84Ysxs+HeGQpii5lZWV1Q4gBZTTu49mF+A6Edw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/expect": "4.1.11", + "@vitest/mocker": "4.1.11", + "@vitest/pretty-format": "4.1.11", + "@vitest/runner": "4.1.11", + "@vitest/snapshot": "4.1.11", + "@vitest/spy": "4.1.11", + "@vitest/utils": "4.1.11", + "es-module-lexer": "^2.0.0", + "expect-type": "^1.3.0", + "magic-string": "^0.30.21", + "obug": "^2.1.1", + "pathe": "^2.0.3", + "picomatch": "^4.0.3", + "std-env": "^4.0.0-rc.1", + "tinybench": "^2.9.0", + "tinyexec": "^1.0.2", + "tinyglobby": "^0.2.15", + "tinyrainbow": "^3.1.0", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0", + "why-is-node-running": "^2.3.0" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@opentelemetry/api": "^1.9.0", + "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0", + "@vitest/browser-playwright": "4.1.11", + "@vitest/browser-preview": "4.1.11", + "@vitest/browser-webdriverio": "4.1.11", + "@vitest/coverage-istanbul": "4.1.11", + "@vitest/coverage-v8": "4.1.11", + "@vitest/ui": "4.1.11", + "happy-dom": "*", + "jsdom": "*", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@opentelemetry/api": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser-playwright": { + "optional": true + }, + "@vitest/browser-preview": { + "optional": true + }, + "@vitest/browser-webdriverio": { + "optional": true + }, + "@vitest/coverage-istanbul": { + "optional": true + }, + "@vitest/coverage-v8": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + }, + "vite": { + "optional": false + } + } + }, + "node_modules/vitest/node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/why-is-node-running": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/zimmerframe": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/zimmerframe/-/zimmerframe-1.1.5.tgz", + "integrity": "sha512-msJxIvYDYcoNL+PJsu+7qmpDWsYmAxTY+2TNYXXF0hzBzBk0BMecOqDOG/EckUoKCuKwObfbugIl8QpqHDXeFA==", + "dev": true, + "license": "MIT" + }, + "node_modules/zod": { + "version": "4.6.7", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.7.tgz", + "integrity": "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..2d61f56 --- /dev/null +++ b/package.json @@ -0,0 +1,52 @@ +{ + "name": "sharepoint-acc-sync", + "private": true, + "version": "0.0.1", + "type": "module", + "scripts": { + "dev": "vite dev", + "build": "vite build", + "preview": "vite preview", + "prepare": "svelte-kit sync || echo ''", + "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", + "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", + "lint": "prettier --check . && eslint .", + "format": "prettier --write .", + "test:unit": "vitest", + "test": "npm run test:unit -- --run", + "db:push": "drizzle-kit push", + "db:generate": "drizzle-kit generate", + "db:migrate": "drizzle-kit migrate", + "db:studio": "drizzle-kit studio" + }, + "devDependencies": { + "@eslint/js": "^10.0.1", + "@sveltejs/adapter-node": "^6.0.0", + "@sveltejs/kit": "^3.0.0", + "@sveltejs/vite-plugin-svelte": "^7.2.0", + "@types/better-sqlite3": "^9.6.0", + "@types/node": "^24", + "drizzle-kit": "^0.31.10", + "drizzle-orm": "^0.45.2", + "eslint": "^10.4.1", + "eslint-config-prettier": "^10.1.8", + "eslint-plugin-svelte": "^3.19.0", + "globals": "^17.6.0", + "prettier": "^3.8.3", + "prettier-plugin-svelte": "^4.1.0", + "svelte": "^5.57.1", + "svelte-check": "^4.6.0", + "typescript": "^6.0.3", + "typescript-eslint": "^8.60.1", + "vite": "^8.3.0", + "vitest": "^4.1.8" + }, + "imports": { + "#lib": "./src/lib/index.js", + "#lib/*": "./src/lib/*" + }, + "dependencies": { + "better-sqlite3": "^13.0.2", + "zod": "^4.6.7" + } +} diff --git a/prettier.config.js b/prettier.config.js new file mode 100644 index 0000000..718ddb8 --- /dev/null +++ b/prettier.config.js @@ -0,0 +1,11 @@ +/** @type {import("prettier").Config} */ +const config = { + useTabs: true, + singleQuote: true, + trailingComma: 'none', + printWidth: 100, + plugins: ['prettier-plugin-svelte'], + overrides: [{ files: '*.svelte', options: { parser: 'svelte' } }] +}; + +export default config; diff --git a/src/app.d.ts b/src/app.d.ts new file mode 100644 index 0000000..da08e6d --- /dev/null +++ b/src/app.d.ts @@ -0,0 +1,13 @@ +// See https://svelte.dev/docs/kit/types#app.d.ts +// for information about these interfaces +declare global { + namespace App { + // interface Error {} + // interface Locals {} + // interface PageData {} + // interface PageState {} + // interface Platform {} + } +} + +export {}; diff --git a/src/app.html b/src/app.html new file mode 100644 index 0000000..6a2bb58 --- /dev/null +++ b/src/app.html @@ -0,0 +1,12 @@ + + + + + + + %sveltekit.head% + + +
%sveltekit.body%
+ + diff --git a/src/env.ts b/src/env.ts new file mode 100644 index 0000000..5d51c08 --- /dev/null +++ b/src/env.ts @@ -0,0 +1,28 @@ +import { defineEnvVars } from '@sveltejs/kit/env'; +import { z } from 'zod'; + +const positiveInt = (fallback: number) => + z.coerce.number().int().positive().default(fallback); + +export const variables = defineEnvVars({ + DATABASE_PATH: { + description: 'Path to the SQLite database file (mount a volume here in Docker).', + schema: z.string().min(1).default('local.db') + }, + POLL_INTERVAL_SECONDS: { + description: 'How often every project is checked for SharePoint changes.', + schema: positiveInt(180) + }, + MANUAL_RUN_COOLDOWN_SECONDS: { + description: 'Minimum gap between "Run now" requests for the same project.', + schema: positiveInt(30) + }, + MAX_ATTEMPTS: { + description: 'Failed attempts before an item is reported as an issue.', + schema: positiveInt(3) + }, + HISTORY_RETENTION_DAYS: { + description: 'How long run history is kept.', + schema: positiveInt(7) + } +}); diff --git a/src/lib/assets/favicon.svg b/src/lib/assets/favicon.svg new file mode 100644 index 0000000..cc5dc66 --- /dev/null +++ b/src/lib/assets/favicon.svg @@ -0,0 +1 @@ +svelte-logo \ No newline at end of file diff --git a/src/lib/index.ts b/src/lib/index.ts new file mode 100644 index 0000000..73c55ef --- /dev/null +++ b/src/lib/index.ts @@ -0,0 +1 @@ +// place files you want to import through the `#lib` alias in this folder. diff --git a/src/lib/server/adapters/sqlite/database.ts b/src/lib/server/adapters/sqlite/database.ts new file mode 100644 index 0000000..39562c0 --- /dev/null +++ b/src/lib/server/adapters/sqlite/database.ts @@ -0,0 +1,16 @@ +import Database from 'better-sqlite3'; +import { drizzle, type BetterSQLite3Database } from 'drizzle-orm/better-sqlite3'; +import { migrate } from 'drizzle-orm/better-sqlite3/migrator'; +import * as schema from './schema'; + +export type Db = BetterSQLite3Database; + +/** Opens (or creates) the database and brings its schema up to date. */ +export function openDatabase(path: string, migrationsFolder = 'drizzle'): Db { + const client = new Database(path); + client.pragma('journal_mode = WAL'); + client.pragma('foreign_keys = ON'); + const db = drizzle(client, { schema }); + migrate(db, { migrationsFolder }); + return db; +} diff --git a/src/lib/server/adapters/sqlite/item-repository.ts b/src/lib/server/adapters/sqlite/item-repository.ts new file mode 100644 index 0000000..17a7161 --- /dev/null +++ b/src/lib/server/adapters/sqlite/item-repository.ts @@ -0,0 +1,88 @@ +import { eq } from 'drizzle-orm'; +import type { ItemState } from '../../sync/core/model'; +import type { ItemRepository } from '../../sync/core/ports'; +import type { Db } from './database'; +import { items, projects } from './schema'; + +type ItemRow = typeof items.$inferSelect; +type Tx = Parameters[0]>[0]; + +export class SqliteItemRepository implements ItemRepository { + constructor(private readonly db: Db) {} + + async listByProject(projectId: string): Promise { + return this.db.select().from(items).where(eq(items.projectId, projectId)).all().map(toItem); + } + + async commitIngest(projectId: string, states: ItemState[], cursor: string): Promise { + this.db.transaction((tx) => { + upsert(tx, projectId, states); + tx.update(projects).set({ deltaCursor: cursor }).where(eq(projects.id, projectId)).run(); + }); + } + + async save(projectId: string, states: ItemState[]): Promise { + this.db.transaction((tx) => upsert(tx, projectId, states)); + } +} + +function upsert(tx: Tx, projectId: string, states: ItemState[]): void { + for (const state of states) { + const row = toRow(projectId, state); + tx.insert(items) + .values(row) + .onConflictDoUpdate({ target: [items.projectId, items.sourceId], set: row }) + .run(); + } +} + +function toRow(projectId: string, { sourceId, desired, synced, ...rest }: ItemState): ItemRow { + return { + projectId, + sourceId, + parentSourceId: desired.parentSourceId, + name: desired.name, + isFolder: desired.isFolder, + contentTag: desired.contentTag, + sourceModifiedAt: desired.modifiedAt, + size: desired.size, + deleted: desired.deleted, + targetId: synced.targetId, + syncedParentSourceId: synced.parentSourceId, + syncedName: synced.name, + syncedContentTag: synced.contentTag, + syncedDeleted: synced.deleted, + syncedAt: synced.at, + status: rest.status, + attemptCount: rest.attemptCount, + lastError: rest.lastError, + lastAttemptAt: rest.lastAttemptAt + }; +} + +function toItem(row: ItemRow): ItemState { + return { + sourceId: row.sourceId, + desired: { + parentSourceId: row.parentSourceId, + name: row.name, + isFolder: row.isFolder, + contentTag: row.contentTag, + modifiedAt: row.sourceModifiedAt, + size: row.size, + deleted: row.deleted + }, + synced: { + targetId: row.targetId, + parentSourceId: row.syncedParentSourceId, + name: row.syncedName, + contentTag: row.syncedContentTag, + deleted: row.syncedDeleted, + at: row.syncedAt + }, + status: row.status, + attemptCount: row.attemptCount, + lastError: row.lastError, + lastAttemptAt: row.lastAttemptAt + }; +} diff --git a/src/lib/server/adapters/sqlite/project-repository.ts b/src/lib/server/adapters/sqlite/project-repository.ts new file mode 100644 index 0000000..a5313d7 --- /dev/null +++ b/src/lib/server/adapters/sqlite/project-repository.ts @@ -0,0 +1,95 @@ +import { eq } from 'drizzle-orm'; +import type { NewProject, Project } from '../../sync/core/model'; +import type { Clock, ProjectRepository } from '../../sync/core/ports'; +import type { Db } from './database'; +import { items, projects } from './schema'; + +type ProjectRow = typeof projects.$inferSelect; + +export class SqliteProjectRepository implements ProjectRepository { + constructor( + private readonly db: Db, + private readonly clock: Clock + ) {} + + async get(id: string): Promise { + const row = this.db.select().from(projects).where(eq(projects.id, id)).get(); + return row ? toProject(row) : null; + } + + async list(): Promise { + return this.db.select().from(projects).orderBy(projects.name).all().map(toProject); + } + + async create(project: NewProject): Promise { + const row = this.db + .insert(projects) + .values({ + id: crypto.randomUUID(), + name: project.name, + spSiteId: project.source.siteId, + spDriveId: project.source.driveId, + spRootItemId: project.source.rootItemId, + spDisplayPath: project.sourceDisplayPath, + accHubId: project.target.hubId, + accProjectId: project.target.projectId, + accRootFolderId: project.target.rootFolderId, + accDisplayPath: project.targetDisplayPath, + createdAt: this.clock() + }) + .returning() + .get(); + return toProject(row); + } + + async pause(id: string, reason: string): Promise { + this.update(id, { pausedReason: reason }); + } + + async resume(id: string): Promise { + this.update(id, { pausedReason: null }); + } + + async markFirstSynced(id: string, at: Date): Promise { + this.update(id, { firstSyncedAt: at }); + } + + async setLastRunAt(id: string, at: Date): Promise { + this.update(id, { lastRunAt: at }); + } + + async reset(id: string): Promise { + this.db.transaction((tx) => { + tx.delete(items).where(eq(items.projectId, id)).run(); + tx.update(projects) + .set({ deltaCursor: null, firstSyncedAt: null, pausedReason: null }) + .where(eq(projects.id, id)) + .run(); + }); + } + + private update(id: string, values: Partial): void { + this.db.update(projects).set(values).where(eq(projects.id, id)).run(); + } +} + +function toProject(row: ProjectRow): Project { + return { + id: row.id, + name: row.name, + enabled: row.enabled, + pausedReason: row.pausedReason, + source: { siteId: row.spSiteId, driveId: row.spDriveId, rootItemId: row.spRootItemId }, + sourceDisplayPath: row.spDisplayPath, + target: { + hubId: row.accHubId, + projectId: row.accProjectId, + rootFolderId: row.accRootFolderId + }, + targetDisplayPath: row.accDisplayPath, + deltaCursor: row.deltaCursor, + firstSyncedAt: row.firstSyncedAt, + lastRunAt: row.lastRunAt, + createdAt: row.createdAt + }; +} diff --git a/src/lib/server/adapters/sqlite/run-repository.spec.ts b/src/lib/server/adapters/sqlite/run-repository.spec.ts new file mode 100644 index 0000000..a07d014 --- /dev/null +++ b/src/lib/server/adapters/sqlite/run-repository.spec.ts @@ -0,0 +1,28 @@ +import { describe, expect, it } from 'vitest'; +import { createHarness } from '../../sync/testing/harness'; + +describe('SqliteRunRepository', () => { + it('prunes old runs together with their events', async () => { + const h = await createHarness(); + h.drive.addFile(h.rootId, 'a.txt'); + const old = await h.sync(); + const cutoff = new Date(Date.UTC(2026, 9, 2)); + const recent = await h.runs.start(h.project.id, 'manual', new Date(Date.UTC(2026, 9, 3))); + + expect(await h.runs.pruneBefore(cutoff)).toBe(1); + + expect((await h.runs.listSince(h.project.id, new Date(0))).map((r) => r.runId)).toEqual([ + recent + ]); + expect(await h.runs.listEvents(old.runId)).toEqual([]); + }); + + it('reports an unfinished run with no outcome', async () => { + const h = await createHarness(); + const runId = await h.runs.start(h.project.id, 'manual', new Date()); + + const [run] = await h.runs.listSince(h.project.id, new Date(0)); + + expect(run).toMatchObject({ runId, outcome: null, finishedAt: null }); + }); +}); diff --git a/src/lib/server/adapters/sqlite/run-repository.ts b/src/lib/server/adapters/sqlite/run-repository.ts new file mode 100644 index 0000000..25ce035 --- /dev/null +++ b/src/lib/server/adapters/sqlite/run-repository.ts @@ -0,0 +1,71 @@ +import { and, asc, desc, eq, gte, lt } from 'drizzle-orm'; +import type { RunCounts, RunEvent, RunOutcome, RunRecord, RunTrigger } from '../../sync/core/model'; +import type { RunRepository } from '../../sync/core/ports'; +import type { Db } from './database'; +import { runEvents, runs } from './schema'; + +type RunRow = typeof runs.$inferSelect; + +export class SqliteRunRepository implements RunRepository { + constructor(private readonly db: Db) {} + + async start(projectId: string, trigger: RunTrigger, at: Date): Promise { + const id = crypto.randomUUID(); + this.db.insert(runs).values({ id, projectId, trigger, startedAt: at }).run(); + return id; + } + + async finish( + runId: string, + result: { finishedAt: Date; outcome: RunOutcome; error: string | null; counts: RunCounts } + ): Promise { + const { finishedAt, outcome, error, counts } = result; + this.db + .update(runs) + .set({ finishedAt, outcome, error, ...counts }) + .where(eq(runs.id, runId)) + .run(); + } + + async addEvent(event: RunEvent): Promise { + this.db.insert(runEvents).values(event).run(); + } + + async listSince(projectId: string, since: Date): Promise { + return this.db + .select() + .from(runs) + .where(and(eq(runs.projectId, projectId), gte(runs.startedAt, since))) + .orderBy(desc(runs.startedAt)) + .all() + .map(toRunRecord); + } + + async listEvents(runId: string): Promise { + return this.db + .select() + .from(runEvents) + .where(eq(runEvents.runId, runId)) + .orderBy(asc(runEvents.id)) + .all() + .map(({ id, ...event }) => event); + } + + async pruneBefore(cutoff: Date): Promise { + return this.db.delete(runs).where(lt(runs.startedAt, cutoff)).run().changes; + } +} + +function toRunRecord(row: RunRow): RunRecord { + const { id, projectId, trigger, startedAt, finishedAt, outcome, error, ...counts } = row; + return { + runId: id, + projectId, + trigger, + startedAt, + finishedAt, + outcome, + error, + counts + }; +} diff --git a/src/lib/server/adapters/sqlite/schema.ts b/src/lib/server/adapters/sqlite/schema.ts new file mode 100644 index 0000000..1d65034 --- /dev/null +++ b/src/lib/server/adapters/sqlite/schema.ts @@ -0,0 +1,99 @@ +import { index, integer, primaryKey, sqliteTable, text } from 'drizzle-orm/sqlite-core'; +import { EVENT_ACTIONS } from '../../sync/core/model'; + +const timestamp = (name: string) => integer(name, { mode: 'timestamp_ms' }); +const flag = (name: string) => integer(name, { mode: 'boolean' }); +const count = (name: string) => integer(name).notNull().default(0); + +export const projects = sqliteTable('projects', { + id: text('id').primaryKey(), + name: text('name').notNull(), + enabled: flag('enabled').notNull().default(true), + pausedReason: text('paused_reason'), + spSiteId: text('sp_site_id').notNull(), + spDriveId: text('sp_drive_id').notNull(), + spRootItemId: text('sp_root_item_id').notNull(), + spDisplayPath: text('sp_display_path').notNull(), + accHubId: text('acc_hub_id').notNull(), + accProjectId: text('acc_project_id').notNull(), + accRootFolderId: text('acc_root_folder_id').notNull(), + accDisplayPath: text('acc_display_path').notNull(), + deltaCursor: text('delta_cursor'), + firstSyncedAt: timestamp('first_synced_at'), + lastRunAt: timestamp('last_run_at'), + createdAt: timestamp('created_at').notNull() +}); + +export const items = sqliteTable( + 'items', + { + projectId: text('project_id') + .notNull() + .references(() => projects.id, { onDelete: 'cascade' }), + sourceId: text('source_id').notNull(), + // desired (from SharePoint) + parentSourceId: text('parent_source_id').notNull(), + name: text('name').notNull(), + isFolder: flag('is_folder').notNull(), + contentTag: text('content_tag'), + sourceModifiedAt: timestamp('source_modified_at').notNull(), + size: integer('size'), + deleted: flag('deleted').notNull(), + // synced (what ACC has) + targetId: text('target_id'), + syncedParentSourceId: text('synced_parent_source_id'), + syncedName: text('synced_name'), + syncedContentTag: text('synced_content_tag'), + syncedDeleted: flag('synced_deleted').notNull(), + syncedAt: timestamp('synced_at'), + // bookkeeping + status: text('status', { enum: ['pending', 'synced', 'failed', 'deleted'] }).notNull(), + attemptCount: count('attempt_count'), + lastError: text('last_error'), + lastAttemptAt: timestamp('last_attempt_at') + }, + (t) => [ + primaryKey({ columns: [t.projectId, t.sourceId] }), + index('items_project_status').on(t.projectId, t.status) + ] +); + +export const runs = sqliteTable( + 'runs', + { + id: text('id').primaryKey(), + projectId: text('project_id') + .notNull() + .references(() => projects.id, { onDelete: 'cascade' }), + trigger: text('trigger', { enum: ['schedule', 'manual'] }).notNull(), + startedAt: timestamp('started_at').notNull(), + finishedAt: timestamp('finished_at'), + outcome: text('outcome', { enum: ['success', 'partial', 'failed'] }), + error: text('error'), + created: count('created'), + updated: count('updated'), + renamed: count('renamed'), + moved: count('moved'), + deleted: count('deleted'), + restored: count('restored'), + failed: count('failed') + }, + (t) => [index('runs_project_started').on(t.projectId, t.startedAt)] +); + +export const runEvents = sqliteTable( + 'run_events', + { + id: integer('id').primaryKey({ autoIncrement: true }), + runId: text('run_id') + .notNull() + .references(() => runs.id, { onDelete: 'cascade' }), + projectId: text('project_id').notNull(), + sourceId: text('source_id').notNull(), + path: text('path').notNull(), + action: text('action', { enum: EVENT_ACTIONS }).notNull(), + message: text('message'), + at: timestamp('at').notNull() + }, + (t) => [index('run_events_run').on(t.runId)] +); diff --git a/src/lib/server/sync/coordinator.spec.ts b/src/lib/server/sync/coordinator.spec.ts new file mode 100644 index 0000000..0e40763 --- /dev/null +++ b/src/lib/server/sync/coordinator.spec.ts @@ -0,0 +1,115 @@ +import { describe, expect, it } from 'vitest'; +import type { ProjectSyncRunner } from './core/engine'; +import { emptyCounts, type Project, type RunTrigger } from './core/model'; +import type { ProjectRepository } from './core/ports'; +import { SyncCoordinator } from './coordinator'; +import { silentLogger } from './testing/harness'; + +function project(id: string, overrides: Partial = {}): Project { + return { id, enabled: true, pausedReason: null, ...overrides } as Project; +} + +/** A runner whose runs stay in flight until `finish` is called. */ +class ControlledRunner implements ProjectSyncRunner { + readonly started: Array<[string, RunTrigger]> = []; + private readonly pending: Array<() => void> = []; + + runProject(projectId: string, trigger: RunTrigger) { + this.started.push([projectId, trigger]); + return new Promise((resolve) => { + this.pending.push(() => + resolve({ runId: 'r', outcome: 'success', error: null, counts: emptyCounts() } as never) + ); + }); + } + + finishAll() { + this.pending.splice(0).forEach((finish) => finish()); + } +} + +function setup(projects: Project[]) { + let now = 0; + const runner = new ControlledRunner(); + const repo = { + get: async (id: string) => projects.find((p) => p.id === id) ?? null, + list: async () => projects + } as ProjectRepository; + const coordinator = new SyncCoordinator({ + runner, + projects: repo, + clock: () => new Date(now), + logger: silentLogger, + manualCooldownMs: 30_000 + }); + return { runner, coordinator, advance: (ms: number) => (now += ms) }; +} + +describe('SyncCoordinator', () => { + it('starts a manual run and reports it as already running on a second click', async () => { + const { runner, coordinator } = setup([project('p1')]); + + expect(await coordinator.requestManualRun('p1')).toEqual({ status: 'started' }); + expect(await coordinator.requestManualRun('p1')).toEqual({ status: 'already-running' }); + expect(runner.started).toEqual([['p1', 'manual']]); + }); + + it('enforces the manual cooldown after a run finishes', async () => { + const { runner, coordinator, advance } = setup([project('p1')]); + await coordinator.requestManualRun('p1'); + runner.finishAll(); + await coordinator.drain(); + + advance(10_000); + expect(await coordinator.requestManualRun('p1')).toEqual({ + status: 'cooldown', + retryAfterSeconds: 20 + }); + + advance(20_000); + expect(await coordinator.requestManualRun('p1')).toEqual({ status: 'started' }); + }); + + it('keeps cooldowns per project', async () => { + const { coordinator } = setup([project('p1'), project('p2')]); + await coordinator.requestManualRun('p1'); + expect(await coordinator.requestManualRun('p2')).toEqual({ status: 'started' }); + }); + + it('refuses manual runs for disabled, paused or unknown projects', async () => { + const { coordinator } = setup([ + project('off', { enabled: false }), + project('paused', { pausedReason: 'Root deleted' }) + ]); + + expect(await coordinator.requestManualRun('off')).toMatchObject({ status: 'unavailable' }); + expect(await coordinator.requestManualRun('paused')).toEqual({ + status: 'unavailable', + reason: 'Root deleted' + }); + expect(await coordinator.requestManualRun('nope')).toMatchObject({ status: 'unavailable' }); + }); + + it('runs scheduled passes sequentially, skipping busy, disabled and paused projects', async () => { + const { runner, coordinator } = setup([ + project('busy'), + project('off', { enabled: false }), + project('paused', { pausedReason: 'x' }), + project('a'), + project('b') + ]); + await coordinator.requestManualRun('busy'); + + const pass = coordinator.runScheduledPass(); + await Promise.resolve(); + await Promise.resolve(); + expect(runner.started.map(([id]) => id)).toEqual(['busy', 'a']); + + runner.finishAll(); + await new Promise((r) => setTimeout(r)); + expect(runner.started.map(([id]) => id)).toEqual(['busy', 'a', 'b']); + + runner.finishAll(); + await pass; + }); +}); diff --git a/src/lib/server/sync/coordinator.ts b/src/lib/server/sync/coordinator.ts new file mode 100644 index 0000000..9a6e7af --- /dev/null +++ b/src/lib/server/sync/coordinator.ts @@ -0,0 +1,79 @@ +import type { ProjectSyncRunner } from './core/engine'; +import { errorMessage } from './core/errors'; +import type { RunTrigger } from './core/model'; +import type { Clock, Logger, ProjectRepository } from './core/ports'; + +export type RunRequestResult = + | { status: 'started' } + | { status: 'already-running' } + | { status: 'cooldown'; retryAfterSeconds: number } + | { status: 'unavailable'; reason: string }; + +export interface SyncCoordinatorDeps { + runner: ProjectSyncRunner; + projects: ProjectRepository; + clock: Clock; + logger: Logger; + manualCooldownMs: number; +} + +/** + * The only way a sync run starts. Guarantees at most one run per project at a + * time and rate-limits manual "Run now" requests per project. + */ +export class SyncCoordinator { + private readonly active = new Map>(); + private readonly lastManualRequest = new Map(); + + constructor(private readonly deps: SyncCoordinatorDeps) {} + + isRunning(projectId: string): boolean { + return this.active.has(projectId); + } + + async requestManualRun(projectId: string): Promise { + const project = await this.deps.projects.get(projectId); + if (!project) return { status: 'unavailable', reason: 'Project not found.' }; + if (!project.enabled) return { status: 'unavailable', reason: 'Project is disabled.' }; + if (project.pausedReason) return { status: 'unavailable', reason: project.pausedReason }; + if (this.isRunning(projectId)) return { status: 'already-running' }; + + const now = this.deps.clock().getTime(); + const elapsed = now - (this.lastManualRequest.get(projectId) ?? -Infinity); + if (elapsed < this.deps.manualCooldownMs) { + return { + status: 'cooldown', + retryAfterSeconds: Math.ceil((this.deps.manualCooldownMs - elapsed) / 1000) + }; + } + + this.lastManualRequest.set(projectId, now); + void this.launch(projectId, 'manual'); + return { status: 'started' }; + } + + /** Syncs every enabled, unpaused, idle project, one after another. */ + async runScheduledPass(): Promise { + for (const project of await this.deps.projects.list()) { + if (!project.enabled || project.pausedReason || this.isRunning(project.id)) continue; + await this.launch(project.id, 'schedule'); + } + } + + /** Resolves once every in-flight run has finished. */ + async drain(): Promise { + await Promise.all(this.active.values()); + } + + private launch(projectId: string, trigger: RunTrigger): Promise { + const run = this.deps.runner + .runProject(projectId, trigger) + .then(() => undefined) + .catch((error) => { + this.deps.logger.error('Sync run crashed', { projectId, error: errorMessage(error) }); + }) + .finally(() => this.active.delete(projectId)); + this.active.set(projectId, run); + return run; + } +} diff --git a/src/lib/server/sync/core/engine.spec.ts b/src/lib/server/sync/core/engine.spec.ts new file mode 100644 index 0000000..8f863da --- /dev/null +++ b/src/lib/server/sync/core/engine.spec.ts @@ -0,0 +1,243 @@ +import { describe, expect, it } from 'vitest'; +import { createHarness } from '../testing/harness'; +import { ServiceUnavailableError } from './errors'; +import { ROOT_DELETED } from './ingest'; +import { WAITING_FOR_PARENT } from './reconciler'; + +describe('SyncEngine', () => { + it('mirrors the initial tree and ignores temp files', async () => { + const h = await createHarness(); + const drawings = h.drive.addFolder(h.rootId, 'Drawings'); + h.drive.addFile(drawings, 'plan.pdf'); + h.drive.addFile(drawings, '~$plan.docx'); + h.drive.addFile(h.rootId, 'notes.txt'); + h.drive.addFile(h.drive.driveRootId, 'outside-root.txt'); + + const result = await h.sync(); + + expect(result.outcome).toBe('success'); + expect(result.counts.created).toBe(3); + expect(h.acc.tree()).toEqual(['Drawings/', 'Drawings/plan.pdf@1', 'notes.txt@1']); + }); + + it('uploads edits as new versions', async () => { + const h = await createHarness(); + const file = h.drive.addFile(h.rootId, 'spec.docx'); + await h.sync(); + + h.drive.edit(file, 'spec v2'); + const result = await h.sync(); + + expect(result.counts.updated).toBe(1); + expect(h.acc.tree()).toEqual(['spec.docx@2']); + expect(h.acc.latestContent('spec.docx')).toBe('spec v2'); + }); + + it('applies a move and rename of the same file', async () => { + const h = await createHarness(); + const a = h.drive.addFolder(h.rootId, 'A'); + const b = h.drive.addFolder(h.rootId, 'B'); + const file = h.drive.addFile(a, 'old.txt'); + await h.sync(); + + h.drive.move(file, b); + h.drive.rename(file, 'new.txt'); + const result = await h.sync(); + + expect(result.counts).toMatchObject({ moved: 1, renamed: 1, created: 0 }); + expect(h.acc.tree()).toEqual(['A/', 'B/', 'B/new.txt@1']); + }); + + it('creates a folder before files moved into it', async () => { + const h = await createHarness(); + const file = h.drive.addFile(h.rootId, 'report.pdf'); + await h.sync(); + + const archive = h.drive.addFolder(h.rootId, 'Archive'); + h.drive.move(file, archive); + await h.sync(); + + expect(h.acc.tree()).toEqual(['Archive/', 'Archive/report.pdf@1']); + }); + + it('deletes a folder with a single ACC call that covers its contents', async () => { + const h = await createHarness(); + const folder = h.drive.addFolder(h.rootId, 'Old'); + h.drive.addFile(folder, 'a.txt'); + h.drive.addFile(folder, 'b.txt'); + await h.sync(); + + h.drive.remove(folder); + const result = await h.sync(); + + expect(result.counts.deleted).toBe(1); + expect(h.acc.calls.filter((c) => c.startsWith('delete'))).toEqual(['delete Old']); + expect(h.acc.tree()).toEqual([]); + expect((await h.itemNamed('a.txt')).status).toBe('deleted'); + }); + + it('treats items moved out of the root as deleted', async () => { + const h = await createHarness(); + const file = h.drive.addFile(h.rootId, 'leaving.txt'); + await h.sync(); + + h.drive.move(file, h.drive.driveRootId); + await h.sync(); + + expect(h.acc.tree()).toEqual([]); + }); + + it('treats a rename to an ignored name as a delete', async () => { + const h = await createHarness(); + const file = h.drive.addFile(h.rootId, 'draft.docx'); + await h.sync(); + + h.drive.rename(file, 'draft.tmp'); + await h.sync(); + + expect(h.acc.tree()).toEqual([]); + }); + + it('revives the same ACC items when a deleted folder is restored', async () => { + const h = await createHarness(); + const folder = h.drive.addFolder(h.rootId, 'Specs'); + h.drive.addFile(folder, 'spec.docx'); + await h.sync(); + const before = await h.itemNamed('spec.docx'); + + h.drive.remove(folder); + await h.sync(); + h.drive.restore(folder); + const result = await h.sync(); + + expect(result.counts.restored).toBe(2); + expect(result.counts.created).toBe(0); + expect(h.acc.tree()).toEqual(['Specs/', 'Specs/spec.docx@1']); + expect((await h.itemNamed('spec.docx')).synced.targetId).toBe(before.synced.targetId); + }); + + it('never touches files added to ACC by hand', async () => { + const h = await createHarness(); + const folder = h.drive.addFolder(h.rootId, 'Shared'); + await h.sync(); + const accFolder = (await h.itemNamed('Shared')).synced.targetId!; + h.acc.addByHand(h.acc.rootFolderId, 'manual.pdf'); + h.acc.addByHand(accFolder, 'inside.pdf'); + + h.drive.addFile(h.rootId, 'synced.txt'); + h.drive.rename(folder, 'Shared Renamed'); + await h.sync(); + + expect(h.acc.tree()).toEqual([ + 'Shared Renamed/', + 'Shared Renamed/inside.pdf@1', + 'manual.pdf@1', + 'synced.txt@1' + ]); + }); + + describe('failures', () => { + it('retries a failing item, then reports it after the last attempt', async () => { + const h = await createHarness({ maxAttempts: 3 }); + h.drive.addFile(h.rootId, 'bad.dwg'); + h.drive.addFile(h.rootId, 'good.txt'); + h.acc.failOn('bad.dwg', new Error('Upload rejected')); + + const first = await h.sync(); + expect(first.outcome).toBe('partial'); + expect((await h.itemNamed('bad.dwg')).status).toBe('pending'); + + await h.sync(); + await h.sync(); + const failed = await h.itemNamed('bad.dwg'); + expect(failed).toMatchObject({ + status: 'failed', + attemptCount: 3, + lastError: 'Upload rejected' + }); + + const uploadsBefore = h.acc.calls.length; + await h.sync(); + expect(h.acc.calls.length).toBe(uploadsBefore); + expect(h.acc.tree()).toEqual(['good.txt@1']); + }); + + it('gives a failed item fresh attempts when it changes in SharePoint', async () => { + const h = await createHarness({ maxAttempts: 1 }); + const file = h.drive.addFile(h.rootId, 'bad.dwg'); + h.acc.failOn('bad.dwg', new Error('Upload rejected'), 1); + await h.sync(); + expect((await h.itemNamed('bad.dwg')).status).toBe('failed'); + + h.drive.edit(file, 'fixed'); + await h.sync(); + + expect((await h.itemNamed('bad.dwg')).status).toBe('synced'); + expect(h.acc.latestContent('bad.dwg')).toBe('fixed'); + }); + + it('holds children without charging attempts while their folder fails', async () => { + const h = await createHarness(); + const folder = h.drive.addFolder(h.rootId, 'Broken'); + h.drive.addFile(folder, 'child.txt'); + h.acc.failOn('Broken', new Error('Folder create failed'), 1); + + await h.sync(); + expect(await h.itemNamed('child.txt')).toMatchObject({ + status: 'pending', + attemptCount: 0, + lastError: WAITING_FOR_PARENT + }); + + await h.sync(); + expect(h.acc.tree()).toEqual(['Broken/', 'Broken/child.txt@1']); + }); + + it('stops the run on an outage without charging attempts', async () => { + const h = await createHarness(); + h.drive.addFile(h.rootId, 'a.txt'); + h.drive.addFile(h.rootId, 'b.txt'); + h.acc.failOn('a.txt', new ServiceUnavailableError('ACC is down'), 1); + + const result = await h.sync(); + + expect(result).toMatchObject({ outcome: 'failed', error: 'ACC is down' }); + expect((await h.itemNamed('a.txt')).attemptCount).toBe(0); + expect(h.acc.calls).toEqual(['uploadFile a.txt']); + + await h.sync(); + expect(h.acc.tree()).toEqual(['a.txt@1', 'b.txt@1']); + }); + }); + + describe('root safety', () => { + it('pauses instead of deleting when the root folder is deleted', async () => { + const h = await createHarness(); + h.drive.addFile(h.rootId, 'keep.txt'); + await h.sync(); + + h.drive.remove(h.rootId); + const result = await h.sync(); + + expect(result).toMatchObject({ outcome: 'failed', error: ROOT_DELETED }); + expect((await h.projects.get(h.project.id))!.pausedReason).toBe(ROOT_DELETED); + expect(h.acc.tree()).toEqual(['keep.txt@1']); + }); + }); + + it('records run history and per-file events', async () => { + const h = await createHarness(); + const folder = h.drive.addFolder(h.rootId, 'Docs'); + h.drive.addFile(folder, 'a.txt'); + + const result = await h.sync(); + + const [run] = await h.runs.listSince(h.project.id, new Date(0)); + expect(run).toMatchObject({ runId: result.runId, trigger: 'schedule', outcome: 'success' }); + const events = await h.runs.listEvents(result.runId); + expect(events.map((e) => `${e.action} ${e.path}`)).toEqual([ + 'created Docs', + 'created Docs/a.txt' + ]); + }); +}); diff --git a/src/lib/server/sync/core/engine.ts b/src/lib/server/sync/core/engine.ts new file mode 100644 index 0000000..981cc65 --- /dev/null +++ b/src/lib/server/sync/core/engine.ts @@ -0,0 +1,104 @@ +import { errorMessage } from './errors'; +import { ingestChanges } from './ingest'; +import { + emptyCounts, + type ItemState, + type Project, + type RunOutcome, + type RunResult, + type RunTrigger +} from './model'; +import type { + ChangeSource, + Clock, + IgnorePolicy, + ItemRepository, + Logger, + ProjectRepository, + RunRepository +} from './ports'; +import type { Reconciler } from './reconciler'; + +export interface ProjectSyncRunner { + runProject(projectId: string, trigger: RunTrigger): Promise; +} + +export interface SyncEngineDeps { + source: ChangeSource; + projects: ProjectRepository; + items: ItemRepository; + runs: RunRepository; + reconciler: Reconciler; + ignore: IgnorePolicy; + clock: Clock; + logger: Logger; + maxAttempts: number; +} + +/** Runs one sync of one project: ingest SharePoint changes, then reconcile ACC. */ +export class SyncEngine implements ProjectSyncRunner { + constructor(private readonly deps: SyncEngineDeps) {} + + async runProject(projectId: string, trigger: RunTrigger): Promise { + const { projects, items, runs, clock, logger } = this.deps; + const project = await projects.get(projectId); + if (!project) throw new Error(`Project ${projectId} not found.`); + + const runId = await runs.start(projectId, trigger, clock()); + let counts = emptyCounts(); + let outcome: RunOutcome = 'failed'; + let error: string | null; + + try { + const stored = await items.listByProject(projectId); + const current = new Map(stored.map((item) => [item.sourceId, item])); + const pausedReason = await this.ingest(project, current); + + if (pausedReason) { + await projects.pause(projectId, pausedReason); + error = pausedReason; + logger.warn('Project paused', { projectId, reason: pausedReason }); + } else { + if (!project.firstSyncedAt) await projects.markFirstSynced(projectId, clock()); + const result = await this.deps.reconciler.reconcile(project, runId, current); + counts = result.counts; + error = result.abortedWith; + outcome = result.abortedWith ? 'failed' : counts.failed > 0 ? 'partial' : 'success'; + } + } catch (caught) { + error = errorMessage(caught); + logger.error('Sync run failed', { projectId, runId, error }); + } + + const finishedAt = clock(); + await runs.finish(runId, { finishedAt, outcome, error, counts }); + await projects.setLastRunAt(projectId, finishedAt); + return { runId, outcome, error, counts }; + } + + /** + * Reads SharePoint changes into `current` and commits them with their cursor. + * Follows up with one full listing when ingest asks for it. Returns a pause + * reason if the batch was rejected. + */ + private async ingest(project: Project, current: Map): Promise { + let cursor = project.deltaCursor; + for (;;) { + const batch = await this.deps.source.getChanges(project.source, cursor); + const result = ingestChanges({ + rootId: project.source.rootItemId, + items: current, + changes: batch.changes, + fullSync: batch.fullSync, + ignore: this.deps.ignore, + maxAttempts: this.deps.maxAttempts + }); + if (result.kind === 'paused') return result.reason; + + await this.deps.items.commitIngest(project.id, result.changed, batch.cursor); + for (const item of result.changed) current.set(item.sourceId, item); + if (!result.needsFullListing) return null; + cursor = null; + } + } +} diff --git a/src/lib/server/sync/core/errors.ts b/src/lib/server/sync/core/errors.ts new file mode 100644 index 0000000..470911a --- /dev/null +++ b/src/lib/server/sync/core/errors.ts @@ -0,0 +1,15 @@ +/** + * A remote service can't be used right now (outage, network, auth, throttling + * that outlasted retries). Adapters throw this so the run stops early instead of + * charging a failed attempt to every item it would otherwise touch. + */ +export class ServiceUnavailableError extends Error { + constructor(message: string, options?: ErrorOptions) { + super(message, options); + this.name = 'ServiceUnavailableError'; + } +} + +export function errorMessage(error: unknown): string { + return error instanceof Error ? error.message : String(error); +} diff --git a/src/lib/server/sync/core/ignore.spec.ts b/src/lib/server/sync/core/ignore.spec.ts new file mode 100644 index 0000000..8049469 --- /dev/null +++ b/src/lib/server/sync/core/ignore.spec.ts @@ -0,0 +1,26 @@ +import { describe, expect, it } from 'vitest'; +import { PatternIgnorePolicy } from './ignore'; + +describe('PatternIgnorePolicy', () => { + const policy = new PatternIgnorePolicy(); + + it.each([ + '~$Report.docx', + '~WRL0003.tmp', + 'upload.TMP', + '.~lock.plan.odt#', + 'thumbs.db', + '.DS_Store' + ])('ignores %s', (name) => expect(policy.isIgnored(name)).toBe(true)); + + it.each(['Report.docx', 'tmp-notes.txt', 'plan.dwg', 'desktop.ini.bak'])('keeps %s', (name) => + expect(policy.isIgnored(name)).toBe(false) + ); + + it('accepts custom patterns', () => { + const custom = new PatternIgnorePolicy(['*.bak', 'draft?.txt']); + expect(custom.isIgnored('a.bak')).toBe(true); + expect(custom.isIgnored('draft1.txt')).toBe(true); + expect(custom.isIgnored('draft10.txt')).toBe(false); + }); +}); diff --git a/src/lib/server/sync/core/ignore.ts b/src/lib/server/sync/core/ignore.ts new file mode 100644 index 0000000..300538c --- /dev/null +++ b/src/lib/server/sync/core/ignore.ts @@ -0,0 +1,35 @@ +import type { IgnorePolicy } from './ports'; + +/** Office lock files, temp/partial downloads and OS metadata. */ +export const DEFAULT_IGNORE_PATTERNS = [ + '~$*', + '~*.tmp', + '*.tmp', + '.~lock.*#', + '*.crdownload', + '*.partial', + 'Thumbs.db', + 'desktop.ini', + '.DS_Store' +]; + +/** Matches names against case-insensitive `*` / `?` wildcard patterns. */ +export class PatternIgnorePolicy implements IgnorePolicy { + private readonly patterns: RegExp[]; + + constructor(patterns: readonly string[] = DEFAULT_IGNORE_PATTERNS) { + this.patterns = patterns.map(toRegExp); + } + + isIgnored(name: string): boolean { + return this.patterns.some((pattern) => pattern.test(name)); + } +} + +function toRegExp(pattern: string): RegExp { + const body = pattern + .split('') + .map((ch) => (ch === '*' ? '.*' : ch === '?' ? '.' : ch.replace(/[.+^${}()|[\]\\#]/g, '\\$&'))) + .join(''); + return new RegExp(`^${body}$`, 'i'); +} diff --git a/src/lib/server/sync/core/ingest.spec.ts b/src/lib/server/sync/core/ingest.spec.ts new file mode 100644 index 0000000..600d89b --- /dev/null +++ b/src/lib/server/sync/core/ingest.spec.ts @@ -0,0 +1,123 @@ +import { describe, expect, it } from 'vitest'; +import { PatternIgnorePolicy } from './ignore'; +import { ingestChanges, ROOT_MISSING, type IngestInput } from './ingest'; +import type { ItemState, SourceChange, SourceItem } from './model'; + +const ROOT = 'root'; + +function source(sourceId: string, parentSourceId: string, overrides: Partial = {}) { + return { + sourceId, + parentSourceId, + name: sourceId, + isFolder: false, + contentTag: 'c1', + modifiedAt: new Date(0), + size: 1, + ...overrides + } satisfies SourceItem; +} + +const upsert = (item: SourceItem): SourceChange => ({ kind: 'upsert', item }); +const folder = (id: string, parent: string) => + source(id, parent, { isFolder: true, contentTag: null }); + +function run( + changes: SourceChange[], + items: ItemState[] = [], + overrides: Partial = {} +) { + const result = ingestChanges({ + rootId: ROOT, + items: new Map(items.map((i) => [i.sourceId, i])), + changes, + fullSync: false, + ignore: new PatternIgnorePolicy(), + maxAttempts: 3, + ...overrides + }); + if (result.kind !== 'ok') throw new Error(result.reason); + return result; +} + +const byId = (items: ItemState[]) => Object.fromEntries(items.map((i) => [i.sourceId, i])); + +describe('ingestChanges', () => { + it('accepts children reported before their parent', () => { + const { changed } = run([upsert(source('file', 'dir')), upsert(folder('dir', ROOT))]); + expect(changed.map((i) => i.sourceId).sort()).toEqual(['dir', 'file']); + }); + + it('skips untracked items outside the root', () => { + const { changed } = run([upsert(source('elsewhere', 'other-folder'))]); + expect(changed).toEqual([]); + }); + + it('keeps the last change when an item appears twice', () => { + const { changed } = run([ + upsert(source('f', ROOT, { name: 'first' })), + upsert(source('f', ROOT, { name: 'second' })) + ]); + expect(changed[0].desired.name).toBe('second'); + }); + + it('skips everything under an ignored folder', () => { + const ignore = { isIgnored: (name: string) => name === 'skip' }; + const { changed } = run([upsert(folder('skip', ROOT)), upsert(source('f', 'skip'))], [], { + ignore + }); + expect(changed).toEqual([]); + }); + + it('cascades a folder delete to everything tracked beneath it', () => { + const first = run([ + upsert(folder('a', ROOT)), + upsert(folder('b', 'a')), + upsert(source('f', 'b')) + ]).changed; + const { changed } = run([{ kind: 'delete', sourceId: 'a' }], first); + expect(changed.map((i) => [i.sourceId, i.desired.deleted]).sort()).toEqual([ + ['a', true], + ['b', true], + ['f', true] + ]); + }); + + it('deletes tracked items missing from a full listing', () => { + const first = run([upsert(source('gone', ROOT)), upsert(source('kept', ROOT))]).changed; + const { changed } = run([upsert(folder(ROOT, 'drive')), upsert(source('kept', ROOT))], first, { + fullSync: true + }); + expect(byId(changed).gone.desired.deleted).toBe(true); + expect(byId(changed).kept).toBeUndefined(); + }); + + it('pauses when a full listing does not include the root', () => { + const result = ingestChanges({ + rootId: ROOT, + items: new Map(), + changes: [], + fullSync: true, + ignore: new PatternIgnorePolicy(), + maxAttempts: 3 + }); + expect(result).toEqual({ kind: 'paused', reason: ROOT_MISSING }); + }); + + it('keeps attempts for metadata-only changes but resets them for real ones', () => { + const [tracked] = run([upsert(source('f', ROOT))]).changed; + const failing = { ...tracked, attemptCount: 3, lastError: 'boom' }; + + const touched = run([upsert(source('f', ROOT, { modifiedAt: new Date(5) }))], [failing]); + expect(touched.changed[0].attemptCount).toBe(3); + + const edited = run([upsert(source('f', ROOT, { contentTag: 'c2' }))], [failing]); + expect(edited.changed[0]).toMatchObject({ attemptCount: 0, lastError: null }); + }); + + it('asks for a full listing when a deleted folder comes back', () => { + const first = run([upsert(folder('a', ROOT))]).changed; + const deleted = run([{ kind: 'delete', sourceId: 'a' }], first).changed; + expect(run([upsert(folder('a', ROOT))], deleted).needsFullListing).toBe(true); + }); +}); diff --git a/src/lib/server/sync/core/ingest.ts b/src/lib/server/sync/core/ingest.ts new file mode 100644 index 0000000..5e81163 --- /dev/null +++ b/src/lib/server/sync/core/ingest.ts @@ -0,0 +1,200 @@ +import type { DesiredState, ItemState, SourceChange, SourceItem } from './model'; +import { withStatus } from './plan'; +import type { IgnorePolicy } from './ports'; +import { ItemTree } from './tree'; + +export const ROOT_DELETED = 'The SharePoint root folder was deleted.'; +export const ROOT_MISSING = 'The SharePoint root folder was not found in a full listing.'; + +export interface IngestInput { + rootId: string; + items: ReadonlyMap; + changes: readonly SourceChange[]; + fullSync: boolean; + ignore: IgnorePolicy; + maxAttempts: number; +} + +export type IngestResult = + | { + kind: 'ok'; + changed: ItemState[]; + /** + * A deleted folder came back. Its contents may not be reported individually, + * so the caller should follow up with a full listing to revive them. + */ + needsFullListing: boolean; + } + | { kind: 'paused'; reason: string }; + +/** + * Folds a batch of SharePoint changes into the desired state of the project's + * items. Pure: returns only the items that changed and never touches ACC. + * + * Anything that leaves the root's scope (moved out, under an ignored or deleted + * folder, renamed to an ignored name, or absent from a full listing) is treated + * as deleted. If the root itself disappears the batch is rejected instead, so a + * misconfiguration can never cascade into deleting everything in ACC. + */ +export function ingestChanges(input: IngestInput): IngestResult { + const { rootId, changes, fullSync, ignore, maxAttempts } = input; + + const latest = new Map(); + for (const change of changes) latest.set(changeId(change), change); + + const rootChange = latest.get(rootId); + if (rootChange?.kind === 'delete') return { kind: 'paused', reason: ROOT_DELETED }; + if (fullSync && !rootChange) return { kind: 'paused', reason: ROOT_MISSING }; + latest.delete(rootId); + + const working = new Map(input.items); + const touched = new Set(); + let revivedFolder = false; + + const setDesired = (sourceId: string, desired: DesiredState) => { + const current = working.get(sourceId); + if (current && sameDesired(current.desired, desired)) return; + const base = current ?? newItem(sourceId, desired); + const resetAttempts = !current || actionableChange(current.desired, desired); + if (current?.desired.deleted && !desired.deleted && desired.isFolder) revivedFolder = true; + working.set(sourceId, { + ...base, + desired, + ...(resetAttempts && { attemptCount: 0, lastError: null }) + }); + touched.add(sourceId); + }; + + const markDeleted = (sourceId: string) => { + const current = working.get(sourceId); + if (current && !current.desired.deleted) { + setDesired(sourceId, { ...current.desired, deleted: true }); + } + }; + + const upserts = new Map(); + for (const change of latest.values()) { + if (change.kind === 'upsert') upserts.set(change.item.sourceId, change.item); + else markDeleted(change.sourceId); + } + + if (fullSync) { + for (const sourceId of input.items.keys()) if (!latest.has(sourceId)) markDeleted(sourceId); + } + + const inScope = scopeResolver(rootId, upserts, working, ignore); + for (const item of upserts.values()) { + if (inScope(item.sourceId)) setDesired(item.sourceId, toDesired(item)); + else markDeleted(item.sourceId); + } + + const tree = new ItemTree(rootId, working); + for (const sourceId of [...touched]) { + const item = working.get(sourceId)!; + if (item.desired.deleted && item.desired.isFolder) { + for (const descendant of tree.desiredDescendants(sourceId)) markDeleted(descendant.sourceId); + } + } + + return { + kind: 'ok', + changed: [...touched].map((id) => withStatus(working.get(id)!, maxAttempts)), + needsFullListing: revivedFolder && !fullSync + }; +} + +/** + * An item is in scope when every ancestor up to the root is a live, non-ignored + * folder. Newer information from this batch wins over stored state. + */ +function scopeResolver( + rootId: string, + upserts: ReadonlyMap, + known: ReadonlyMap, + ignore: IgnorePolicy +): (sourceId: string) => boolean { + const memo = new Map(); + + const resolve = (sourceId: string): boolean => { + if (sourceId === rootId) return true; + const cached = memo.get(sourceId); + if (cached !== undefined) return cached; + memo.set(sourceId, false); // guards against parent cycles + + const fresh = upserts.get(sourceId); + const stored = known.get(sourceId); + let result: boolean; + if (fresh) { + result = + !ignore.isIgnored(fresh.name, fresh.isFolder) && + fresh.parentSourceId !== null && + resolveParent(fresh.parentSourceId); + } else { + result = !!stored && !stored.desired.deleted && resolveParent(stored.desired.parentSourceId); + } + memo.set(sourceId, result); + return result; + }; + + const resolveParent = (parentId: string): boolean => { + if (parentId === rootId) return true; + const isFolder = upserts.get(parentId)?.isFolder ?? known.get(parentId)?.desired.isFolder; + return isFolder === true && resolve(parentId); + }; + + return resolve; +} + +function changeId(change: SourceChange): string { + return change.kind === 'upsert' ? change.item.sourceId : change.sourceId; +} + +function toDesired(item: SourceItem): DesiredState { + return { + parentSourceId: item.parentSourceId!, + name: item.name, + isFolder: item.isFolder, + contentTag: item.contentTag, + modifiedAt: item.modifiedAt, + size: item.size, + deleted: false + }; +} + +function newItem(sourceId: string, desired: DesiredState): ItemState { + return { + sourceId, + desired, + synced: { + targetId: null, + parentSourceId: null, + name: null, + contentTag: null, + deleted: false, + at: null + }, + status: 'pending', + attemptCount: 0, + lastError: null, + lastAttemptAt: null + }; +} + +/** Changes that alter what needs doing in ACC (as opposed to display metadata). */ +function actionableChange(a: DesiredState, b: DesiredState): boolean { + return ( + a.parentSourceId !== b.parentSourceId || + a.name !== b.name || + a.contentTag !== b.contentTag || + a.deleted !== b.deleted + ); +} + +function sameDesired(a: DesiredState, b: DesiredState): boolean { + return ( + !actionableChange(a, b) && + a.isFolder === b.isFolder && + a.size === b.size && + a.modifiedAt.getTime() === b.modifiedAt.getTime() + ); +} diff --git a/src/lib/server/sync/core/model.ts b/src/lib/server/sync/core/model.ts new file mode 100644 index 0000000..c7583f6 --- /dev/null +++ b/src/lib/server/sync/core/model.ts @@ -0,0 +1,145 @@ +/** Where a project's files come from in SharePoint (all Graph IDs). */ +export interface SourceRoot { + siteId: string; + driveId: string; + /** The folder whose contents are mirrored. Never stored as an item itself. */ + rootItemId: string; +} + +/** Where a project's files go in ACC (all APS IDs). */ +export interface TargetRoot { + hubId: string; + projectId: string; + rootFolderId: string; +} + +export interface Project { + id: string; + name: string; + enabled: boolean; + /** Set when the sync refuses to continue (e.g. the SharePoint root vanished). */ + pausedReason: string | null; + source: SourceRoot; + sourceDisplayPath: string; + target: TargetRoot; + targetDisplayPath: string; + deltaCursor: string | null; + firstSyncedAt: Date | null; + lastRunAt: Date | null; + createdAt: Date; +} + +export type NewProject = Pick< + Project, + 'name' | 'source' | 'sourceDisplayPath' | 'target' | 'targetDisplayPath' +>; + +/** An item as SharePoint currently describes it. */ +export interface SourceItem { + sourceId: string; + parentSourceId: string | null; + name: string; + isFolder: boolean; + /** Changes only when file content changes (Graph `cTag`). Null for folders. */ + contentTag: string | null; + modifiedAt: Date; + size: number | null; +} + +export type SourceChange = + { kind: 'upsert'; item: SourceItem } | { kind: 'delete'; sourceId: string }; + +export interface FileContent { + size: number; + stream: ReadableStream; +} + +export interface TargetRef { + id: string; + isFolder: boolean; +} + +/** What SharePoint says the item should look like. */ +export interface DesiredState { + parentSourceId: string; + name: string; + isFolder: boolean; + contentTag: string | null; + modifiedAt: Date; + size: number | null; + deleted: boolean; +} + +/** What we last successfully wrote to ACC. */ +export interface SyncedState { + targetId: string | null; + parentSourceId: string | null; + name: string | null; + contentTag: string | null; + deleted: boolean; + at: Date | null; +} + +export type ItemStatus = 'pending' | 'synced' | 'failed' | 'deleted'; + +export interface ItemState { + sourceId: string; + desired: DesiredState; + synced: SyncedState; + status: ItemStatus; + attemptCount: number; + lastError: string | null; + lastAttemptAt: Date | null; +} + +export type SyncAction = + | { kind: 'create' } + | { kind: 'restore' } + | { kind: 'delete' } + | { kind: 'update'; move: boolean; rename: boolean; content: boolean }; + +export type RunTrigger = 'schedule' | 'manual'; +export type RunOutcome = 'success' | 'partial' | 'failed'; + +export const EVENT_ACTIONS = [ + 'created', + 'updated', + 'renamed', + 'moved', + 'deleted', + 'restored', + 'failed' +] as const; +export type EventAction = (typeof EVENT_ACTIONS)[number]; + +export type RunCounts = Record; + +export function emptyCounts(): RunCounts { + return Object.fromEntries(EVENT_ACTIONS.map((a) => [a, 0])) as RunCounts; +} + +export interface RunResult { + runId: string; + outcome: RunOutcome; + error: string | null; + counts: RunCounts; +} + +export interface RunRecord extends Omit { + /** Null while the run is still in progress. */ + outcome: RunOutcome | null; + projectId: string; + trigger: RunTrigger; + startedAt: Date; + finishedAt: Date | null; +} + +export interface RunEvent { + runId: string; + projectId: string; + sourceId: string; + path: string; + action: EventAction; + message: string | null; + at: Date; +} diff --git a/src/lib/server/sync/core/plan.spec.ts b/src/lib/server/sync/core/plan.spec.ts new file mode 100644 index 0000000..b820af4 --- /dev/null +++ b/src/lib/server/sync/core/plan.spec.ts @@ -0,0 +1,67 @@ +import { describe, expect, it } from 'vitest'; +import type { DesiredState, ItemState, SyncedState } from './model'; +import { computeStatus, planAction } from './plan'; + +const desired: DesiredState = { + parentSourceId: 'p', + name: 'a.txt', + isFolder: false, + contentTag: 'c1', + modifiedAt: new Date(0), + size: 1, + deleted: false +}; +const synced: SyncedState = { + targetId: 't', + parentSourceId: 'p', + name: 'a.txt', + contentTag: 'c1', + deleted: false, + at: new Date(0) +}; + +function item(d: Partial = {}, s: Partial = {}, attemptCount = 0) { + return { + sourceId: 'x', + desired: { ...desired, ...d }, + synced: { ...synced, ...s }, + status: 'pending', + attemptCount, + lastError: null, + lastAttemptAt: null + } satisfies ItemState; +} + +describe('planAction', () => { + it.each([ + ['in sync', item(), null], + ['never synced', item({}, { targetId: null }), { kind: 'create' }], + ['deleted in ACC, alive in SharePoint', item({}, { deleted: true }), { kind: 'restore' }], + ['deleted in SharePoint', item({ deleted: true }), { kind: 'delete' }], + ['deleted before it was ever synced', item({ deleted: true }, { targetId: null }), null], + ['already deleted in both', item({ deleted: true }, { deleted: true }), null], + [ + 'moved, renamed and edited', + item({ parentSourceId: 'q', name: 'b.txt', contentTag: 'c2' }), + { kind: 'update', move: true, rename: true, content: true } + ], + [ + 'folder (content tags ignored)', + item({ isFolder: true, contentTag: null }, { contentTag: null }), + null + ] + ])('%s', (_label, state, expected) => { + expect(planAction(state)).toEqual(expected); + }); +}); + +describe('computeStatus', () => { + it.each([ + [item(), 'synced'], + [item({ deleted: true }, { deleted: true }), 'deleted'], + [item({ name: 'new' }, {}, 2), 'pending'], + [item({ name: 'new' }, {}, 3), 'failed'] + ] as const)('%#: %s', (state, expected) => { + expect(computeStatus(state, 3)).toBe(expected); + }); +}); diff --git a/src/lib/server/sync/core/plan.ts b/src/lib/server/sync/core/plan.ts new file mode 100644 index 0000000..8dd7112 --- /dev/null +++ b/src/lib/server/sync/core/plan.ts @@ -0,0 +1,39 @@ +import type { ItemState, ItemStatus, SyncAction } from './model'; +import type { ItemTree } from './tree'; + +/** The ACC operation needed to make the synced state match the desired state, if any. */ +export function planAction({ desired, synced }: ItemState): SyncAction | null { + if (desired.deleted) return synced.targetId && !synced.deleted ? { kind: 'delete' } : null; + if (!synced.targetId) return { kind: 'create' }; + if (synced.deleted) return { kind: 'restore' }; + + const move = desired.parentSourceId !== synced.parentSourceId; + const rename = desired.name !== synced.name; + const content = !desired.isFolder && desired.contentTag !== synced.contentTag; + return move || rename || content ? { kind: 'update', move, rename, content } : null; +} + +export function computeStatus(item: ItemState, maxAttempts: number): ItemStatus { + if (!planAction(item)) return item.desired.deleted ? 'deleted' : 'synced'; + return item.attemptCount >= maxAttempts ? 'failed' : 'pending'; +} + +export function withStatus(item: ItemState, maxAttempts: number): ItemState { + return { ...item, status: computeStatus(item, maxAttempts) }; +} + +/** + * Items with outstanding work and attempts left, ordered so parents exist before + * children: folders (shallow first), then files, then deletes (shallow first, so + * a folder delete covers its contents). + */ +export function workQueue( + items: Iterable, + tree: ItemTree, + maxAttempts: number +): ItemState[] { + const rank = (item: ItemState) => (item.desired.deleted ? 2 : item.desired.isFolder ? 0 : 1); + return [...items] + .filter((item) => computeStatus(item, maxAttempts) === 'pending') + .sort((a, b) => rank(a) - rank(b) || tree.depth(a.sourceId) - tree.depth(b.sourceId)); +} diff --git a/src/lib/server/sync/core/ports.ts b/src/lib/server/sync/core/ports.ts new file mode 100644 index 0000000..b9fd55f --- /dev/null +++ b/src/lib/server/sync/core/ports.ts @@ -0,0 +1,93 @@ +import type { + FileContent, + ItemState, + NewProject, + Project, + RunEvent, + RunOutcome, + RunCounts, + RunRecord, + RunTrigger, + SourceChange, + SourceRoot, + TargetRef +} from './model'; + +export interface ChangeBatch { + changes: SourceChange[]; + /** Cursor to pass next time. */ + cursor: string; + /** True when this is a complete listing: anything tracked but absent has been removed. */ + fullSync: boolean; +} + +export interface ChangeSource { + /** Changes since `cursor`; a null cursor (or an expired one) yields a full listing. */ + getChanges(root: SourceRoot, cursor: string | null): Promise; + download(root: SourceRoot, sourceId: string): Promise; +} + +/** + * The destination document store. Implementations own any fallbacks they need + * (e.g. move by copy + delete), so callers never branch on target quirks. + */ +export interface DocumentTarget { + createFolder(parentId: string, name: string): Promise; + uploadFile(parentId: string, name: string, content: FileContent): Promise; + uploadVersion(ref: TargetRef, name: string, content: FileContent): Promise; + rename(ref: TargetRef, name: string): Promise; + /** May return a different ref if the move had to be done by copy + delete. */ + move(ref: TargetRef, newParentId: string): Promise; + delete(ref: TargetRef): Promise; + /** Bring back a deleted item, keeping its history where possible. */ + restore( + ref: TargetRef, + parentId: string, + name: string, + content?: FileContent + ): Promise; +} + +export interface IgnorePolicy { + isIgnored(name: string, isFolder: boolean): boolean; +} + +export interface ProjectRepository { + get(id: string): Promise; + list(): Promise; + create(project: NewProject): Promise; + pause(id: string, reason: string): Promise; + resume(id: string): Promise; + markFirstSynced(id: string, at: Date): Promise; + setLastRunAt(id: string, at: Date): Promise; + /** Forget all sync state so the project starts over from a full listing. */ + reset(id: string): Promise; +} + +export interface ItemRepository { + listByProject(projectId: string): Promise; + /** Atomically store ingested changes and the cursor they were read up to. */ + commitIngest(projectId: string, items: ItemState[], cursor: string): Promise; + save(projectId: string, items: ItemState[]): Promise; +} + +export interface RunRepository { + start(projectId: string, trigger: RunTrigger, at: Date): Promise; + finish( + runId: string, + result: { finishedAt: Date; outcome: RunOutcome; error: string | null; counts: RunCounts } + ): Promise; + addEvent(event: RunEvent): Promise; + listSince(projectId: string, since: Date): Promise; + listEvents(runId: string): Promise; + /** Delete runs (and their events) started before `cutoff`; returns how many runs were removed. */ + pruneBefore(cutoff: Date): Promise; +} + +export type Clock = () => Date; + +export interface Logger { + info(message: string, meta?: Record): void; + warn(message: string, meta?: Record): void; + error(message: string, meta?: Record): void; +} diff --git a/src/lib/server/sync/core/reconciler.ts b/src/lib/server/sync/core/reconciler.ts new file mode 100644 index 0000000..28701fe --- /dev/null +++ b/src/lib/server/sync/core/reconciler.ts @@ -0,0 +1,237 @@ +import { errorMessage, ServiceUnavailableError } from './errors'; +import { + emptyCounts, + type EventAction, + type ItemState, + type Project, + type RunCounts, + type SyncAction, + type SyncedState, + type TargetRef +} from './model'; +import { planAction, withStatus, workQueue } from './plan'; +import type { ChangeSource, Clock, DocumentTarget, ItemRepository, RunRepository } from './ports'; +import { ItemTree } from './tree'; + +export const WAITING_FOR_PARENT = 'Waiting for its parent folder to sync.'; + +export interface ReconcilerDeps { + source: ChangeSource; + target: DocumentTarget; + items: ItemRepository; + runs: RunRepository; + clock: Clock; + maxAttempts: number; +} + +export interface ReconcileResult { + counts: RunCounts; + /** Set when a service outage stopped the run early. */ + abortedWith: string | null; +} + +type RecordEvent = (action: EventAction, message?: string) => Promise; + +/** Pushes every pending item's desired state to ACC, one item at a time. */ +export class Reconciler { + constructor(private readonly deps: ReconcilerDeps) {} + + async reconcile( + project: Project, + runId: string, + items: Map + ): Promise { + const { maxAttempts } = this.deps; + const tree = new ItemTree(project.source.rootItemId, items); + const counts = emptyCounts(); + + for (const { sourceId } of workQueue(items.values(), tree, maxAttempts)) { + // Re-read: an earlier folder delete may already have covered this item. + const item = items.get(sourceId)!; + const action = planAction(item); + if (!action) continue; + + const record: RecordEvent = async (eventAction, message) => { + counts[eventAction]++; + await this.deps.runs.addEvent({ + runId, + projectId: project.id, + sourceId, + path: tree.path(sourceId), + action: eventAction, + message: message ?? null, + at: this.deps.clock() + }); + }; + + try { + await this.apply(project, items, tree, item, action, record); + } catch (error) { + if (error instanceof ServiceUnavailableError) { + return { counts, abortedWith: error.message }; + } + throw error; + } + } + return { counts, abortedWith: null }; + } + + private async apply( + project: Project, + items: Map, + tree: ItemTree, + item: ItemState, + action: SyncAction, + record: RecordEvent + ): Promise { + const parentTargetId = this.targetParentId(project, items, item); + const needsParent = action.kind !== 'delete' && (action.kind !== 'update' || action.move); + if (needsParent && !parentTargetId) { + await this.store(project, items, [{ ...item, lastError: WAITING_FOR_PARENT }]); + return; + } + + const synced: SyncedState = { ...item.synced }; + const now = this.deps.clock(); + try { + await this.execute(project, item, action, parentTargetId!, synced, record); + const done: ItemState = { + ...item, + synced: { ...synced, at: now }, + attemptCount: 0, + lastError: null, + lastAttemptAt: now + }; + await this.store(project, items, [done]); + if (action.kind === 'delete' && item.desired.isFolder) { + await this.coverDeletedContents(project, items, tree, item.sourceId); + } + } catch (error) { + if (error instanceof ServiceUnavailableError) { + // Keep partial progress but don't charge an attempt for an outage. + await this.store(project, items, [{ ...item, synced }]); + throw error; + } + const message = errorMessage(error); + await this.store(project, items, [ + { + ...item, + synced, + attemptCount: item.attemptCount + 1, + lastError: message, + lastAttemptAt: now + } + ]); + await record('failed', message); + } + } + + /** Runs the target calls for one action, recording progress into `synced` as each succeeds. */ + private async execute( + project: Project, + item: ItemState, + action: SyncAction, + parentTargetId: string, + synced: SyncedState, + record: RecordEvent + ): Promise { + const { target } = this.deps; + const { desired } = item; + const adopt = (ref: TargetRef) => + Object.assign(synced, { + targetId: ref.id, + parentSourceId: desired.parentSourceId, + name: desired.name, + contentTag: desired.contentTag, + deleted: false + }); + + switch (action.kind) { + case 'create': { + const ref = desired.isFolder + ? await target.createFolder(parentTargetId, desired.name) + : await target.uploadFile( + parentTargetId, + desired.name, + await this.download(project, item) + ); + adopt(ref); + return record('created'); + } + case 'restore': { + const stale = !desired.isFolder && desired.contentTag !== synced.contentTag; + const content = stale ? await this.download(project, item) : undefined; + adopt(await target.restore(refOf(item), parentTargetId, desired.name, content)); + return record('restored'); + } + case 'delete': { + await target.delete(refOf(item)); + synced.deleted = true; + return record('deleted'); + } + case 'update': { + let ref = refOf(item); + if (action.move) { + ref = await target.move(ref, parentTargetId); + Object.assign(synced, { targetId: ref.id, parentSourceId: desired.parentSourceId }); + await record('moved'); + } + if (action.rename) { + await target.rename(ref, desired.name); + synced.name = desired.name; + await record('renamed'); + } + if (action.content) { + await target.uploadVersion(ref, desired.name, await this.download(project, item)); + synced.contentTag = desired.contentTag; + await record('updated'); + } + } + } + } + + /** Deleting a folder in ACC takes its contents with it; reflect that in their synced state. */ + private async coverDeletedContents( + project: Project, + items: Map, + tree: ItemTree, + folderId: string + ): Promise { + const covered = tree + .syncedDescendants(folderId) + .filter((d) => d.synced.targetId && !d.synced.deleted) + .map((d) => ({ ...d, synced: { ...d.synced, deleted: true } })); + await this.store(project, items, covered); + } + + private targetParentId( + project: Project, + items: ReadonlyMap, + item: ItemState + ): string | null { + const parentId = item.desired.parentSourceId; + if (parentId === project.source.rootItemId) return project.target.rootFolderId; + const parent = items.get(parentId); + return parent?.synced.targetId && !parent.synced.deleted ? parent.synced.targetId : null; + } + + private download(project: Project, item: ItemState) { + return this.deps.source.download(project.source, item.sourceId); + } + + /** Persists items with fresh statuses and mirrors them into the in-memory map. */ + private async store( + project: Project, + items: Map, + updated: ItemState[] + ): Promise { + if (updated.length === 0) return; + const withStatuses = updated.map((item) => withStatus(item, this.deps.maxAttempts)); + await this.deps.items.save(project.id, withStatuses); + for (const item of withStatuses) items.set(item.sourceId, item); + } +} + +function refOf(item: ItemState): TargetRef { + return { id: item.synced.targetId!, isFolder: item.desired.isFolder }; +} diff --git a/src/lib/server/sync/core/tree.ts b/src/lib/server/sync/core/tree.ts new file mode 100644 index 0000000..adecce8 --- /dev/null +++ b/src/lib/server/sync/core/tree.ts @@ -0,0 +1,73 @@ +import type { ItemState } from './model'; + +type ParentOf = (item: ItemState) => string | null; + +const desiredParent: ParentOf = (item) => item.desired.parentSourceId; +const syncedParent: ParentOf = (item) => item.synced.parentSourceId; + +/** + * Read-only view over a project's items. Reads the map live, so it reflects + * entries replaced after construction. + */ +export class ItemTree { + constructor( + private readonly rootId: string, + private readonly items: ReadonlyMap + ) {} + + /** Desired ancestors, nearest first, stopping before the root. Cycle-safe. */ + ancestors(sourceId: string): ItemState[] { + const result: ItemState[] = []; + const seen = new Set([sourceId]); + let parentId = this.items.get(sourceId)?.desired.parentSourceId; + while (parentId && parentId !== this.rootId && !seen.has(parentId)) { + const parent = this.items.get(parentId); + if (!parent) break; + result.push(parent); + seen.add(parentId); + parentId = parent.desired.parentSourceId; + } + return result; + } + + depth(sourceId: string): number { + return this.ancestors(sourceId).length; + } + + /** Display path relative to the project root, e.g. `Drawings/Level 1/plan.pdf`. */ + path(sourceId: string): string { + const item = this.items.get(sourceId); + if (!item) return sourceId; + return [...this.ancestors(sourceId).reverse(), item].map((i) => i.desired.name).join('/'); + } + + /** Items under `folderId` according to SharePoint. */ + desiredDescendants(folderId: string): ItemState[] { + return this.descendants(folderId, desiredParent); + } + + /** Items under `folderId` as they currently sit in ACC. */ + syncedDescendants(folderId: string): ItemState[] { + return this.descendants(folderId, syncedParent); + } + + private descendants(folderId: string, parentOf: ParentOf): ItemState[] { + const children = new Map(); + for (const item of this.items.values()) { + const parentId = parentOf(item); + if (parentId) children.set(parentId, [...(children.get(parentId) ?? []), item]); + } + const result: ItemState[] = []; + const seen = new Set([folderId]); + const queue = [folderId]; + while (queue.length > 0) { + for (const child of children.get(queue.shift()!) ?? []) { + if (seen.has(child.sourceId)) continue; + seen.add(child.sourceId); + result.push(child); + queue.push(child.sourceId); + } + } + return result; + } +} diff --git a/src/lib/server/sync/scheduler.spec.ts b/src/lib/server/sync/scheduler.spec.ts new file mode 100644 index 0000000..e0595ad --- /dev/null +++ b/src/lib/server/sync/scheduler.spec.ts @@ -0,0 +1,38 @@ +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; +import { IntervalScheduler } from './scheduler'; +import { silentLogger } from './testing/harness'; + +describe('IntervalScheduler', () => { + beforeEach(() => vi.useFakeTimers()); + afterEach(() => vi.useRealTimers()); + + it('waits for a slow task to finish before scheduling the next run', async () => { + const scheduler = new IntervalScheduler(silentLogger); + let runs = 0; + scheduler.every('slow', 1000, async () => { + runs++; + await new Promise((resolve) => setTimeout(resolve, 5000)); + }); + + await vi.advanceTimersByTimeAsync(1000); + expect(runs).toBe(1); + await vi.advanceTimersByTimeAsync(4000); + expect(runs).toBe(1); + await vi.advanceTimersByTimeAsync(2000); + expect(runs).toBe(2); + scheduler.stop(); + }); + + it('keeps going after a task throws, and stops cleanly', async () => { + const scheduler = new IntervalScheduler(silentLogger); + const task = vi.fn().mockRejectedValueOnce(new Error('boom')).mockResolvedValue(undefined); + scheduler.every('flaky', 1000, task); + + await vi.advanceTimersByTimeAsync(2000); + expect(task).toHaveBeenCalledTimes(2); + + scheduler.stop(); + await vi.advanceTimersByTimeAsync(5000); + expect(task).toHaveBeenCalledTimes(2); + }); +}); diff --git a/src/lib/server/sync/scheduler.ts b/src/lib/server/sync/scheduler.ts new file mode 100644 index 0000000..97c4843 --- /dev/null +++ b/src/lib/server/sync/scheduler.ts @@ -0,0 +1,39 @@ +import { errorMessage } from './core/errors'; +import type { Logger } from './core/ports'; + +/** + * Runs async tasks on fixed intervals. The next run of a task is scheduled only + * after the previous one settles, so a slow task never overlaps itself. + */ +export class IntervalScheduler { + private readonly timers = new Set>(); + private stopped = false; + + constructor(private readonly logger: Logger) {} + + every(name: string, intervalMs: number, task: () => Promise): void { + const tick = async () => { + try { + await task(); + } catch (error) { + this.logger.error('Scheduled task failed', { task: name, error: errorMessage(error) }); + } + schedule(); + }; + const schedule = () => { + if (this.stopped) return; + const timer = setTimeout(() => { + this.timers.delete(timer); + void tick(); + }, intervalMs); + this.timers.add(timer); + }; + schedule(); + } + + stop(): void { + this.stopped = true; + for (const timer of this.timers) clearTimeout(timer); + this.timers.clear(); + } +} diff --git a/src/lib/server/sync/testing/fake-acc.ts b/src/lib/server/sync/testing/fake-acc.ts new file mode 100644 index 0000000..f79244e --- /dev/null +++ b/src/lib/server/sync/testing/fake-acc.ts @@ -0,0 +1,145 @@ +import type { FileContent, TargetRef } from '../core/model'; +import type { DocumentTarget } from '../core/ports'; + +interface AccNode { + id: string; + parentId: string | null; + name: string; + isFolder: boolean; + deleted: boolean; + versions: string[]; +} + +/** + * In-memory stand-in for ACC Docs. Deleting a folder hides its contents (as in + * ACC); restoring a folder does not bring its contents back. + */ +export class FakeAcc implements DocumentTarget { + readonly rootFolderId = 'acc-root'; + readonly calls: string[] = []; + private readonly nodes = new Map(); + private readonly failures = new Map(); + private nextId = 1; + + constructor() { + this.nodes.set(this.rootFolderId, { + id: this.rootFolderId, + parentId: null, + name: 'Project Files', + isFolder: true, + deleted: false, + versions: [] + }); + } + + /** Make the next `times` operations on an item with this name throw `error`. */ + failOn(name: string, error: Error, times = Infinity): void { + this.failures.set(name, { error, remaining: times }); + } + + /** Adds a file directly, as if someone uploaded it by hand in ACC. */ + addByHand(parentId: string, name: string): string { + return this.insert(parentId, name, false, ['by hand']); + } + + /** Live paths, e.g. `Drawings/`, `Drawings/plan.pdf@2` (file@version count). */ + tree(): string[] { + return [...this.nodes.values()] + .filter((node) => node.id !== this.rootFolderId && this.isAlive(node)) + .map((node) => this.path(node) + (node.isFolder ? '/' : `@${node.versions.length}`)) + .sort(); + } + + latestContent(path: string): string | undefined { + const node = [...this.nodes.values()].find((n) => this.isAlive(n) && this.path(n) === path); + return node?.versions.at(-1); + } + + async createFolder(parentId: string, name: string): Promise { + this.enter('createFolder', name); + return { id: this.insert(parentId, name, true, []), isFolder: true }; + } + + async uploadFile(parentId: string, name: string, content: FileContent): Promise { + this.enter('uploadFile', name); + return { id: this.insert(parentId, name, false, [await read(content)]), isFolder: false }; + } + + async uploadVersion(ref: TargetRef, name: string, content: FileContent): Promise { + const node = this.node(ref, 'uploadVersion'); + node.versions.push(await read(content)); + node.name = name; + } + + async rename(ref: TargetRef, name: string): Promise { + this.node(ref, 'rename').name = name; + } + + async move(ref: TargetRef, newParentId: string): Promise { + this.node(ref, 'move').parentId = newParentId; + return ref; + } + + async delete(ref: TargetRef): Promise { + this.node(ref, 'delete').deleted = true; + } + + async restore( + ref: TargetRef, + parentId: string, + name: string, + content?: FileContent + ): Promise { + const node = this.node(ref, 'restore'); + Object.assign(node, { deleted: false, parentId, name }); + if (content) node.versions.push(await read(content)); + return ref; + } + + private insert(parentId: string, name: string, isFolder: boolean, versions: string[]): string { + if (!this.nodes.has(parentId)) throw new Error(`No ACC folder ${parentId}`); + const id = `acc-${this.nextId++}`; + this.nodes.set(id, { id, parentId, name, isFolder, deleted: false, versions }); + return id; + } + + private node(ref: TargetRef, operation: string): AccNode { + const node = this.nodes.get(ref.id); + if (!node) throw new Error(`No ACC item ${ref.id}`); + this.enter(operation, node.name); + return node; + } + + private enter(operation: string, name: string): void { + this.calls.push(`${operation} ${name}`); + const failure = this.failures.get(name); + if (failure && failure.remaining > 0) { + failure.remaining--; + throw failure.error; + } + } + + private isAlive(node: AccNode): boolean { + for ( + let n: AccNode | undefined = node; + n; + n = n.parentId ? this.nodes.get(n.parentId) : undefined + ) { + if (n.deleted) return false; + } + return true; + } + + private path(node: AccNode): string { + const names: string[] = []; + for (let n: AccNode | undefined = node; n && n.id !== this.rootFolderId;) { + names.unshift(n.name); + n = n.parentId ? this.nodes.get(n.parentId) : undefined; + } + return names.join('/'); + } +} + +async function read(content: FileContent): Promise { + return new Response(content.stream).text(); +} diff --git a/src/lib/server/sync/testing/fake-drive.ts b/src/lib/server/sync/testing/fake-drive.ts new file mode 100644 index 0000000..15eb925 --- /dev/null +++ b/src/lib/server/sync/testing/fake-drive.ts @@ -0,0 +1,127 @@ +import type { FileContent, SourceChange, SourceItem, SourceRoot } from '../core/model'; +import type { ChangeBatch, ChangeSource } from '../core/ports'; + +interface DriveNode { + id: string; + parentId: string | null; + name: string; + isFolder: boolean; + content: string; + version: number; + deleted: boolean; +} + +/** + * In-memory stand-in for a SharePoint document library that behaves like Graph + * delta: a null cursor lists everything; otherwise each item changed since the + * cursor is reported once, in its latest state. + */ +export class FakeDrive implements ChangeSource { + readonly driveRootId = 'drive-root'; + private readonly nodes = new Map(); + private readonly log: string[] = []; + private nextId = 1; + + constructor() { + this.nodes.set(this.driveRootId, { + id: this.driveRootId, + parentId: null, + name: 'root', + isFolder: true, + content: '', + version: 0, + deleted: false + }); + } + + addFolder(parentId: string, name: string): string { + return this.add(parentId, name, true, ''); + } + + addFile(parentId: string, name: string, content = `${name} v1`): string { + return this.add(parentId, name, false, content); + } + + edit(id: string, content: string): void { + this.change(id, (node) => { + node.content = content; + node.version++; + }); + } + + rename(id: string, name: string): void { + this.change(id, (node) => (node.name = name)); + } + + move(id: string, parentId: string): void { + this.change(id, (node) => (node.parentId = parentId)); + } + + /** Reports only the removed item, not its contents: the harder case for the engine. */ + remove(id: string): void { + this.change(id, (node) => (node.deleted = true)); + } + + /** Reports only the restored item, not its contents. */ + restore(id: string): void { + this.change(id, (node) => (node.deleted = false)); + } + + async getChanges(_root: SourceRoot, cursor: string | null): Promise { + const end = String(this.log.length); + if (cursor === null) { + const changes = [...this.nodes.values()] + .filter((node) => this.isAlive(node)) + .map((node) => this.toChange(node)); + return { changes, cursor: end, fullSync: true }; + } + const ids = [...new Set(this.log.slice(Number(cursor)).reverse())].reverse(); + return { + changes: ids.map((id) => this.toChange(this.nodes.get(id)!)), + cursor: end, + fullSync: false + }; + } + + async download(_root: SourceRoot, sourceId: string): Promise { + const bytes = new TextEncoder().encode(this.nodes.get(sourceId)!.content); + return { size: bytes.length, stream: new Response(bytes).body! }; + } + + private add(parentId: string, name: string, isFolder: boolean, content: string): string { + const id = `sp-${this.nextId++}`; + this.nodes.set(id, { id, parentId, name, isFolder, content, version: 1, deleted: false }); + this.log.push(id); + return id; + } + + private change(id: string, mutate: (node: DriveNode) => void): void { + mutate(this.nodes.get(id)!); + this.log.push(id); + } + + private isAlive(node: DriveNode): boolean { + for ( + let n: DriveNode | undefined = node; + n; + n = n.parentId ? this.nodes.get(n.parentId) : undefined + ) { + if (n.deleted) return false; + } + return true; + } + + private toChange(node: DriveNode): SourceChange { + if (node.deleted) return { kind: 'delete', sourceId: node.id }; + const item: SourceItem = { + sourceId: node.id, + parentSourceId: node.parentId, + name: node.name, + isFolder: node.isFolder, + contentTag: node.isFolder ? null : `c${node.version}`, + modifiedAt: new Date(Date.UTC(2026, 0, 1, 0, 0, node.version)), + size: node.isFolder ? null : node.content.length + }; + return { kind: 'upsert', item }; + } +} diff --git a/src/lib/server/sync/testing/harness.ts b/src/lib/server/sync/testing/harness.ts new file mode 100644 index 0000000..df2f28a --- /dev/null +++ b/src/lib/server/sync/testing/harness.ts @@ -0,0 +1,70 @@ +import { openDatabase } from '../../adapters/sqlite/database'; +import { SqliteItemRepository } from '../../adapters/sqlite/item-repository'; +import { SqliteProjectRepository } from '../../adapters/sqlite/project-repository'; +import { SqliteRunRepository } from '../../adapters/sqlite/run-repository'; +import { SyncEngine } from '../core/engine'; +import { PatternIgnorePolicy } from '../core/ignore'; +import type { Logger } from '../core/ports'; +import { Reconciler } from '../core/reconciler'; +import { FakeAcc } from './fake-acc'; +import { FakeDrive } from './fake-drive'; + +export const silentLogger: Logger = { info() {}, warn() {}, error() {} }; + +/** A real engine over in-memory SQLite, a fake SharePoint drive and a fake ACC. */ +export async function createHarness({ maxAttempts = 3 } = {}) { + let now = Date.UTC(2026, 9, 1); + const clock = () => new Date((now += 1000)); + + const db = openDatabase(':memory:'); + const projects = new SqliteProjectRepository(db, clock); + const items = new SqliteItemRepository(db); + const runs = new SqliteRunRepository(db); + + const drive = new FakeDrive(); + const acc = new FakeAcc(); + const rootId = drive.addFolder(drive.driveRootId, 'Project X'); + + const reconciler = new Reconciler({ + source: drive, + target: acc, + items, + runs, + clock, + maxAttempts + }); + const engine = new SyncEngine({ + source: drive, + projects, + items, + runs, + reconciler, + ignore: new PatternIgnorePolicy(), + clock, + logger: silentLogger, + maxAttempts + }); + + const project = await projects.create({ + name: 'Project X', + source: { siteId: 'site', driveId: 'drive', rootItemId: rootId }, + sourceDisplayPath: '/sites/ProjectX/Documents/Project X', + target: { hubId: 'hub', projectId: 'acc-project', rootFolderId: acc.rootFolderId }, + targetDisplayPath: 'Project X/Project Files' + }); + + return { + db, + drive, + acc, + rootId, + projects, + items, + runs, + engine, + project, + sync: () => engine.runProject(project.id, 'schedule'), + itemNamed: async (name: string) => + (await items.listByProject(project.id)).find((i) => i.desired.name === name)! + }; +} diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte new file mode 100644 index 0000000..7a8b5d1 --- /dev/null +++ b/src/routes/+layout.svelte @@ -0,0 +1,12 @@ + + + + + + +{@render children()} diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte new file mode 100644 index 0000000..cc88df0 --- /dev/null +++ b/src/routes/+page.svelte @@ -0,0 +1,2 @@ +

Welcome to SvelteKit

+

Visit svelte.dev/docs/kit to read the documentation

diff --git a/static/robots.txt b/static/robots.txt new file mode 100644 index 0000000..b6dd667 --- /dev/null +++ b/static/robots.txt @@ -0,0 +1,3 @@ +# allow crawling everything by default +User-agent: * +Disallow: diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..7619945 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "$app/tsconfig", + "compilerOptions": { + "strict": true, + "types": ["$app/types", "node"] + }, + "include": ["src", "vite.config.ts", "drizzle.config.ts"] +} diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 0000000..51fcb1c --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,30 @@ +import { defineConfig } from 'vitest/config'; +import adapter from '@sveltejs/adapter-node'; +import { sveltekit } from '@sveltejs/kit/vite'; + +export default defineConfig({ + plugins: [ + sveltekit({ + compilerOptions: { + // Force runes mode for the project, except for libraries. Can be removed in svelte 6. + runes: ({ filename }) => + filename.split(/[/\\]/).includes('node_modules') ? undefined : true + }, + adapter: adapter() + }) + ], + test: { + expect: { requireAssertions: true }, + projects: [ + { + extends: './vite.config.ts', + test: { + name: 'server', + environment: 'node', + include: ['src/**/*.{test,spec}.{js,ts}'], + exclude: ['src/**/*.svelte.{test,spec}.{js,ts}'] + } + } + ] + } +});