@dimah-s3/db 2.0.0-beta.1 → 2.0.0-beta.10

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 (82) hide show
  1. package/README.md +19 -10
  2. package/dist/adapters/drizzle.d.ts +2 -3
  3. package/dist/adapters/drizzle.d.ts.map +1 -1
  4. package/dist/adapters/kysely.d.ts +1 -1
  5. package/dist/adapters/prisma.d.ts +1 -1
  6. package/dist/cli.d.ts +18 -13
  7. package/dist/cli.d.ts.map +1 -1
  8. package/dist/cli.js +57 -84
  9. package/dist/cli.js.map +1 -1
  10. package/dist/client/db-client.d.ts +1 -1
  11. package/dist/client/db-client.d.ts.map +1 -1
  12. package/dist/client/db-object-source.d.ts +15 -9
  13. package/dist/client/db-object-source.d.ts.map +1 -1
  14. package/dist/client/index.d.ts +3 -3
  15. package/dist/client/index.d.ts.map +1 -1
  16. package/dist/client/index.js +101 -21
  17. package/dist/client/index.js.map +1 -1
  18. package/dist/folder-path.d.ts +17 -4
  19. package/dist/folder-path.d.ts.map +1 -1
  20. package/dist/fuma-db.d.ts +23 -23
  21. package/dist/fuma-db.d.ts.map +1 -1
  22. package/dist/index.d.ts +9 -9
  23. package/dist/index.js +595 -267
  24. package/dist/index.js.map +1 -1
  25. package/dist/plugin/create-database-endpoints.d.ts +46 -22
  26. package/dist/plugin/create-database-endpoints.d.ts.map +1 -1
  27. package/dist/plugin/create-database-lifecycle-hooks.d.ts +4 -4
  28. package/dist/plugin/create-database-lifecycle-hooks.d.ts.map +1 -1
  29. package/dist/plugin/db.d.ts +2 -2
  30. package/dist/plugin/db.d.ts.map +1 -1
  31. package/dist/plugin/object-access.d.ts +2 -2
  32. package/dist/plugin/object-access.d.ts.map +1 -1
  33. package/dist/plugin/public-stores.d.ts +5 -8
  34. package/dist/plugin/public-stores.d.ts.map +1 -1
  35. package/dist/plugin/quota.d.ts +1 -1
  36. package/dist/plugin/schemas.d.ts +25 -11
  37. package/dist/plugin/schemas.d.ts.map +1 -1
  38. package/dist/plugin/scope.d.ts +2 -0
  39. package/dist/plugin/scope.d.ts.map +1 -1
  40. package/dist/plugin/to-db-client-object.d.ts.map +1 -1
  41. package/dist/schema/schema.d.ts +48 -49
  42. package/dist/schema/schema.d.ts.map +1 -1
  43. package/dist/store/create-db-store.d.ts +2 -2
  44. package/dist/store/create-db-store.d.ts.map +1 -1
  45. package/dist/store/folder-store.d.ts +73 -15
  46. package/dist/store/folder-store.d.ts.map +1 -1
  47. package/dist/store/list-cursor.d.ts +3 -1
  48. package/dist/store/list-cursor.d.ts.map +1 -1
  49. package/dist/store/map-row.d.ts +3 -9
  50. package/dist/store/map-row.d.ts.map +1 -1
  51. package/dist/store/object-store.d.ts +20 -10
  52. package/dist/store/object-store.d.ts.map +1 -1
  53. package/dist/store/search-name.d.ts +7 -0
  54. package/dist/store/search-name.d.ts.map +1 -0
  55. package/dist/types/client.d.ts +114 -23
  56. package/dist/types/client.d.ts.map +1 -1
  57. package/dist/types/plugin.d.ts +17 -6
  58. package/dist/types/plugin.d.ts.map +1 -1
  59. package/dist/types/storage-object.d.ts +8 -7
  60. package/dist/types/storage-object.d.ts.map +1 -1
  61. package/package.json +15 -33
  62. package/dist/drizzle/mysql.d.ts +0 -1025
  63. package/dist/drizzle/mysql.d.ts.map +0 -1
  64. package/dist/drizzle/mysql.js +0 -117
  65. package/dist/drizzle/mysql.js.map +0 -1
  66. package/dist/drizzle/pg.d.ts +0 -964
  67. package/dist/drizzle/pg.d.ts.map +0 -1
  68. package/dist/drizzle/pg.js +0 -98
  69. package/dist/drizzle/pg.js.map +0 -1
  70. package/dist/drizzle/shared.d.ts +0 -7
  71. package/dist/drizzle/shared.d.ts.map +0 -1
  72. package/dist/drizzle/sqlite.d.ts +0 -1024
  73. package/dist/drizzle/sqlite.d.ts.map +0 -1
  74. package/dist/drizzle/sqlite.js +0 -101
  75. package/dist/drizzle/sqlite.js.map +0 -1
  76. package/prisma/dimah-s3.prisma +0 -80
  77. package/sql/mysql.sql +0 -59
  78. package/sql/pg.sql +0 -53
  79. package/sql/sqlite.sql +0 -54
  80. package/src/drizzle/mysql.ts +0 -172
  81. package/src/drizzle/pg.ts +0 -140
  82. package/src/drizzle/sqlite.ts +0 -144
