@vite-hub/workspace 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +62 -19
- package/dist/blob-database/postgres.d.ts +424 -0
- package/dist/blob-database/postgres.js +2 -0
- package/dist/blob-database-sources-DDZ1wV9w.js +9 -0
- package/dist/blob-database.d.ts +33 -447
- package/dist/blob-database.js +637 -208
- package/dist/checkout.js +1 -1
- package/dist/cloudflare.d.ts +1 -1
- package/dist/cloudflare.js +1 -1
- package/dist/{config-D1QENneP.js → config-DiyPi3Ff.js} +7 -7
- package/dist/{config-CDeGd0RB.d.ts → config-hxABr_Gg.d.ts} +1 -1
- package/dist/durability.d.ts +11 -2
- package/dist/durability.js +46 -4
- package/dist/{error-diagnostics-CQ4BUqRe.js → error-diagnostics-C0KyI408.js} +5 -1
- package/dist/{error-diagnostics-B5s9kNEA.js → error-diagnostics-Cth97txN.js} +10 -2
- package/dist/{path-uxLkzrZm.d.ts → errors-DXCZjdUU.d.ts} +0 -1
- package/dist/{file-CqG9zqiF.js → file-C1DYoGz3.js} +1 -1
- package/dist/{target-Dm9dHAVJ.js → file-metadata-Dv2JZwal.js} +1 -29
- package/dist/{files-B6wpAhEx.js → files-iHyik8jj.js} +2 -2
- package/dist/files.d.ts +13 -5
- package/dist/files.js +6 -5
- package/dist/{github-DKAlO0Vh.js → github-CFHl6RI0.js} +4 -4
- package/dist/{glob-BOqSKzSg.js → glob-BitxqDhb.js} +7 -7
- package/dist/{glob-Cjxms1t7.js → glob-Buxfvmyy.js} +1 -1
- package/dist/history-schema-BBWbpDk4.d.ts +436 -0
- package/dist/history-schema-postgres-U_ueRvmO.js +41 -0
- package/dist/{host-Bf1a2uo_.js → host-Dmr2Ctem.js} +150 -16
- package/dist/{hosted-zG7HJaE4.js → hosted-BktlvkF2.js} +20 -11
- package/dist/{hosted-vercel-blob-AbXG8fvR.js → hosted-vercel-blob-D0IPAjb1.js} +5 -5
- package/dist/hosted-vercel-blob.d.ts +1 -1
- package/dist/hosted-vercel-blob.js +1 -1
- package/dist/hosted.d.ts +1 -1
- package/dist/hosted.js +1 -1
- package/dist/index.d.ts +11 -23
- package/dist/index.js +28 -106
- package/dist/internal/workspace.d.ts +14 -0
- package/dist/internal/workspace.js +86 -0
- package/dist/{lifecycle-D8FdpBod.js → lifecycle-D6WN2dd_.js} +11 -8
- package/dist/loader.d.ts +1 -1
- package/dist/loader.js +2 -2
- package/dist/{mcp-resources-DntxtmDU.js → mcp-resources-TtxLNSL6.js} +1 -1
- package/dist/{memory-D5jq9HZW.js → memory-DjzwSng2.js} +16 -8
- package/dist/{metadata-target-DDoOQNp1.js → metadata-target-CR0aDtvS.js} +205 -60
- package/dist/{operation-definition-nmRu_O3V.d.ts → operation-definition-CI2PJGqu.d.ts} +8 -2
- package/dist/{operations-D8uCpzhM.js → operations-Cib30_dt.js} +5 -5
- package/dist/{operations-DsY2MQnG.js → operations-dtcU5LkD.js} +22 -7
- package/dist/operations.d.ts +2 -2
- package/dist/operations.js +1 -1
- package/dist/{path--wrT_Azm.js → path-BlIBpI7U.js} +1 -16
- package/dist/{plugins-CsrXCA1Q.d.ts → plugins-DKCBrH31.d.ts} +1 -1
- package/dist/{provider-sm9uzkLg.js → provider-Fc3M6bEx.js} +23 -10
- package/dist/providers/github/store.d.ts +1 -1
- package/dist/providers/github/store.js +1 -1
- package/dist/{registry-CwryP59t.d.ts → registry-CLL0TY0L.d.ts} +5 -3
- package/dist/{registry-DmVfUe4K.js → registry-CedQvQxW.js} +8 -3
- package/dist/{registry-CFl1Htyc.d.ts → registry-DpB5PBA4.d.ts} +5 -4
- package/dist/{request-scope-Dw5n8bMC.js → request-scope-Bcv2kD8h.js} +2 -1
- package/dist/rule-keys-Bsz6jTTF.js +19 -0
- package/dist/rules-OHaPFopX.js +269 -0
- package/dist/runtime/assets.d.ts +1 -1
- package/dist/runtime/assets.js +3 -3
- package/dist/runtime/empty-assets-registry.d.ts +1 -1
- package/dist/runtime/empty-registry.d.ts +2 -2
- package/dist/runtime/registry.d.ts +2 -2
- package/dist/runtime/request.js +1 -1
- package/dist/runtime/state.d.ts +5 -4
- package/dist/runtime/state.js +18 -6
- package/dist/runtime/workspace.d.ts +1 -1
- package/dist/runtime/workspace.js +1 -1
- package/dist/runtime.d.ts +9 -8
- package/dist/runtime.js +23 -16
- package/dist/{search-C_RfoM2j.js → search-BqNV9LnO.js} +1 -1
- package/dist/{server-Cd4-iCh5.js → server-CFtrOPk6.js} +5 -5
- package/dist/server.d.ts +2 -2
- package/dist/server.js +1 -1
- package/dist/{shared-ovXVSV3-.js → shared-BgDjxY3J.js} +14 -3
- package/dist/source-metadata.d.ts +2 -2
- package/dist/source-metadata.js +3 -3
- package/dist/{state-C-YtsaiJ.d.ts → state-DBV6VHS6.d.ts} +13 -21
- package/dist/{store-NZoRto-Y.js → store-BRMdD8Ft.js} +37 -36
- package/dist/{sync-CrT8zjwc.js → sync-BezGVzrW.js} +4 -4
- package/dist/test.d.ts +1 -1
- package/dist/test.js +1 -1
- package/dist/{types-1Z-tKK3g.d.ts → types-9DMtFjaa.d.ts} +52 -4
- package/dist/{use-B0o5HoBl.js → use-Dm2tbI5F.js} +15 -15
- package/dist/{use-CjbF8EO9.d.ts → use-Dv973swc.d.ts} +20 -28
- package/dist/{state-Cb_hIyAw.js → use-tools-C1qvhzme.js} +4 -17
- package/dist/use-tools-CMUthOdy.d.ts +12 -0
- package/dist/{utils-Dw-WULEZ.js → utils-C0Au2R16.js} +77 -268
- package/dist/vite.d.ts +32 -3
- package/dist/vite.js +990 -1286
- package/dist/vitehub-grants-C8IAl5-M.js +38 -0
- package/dist/{workspace-DvKu5PRa.js → workspace-CFrwWhEm.js} +18 -17
- package/dist/{workspace-CIXgHeyX.d.ts → workspace-Cw4ycIW-.d.ts} +1 -1
- package/package.json +22 -12
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ Use `skipLibCheck: true` in app TypeScript configs while ViteHub depends on runt
|
|
|
35
35
|
|
|
36
36
|
The local Store persists file metadata inside `.vitehub` under the Workspace root. If file removal stops before metadata cleanup completes, reads reject with `Interrupted Workspace removal` so a restored file cannot reuse deleted ownership. Retry removal of the reported path with `force: true` and, for directories, `recursive: true` before restoring files.
|
|
37
37
|
|
|
38
|
-
Lock markers are not reclaimed based on age because a slow operation or failed heartbeat may still own them. If a process crashes and operations report `Timed out waiting to read Workspace` or `Timed out waiting to write Workspace`, stop every process using that Workspace. Call `recoverLocalWorkspaceLocks({ root, offline: true })` from `@vite-hub/workspace/runtime` with the Local Store's root, then restart the processes after recovery succeeds. Prevent changes to the Store and its ancestor directories throughout recovery. The `offline: true` flag confirms exclusive offline access; it does not stop other processes. See [Local Store recovery](
|
|
38
|
+
Lock markers are not reclaimed based on age because a slow operation or failed heartbeat may still own them. If a process crashes and operations report `Timed out waiting to read Workspace` or `Timed out waiting to write Workspace`, stop every process using that Workspace. Call `recoverLocalWorkspaceLocks({ root, offline: true })` from `@vite-hub/workspace/runtime` with the Local Store's root, then restart the processes after recovery succeeds. Prevent changes to the Store and its ancestor directories throughout recovery. The `offline: true` flag confirms exclusive offline access; it does not stop other processes. See [Local Store recovery](https://vitehub.dev/docs/workspace/limits-and-errors#recover-a-local-store-after-a-crash) for the procedure.
|
|
39
39
|
|
|
40
40
|
Set `locks: "process"` on a local Store when one process owns its root, for example a disposable checkout that one worker uses. The Store then keeps the same per-path read and write locks in memory. It creates no `.vitehub/locks` directory, does not poll lock markers, and lists entries in parallel. Keep the default `locks: "filesystem"` when more than one process can access the root.
|
|
41
41
|
|
|
@@ -148,12 +148,11 @@ Definition, apply its migrations, and pass
|
|
|
148
148
|
Workspace Definition's `store`. The framework also exports
|
|
149
149
|
`vite-hub/workspace/blob-database`.
|
|
150
150
|
|
|
151
|
-
`
|
|
152
|
-
|
|
153
|
-
the
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
relations of the build.
|
|
151
|
+
`blob` names a Blob store and `database` names a Database. The Store looks
|
|
152
|
+
them up on first use, because the build loads the Workspace Definition without
|
|
153
|
+
the app's Databases. `blob` also takes a `BlobStorage` object, and `database`
|
|
154
|
+
takes a Drizzle database or a function that returns one. Do not pass the
|
|
155
|
+
Database Definition: it holds options only.
|
|
157
156
|
|
|
158
157
|
```ts [server/databases/history/index.ts]
|
|
159
158
|
import { defineDatabase } from "@vite-hub/database"
|
|
@@ -163,20 +162,31 @@ export default defineDatabase({ name: "history", schema: workspaceHistorySchema
|
|
|
163
162
|
```
|
|
164
163
|
|
|
165
164
|
```ts [server/workspaces/notes.ts]
|
|
166
|
-
import { blob } from "@vite-hub/blob"
|
|
167
|
-
import { useDatabase } from "@vite-hub/database"
|
|
168
165
|
import { defineWorkspace } from "@vite-hub/workspace"
|
|
169
166
|
import { createBlobDatabaseWorkspaceStore } from "@vite-hub/workspace/blob-database"
|
|
170
167
|
|
|
171
168
|
export default defineWorkspace({
|
|
172
169
|
store: createBlobDatabaseWorkspaceStore({
|
|
173
|
-
blob:
|
|
174
|
-
database:
|
|
170
|
+
blob: "workspace-history",
|
|
171
|
+
database: "history",
|
|
175
172
|
workspace: "notes-123",
|
|
176
173
|
}),
|
|
177
174
|
})
|
|
178
175
|
```
|
|
179
176
|
|
|
177
|
+
On Postgres, import `workspaceHistorySchema` from
|
|
178
|
+
`@vite-hub/workspace/blob-database/postgres` and set `dialect: "postgresql"`.
|
|
179
|
+
If the Database uses Cloudflare Hyperdrive, disable query caching so all instances
|
|
180
|
+
read the current head.
|
|
181
|
+
|
|
182
|
+
Instances that use the same Blob store, Database, and workspace identity share
|
|
183
|
+
one Workspace. The Database decides which commit wins: a commit from a stale
|
|
184
|
+
head fails with `WORKSPACE_CONFLICT` on every instance. Postgres runs each
|
|
185
|
+
commit in one transaction that locks the Workspace row. SQLite, libSQL, and D1
|
|
186
|
+
run it as one batch of conditional statements. With names, the durability
|
|
187
|
+
report shows the Store as `shared` only when the Blob store and the Database
|
|
188
|
+
are both shared. With objects, it trusts them, as it does a custom Store.
|
|
189
|
+
|
|
180
190
|
```ts
|
|
181
191
|
import { useWorkspace } from "@vite-hub/workspace"
|
|
182
192
|
|
|
@@ -196,7 +206,7 @@ await workspace.history.usage()
|
|
|
196
206
|
Commits publish the complete desired file set with an atomic head comparison.
|
|
197
207
|
Catch `isWorkspaceConflict(error)` for a stale `ifHead`. Omitted paths disappear
|
|
198
208
|
from the new revision; earlier versions retain their bytes. Read mode exposes
|
|
199
|
-
`head`, `list`, `refs`, `open`, and `usage`. Stores without retained history
|
|
209
|
+
`head`, `list`, `refs`, `open`, `diff`, and `usage`. Stores without retained history
|
|
200
210
|
throw `WORKSPACE_R0069`. Existing checkpoint and rebase behavior is unchanged.
|
|
201
211
|
|
|
202
212
|
History has named refs. Calls without `ref` use `main`. Each ref has its own head
|
|
@@ -213,6 +223,38 @@ await workspace.history.commit({
|
|
|
213
223
|
await workspace.history.refs() // [{ name: "draft", head }, { name: "main", head }]
|
|
214
224
|
```
|
|
215
225
|
|
|
226
|
+
`history.diff({ from, to })` lists the files that were added, modified, or removed
|
|
227
|
+
between two revisions, also on different refs. Changes to bytes, media type, or
|
|
228
|
+
retained metadata count as modifications:
|
|
229
|
+
|
|
230
|
+
```ts fragment
|
|
231
|
+
const [published, saved] = await Promise.all([
|
|
232
|
+
workspace.history.head({ ref: "published" }),
|
|
233
|
+
workspace.history.head({ ref: "draft" }),
|
|
234
|
+
])
|
|
235
|
+
if (saved) {
|
|
236
|
+
const { entries } = await workspace.history.diff({ from: published?.id, to: saved.id })
|
|
237
|
+
// [{ path: "posts/hello.md", type: "modified", before, after }]
|
|
238
|
+
}
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
Use `isWorkspaceName(name)` to check a Workspace name from a request or a database
|
|
242
|
+
before you pass it to `useWorkspace()` or `useWorkspaceFiles()`.
|
|
243
|
+
|
|
244
|
+
`history.deleteRef({ ref, ifHead? })` deletes a ref. It returns `false` when the ref
|
|
245
|
+
does not exist and no `ifHead` was supplied. It cannot delete `main` or the Store's
|
|
246
|
+
working ref:
|
|
247
|
+
|
|
248
|
+
```ts fragment
|
|
249
|
+
const head = await workspace.history.head({ ref: runId })
|
|
250
|
+
await workspace.history.deleteRef({ ref: runId, ifHead: head?.id })
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
Blob + Database checks `ifHead` atomically with ref deletion and also removes the
|
|
254
|
+
ref's revisions and bytes that no other revision uses. GitHub only deletes the
|
|
255
|
+
branch, so commits and bytes may still be readable by SHA. Its `ifHead` check
|
|
256
|
+
happens before a separate, unconditional delete request.
|
|
257
|
+
|
|
216
258
|
Rules, validators, hooks, and Source ownership run on every changed path in both
|
|
217
259
|
forms. Use `registerWorkspacePlugin(name, plugin)` to add rules and hooks to a
|
|
218
260
|
Workspace your package does not define. In a history commit, each hook gets
|
|
@@ -220,7 +262,7 @@ Workspace your package does not define. In a history commit, each hook gets
|
|
|
220
262
|
that the commit changes. A hook can check all paths at once, and read the intent of
|
|
221
263
|
the caller from the metadata, as Content reads `lease: "override"`.
|
|
222
264
|
|
|
223
|
-
File objects use `_vitehub/workspace-history[/<prefix>]/<sha256(workspace)>/sha256/<digest>` Blob keys.
|
|
265
|
+
File objects use `_vitehub/workspace-history[/<prefix>]/<sha256(workspace)>/sha256/<digest>-<generation>` Blob keys. Existing digest-only keys remain readable.
|
|
224
266
|
The optional `prefix` nests below `_vitehub/workspace-history/`, so ViteHub owns every
|
|
225
267
|
history object.
|
|
226
268
|
Identical bytes share one object within a workspace. Database stores immutable
|
|
@@ -232,7 +274,8 @@ Normal file writes stage changes in instance memory until checkpoint or snapshot
|
|
|
232
274
|
which commit to `main`. Only committed history is durable; keep drafts on a ref. `store.delete()` permanently tombstones the
|
|
233
275
|
identity and removes its history and objects. Retry deletion after storage errors
|
|
234
276
|
or after stopping abandoned uploads. Failed publications can leave reusable
|
|
235
|
-
objects outside retained usage accounting until deletion.
|
|
277
|
+
objects outside retained usage accounting until deletion. `history.deleteRef()` deletes
|
|
278
|
+
one ref and the objects that no other revision uses.
|
|
236
279
|
Use a strongly consistent Blob backend and small folders. See
|
|
237
280
|
[configuration](https://vitehub.dev/docs/workspace/configure#blob-database-store)
|
|
238
281
|
and [server API](https://vitehub.dev/docs/workspace/server-api#retained-folder-history).
|
|
@@ -244,8 +287,8 @@ runtime of the dev server, or of a deployed app with `--url`, and never write:
|
|
|
244
287
|
vitehub workspace history content # revisions on every ref, newest first
|
|
245
288
|
vitehub workspace history content --ref draft
|
|
246
289
|
vitehub workspace refs content # each ref and its head revision
|
|
247
|
-
vitehub workspace
|
|
248
|
-
vitehub workspace
|
|
290
|
+
vitehub workspace get content draft # one revision and its files
|
|
291
|
+
vitehub workspace get content draft posts/hello.md
|
|
249
292
|
```
|
|
250
293
|
|
|
251
294
|
Add `--json` for machine-readable output. A Store without retained history
|
|
@@ -499,7 +542,7 @@ GitHub-backed Stores also expose the retained history reader. Repository branche
|
|
|
499
542
|
history refs, and GitHub commits are immutable Workspace revisions. Revision metadata
|
|
500
543
|
includes the commit author and a `url` that opens the commit on GitHub. Revision file
|
|
501
544
|
views read the configured Workspace root from the commit tree and fetch file bytes from
|
|
502
|
-
that commit. The `vitehub workspace history`, `refs`, and `
|
|
545
|
+
that commit. The `vitehub workspace history`, `refs`, and `get` CLI commands
|
|
503
546
|
inspect this data; the Console Workspace/files view does not yet provide a history
|
|
504
547
|
navigator.
|
|
505
548
|
|
|
@@ -519,8 +562,6 @@ first use, so a missing one throws `WORKSPACE_R0072` then, not when the definiti
|
|
|
519
562
|
|
|
520
563
|
Built on [`@vite-hub/source`](../source/README.md) and [isomorphic-git](https://isomorphic-git.org/). Shell-backed Workspace tools load `@vite-hub/shell` only when the shell tool executes.
|
|
521
564
|
|
|
522
|
-
Learn more at [vitehub.dev](https://vitehub.dev).
|
|
523
|
-
|
|
524
565
|
Startup and build Source cleanup track ownership by Workspace name. When definitions share a Store, removing or refreshing one definition does not remove files last materialized by another definition. Cleanup also preserves files without a recorded Workspace owner, including files from legacy snapshots. Shared paths still contain the most recent write.
|
|
525
566
|
|
|
526
567
|
Source Sync and runtime Source materialization change files only inside the mount of the Source that they process. A Source with an empty mount owns the Workspace root. Source Sync with `stale: "remove"` removes only stale paths inside the current mount. If you move a Source mount, the files in the old mount stay. Remove them yourself if you do not need them. When mounts for the same Source key share an output path, sync retains their claims separately. Each mount can update the file, and every claim tracks the digest of the latest Source write to that shared path. Stale cleanup removes the file only after the other mounts release their claims and its content still matches that digest. Releasing a claim preserves this digest without adopting current file content, including user edits that restore an older Source version.
|
|
@@ -536,3 +577,5 @@ File metadata must be a JSON-safe plain object containing only plain objects, de
|
|
|
536
577
|
Custom Stores can implement `removeEmptyDirectory(path)` to support build directory cleanup. The operation must check the path inside the Store mutation boundary, preserve files and missing paths, and reject nonempty directories. Stores without this method retain generated directories. The local, memory, and Cloudflare Artifacts Stores implement it.
|
|
537
578
|
|
|
538
579
|
Writable facade wrappers that replace `fs` and omit symbol properties must forward internal Source Sync routing explicitly. After creating a wrapper, call `forwardWorkspaceFacade(base, wrapped)` from `@vite-hub/workspace/runtime`. This preserves durable sync metadata and enclosing Source guards without exposing internal setters or passing capabilities to the wrapper's public `setMeta` method. Public metadata writes still reject reserved keys.
|
|
580
|
+
|
|
581
|
+
Learn more at [vitehub.dev](https://vitehub.dev).
|
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
import { t as HistoryManifestFile } from "../history-schema-BBWbpDk4.js";
|
|
2
|
+
//#region src/storage/history-schema-postgres.d.ts
|
|
3
|
+
type HistoryFileIndex = Record<string, Pick<HistoryManifestFile, "digest" | "size"> & {
|
|
4
|
+
fingerprint: string;
|
|
5
|
+
}>;
|
|
6
|
+
/** Include these tables in a Postgres Database Definition and apply its migrations. */
|
|
7
|
+
export declare const workspaceHistorySchema: {
|
|
8
|
+
workspaceHistoryWorkspaces: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
9
|
+
name: "workspace_history_workspaces";
|
|
10
|
+
schema: undefined;
|
|
11
|
+
columns: {
|
|
12
|
+
workspace: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_workspaces", import("drizzle-orm/pg-core").SetIsPrimaryKey<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
|
|
13
|
+
name: string;
|
|
14
|
+
tableName: "workspace_history_workspaces";
|
|
15
|
+
dataType: "string";
|
|
16
|
+
data: string;
|
|
17
|
+
driverParam: string;
|
|
18
|
+
notNull: true;
|
|
19
|
+
hasDefault: false;
|
|
20
|
+
isPrimaryKey: false;
|
|
21
|
+
isAutoincrement: false;
|
|
22
|
+
hasRuntimeDefault: false;
|
|
23
|
+
enumValues: undefined;
|
|
24
|
+
identity: undefined;
|
|
25
|
+
generated: undefined;
|
|
26
|
+
}>;
|
|
27
|
+
deleted: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_workspaces", import("drizzle-orm/pg-core").SetHasDefault<import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgBooleanBuilder>>, {
|
|
28
|
+
name: string;
|
|
29
|
+
tableName: "workspace_history_workspaces";
|
|
30
|
+
dataType: "boolean";
|
|
31
|
+
data: boolean;
|
|
32
|
+
driverParam: boolean;
|
|
33
|
+
notNull: true;
|
|
34
|
+
hasDefault: true;
|
|
35
|
+
isPrimaryKey: false;
|
|
36
|
+
isAutoincrement: false;
|
|
37
|
+
hasRuntimeDefault: false;
|
|
38
|
+
enumValues: undefined;
|
|
39
|
+
identity: undefined;
|
|
40
|
+
generated: undefined;
|
|
41
|
+
}>;
|
|
42
|
+
};
|
|
43
|
+
dialect: "pg";
|
|
44
|
+
isAlias: false;
|
|
45
|
+
}>;
|
|
46
|
+
workspaceHistoryRefs: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
47
|
+
name: "workspace_history_refs";
|
|
48
|
+
schema: undefined;
|
|
49
|
+
columns: {
|
|
50
|
+
workspace: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_refs", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
|
|
51
|
+
name: string;
|
|
52
|
+
tableName: "workspace_history_refs";
|
|
53
|
+
dataType: "string";
|
|
54
|
+
data: string;
|
|
55
|
+
driverParam: string;
|
|
56
|
+
notNull: true;
|
|
57
|
+
hasDefault: false;
|
|
58
|
+
isPrimaryKey: false;
|
|
59
|
+
isAutoincrement: false;
|
|
60
|
+
hasRuntimeDefault: false;
|
|
61
|
+
enumValues: undefined;
|
|
62
|
+
identity: undefined;
|
|
63
|
+
generated: undefined;
|
|
64
|
+
}>;
|
|
65
|
+
ref: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_refs", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
|
|
66
|
+
name: string;
|
|
67
|
+
tableName: "workspace_history_refs";
|
|
68
|
+
dataType: "string";
|
|
69
|
+
data: string;
|
|
70
|
+
driverParam: string;
|
|
71
|
+
notNull: true;
|
|
72
|
+
hasDefault: false;
|
|
73
|
+
isPrimaryKey: false;
|
|
74
|
+
isAutoincrement: false;
|
|
75
|
+
hasRuntimeDefault: false;
|
|
76
|
+
enumValues: undefined;
|
|
77
|
+
identity: undefined;
|
|
78
|
+
generated: undefined;
|
|
79
|
+
}>;
|
|
80
|
+
head: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_refs", import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>, {
|
|
81
|
+
name: string;
|
|
82
|
+
tableName: "workspace_history_refs";
|
|
83
|
+
dataType: "string";
|
|
84
|
+
data: string;
|
|
85
|
+
driverParam: string;
|
|
86
|
+
notNull: false;
|
|
87
|
+
hasDefault: false;
|
|
88
|
+
isPrimaryKey: false;
|
|
89
|
+
isAutoincrement: false;
|
|
90
|
+
hasRuntimeDefault: false;
|
|
91
|
+
enumValues: undefined;
|
|
92
|
+
identity: undefined;
|
|
93
|
+
generated: undefined;
|
|
94
|
+
}>;
|
|
95
|
+
sequence: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_refs", import("drizzle-orm/pg-core").SetHasDefault<import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgIntegerBuilder>>, {
|
|
96
|
+
name: string;
|
|
97
|
+
tableName: "workspace_history_refs";
|
|
98
|
+
dataType: "number int32";
|
|
99
|
+
data: number;
|
|
100
|
+
driverParam: string | number;
|
|
101
|
+
notNull: true;
|
|
102
|
+
hasDefault: true;
|
|
103
|
+
isPrimaryKey: false;
|
|
104
|
+
isAutoincrement: false;
|
|
105
|
+
hasRuntimeDefault: false;
|
|
106
|
+
enumValues: undefined;
|
|
107
|
+
identity: undefined;
|
|
108
|
+
generated: undefined;
|
|
109
|
+
}>;
|
|
110
|
+
};
|
|
111
|
+
dialect: "pg";
|
|
112
|
+
isAlias: false;
|
|
113
|
+
}>;
|
|
114
|
+
workspaceHistoryRevisions: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
115
|
+
name: "workspace_history_revisions";
|
|
116
|
+
schema: undefined;
|
|
117
|
+
columns: {
|
|
118
|
+
workspace: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_revisions", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
|
|
119
|
+
name: string;
|
|
120
|
+
tableName: "workspace_history_revisions";
|
|
121
|
+
dataType: "string";
|
|
122
|
+
data: string;
|
|
123
|
+
driverParam: string;
|
|
124
|
+
notNull: true;
|
|
125
|
+
hasDefault: false;
|
|
126
|
+
isPrimaryKey: false;
|
|
127
|
+
isAutoincrement: false;
|
|
128
|
+
hasRuntimeDefault: false;
|
|
129
|
+
enumValues: undefined;
|
|
130
|
+
identity: undefined;
|
|
131
|
+
generated: undefined;
|
|
132
|
+
}>;
|
|
133
|
+
id: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_revisions", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
|
|
134
|
+
name: string;
|
|
135
|
+
tableName: "workspace_history_revisions";
|
|
136
|
+
dataType: "string";
|
|
137
|
+
data: string;
|
|
138
|
+
driverParam: string;
|
|
139
|
+
notNull: true;
|
|
140
|
+
hasDefault: false;
|
|
141
|
+
isPrimaryKey: false;
|
|
142
|
+
isAutoincrement: false;
|
|
143
|
+
hasRuntimeDefault: false;
|
|
144
|
+
enumValues: undefined;
|
|
145
|
+
identity: undefined;
|
|
146
|
+
generated: undefined;
|
|
147
|
+
}>;
|
|
148
|
+
ref: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_revisions", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
|
|
149
|
+
name: string;
|
|
150
|
+
tableName: "workspace_history_revisions";
|
|
151
|
+
dataType: "string";
|
|
152
|
+
data: string;
|
|
153
|
+
driverParam: string;
|
|
154
|
+
notNull: true;
|
|
155
|
+
hasDefault: false;
|
|
156
|
+
isPrimaryKey: false;
|
|
157
|
+
isAutoincrement: false;
|
|
158
|
+
hasRuntimeDefault: false;
|
|
159
|
+
enumValues: undefined;
|
|
160
|
+
identity: undefined;
|
|
161
|
+
generated: undefined;
|
|
162
|
+
}>;
|
|
163
|
+
parentId: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_revisions", import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>, {
|
|
164
|
+
name: string;
|
|
165
|
+
tableName: "workspace_history_revisions";
|
|
166
|
+
dataType: "string";
|
|
167
|
+
data: string;
|
|
168
|
+
driverParam: string;
|
|
169
|
+
notNull: false;
|
|
170
|
+
hasDefault: false;
|
|
171
|
+
isPrimaryKey: false;
|
|
172
|
+
isAutoincrement: false;
|
|
173
|
+
hasRuntimeDefault: false;
|
|
174
|
+
enumValues: undefined;
|
|
175
|
+
identity: undefined;
|
|
176
|
+
generated: undefined;
|
|
177
|
+
}>;
|
|
178
|
+
sequence: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_revisions", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgIntegerBuilder>, {
|
|
179
|
+
name: string;
|
|
180
|
+
tableName: "workspace_history_revisions";
|
|
181
|
+
dataType: "number int32";
|
|
182
|
+
data: number;
|
|
183
|
+
driverParam: string | number;
|
|
184
|
+
notNull: true;
|
|
185
|
+
hasDefault: false;
|
|
186
|
+
isPrimaryKey: false;
|
|
187
|
+
isAutoincrement: false;
|
|
188
|
+
hasRuntimeDefault: false;
|
|
189
|
+
enumValues: undefined;
|
|
190
|
+
identity: undefined;
|
|
191
|
+
generated: undefined;
|
|
192
|
+
}>;
|
|
193
|
+
createdAt: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_revisions", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
|
|
194
|
+
name: string;
|
|
195
|
+
tableName: "workspace_history_revisions";
|
|
196
|
+
dataType: "string";
|
|
197
|
+
data: string;
|
|
198
|
+
driverParam: string;
|
|
199
|
+
notNull: true;
|
|
200
|
+
hasDefault: false;
|
|
201
|
+
isPrimaryKey: false;
|
|
202
|
+
isAutoincrement: false;
|
|
203
|
+
hasRuntimeDefault: false;
|
|
204
|
+
enumValues: undefined;
|
|
205
|
+
identity: undefined;
|
|
206
|
+
generated: undefined;
|
|
207
|
+
}>;
|
|
208
|
+
message: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_revisions", import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>, {
|
|
209
|
+
name: string;
|
|
210
|
+
tableName: "workspace_history_revisions";
|
|
211
|
+
dataType: "string";
|
|
212
|
+
data: string;
|
|
213
|
+
driverParam: string;
|
|
214
|
+
notNull: false;
|
|
215
|
+
hasDefault: false;
|
|
216
|
+
isPrimaryKey: false;
|
|
217
|
+
isAutoincrement: false;
|
|
218
|
+
hasRuntimeDefault: false;
|
|
219
|
+
enumValues: undefined;
|
|
220
|
+
identity: undefined;
|
|
221
|
+
generated: undefined;
|
|
222
|
+
}>;
|
|
223
|
+
metadata: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_revisions", import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgJsonBuilder, Record<string, unknown>>, {
|
|
224
|
+
name: string;
|
|
225
|
+
tableName: "workspace_history_revisions";
|
|
226
|
+
dataType: "object json";
|
|
227
|
+
data: Record<string, unknown>;
|
|
228
|
+
driverParam: unknown;
|
|
229
|
+
notNull: false;
|
|
230
|
+
hasDefault: false;
|
|
231
|
+
isPrimaryKey: false;
|
|
232
|
+
isAutoincrement: false;
|
|
233
|
+
hasRuntimeDefault: false;
|
|
234
|
+
enumValues: undefined;
|
|
235
|
+
identity: undefined;
|
|
236
|
+
generated: undefined;
|
|
237
|
+
}>;
|
|
238
|
+
files: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_revisions", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgIntegerBuilder>, {
|
|
239
|
+
name: string;
|
|
240
|
+
tableName: "workspace_history_revisions";
|
|
241
|
+
dataType: "number int32";
|
|
242
|
+
data: number;
|
|
243
|
+
driverParam: string | number;
|
|
244
|
+
notNull: true;
|
|
245
|
+
hasDefault: false;
|
|
246
|
+
isPrimaryKey: false;
|
|
247
|
+
isAutoincrement: false;
|
|
248
|
+
hasRuntimeDefault: false;
|
|
249
|
+
enumValues: undefined;
|
|
250
|
+
identity: undefined;
|
|
251
|
+
generated: undefined;
|
|
252
|
+
}>;
|
|
253
|
+
bytes: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_revisions", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgBigInt53Builder>, {
|
|
254
|
+
name: string;
|
|
255
|
+
tableName: "workspace_history_revisions";
|
|
256
|
+
dataType: "number int53";
|
|
257
|
+
data: number;
|
|
258
|
+
driverParam: string | number;
|
|
259
|
+
notNull: true;
|
|
260
|
+
hasDefault: false;
|
|
261
|
+
isPrimaryKey: false;
|
|
262
|
+
isAutoincrement: false;
|
|
263
|
+
hasRuntimeDefault: false;
|
|
264
|
+
enumValues: undefined;
|
|
265
|
+
identity: undefined;
|
|
266
|
+
generated: undefined;
|
|
267
|
+
}>;
|
|
268
|
+
entries: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_revisions", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgJsonBuilder, Record<string, HistoryManifestFile>>>, {
|
|
269
|
+
name: string;
|
|
270
|
+
tableName: "workspace_history_revisions";
|
|
271
|
+
dataType: "object json";
|
|
272
|
+
data: Record<string, HistoryManifestFile>;
|
|
273
|
+
driverParam: unknown;
|
|
274
|
+
notNull: true;
|
|
275
|
+
hasDefault: false;
|
|
276
|
+
isPrimaryKey: false;
|
|
277
|
+
isAutoincrement: false;
|
|
278
|
+
hasRuntimeDefault: false;
|
|
279
|
+
enumValues: undefined;
|
|
280
|
+
identity: undefined;
|
|
281
|
+
generated: undefined;
|
|
282
|
+
}>;
|
|
283
|
+
fileIndex: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_revisions", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgJsonbBuilder, HistoryFileIndex>>, {
|
|
284
|
+
name: string;
|
|
285
|
+
tableName: "workspace_history_revisions";
|
|
286
|
+
dataType: "object json";
|
|
287
|
+
data: HistoryFileIndex;
|
|
288
|
+
driverParam: unknown;
|
|
289
|
+
notNull: true;
|
|
290
|
+
hasDefault: false;
|
|
291
|
+
isPrimaryKey: false;
|
|
292
|
+
isAutoincrement: false;
|
|
293
|
+
hasRuntimeDefault: false;
|
|
294
|
+
enumValues: undefined;
|
|
295
|
+
identity: undefined;
|
|
296
|
+
generated: undefined;
|
|
297
|
+
}>;
|
|
298
|
+
committed: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_revisions", import("drizzle-orm/pg-core").SetHasDefault<import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgBooleanBuilder>>, {
|
|
299
|
+
name: string;
|
|
300
|
+
tableName: "workspace_history_revisions";
|
|
301
|
+
dataType: "boolean";
|
|
302
|
+
data: boolean;
|
|
303
|
+
driverParam: boolean;
|
|
304
|
+
notNull: true;
|
|
305
|
+
hasDefault: true;
|
|
306
|
+
isPrimaryKey: false;
|
|
307
|
+
isAutoincrement: false;
|
|
308
|
+
hasRuntimeDefault: false;
|
|
309
|
+
enumValues: undefined;
|
|
310
|
+
identity: undefined;
|
|
311
|
+
generated: undefined;
|
|
312
|
+
}>;
|
|
313
|
+
};
|
|
314
|
+
dialect: "pg";
|
|
315
|
+
isAlias: false;
|
|
316
|
+
}>;
|
|
317
|
+
workspaceHistoryObjects: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
318
|
+
name: "workspace_history_objects";
|
|
319
|
+
schema: undefined;
|
|
320
|
+
columns: {
|
|
321
|
+
workspace: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_objects", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
|
|
322
|
+
name: string;
|
|
323
|
+
tableName: "workspace_history_objects";
|
|
324
|
+
dataType: "string";
|
|
325
|
+
data: string;
|
|
326
|
+
driverParam: string;
|
|
327
|
+
notNull: true;
|
|
328
|
+
hasDefault: false;
|
|
329
|
+
isPrimaryKey: false;
|
|
330
|
+
isAutoincrement: false;
|
|
331
|
+
hasRuntimeDefault: false;
|
|
332
|
+
enumValues: undefined;
|
|
333
|
+
identity: undefined;
|
|
334
|
+
generated: undefined;
|
|
335
|
+
}>;
|
|
336
|
+
digest: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_objects", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
|
|
337
|
+
name: string;
|
|
338
|
+
tableName: "workspace_history_objects";
|
|
339
|
+
dataType: "string";
|
|
340
|
+
data: string;
|
|
341
|
+
driverParam: string;
|
|
342
|
+
notNull: true;
|
|
343
|
+
hasDefault: false;
|
|
344
|
+
isPrimaryKey: false;
|
|
345
|
+
isAutoincrement: false;
|
|
346
|
+
hasRuntimeDefault: false;
|
|
347
|
+
enumValues: undefined;
|
|
348
|
+
identity: undefined;
|
|
349
|
+
generated: undefined;
|
|
350
|
+
}>;
|
|
351
|
+
size: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_objects", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgBigInt53Builder>, {
|
|
352
|
+
name: string;
|
|
353
|
+
tableName: "workspace_history_objects";
|
|
354
|
+
dataType: "number int53";
|
|
355
|
+
data: number;
|
|
356
|
+
driverParam: string | number;
|
|
357
|
+
notNull: true;
|
|
358
|
+
hasDefault: false;
|
|
359
|
+
isPrimaryKey: false;
|
|
360
|
+
isAutoincrement: false;
|
|
361
|
+
hasRuntimeDefault: false;
|
|
362
|
+
enumValues: undefined;
|
|
363
|
+
identity: undefined;
|
|
364
|
+
generated: undefined;
|
|
365
|
+
}>;
|
|
366
|
+
};
|
|
367
|
+
dialect: "pg";
|
|
368
|
+
isAlias: false;
|
|
369
|
+
}>;
|
|
370
|
+
workspaceHistoryMetadata: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
371
|
+
name: "workspace_history_metadata";
|
|
372
|
+
schema: undefined;
|
|
373
|
+
columns: {
|
|
374
|
+
workspace: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_metadata", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
|
|
375
|
+
name: string;
|
|
376
|
+
tableName: "workspace_history_metadata";
|
|
377
|
+
dataType: "string";
|
|
378
|
+
data: string;
|
|
379
|
+
driverParam: string;
|
|
380
|
+
notNull: true;
|
|
381
|
+
hasDefault: false;
|
|
382
|
+
isPrimaryKey: false;
|
|
383
|
+
isAutoincrement: false;
|
|
384
|
+
hasRuntimeDefault: false;
|
|
385
|
+
enumValues: undefined;
|
|
386
|
+
identity: undefined;
|
|
387
|
+
generated: undefined;
|
|
388
|
+
}>;
|
|
389
|
+
key: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_metadata", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
|
|
390
|
+
name: string;
|
|
391
|
+
tableName: "workspace_history_metadata";
|
|
392
|
+
dataType: "string";
|
|
393
|
+
data: string;
|
|
394
|
+
driverParam: string;
|
|
395
|
+
notNull: true;
|
|
396
|
+
hasDefault: false;
|
|
397
|
+
isPrimaryKey: false;
|
|
398
|
+
isAutoincrement: false;
|
|
399
|
+
hasRuntimeDefault: false;
|
|
400
|
+
enumValues: undefined;
|
|
401
|
+
identity: undefined;
|
|
402
|
+
generated: undefined;
|
|
403
|
+
}>;
|
|
404
|
+
value: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_metadata", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgJsonBuilder, unknown>>, {
|
|
405
|
+
name: string;
|
|
406
|
+
tableName: "workspace_history_metadata";
|
|
407
|
+
dataType: "object json";
|
|
408
|
+
data: unknown;
|
|
409
|
+
driverParam: unknown;
|
|
410
|
+
notNull: true;
|
|
411
|
+
hasDefault: false;
|
|
412
|
+
isPrimaryKey: false;
|
|
413
|
+
isAutoincrement: false;
|
|
414
|
+
hasRuntimeDefault: false;
|
|
415
|
+
enumValues: undefined;
|
|
416
|
+
identity: undefined;
|
|
417
|
+
generated: undefined;
|
|
418
|
+
}>;
|
|
419
|
+
};
|
|
420
|
+
dialect: "pg";
|
|
421
|
+
isAlias: false;
|
|
422
|
+
}>;
|
|
423
|
+
};
|
|
424
|
+
//#endregion
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/storage/blob-database-sources.ts
|
|
2
|
+
const blobDatabaseSources = Symbol.for("vitehub.workspace.blobDatabaseSources");
|
|
3
|
+
function readBlobDatabaseSources(store) {
|
|
4
|
+
if (typeof store !== "object" || store === null) return void 0;
|
|
5
|
+
const read = Reflect.get(store, blobDatabaseSources);
|
|
6
|
+
return typeof read === "function" ? Reflect.apply(read, store, []) : void 0;
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { readBlobDatabaseSources as n, blobDatabaseSources as t };
|