@dimah-s3/db 2.0.0-beta.0 → 2.0.0-beta.2

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.
Files changed (81) hide show
  1. package/README.md +3 -3
  2. package/dist/adapters/drizzle.d.ts +2 -1
  3. package/dist/adapters/drizzle.d.ts.map +1 -1
  4. package/dist/cli.d.ts +8 -9
  5. package/dist/cli.d.ts.map +1 -1
  6. package/dist/cli.js +42 -103
  7. package/dist/cli.js.map +1 -1
  8. package/dist/client/db-client.d.ts +1 -1
  9. package/dist/client/db-client.d.ts.map +1 -1
  10. package/dist/client/db-object-source.d.ts +5 -4
  11. package/dist/client/db-object-source.d.ts.map +1 -1
  12. package/dist/client/index.d.ts +1 -1
  13. package/dist/client/index.d.ts.map +1 -1
  14. package/dist/client/index.js +27 -12
  15. package/dist/client/index.js.map +1 -1
  16. package/dist/drizzle/mysql.d.ts +46 -13
  17. package/dist/drizzle/mysql.d.ts.map +1 -1
  18. package/dist/drizzle/mysql.js +15 -18
  19. package/dist/drizzle/mysql.js.map +1 -1
  20. package/dist/drizzle/pg.d.ts +44 -13
  21. package/dist/drizzle/pg.d.ts.map +1 -1
  22. package/dist/drizzle/pg.js +17 -17
  23. package/dist/drizzle/pg.js.map +1 -1
  24. package/dist/drizzle/shared.d.ts +4 -13
  25. package/dist/drizzle/shared.d.ts.map +1 -1
  26. package/dist/drizzle/sqlite.d.ts +46 -13
  27. package/dist/drizzle/sqlite.d.ts.map +1 -1
  28. package/dist/drizzle/sqlite.js +17 -17
  29. package/dist/drizzle/sqlite.js.map +1 -1
  30. package/dist/folder-path.d.ts +9 -2
  31. package/dist/folder-path.d.ts.map +1 -1
  32. package/dist/fuma-db.d.ts +10 -30
  33. package/dist/fuma-db.d.ts.map +1 -1
  34. package/dist/index.d.ts +1 -1
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +372 -231
  37. package/dist/index.js.map +1 -1
  38. package/dist/plugin/create-database-endpoints.d.ts +38 -18
  39. package/dist/plugin/create-database-endpoints.d.ts.map +1 -1
  40. package/dist/plugin/create-database-lifecycle-hooks.d.ts +1 -1
  41. package/dist/plugin/create-database-lifecycle-hooks.d.ts.map +1 -1
  42. package/dist/plugin/db.d.ts.map +1 -1
  43. package/dist/plugin/object-access.d.ts +1 -1
  44. package/dist/plugin/object-access.d.ts.map +1 -1
  45. package/dist/plugin/public-stores.d.ts +4 -7
  46. package/dist/plugin/public-stores.d.ts.map +1 -1
  47. package/dist/plugin/schemas.d.ts +21 -12
  48. package/dist/plugin/schemas.d.ts.map +1 -1
  49. package/dist/plugin/to-db-client-object.d.ts.map +1 -1
  50. package/dist/schema/{v2.d.ts → schema.d.ts} +23 -13
  51. package/dist/schema/schema.d.ts.map +1 -0
  52. package/dist/store/create-db-store.d.ts +2 -2
  53. package/dist/store/folder-store.d.ts +41 -14
  54. package/dist/store/folder-store.d.ts.map +1 -1
  55. package/dist/store/list-cursor.d.ts +1 -1
  56. package/dist/store/list-cursor.d.ts.map +1 -1
  57. package/dist/store/map-row.d.ts +2 -2
  58. package/dist/store/map-row.d.ts.map +1 -1
  59. package/dist/store/object-store.d.ts +9 -9
  60. package/dist/store/object-store.d.ts.map +1 -1
  61. package/dist/store/schema-version.d.ts +1 -1
  62. package/dist/types/client.d.ts +47 -18
  63. package/dist/types/client.d.ts.map +1 -1
  64. package/dist/types/plugin.d.ts +6 -1
  65. package/dist/types/plugin.d.ts.map +1 -1
  66. package/dist/types/storage-object.d.ts +8 -7
  67. package/dist/types/storage-object.d.ts.map +1 -1
  68. package/package.json +9 -6
  69. package/prisma/dimah-s3.prisma +14 -13
  70. package/sql/mysql.sql +12 -11
  71. package/sql/pg.sql +10 -10
  72. package/sql/sqlite.sql +10 -9
  73. package/src/drizzle/mysql.ts +175 -0
  74. package/src/drizzle/pg.ts +146 -0
  75. package/src/drizzle/sqlite.ts +150 -0
  76. package/dist/schema/v1.d.ts +0 -24
  77. package/dist/schema/v1.d.ts.map +0 -1
  78. package/dist/schema/v2.d.ts.map +0 -1
  79. package/sql/upgrade/1.0.0-2.0.0/mysql.sql +0 -71
  80. package/sql/upgrade/1.0.0-2.0.0/pg.sql +0 -47
  81. package/sql/upgrade/1.0.0-2.0.0/sqlite.sql +0 -119
@@ -5,13 +5,15 @@ import type { StorageObject } from "../types/storage-object.js";
5
5
  import type { ObjectAccess } from "./object-access";
6
6
  import type { DbObjects } from "./public-stores";
7
7
  import type { Quota } from "./quota";