@@ -1,35 +1,93 @@
1
1
  import type { StorageFolder } from "../types/storage-object.js";
2
- import { type GetDbOrm } from "./object-store";
2
+ import { type GetDbOrm } from "./object-store.js";
3
3
  /** Most child folders `children` returns when `limit` is not given. */
4
4
  export declare const DEFAULT_FOLDER_CHILDREN_LIMIT = 1000;
5
+ /** Most folders `descendants` returns when `limit` is not given. */
6
+ export declare const DEFAULT_FOLDER_DESCENDANTS_LIMIT = 1000;
5
7
  /**
6
- * Data access for the `storage_folder` table. Paths are normalized folder
7
- * paths (see `parseFolder`); the root (`null`) is never stored.
8
+ * Most folders below the open one that a recursive listing covers. Their
9
+ * ids go into one `in` list, well under every driver's parameter cap.
10
+ */
11
+ export declare const FOLDER_SUBTREE_LIMIT = 10000;
12
+ /** Where a new or moved folder sits. `null` is the root. */
13
+ export type FolderPlacement = {
14
+ parentId: string | null;
15
+ name: string;
16
+ };
17
+ /**
18
+ * Data access for the `storage_folder` table. A folder is its `id`. The
19
+ * root is not a row: a top-level folder stores `parent_id` as `""`, because
20
+ * a nullable parent cannot be unique. `path` is rewritten when the folder
21
+ * or one of its ancestors is renamed or moved.
8
22
  */