8
+ import type { ScopeResolver } from "./scope";
8
9
  /** Largest JSON size of stored attributes when `maxBytes` is not set. */
9
10
  export declare const DEFAULT_ATTRIBUTES_MAX_BYTES = 16384;
10
11
  export type CreateDatabaseEndpointsOptions<TSession, TAttributes, TClientAttributes> = {
11
12
  store: Pick<DbStore<TAttributes>, "objects" | "folders">;
12
- /** The public object store, whose `update` also creates the folder. */
13
+ /** The public object store, whose `update` checks the folder and retains it. */
13
14
  objects: Pick<DbObjects<TAttributes>, "update">;
14
15
  access: ObjectAccess<TSession, TAttributes>;
16
+ resolveScope: ScopeResolver<TSession>;
15
17
  quota: Pick<Quota<TSession>, "limits">;
16
18
  /** The plugin's `attributes` option. Without it, PATCH refuses `attributes`. */
17
19
  attributes?: DbAttributesOptions<TAttributes, TClientAttributes>;
@@ -22,22 +24,22 @@ export type CreateDatabaseEndpointsOptions<TSession, TAttributes, TClientAttribu
22
24
  * runs `authorize` before it reads or writes a row:
23
25
  *
24
26
  * - `GET /db/objects` (op `list`): one page of the scope's objects. The
25
- * first page also carries usage, the quota, and the child folders (those
26
- * whose name contains `search`, when it is set).
27
+ * first page also carries usage, the quota, the child folders (those
28
+ * whose name contains `search`, when it is set), and the breadcrumb trail.
27
29
  * - `GET /db/object` (op `read`): one object.
28
30
  * - `PATCH /db/object` (op `update`): renames, moves, or sets attributes.
29
- * - `POST /db/folder` and `DELETE /db/folder` (op `update`): creates or
30
- * removes an empty folder.
31
+ * - `POST /db/folder`, `PATCH /db/folder`, and `DELETE /db/folder`
32
+ * (op `update`): create a folder, rename or move it, or remove an empty one.
31
33
  */
32
34
  export declare function createDatabaseEndpoints<TSession, TAttributes, TClientAttributes>(options: CreateDatabaseEndpointsOptions<TSession, TAttributes, TClientAttributes>): {
33
- /** One page of the caller's objects. `folder` omitted lists every folder. */
35
+ /** One page of the caller's objects. `folderId` omitted lists every folder. */
34
36
  objects: import("better-call").StrictEndpoint<string, {
35
37
  use: import("better-call").MiddlewareHandler[];
36
38
  } & {
37
39
  method: "GET";
38
40
  } & {
39
41
  query: import("better-call").StandardSchemaV1<{
40
- folder?: string | undefined;
42
+ folderId?: string | undefined;
41
43
  route?: string | undefined;
42
44
  status?: "active" | "deleted" | "pending" | undefined;
43
45
  contentType?: unknown;
@@ -49,7 +51,7 @@ export declare function createDatabaseEndpoints<TSession, TAttributes, TClientAt
49
51
  limit?: string | number | undefined;
50
52
  cursor?: unknown;
51
53
  }, {
52
- folder?: string | undefined;
54
+ folderId?: string | undefined;
53
55
  route?: string | undefined;
54
56
  status?: "active" | "deleted" | "pending" | undefined;
55
57
  contentType?: unknown;
@@ -80,8 +82,7 @@ export declare function createDatabaseEndpoints<TSession, TAttributes, TClientAt
80
82
  }>;
81
83
  /**
82
84
  * Renames, moves, or sets the attributes of an active object. A move
83
- * checks the target folder like an upload: validated, authorized, and
84
- * created when missing.
85
+ * requires the target folder to exist and authorizes that folder.
85
86
  */
86
87
  updateObject: import("better-call").StrictEndpoint<string, {
87
88
  use: import("better-call").MiddlewareHandler[];
@@ -91,27 +92,46 @@ export declare function createDatabaseEndpoints<TSession, TAttributes, TClientAt
91
92
  key: string;
92
93
  bucket?: string | undefined;
93
94
  filename?: string | undefined;
94
- folder?: string | null | undefined;
95
+ folderId?: string | null | undefined;
95
96
  attributes?: Record<string, unknown> | null | undefined;
96
97
  }, {
97
98
  key: string;
98
99
  bucket?: string | undefined;
99
100
  filename?: string | undefined;
100
- folder?: string | null | undefined;
101
+ folderId?: string | null | undefined;
101
102
  attributes?: Record<string, unknown> | null | undefined;
102
103
  }>;
103
104
  }, {
104
105
  object: DbClientObject<TClientAttributes>;
105
106
  }>;
106
- /** Creates a folder and its missing ancestors. */
107
+ /** Creates one folder inside a parent that already exists. */
107
108
  createFolder: import("better-call").StrictEndpoint<string, {
108
109
  use: import("better-call").MiddlewareHandler[];
109
110
  } & {
110
111
  method: "POST";
111
112
  body: import("better-call").StandardSchemaV1<{
112
- path: string;
113
+ parentId?: string | null | undefined;
114
+ name: string;
113
115
  }, {
114
- path: string;
116
+ parentId?: string | null | undefined;
117
+ name: string;
118
+ }>;
119
+ }, {
120
+ folder: DbClientFolder;
121
+ }>;
122
+ /** Renames a folder, moves it, or both. */
123
+ updateFolder: import("better-call").StrictEndpoint<string, {
124
+ use: import("better-call").MiddlewareHandler[];
125
+ } & {
126
+ method: "PATCH";
127
+ body: import("better-call").StandardSchemaV1<{
128
+ id: string;
129
+ name?: string | undefined;
130
+ parentId?: string | null | undefined;
131
+ }, {
132
+ id: string;
133
+ name?: string | undefined;
134
+ parentId?: string | null | undefined;
115
135
  }>;
116
136
  }, {
117
137
  folder: DbClientFolder;
@@ -124,12 +144,12 @@ export declare function createDatabaseEndpoints<TSession, TAttributes, TClientAt
124
144
  body: import("better-call").StandardSchemaV1<unknown, unknown>;
125
145
  } & {
126
146
  query: import("better-call").StandardSchemaV1<{
127
- path: string;
147
+ id: string;
128
148
  }, {
129
- path: string;
149
+ id: string;
130
150
  }>;
131
151
  }, {
132
- path: string;
152
+ id: string;
133
153
  }>;
134
154
  };
135
155
  //# sourceMappingURL=create-database-endpoints.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-database-endpoints.d.ts","sourceRoot":"","sources":["../../src/plugin/create-database-endpoints.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,KAAK,EACV,cAAc,EACd,oBAAoB,EACpB,cAAc,EACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,mBA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C,CAAC;IACvC,gFAAgF;IAChF,UAAU,CAAC,EAAE,mBAAmB,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC;IACjE,cAAc,EAAE,CACd,MAAM,EAAE,aAAa,CAAC,WAAW,CAAC,KAC/B,cAAc,CAAC,iBAAiB,CAAC,CAAC;CACxC,CAAC;AA6DF;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EACR,WAAW,EACX,iBAAiB,EAEjB,OAAO,EAAE,8BAA8B,CACrC,QAAQ,EACR,WAAW,EACX,iBAAiB,CAClB;IAiDC,+EAA+E;IAC/E,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoDP,wCAAwC;IACxC,MAAM;;;;;;;;;;;;;gBAG2B,cAAc,CAAC,iBAAiB,CAAC;;IAiBlE;;;OAGG;IACH,YAAY;;;;;;;;;;;;;;;;;;gBAGqB,cAAc,CAAC,iBAAiB,CAAC;;IAmDlE,8DAA8D;IAC9D,YAAY;;;;;;;;;;;;gBAGqB,cAAc;;IAmB/C,2CAA2C;IAC3C,YAAY;;;;;;;;;;;;;;gBAGqB,cAAc;;IA4B/C,iEAAiE;IACjE,YAAY;;;;;;;;;;;;YAGiB,MAAM;;EAatC"}
@@ -29,7 +29,7 @@ export type CreateDatabaseLifecycleHooksOptions<TSession, TAttributes> = {
29
29
  * - `ticketSubject` binds upload tickets to the scope.
30
30
  * - `upload.guard` checks the folder, ownership of the key, `authorize`
31
31
  * (with the object an overwrite replaces), and the quota; `onStart` writes
32
- * the pending row, then its folders. An overwrite leaves the active row in
32
+ * the pending row, then retains its folder. An overwrite leaves the active row in
33
33
  * place until it is confirmed.
34
34
  * - `confirmGuard` and `multipart.guard` accept only the row of the ticket's
35
35
  * upload, or a confirm it already finished; `onConfirmed` checks the quota
@@ -1 +1 @@
1
- {"version":3,"file":"create-database-lifecycle-hooks.d.ts","sourceRoot":"","sources":["../../src/plugin/create-database-lifecycle-hooks.ts"],"names":[],"mappings":"AA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Q,EAAE,WAAW,EAChE,OAAO,EAAE,mCAAmC,CAAC,QAAQ,EAAE,WAAW,CAAC,GAClE,kBAAkB,CA4PpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../src/plugin/db.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,aAAa,EAEnB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,eAAe,EAAkB,MAAM,gBAAgB,CAAC;AAQtE,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,SAAS,CAAC;AAKlD,0DAA0D;AAC1D,MAAM,MAAM,eAAe,CAAC,WAAW,GAAG,KAAK,IAAI;IACjD,wEAAwE;IACxE,OAAO,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IAChC,iCAAiC;IACjC,OAAO,EAAE,SAAS,CAAC;IACnB;;;OAGG;IACH,WAAW,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAClC,GAAG,KAAK,CAAC;AAEV;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,EAAE,CAChB,QAAQ,GAAG,SAAS,EACpB,WAAW,GAAG,KAAK,EACnB,iBAAiB,GAAG,WAAW,EAE/B,OAAO,EAAE,eAAe,CAAC,QAAQ,EAAE,WAAW,EAAE,iBAAiB,CAAC,GACjE,aAAa,CAAC,IAAI,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC,CA0DnD"}
1
+ {"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../src/plugin/db.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,aAAa,EAEnB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,eAAe,EAAkB,MAAM,gBAAgB,CAAC;AAQtE,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,SAAS,CAAC;AAKlD,0DAA0D;AAC1D,MAAM,MAAM,eAAe,CAAC,WAAW,GAAG,KAAK,IAAI;IACjD,wEAAwE;IACxE,OAAO,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IAChC,iCAAiC;IACjC,OAAO,EAAE,SAAS,CAAC;IACnB;;;OAGG;IACH,WAAW,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAClC,GAAG,KAAK,CAAC;AAEV;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,EAAE,CAChB,QAAQ,GAAG,SAAS,EACpB,WAAW,GAAG,KAAK,EACnB,iBAAiB,GAAG,WAAW,EAE/B,OAAO,EAAE,eAAe,CAAC,QAAQ,EAAE,WAAW,EAAE,iBAAiB,CAAC,GACjE,aAAa,CAAC,IAAI,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC,CA2DnD"}
@@ -3,7 +3,7 @@ import type { AuthorizeContext, DbPluginOptions } from "../types/plugin.js";
3
3
  import type { StorageObject } from "../types/storage-object.js";
4
4
  import type { ResolvedScope, ScopeCall, ScopeResolver, ScopeTarget } from "./scope";
5
5
  /** What a call targets: its scope target, plus what `authorize` checks. */
6
- export type AccessTarget = ScopeTarget & Pick<AuthorizeContext, "key" | "folder" | "clientMetadata">;
6
+ export type AccessTarget = ScopeTarget & Pick<AuthorizeContext, "key" | "folder" | "folderId" | "clientMetadata">;
7
7
  export type CreateObjectAccessOptions<TSession, TAttributes> = Pick<DbPluginOptions<TSession, TAttributes>, "authorize"> & {
8
8
  objects: Pick<StorageObjectStore<TAttributes>, "find">;
9
9
  resolveScope: ScopeResolver<TSession>;
@@ -1 +1 @@
1
- {"version":3,"file":"object-access.d.ts","sourceRoot":"","sources":["../../src/plugin/object-access.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC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D,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC/B,MAAM,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;CACpC,CAAC;AAEF,uEAAuE;AACvE,MAAM,MAAM,YAAY,CAAC,QAAQ,EAAE,WAAW,IAAI;IAChD;;;;OAIG;IACH,KAAK,EAAE,CACL,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,YAAY,KACjB,OAAO,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;IACtC;;;;;;;OAOG;IACH,MAAM,EAAE,CACN,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,YAAY,EACpB,GAAG,EAAE,SAAS,EACd,OAAO,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,OAAO,CAAA;KAAE,KACjC,OAAO,CAAC,gBAAgB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;IACtD;;;OAGG;IACH,WAAW,EAAE,CACX,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,EAC9B,MAAM,EAAE,aAAa,CAAC,WAAW,CAAC,EAClC,MAAM,CAAC,EAAE,YAAY,KAClB,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,WAAW,EACtD,OAAO,EAAE,yBAAyB,CAAC,QAAQ,EAAE,WAAW,CAAC,GACxD,YAAY,CAAC,QAAQ,EAAE,WAAW,CAAC,CAgDrC"}
@@ -11,19 +11,16 @@ import type { StorageObject } from "../types/storage-object.js";
11
11
  export type DbObjects<TAttributes = never> = Pick<StorageObjectStore<TAttributes>, "find" | "list" | "count" | "getUsage"> & {
12
12
  /**
13
13
  * Renames, moves, or sets the attributes of an active row, like
14
- * `PATCH /db/object` without its access check. A folder is validated
15
- * (`FOLDER_INVALID`) and created when missing. With `id` or `scope`, only
16
- * that row changes. Returns `null` when no active row matches.
14
+ * `PATCH /db/object` without its access check. A `folderId` must already
15
+ * exist in the row's scope (`FOLDER_NOT_FOUND`). With `id` or `scope`,
16
+ * only that row changes. Returns `null` when no active row matches.
17
17
  */
18
18
  update: (ref: ObjectRef & {
19
19
  id?: string;
20
20
  scope?: string;
21
21
  }, input: UpdateObjectInput<TAttributes>) => Promise<StorageObject<TAttributes> | null>;
22
22
  };
23
- /**
24
- * `s3.db.folders`: the `storage_folder` rows. Paths are validated as on the
25
- * HTTP endpoints (`FOLDER_INVALID`); the root (`null`) is never stored.
26
- */
23
+ /** `s3.db.folders`: the `storage_folder` rows. The root is never stored. */
27
24
  export type DbFolders = StorageFolderStore;
28
25
  /** The public stores over the plugin's stores. */
29
26
  export declare function createPublicStores<TAttributes>(store: Pick<DbStore<TAttributes>, "objects" | "folders">): {
@@ -1 +1 @@
1
- {"version":3,"file":"public-stores.d.ts","sourceRoot":"","sources":["../../src/plugin/public-stores.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,EACV,SAAS,EACT,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,MAAM,SAAS,CAAC,WAAW,GAAG,KAAK,IAAI,IAAI,CAC/C,kBAAkB,CAAC,WAAW,CAAC,EAC/B,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,CACvC,GAAG;IACF;;;;;OAKG;IACH,MAAM,EAAE,CACN,GAAG,EAAE,SAAS,GAAG;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,EAChD,KAAK,EAAE,iBAAiB,CAAC,WAAW,CAAC,KAClC,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,CAAC;C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AAW,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC,GACvD;IAAE,OAAO,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IAAC,OAAO,EAAE,SAAS,CAAA;CAAE,CAyBzD"}
@@ -2,12 +2,11 @@ import * as z from "zod";
2
2
  /** Most rows one page of `GET /db/objects` returns. */
3
3
  export declare const DB_LIST_MAX_LIMIT = 100;
4
4
  /**
5
- * Query of `GET /db/objects`. `folder` is a wire folder (`""` is the root)
6
- * that the endpoint validates, so a bad path is `FOLDER_INVALID`. Blank
7
- * `search`, `contentType`, and `cursor` values are omitted.
5
+ * Query of `GET /db/objects`. `folderId` of `""` is the root. Omit it for a
6
+ * flat list. Blank `search`, `contentType`, and `cursor` values are omitted.
8
7
  */
9
8
  export declare const dbListQuerySchema: z.ZodObject<{
10
- folder: z.ZodOptional<z.ZodString>;
9
+ folderId: z.ZodOptional<z.ZodString>;
11
10
  route: z.ZodOptional<z.ZodString>;
12
11
  status: z.ZodOptional<z.ZodEnum<{
13
12
  active: "active";
@@ -48,22 +47,32 @@ export declare const dbObjectQuerySchema: z.ZodObject<{
48
47
  bucket: z.ZodOptional<z.ZodString>;
49
48
  }, z.core.$strict>;
50
49
  /**
51
- * Body of `PATCH /db/object`. `folder` is validated by the endpoint; `null`
52
- * and `""` are the root. `attributes` are checked by the plugin's
53
- * `attributes.schema`.
50
+ * Body of `PATCH /db/object`. `folderId` of `null` or `""` is the root.
51
+ * `attributes` are checked by the plugin's `attributes.schema`.
54
52
  */
55
53
  export declare const dbUpdateObjectBodySchema: z.ZodObject<{
56
54
  key: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
57
55
  bucket: z.ZodOptional<z.ZodString>;
58
56
  filename: z.ZodOptional<z.ZodString>;
59
- folder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
57
+ folderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
60
58
  attributes: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
61
59
  }, z.core.$strict>;
60
+ /** Body of `POST /db/folder`. `parentId` omitted, `null`, or `""` is the root. */
61
+ export declare const dbCreateFolderBodySchema: z.ZodObject<{
62
+ parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
63
+ name: z.ZodString;
64
+ }, z.core.$strict>;
62
65
  /**
63
- * Body of `POST /db/folder` and query of `DELETE /db/folder`. The endpoint
64
- * validates `path`, so a bad path is `FOLDER_INVALID`.
66
+ * Body of `PATCH /db/folder`. `parentId` of `null` or `""` is the root.
67
+ * The endpoint checks the name and that the folder is not moved into itself.
65
68
  */
66
- export declare const dbFolderInputSchema: z.ZodObject<{
67
- path: z.ZodString;
69
+ export declare const dbUpdateFolderBodySchema: z.ZodObject<{
70
+ id: z.ZodString;
71
+ name: z.ZodOptional<z.ZodString>;
72
+ parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
73
+ }, z.core.$strict>;
74
+ /** Query of `DELETE /db/folder`. */
75
+ export declare const dbDeleteFolderQuerySchema: z.ZodObject<{
76
+ id: z.ZodString;
68
77
  }, z.core.$strict>;
69
78
  //# sourceMappingURL=schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/plugin/schemas.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,uDAAuD;AACvD,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAuDrC;;;;GAIG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAiB5B,CAAC;AAEH,iCAAiC;AACjC,eAAO,MAAM,mBAAmB;;;kBAG9B,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;;;;;;kBAOnC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;kBAE9B,CAAC"}
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/plugin/schemas.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,uDAAuD;AACvD,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAuDrC;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAiB5B,CAAC;AAEH,iCAAiC;AACjC,eAAO,MAAM,mBAAmB;;;kBAG9B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,wBAAwB;;;;;;kBAOnC,CAAC;AAEH,kFAAkF;AAClF,eAAO,MAAM,wBAAwB;;;kBAGnC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,wBAAwB;;;;kBAInC,CAAC;AAEH,oCAAoC;AACpC,eAAO,MAAM,yBAAyB;;kBAEpC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"to-db-client-object.d.ts","sourceRoot":"","sources":["../../src/plugin/to-db-client-object.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EAEf,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE3E;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,iBAAiB,GAAG,WAAW,EAC3E,MAAM,EAAE,aAAa,CAAC,WAAW,CAAC,EAClC,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,WAAW,KAAK,iBAAiB,GACxD,cAAc,CAAC,iBAAiB,CAAC,CAyBnC;AAED,6DAA6D;AAC7D,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,aAAa,GAAG,cAAc,CAOtE"}
1
+ {"version":3,"file":"to-db-client-object.d.ts","sourceRoot":"","sources":["../../src/plugin/to-db-client-object.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EAEf,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE3E;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,iBAAiB,GAAG,WAAW,EAC3E,MAAM,EAAE,aAAa,CAAC,WAAW,CAAC,EAClC,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,WAAW,KAAK,iBAAiB,GACxD,cAAc,CAAC,iBAAiB,CAAC,CAyBnC;AAED,6DAA6D;AAC7D,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,aAAa,GAAG,cAAc,CAStE"}
@@ -6,15 +6,24 @@ export type SchemaIndex = {
6
6
  columns: readonly string[];
7
7
  };
8
8
  /**
9
- * Secondary indexes of schema 2.0.0. FumaDB cannot declare them, so the SQL
10
- * files, the Drizzle tables, and the Prisma schema carry them.
9
+ * Secondary indexes. FumaDB cannot declare them, so {@link dbSchema}'s
10
+ * migration, the SQL files, the Drizzle tables, and the Prisma schema carry
11
+ * them.
11
12
  */
12
- export declare const v2Indexes: readonly SchemaIndex[];
13
+ export declare const schemaIndexes: readonly SchemaIndex[];
13
14
  /**
14
- * Schema 2.0.0: logical folders (`folder` plus `storage_folder`), S3 metadata
15
- * split from typed `attributes`, the upload token, and the sort indexes.
15
+ * FumaDB runs `up` only when migrating from the previous entry, and skips
16
+ * `up` on the first one. This empty entry exists so {@link dbSchema} can
17
+ * create the indexes on a new database. A finished database is at
18
+ * {@link dbSchema}.
16
19
  */
17
- export declare const v2: import("fumadb/schema").Schema<"2.0.0", {
20
+ export declare const PREDECESSOR_VERSION = "0.0.1";
21
+ export declare const predecessor: import("fumadb/schema").Schema<"0.0.1", {}>;
22
+ /**
23
+ * The @dimah-s3/db schema, version `2.1.0`. The migration creates the
24
+ * secondary indexes after the tables, because FumaDB cannot declare them.
25
+ */
26
+ export declare const dbSchema: import("fumadb/schema").Schema<"2.1.0", {
18
27
  storageObject: import("fumadb/schema").Table<{
19
28
  id: import("fumadb/schema").IdColumn<"varchar(255)", string | null, string>;
20
29
  /** Owner, for example `user:123` or `org:acme`. */
@@ -23,8 +32,8 @@ export declare const v2: import("fumadb/schema").Schema<"2.0.0", {
23
32
  key: Column<"string", string, string>;
24
33
  /** Named dimah-s3 route that created the object. */
25
34
  route: Column<"string", string, string>;
26
- /** Logical folder path. `null` is the root. */
27
- folder: Column<"string", string | null, string | null>;
35
+ /** Folder that holds the object. `null` is the root. */
36
+ folderId: Column<"string", string | null, string | null>;
28
37
  filename: Column<"string", string, string>;
29
38
  contentType: Column<"string", string | null, string | null>;
30
39
  /** Verified size from HeadObject, set on confirm. */
@@ -52,13 +61,14 @@ export declare const v2: import("fumadb/schema").Schema<"2.0.0", {
52
61
  storageFolder: import("fumadb/schema").Table<{
53
62
  id: import("fumadb/schema").IdColumn<"varchar(255)", string | null, string>;
54
63
  scope: Column<"string", string, string>;
55
- /** Full folder path. */
56
- path: Column<"string", string, string>;
57
- /** Path of the containing folder. `null` is the root. */
58
- parent: Column<"string", string | null, string | null>;
64
+ /** Id of the containing folder. `""` is the root. */
65
+ parentId: Column<"string", string, string>;
59
66
  /** Last segment of `path`. */
60
67
  name: Column<"string", string, string>;
68
+ /** Full folder path. */
69
+ path: Column<"string", string, string>;
61
70
  createdAt: Column<"timestamp", Date | null, Date>;
71
+ updatedAt: Column<"timestamp", Date | null, Date>;
62
72
  }, {}>;
63
73
  }>;
64
- //# sourceMappingURL=v2.d.ts.map
74
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/schema/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,KAAK,MAAM,EAAE,MAAM,eAAe,CAAC;AA8E7E,wDAAwD;AACxD,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,gBAAgB,GAAG,gBAAgB,CAAC;IAC3C,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CAC5B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,SAAS,WAAW,EA0B/C,CAAC;AAIF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,UAAU,CAAC;AAE3C,eAAO,MAAM,WAAW,6CAGtB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,QAAQ;;;QAjHnB,mDAAmD;;;;QAInD,oDAAoD;;QAEpD,wDAAwD;;;;QAIxD,qDAAqD;;QAErD,8EAA8E;;;;QAI9E,+CAA+C;;QAE/C,qEAAqE;;;QAGrE,oDAAoD;;QAEpD,iFAAiF;;QAEjF,sEAAsE;;;;;;;;;;QAiBtE,qDAAqD;;QAErD,8BAA8B;;QAE9B,wBAAwB;;;;;EAkFxB,CAAC"}
@@ -10,8 +10,8 @@ export type DbStore<TAttributes = never> = {
10
10
  };
11
11
  /**
12
12
  * Creates the object and folder stores. The first query checks the schema
13
- * version, so a 1.x database throws instead of being read with the wrong
14
- * columns. A failed check runs again on the next query.
13
+ * version, so a database at another version throws instead of being read
14
+ * with the wrong columns. A failed check runs again on the next query.
15
15
  */
16
16
  export declare function createDbStore<TAttributes = never>(client: DimahS3DbClient): DbStore<TAttributes>;
17
17
  //# sourceMappingURL=create-db-store.d.ts.map
@@ -2,34 +2,61 @@ import type { StorageFolder } from "../types/storage-object.js";
2
2
  import { type GetDbOrm } from "./object-store";
3
3
  /** Most child folders `children` returns when `limit` is not given. */
4
4
  export declare const DEFAULT_FOLDER_CHILDREN_LIMIT = 1000;
5
+ /** Where a new or moved folder sits. `null` is the root. */
6
+ export type FolderPlacement = {
7
+ parentId: string | null;
8
+ name: string;
9
+ };
5
10
  /**
6
- * Data access for the `storage_folder` table. Paths are normalized folder
7
- * paths (see `parseFolder`); the root (`null`) is never stored.
11
+ * Data access for the `storage_folder` table. A folder is its `id`. The
12
+ * root is not a row: a top-level folder stores `parent_id` as `""`, because
13
+ * a nullable parent cannot be unique. `path` is rewritten when the folder
14
+ * or one of its ancestors is renamed or moved.
8
15
  */
9
16
  export type StorageFolderStore = {
10
- /** Loads one folder. */
11
- find: (scope: string, path: string) => Promise<StorageFolder | null>;
12
- /** Direct child folders of `parent` (`null` is the root), by name. */
13
- children: (scope: string, parent: string | null, options?: {
17
+ /** Loads one folder of the scope. */
18
+ find: (scope: string, id: string) => Promise<StorageFolder | null>;
19
+ /** Direct child folders of `parentId` (`null` is the root), by name. */
20
+ children: (scope: string, parentId: string | null, options?: {
14
21
  limit?: number;
15
22
  }) => Promise<StorageFolder[]>;
16
23
  /**
17
- * Creates `path` and every missing ancestor, so it also restores an
18
- * ancestor that a concurrent delete removed. Safe to call concurrently.
19
- * The root (`null`) needs nothing.
24
+ * The folders from the root down to `id`, including `id`.
25
+ * @throws `FOLDER_NOT_FOUND` when the scope has no such folder.
26
+ */
27
+ trail: (scope: string, id: string) => Promise<StorageFolder[]>;
28
+ /**
29
+ * Creates `name` inside `parentId`. The parent must already exist.
30
+ * @throws `FOLDER_NOT_FOUND` when the parent is missing.
31
+ * @throws `FOLDER_INVALID` when the name or the resulting path is not a
32
+ * folder path.
33
+ * @throws `FOLDER_EXISTS` when that parent already has the name.
20
34
  */
21
- ensure: (scope: string, path: string | null) => Promise<void>;
35
+ create: (scope: string, input: FolderPlacement) => Promise<StorageFolder>;
22
36
  /**
23
- * Creates `path` and every missing ancestor.
24
- * @throws `FOLDER_EXISTS` when the folder already exists.
37
+ * Renames `id`, moves it, or both. An omitted field stays as it is.
38
+ * `parentId: null` moves the folder to the root. Descendants keep their
39
+ * ids; their paths are rewritten.
40
+ * @throws `FOLDER_NOT_FOUND` when the folder or its new parent is missing.
41
+ * @throws `FOLDER_INVALID` when the name is not a folder name, the folder
42
+ * would sit inside itself, or a path would be too long or too deep.
43
+ * @throws `FOLDER_EXISTS` when the destination already has the name.
25
44
  */
26
- create: (scope: string, path: string) => Promise<StorageFolder>;
45
+ update: (scope: string, id: string, input: {
46
+ name?: string;
47
+ parentId?: string | null;
48
+ }) => Promise<StorageFolder>;
27
49
  /**
28
50
  * Removes an empty folder. Removing a missing folder does nothing.
29
51
  * @throws `FOLDER_NOT_EMPTY` when it has child folders, or active or
30
52
  * pending objects.
31
53
  */
32
- delete: (scope: string, path: string) => Promise<void>;
54
+ delete: (scope: string, id: string) => Promise<void>;
55
+ /**
56
+ * Puts `folder` back when a concurrent delete removed it, with the same
57
+ * id. An object written in between still points at that id.
58
+ */
59
+ retain: (folder: StorageFolder) => Promise<void>;
33
60
  };
34
61
  /** Creates the `storage_folder` store over `getOrm`. */
35
62
  export declare function createFolderStore(getOrm: GetDbOrm): StorageFolderStore;
@@ -1 +1 @@
1
- {"version":3,"file":"folder-store.d.ts","sourceRoot":"","sources":["../../src/store/folder-store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAA0B,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAEvE,uEAAuE;AACvE,eAAO,MAAM,6BAA6B,OAAO,CAAC;AAElD;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,wBAAwB;IACxB,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;IACrE,sEAAsE;IACtE,QAAQ,EAAE,CACR,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,KACzB,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;IAC9B;;;;OAIG;IACH,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D;;;OAGG;IACH,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;IAChE;;;;OAIG;IACH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AE,CACN,KAAK,EAAE,MAAM,EACb,EAAE,EAAE,MAAM,EACV,KAAK,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,KAC/C,OAAO,CAAC,aAAa,CAAC,CAAC;IAC5B;;;;OAIG;IACH,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrD;;;OAGG;IACH,MAAM,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAClD,CAAC;AA0CF,wDAAwD;AACxD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,QAAQ,GAAG,kBAAkB,CAsPtE"}
@@ -5,7 +5,7 @@ export declare const DEFAULT_LIST_SORT: DbListSort;
5
5
  /** What a listing is filtered and ordered by. A cursor is only valid for these. */
6
6
  export type ListCursorFilters = {
7
7
  /** `undefined` lists every folder; `null` is the root. */
8
- folder: string | null | undefined;
8
+ folderId: string | null | undefined;
9
9
  search: string | undefined;
10
10
  status: StorageObjectStatus;
11
11
  route: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"list-cursor.d.ts","sourceRoot":"","sources":["../../src/store/list-cursor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAmB,MAAM,gBAAgB,CAAC;AAClE,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACpB,MAAM,wBAAwB,CAAC;AAEhC,sDAAsD;AACtD,eAAO,MAAM,iBAAiB,EAAE,UAG/B,CAAC;AAEF,mFAAmF;AACnF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,0DAA0D;IAC1D,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAClC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,MAAM,EAAE,mBAAmB,CAAC;IAC5B,KAAK,EA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MAAM,CAAC;CACZ,CAAC;AAqCF,wEAAwE;AACxE,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,iBAAiB,EAC1B,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,GAC7B,MAAM,CAQR;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,iBAAiB,GACzB,UAAU,GAAG,IAAI,CAYnB"}
@@ -1,7 +1,7 @@
1
1
  import type { StorageObject } from "../types/storage-object.js";
2
2
  /**
3
3
  * A byte count as a driver returns it: a number, a bigint, or a string
4
- * (PostgreSQL int8). A 1.x SQLite row still holds a blob, read as a bigint.
4
+ * (PostgreSQL int8).
5
5
  */
6
6
  type ByteCount = number | bigint | string | null;
7
7
  /** Raw `storage_object` row as the FumaDB ORM returns it. */
@@ -11,7 +11,7 @@ export type StorageObjectRow = {
11
11
  bucket: string;
12
12
  key: string;
13
13
  route: string;
14
- folder: string | null;
14
+ folderId: string | null;
15
15
  filename: string;
16
16
  contentType: string | null;
17
17
  size: ByteCount;
@@ -1 +1 @@
1
- {"version":3,"file":"map-row.d.ts","sourceRoot":"","sources":["../../src/store/map-row.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EAEd,MAAM,wBAAwB,CAAC;AAEhC;;;GAGG;AACH,KAAK,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;AAEjD,6DAA6D;AAC7D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,IAAI,EAAE,SAAS,CA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M,GAAG,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IACvB,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;CACxB,CAAC;AAMF,yEAAyE;AACzE,wBAAgB,mBAAmB,CAAC,WAAW,GAAG,KAAK,EACrD,GAAG,EAAE,gBAAgB,GACpB,aAAa,CAAC,WAAW,CAAC,CAyB5B"}
@@ -1,13 +1,13 @@
1
1
  import type { AbstractQuery, FindManyOptions } from "fumadb/query";
2
- import type { v2 } from "../schema/v2.js";
2
+ import type { dbSchema } from "../schema/schema.js";
3
3
  import type { DbListSort, DbUsage } from "../types/client.js";
4
4
  import type { StorageObject, StorageObjectStatus } from "../types/storage-object.js";
5
- /** The FumaDB ORM for schema 2.0.0. */
6
- export type DbOrm = AbstractQuery<typeof v2>;
5
+ /** The FumaDB ORM for the schema the stores read. */
6
+ export type DbOrm = AbstractQuery<typeof dbSchema>;
7
7
  /** Resolves the ORM once the schema version is checked. */
8
8
  export type GetDbOrm = () => Promise<DbOrm>;
9
9
  /** Condition builder of a `storage_object` query. */
10
- export type ObjectConditions = Parameters<NonNullable<FindManyOptions<(typeof v2.tables)["storageObject"]>["where"]>>[0];
10
+ export type ObjectConditions = Parameters<NonNullable<FindManyOptions<(typeof dbSchema.tables)["storageObject"]>["where"]>>[0];
11
11
  type Condition = ReturnType<ObjectConditions> | boolean;
12
12
  /** Rows per page when `limit` is not given. */
13
13
  export declare const DEFAULT_LIST_LIMIT = 50;
@@ -30,8 +30,8 @@ export type UploadRef = ObjectRef & {
30
30
  export type UpsertPendingInput = ObjectRef & {
31
31
  scope: string;
32
32
  route: string;
33
- /** Logical folder. `null` is the root. */
34
- folder: string | null;
33
+ /** Folder that holds the object. `null` is the root. */
34
+ folderId: string | null;
35
35
  filename: string;
36
36
  contentType?: string | null;
37
37
  /** Size the client declared. Quota counts it until the row expires. */
@@ -63,7 +63,7 @@ export type MarkActiveInput = UploadRef & {
63
63
  export type ObjectFilter = {
64
64
  scope: string;
65
65
  /** Folder to cover. `null` is the root. Omit for every folder. */
66
- folder?: string | null;
66
+ folderId?: string | null;
67
67
  /**
68
68
  * @default "active". `pending` covers only rows that have not expired.
69
69
  */
@@ -99,8 +99,8 @@ export type ListObjectsPage<TAttributes = never> = {
99
99
  /** Fields `update` changes. Omitted fields stay as they are. */
100
100
  export type UpdateObjectInput<TAttributes = never> = {
101
101
  filename?: string;
102
- /** Folder path. `null` is the root. */
103
- folder?: string | null;
102
+ /** Folder id. `null` moves the object to the root. */
103
+ folderId?: string | null;
104
104
  attributes?: TAttributes | null;
105
105
  };
106
106
  /** Data access for the `storage_object` table. It never calls S3. */
@@ -1 +1 @@
1
- {"version":3,"file":"object-store.d.ts","sourceRoot":"","sources":["../../src/store/object-store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACpB,MAAM,wBAAwB,CAAC;AAUhC,uCAAuC;AACvC,MAAM,MAAM,KAAK,GAAG,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC;AAE7C,2DAA2D;AAC3D,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,CAA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AC,MAAM,CAAC,CAAC;CACpD,CAAC;AAiBF;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,iBAK3D;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,GAAG,OAAO,CAMnE;AAED,2EAA2E;AAC3E,wBAAgB,UAAU,CAAC,CAAC,EAAE,gBAAgB,EAAE,GAAG,EAAE,IAAI,GAAG,SAAS,CAKpE;AAwFD,wDAAwD;AACxD,wBAAgB,iBAAiB,CAAC,WAAW,GAAG,KAAK,EACnD,MAAM,EAAE,QAAQ,GACf,kBAAkB,CAAC,WAAW,CAAC,CAqZjC"}
@@ -1,7 +1,7 @@
1
1
  import { type DimahS3DbClient } from "../fuma-db.js";
2
2
  /**
3
3
  * Throws unless the database is at the schema the stores use
4
- * ({@link DB_SCHEMA_VERSION}). A 1.x database must be upgraded first.
4
+ * ({@link DB_SCHEMA_VERSION}).
5
5
  */
6
6
  export declare function checkSchemaVersion(client: DimahS3DbClient): Promise<void>;
7
7
  //# sourceMappingURL=schema-version.d.ts.map