9
23
  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?: {
24
+ /** Loads one folder of the scope. */
25
+ find: (scope: string, id: string) => Promise<StorageFolder | null>;
26
+ /**
27
+ * Ids of the folders below `id` at any depth, up to
28
+ * {@link FOLDER_SUBTREE_LIMIT}, in no order. Empty for a folder the scope
29
+ * does not have. Lookups for the same folder that overlap share one walk.
30
+ * @internal Recursive listings use it.
31
+ */
32
+ subtreeIds: (scope: string, id: string) => Promise<string[]>;
33
+ /** Direct child folders of `parentId` (`null` is the root), by name. */
34
+ children: (scope: string, parentId: string | null, options?: {
14
35
  limit?: number;
15
36
  }) => Promise<StorageFolder[]>;
16
37
  /**
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.
38
+ * The folders from the root down to `id`, including `id`.
39
+ * @throws `FOLDER_NOT_FOUND` when the scope has no such folder.
20
40
  */
21
- ensure: (scope: string, path: string | null) => Promise<void>;
41
+ trail: (scope: string, id: string) => Promise<StorageFolder[]>;
22
42
  /**
23
- * Creates `path` and every missing ancestor.
24
- * @throws `FOLDER_EXISTS` when the folder already exists.
43
+ * Folders below `parentId` at any depth (`null`: every folder of the
44
+ * scope), by name, then path. With `search`, only those whose name
45
+ * contains it, folded the way file search folds (case, accents, and
46
+ * look-alike letters do not count). `parentId` itself is not included.
47
+ * @throws `FOLDER_NOT_FOUND` when `parentId` is not in the scope.
25
48
  */
26
- create: (scope: string, path: string) => Promise<StorageFolder>;
49
+ descendants: (scope: string, parentId: string | null, options?: {
50
+ search?: string;
51
+ limit?: number;
52
+ }) => Promise<StorageFolder[]>;
53
+ /**
54
+ * Every folder from the top level down to each of `ids`, `ids` included,
55
+ * once each, in path order. Ids the scope does not have are skipped.
56
+ * Draws the location of rows that come from several folders.
57
+ */
58
+ ancestors: (scope: string, ids: readonly string[]) => Promise<StorageFolder[]>;
59
+ /**
60
+ * Creates `name` inside `parentId`. The parent must already exist.
61
+ * @throws `FOLDER_NOT_FOUND` when the parent is missing.
62
+ * @throws `FOLDER_INVALID` when the name or the resulting path is not a
63
+ * folder path.
64
+ * @throws `FOLDER_EXISTS` when that parent already has the name.
65
+ */
66
+ create: (scope: string, input: FolderPlacement) => Promise<StorageFolder>;
67
+ /**
68
+ * Renames `id`, moves it, or both. An omitted field stays as it is.
69
+ * `parentId: null` moves the folder to the root. Descendants keep their
70
+ * ids; their paths are rewritten.
71
+ * @throws `FOLDER_NOT_FOUND` when the folder or its new parent is missing.
72
+ * @throws `FOLDER_INVALID` when the name is not a folder name, the folder
73
+ * would sit inside itself, or a path would be too long or too deep.
74
+ * @throws `FOLDER_EXISTS` when the destination already has the name.
75
+ */
76
+ update: (scope: string, id: string, input: {
77
+ name?: string;
78
+ parentId?: string | null;
79
+ }) => Promise<StorageFolder>;
27
80
  /**
28
81
  * Removes an empty folder. Removing a missing folder does nothing.
29
82
  * @throws `FOLDER_NOT_EMPTY` when it has child folders, or active or
30
83
  * pending objects.
31
84
  */
32
- delete: (scope: string, path: string) => Promise<void>;
85
+ delete: (scope: string, id: string) => Promise<void>;
86
+ /**
87
+ * Puts `folder` back when a concurrent delete removed it, with the same
88
+ * id. An object written in between still points at that id.
89
+ */
90
+ retain: (folder: StorageFolder) => Promise<void>;
33
91
  };
34
92
  /** Creates the `storage_folder` store over `getOrm`. */
35
93
  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,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,EAAE,aAAa,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAClD,CAAC;AAoDF,wDAAwD;AACxD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,QAAQ,GAAG,kBAAkB,CAoVtE"}
@@ -5,7 +5,9 @@ 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
+ /** The folders below `folderId` are listed too. */
10
+ recursive: boolean;
9
11
  search: string | undefined;
10
12
  status: StorageObjectStatus;
11
13
  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,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,IAAI,EAAE,UAAU,CAAC;CAClB,CAAC;AAEF,iFAAiF;AACjF,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACrC,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAqCF,wEAAwE;AACxE,wBAAgB,gBAAgB,CAC9B,O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B"}
@@ -1,9 +1,4 @@
1
1
  import type { StorageObject } from "../types/storage-object.js";
2
- /**
3
- * A byte count as a driver returns it: a number, a bigint, or a string
4
- * (PostgreSQL int8).
5
- */
6
- type ByteCount = number | bigint | string | null;
7
2
  /** Raw `storage_object` row as the FumaDB ORM returns it. */
8
3
  export type StorageObjectRow = {
9
4
  id: string;
@@ -11,11 +6,11 @@ export type StorageObjectRow = {
11
6
  bucket: string;
12
7
  key: string;
13
8
  route: string;
14
- folder: string | null;
9
+ folderId: string | null;
15
10
  filename: string;
16
11
  contentType: string | null;
17
- size: ByteCount;
18
- declaredSize: ByteCount;
12
+ size: bigint | null;
13
+ declaredSize: bigint | null;
19
14
  eTag: string | null;
20
15
  status: string;
21
16
  s3Metadata: unknown;
@@ -31,5 +26,4 @@ export type StorageObjectRow = {
31
26
  };
32
27
  /** Normalizes a raw row: sizes become numbers, JSON columns are cast. */
33
28
  export declare function mapStorageObjectRow<TAttributes = never>(row: StorageObjectRow): StorageObject<TAttributes>;
34
- export {};
35
29
  //# sourceMappingURL=map-row.d.ts.map
@@ -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,C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,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;AAOF,yEAAyE;AACzE,wBAAgB,mBAAmB,CAAC,WAAW,GAAG,KAAK,EACrD,GAAG,EAAE,gBAAgB,GACpB,aAAa,CAAC,WAAW,CAAC,CAyB5B"}
@@ -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,13 @@ 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
+ /**
68
+ * With `folderId`, also cover every folder below it, up to
69
+ * `FOLDER_SUBTREE_LIMIT` (10,000) folders. At the root that is the whole
70
+ * scope. A folder the scope does not have covers nothing.
71
+ */
72
+ recursive?: boolean;
67
73
  /**
68
74
  * @default "active". `pending` covers only rows that have not expired.
69
75
  */
@@ -72,9 +78,10 @@ export type ObjectFilter = {
72
78
  /** Exact type, or `type/*` for every subtype (`image/*`). */
73
79
  contentType?: string;
74
80
  /**
75
- * Text the `filename` contains (`LIKE` on SQL), where `%` and `_` act as
76
- * wildcards. The database decides case: PostgreSQL matches it exactly,
77
- * SQLite ignores ASCII case, and MySQL follows the column collation.
81
+ * Text the `filename` contains. Both sides are folded the same way on
82
+ * every database: case, accents, and look-alike letters (`ي`/`ی`,
83
+ * `ك`/`ک`) do not count, Persian and Arabic-Indic digits match `0`–`9`,
84
+ * and `%`, `_`, and `\` match as themselves.
78
85
  */
79
86
  search?: string;
80
87
  };
@@ -99,8 +106,8 @@ export type ListObjectsPage<TAttributes = never> = {
99
106
  /** Fields `update` changes. Omitted fields stay as they are. */
100
107
  export type UpdateObjectInput<TAttributes = never> = {
101
108
  filename?: string;
102
- /** Folder path. `null` is the root. */
103
- folder?: string | null;
109
+ /** Folder id. `null` moves the object to the root. */
110
+ folderId?: string | null;
104
111
  attributes?: TAttributes | null;
105
112
  };
106
113
  /** Data access for the `storage_object` table. It never calls S3. */
@@ -202,7 +209,10 @@ export declare function uploadTokenOf(object: StorageObject<unknown>): string |
202
209
  export declare function isUploading(object: StorageObject<unknown>): boolean;
203
210
  /** Active rows, and pending rows whose confirm deadline has not passed. */
204
211
  export declare function liveObject(b: ObjectConditions, now: Date): Condition;
205
- /** Creates the `storage_object` store over `getOrm`. */
206
- export declare function createObjectStore<TAttributes = never>(getOrm: GetDbOrm): StorageObjectStore<TAttributes>;
212
+ /**
213
+ * Creates the `storage_object` store over `getOrm`. `subtreeIds` lists the
214
+ * folders below a folder, for recursive listings.
215
+ */
216
+ export declare function createObjectStore<TAttributes = never>(getOrm: GetDbOrm, subtreeIds: (scope: string, folderId: string) => Promise<string[]>): StorageObjectStore<TAttributes>;
207
217
  export {};
208
218
  //# sourceMappingURL=object-store.d.ts.map
@@ -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,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AA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,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IAC5C;;;;;;;;OAQG;IACH,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,CAAC;IACvE,+DAA+D;IAC/D,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,2EAA2E;IAC3E,YAAY,EAAE,CAAC,SAAS,EAAE,IAAI,KAAK,OAAO,CAAC,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;AA8GD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,GAAG,KAAK,EACnD,MAAM,EAAE,QAAQ,EAChB,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,GACjE,kBAAkB,CAAC,WAAW,CAAC,CAoajC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * The `search_name` of a file or folder name, or the text a search looks
3
+ * for: folded with `normalizeSearchText` from `@dimah-s3/core`, with the
4
+ * `LIKE` specials kept literal, and cut to the column's length.
5
+ */
6
+ export declare function toSearchName(value: string): string;
7
+ //# sourceMappingURL=search-name.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-name.d.ts","sourceRoot":"","sources":["../../src/store/search-name.ts"],"names":[],"mappings":"AAeA;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CASlD"}
@@ -1,5 +1,5 @@
1
1
  import type { S3RequestOptions, S3RouteName } from "@dimah-s3/core";
2
- import type { StorageObjectStatus } from "./storage-object";
2
+ import type { StorageObjectStatus } from "./storage-object.js";
3
3
  /** A row status the browser can see. Rows that purge has claimed stay internal. */
4
4
  export type DbClientObjectStatus = Exclude<StorageObjectStatus, "purging">;
5
5
  /**
@@ -12,8 +12,8 @@ export type DbClientObject<TClientAttributes = never> = {
12
12
  bucket: string;
13
13
  key: string;
14
14
  route: string;
15
- /** Logical folder path. `null` is the root. */
16
- folder: string | null;
15
+ /** Folder that holds the object. `null` is the root. */
16
+ folderId: string | null;
17
17
  filename: string;
18
18
  contentType: string | null;
19
19
  /** Verified size. `null` while the object is pending. */
@@ -28,12 +28,16 @@ export type DbClientObject<TClientAttributes = never> = {
28
28
  };
29
29
  /** Browser-facing folder row. */
30
30
  export type DbClientFolder = {
31
- path: string;
31
+ id: string;
32
32
  name: string;
33
- /** Path of the containing folder. `null` is the root. */
34
- parent: string | null;
33
+ /** Containing folder. `null` is the root. */
34
+ parentId: string | null;
35
+ /** Full path, from the root. It changes when an ancestor is renamed. */
36
+ path: string;
35
37
  /** ISO 8601 timestamp. */
36
38
  createdAt: string;
39
+ /** ISO 8601 timestamp. */
40
+ updatedAt: string;
37
41
  };
38
42
  /** Column a listing can be ordered by. */
39
43
  export type DbListSortField = "createdAt" | "updatedAt" | "size" | "filename";
@@ -64,16 +68,24 @@ export type DbClientListInput = {
64
68
  * Folder to list. `null` (or `""`) is the root. Omit for a flat list of
65
69
  * every folder.
66
70
  */
67
- folder?: string | null;
71
+ folderId?: string | null;
72
+ /**
73
+ * With `folderId`, also list every folder below it: objects from the
74
+ * whole subtree, and every folder in it as `folders`. At the root that is
75
+ * the whole scope. Each page carries `locations`, so a row can say where
76
+ * it is. `authorize` sees `recursive: true`.
77
+ */
78
+ recursive?: boolean;
68
79
  route?: S3RouteName;
69
80
  /** @default "active" */
70
81
  status?: DbClientObjectStatus;
71
82
  /** Exact type, or `type/*` for every subtype (`image/*`). */
72
83
  contentType?: string;
73
84
  /**
74
- * Text the `filename` contains. The database decides case: PostgreSQL
75
- * matches it exactly, SQLite ignores ASCII case, and MySQL follows the
76
- * column collation.
85
+ * Text the `filename` contains. Case, accents, and look-alike letters
86
+ * (`ي`/`ی`, `ك`/`ک`) do not count, Persian and Arabic-Indic digits match
87
+ * `0`–`9`, and `%` and `_` are plain text, the same on every database.
88
+ * With `folderId`, folder names are matched the same way.
77
89
  */
78
90
  search?: string;
79
91
  /** @default { field: "createdAt", direction: "desc" } */
@@ -92,10 +104,25 @@ export type DbClientListResponse<TClientAttributes = never> = {
92
104
  /** `null` on the last page. */
93
105
  nextCursor: string | null;
94
106
  /**
95
- * Direct child folders of `folder`, at most 1000, and only those whose
96
- * name contains `search` when it is set. First page only.
107
+ * Direct child folders of `folderId`, or with `recursive` every folder
108
+ * below it, by name. At most 1000, and only those whose name contains
109
+ * `search` when it is set. First page only, and only when `folderId` is
110
+ * set.
97
111
  */
98
112
  folders?: DbClientFolder[];
113
+ /**
114
+ * Folders from the root down to the open folder. Empty at the root.
115
+ * First page only, and only when `folderId` is set.
116
+ */
117
+ trail?: DbClientFolder[];
118
+ /**
119
+ * With `recursive`, every folder on the way to the objects of this page
120
+ * and, on the first page, to `folders`: walk `parentId` from a row's
121
+ * `folderId` to draw where it lives. Every page.
122
+ */
123
+ locations?: DbClientFolder[];
124
+ /** Objects that match, across every page. First page of a search only. */
125
+ total?: number;
99
126
  /** First page only. */
100
127
  usage?: DbUsage;
101
128
  /** Caps for the scope, `null` when there are none. First page only. */
@@ -109,17 +136,29 @@ export type DbClientGetInput = {
109
136
  /** Body of `PATCH /db/object`. Omitted fields stay as they are. */
110
137
  export type DbClientUpdateInput = DbClientGetInput & {
111
138
  filename?: string;
112
- /** Folder path. `null` moves the object to the root. */
113
- folder?: string | null;
139
+ /** Folder id. `null` moves the object to the root. */
140
+ folderId?: string | null;
114
141
  /**
115
142
  * Replaces the attributes, checked by the plugin's `attributes.schema`.
116
143
  * `null` clears them.
117
144
  */
118
145
  attributes?: Record<string, unknown> | null;
119
146
  };
120
- /** Body of `POST /db/folder` and query of `DELETE /db/folder`. */
121
- export type DbClientFolderInput = {
122
- path: string;
147
+ /** Body of `POST /db/folder`. `parentId` omitted or `null` is the root. */
148
+ export type DbClientCreateFolderInput = {
149
+ parentId?: string | null;
150
+ name: string;
151
+ };
152
+ /** Body of `PATCH /db/folder`. An omitted field stays as it is. */
153
+ export type DbClientUpdateFolderInput = {
154
+ id: string;
155
+ name?: string;
156
+ /** `null` moves the folder to the root. */
157
+ parentId?: string | null;
158
+ };
159
+ /** Query of `DELETE /db/folder`. */
160
+ export type DbClientDeleteFolderInput = {
161
+ id: string;
123
162
  };
124
163
  /**
125
164
  * The db endpoints as client actions (`api.db`). Each takes the same
@@ -133,11 +172,14 @@ export type DbClientActions<TClientAttributes = never> = {
133
172
  updateObject(input: DbClientUpdateInput, options?: S3RequestOptions): Promise<{
134
173
  object: DbClientObject<TClientAttributes>;
135
174
  }>;
136
- createFolder(input: DbClientFolderInput, options?: S3RequestOptions): Promise<{
175
+ createFolder(input: DbClientCreateFolderInput, options?: S3RequestOptions): Promise<{
137
176
  folder: DbClientFolder;
138
177
  }>;
139
- deleteFolder(input: DbClientFolderInput, options?: S3RequestOptions): Promise<{
140
- path: string;
178
+ updateFolder(input: DbClientUpdateFolderInput, options?: S3RequestOptions): Promise<{
179
+ folder: DbClientFolder;
180
+ }>;
181
+ deleteFolder(input: DbClientDeleteFolderInput, options?: S3RequestOptions): Promise<{
182
+ id: string;
141
183
  }>;
142
184
  };
143
185
  /** Filters `dbObjectSource` sends with every page. */
@@ -151,15 +193,29 @@ export type DbObjectSourceOptions = {
151
193
  limit?: number;
152
194
  /** List one folder at a time, with folder rows. @default true */
153
195
  folders?: boolean;
196
+ /**
197
+ * With `folders` on, search the folders below the open one too, or the
198
+ * whole scope (`searchScopes`). Turn it off when `authorize` keeps
199
+ * listings to one folder: a search then matches the open folder only.
200
+ * @default true
201
+ */
202
+ recursiveSearch?: boolean;
154
203
  };
155
- /** A folder row of {@link DbObjectSource}. `id` is the folder path. */
204
+ /** Where a search looks. Mirrors react's `ObjectListSearchScope`. */
205
+ export type DbObjectSourceSearchScope = "folder" | "all";
206
+ /** A folder row of {@link DbObjectSource}. `id` is the folder id. */
156
207
  export type DbObjectSourceFolder = {
157
208
  id: string;
158
209
  name: string;
210
+ /**
211
+ * Folders from the root down to the one that holds this folder. Set on
212
+ * the results of a search.
213
+ */
214
+ location?: readonly DbObjectSourceFolder[];
159
215
  };
160
216
  /** The `useObjectList` query input. Mirrors react's `ObjectListQueryInput`. */
161
217
  export type DbObjectSourceQueryInput = {
162
- /** Folder path. `null` is the root. */
218
+ /** Folder id. `null` is the root. */
163
219
  parent: string | null;
164
220
  cursor: string | null;
165
221
  /** `name`, `size`, or `updatedAt`. Other fields keep the default order. */
@@ -168,6 +224,11 @@ export type DbObjectSourceQueryInput = {
168
224
  direction: "asc" | "desc";
169
225
  } | null;
170
226
  search: string;
227
+ /**
228
+ * `folder`: the open folder and every folder below it. `all`: the whole
229
+ * scope. @default "folder"
230
+ */
231
+ searchScope?: DbObjectSourceSearchScope;
171
232
  signal: AbortSignal;
172
233
  };
173
234
  /** One page of {@link DbObjectSource}. Mirrors react's `ObjectListPage`. */
@@ -175,9 +236,16 @@ export type DbObjectSourcePage<TClientAttributes = never> = {
175
236
  items: DbClientObject<TClientAttributes>[];
176
237
  /** First page only. */
177
238
  folders?: DbObjectSourceFolder[];
239
+ /**
240
+ * Folders from the root down to `parent`. First page only.
241
+ * `useObjectList` shows these names in the breadcrumb.
242
+ */
243
+ trail?: DbObjectSourceFolder[];
178
244
  nextCursor: string | null;
179
245
  /** Scope usage with its caps. First page only. */
180
246
  usage?: DbUsage & DbQuota;
247
+ /** Files that match a search, across every page. First page only. */
248
+ total?: number;
181
249
  };
182
250
  /** How the list reads one row. Mirrors react's `ObjectListFile`. */
183
251
  export type DbObjectSourceFile = {
@@ -187,6 +255,11 @@ export type DbObjectSourceFile = {
187
255
  contentType: string | null;
188
256
  /** The row's `updatedAt`. */
189
257
  updatedAt: string;
258
+ /**
259
+ * Folders from the root down to the row's folder. Set on the rows of a
260
+ * search.
261
+ */
262
+ location?: readonly DbObjectSourceFolder[];
190
263
  };
191
264
  /**
192
265
  * A `useObjectList` source over `GET /db/objects`. Typed structurally so db
@@ -196,7 +269,9 @@ export type DbObjectSource<TClientAttributes = never> = {
196
269
  query: (input: DbObjectSourceQueryInput) => Promise<DbObjectSourcePage<TClientAttributes>>;
197
270
  getKey: (item: DbClientObject<TClientAttributes>) => string;
198
271
  getFile: (item: DbClientObject<TClientAttributes>) => DbObjectSourceFile;
199
- /** Upload options for files dropped into `parent`. Root is `""`. */
272
+ /** `["folder", "all"]` with `folders` on: search reaches every folder. */
273
+ searchScopes?: readonly DbObjectSourceSearchScope[];
274
+ /** Upload options for files dropped into `parent`. The root sends `""`. */
200
275
  uploadOptions?: (parent: string | null) => {
201
276
  metadata: Record<string, string>;
202
277
  };
@@ -205,5 +280,21 @@ export type DbObjectSource<TClientAttributes = never> = {
205
280
  parent: string | null;
206
281
  name: string;
207
282
  }) => Promise<DbObjectSourceFolder>;
283
+ /**
284
+ * Renames a file's `filename`. The object `key` stays. Set when `api.db`
285
+ * has `updateObject`.
286
+ */
287
+ renameFile?: (input: {
288
+ item: DbClientObject<TClientAttributes>;
289
+ name: string;
290
+ }) => Promise<DbClientObject<TClientAttributes>>;
291
+ /**
292
+ * Renames a folder. Its id stays. Set when `api.db` has `updateFolder`
293
+ * and `folders` is on.
294
+ */
295
+ renameFolder?: (input: {
296
+ folder: DbObjectSourceFolder;
297
+ name: string;
298
+ }) => Promise<DbObjectSourceFolder>;
208
299
  };
209
300
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/types/client.ts"],"names":[],"mappings":"AA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E,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,KAAK;QACzC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAClC,CAAC;IACF,sCAAsC;IACtC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE;QACrB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;QACtB,IAAI,EAAE,MAAM,CAAC;KACd,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACpC;;;OAGG;IACH,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE;QACnB,IAAI,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAC;QACxC,IAAI,EAAE,MAAM,CAAC;KACd,KAAK,OAAO,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACjD;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE;QACrB,MAAM,EAAE,oBAAoB,CAAC;QAC7B,IAAI,EAAE,MAAM,CAAC;KACd,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;CACrC,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import type { DimahS3Locals } from "@dimah-s3/server";
2
2
  import type { DimahS3DbClient } from "../fuma-db.js";
3
3
  import type { StandardSchemaV1 } from "../standard-schema.js";
4
- import type { DbQuota } from "./client";
5
- import type { StorageObject } from "./storage-object";
4
+ import type { DbQuota } from "./client.js";
5
+ import type { StorageObject } from "./storage-object.js";
6
6
  /**
7
7
  * What a scope is resolved for.
8
8
  * - `upload`: presign, multipart init, and `s3.put`
@@ -41,8 +41,18 @@ export type AuthorizeContext<TSession = undefined, TAttributes = never> = ScopeC
41
41
  scope: string;
42
42
  /** Object key. Absent on `list` and the folder endpoints. */
43
43
  key?: string;
44
- /** Target folder of an upload, move, or folder endpoint. `null` is the root. */
44
+ /**
45
+ * Path of the target folder. `null` is the root. Absent when the call is
46
+ * not aimed at one folder. A rename or move reports the destination.
47
+ */
45
48
  folder?: string | null;
49
+ /** Id of the target folder. `null` is the root. */
50
+ folderId?: string | null;
51
+ /**
52
+ * `true` when a `list` also covers every folder below `folder`, as a
53
+ * search across folders does. Deny it to keep listings to one folder.
54
+ */
55
+ recursive?: boolean;
46
56
  /** Client extras of the upload. Set on `upload` only. */
47
57
  clientMetadata?: Record<string, string>;
48
58
  /**
@@ -89,9 +99,10 @@ export type DbPluginOptions<TSession = undefined, TAttributes = never, TClientAt
89
99
  /** Loads the session for a request. Called at most once per `Request`. */
90
100
  getSession?: (request: Request) => TSession | Promise<TSession>;
91
101
  /**
92
- * Owning scope of the caller, such as `user:123`. `null` rejects the
93
- * call with `UNAUTHORIZED`. It runs once per call and route, so the guard
94
- * and the lifecycle hooks of one call share the result.
102
+ * Owning scope of the caller, such as `user:123`, at most 255 characters.
103
+ * `null` rejects the call with `UNAUTHORIZED`, and a longer scope fails it
104
+ * as a config error. It runs once per call and route, so the guard and the
105
+ * lifecycle hooks of one call share the result.
95
106
  */
96
107
  resolveScope: (context: ScopeContext<TSession>) => string | null | Promise<string | null>;
97
108
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/types/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,cAAc,GACtB,QAAQ,GACR,SAAS,GACT,WAAW,GACX,UAAU,GACV,QAAQ,GACR,MAAM,GACN,MAAM,GACN,QAAQ,CAAC;AAEb;;;;GAIG;AACH,MAAM,MAAM,YAAY,CAAC,QAAQ,GAAG,SAAS,IAAI;IAC/C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