@tiddlywiki/mws 0.1.14 → 0.2.1

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 (117) hide show
  1. package/README.md +41 -20
  2. package/dist/metafile-esm.json +1 -1
  3. package/dist/mws.js +40121 -20116
  4. package/dist/mws.js.map +1 -1
  5. package/mws.run.mjs +28 -8
  6. package/package.json +20 -33
  7. package/plugins/client/plugin.info +1 -1
  8. package/plugins/client/src/multiwikiclientadaptor.ts +6 -34
  9. package/plugins/client/src/mws.d.ts +2 -1
  10. package/plugins/client/src/new-multiwikiclientadaptor.ts +634 -0
  11. package/plugins/client/src/types.d.ts +2531 -1036
  12. package/plugins/client/tiddlers/managetiddleraction.js +0 -5
  13. package/plugins/client/tiddlers/syncer/new-multiwikiclientadaptor.js +432 -0
  14. package/plugins/client/tiddlers/syncer/syncer.js +123 -241
  15. package/plugins/client/tsconfig.json +5 -1
  16. package/prisma/browser.ts +2 -0
  17. package/prisma/client/browser.ts +84 -0
  18. package/prisma/client/client.ts +108 -0
  19. package/prisma/client/commonInputTypes.ts +598 -0
  20. package/prisma/client/enums.ts +42 -0
  21. package/prisma/client/internal/class.ts +326 -0
  22. package/prisma/client/internal/prismaNamespace.ts +1870 -0
  23. package/prisma/client/internal/prismaNamespaceBrowser.ts +259 -0
  24. package/prisma/client/models/Bag.ts +1701 -0
  25. package/prisma/client/models/BagPermission.ts +1284 -0
  26. package/prisma/client/models/Recipe.ts +1722 -0
  27. package/prisma/client/models/RecipeBag.ts +1518 -0
  28. package/prisma/client/models/RecipePermission.ts +1284 -0
  29. package/prisma/client/models/Roles.ts +1316 -0
  30. package/prisma/client/models/Sessions.ts +1344 -0
  31. package/prisma/client/models/Settings.ts +1093 -0
  32. package/prisma/client/models/Template.ts +1477 -0
  33. package/prisma/client/models/TemplatePermission.ts +1284 -0
  34. package/prisma/client/models/Tiddler.ts +1434 -0
  35. package/prisma/client/models/TiddlerEvent.ts +1360 -0
  36. package/prisma/client/models/Users.ts +1579 -0
  37. package/prisma/client/models.ts +24 -0
  38. package/prisma/client/pjtg.ts +183 -0
  39. package/prisma/index.ts +74 -0
  40. package/prisma/migrations/20260708160259_init/migration.sql +172 -0
  41. package/prisma/migrations-v1/migration_lock.toml +3 -0
  42. package/prisma/package.json +12 -0
  43. package/prisma/schema.prisma +147 -89
  44. package/prisma/types.ts +9 -0
  45. package/public/.default.html +1 -0
  46. package/public/admin-vanilla/fish.svg +399 -0
  47. package/public/admin-vanilla/fish2.svg +389 -0
  48. package/public/admin-vanilla/main-LYDE4NDJ.css +1 -0
  49. package/public/admin-vanilla/main-Y4GDO4MD.js +1797 -0
  50. package/public/admin-vanilla/main-Y4GDO4MD.js.map +7 -0
  51. package/public/admin-vanilla/normalize.css +349 -0
  52. package/public/admin-vanilla/polyfill-ADOI2A4V.js +2 -0
  53. package/public/admin-vanilla/polyfill-ADOI2A4V.js.map +7 -0
  54. package/public/{react-admin → admin-vanilla}/site.webmanifest +1 -1
  55. package/public/admin-vanilla.html +62 -0
  56. package/public/admin-vanilla.json +1 -0
  57. package/public/{react-admin → stats}/stats.html +5 -2
  58. package/public/{react-admin → stats}/stats.js +2 -1
  59. package/scripts/build-docs.sh +30 -0
  60. package/scripts/helpers.mjs +107 -0
  61. package/scripts/json.js +8 -0
  62. package/scripts/scripts.mjs +114 -0
  63. package/prisma/client/client.d.ts +0 -1
  64. package/prisma/client/client.js +0 -3
  65. package/prisma/client/default.d.ts +0 -1
  66. package/prisma/client/default.js +0 -3
  67. package/prisma/client/edge.d.ts +0 -1
  68. package/prisma/client/edge.js +0 -297
  69. package/prisma/client/index-browser.js +0 -275
  70. package/prisma/client/index.d.ts +0 -17770
  71. package/prisma/client/index.js +0 -324
  72. package/prisma/client/package.json +0 -173
  73. package/prisma/client/query_engine_bg.js +0 -811
  74. package/prisma/client/query_engine_bg.wasm +0 -0
  75. package/prisma/client/runtime/edge-esm.js +0 -10000
  76. package/prisma/client/runtime/edge.js +0 -10036
  77. package/prisma/client/runtime/index-browser.d.ts +0 -370
  78. package/prisma/client/runtime/index-browser.js +0 -2300
  79. package/prisma/client/runtime/library.d.ts +0 -3681
  80. package/prisma/client/runtime/library.js +0 -10604
  81. package/prisma/client/runtime/react-native.js +0 -10629
  82. package/prisma/client/runtime/wasm-compiler-edge.js +0 -11238
  83. package/prisma/client/runtime/wasm-engine-edge.js +0 -7801
  84. package/prisma/client/schema.prisma +0 -156
  85. package/prisma/client/wasm-edge-light-loader.mjs +0 -4
  86. package/prisma/client/wasm-worker-loader.mjs +0 -4
  87. package/prisma/client/wasm.d.ts +0 -1
  88. package/prisma/client/wasm.js +0 -304
  89. package/prisma/global.ts +0 -53
  90. package/public/react-admin/chunk-YALWN5OT.js +0 -2
  91. package/public/react-admin/esm-L4WLVWJN.js +0 -3
  92. package/public/react-admin/esm-L4WLVWJN.js.map +0 -7
  93. package/public/react-admin/esm-QMNGI3LF.js +0 -3
  94. package/public/react-admin/esm-QMNGI3LF.js.map +0 -7
  95. package/public/react-admin/index.html +0 -36
  96. package/public/react-admin/main.js +0 -268
  97. package/public/react-admin/main.js.map +0 -7
  98. package/public/react-admin/stats.json +0 -1
  99. package/scripts.mjs +0 -142
  100. /package/prisma/{migrations → migrations-v1}/20250606001949_init/migration.sql +0 -0
  101. /package/prisma/{migrations → migrations-v1}/20250613000526_remove_group/migration.sql +0 -0
  102. /package/prisma/{migrations → migrations-v1}/20250620014502_settings/migration.sql +0 -0
  103. /package/prisma/{migrations → migrations-v1}/20250707205229_recipes/migration.sql +0 -0
  104. /package/public/{react-admin → admin-vanilla}/android-chrome-192x192.png +0 -0
  105. /package/public/{react-admin → admin-vanilla}/android-chrome-512x512.png +0 -0
  106. /package/public/{react-admin → admin-vanilla}/apple-touch-icon.png +0 -0
  107. /package/public/{react-admin → admin-vanilla}/favicon-16x16.png +0 -0
  108. /package/public/{react-admin → admin-vanilla}/favicon-32x32.png +0 -0
  109. /package/public/{react-admin → admin-vanilla}/favicon.ico +0 -0
  110. /package/public/{react-admin → admin-vanilla}/favicon.png +0 -0
  111. /package/public/{react-admin/chunk-YALWN5OT.js.map → admin-vanilla/main-LYDE4NDJ.css.map} +0 -0
  112. /package/public/{react-admin → admin-vanilla}/missing-favicon.png +0 -0
  113. /package/public/{react-admin → admin-vanilla}/motovun-jack.jpg +0 -0
  114. /package/public/{react-admin → admin-vanilla}/mws-icon.png +0 -0
  115. /package/public/{react-admin → admin-vanilla}/vite.svg +0 -0
  116. /package/public/{react-admin → stats}/stats.css +0 -0
  117. /package/public/{react-admin → stats}/stats.svg +0 -0
@@ -1,87 +1,3 @@
1
- declare module "prisma/global" {
2
- import type { Prisma } from "prisma-client";
3
- global {
4
- namespace PrismaJson {
5
- type Recipes_plugin_names = string[];
6
- type Recipe_bags_partitioned_bags = {
7
- /** partitioned bags allow each user with write access to write to `${title_prefix}${username}` */
8
- title_prefix: string;
9
- /**
10
- * everyone with acl read can read all tiddlers
11
- *
12
- * if this is false, admins can still do this, but they will be in a restricted readonly mode.
13
- */
14
- everyone_readable: boolean;
15
- /**
16
- * everyone with acl write can write normal tiddlers.
17
- *
18
- * site and entity admins can always do this.
19
- */
20
- normally_writable: boolean;
21
- };
22
- }
23
- }
24
- global {
25
- /**
26
- * This primarily makes sure that positional arguments are used correctly
27
- * (so you can't switch a title and bag_name around).
28
- *
29
- * If you assign the wrong value (like `5 as PrismaField<"Bags", "bag_name">`),
30
- * this will result in a type error on the as keyword, allowing you to catch incorrect types quickly.
31
- */
32
- type PrismaField<T extends Prisma.ModelName, K extends keyof PrismaPayloadScalars<T>> = ([
33
- T,
34
- K
35
- ] extends ["Tiddlers", "bag_id"] ? PrismaField<"Bags", "bag_id"> : [
36
- T,
37
- K
38
- ] extends ["Sessions", "user_id"] ? PrismaField<"Users", "user_id"> : [
39
- T,
40
- K
41
- ] extends ["Recipe_bags", "bag_id"] ? PrismaField<"Bags", "bag_id"> : [
42
- T,
43
- K
44
- ] extends ["Recipe_bags", "recipe_id"] ? PrismaField<"Recipes", "recipe_id"> : [
45
- T,
46
- K
47
- ] extends ["Recipes", "owner_id"] ? PrismaField<"Users", "user_id"> : [
48
- T,
49
- K
50
- ] extends ["Bags", "owner_id"] ? PrismaField<"Users", "user_id"> : (PrismaPayloadScalars<T>[K] & {
51
- __prisma_table: T;
52
- __prisma_field: K;
53
- })) | (null extends PrismaPayloadScalars<T>[K] ? null : never);
54
- type PrismaPayloadScalars<T extends Prisma.ModelName> = Prisma.TypeMap["model"][T]["payload"]["scalars"];
55
- }
56
- }
57
- declare module "packages/events/src/index" {
58
- import EventEmitter from "events";
59
- /**
60
- * Server events used throughout the entire server.
61
- *
62
- * To find all references to a specific event, use find all occurrences
63
- * on a usage of the event name string, not on the definition of the event.
64
- */
65
- export interface ServerEventsMap {
66
- }
67
- export class ServerEvents extends EventEmitter<ServerEventsMap> {
68
- /** Use emitAsync instead */
69
- emit: never;
70
- emitAsync<K>(eventName: keyof ServerEventsMap | K, ...args: K extends keyof ServerEventsMap ? ServerEventsMap[K] : never): Promise<void>;
71
- }
72
- /**
73
- * Server events used throughout the entire server.
74
- *
75
- * To find all references to a specific event, use find all occurrences
76
- * on a usage of the event name string.
77
- *
78
- * The listener function is awaited, but the return value is ignored.
79
- *
80
- * If any listener throws, the await rejects, and the error is
81
- * caught by the nearest error handler, if one exists.
82
- */
83
- export const serverEvents: ServerEvents;
84
- }
85
1
  declare module "packages/commander/src/BaseCommand" {
86
2
  import * as commander from "commander";
87
3
  export type CommandClass = {
@@ -132,6 +48,34 @@ declare module "packages/commander/src/BaseCommand" {
132
48
  command?(program: commander.Command): commander.Command;
133
49
  }
134
50
  }
51
+ declare module "packages/events/src/index" {
52
+ import { EventEmitter } from "events";
53
+ /**
54
+ * Server events used throughout the entire server.
55
+ *
56
+ * To find all references to a specific event, use find all occurrences
57
+ * on a usage of the event name string, not on the definition of the event.
58
+ */
59
+ export interface ServerEventsMap {
60
+ }
61
+ export class ServerEvents extends EventEmitter<ServerEventsMap> {
62
+ /** Use emitAsync instead */
63
+ emit: never;
64
+ emitAsync<K>(eventName: keyof ServerEventsMap | K, ...args: K extends keyof ServerEventsMap ? ServerEventsMap[K] : never): Promise<void>;
65
+ }
66
+ /**
67
+ * Server events used throughout the entire server.
68
+ *
69
+ * To find all references to a specific event, use find all occurrences
70
+ * on a usage of the event name string.
71
+ *
72
+ * The listener function is awaited, but the return value is ignored.
73
+ *
74
+ * If any listener throws, the await rejects, and the error is
75
+ * caught by the nearest error handler, if one exists.
76
+ */
77
+ export const serverEvents: ServerEvents;
78
+ }
135
79
  declare module "packages/commander/src/runCLI" {
136
80
  import { BaseCommand, CommandFile } from "packages/commander/src/BaseCommand";
137
81
  import * as commander from "commander";
@@ -166,97 +110,1532 @@ declare module "packages/commander/src/runCLI" {
166
110
  export function runCLI(): Promise<undefined>;
167
111
  }
168
112
  declare module "packages/commander/src/index" {
113
+ import { runCLI } from "packages/commander/src/runCLI";
169
114
  export * from "packages/commander/src/BaseCommand";
170
115
  export * from "packages/commander/src/runCLI";
116
+ export default runCLI;
171
117
  }
172
- declare module "packages/server/src/utils" {
173
- export function is<T>(a: any, b: boolean): a is T;
174
- /** Initiates a timer that must get cancelled before the current turn of the event loop ends */
175
- export class SyncCheck {
176
- done: () => void;
177
- constructor();
118
+ declare module "packages/multipart-parser/src/headers/lib/header-value" {
119
+ export interface HeaderValue {
120
+ toString(): string;
178
121
  }
122
+ }
123
+ declare module "packages/multipart-parser/src/headers/lib/param-values" {
124
+ export function parseParams(input: string, delimiter?: ';' | ','): [string, string | undefined][];
125
+ export function quote(value: string): string;
126
+ }
127
+ declare module "packages/multipart-parser/src/headers/lib/utils" {
128
+ export function capitalize(str: string): string;
129
+ export function isIterable<T>(value: any): value is Iterable<T>;
130
+ export function isValidDate(date: unknown): boolean;
131
+ export function quoteEtag(tag: string): string;
132
+ }
133
+ declare module "packages/multipart-parser/src/headers/lib/accept" {
134
+ import { type HeaderValue } from "packages/multipart-parser/src/headers/lib/header-value";
135
+ export type AcceptInit = Iterable<string | [string, number]> | Record<string, number>;
179
136
  /**
180
- * If any property returns a function, and that function returns a promise,
181
- * the proxy will throw an error if the promise is not awaited before the next property access.
137
+ * The value of a `Accept` HTTP header.
182
138
  *
183
- * The stack trace of the error will point to the line where the promise was returned.
139
+ * [MDN `Accept` Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept)
140
+ *
141
+ * [HTTP/1.1 Specification](https://datatracker.ietf.org/doc/html/rfc7231#section-5.3.2)
184
142
  */
185
- export function createStrictAwaitProxy<T extends object>(instance: T): T;
186
- export function tryParseJSON<T>(json: string): T | undefined;
187
- export class TypedGenerator<T extends [any, any][]> {
188
- private inner;
189
- private index;
190
- static checker<T extends [any, any][]>(): {
191
- /** `const value1 = asV(1, yield asY(0, value0))` */
192
- asV<I extends number>(index: I, args: T[I][0]): T[I][0];
193
- /** `const value1 = asV(1, yield asY(0, value0))` */
194
- asY<I extends number>(index: I, ret: T[I][1]): T[I][1];
195
- };
196
- static wrapper<T extends [any, any][]>(): <A extends any[]>(factory: (...args: A) => Generator<any, any, any>) => (...args: A) => TypedGenerator<T>;
197
- constructor(inner: Generator<any, any, any>, index?: number);
198
- next<I extends number>(index: I, ...args: T[I][0] extends void ? [] : [T[I][0]]): Promise<(T extends [...any[], T[I]] ? IteratorReturnResult<T[I][1]> : IteratorYieldResult<T[I][1]>)>;
199
- return(value: any): any;
200
- throw(e: any): any;
201
- }
202
- export function mapAsync<T, U, V>(array: T[], callback: (this: V, value: T, index: number, array: T[]) => Promise<U>, thisArg?: any): Promise<U[]>;
203
- export function filterAsync<T, V>(array: T[], callback: (this: V, value: T, index: number, array: T[]) => Promise<boolean>, thisArg?: any): Promise<T[]>;
204
- export class UserError extends Error {
205
- constructor(message: string);
143
+ export class Accept implements HeaderValue, Iterable<[string, number]> {
144
+ #private;
145
+ constructor(init?: string | AcceptInit);
146
+ /**
147
+ * An array of all media types in the header.
148
+ */
149
+ get mediaTypes(): string[];
150
+ /**
151
+ * An array of all weights (q values) in the header.
152
+ */
153
+ get weights(): number[];
154
+ /**
155
+ * The number of media types in the `Accept` header.
156
+ */
157
+ get size(): number;
158
+ /**
159
+ * Returns `true` if the header matches the given media type (i.e. it is "acceptable").
160
+ * @param mediaType The media type to check.
161
+ * @returns `true` if the media type is acceptable, `false` otherwise.
162
+ */
163
+ accepts(mediaType: string): boolean;
164
+ /**
165
+ * Gets the weight of a given media type. Also supports wildcards, so e.g. `text/*` will match `text/html`.
166
+ * @param mediaType The media type to get the weight of.
167
+ * @returns The weight of the media type.
168
+ */
169
+ getWeight(mediaType: string): number;
170
+ /**
171
+ * Returns the most preferred media type from the given list of media types.
172
+ * @param mediaTypes The list of media types to choose from.
173
+ * @returns The most preferred media type or `null` if none match.
174
+ */
175
+ getPreferred(mediaTypes: string[]): string | null;
176
+ /**
177
+ * Returns the weight of a media type. If it is not in the header verbatim, this returns `null`.
178
+ * @param mediaType The media type to get the weight of.
179
+ * @returns The weight of the media type, or `null` if it is not in the header.
180
+ */
181
+ get(mediaType: string): number | null;
182
+ /**
183
+ * Sets a media type with the given weight.
184
+ * @param mediaType The media type to set.
185
+ * @param weight The weight of the media type. Defaults to 1.
186
+ */
187
+ set(mediaType: string, weight?: number): void;
188
+ /**
189
+ * Removes the given media type from the header.
190
+ * @param mediaType The media type to remove.
191
+ */
192
+ delete(mediaType: string): void;
193
+ /**
194
+ * Checks if a media type is in the header.
195
+ * @param mediaType The media type to check.
196
+ * @returns `true` if the media type is in the header (verbatim), `false` otherwise.
197
+ */
198
+ has(mediaType: string): boolean;
199
+ /**
200
+ * Removes all media types from the header.
201
+ */
202
+ clear(): void;
203
+ entries(): IterableIterator<[string, number]>;
204
+ [Symbol.iterator](): IterableIterator<[string, number]>;
205
+ forEach(callback: (mediaType: string, weight: number, header: Accept) => void, thisArg?: any): void;
206
+ toString(): string;
206
207
  }
208
+ }
209
+ declare module "packages/multipart-parser/src/headers/lib/accept-encoding" {
210
+ import { type HeaderValue } from "packages/multipart-parser/src/headers/lib/header-value";
211
+ export type AcceptEncodingInit = Iterable<string | [string, number]> | Record<string, number>;
207
212
  /**
208
- * This returns the resolved path relative to the executing code file,
209
- * however it uses path.resolve, not require.resolve.
213
+ * The value of a `Accept-Encoding` HTTP header.
214
+ *
215
+ * [MDN `Accept-Encoding` Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding)
216
+ *
217
+ * [HTTP/1.1 Specification](https://datatracker.ietf.org/doc/html/rfc7231#section-5.3.4)
210
218
  */
211
- export function dist_resolve(filepath: string): string;
212
- export function dist_require_resolve(filepath: string): string;
213
- export interface JsonArray extends Array<JsonValue> {
219
+ export class AcceptEncoding implements HeaderValue, Iterable<[string, number]> {
220
+ #private;
221
+ constructor(init?: string | AcceptEncodingInit);
222
+ /**
223
+ * An array of all encodings in the header.
224
+ */
225
+ get encodings(): string[];
226
+ /**
227
+ * An array of all weights (q values) in the header.
228
+ */
229
+ get weights(): number[];
230
+ /**
231
+ * The number of encodings in the header.
232
+ */
233
+ get size(): number;
234
+ /**
235
+ * Returns `true` if the header matches the given encoding (i.e. it is "acceptable").
236
+ * @param encoding The encoding to check.
237
+ * @returns `true` if the encoding is acceptable, `false` otherwise.
238
+ */
239
+ accepts(encoding: string): boolean;
240
+ /**
241
+ * Gets the weight an encoding. Performs wildcard matching so `*` matches all encodings.
242
+ * @param encoding The encoding to get.
243
+ * @returns The weight of the encoding, or `0` if it is not in the header.
244
+ */
245
+ getWeight(encoding: string): number;
246
+ /**
247
+ * Returns the most preferred encoding from the given list of encodings.
248
+ * @param encodings The encodings to choose from.
249
+ * @returns The most preferred encoding or `null` if none match.
250
+ */
251
+ getPreferred(encodings: string[]): string | null;
252
+ /**
253
+ * Gets the weight of an encoding. If it is not in the header verbatim, this returns `null`.
254
+ * @param encoding The encoding to get.
255
+ * @returns The weight of the encoding, or `null` if it is not in the header.
256
+ */
257
+ get(encoding: string): number | null;
258
+ /**
259
+ * Sets an encoding with the given weight.
260
+ * @param encoding The encoding to set.
261
+ * @param weight The weight of the encoding. Defaults to 1.
262
+ */
263
+ set(encoding: string, weight?: number): void;
264
+ /**
265
+ * Removes the given encoding from the header.
266
+ * @param encoding The encoding to remove.
267
+ */
268
+ delete(encoding: string): void;
269
+ /**
270
+ * Checks if the header contains a given encoding.
271
+ * @param encoding The encoding to check.
272
+ * @returns `true` if the encoding is in the header, `false` otherwise.
273
+ */
274
+ has(encoding: string): boolean;
275
+ /**
276
+ * Removes all encodings from the header.
277
+ */
278
+ clear(): void;
279
+ entries(): IterableIterator<[string, number]>;
280
+ [Symbol.iterator](): IterableIterator<[string, number]>;
281
+ forEach(callback: (encoding: string, weight: number, header: AcceptEncoding) => void, thisArg?: any): void;
282
+ toString(): string;
214
283
  }
215
- export type JsonObject = {
216
- [Key in string]?: JsonValue;
217
- };
218
- export type JsonValue = string | number | boolean | JsonObject | JsonArray | null | Date;
219
284
  }
220
- declare module "packages/server/src/compression" {
221
- /*!
222
- * compression
223
- * Copyright(c) 2010 Sencha Inc.
224
- * Copyright(c) 2011 TJ Holowaychuk
225
- * Copyright(c) 2014 Jonathan Ong
226
- * Copyright(c) 2014-2015 Douglas Christopher Wilson
227
- * MIT Licensed
285
+ declare module "packages/multipart-parser/src/headers/lib/accept-language" {
286
+ import { type HeaderValue } from "packages/multipart-parser/src/headers/lib/header-value";
287
+ export type AcceptLanguageInit = Iterable<string | [string, number]> | Record<string, number>;
288
+ /**
289
+ * The value of a `Accept-Language` HTTP header.
290
+ *
291
+ * [MDN `Accept-Language` Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language)
292
+ *
293
+ * [HTTP/1.1 Specification](https://datatracker.ietf.org/doc/html/rfc7231#section-5.3.5)
228
294
  */
229
- import { DuplexOptions, PassThrough } from "stream";
230
- import zlib, { BrotliOptions, ZlibOptions } from 'zlib';
231
- export interface CompressorOptions {
232
- /** Opts passed to brotli. The default quality param is 4. */
233
- brotli?: BrotliOptions;
234
- /** Opts passed to gzip */
235
- gzip?: ZlibOptions;
236
- /** Opts passed to deflate */
237
- deflate?: ZlibOptions;
238
- /** options to pass to the Passthrough stream used for identity encoding. */
239
- identity?: DuplexOptions;
295
+ export class AcceptLanguage implements HeaderValue, Iterable<[string, number]> {
296
+ #private;
297
+ constructor(init?: string | AcceptLanguageInit);
240
298
  /**
241
- * source threshold below which to skip compression.
242
- * only works if content-length header is set.
243
- *
244
- * If a string, may be any number with a byte suffix (kb, mb, etc).
299
+ * An array of all languages in the header.
245
300
  */
246
- threshold?: number | string;
247
- /** use a specific encoding if the accept-encoding header is not present, defaults to identity */
248
- defaultEncoding?: 'br' | 'gzip' | 'deflate' | 'identity';
301
+ get languages(): string[];
302
+ /**
303
+ * An array of all weights (q values) in the header.
304
+ */
305
+ get weights(): number[];
306
+ /**
307
+ * The number of languages in the header.
308
+ */
309
+ get size(): number;
310
+ /**
311
+ * Returns `true` if the header matches the given language (i.e. it is "acceptable").
312
+ * @param language The locale identifier of the language to check.
313
+ * @returns `true` if the language is acceptable, `false` otherwise.
314
+ */
315
+ accepts(language: string): boolean;
316
+ /**
317
+ * Gets the weight of a language with the given locale identifier. Performs wildcard and subtype
318
+ * matching, so `en` matches `en-US` and `en-GB`, and `*` matches all languages.
319
+ * @param language The locale identifier of the language to get.
320
+ * @returns The weight of the language, or `0` if it is not in the header.
321
+ */
322
+ getWeight(language: string): number;
323
+ /**
324
+ * Returns the most preferred language from the given list of languages.
325
+ * @param languages The locale identifiers of the languages to choose from.
326
+ * @returns The most preferred language or `null` if none match.
327
+ */
328
+ getPreferred(languages: string[]): string | null;
329
+ /**
330
+ * Gets the weight of a language with the given locale identifier. If it is not in the header
331
+ * verbatim, this returns `null`.
332
+ * @param language The locale identifier of the language to get.
333
+ * @returns The weight of the language, or `null` if it is not in the header.
334
+ */
335
+ get(language: string): number | null;
336
+ /**
337
+ * Sets a language with the given weight.
338
+ * @param language The locale identifier of the language to set.
339
+ * @param weight The weight of the language. Defaults to 1.
340
+ */
341
+ set(language: string, weight?: number): void;
342
+ /**
343
+ * Removes a language with the given locale identifier.
344
+ * @param language The locale identifier of the language to remove.
345
+ */
346
+ delete(language: string): void;
347
+ /**
348
+ * Checks if the header contains a language with the given locale identifier.
349
+ * @param language The locale identifier of the language to check.
350
+ * @returns `true` if the language is in the header, `false` otherwise.
351
+ */
352
+ has(language: string): boolean;
353
+ /**
354
+ * Removes all languages from the header.
355
+ */
356
+ clear(): void;
357
+ entries(): IterableIterator<[string, number]>;
358
+ [Symbol.iterator](): IterableIterator<[string, number]>;
359
+ forEach(callback: (language: string, weight: number, header: AcceptLanguage) => void, thisArg?: any): void;
360
+ toString(): string;
249
361
  }
250
- export class Compressor {
251
- private req;
252
- private res;
253
- constructor(req: import("http").IncomingMessage | import("http2").Http2ServerRequest, res: import("http").ServerResponse | import("http2").Http2ServerResponse, { identity, brotli, threshold, defaultEncoding, deflate, gzip }: CompressorOptions);
254
- /** Ends the response. Shortcut for easy removal when switching streams. */
255
- finisher: () => import("http").ServerResponse<import("http").IncomingMessage> | import("http2").Http2ServerResponse<import("http2").Http2ServerRequest>;
256
- enabled: boolean;
257
- method: string;
258
- threshold: any;
259
- defaultEncoding: "deflate" | "gzip" | "br" | "identity";
362
+ }
363
+ declare module "packages/multipart-parser/src/headers/lib/cache-control" {
364
+ import { type HeaderValue } from "packages/multipart-parser/src/headers/lib/header-value";
365
+ export interface CacheControlInit {
366
+ /**
367
+ * The `max-age=N` **request directive** indicates that the client allows a stored response that
368
+ * is generated on the origin server within _N_ seconds — where _N_ may be any non-negative
369
+ * integer (including `0`).
370
+ *
371
+ * The `max-age=N` **response directive** indicates that the response remains
372
+ * [fresh](https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching#fresh_and_stale_based_on_age)
373
+ * until _N_ seconds after the response is generated.
374
+ *
375
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#max-age)
376
+ */
377
+ maxAge?: number;
378
+ /**
379
+ * The `max-stale=N` **request directive** indicates that the client allows a stored response
380
+ * that is [stale](https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching#fresh_and_stale_based_on_age)
381
+ * within _N_ seconds.
382
+ *
383
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#max-stale)
384
+ */
385
+ maxStale?: number;
386
+ /**
387
+ * The `min-fresh=N` **request directive** indicates that the client allows a stored response
388
+ * that is [fresh](https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching#fresh_and_stale_based_on_age)
389
+ * for at least _N_ seconds.
390
+ *
391
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#min-fresh)
392
+ */
393
+ minFresh?: number;
394
+ /**
395
+ * The `s-maxage` **response directive** also indicates how long the response is
396
+ * [fresh](https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching#fresh_and_stale_based_on_age) for (similar to `max-age`) —
397
+ * but it is specific to shared caches, and they will ignore `max-age` when it is present.
398
+ *
399
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage)
400
+ */
401
+ sMaxage?: number;
402
+ /**
403
+ * The `no-cache` **request directive** asks caches to validate the response with the origin
404
+ * server before reuse. If you want caches to always check for content updates while reusing
405
+ * stored content, `no-cache` is the directive to use.
406
+ *
407
+ * The `no-cache` **response directive** indicates that the response can be stored in caches, but
408
+ * the response must be validated with the origin server before each reuse, even when the cache
409
+ * is disconnected from the origin server.
410
+ *
411
+ * `no-cache` allows clients to request the most up-to-date response even if the cache has a
412
+ * [fresh](https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching#fresh_and_stale_based_on_age)
413
+ * response.
414
+ *
415
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#no-cache)
416
+ */
417
+ noCache?: true;
418
+ /**
419
+ * The `no-store` **request directive** allows a client to request that caches refrain from
420
+ * storing the request and corresponding response — even if the origin server's response could
421
+ * be stored.
422
+ *
423
+ * The `no-store` **response directive** indicates that any caches of any kind (private or shared)
424
+ * should not store this response.
425
+ *
426
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#no-store)
427
+ */
428
+ noStore?: true;
429
+ /**
430
+ * `no-transform` indicates that any intermediary (regardless of whether it implements a cache)
431
+ * shouldn't transform the response contents.
432
+ *
433
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#no-transform)
434
+ */
435
+ noTransform?: true;
436
+ /**
437
+ * The client indicates that cache should obtain an already-cached response. If a cache has
438
+ * stored a response, it's reused.
439
+ *
440
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#only-if-cached)
441
+ */
442
+ onlyIfCached?: true;
443
+ /**
444
+ * The `must-revalidate` **response directive** indicates that the response can be stored in
445
+ * caches and can be reused while [fresh](https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching#fresh_and_stale_based_on_age).
446
+ * If the response becomes [stale](https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching#fresh_and_stale_based_on_age),
447
+ * it must be validated with the origin server before reuse.
448
+ *
449
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#must-revalidate)
450
+ */
451
+ mustRevalidate?: true;
452
+ /**
453
+ * The `proxy-revalidate` **response directive** is the equivalent of `must-revalidate`, but
454
+ * specifically for shared caches only.
455
+ *
456
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#proxy-revalidate)
457
+ */
458
+ proxyRevalidate?: true;
459
+ /**
460
+ * The `must-understand` **response directive** indicates that a cache should store the response
461
+ * only if it understands the requirements for caching based on status code.
462
+ *
463
+ * `must-understand` should be coupled with `no-store` for fallback behavior.
464
+ *
465
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#must-understand)
466
+ */
467
+ mustUnderstand?: true;
468
+ /**
469
+ * The `private` **response directive** indicates that the response can be stored only in a
470
+ * private cache (e.g. local caches in browsers).
471
+ *
472
+ * You should add the `private` directive for user-personalized content, especially for responses
473
+ * received after login and for sessions managed via cookies.
474
+ *
475
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#private)
476
+ */
477
+ private?: true;
478
+ /**
479
+ * The `public` **response directive** indicates that the response can be stored in a shared
480
+ * cache. Responses for requests with `Authorization` header fields must not be stored in a
481
+ * shared cache; however, the `public` directive will cause such responses to be stored in a
482
+ * shared cache.
483
+ *
484
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#public)
485
+ */
486
+ public?: true;
487
+ /**
488
+ * The `immutable` **response directive** indicates that the response will not be updated while
489
+ * it's [fresh](https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching#fresh_and_stale_based_on_age).
490
+ *
491
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#public)
492
+ */
493
+ immutable?: true;
494
+ /**
495
+ * The `stale-while-revalidate` **response directive** indicates that the cache could reuse a
496
+ * stale response while it revalidates it to a cache.
497
+ *
498
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate)
499
+ */
500
+ staleWhileRevalidate?: number;
501
+ /**
502
+ * The `stale-if-error` **response directive** indicates that the cache can reuse a
503
+ * [stale response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching#fresh_and_stale_based_on_age)
504
+ * when an upstream server generates an error, or when the error is generated locally. Here, an
505
+ * error is considered any response with a status code of 500, 502, 503, or 504.
506
+ *
507
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error)
508
+ */
509
+ staleIfError?: number;
510
+ }
511
+ /**
512
+ * The value of a `Cache-Control` HTTP header.
513
+ *
514
+ * [MDN `Cache-Control` Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control)
515
+ *
516
+ * [HTTP/1.1 Specification](https://datatracker.ietf.org/doc/html/rfc7234#section-5.2)
517
+ */
518
+ export class CacheControl implements HeaderValue, CacheControlInit {
519
+ maxAge?: number;
520
+ maxStale?: number;
521
+ minFresh?: number;
522
+ sMaxage?: number;
523
+ noCache?: true;
524
+ noStore?: true;
525
+ noTransform?: true;
526
+ onlyIfCached?: true;
527
+ mustRevalidate?: true;
528
+ proxyRevalidate?: true;
529
+ mustUnderstand?: true;
530
+ private?: true;
531
+ public?: true;
532
+ immutable?: true;
533
+ staleWhileRevalidate?: number;
534
+ staleIfError?: number;
535
+ constructor(init?: string | CacheControlInit);
536
+ toString(): string;
537
+ }
538
+ }
539
+ declare module "packages/multipart-parser/src/headers/lib/content-disposition" {
540
+ import { type HeaderValue } from "packages/multipart-parser/src/headers/lib/header-value";
541
+ export interface ContentDispositionInit {
542
+ /**
543
+ * For file uploads, the name of the file that the user selected.
544
+ */
545
+ filename?: string;
546
+ /**
547
+ * For file uploads, the name of the file that the user selected, encoded as a [RFC 8187](https://tools.ietf.org/html/rfc8187) `filename*` parameter.
548
+ * This parameter allows non-ASCII characters in filenames, and specifies the character encoding.
549
+ */
550
+ filenameSplat?: string;
551
+ /**
552
+ * For `multipart/form-data` requests, the name of the `<input>` field associated with this content.
553
+ */
554
+ name?: string;
555
+ /**
556
+ * The disposition type of the content, such as `attachment` or `inline`.
557
+ */
558
+ type?: string;
559
+ }
560
+ /**
561
+ * The value of a `Content-Disposition` HTTP header.
562
+ *
563
+ * [MDN `Content-Disposition` Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition)
564
+ *
565
+ * [RFC 6266](https://tools.ietf.org/html/rfc6266)
566
+ */
567
+ export class ContentDisposition implements HeaderValue, ContentDispositionInit {
568
+ filename?: string;
569
+ filenameSplat?: string;
570
+ name?: string;
571
+ type?: string;
572
+ constructor(init?: string | ContentDispositionInit);
573
+ /**
574
+ * The preferred filename for the content, using the `filename*` parameter if present, falling back to the `filename` parameter.
575
+ *
576
+ * From [RFC 6266](https://tools.ietf.org/html/rfc6266):
577
+ *
578
+ * Many user agent implementations predating this specification do not understand the "filename*" parameter.
579
+ * Therefore, when both "filename" and "filename*" are present in a single header field value, recipients SHOULD
580
+ * pick "filename*" and ignore "filename". This way, senders can avoid special-casing specific user agents by
581
+ * sending both the more expressive "filename*" parameter, and the "filename" parameter as fallback for legacy recipients.
582
+ */
583
+ get preferredFilename(): string | undefined;
584
+ toString(): string;
585
+ }
586
+ }
587
+ declare module "packages/multipart-parser/src/headers/lib/content-type" {
588
+ import { type HeaderValue } from "packages/multipart-parser/src/headers/lib/header-value";
589
+ export interface ContentTypeInit {
590
+ /**
591
+ * For multipart entities, the boundary that separates the different parts of the message.
592
+ */
593
+ boundary?: string;
594
+ /**
595
+ * Indicates the [character encoding](https://developer.mozilla.org/en-US/docs/Glossary/Character_encoding) of the content.
596
+ *
597
+ * For example, `utf-8`, `iso-8859-1`.
598
+ */
599
+ charset?: string;
600
+ /**
601
+ * The media type (or MIME type) of the content. This consists of a type and subtype, separated by a slash.
602
+ *
603
+ * For example, `text/html`, `application/json`, `image/png`.
604
+ *
605
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)
606
+ */
607
+ mediaType?: string;
608
+ }
609
+ /**
610
+ * The value of a `Content-Type` HTTP header.
611
+ *
612
+ * [MDN `Content-Type` Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type)
613
+ *
614
+ * [HTTP/1.1 Specification](https://datatracker.ietf.org/doc/html/rfc7231#section-3.1.1.5)
615
+ */
616
+ export class ContentType implements HeaderValue, ContentTypeInit {
617
+ boundary?: string;
618
+ charset?: string;
619
+ mediaType?: string;
620
+ constructor(init?: string | ContentTypeInit);
621
+ toString(): string;
622
+ }
623
+ }
624
+ declare module "packages/multipart-parser/src/headers/lib/cookie" {
625
+ import { type HeaderValue } from "packages/multipart-parser/src/headers/lib/header-value";
626
+ export type CookieInit = Iterable<[string, string]> | Record<string, string>;
627
+ /**
628
+ * The value of a `Cookie` HTTP header.
629
+ *
630
+ * [MDN `Cookie` Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cookie)
631
+ *
632
+ * [HTTP/1.1 Specification](https://datatracker.ietf.org/doc/html/rfc6265#section-4.2)
633
+ */
634
+ export class Cookie implements HeaderValue, Iterable<[string, string]> {
635
+ #private;
636
+ constructor(init?: string | CookieInit);
637
+ /**
638
+ * An array of the names of the cookies in the header.
639
+ */
640
+ get names(): string[];
641
+ /**
642
+ * An array of the values of the cookies in the header.
643
+ */
644
+ get values(): string[];
645
+ /**
646
+ * The number of cookies in the header.
647
+ */
648
+ get size(): number;
649
+ /**
650
+ * Gets the value of a cookie with the given name from the header.
651
+ * @param name The name of the cookie.
652
+ * @returns The value of the cookie, or `null` if the cookie does not exist.
653
+ */
654
+ get(name: string): string | null;
655
+ /**
656
+ * Sets a cookie with the given name and value in the header.
657
+ * @param name The name of the cookie.
658
+ * @param value The value of the cookie.
659
+ */
660
+ set(name: string, value: string): void;
661
+ /**
662
+ * Removes a cookie with the given name from the header.
663
+ * @param name The name of the cookie.
664
+ */
665
+ delete(name: string): void;
666
+ /**
667
+ * True if a cookie with the given name exists in the header.
668
+ * @param name The name of the cookie.
669
+ * @returns True if a cookie with the given name exists in the header.
670
+ */
671
+ has(name: string): boolean;
672
+ /**
673
+ * Removes all cookies from the header.
674
+ */
675
+ clear(): void;
676
+ entries(): IterableIterator<[string, string]>;
677
+ [Symbol.iterator](): IterableIterator<[string, string]>;
678
+ forEach(callback: (name: string, value: string, header: Cookie) => void, thisArg?: any): void;
679
+ toString(): string;
680
+ }
681
+ }
682
+ declare module "packages/multipart-parser/src/headers/lib/if-none-match" {
683
+ import { type HeaderValue } from "packages/multipart-parser/src/headers/lib/header-value";
684
+ export interface IfNoneMatchInit {
685
+ /**
686
+ * The entity tags to compare against the current entity.
687
+ */
688
+ tags: string[];
689
+ }
690
+ /**
691
+ * The value of an `If-None-Match` HTTP header.
692
+ *
693
+ * [MDN `If-None-Match` Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-None-Match)
694
+ *
695
+ * [HTTP/1.1 Specification](https://datatracker.ietf.org/doc/html/rfc7232#section-3.2)
696
+ */
697
+ export class IfNoneMatch implements HeaderValue, IfNoneMatchInit {
698
+ tags: string[];
699
+ constructor(init?: string | string[] | IfNoneMatchInit);
700
+ /**
701
+ * Checks if the header contains the given entity tag.
702
+ *
703
+ * Note: This method checks only for exact matches and does not consider wildcards.
704
+ *
705
+ * @param tag The entity tag to check for.
706
+ * @returns `true` if the tag is present in the header, `false` otherwise.
707
+ */
708
+ has(tag: string): boolean;
709
+ /**
710
+ * Checks if this header matches the given entity tag.
711
+ *
712
+ * @param tag The entity tag to check for.
713
+ * @returns `true` if the tag is present in the header (or the header contains a wildcard), `false` otherwise.
714
+ */
715
+ matches(tag: string): boolean;
716
+ toString(): string;
717
+ }
718
+ }
719
+ declare module "packages/multipart-parser/src/headers/lib/set-cookie" {
720
+ import { type HeaderValue } from "packages/multipart-parser/src/headers/lib/header-value";
721
+ type SameSiteValue = 'Strict' | 'Lax' | 'None';
722
+ export interface SetCookieInit {
723
+ /**
724
+ * The domain of the cookie. For example, `example.com`.
725
+ *
726
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#domaindomain-value)
727
+ */
728
+ domain?: string;
729
+ /**
730
+ * The expiration date of the cookie. If not specified, the cookie is a session cookie.
731
+ *
732
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#expiresdate)
733
+ */
734
+ expires?: Date;
735
+ /**
736
+ * Indicates this cookie should not be accessible via JavaScript.
737
+ *
738
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#httponly)
739
+ */
740
+ httpOnly?: true;
741
+ /**
742
+ * The maximum age of the cookie in seconds.
743
+ *
744
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#max-age)
745
+ */
746
+ maxAge?: number;
747
+ /**
748
+ * The name of the cookie.
749
+ *
750
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#cookie-namecookie-value)
751
+ */
752
+ name?: string;
753
+ /**
754
+ * The path of the cookie. For example, `/` or `/admin`.
755
+ *
756
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#pathpath-value)
757
+ */
758
+ path?: string;
759
+ /**
760
+ * The `SameSite` attribute of the cookie. This attribute lets servers require that a cookie shouldn't be sent with
761
+ * cross-site requests, which provides some protection against cross-site request forgery attacks.
762
+ *
763
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#samesitesamesite-value)
764
+ */
765
+ sameSite?: SameSiteValue;
766
+ /**
767
+ * Indicates the cookie should only be sent over HTTPS.
768
+ *
769
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#secure)
770
+ */
771
+ secure?: true;
772
+ /**
773
+ * The value of the cookie.
774
+ *
775
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#cookie-namecookie-value)
776
+ */
777
+ value?: string;
778
+ }
779
+ /**
780
+ * The value of a `Set-Cookie` HTTP header.
781
+ *
782
+ * [MDN `Set-Cookie` Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie)
783
+ *
784
+ * [HTTP/1.1 Specification](https://datatracker.ietf.org/doc/html/rfc6265#section-4.1)
785
+ */
786
+ export class SetCookie implements HeaderValue, SetCookieInit {
787
+ domain?: string;
788
+ expires?: Date;
789
+ httpOnly?: true;
790
+ maxAge?: number;
791
+ name?: string;
792
+ path?: string;
793
+ sameSite?: SameSiteValue;
794
+ secure?: true;
795
+ value?: string;
796
+ constructor(init?: string | SetCookieInit);
797
+ toString(): string;
798
+ }
799
+ }
800
+ declare module "packages/multipart-parser/src/headers/lib/header-names" {
801
+ export function canonicalHeaderName(name: string): string;
802
+ }
803
+ declare module "packages/multipart-parser/src/headers/lib/super-headers" {
804
+ import { type AcceptInit, Accept } from "packages/multipart-parser/src/headers/lib/accept";
805
+ import { type AcceptEncodingInit, AcceptEncoding } from "packages/multipart-parser/src/headers/lib/accept-encoding";
806
+ import { type AcceptLanguageInit, AcceptLanguage } from "packages/multipart-parser/src/headers/lib/accept-language";
807
+ import { type CacheControlInit, CacheControl } from "packages/multipart-parser/src/headers/lib/cache-control";
808
+ import { type ContentDispositionInit, ContentDisposition } from "packages/multipart-parser/src/headers/lib/content-disposition";
809
+ import { type ContentTypeInit, ContentType } from "packages/multipart-parser/src/headers/lib/content-type";
810
+ import { type CookieInit, Cookie } from "packages/multipart-parser/src/headers/lib/cookie";
811
+ import { type HeaderValue } from "packages/multipart-parser/src/headers/lib/header-value";
812
+ import { type IfNoneMatchInit, IfNoneMatch } from "packages/multipart-parser/src/headers/lib/if-none-match";
813
+ import { type SetCookieInit, SetCookie } from "packages/multipart-parser/src/headers/lib/set-cookie";
814
+ type DateInit = number | Date;
815
+ interface SuperHeadersPropertyInit {
816
+ /**
817
+ * The [`Accept`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept) header value.
818
+ */
819
+ accept?: string | AcceptInit;
820
+ /**
821
+ * The [`Accept-Encoding`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding) header value.
822
+ */
823
+ acceptEncoding?: string | AcceptEncodingInit;
824
+ /**
825
+ * The [`Accept-Language`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language) header value.
826
+ */
827
+ acceptLanguage?: string | AcceptLanguageInit;
828
+ /**
829
+ * The [`Accept-Ranges`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Ranges) header value.
830
+ */
831
+ acceptRanges?: string;
832
+ /**
833
+ * The [`Age`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Age) header value.
834
+ */
835
+ age?: string | number;
836
+ /**
837
+ * The [`Cache-Control`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control) header value.
838
+ */
839
+ cacheControl?: string | CacheControlInit;
840
+ /**
841
+ * The [`Connection`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Connection) header value.
842
+ */
843
+ connection?: string;
844
+ /**
845
+ * The [`Content-Disposition`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition) header value.
846
+ */
847
+ contentDisposition?: string | ContentDispositionInit;
848
+ /**
849
+ * The [`Content-Encoding`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding) header value.
850
+ */
851
+ contentEncoding?: string | string[];
852
+ /**
853
+ * The [`Content-Language`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Language) header value.
854
+ */
855
+ contentLanguage?: string | string[];
856
+ /**
857
+ * The [`Content-Length`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Length) header value.
858
+ */
859
+ contentLength?: string | number;
860
+ /**
861
+ * The [`Content-Type`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type) header value.
862
+ */
863
+ contentType?: string | ContentTypeInit;
864
+ /**
865
+ * The [`Cookie`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cookie) header value.
866
+ */
867
+ cookie?: string | CookieInit;
868
+ /**
869
+ * The [`Date`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Date) header value.
870
+ */
871
+ date?: string | DateInit;
872
+ /**
873
+ * The [`ETag`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) header value.
874
+ */
875
+ etag?: string;
876
+ /**
877
+ * The [`Expires`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expires) header value.
878
+ */
879
+ expires?: string | DateInit;
880
+ /**
881
+ * The [`Host`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Host) header value.
882
+ */
883
+ host?: string;
884
+ /**
885
+ * The [`If-Modified-Since`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Modified-Since) header value.
886
+ */
887
+ ifModifiedSince?: string | DateInit;
888
+ /**
889
+ * The [`If-None-Match`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-None-Match) header value.
890
+ */
891
+ ifNoneMatch?: string | string[] | IfNoneMatchInit;
892
+ /**
893
+ * The [`If-Unmodified-Since`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Unmodified-Since) header value.
894
+ */
895
+ ifUnmodifiedSince?: string | DateInit;
896
+ /**
897
+ * The [`Last-Modified`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Last-Modified) header value.
898
+ */
899
+ lastModified?: string | DateInit;
900
+ /**
901
+ * The [`Location`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Location) header value.
902
+ */
903
+ location?: string;
904
+ /**
905
+ * The [`Referer`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referer) header value.
906
+ */
907
+ referer?: string;
908
+ /**
909
+ * The [`Set-Cookie`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie) header value(s).
910
+ */
911
+ setCookie?: string | (string | SetCookieInit)[];
912
+ }
913
+ export type SuperHeadersInit = Iterable<[string, string]> | (SuperHeadersPropertyInit & Record<string, string | HeaderValue>);
914
+ /**
915
+ * An enhanced JavaScript `Headers` interface with type-safe access.
916
+ *
917
+ * [API Reference](https://github.com/mjackson/remix-the-web/tree/main/packages/headers)
918
+ *
919
+ * [MDN `Headers` Base Class Reference](https://developer.mozilla.org/en-US/docs/Web/API/Headers)
920
+ */
921
+ export class SuperHeaders extends Headers {
922
+ #private;
923
+ constructor(init?: string | SuperHeadersInit | Headers);
924
+ /**
925
+ * Appends a new header value to the existing set of values for a header,
926
+ * or adds the header if it does not already exist.
927
+ *
928
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/Headers/append)
929
+ */
930
+ append(name: string, value: string): void;
931
+ /**
932
+ * Removes a header.
933
+ *
934
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/Headers/delete)
935
+ */
936
+ delete(name: string): void;
937
+ /**
938
+ * Returns a string of all the values for a header, or `null` if the header does not exist.
939
+ *
940
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/Headers/get)
941
+ */
942
+ get(name: string): string | null;
943
+ /**
944
+ * Returns an array of all values associated with the `Set-Cookie` header. This is
945
+ * useful when building headers for a HTTP response since multiple `Set-Cookie` headers
946
+ * must be sent on separate lines.
947
+ *
948
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/Headers/getSetCookie)
949
+ */
950
+ getSetCookie(): string[];
951
+ /**
952
+ * Returns `true` if the header is present in the list of headers.
953
+ *
954
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/Headers/has)
955
+ */
956
+ has(name: string): boolean;
957
+ /**
958
+ * Sets a new value for the given header. If the header already exists, the new value
959
+ * will replace the existing value.
960
+ *
961
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/Headers/set)
962
+ */
963
+ set(name: string, value: string): void;
964
+ /**
965
+ * Returns an iterator of all header keys (lowercase).
966
+ *
967
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/Headers/keys)
968
+ */
969
+ keys(): IterableIterator<string>;
970
+ /**
971
+ * Returns an iterator of all header values.
972
+ *
973
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/Headers/values)
974
+ */
975
+ values(): IterableIterator<string>;
976
+ /**
977
+ * Returns an iterator of all header key/value pairs.
978
+ *
979
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/Headers/entries)
980
+ */
981
+ entries(): IterableIterator<[string, string]>;
982
+ [Symbol.iterator](): IterableIterator<[string, string]>;
983
+ /**
984
+ * Invokes the `callback` for each header key/value pair.
985
+ *
986
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/Headers/forEach)
987
+ */
988
+ forEach(callback: (value: string, key: string, headers: SuperHeaders) => void, thisArg?: any): void;
989
+ /**
990
+ * Returns a string representation of the headers suitable for use in a HTTP message.
991
+ */
992
+ toString(): string;
993
+ /**
994
+ * The `Accept` header is used by clients to indicate the media types that are acceptable
995
+ * in the response.
996
+ *
997
+ * [MDN `Accept` Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept)
998
+ *
999
+ * [HTTP/1.1 Specification](https://datatracker.ietf.org/doc/html/rfc7231#section-5.3.2)
1000
+ */
1001
+ get accept(): Accept;
1002
+ set accept(value: string | AcceptInit | undefined | null);
1003
+ /**
1004
+ * The `Accept-Encoding` header contains information about the content encodings that the client
1005
+ * is willing to accept in the response.
1006
+ *
1007
+ * [MDN `Accept-Encoding` Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding)
1008
+ *
1009
+ * [HTTP/1.1 Specification](https://datatracker.ietf.org/doc/html/rfc7231#section-5.3.4)
1010
+ */
1011
+ get acceptEncoding(): AcceptEncoding;
1012
+ set acceptEncoding(value: string | AcceptEncodingInit | undefined | null);
1013
+ /**
1014
+ * The `Accept-Language` header contains information about preferred natural language for the
1015
+ * response.
1016
+ *
1017
+ * [MDN `Accept-Language` Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language)
1018
+ *
1019
+ * [HTTP/1.1 Specification](https://datatracker.ietf.org/doc/html/rfc7231#section-5.3.5)
1020
+ */
1021
+ get acceptLanguage(): AcceptLanguage;
1022
+ set acceptLanguage(value: string | AcceptLanguageInit | undefined | null);
1023
+ /**
1024
+ * The `Accept-Ranges` header indicates the server's acceptance of range requests.
1025
+ *
1026
+ * [MDN `Accept-Ranges` Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Ranges)
1027
+ *
1028
+ * [HTTP/1.1 Specification](https://datatracker.ietf.org/doc/html/rfc7233#section-2.3)
1029
+ */
1030
+ get acceptRanges(): string | null;
1031
+ set acceptRanges(value: string | undefined | null);
1032
+ /**
1033
+ * The `Age` header contains the time in seconds an object was in a proxy cache.
1034
+ *
1035
+ * [MDN `Age` Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Age)
1036
+ *
1037
+ * [HTTP/1.1 Specification](https://datatracker.ietf.org/doc/html/rfc7234#section-5.1)
1038
+ */
1039
+ get age(): number | null;
1040
+ set age(value: string | number | undefined | null);
1041
+ /**
1042
+ * The `Cache-Control` header contains directives for caching mechanisms in both requests and responses.
1043
+ *
1044
+ * [MDN `Cache-Control` Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control)
1045
+ *
1046
+ * [HTTP/1.1 Specification](https://datatracker.ietf.org/doc/html/rfc7234#section-5.2)
1047
+ */
1048
+ get cacheControl(): CacheControl;
1049
+ set cacheControl(value: string | CacheControlInit | undefined | null);
1050
+ /**
1051
+ * The `Connection` header controls whether the network connection stays open after the current
1052
+ * transaction finishes.
1053
+ *
1054
+ * [MDN `Connection` Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Connection)
1055
+ *
1056
+ * [HTTP/1.1 Specification](https://datatracker.ietf.org/doc/html/rfc7230#section-6.1)
1057
+ */
1058
+ get connection(): string | null;
1059
+ set connection(value: string | undefined | null);
1060
+ /**
1061
+ * The `Content-Disposition` header is a response-type header that describes how the payload is displayed.
1062
+ *
1063
+ * [MDN `Content-Disposition` Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition)
1064
+ *
1065
+ * [RFC 6266](https://datatracker.ietf.org/doc/html/rfc6266)
1066
+ */
1067
+ get contentDisposition(): ContentDisposition;
1068
+ set contentDisposition(value: string | ContentDispositionInit | undefined | null);
1069
+ /**
1070
+ * The `Content-Encoding` header specifies the encoding of the resource.
1071
+ *
1072
+ * Note: If multiple encodings have been used, this value may be a comma-separated list. However, most often this
1073
+ * header will only contain a single value.
1074
+ *
1075
+ * [MDN `Content-Encoding` Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding)
1076
+ *
1077
+ * [HTTP/1.1 Specification](https://httpwg.org/specs/rfc9110.html#field.content-encoding)
1078
+ */
1079
+ get contentEncoding(): string | null;
1080
+ set contentEncoding(value: string | string[] | undefined | null);
1081
+ /**
1082
+ * The `Content-Language` header describes the natural language(s) of the intended audience for the response content.
1083
+ *
1084
+ * Note: If the response content is intended for multiple audiences, this value may be a comma-separated list. However,
1085
+ * most often this header will only contain a single value.
1086
+ *
1087
+ * [MDN `Content-Language` Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Language)
1088
+ *
1089
+ * [HTTP/1.1 Specification](https://httpwg.org/specs/rfc9110.html#field.content-language)
1090
+ */
1091
+ get contentLanguage(): string | null;
1092
+ set contentLanguage(value: string | string[] | undefined | null);
1093
+ /**
1094
+ * The `Content-Length` header indicates the size of the entity-body in bytes.
1095
+ *
1096
+ * [MDN `Content-Length` Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Length)
1097
+ *
1098
+ * [HTTP/1.1 Specification](https://datatracker.ietf.org/doc/html/rfc7230#section-3.3.2)
1099
+ */
1100
+ get contentLength(): number | null;
1101
+ set contentLength(value: string | number | undefined | null);
1102
+ /**
1103
+ * The `Content-Type` header indicates the media type of the resource.
1104
+ *
1105
+ * [MDN `Content-Type` Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type)
1106
+ *
1107
+ * [HTTP/1.1 Specification](https://datatracker.ietf.org/doc/html/rfc7231#section-3.1.1.5)
1108
+ */
1109
+ get contentType(): ContentType;
1110
+ set contentType(value: string | ContentTypeInit | undefined | null);
1111
+ /**
1112
+ * The `Cookie` request header contains stored HTTP cookies previously sent by the server with
1113
+ * the `Set-Cookie` header.
1114
+ *
1115
+ * [MDN `Cookie` Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cookie)
1116
+ *
1117
+ * [HTTP/1.1 Specification](https://datatracker.ietf.org/doc/html/rfc6265#section-5.4)
1118
+ */
1119
+ get cookie(): Cookie;
1120
+ set cookie(value: string | CookieInit | undefined | null);
1121
+ /**
1122
+ * The `Date` header contains the date and time at which the message was sent.
1123
+ *
1124
+ * [MDN `Date` Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Date)
1125
+ *
1126
+ * [HTTP/1.1 Specification](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.2)
1127
+ */
1128
+ get date(): Date | null;
1129
+ set date(value: string | DateInit | undefined | null);
1130
+ /**
1131
+ * The `ETag` header provides a unique identifier for the current version of the resource.
1132
+ *
1133
+ * [MDN `ETag` Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag)
1134
+ *
1135
+ * [HTTP/1.1 Specification](https://datatracker.ietf.org/doc/html/rfc7232#section-2.3)
1136
+ */
1137
+ get etag(): string | null;
1138
+ set etag(value: string | undefined | null);
1139
+ /**
1140
+ * The `Expires` header contains the date/time after which the response is considered stale.
1141
+ *
1142
+ * [MDN `Expires` Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expires)
1143
+ *
1144
+ * [HTTP/1.1 Specification](https://datatracker.ietf.org/doc/html/rfc7234#section-5.3)
1145
+ */
1146
+ get expires(): Date | null;
1147
+ set expires(value: string | DateInit | undefined | null);
1148
+ /**
1149
+ * The `Host` header specifies the domain name of the server and (optionally) the TCP port number.
1150
+ *
1151
+ * [MDN `Host` Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Host)
1152
+ *
1153
+ * [HTTP/1.1 Specification](https://datatracker.ietf.org/doc/html/rfc7230#section-5.4)
1154
+ */
1155
+ get host(): string | null;
1156
+ set host(value: string | undefined | null);
1157
+ /**
1158
+ * The `If-Modified-Since` header makes a request conditional on the last modification date of the
1159
+ * requested resource.
1160
+ *
1161
+ * [MDN `If-Modified-Since` Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Modified-Since)
1162
+ *
1163
+ * [HTTP/1.1 Specification](https://datatracker.ietf.org/doc/html/rfc7232#section-3.3)
1164
+ */
1165
+ get ifModifiedSince(): Date | null;
1166
+ set ifModifiedSince(value: string | DateInit | undefined | null);
1167
+ /**
1168
+ * The `If-None-Match` header makes a request conditional on the absence of a matching ETag.
1169
+ *
1170
+ * [MDN `If-None-Match` Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-None-Match)
1171
+ *
1172
+ * [HTTP/1.1 Specification](https://datatracker.ietf.org/doc/html/rfc7232#section-3.2)
1173
+ */
1174
+ get ifNoneMatch(): IfNoneMatch;
1175
+ set ifNoneMatch(value: string | string[] | IfNoneMatchInit | undefined | null);
1176
+ /**
1177
+ * The `If-Unmodified-Since` header makes a request conditional on the last modification date of the
1178
+ * requested resource.
1179
+ *
1180
+ * [MDN `If-Unmodified-Since` Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Unmodified-Since)
1181
+ *
1182
+ * [HTTP/1.1 Specification](https://datatracker.ietf.org/doc/html/rfc7232#section-3.4)
1183
+ */
1184
+ get ifUnmodifiedSince(): Date | null;
1185
+ set ifUnmodifiedSince(value: string | DateInit | undefined | null);
1186
+ /**
1187
+ * The `Last-Modified` header contains the date and time at which the resource was last modified.
1188
+ *
1189
+ * [MDN `Last-Modified` Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Last-Modified)
1190
+ *
1191
+ * [HTTP/1.1 Specification](https://datatracker.ietf.org/doc/html/rfc7232#section-2.2)
1192
+ */
1193
+ get lastModified(): Date | null;
1194
+ set lastModified(value: string | DateInit | undefined | null);
1195
+ /**
1196
+ * The `Location` header indicates the URL to redirect to.
1197
+ *
1198
+ * [MDN `Location` Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Location)
1199
+ *
1200
+ * [HTTP/1.1 Specification](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.2)
1201
+ */
1202
+ get location(): string | null;
1203
+ set location(value: string | undefined | null);
1204
+ /**
1205
+ * The `Referer` header contains the address of the previous web page from which a link to the
1206
+ * currently requested page was followed.
1207
+ *
1208
+ * [MDN `Referer` Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referer)
1209
+ *
1210
+ * [HTTP/1.1 Specification](https://datatracker.ietf.org/doc/html/rfc7231#section-5.5.2)
1211
+ */
1212
+ get referer(): string | null;
1213
+ set referer(value: string | undefined | null);
1214
+ /**
1215
+ * The `Set-Cookie` header is used to send cookies from the server to the user agent.
1216
+ *
1217
+ * [MDN `Set-Cookie` Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie)
1218
+ *
1219
+ * [HTTP/1.1 Specification](https://datatracker.ietf.org/doc/html/rfc6265#section-4.1)
1220
+ */
1221
+ get setCookie(): SetCookie[];
1222
+ set setCookie(value: (string | SetCookieInit)[] | string | SetCookieInit | undefined | null);
1223
+ }
1224
+ }
1225
+ declare module "packages/multipart-parser/src/headers/index" {
1226
+ export { type AcceptInit, Accept } from "packages/multipart-parser/src/headers/lib/accept";
1227
+ export { type AcceptEncodingInit, AcceptEncoding } from "packages/multipart-parser/src/headers/lib/accept-encoding";
1228
+ export { type AcceptLanguageInit, AcceptLanguage } from "packages/multipart-parser/src/headers/lib/accept-language";
1229
+ export { type CacheControlInit, CacheControl } from "packages/multipart-parser/src/headers/lib/cache-control";
1230
+ export { type ContentDispositionInit, ContentDisposition } from "packages/multipart-parser/src/headers/lib/content-disposition";
1231
+ export { type ContentTypeInit, ContentType } from "packages/multipart-parser/src/headers/lib/content-type";
1232
+ export { type CookieInit, Cookie } from "packages/multipart-parser/src/headers/lib/cookie";
1233
+ export { type IfNoneMatchInit, IfNoneMatch } from "packages/multipart-parser/src/headers/lib/if-none-match";
1234
+ export { type SetCookieInit, SetCookie } from "packages/multipart-parser/src/headers/lib/set-cookie";
1235
+ export { type SuperHeadersInit, SuperHeaders, SuperHeaders as default, } from "packages/multipart-parser/src/headers/lib/super-headers";
1236
+ }
1237
+ declare module "packages/multipart-parser/src/lib/read-stream" {
1238
+ export function readStream(stream: ReadableStream<Uint8Array>): AsyncIterable<Uint8Array>;
1239
+ }
1240
+ declare module "packages/multipart-parser/src/lib/buffer-search" {
1241
+ export interface SearchFunction {
1242
+ (haystack: Uint8Array, start?: number): number;
1243
+ }
1244
+ export function createSearch(pattern: string): SearchFunction;
1245
+ export interface PartialTailSearchFunction {
1246
+ (haystack: Uint8Array): number;
1247
+ }
1248
+ export function createPartialTailSearch(pattern: string): PartialTailSearchFunction;
1249
+ }
1250
+ declare module "packages/multipart-parser/src/lib/multipart" {
1251
+ import Headers from "packages/multipart-parser/src/headers/index";
1252
+ /**
1253
+ * The base class for errors thrown by the multipart parser.
1254
+ */
1255
+ export class MultipartParseError extends Error {
1256
+ constructor(message: string);
1257
+ }
1258
+ /**
1259
+ * An error thrown when the maximum allowed size of a header is exceeded.
1260
+ */
1261
+ export class MaxHeaderSizeExceededError extends MultipartParseError {
1262
+ constructor(maxHeaderSize: number);
1263
+ }
1264
+ /**
1265
+ * An error thrown when the maximum allowed size of a file is exceeded.
1266
+ */
1267
+ export class MaxFileSizeExceededError extends MultipartParseError {
1268
+ constructor(maxFileSize: number);
1269
+ }
1270
+ export interface ParseMultipartOptions {
1271
+ /**
1272
+ * The boundary string used to separate parts in the multipart message,
1273
+ * e.g. the `boundary` parameter in the `Content-Type` header.
1274
+ */
1275
+ boundary: string;
1276
+ /**
1277
+ * The maximum allowed size of a header in bytes. If an individual part's header
1278
+ * exceeds this size, a `MaxHeaderSizeExceededError` will be thrown.
1279
+ *
1280
+ * Default: 8 KiB
1281
+ */
1282
+ maxHeaderSize?: number;
1283
+ /**
1284
+ * The maximum allowed size of a file in bytes. If an individual part's content
1285
+ * exceeds this size, a `MaxFileSizeExceededError` will be thrown.
1286
+ *
1287
+ * Default: 2 MiB
1288
+ */
1289
+ maxFileSize?: number;
1290
+ useContentPart?: boolean;
1291
+ onCreatePart?(part: MultipartPart): void;
1292
+ }
1293
+ /**
1294
+ * Parse a `multipart/*` message from a buffer/iterable and yield each part as a `MultipartPart` object.
1295
+ *
1296
+ * Note: This is a low-level API that requires manual handling of the content and boundary. If you're
1297
+ * building a web server, consider using `parseMultipartRequest(request)` instead.
1298
+ *
1299
+ * @param message The multipart message as a `Uint8Array` or an iterable of `Uint8Array` chunks
1300
+ * @param options Options for the parser
1301
+ * @return A generator that yields `MultipartPart` objects
1302
+ */
1303
+ export function parseMultipart(message: Uint8Array | Iterable<Uint8Array>, options: ParseMultipartOptions): Generator<MultipartPart, void, unknown>;
1304
+ /**
1305
+ * Parse a `multipart/*` message stream and yield each part as a `MultipartPart` object.
1306
+ *
1307
+ * Note: This is a low-level API that requires manual handling of the content and boundary. If you're
1308
+ * building a web server, consider using `parseMultipartRequest(request)` instead.
1309
+ *
1310
+ * @param stream A stream containing multipart data as a `ReadableStream<Uint8Array>`
1311
+ * @param options Options for the parser
1312
+ * @return An async generator that yields `MultipartPart` objects
1313
+ */
1314
+ export function parseMultipartStream(stream: ReadableStream<Uint8Array>, options: ParseMultipartOptions): AsyncGenerator<MultipartPart, void, unknown>;
1315
+ export type MultipartParserOptions = Omit<ParseMultipartOptions, 'boundary'>;
1316
+ /**
1317
+ * A streaming parser for `multipart/*` HTTP messages.
1318
+ */
1319
+ export class MultipartParser {
1320
+ #private;
1321
+ readonly boundary: string;
1322
+ readonly maxHeaderSize: number;
1323
+ readonly maxFileSize: number;
1324
+ constructor(boundary: string, options?: MultipartParserOptions);
1325
+ /**
1326
+ * Write a chunk of data to the parser.
1327
+ *
1328
+ * @param chunk A chunk of data to write to the parser
1329
+ * @return A generator yielding `MultipartPart` objects as they are parsed
1330
+ */
1331
+ write(chunk: Uint8Array): Generator<MultipartPart, void, unknown>;
1332
+ /**
1333
+ * Should be called after all data has been written to the parser.
1334
+ *
1335
+ * Note: This will throw if the multipart message is incomplete or
1336
+ * wasn't properly terminated.
1337
+ *
1338
+ * @return void
1339
+ */
1340
+ finish(): void;
1341
+ }
1342
+ export type MultipartContentFields = "bytes" | "size" | "text" | "arrayBuffer";
1343
+ /**
1344
+ * A part of a `multipart/*` HTTP message.
1345
+ */
1346
+ export class MultipartPart {
1347
+ #private;
1348
+ constructor(header: Uint8Array);
1349
+ append(chunk: Uint8Array): void;
1350
+ /**
1351
+ * The headers associated with this part.
1352
+ */
1353
+ get headers(): Headers;
1354
+ /**
1355
+ * True if this part originated from a file upload.
1356
+ */
1357
+ get isFile(): boolean;
1358
+ /**
1359
+ * True if this part originated from a text input field in a form submission.
1360
+ */
1361
+ get isText(): boolean;
1362
+ /**
1363
+ * The filename of the part, if it is a file upload.
1364
+ */
1365
+ get filename(): string | undefined;
1366
+ /**
1367
+ * The media type of the part.
1368
+ */
1369
+ get mediaType(): string | undefined;
1370
+ /**
1371
+ * The name of the part, usually the `name` of the field in the `<form>` that submitted the request.
1372
+ */
1373
+ get name(): string | undefined;
1374
+ }
1375
+ export class MultipartContentPart extends MultipartPart {
1376
+ /**
1377
+ * The raw content of this part as an array of `Uint8Array` chunks.
1378
+ */
1379
+ readonly content: Uint8Array[];
1380
+ constructor(header: Uint8Array, content: Uint8Array[]);
1381
+ append(chunk: Uint8Array): void;
1382
+ /**
1383
+ * The content of this part as an `ArrayBuffer`.
1384
+ */
1385
+ get arrayBuffer(): ArrayBuffer;
1386
+ /**
1387
+ * The content of this part as a single `Uint8Array`. In `multipart/form-data` messages, this is useful
1388
+ * for reading the value of files that were uploaded using `<input type="file">` fields.
1389
+ */
1390
+ get bytes(): Uint8Array;
1391
+ /**
1392
+ * The size of the content in bytes.
1393
+ */
1394
+ get size(): number;
1395
+ /**
1396
+ * The content of this part as a string. In `multipart/form-data` messages, this is useful for
1397
+ * reading the value of parts that originated from `<input type="text">` fields.
1398
+ *
1399
+ * Note: Do not use this for binary data, use `part.bytes` or `part.arrayBuffer` instead.
1400
+ */
1401
+ get text(): string;
1402
+ }
1403
+ }
1404
+ declare module "packages/multipart-parser/src/lib/multipart-request" {
1405
+ import type { MultipartParserOptions, MultipartPart } from "packages/multipart-parser/src/lib/multipart";
1406
+ /**
1407
+ * Extracts the boundary string from a `multipart/*` content type.
1408
+ *
1409
+ * @param contentType The `Content-Type` header value from the request
1410
+ * @return The boundary string if found, or null if not present
1411
+ */
1412
+ export function getMultipartBoundary(contentType: string): string | null;
1413
+ /**
1414
+ * Returns true if the given request contains multipart data.
1415
+ *
1416
+ * @param request The `Request` object to check
1417
+ * @return `true` if the request is a multipart request, `false` otherwise
1418
+ */
1419
+ export function isMultipartRequest(request: Request): boolean;
1420
+ /**
1421
+ * Returns true if the given request is a multipart request.
1422
+ *
1423
+ * @param req The Node.js `http.IncomingMessage` object to check
1424
+ * @return `true` if the request is a multipart request, `false` otherwise
1425
+ */
1426
+ export function isMultipartRequestHeader(contentTypeHeader: string | null | undefined): boolean;
1427
+ /**
1428
+ * Parse a multipart [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request) and yield each part as
1429
+ * a `MultipartPart` object. Useful in HTTP server contexts for handling incoming `multipart/*` requests.
1430
+ *
1431
+ * @param request The `Request` object containing multipart data
1432
+ * @param options Optional parser options, such as `maxHeaderSize` and `maxFileSize`
1433
+ * @return An async generator yielding `MultipartPart` objects
1434
+ */
1435
+ export function parseMultipartRequest(request: Request, options?: MultipartParserOptions): AsyncGenerator<MultipartPart, void, unknown>;
1436
+ }
1437
+ declare module "packages/multipart-parser/src/lib/multipart.node" {
1438
+ import type * as http from 'node:http';
1439
+ import { Readable } from 'node:stream';
1440
+ import type { ParseMultipartOptions, MultipartParserOptions, MultipartPart } from "packages/multipart-parser/src/lib/multipart";
1441
+ /**
1442
+ * Parse a `multipart/*` Node.js `Buffer` and yield each part as a `MultipartPart` object.
1443
+ *
1444
+ * Note: This is a low-level API that requires manual handling of the content and boundary. If you're
1445
+ * building a web server, consider using `parseMultipartRequest(request)` instead.
1446
+ *
1447
+ * @param message The multipart message as a `Buffer` or an iterable of `Buffer` chunks
1448
+ * @param options Options for the parser
1449
+ * @return A generator yielding `MultipartPart` objects
1450
+ */
1451
+ export function parseMultipart(message: Buffer | Iterable<Buffer>, options: ParseMultipartOptions): Generator<MultipartPart, void, unknown>;
1452
+ /**
1453
+ * Parse a `multipart/*` Node.js `Readable` stream and yield each part as a `MultipartPart` object.
1454
+ *
1455
+ * Note: This is a low-level API that requires manual handling of the stream and boundary. If you're
1456
+ * building a web server, consider using `parseMultipartRequest(request)` instead.
1457
+ *
1458
+ * @param stream A Node.js `Readable` stream containing multipart data
1459
+ * @param options Options for the parser
1460
+ * @return An async generator yielding `MultipartPart` objects
1461
+ */
1462
+ export function parseMultipartStream(stream: Readable, options: ParseMultipartOptions): AsyncGenerator<MultipartPart, void, unknown>;
1463
+ /**
1464
+ * Returns true if the given request is a multipart request.
1465
+ *
1466
+ * @param req The Node.js `http.IncomingMessage` object to check
1467
+ * @return `true` if the request is a multipart request, `false` otherwise
1468
+ */
1469
+ export function isMultipartRequest(req: http.IncomingMessage): boolean;
1470
+ /**
1471
+ * Parse a multipart Node.js request and yield each part as a `MultipartPart` object.
1472
+ *
1473
+ * @param req The Node.js `http.IncomingMessage` object containing multipart data
1474
+ * @param options Options for the parser
1475
+ * @return An async generator yielding `MultipartPart` objects
1476
+ */
1477
+ export function parseMultipartRequest(req: http.IncomingMessage, options?: MultipartParserOptions): AsyncGenerator<MultipartPart, void, unknown>;
1478
+ }
1479
+ declare module "packages/multipart-parser/src/index" {
1480
+ export type { ParseMultipartOptions, MultipartParserOptions } from "packages/multipart-parser/src/lib/multipart";
1481
+ export { MultipartParseError, MaxHeaderSizeExceededError, MaxFileSizeExceededError, MultipartParser, MultipartPart, } from "packages/multipart-parser/src/lib/multipart";
1482
+ export { parseMultipart, parseMultipartStream, } from "packages/multipart-parser/src/lib/multipart";
1483
+ export { isMultipartRequest, isMultipartRequestHeader, getMultipartBoundary, parseMultipartRequest, } from "packages/multipart-parser/src/lib/multipart-request";
1484
+ export { isMultipartRequest as isNodeMultipartRequest, parseMultipartRequest as parseNodeMultipartRequest, parseMultipart as parseNodeMultipart, parseMultipartStream as parseNodeMultipartStream } from "packages/multipart-parser/src/lib/multipart.node";
1485
+ export * from "packages/multipart-parser/src/headers/index";
1486
+ }
1487
+ declare module "packages/multipart-parser/src/multipart-parser.node" {
1488
+ export type { ParseMultipartOptions, MultipartParserOptions } from "packages/multipart-parser/src/lib/multipart";
1489
+ export { MultipartParseError, MaxHeaderSizeExceededError, MaxFileSizeExceededError, MultipartParser, MultipartPart, } from "packages/multipart-parser/src/lib/multipart";
1490
+ export { getMultipartBoundary } from "packages/multipart-parser/src/lib/multipart-request";
1491
+ export { isMultipartRequest, parseMultipartRequest, parseMultipart, parseMultipartStream } from "packages/multipart-parser/src/lib/multipart.node";
1492
+ }
1493
+ declare module "packages/multipart-parser/src/multipart-parser" {
1494
+ export type { ParseMultipartOptions, MultipartParserOptions } from "packages/multipart-parser/src/lib/multipart";
1495
+ export { MultipartParseError, MaxHeaderSizeExceededError, MaxFileSizeExceededError, parseMultipart, parseMultipartStream, MultipartParser, MultipartPart, } from "packages/multipart-parser/src/lib/multipart";
1496
+ export { getMultipartBoundary, isMultipartRequest, parseMultipartRequest, } from "packages/multipart-parser/src/lib/multipart-request";
1497
+ }
1498
+ declare module "packages/multipart-parser/src/headers/lib/accept-encoding.test" { }
1499
+ declare module "packages/multipart-parser/src/headers/lib/accept-language.test" { }
1500
+ declare module "packages/multipart-parser/src/headers/lib/accept.test" { }
1501
+ declare module "packages/multipart-parser/src/headers/lib/cache-control.test" { }
1502
+ declare module "packages/multipart-parser/src/headers/lib/content-disposition.test" { }
1503
+ declare module "packages/multipart-parser/src/headers/lib/content-type.test" { }
1504
+ declare module "packages/multipart-parser/src/headers/lib/cookie.test" { }
1505
+ declare module "packages/multipart-parser/src/headers/lib/header-names.test" { }
1506
+ declare module "packages/multipart-parser/src/headers/lib/if-none-match.test" { }
1507
+ declare module "packages/multipart-parser/src/headers/lib/param-values.test" { }
1508
+ declare module "packages/multipart-parser/src/headers/lib/set-cookie.test" { }
1509
+ declare module "packages/multipart-parser/src/headers/lib/super-headers.test" { }
1510
+ declare module "packages/utils/src/ReactiveArray" {
1511
+ export type RxArrayEvents<T> = {
1512
+ [K in "push" | "pop" | "shift" | "unshift" | "splice" | "sort" | "copyWithin" | "reverse"]?: [
1513
+ K,
1514
+ Parameters<Array<T>[K]>,
1515
+ ReturnType<Array<T>[K]>
1516
+ ];
1517
+ };
1518
+ /** An array which emits events for each call to mutable functions on the array. */
1519
+ export class ReactiveArray<T> extends Array<T> {
1520
+ #private;
1521
+ get events(): import("rxjs").Observable<["pop", [], T | undefined] | ["push", T[], number] | ["reverse", [], T[]] | ["shift", [], T | undefined] | ["sort", [compareFn?: ((a: T, b: T) => number) | undefined], T[]] | ["splice", [start: number, deleteCount: number, ...items: T[]], T[]] | ["unshift", T[], number] | ["copyWithin", [target: number, start: number, end?: number | undefined], T[]] | undefined>;
1522
+ constructor(length: number);
1523
+ constructor(...items: T[]);
1524
+ }
1525
+ }
1526
+ declare module "packages/utils/src/index" {
1527
+ global {
1528
+ /** Awaited Return Type */
1529
+ type ART<T extends (...args: any) => any> = Awaited<ReturnType<T>>;
1530
+ interface ObjectConstructor {
1531
+ keys<T>(t: T): (string & keyof T)[];
1532
+ }
1533
+ /**
1534
+ * helper function which returns the arguments as an array,
1535
+ * but typed as a tuple, which is still an array, but positional.
1536
+ */
1537
+ function Tuple<P extends any[]>(...arg: P): P;
1538
+ /**
1539
+ * Helper function which returns tells whether an item is truthy.
1540
+ *
1541
+ * Useful for removing falsey values and the corresponding types from an array.
1542
+ *
1543
+ * It uses `!!` to to determine truthiness
1544
+ */
1545
+ function truthy<T>(obj: T): obj is Exclude<T, false | null | undefined | 0 | '' | void>;
1546
+ }
1547
+ export {};
1548
+ export * from "packages/utils/src/ReactiveArray";
1549
+ }
1550
+ declare module "packages/server/src/utils" {
1551
+ export function is<T>(a: any, b: boolean): a is T;
1552
+ /** Initiates a timer that must get cancelled before the current turn of the event loop ends */
1553
+ export class SyncCheck {
1554
+ done: () => void;
1555
+ constructor();
1556
+ }
1557
+ /**
1558
+ * If any property returns a function, and that function returns a promise,
1559
+ * the proxy will throw an error if the promise is not awaited before the next property access.
1560
+ *
1561
+ * The stack trace of the error will point to the line where the promise was returned.
1562
+ */
1563
+ export function createStrictAwaitProxy<T extends object>(instance: T): T;
1564
+ export function tryParseJSON<T>(json: string): T | undefined;
1565
+ export class TypedGenerator<T extends [any, any][]> {
1566
+ private inner;
1567
+ private index;
1568
+ static checker<T extends [any, any][]>(): {
1569
+ /** `const value1 = asV(1, yield asY(0, value0))` */
1570
+ asV<I extends number>(index: I, args: T[I][0]): T[I][0];
1571
+ /** `const value1 = asV(1, yield asY(0, value0))` */
1572
+ asY<I extends number>(index: I, ret: T[I][1]): T[I][1];
1573
+ };
1574
+ static wrapper<T extends [any, any][]>(): <A extends any[]>(factory: (...args: A) => Generator<any, any, any>) => (...args: A) => TypedGenerator<T>;
1575
+ constructor(inner: Generator<any, any, any>, index?: number);
1576
+ next<I extends number>(index: I, ...args: T[I][0] extends void ? [] : [T[I][0]]): Promise<(T extends [...any[], T[I]] ? IteratorReturnResult<T[I][1]> : IteratorYieldResult<T[I][1]>)>;
1577
+ return(value: any): any;
1578
+ throw(e: any): any;
1579
+ }
1580
+ export function mapAsync<T, U, V>(array: T[], callback: (this: V, value: T, index: number, array: T[]) => Promise<U>, thisArg?: any): Promise<U[]>;
1581
+ export function filterAsync<T, V>(array: T[], callback: (this: V, value: T, index: number, array: T[]) => Promise<boolean>, thisArg?: any): Promise<T[]>;
1582
+ export class UserError extends Error {
1583
+ constructor(message: string);
1584
+ }
1585
+ /**
1586
+ * This returns the resolved path relative to the executing code file,
1587
+ * however it uses path.resolve, not require.resolve.
1588
+ */
1589
+ export function dist_resolve(filepath: string): string;
1590
+ export function dist_require_resolve(filepath: string): string;
1591
+ export interface JsonArray extends Array<JsonValue> {
1592
+ }
1593
+ export type JsonObject = {
1594
+ [Key in string]?: JsonValue;
1595
+ };
1596
+ export type JsonValue = string | number | boolean | JsonObject | JsonArray | null | Date;
1597
+ }
1598
+ declare module "packages/server/src/compression" {
1599
+ /*!
1600
+ * compression
1601
+ * Copyright(c) 2010 Sencha Inc.
1602
+ * Copyright(c) 2011 TJ Holowaychuk
1603
+ * Copyright(c) 2014 Jonathan Ong
1604
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
1605
+ * MIT Licensed
1606
+ */
1607
+ import { DuplexOptions, PassThrough } from "stream";
1608
+ import { BrotliOptions, ZlibOptions } from 'zlib';
1609
+ import * as zlib from 'zlib';
1610
+ export interface CompressorOptions {
1611
+ /** Opts passed to brotli. The default quality param is 4. */
1612
+ brotli?: BrotliOptions;
1613
+ /** Opts passed to gzip */
1614
+ gzip?: ZlibOptions;
1615
+ /** Opts passed to deflate */
1616
+ deflate?: ZlibOptions;
1617
+ /** options to pass to the Passthrough stream used for identity encoding. */
1618
+ identity?: DuplexOptions;
1619
+ /**
1620
+ * source threshold below which to skip compression.
1621
+ * only works if content-length header is set.
1622
+ *
1623
+ * If a string, may be any number with a byte suffix (kb, mb, etc).
1624
+ */
1625
+ threshold?: number | string;
1626
+ /** use a specific encoding if the accept-encoding header is not present, defaults to identity */
1627
+ defaultEncoding?: 'br' | 'gzip' | 'deflate' | 'identity';
1628
+ }
1629
+ export class Compressor {
1630
+ private req;
1631
+ private res;
1632
+ constructor(req: import("http").IncomingMessage | import("http2").Http2ServerRequest, res: import("http").ServerResponse | import("http2").Http2ServerResponse, { identity, brotli, threshold, defaultEncoding, deflate, gzip }: CompressorOptions);
1633
+ /** Ends the response. Shortcut for easy removal when switching streams. */
1634
+ finisher: () => import("http").ServerResponse<import("http").IncomingMessage> | import("http2").Http2ServerResponse<import("http2").Http2ServerRequest>;
1635
+ enabled: boolean;
1636
+ method: string;
1637
+ threshold: any;
1638
+ defaultEncoding: "deflate" | "gzip" | "br" | "identity";
260
1639
  ended: boolean;
261
1640
  createStream: (method: string) => PassThrough;
262
1641
  length: number;
@@ -318,6 +1697,7 @@ declare module "packages/server/src/streamer" {
318
1697
  host: string;
319
1698
  method: string;
320
1699
  urlInfo: URL;
1700
+ /** The request url with path prefix removed. */
321
1701
  url: string;
322
1702
  headers: IncomingHttpHeaders;
323
1703
  cookies: URLSearchParams;
@@ -577,6 +1957,7 @@ declare module "packages/server/src/streamer" {
577
1957
  splitCompressionStream(): Promise<void>;
578
1958
  STREAM_ENDED: typeof STREAM_ENDED;
579
1959
  constructor(streamer: Streamer);
1960
+ /** The request url with path prefix removed. */
580
1961
  get url(): string;
581
1962
  get method(): string;
582
1963
  get headers(): IncomingHttpHeaders;
@@ -597,11 +1978,51 @@ declare module "packages/server/src/streamer" {
597
1978
  get pathPrefix(): string;
598
1979
  }
599
1980
  }
1981
+ declare module "packages/server/src/SendError" {
1982
+ export interface SendErrorItem<STATUS extends number, DETAIL extends (object & {}) | null> {
1983
+ status: STATUS;
1984
+ details: DETAIL;
1985
+ }
1986
+ export interface SendErrorReasonData {
1987
+ /** Check the server logs for this one */
1988
+ "INTERNAL_SERVER_ERROR": SendErrorItem<500, {
1989
+ message: string;
1990
+ details?: any;
1991
+ }>;
1992
+ "INVALID_X_REQUESTED_WITH": SendErrorItem<400, null>;
1993
+ "MALFORMED_JSON": SendErrorItem<400, null>;
1994
+ "NO_ROUTE_MATCHED": SendErrorItem<400, null>;
1995
+ "METHOD_NOT_ALLOWED": SendErrorItem<405, {
1996
+ allowedMethods: string[];
1997
+ }>;
1998
+ "INVALID_BODY_FORMAT": SendErrorItem<500, null>;
1999
+ "REQUEST_DROPPED": SendErrorItem<500, null>;
2000
+ "MULTIPART_INVALID_CONTENT_TYPE": SendErrorItem<400, null>;
2001
+ "MULTIPART_MISSING_BOUNDARY": SendErrorItem<400, null>;
2002
+ "MULTIPART_INVALID_PART_ENCODING": SendErrorItem<400, {
2003
+ partIndex: number;
2004
+ partEncoding: string;
2005
+ }>;
2006
+ }
2007
+ export class SendError<REASON extends SendErrorReason> extends Error {
2008
+ reason: REASON;
2009
+ status: SendErrorReasonData[REASON]["status"];
2010
+ details: SendErrorReasonData[REASON]["details"];
2011
+ constructor(reason: REASON, status: SendErrorReasonData[REASON]["status"], details: SendErrorReasonData[REASON]["details"]);
2012
+ get message(): string;
2013
+ toJSON(): {
2014
+ status: SendErrorReasonData[REASON]["status"];
2015
+ reason: REASON;
2016
+ details: SendErrorReasonData[REASON]["details"];
2017
+ };
2018
+ }
2019
+ export type SendErrorReason = keyof SendErrorReasonData;
2020
+ }
600
2021
  declare module "packages/server/src/StateObject" {
601
2022
  import { Streamer, StreamerState } from "packages/server/src/streamer";
602
2023
  import { BodyFormat, Router } from "packages/server/src/router";
603
2024
  import { RouteMatch } from "packages/server/src/router";
604
- import { IncomingHttpHeaders } from 'http';
2025
+ import { MultipartPart } from "packages/multipart-parser/src/index";
605
2026
  export interface ServerRequest<B extends BodyFormat = BodyFormat, M extends string = string, D = unknown> extends ServerRequestClass<B, M, D> {
606
2027
  }
607
2028
  export class ServerRequestClass<B extends BodyFormat = BodyFormat, M extends string = string, D = unknown> extends StreamerState {
@@ -656,20 +2077,10 @@ declare module "packages/server/src/StateObject" {
656
2077
  * - **308 Permanent Redirect:** The resource has permanently moved; the client should use the new URL in future requests.
657
2078
  */
658
2079
  redirect(location: string): typeof STREAM_ENDED;
659
- /**
660
- Options include:
661
- - `cbPartStart(headers,name,filename)` - invoked when a file starts being received
662
- - `cbPartChunk(chunk)` - invoked when a chunk of a file is received
663
- - `cbPartEnd()` - invoked when a file finishes being received
664
- - `cbFinished(err)` - invoked when the all the form data has been processed, optional,
665
- as it is called immediately before resolving or rejecting the promise.
666
- The promise will reject with err if there is an error.
667
- */
668
- readMultipartData(this: ServerRequest<any, any>, options: {
669
- cbPartStart: (headers: IncomingHttpHeaders, name: string | null, filename: string | null) => void;
670
- cbPartChunk: (chunk: Buffer) => void;
671
- cbPartEnd: () => void;
672
- cbFinished?: (err: Error | string | null) => void;
2080
+ readMultipartData(this: ServerRequest<"stream", any>, options: {
2081
+ cbPartStart: (part: MultipartPart) => void;
2082
+ cbPartChunk: (part: MultipartPart, chunk: Buffer) => void;
2083
+ cbPartEnd: (part: MultipartPart) => void;
673
2084
  }): Promise<void>;
674
2085
  }
675
2086
  }
@@ -680,7 +2091,7 @@ declare module "packages/server/src/zodRoute" {
680
2091
  import { RouteDef } from "packages/server/src/router";
681
2092
  import { Z2, zod as z } from "packages/server/src/Z2";
682
2093
  import * as core from "zod/v4/core";
683
- export function zodRoute<M extends string, B extends "GET" | "HEAD" extends M ? "ignore" : BodyFormat, P extends Record<string, z.ZodType<any, string | undefined>>, Q extends Record<string, z.ZodType<any, string[] | undefined>>, T extends z.ZodTypeAny, R extends JsonValue>(route: ZodRoute<M, B, P, Q, T, R>): ZodRoute<M, B, P, Q, T, R>;
2094
+ export function zodRoute<M extends string, B extends "GET" | "HEAD" extends M ? "ignore" : BodyFormat, P extends Record<string, z.ZodType<any, string | undefined>>, Q extends Record<string, z.ZodType<any, string[] | undefined>>, T extends z.ZodTypeAny, R extends JsonValue>(route: Omit<ZodRoute<M, B, P, Q, T, R>, "registerError">): ZodRoute<M, B, P, Q, T, R>;
684
2095
  export type FieldTypeGroups = "STRING" | "JSON";
685
2096
  export interface ZodRoute<M extends string, B extends BodyFormat, P extends Record<string, z.ZodType<any, string | undefined>>, Q extends Record<string, z.ZodType<any, string[] | undefined>>, T extends z.ZodTypeAny, R extends JsonValue> {
686
2097
  /**
@@ -701,14 +2112,6 @@ declare module "packages/server/src/zodRoute" {
701
2112
  * The default behavior is to remove all query params.
702
2113
  */
703
2114
  zodQueryParams?: (z: Z2<"STRING">) => Q;
704
- /**
705
- * CORS preflight requests do not include credentials or request headers,
706
- * so you can't authenticate requests. It is a way to provide information about the endpoint.
707
- *
708
- * Be careful, because if you specify the same route with different methods, and set corsRequest
709
- * on more than one, because only the first one will actually be called.
710
- */
711
- corsRequest?: (state: ZodState<"OPTIONS", "ignore", P, Q, z.ZodUndefined>) => Promise<typeof STREAM_ENDED>;
712
2115
  /**
713
2116
  * A zod check of the request body result.
714
2117
  *
@@ -721,6 +2124,7 @@ declare module "packages/server/src/zodRoute" {
721
2124
  method: M[];
722
2125
  path: string;
723
2126
  bodyFormat: B;
2127
+ registerError: Error;
724
2128
  inner: (state: {
725
2129
  [K in M]: ZodState<K, B, P, Q, T>;
726
2130
  }[M]) => Promise<R>;
@@ -769,12 +2173,12 @@ declare module "packages/server/src/listeners" {
769
2173
  constructor(router: Router, config: ListenOptions);
770
2174
  }
771
2175
  export interface ListenOptions {
772
- port?: string;
773
- host?: string;
774
- prefix?: string;
2176
+ port: string;
2177
+ host: string;
2178
+ prefix: string;
2179
+ secure: boolean;
775
2180
  key?: string;
776
2181
  cert?: string;
777
- secure?: boolean;
778
2182
  redirect?: number;
779
2183
  }
780
2184
  }
@@ -785,9 +2189,13 @@ declare module "packages/server/src/router" {
785
2189
  import { IncomingMessage, ServerResponse } from "node:http";
786
2190
  import { Http2ServerRequest, Http2ServerResponse } from "node:http2";
787
2191
  import { ListenOptions } from "packages/server/src/listeners";
2192
+ export interface AllowedRequestedWithHeaderKeys {
2193
+ fetch: true;
2194
+ XMLHttpRequest: true;
2195
+ }
788
2196
  export class Router {
789
2197
  rootRoute: ServerRoute;
790
- allowedRequestedWithHeaders: string[];
2198
+ allowedRequestedWithHeaders: (keyof AllowedRequestedWithHeaderKeys)[];
791
2199
  constructor(rootRoute: ServerRoute);
792
2200
  handle(req: IncomingMessage | Http2ServerRequest, res: ServerResponse | Http2ServerResponse, options: ListenOptions): void;
793
2201
  handleRequest(req: IncomingMessage | Http2ServerRequest, res: ServerResponse | Http2ServerResponse, options: ListenOptions): Promise<void>;
@@ -818,7 +2226,8 @@ declare module "packages/server/src/router" {
818
2226
  params: (string | undefined)[];
819
2227
  remainingPath: string;
820
2228
  }
821
- export const zodTransformJSON: (arg: string, ctx: zod.RefinementCtx) => any;
2229
+ export const zodTransformJSON: (arg: string, ctx: zod.RefinementCtx<string>) => any;
2230
+ export const zodDecodeURIComponent: (arg: string, ctx: zod.RefinementCtx<string>) => string;
822
2231
  export const BodyFormats: readonly ["stream", "string", "json", "buffer", "www-form-urlencoded", "www-form-urlencoded-urlsearchparams", "ignore"];
823
2232
  export type BodyFormat = (typeof BodyFormats)[number];
824
2233
  export interface RouteDef {
@@ -847,9 +2256,11 @@ declare module "packages/server/src/router" {
847
2256
  denyFinal?: boolean;
848
2257
  securityChecks?: {
849
2258
  /**
850
- * If true, the request must have the "x-requested-with" header set to "XMLHttpRequest".
2259
+ * If true, the request must have the "x-requested-with" header set to keyof AllowedRequestedWithHeaderKeys.
851
2260
  * This is a common way to check if the request is an AJAX request.
852
2261
  * If the header is not set, the request will be rejected with a 403 Forbidden.
2262
+ *
2263
+ * @see {@link AllowedRequestedWithHeaderKeys}
853
2264
  */
854
2265
  requestedWithHeader?: boolean;
855
2266
  };
@@ -859,6 +2270,13 @@ declare module "packages/server/src/router" {
859
2270
  * If this route's handler sends headers, the matched child route will not be called.
860
2271
  */
861
2272
  handler: (state: ServerRequest) => Promise<typeof STREAM_ENDED>;
2273
+ /**
2274
+ * If the handler promise rejects, this function will be called as a second attempt.
2275
+ *
2276
+ * Same rules apply as for handler.
2277
+ */
2278
+ catchHandler?: (state: ServerRequest, error: any) => Promise<typeof STREAM_ENDED>;
2279
+ registerError: Error;
862
2280
  /**
863
2281
  * ### ROUTING
864
2282
  *
@@ -876,10 +2294,10 @@ declare module "packages/server/src/router" {
876
2294
  *
877
2295
  * Note that GET and HEAD are always bodyFormat: "ignore", regardless of what is set here.
878
2296
  */
879
- defineRoute: (route: RouteDef, handler: (state: ServerRequest) => Promise<symbol | void>) => ServerRoute;
2297
+ defineRoute: (route: RouteDef, handler: (state: ServerRequest) => Promise<symbol | void>, catchHandler?: (state: ServerRequest, error: any) => Promise<symbol | void>) => ServerRoute;
880
2298
  }
881
2299
  export const ROOT_ROUTE: unique symbol;
882
- export function createRootRoute(method: string[], handler: (state: ServerRequest) => void): any;
2300
+ export function createRootRoute(method: string[], handler: (state: ServerRequest) => Promise<void>): ServerRoute;
883
2301
  }
884
2302
  declare module "packages/server/src/zodRegister" {
885
2303
  import { ServerRequest } from "packages/server/src/StateObject";
@@ -888,21 +2306,22 @@ declare module "packages/server/src/zodRegister" {
888
2306
  import { zod } from "packages/server/src/index";
889
2307
  import * as core from "zod/v4/core";
890
2308
  export const registerZodRoutes: (parent: ServerRoute, router: any, keys: string[]) => void;
891
- export function checkData<T extends core.$ZodType>(state: ServerRequest, zodRequestBody: (z: Z2<any>) => T): asserts state is ServerRequest & {
2309
+ export function checkData<T extends core.$ZodType>(state: ServerRequest, zodRequestBody: (z: Z2<any>) => T, registerError: Error): asserts state is ServerRequest & {
892
2310
  data: zod.infer<T>;
893
2311
  };
894
2312
  export function checkQuery<T extends {
895
2313
  [x: string]: core.$ZodType<unknown, string[] | undefined>;
896
- }>(state: ServerRequest, zodQueryParams: (z: Z2<"STRING">) => T): asserts state is ServerRequest & {
2314
+ }>(state: ServerRequest, zodQueryParams: (z: Z2<"STRING">) => T, registerError: Error): asserts state is ServerRequest & {
897
2315
  queryParams: zod.infer<zod.ZodObject<T>>;
898
2316
  };
899
2317
  export function checkPath<T extends {
900
2318
  [x: string]: core.$ZodType<unknown, string | undefined>;
901
- }>(state: ServerRequest, zodPathParams: (z: Z2<"STRING">) => T): asserts state is ServerRequest & {
2319
+ }>(state: ServerRequest, zodPathParams: (z: Z2<"STRING">) => T, registerError: Error): asserts state is ServerRequest & {
902
2320
  pathParams: zod.infer<zod.ZodObject<T>>;
903
2321
  };
904
2322
  }
905
2323
  declare module "packages/server/src/index" {
2324
+ import "packages/utils/src/index";
906
2325
  import { Router, type RouteMatch } from "packages/server/src/router";
907
2326
  import { ListenerHTTP, ListenerHTTPS, ListenOptions } from "packages/server/src/listeners";
908
2327
  import type { Streamer } from "packages/server/src/streamer";
@@ -912,19 +2331,20 @@ declare module "packages/server/src/index" {
912
2331
  import { Z2 } from "packages/server/src/Z2";
913
2332
  export * from "packages/server/src/listeners";
914
2333
  export * from "packages/server/src/router";
2334
+ export * from "packages/server/src/SendError";
915
2335
  export * from "packages/server/src/StateObject";
916
2336
  export * from "packages/server/src/streamer";
917
2337
  export * from "packages/server/src/utils";
2338
+ export * from "packages/server/src/Z2";
918
2339
  export * from "packages/server/src/zodRegister";
919
2340
  export * from "packages/server/src/zodRoute";
920
- export * from "packages/server/src/Z2";
921
2341
  /**
922
2342
  *
923
2343
  * Runs the following events in order:
924
2344
  * - `"zod.make"`
925
2345
  */
926
2346
  export function startup(): Promise<void>;
927
- export function startListening(router: Router, options?: ListenOptions[]): Promise<(ListenerHTTPS | ListenerHTTP)[]>;
2347
+ export function startListening(router: Router, options?: Partial<ListenOptions>[]): Promise<(ListenerHTTPS | ListenerHTTP)[]>;
928
2348
  module "packages/events/src/index" {
929
2349
  interface ServerEventsMap {
930
2350
  "zod.make": [zod: Z2<any>];
@@ -991,12 +2411,12 @@ declare module "packages/mws/src/services/cache" {
991
2411
  export type CacheState = ART<typeof startupCache>;
992
2412
  }
993
2413
  declare module "packages/mws/src/ServerState" {
994
- import { PrismaClient, Prisma } from "prisma-client";
995
- import { ITXClientDenyList } from "prisma-client/runtime/library";
2414
+ import { PrismaClient, Prisma } from "@tiddlywiki/mws-prisma";
2415
+ import { ITXClientDenyList } from "@tiddlywiki/mws-prisma/runtime/library";
996
2416
  import { TW } from "tiddlywiki";
997
2417
  import { createPasswordService } from "packages/mws/src/services/PasswordService";
998
2418
  import { startupCache } from "packages/mws/src/services/cache";
999
- import { Types } from "prisma-client/runtime/library";
2419
+ import { Types } from "@tiddlywiki/mws-prisma/runtime/library";
1000
2420
  /** This is an alias for ServerState in case we want to separate the two purposes. */
1001
2421
  export type SiteConfig = ServerState;
1002
2422
  export class ServerState {
@@ -1069,18 +2489,19 @@ declare module "packages/mws/src/ServerState" {
1069
2489
  export type TiddlerCache = ART<typeof startupCache>;
1070
2490
  }
1071
2491
  declare module "packages/mws/src/RequestState" {
1072
- import { Prisma } from 'prisma-client';
1073
- import { Types } from 'prisma-client/runtime/library';
2492
+ import { Prisma } from '@tiddlywiki/mws-prisma';
2493
+ import { Types } from '@tiddlywiki/mws-prisma/runtime/library';
1074
2494
  import { ServerState } from "packages/mws/src/ServerState";
1075
2495
  import { BodyFormat, RouteMatch, Router, ServerRequestClass, Streamer } from "packages/server/src/index";
2496
+ import { SendErrorReasonData } from "packages/server/src/index";
1076
2497
  export class StateObject<B extends BodyFormat = BodyFormat, M extends string = string, D = unknown> extends ServerRequestClass<B, M, D> {
1077
2498
  config: ServerState;
1078
2499
  user: import("packages/mws/src/services/sessions").AuthUser;
1079
2500
  engine: PrismaEngineClient;
1080
- sendAdmin: () => Promise<symbol>;
2501
+ sendAdmin: (status: number, response: string) => Promise<typeof STREAM_ENDED>;
1081
2502
  asserted: boolean;
1082
2503
  PasswordService: {
1083
- serverState: Map<string, import("@tiddlywiki/server").TypedGenerator<[[void, loginResponse: string], [finishLoginRequest: string, {
2504
+ serverState: Map<string, import("packages/server/src/index").TypedGenerator<[[void, loginResponse: string], [finishLoginRequest: string, {
1084
2505
  user_id: PrismaField<"Users", "user_id">;
1085
2506
  session: {
1086
2507
  sessionKey: string;
@@ -1090,7 +2511,7 @@ declare module "packages/mws/src/RequestState" {
1090
2511
  user_id: PrismaField<"Users", "user_id">;
1091
2512
  startLoginRequest: string;
1092
2513
  registrationRecord: string;
1093
- }) => import("@tiddlywiki/server").TypedGenerator<[[void, loginResponse: string], [finishLoginRequest: string, {
2514
+ }) => import("packages/server/src/index").TypedGenerator<[[void, loginResponse: string], [finishLoginRequest: string, {
1094
2515
  user_id: PrismaField<"Users", "user_id">;
1095
2516
  session: {
1096
2517
  sessionKey: string;
@@ -1104,13 +2525,13 @@ declare module "packages/mws/src/RequestState" {
1104
2525
  userID: PrismaField<"Users", "user_id">;
1105
2526
  registrationRequest: string;
1106
2527
  }) => Promise<string>;
1107
- startLoginSession: (stater: import("@tiddlywiki/server").TypedGenerator<[[void, loginResponse: string], [finishLoginRequest: string, {
2528
+ startLoginSession: (stater: import("packages/server/src/index").TypedGenerator<[[void, loginResponse: string], [finishLoginRequest: string, {
1108
2529
  user_id: PrismaField<"Users", "user_id">;
1109
2530
  session: {
1110
2531
  sessionKey: string;
1111
2532
  } | undefined;
1112
2533
  }]]>) => Promise<string>;
1113
- finishLoginSession: (loginSession: string) => Promise<import("@tiddlywiki/server").TypedGenerator<[[void, loginResponse: string], [finishLoginRequest: string, {
2534
+ finishLoginSession: (loginSession: string) => Promise<import("packages/server/src/index").TypedGenerator<[[void, loginResponse: string], [finishLoginRequest: string, {
1114
2535
  user_id: PrismaField<"Users", "user_id">;
1115
2536
  session: {
1116
2537
  sessionKey: string;
@@ -1133,6 +2554,7 @@ declare module "packages/mws/src/RequestState" {
1133
2554
  $transactionTuple<P extends Prisma.PrismaPromise<any>[]>(arg: (prisma: ServerState["engine"]) => [...P], options?: {
1134
2555
  isolationLevel?: Prisma.TransactionIsolationLevel;
1135
2556
  }): Promise<Types.Utils.UnwrapTuple<P>>;
2557
+ sendError<ReasonStr extends keyof SendErrorReasonData>(reason: ReasonStr, status: SendErrorReasonData[ReasonStr]["status"], details: SendErrorReasonData[ReasonStr]["details"]): typeof STREAM_ENDED;
1136
2558
  makeTiddlerEtag(options: {
1137
2559
  bag_name: string;
1138
2560
  revision_id: string | number;
@@ -1146,8 +2568,21 @@ declare module "packages/mws/src/RequestState" {
1146
2568
  } | null;
1147
2569
  canRead: unknown;
1148
2570
  canWrite: unknown;
2571
+ referer: (string & {
2572
+ __prisma_table: "Recipes";
2573
+ __prisma_field: "recipe_name";
2574
+ }) | undefined;
2575
+ }>;
2576
+ getRefererRecipe(): (string & {
2577
+ __prisma_table: "Recipes";
2578
+ __prisma_field: "recipe_name";
2579
+ }) | undefined;
2580
+ assertRecipeAccess(recipe_name: PrismaField<"Recipes", "recipe_name">, needWrite: boolean): Promise<{
2581
+ recipe_id: string & {
2582
+ __prisma_table: "Recipes";
2583
+ __prisma_field: "recipe_id";
2584
+ };
1149
2585
  }>;
1150
- assertRecipeAccess(recipe_name: PrismaField<"Recipes", "recipe_name">, needWrite: boolean): Promise<void>;
1151
2586
  assertBagAccess(bag_name: PrismaField<"Bags", "bag_name">, needWrite: boolean): Promise<{
1152
2587
  owner_id: PrismaField<"Bags", "owner_id">;
1153
2588
  bag_id: string & {
@@ -1265,6 +2700,107 @@ declare module "packages/mws/src/RequestState" {
1265
2700
  }
1266
2701
  export type ACLPermissionName = "READ" | "WRITE" | "ADMIN";
1267
2702
  }
2703
+ declare module "packages/mws/src/SendError" {
2704
+ import { SendErrorItem } from "packages/server/src/index";
2705
+ module "packages/server/src/index" {
2706
+ interface SendErrorReasonData {
2707
+ "RECIPE_NOT_FOUND": SendErrorItem<404, {
2708
+ recipeName: string;
2709
+ }>;
2710
+ "RECIPE_NO_READ_PERMISSION": SendErrorItem<403, {
2711
+ recipeName: string;
2712
+ }>;
2713
+ "RECIPE_NO_WRITE_PERMISSION": SendErrorItem<403, {
2714
+ recipeName: string;
2715
+ }>;
2716
+ "RECIPE_MUST_HAVE_BAGS": SendErrorItem<400, {
2717
+ recipeName: string;
2718
+ }>;
2719
+ "RECIPE_NO_BAG_AT_POSITION_ZERO": SendErrorItem<403, {
2720
+ recipeName: string;
2721
+ }>;
2722
+ "BAG_NOT_FOUND": SendErrorItem<404, {
2723
+ bagName: string;
2724
+ }>;
2725
+ "BAG_NO_READ_PERMISSION": SendErrorItem<403, {
2726
+ bagName: string;
2727
+ }>;
2728
+ "BAG_NO_WRITE_PERMISSION": SendErrorItem<403, {
2729
+ bagName: string;
2730
+ }>;
2731
+ "BAG_DOES_NOT_HAVE_THIS_TIDDLER": SendErrorItem<403, {
2732
+ bagName: string;
2733
+ tiddlerTitle: string;
2734
+ }>;
2735
+ "PAGE_NOT_AUTHORIZED_FOR_ENDPOINT": SendErrorItem<403, null>;
2736
+ "RESPONSE_INTERCEPTED_BY_CHECKER": SendErrorItem<500, null>;
2737
+ "TIDDLER_WIRE_FORMAT_UNKNOWN": SendErrorItem<403, {
2738
+ contentType: string;
2739
+ }>;
2740
+ "SETTING_KEY_INVALID": SendErrorItem<403, {
2741
+ key: string;
2742
+ }>;
2743
+ "LAST_EVENT_ID_NOT_PROVIDED": SendErrorItem<403, null>;
2744
+ }
2745
+ }
2746
+ }
2747
+ declare module "packages/mws/src/globals" {
2748
+ import type { Prisma } from "@tiddlywiki/mws-prisma";
2749
+ global {
2750
+ namespace PrismaJson {
2751
+ type Recipes_plugin_names = string[];
2752
+ type Recipe_bags_partitioned_bags = {
2753
+ /** partitioned bags allow each user with write access to write to `${title_prefix}${username}` */
2754
+ title_prefix: string;
2755
+ /**
2756
+ * everyone with acl read can read all tiddlers
2757
+ *
2758
+ * if this is false, admins can still do this, but they will be in a restricted readonly mode.
2759
+ */
2760
+ everyone_readable: boolean;
2761
+ /**
2762
+ * everyone with acl write can write normal tiddlers.
2763
+ *
2764
+ * site and entity admins can always do this.
2765
+ */
2766
+ normally_writable: boolean;
2767
+ };
2768
+ }
2769
+ }
2770
+ global {
2771
+ /**
2772
+ * This primarily makes sure that positional arguments are used correctly
2773
+ * (so you can't switch a title and bag_name around).
2774
+ *
2775
+ * If you assign the wrong value (like `5 as PrismaField<"Bags", "bag_name">`),
2776
+ * this will result in a type error on the as keyword, allowing you to catch incorrect types quickly.
2777
+ */
2778
+ type PrismaField<T extends Prisma.ModelName, K extends keyof PrismaPayloadScalars<T>> = ([
2779
+ T,
2780
+ K
2781
+ ] extends ["Tiddlers", "bag_id"] ? PrismaField<"Bags", "bag_id"> : [
2782
+ T,
2783
+ K
2784
+ ] extends ["Sessions", "user_id"] ? PrismaField<"Users", "user_id"> : [
2785
+ T,
2786
+ K
2787
+ ] extends ["Recipe_bags", "bag_id"] ? PrismaField<"Bags", "bag_id"> : [
2788
+ T,
2789
+ K
2790
+ ] extends ["Recipe_bags", "recipe_id"] ? PrismaField<"Recipes", "recipe_id"> : [
2791
+ T,
2792
+ K
2793
+ ] extends ["Recipes", "owner_id"] ? PrismaField<"Users", "user_id"> : [
2794
+ T,
2795
+ K
2796
+ ] extends ["Bags", "owner_id"] ? PrismaField<"Users", "user_id"> : (PrismaPayloadScalars<T>[K] & {
2797
+ __prisma_table: T;
2798
+ __prisma_field: K;
2799
+ })) | (null extends PrismaPayloadScalars<T>[K] ? null : never);
2800
+ type PrismaPayloadScalars<T extends Prisma.ModelName> = Prisma.TypeMap["model"][T]["payload"]["scalars"];
2801
+ }
2802
+ export {};
2803
+ }
1268
2804
  declare module "packages/mws/src/services/sessions" {
1269
2805
  import { jsonify, JsonValue, RouterKeyMap, ServerRoute, Streamer, Z2, zod, ZodRoute, ZodState } from "packages/server/src/index";
1270
2806
  import { ServerState } from "packages/mws/src/ServerState";
@@ -1347,7 +2883,7 @@ declare module "packages/mws/src/services/sessions" {
1347
2883
  declare module "packages/mws/src/services/setupDevServer" {
1348
2884
  import { ServerState } from "packages/mws/src/ServerState";
1349
2885
  import { ServerRequest } from "packages/server/src/index";
1350
- export function setupDevServer(config: ServerState): Promise<(state: ServerRequest) => Promise<symbol>>;
2886
+ export function setupDevServer(config: ServerState): Promise<(state: ServerRequest, status: number, serverResponse: string) => Promise<typeof STREAM_ENDED>>;
1351
2887
  export function esbuildStartup(): Promise<{
1352
2888
  ctx: import("esbuild").BuildContext<{
1353
2889
  entryPoints: string[];
@@ -1409,6 +2945,9 @@ declare module "packages/mws/src/registerRequest" {
1409
2945
  interface Streamer {
1410
2946
  user: AuthUser;
1411
2947
  }
2948
+ interface AllowedRequestedWithHeaderKeys {
2949
+ TiddlyWiki: true;
2950
+ }
1412
2951
  }
1413
2952
  }
1414
2953
  declare module "packages/mws/src/db/sqlite-adapter" {
@@ -1439,8 +2978,8 @@ declare module "packages/mws/src/registerStartup" {
1439
2978
  import { ServerState, TiddlerCache } from "packages/mws/src/ServerState";
1440
2979
  module "packages/events/src/index" {
1441
2980
  interface ServerEventsMap {
1442
- "mws.init.before": [config: ServerState, $tw: TW];
1443
- "mws.init.after": [config: ServerState, $tw: TW];
2981
+ "mws.config.init.before": [config: ServerState, $tw: TW];
2982
+ "mws.config.init.after": [config: ServerState, $tw: TW];
1444
2983
  "mws.adapter.init.before": [adapter: SqliteAdapter];
1445
2984
  "mws.adapter.init.after": [adapter: SqliteAdapter];
1446
2985
  "mws.cache.init.before": [cachePath: string, $tw: TW];
@@ -1476,23 +3015,23 @@ declare module "packages/mws/src/managers/TiddlerStore" {
1476
3015
  validateItemName(name: string, allowPrivilegedCharacters: boolean): "Not a valid string" | "Too long" | "Invalid character(s)" | null;
1477
3016
  validateItemNames(names: string[], allowPrivilegedCharacters: boolean): string | null;
1478
3017
  upsertRecipe_PrismaArray(recipe_name: PrismaField<"Recipes", "recipe_name">, description: PrismaField<"Recipes", "description">, bags: {
1479
- bag_name: PrismaField<"Bags", "bag_name">;
3018
+ bag_id: PrismaField<"Bags", "bag_id">;
1480
3019
  with_acl: PrismaField<"Recipe_bags", "with_acl">;
1481
3020
  }[], plugin_names: string[], { allowPrivilegedCharacters }?: {
1482
3021
  allowPrivilegedCharacters?: boolean;
1483
- }): [import("prisma/client").Prisma.Prisma__RecipesClient<{
3022
+ }): [import("@tiddlywiki/mws-prisma").Prisma.Prisma__RecipesClient<{
1484
3023
  recipe_id: string & {
1485
3024
  __prisma_table: "Recipes";
1486
3025
  __prisma_field: "recipe_id";
1487
3026
  };
1488
3027
  }, never, {
1489
- result: { [T in Uncapitalize<import("prisma/client").Prisma.ModelName>]: { [K in keyof PrismaPayloadScalars<Capitalize<T>>]: () => {
3028
+ result: { [T in Uncapitalize<import("@tiddlywiki/mws-prisma").Prisma.ModelName>]: { [K in keyof PrismaPayloadScalars<Capitalize<T>>]: () => {
1490
3029
  compute: () => PrismaField<Capitalize<T>, K>;
1491
3030
  }; }; };
1492
3031
  client: {};
1493
3032
  model: {};
1494
3033
  query: {};
1495
- }, import("prisma/client").Prisma.PrismaClientOptions>, import("prisma/client").Prisma.Prisma__RecipesClient<{
3034
+ }, import("@tiddlywiki/mws-prisma").Prisma.PrismaClientOptions>, import("@tiddlywiki/mws-prisma").Prisma.Prisma__RecipesClient<{
1496
3035
  description: string & {
1497
3036
  __prisma_table: "Recipes";
1498
3037
  __prisma_field: "description";
@@ -1512,86 +3051,171 @@ declare module "packages/mws/src/managers/TiddlerStore" {
1512
3051
  };
1513
3052
  skip_required_plugins: PrismaField<"Recipes", "skip_required_plugins">;
1514
3053
  skip_core: PrismaField<"Recipes", "skip_core">;
3054
+ preload_store: PrismaField<"Recipes", "preload_store">;
3055
+ custom_wiki: PrismaField<"Recipes", "custom_wiki">;
1515
3056
  }, never, {
1516
- result: { [T in Uncapitalize<import("prisma/client").Prisma.ModelName>]: { [K in keyof PrismaPayloadScalars<Capitalize<T>>]: () => {
3057
+ result: { [T in Uncapitalize<import("@tiddlywiki/mws-prisma").Prisma.ModelName>]: { [K in keyof PrismaPayloadScalars<Capitalize<T>>]: () => {
1517
3058
  compute: () => PrismaField<Capitalize<T>, K>;
1518
3059
  }; }; };
1519
3060
  client: {};
1520
3061
  model: {};
1521
3062
  query: {};
1522
- }, import("prisma/client").Prisma.PrismaClientOptions>];
3063
+ }, import("@tiddlywiki/mws-prisma").Prisma.PrismaClientOptions>];
1523
3064
  upsertBag_PrismaPromise(bag_name: PrismaField<"Bags", "bag_name">, description: PrismaField<"Bags", "description">, { allowPrivilegedCharacters }?: {
1524
3065
  allowPrivilegedCharacters?: boolean;
1525
- }): import("prisma/client").Prisma.Prisma__BagsClient<{
3066
+ }): import("@tiddlywiki/mws-prisma").Prisma.Prisma__BagsClient<{
1526
3067
  bag_id: string & {
1527
3068
  __prisma_table: "Bags";
1528
3069
  __prisma_field: "bag_id";
1529
3070
  };
1530
3071
  }, never, {
1531
- result: { [T in Uncapitalize<import("prisma/client").Prisma.ModelName>]: { [K in keyof PrismaPayloadScalars<Capitalize<T>>]: () => {
3072
+ result: { [T in Uncapitalize<import("@tiddlywiki/mws-prisma").Prisma.ModelName>]: { [K in keyof PrismaPayloadScalars<Capitalize<T>>]: () => {
1532
3073
  compute: () => PrismaField<Capitalize<T>, K>;
1533
3074
  }; }; };
1534
3075
  client: {};
1535
3076
  model: {};
1536
3077
  query: {};
1537
- }, import("prisma/client").Prisma.PrismaClientOptions>;
1538
- saveTiddlersFromPath_PrismaArray(bag_name: PrismaField<"Bags", "bag_name">, tiddlers: TiddlerFields[]): [import("prisma/client").Prisma.PrismaPromise<import("prisma/client").Prisma.BatchPayload>, ...(import("prisma/client").Prisma.PrismaPromise<import("prisma/client").Prisma.BatchPayload> | import("prisma/client").Prisma.Prisma__TiddlersClient<{
3078
+ }, import("@tiddlywiki/mws-prisma").Prisma.PrismaClientOptions>;
3079
+ saveTiddlersFromPath_PrismaArray(bag_id: PrismaField<"Bags", "bag_id">, tiddlers: TiddlerFields[]): [import("@tiddlywiki/mws-prisma").Prisma.PrismaPromise<import("@tiddlywiki/mws-prisma").Prisma.BatchPayload>, ...(import("@tiddlywiki/mws-prisma").Prisma.PrismaPromise<import("@tiddlywiki/mws-prisma").Prisma.BatchPayload> | import("@tiddlywiki/mws-prisma").Prisma.Prisma__TiddlersClient<{
3080
+ bag: {
3081
+ bag_id: string & {
3082
+ __prisma_table: "Bags";
3083
+ __prisma_field: "bag_id";
3084
+ };
3085
+ bag_name: string & {
3086
+ __prisma_table: "Bags";
3087
+ __prisma_field: "bag_name";
3088
+ };
3089
+ };
3090
+ } & {
3091
+ title: string & {
3092
+ __prisma_table: "Tiddlers";
3093
+ __prisma_field: "title";
3094
+ };
3095
+ bag_id: string & {
3096
+ __prisma_table: "Bags";
3097
+ __prisma_field: "bag_id";
3098
+ };
1539
3099
  revision_id: string & {
1540
3100
  __prisma_table: "Tiddlers";
1541
- __prisma_field: "revision_id";
3101
+ __prisma_field: "revision_id";
3102
+ };
3103
+ is_deleted: PrismaField<"Tiddlers", "is_deleted">;
3104
+ attachment_hash: PrismaField<"Tiddlers", "attachment_hash">;
3105
+ }, never, {
3106
+ result: { [T in Uncapitalize<import("@tiddlywiki/mws-prisma").Prisma.ModelName>]: { [K in keyof PrismaPayloadScalars<Capitalize<T>>]: () => {
3107
+ compute: () => PrismaField<Capitalize<T>, K>;
3108
+ }; }; };
3109
+ client: {};
3110
+ model: {};
3111
+ query: {};
3112
+ }, import("@tiddlywiki/mws-prisma").Prisma.PrismaClientOptions>)[]];
3113
+ saveBagTiddlerFields_PrismaArray(tiddlerFields: TiddlerFields, bag_id: PrismaField<"Bags", "bag_id">, attachment_hash: PrismaField<"Tiddlers", "attachment_hash">): [import("@tiddlywiki/mws-prisma").Prisma.PrismaPromise<import("@tiddlywiki/mws-prisma").Prisma.BatchPayload>, import("@tiddlywiki/mws-prisma").Prisma.Prisma__TiddlersClient<{
3114
+ bag: {
3115
+ bag_id: string & {
3116
+ __prisma_table: "Bags";
3117
+ __prisma_field: "bag_id";
3118
+ };
3119
+ bag_name: string & {
3120
+ __prisma_table: "Bags";
3121
+ __prisma_field: "bag_name";
3122
+ };
3123
+ };
3124
+ } & {
3125
+ title: string & {
3126
+ __prisma_table: "Tiddlers";
3127
+ __prisma_field: "title";
3128
+ };
3129
+ bag_id: string & {
3130
+ __prisma_table: "Bags";
3131
+ __prisma_field: "bag_id";
1542
3132
  };
1543
- }, never, {
1544
- result: { [T in Uncapitalize<import("prisma/client").Prisma.ModelName>]: { [K in keyof PrismaPayloadScalars<Capitalize<T>>]: () => {
1545
- compute: () => PrismaField<Capitalize<T>, K>;
1546
- }; }; };
1547
- client: {};
1548
- model: {};
1549
- query: {};
1550
- }, import("prisma/client").Prisma.PrismaClientOptions>)[]];
1551
- saveBagTiddlerFields_PrismaArray(tiddlerFields: TiddlerFields, bag_name: PrismaField<"Bags", "bag_name">, attachment_hash: PrismaField<"Tiddlers", "attachment_hash">): [import("prisma/client").Prisma.PrismaPromise<import("prisma/client").Prisma.BatchPayload>, import("prisma/client").Prisma.Prisma__TiddlersClient<{
1552
3133
  revision_id: string & {
1553
3134
  __prisma_table: "Tiddlers";
1554
3135
  __prisma_field: "revision_id";
1555
3136
  };
3137
+ is_deleted: PrismaField<"Tiddlers", "is_deleted">;
3138
+ attachment_hash: PrismaField<"Tiddlers", "attachment_hash">;
1556
3139
  }, never, {
1557
- result: { [T in Uncapitalize<import("prisma/client").Prisma.ModelName>]: { [K in keyof PrismaPayloadScalars<Capitalize<T>>]: () => {
3140
+ result: { [T in Uncapitalize<import("@tiddlywiki/mws-prisma").Prisma.ModelName>]: { [K in keyof PrismaPayloadScalars<Capitalize<T>>]: () => {
1558
3141
  compute: () => PrismaField<Capitalize<T>, K>;
1559
3142
  }; }; };
1560
3143
  client: {};
1561
3144
  model: {};
1562
3145
  query: {};
1563
- }, import("prisma/client").Prisma.PrismaClientOptions>];
3146
+ }, import("@tiddlywiki/mws-prisma").Prisma.PrismaClientOptions>];
1564
3147
  /**
1565
3148
  Returns {revision_id:} of the delete marker
1566
3149
  */
1567
- deleteBagTiddler_PrismaArray(bag_name: PrismaField<"Bags", "bag_name">, title: PrismaField<"Tiddlers", "title">): [import("prisma/client").Prisma.PrismaPromise<import("prisma/client").Prisma.BatchPayload>, import("prisma/client").Prisma.Prisma__TiddlersClient<{
3150
+ deleteBagTiddler_PrismaArray(bag_id: PrismaField<"Bags", "bag_id">, title: PrismaField<"Tiddlers", "title">): [import("@tiddlywiki/mws-prisma").Prisma.PrismaPromise<import("@tiddlywiki/mws-prisma").Prisma.BatchPayload>, import("@tiddlywiki/mws-prisma").Prisma.Prisma__TiddlersClient<{
3151
+ title: string & {
3152
+ __prisma_table: "Tiddlers";
3153
+ __prisma_field: "title";
3154
+ };
3155
+ bag_id: string & {
3156
+ __prisma_table: "Bags";
3157
+ __prisma_field: "bag_id";
3158
+ };
1568
3159
  revision_id: string & {
1569
3160
  __prisma_table: "Tiddlers";
1570
3161
  __prisma_field: "revision_id";
1571
3162
  };
3163
+ is_deleted: PrismaField<"Tiddlers", "is_deleted">;
3164
+ attachment_hash: PrismaField<"Tiddlers", "attachment_hash">;
1572
3165
  }, never, {
1573
- result: { [T in Uncapitalize<import("prisma/client").Prisma.ModelName>]: { [K in keyof PrismaPayloadScalars<Capitalize<T>>]: () => {
3166
+ result: { [T in Uncapitalize<import("@tiddlywiki/mws-prisma").Prisma.ModelName>]: { [K in keyof PrismaPayloadScalars<Capitalize<T>>]: () => {
1574
3167
  compute: () => PrismaField<Capitalize<T>, K>;
1575
3168
  }; }; };
1576
3169
  client: {};
1577
3170
  model: {};
1578
3171
  query: {};
1579
- }, import("prisma/client").Prisma.PrismaClientOptions>];
3172
+ }, import("@tiddlywiki/mws-prisma").Prisma.PrismaClientOptions>];
1580
3173
  }
1581
3174
  export class TiddlerStore_PrismaTransaction extends TiddlerStore_PrismaBase {
1582
3175
  prisma: PrismaTxnClient;
1583
3176
  constructor(prisma: PrismaTxnClient);
1584
- saveBagTiddlerFields(tiddlerFields: TiddlerFields, bag_name: PrismaField<"Bags", "bag_name">, attachment_hash: PrismaField<"Tiddlers", "attachment_hash">): Promise<{
3177
+ saveBagTiddlerFields(tiddlerFields: TiddlerFields, bag_id: PrismaField<"Bags", "bag_id">, attachment_hash: PrismaField<"Tiddlers", "attachment_hash">): Promise<{
3178
+ bag: {
3179
+ bag_id: string & {
3180
+ __prisma_table: "Bags";
3181
+ __prisma_field: "bag_id";
3182
+ };
3183
+ bag_name: string & {
3184
+ __prisma_table: "Bags";
3185
+ __prisma_field: "bag_name";
3186
+ };
3187
+ };
3188
+ } & {
3189
+ title: string & {
3190
+ __prisma_table: "Tiddlers";
3191
+ __prisma_field: "title";
3192
+ };
3193
+ bag_id: string & {
3194
+ __prisma_table: "Bags";
3195
+ __prisma_field: "bag_id";
3196
+ };
1585
3197
  revision_id: string & {
1586
3198
  __prisma_table: "Tiddlers";
1587
3199
  __prisma_field: "revision_id";
1588
3200
  };
3201
+ is_deleted: PrismaField<"Tiddlers", "is_deleted">;
3202
+ attachment_hash: PrismaField<"Tiddlers", "attachment_hash">;
1589
3203
  }>;
1590
- deleteBagTiddler(bag_name: PrismaField<"Bags", "bag_name">, title: PrismaField<"Tiddlers", "title">): Promise<{
3204
+ deleteBagTiddler(bag_id: PrismaField<"Bags", "bag_id">, title: PrismaField<"Tiddlers", "title">): Promise<{
3205
+ title: string & {
3206
+ __prisma_table: "Tiddlers";
3207
+ __prisma_field: "title";
3208
+ };
3209
+ bag_id: string & {
3210
+ __prisma_table: "Bags";
3211
+ __prisma_field: "bag_id";
3212
+ };
1591
3213
  revision_id: string & {
1592
3214
  __prisma_table: "Tiddlers";
1593
3215
  __prisma_field: "revision_id";
1594
3216
  };
3217
+ is_deleted: PrismaField<"Tiddlers", "is_deleted">;
3218
+ attachment_hash: PrismaField<"Tiddlers", "attachment_hash">;
1595
3219
  }>;
1596
3220
  /**
1597
3221
  * Get the writable bag for the specified recipe.
@@ -1650,6 +3274,8 @@ declare module "packages/mws/src/managers/TiddlerStore" {
1650
3274
  };
1651
3275
  skip_required_plugins: PrismaField<"Recipes", "skip_required_plugins">;
1652
3276
  skip_core: PrismaField<"Recipes", "skip_core">;
3277
+ preload_store: PrismaField<"Recipes", "preload_store">;
3278
+ custom_wiki: PrismaField<"Recipes", "custom_wiki">;
1653
3279
  };
1654
3280
  bag: {
1655
3281
  description: string & {
@@ -1711,7 +3337,7 @@ declare module "packages/mws/src/managers/TiddlerStore" {
1711
3337
  getBagTiddlers_PrismaQuery(bag_name: PrismaField<"Bags", "bag_name">, options?: {
1712
3338
  last_known_revision_id?: PrismaField<"Tiddlers", "revision_id">;
1713
3339
  include_deleted?: boolean;
1714
- }): import("prisma/client").Prisma.Prisma__BagsClient<{
3340
+ }): import("@tiddlywiki/mws-prisma").Prisma.Prisma__BagsClient<{
1715
3341
  bag_id: string & {
1716
3342
  __prisma_table: "Bags";
1717
3343
  __prisma_field: "bag_id";
@@ -1732,13 +3358,13 @@ declare module "packages/mws/src/managers/TiddlerStore" {
1732
3358
  is_deleted: PrismaField<"Tiddlers", "is_deleted">;
1733
3359
  }[];
1734
3360
  } | null, null, {
1735
- result: { [T in Uncapitalize<import("prisma/client").Prisma.ModelName>]: { [K in keyof PrismaPayloadScalars<Capitalize<T>>]: () => {
3361
+ result: { [T in Uncapitalize<import("@tiddlywiki/mws-prisma").Prisma.ModelName>]: { [K in keyof PrismaPayloadScalars<Capitalize<T>>]: () => {
1736
3362
  compute: () => PrismaField<Capitalize<T>, K>;
1737
3363
  }; }; };
1738
3364
  client: {};
1739
3365
  model: {};
1740
3366
  query: {};
1741
- }, import("prisma/client").Prisma.PrismaClientOptions>;
3367
+ }, import("@tiddlywiki/mws-prisma").Prisma.PrismaClientOptions>;
1742
3368
  }
1743
3369
  }
1744
3370
  declare module "packages/mws/src/commands/load-wiki-folder" {
@@ -1813,6 +3439,8 @@ declare module "packages/mws/src/commands/save-archive" {
1813
3439
  };
1814
3440
  skip_required_plugins: PrismaField<"Recipes", "skip_required_plugins">;
1815
3441
  skip_core: PrismaField<"Recipes", "skip_core">;
3442
+ preload_store: PrismaField<"Recipes", "preload_store">;
3443
+ custom_wiki: PrismaField<"Recipes", "custom_wiki">;
1816
3444
  })[]>;
1817
3445
  getBags(): Promise<{
1818
3446
  tiddlers: {
@@ -1879,6 +3507,10 @@ declare module "packages/mws/src/commands/save-archive" {
1879
3507
  };
1880
3508
  }[];
1881
3509
  sessions: {
3510
+ session_id: string & {
3511
+ __prisma_table: "Sessions";
3512
+ __prisma_field: "session_id";
3513
+ };
1882
3514
  user_id: string & {
1883
3515
  __prisma_table: "Users";
1884
3516
  __prisma_field: "user_id";
@@ -1887,10 +3519,6 @@ declare module "packages/mws/src/commands/save-archive" {
1887
3519
  __prisma_table: "Sessions";
1888
3520
  __prisma_field: "created_at";
1889
3521
  };
1890
- session_id: string & {
1891
- __prisma_table: "Sessions";
1892
- __prisma_field: "session_id";
1893
- };
1894
3522
  last_accessed: Date & {
1895
3523
  __prisma_table: "Sessions";
1896
3524
  __prisma_field: "last_accessed";
@@ -2063,7 +3691,7 @@ declare module "packages/mws/src/commands/build-client" {
2063
3691
  }
2064
3692
  declare module "packages/mws/src/managers/admin-utils" {
2065
3693
  import { JsonValue, Z2, zod, ZodState } from "packages/server/src/index";
2066
- export function admin<T extends zod.ZodTypeAny, R extends JsonValue>(zodRequest: (z: Z2<"JSON">) => T, inner: (state: ZodState<"POST", "json", {}, {}, T>, prisma: PrismaTxnClient) => Promise<R>): import("@tiddlywiki/server").ZodRoute<"POST", "json", {}, {}, T, R>;
3694
+ export function admin<T extends zod.ZodTypeAny, R extends JsonValue>(zodRequest: (z: Z2<"JSON">) => T, inner: (state: ZodState<"POST", "json", {}, {}, T>, prisma: PrismaTxnClient) => Promise<R>): import("packages/server/src/index").ZodRoute<"POST", "json", {}, {}, T, R>;
2067
3695
  }
2068
3696
  declare module "packages/mws/src/managers/admin-recipes" {
2069
3697
  import { RouterKeyMap, RouterRouteMap, ServerRequest, ServerRoute } from "packages/server/src/index";
@@ -2072,7 +3700,7 @@ declare module "packages/mws/src/managers/admin-recipes" {
2072
3700
  export class RecipeManager {
2073
3701
  static defineRoutes(root: ServerRoute): void;
2074
3702
  constructor();
2075
- recipe_create_or_update: import("@tiddlywiki/server").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
3703
+ recipe_create_or_update: import("packages/server/src/index").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
2076
3704
  recipe_name: import("zod/v4").ZodType<string & {
2077
3705
  __prisma_table: "Recipes";
2078
3706
  __prisma_field: "recipe_name";
@@ -2095,6 +3723,8 @@ declare module "packages/mws/src/managers/admin-recipes" {
2095
3723
  owner_id: import("zod/v4").ZodOptional<import("zod/v4").ZodType<PrismaField<"Recipes", "owner_id">, string | null, import("zod/v4/core").$ZodTypeInternals<PrismaField<"Recipes", "owner_id">, string | null>>>;
2096
3724
  skip_required_plugins: import("zod/v4").ZodType<PrismaField<"Recipes", "skip_required_plugins">, boolean, import("zod/v4/core").$ZodTypeInternals<PrismaField<"Recipes", "skip_required_plugins">, boolean>>;
2097
3725
  skip_core: import("zod/v4").ZodType<PrismaField<"Recipes", "skip_core">, boolean, import("zod/v4/core").$ZodTypeInternals<PrismaField<"Recipes", "skip_core">, boolean>>;
3726
+ preload_store: import("zod/v4").ZodType<PrismaField<"Recipes", "preload_store">, boolean, import("zod/v4/core").$ZodTypeInternals<PrismaField<"Recipes", "preload_store">, boolean>>;
3727
+ custom_wiki: import("zod/v4").ZodType<PrismaField<"Recipes", "custom_wiki">, string | null, import("zod/v4/core").$ZodTypeInternals<PrismaField<"Recipes", "custom_wiki">, string | null>>;
2098
3728
  create_only: import("zod/v4").ZodBoolean;
2099
3729
  }, import("zod/v4/core").$strip>, {
2100
3730
  description: string & {
@@ -2116,8 +3746,10 @@ declare module "packages/mws/src/managers/admin-recipes" {
2116
3746
  };
2117
3747
  skip_required_plugins: PrismaField<"Recipes", "skip_required_plugins">;
2118
3748
  skip_core: PrismaField<"Recipes", "skip_core">;
3749
+ preload_store: PrismaField<"Recipes", "preload_store">;
3750
+ custom_wiki: PrismaField<"Recipes", "custom_wiki">;
2119
3751
  }>;
2120
- bag_create_or_update: import("@tiddlywiki/server").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
3752
+ bag_create_or_update: import("packages/server/src/index").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
2121
3753
  bag_name: import("zod/v4").ZodType<string & {
2122
3754
  __prisma_table: "Bags";
2123
3755
  __prisma_field: "bag_name";
@@ -2158,13 +3790,13 @@ declare module "packages/mws/src/managers/admin-recipes" {
2158
3790
  } | null;
2159
3791
  type: "recipe" | "bag";
2160
3792
  }): void;
2161
- recipe_delete: import("@tiddlywiki/server").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
3793
+ recipe_delete: import("packages/server/src/index").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
2162
3794
  recipe_name: import("zod/v4").ZodString;
2163
3795
  }, import("zod/v4/core").$strip>, null>;
2164
- bag_delete: import("@tiddlywiki/server").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
3796
+ bag_delete: import("packages/server/src/index").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
2165
3797
  bag_name: import("zod/v4").ZodString;
2166
3798
  }, import("zod/v4/core").$strip>, null>;
2167
- recipe_acl_update: import("@tiddlywiki/server").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
3799
+ recipe_acl_update: import("packages/server/src/index").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
2168
3800
  recipe_name: import("zod/v4").ZodType<string & {
2169
3801
  __prisma_table: "Recipes";
2170
3802
  __prisma_field: "recipe_name";
@@ -2187,7 +3819,7 @@ declare module "packages/mws/src/managers/admin-recipes" {
2187
3819
  }>;
2188
3820
  }, import("zod/v4/core").$strip>>;
2189
3821
  }, import("zod/v4/core").$strip>, null>;
2190
- bag_acl_update: import("@tiddlywiki/server").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
3822
+ bag_acl_update: import("packages/server/src/index").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
2191
3823
  bag_name: import("zod/v4").ZodType<string & {
2192
3824
  __prisma_table: "Bags";
2193
3825
  __prisma_field: "bag_name";
@@ -2219,7 +3851,7 @@ declare module "packages/mws/src/managers/admin-users" {
2219
3851
  export class UserManager {
2220
3852
  static defineRoutes(root: ServerRoute): void;
2221
3853
  constructor();
2222
- user_edit_data: import("@tiddlywiki/server").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
3854
+ user_edit_data: import("packages/server/src/index").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
2223
3855
  user_id: import("zod/v4").ZodType<string & {
2224
3856
  __prisma_table: "Users";
2225
3857
  __prisma_field: "user_id";
@@ -2270,9 +3902,7 @@ declare module "packages/mws/src/managers/admin-users" {
2270
3902
  };
2271
3903
  }[];
2272
3904
  }>;
2273
- user_list: import("@tiddlywiki/server").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodUndefined, {
2274
- last_login: string | undefined;
2275
- created_at: string;
3905
+ user_list: import("packages/server/src/index").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodUndefined, {
2276
3906
  username: string & {
2277
3907
  __prisma_table: "Users";
2278
3908
  __prisma_field: "username";
@@ -2296,8 +3926,13 @@ declare module "packages/mws/src/managers/admin-users" {
2296
3926
  __prisma_table: "Users";
2297
3927
  __prisma_field: "user_id";
2298
3928
  };
3929
+ created_at: Date & {
3930
+ __prisma_table: "Users";
3931
+ __prisma_field: "created_at";
3932
+ };
3933
+ last_login: PrismaField<"Users", "last_login">;
2299
3934
  }[]>;
2300
- user_create: import("@tiddlywiki/server").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
3935
+ user_create: import("packages/server/src/index").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
2301
3936
  username: import("zod/v4").ZodString;
2302
3937
  email: import("zod/v4").ZodString;
2303
3938
  role_ids: import("zod/v4").ZodArray<import("zod/v4").ZodType<string & {
@@ -2317,7 +3952,7 @@ declare module "packages/mws/src/managers/admin-users" {
2317
3952
  __prisma_field: "created_at";
2318
3953
  };
2319
3954
  }>;
2320
- user_update: import("@tiddlywiki/server").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
3955
+ user_update: import("packages/server/src/index").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
2321
3956
  user_id: import("zod/v4").ZodType<string & {
2322
3957
  __prisma_table: "Users";
2323
3958
  __prisma_field: "user_id";
@@ -2347,7 +3982,16 @@ declare module "packages/mws/src/managers/admin-users" {
2347
3982
  __prisma_field: "role_id";
2348
3983
  }, string>>>;
2349
3984
  }, import("zod/v4/core").$strip>, null>;
2350
- user_delete: import("@tiddlywiki/server").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
3985
+ user_delete: import("packages/server/src/index").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
3986
+ user_id: import("zod/v4").ZodType<string & {
3987
+ __prisma_table: "Users";
3988
+ __prisma_field: "user_id";
3989
+ }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3990
+ __prisma_table: "Users";
3991
+ __prisma_field: "user_id";
3992
+ }, string>>;
3993
+ }, import("zod/v4/core").$strip>, null>;
3994
+ user_update_password: import("packages/server/src/index").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
2351
3995
  user_id: import("zod/v4").ZodType<string & {
2352
3996
  __prisma_table: "Users";
2353
3997
  __prisma_field: "user_id";
@@ -2355,135 +3999,296 @@ declare module "packages/mws/src/managers/admin-users" {
2355
3999
  __prisma_table: "Users";
2356
4000
  __prisma_field: "user_id";
2357
4001
  }, string>>;
2358
- }, import("zod/v4/core").$strip>, null>;
2359
- user_update_password: import("@tiddlywiki/server").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
2360
- user_id: import("zod/v4").ZodType<string & {
2361
- __prisma_table: "Users";
2362
- __prisma_field: "user_id";
4002
+ registrationRequest: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
4003
+ registrationRecord: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
4004
+ session_id: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
4005
+ signature: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
4006
+ }, import("zod/v4/core").$strip>, string | null>;
4007
+ role_create: import("packages/server/src/index").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
4008
+ role_name: import("zod/v4").ZodString;
4009
+ description: import("zod/v4").ZodString;
4010
+ }, import("zod/v4/core").$strip>, {
4011
+ description: PrismaField<"Roles", "description">;
4012
+ role_id: string & {
4013
+ __prisma_table: "Roles";
4014
+ __prisma_field: "role_id";
4015
+ };
4016
+ role_name: string & {
4017
+ __prisma_table: "Roles";
4018
+ __prisma_field: "role_name";
4019
+ };
4020
+ }>;
4021
+ role_update: import("packages/server/src/index").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
4022
+ role_id: import("zod/v4").ZodType<string & {
4023
+ __prisma_table: "Roles";
4024
+ __prisma_field: "role_id";
4025
+ }, string, import("zod/v4/core").$ZodTypeInternals<string & {
4026
+ __prisma_table: "Roles";
4027
+ __prisma_field: "role_id";
4028
+ }, string>>;
4029
+ role_name: import("zod/v4").ZodType<string & {
4030
+ __prisma_table: "Roles";
4031
+ __prisma_field: "role_name";
4032
+ }, string, import("zod/v4/core").$ZodTypeInternals<string & {
4033
+ __prisma_table: "Roles";
4034
+ __prisma_field: "role_name";
4035
+ }, string>>;
4036
+ description: import("zod/v4").ZodType<PrismaField<"Roles", "description">, string | null, import("zod/v4/core").$ZodTypeInternals<PrismaField<"Roles", "description">, string | null>>;
4037
+ }, import("zod/v4/core").$strip>, {
4038
+ description: PrismaField<"Roles", "description">;
4039
+ role_id: string & {
4040
+ __prisma_table: "Roles";
4041
+ __prisma_field: "role_id";
4042
+ };
4043
+ role_name: string & {
4044
+ __prisma_table: "Roles";
4045
+ __prisma_field: "role_name";
4046
+ };
4047
+ }>;
4048
+ }
4049
+ }
4050
+ declare module "packages/mws/src/managers/admin-settings" {
4051
+ import { RouterKeyMap, RouterRouteMap, ServerRoute } from "packages/server/src/index";
4052
+ export const SettingsKeyMap: RouterKeyMap<SettingsManager, true>;
4053
+ export type SettingsManagerMap = RouterRouteMap<SettingsManager>;
4054
+ class SettingsManager {
4055
+ static defineRoutes(root: ServerRoute): void;
4056
+ settings_read: import("packages/server/src/index").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodUndefined, {
4057
+ value: string & {
4058
+ __prisma_table: "Settings";
4059
+ __prisma_field: "value";
4060
+ };
4061
+ key: string;
4062
+ description: string;
4063
+ valueType: "string" | "boolean" | "number";
4064
+ }[]>;
4065
+ settings_update: import("packages/server/src/index").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
4066
+ key: import("zod/v4").ZodString;
4067
+ value: import("zod/v4").ZodString;
4068
+ }, import("zod/v4/core").$strip>, {
4069
+ success: true;
4070
+ }>;
4071
+ }
4072
+ }
4073
+ declare module "packages/mws/src/managers/WikiStateStore" {
4074
+ import { TiddlerStore_PrismaTransaction } from "packages/mws/src/managers/TiddlerStore";
4075
+ import { ServerRequest } from "packages/server/src/index";
4076
+ /** Basically a bunch of methods to help with wiki routes. */
4077
+ export class WikiStateStore extends TiddlerStore_PrismaTransaction {
4078
+ protected state: ServerRequest;
4079
+ constructor(state: ServerRequest, prisma: PrismaTxnClient);
4080
+ serveIndexFile(recipe_name: PrismaField<"Recipes", "recipe_name">): Promise<symbol>;
4081
+ private writeStoreTiddlers;
4082
+ private serveStoreTiddlers;
4083
+ serveBagTiddler(bag_id: PrismaField<"Bags", "bag_id">, bag_name: PrismaField<"Bags", "bag_name">, title: PrismaField<"Tiddlers", "title">): Promise<symbol>;
4084
+ }
4085
+ }
4086
+ declare module "packages/mws/src/managers/wiki-utils" {
4087
+ import { BodyFormat, JsonValue, zod, ZodRoute, ZodState } from "packages/server/src/index";
4088
+ import { TiddlerFields } from "tiddlywiki";
4089
+ export interface WikiRoute<M extends string, B extends BodyFormat, P extends Record<string, zod.ZodType<any, string | undefined>>, Q extends Record<string, zod.ZodType<any, string[] | undefined>>, T extends zod.ZodTypeAny, R extends JsonValue> extends ZodRoute<M, B, P, Q, T, R> {
4090
+ routeType: "wiki" | "recipe" | "bag";
4091
+ routeName: string;
4092
+ }
4093
+ export const BAG_PREFIX = "/bag";
4094
+ export const RECIPE_PREFIX = "/recipe";
4095
+ export const WIKI_PREFIX = "/wiki";
4096
+ export function parseTiddlerFields(input: string, ctype: string | undefined): any;
4097
+ export function recieveTiddlerMultipartUpload(state: ZodState<"POST", "stream", any, any, zod.ZodTypeAny>): Promise<TiddlerFields>;
4098
+ export function rethrow<T>(cb: () => T, message: string): T;
4099
+ }
4100
+ declare module "packages/mws/src/managers/wiki-recipe" {
4101
+ import { TiddlerFields } from "tiddlywiki";
4102
+ export class WikiRecipeRoutes {
4103
+ handleLoadRecipeTiddler: import("packages/server/src/index").ZodRoute<"GET" | "HEAD", "ignore", {
4104
+ recipe_name: import("zod/v4").ZodType<string & {
4105
+ __prisma_table: "Recipes";
4106
+ __prisma_field: "recipe_name";
4107
+ }, string, import("zod/v4/core").$ZodTypeInternals<string & {
4108
+ __prisma_table: "Recipes";
4109
+ __prisma_field: "recipe_name";
4110
+ }, string>>;
4111
+ title: import("zod/v4").ZodType<string & {
4112
+ __prisma_table: "Tiddlers";
4113
+ __prisma_field: "title";
4114
+ }, string, import("zod/v4/core").$ZodTypeInternals<string & {
4115
+ __prisma_table: "Tiddlers";
4116
+ __prisma_field: "title";
4117
+ }, string>>;
4118
+ }, Record<string, import("zod/v4").ZodType<any, string[] | undefined, import("zod/v4/core").$ZodTypeInternals<any, string[] | undefined>>>, import("zod/v4").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, never>;
4119
+ rpcLoadRecipeTiddlerList: import("packages/server/src/index").ZodRoute<"PUT", "json", {
4120
+ recipe_name: import("zod/v4").ZodType<string & {
4121
+ __prisma_table: "Recipes";
4122
+ __prisma_field: "recipe_name";
4123
+ }, string, import("zod/v4/core").$ZodTypeInternals<string & {
4124
+ __prisma_table: "Recipes";
4125
+ __prisma_field: "recipe_name";
4126
+ }, string>>;
4127
+ }, Record<string, import("zod/v4").ZodType<any, string[] | undefined, import("zod/v4/core").$ZodTypeInternals<any, string[] | undefined>>>, import("zod/v4").ZodObject<{
4128
+ titles: import("zod/v4").ZodArray<import("zod/v4").ZodType<string & {
4129
+ __prisma_table: "Tiddlers";
4130
+ __prisma_field: "title";
4131
+ }, string, import("zod/v4/core").$ZodTypeInternals<string & {
4132
+ __prisma_table: "Tiddlers";
4133
+ __prisma_field: "title";
4134
+ }, string>>>;
4135
+ }, import("zod/v4/core").$strict>, {
4136
+ bag_id: string & {
4137
+ __prisma_table: "Bags";
4138
+ __prisma_field: "bag_id";
4139
+ };
4140
+ bag_name: string & {
4141
+ __prisma_table: "Bags";
4142
+ __prisma_field: "bag_name";
4143
+ };
4144
+ tiddler: TiddlerFields;
4145
+ }[]>;
4146
+ handleSaveRecipeTiddler: import("packages/server/src/index").ZodRoute<"PUT", "string", {
4147
+ recipe_name: import("zod/v4").ZodType<string & {
4148
+ __prisma_table: "Recipes";
4149
+ __prisma_field: "recipe_name";
4150
+ }, string, import("zod/v4/core").$ZodTypeInternals<string & {
4151
+ __prisma_table: "Recipes";
4152
+ __prisma_field: "recipe_name";
4153
+ }, string>>;
4154
+ title: import("zod/v4").ZodType<string & {
4155
+ __prisma_table: "Tiddlers";
4156
+ __prisma_field: "title";
4157
+ }, string, import("zod/v4/core").$ZodTypeInternals<string & {
4158
+ __prisma_table: "Tiddlers";
4159
+ __prisma_field: "title";
4160
+ }, string>>;
4161
+ }, Record<string, import("zod/v4").ZodType<any, string[] | undefined, import("zod/v4/core").$ZodTypeInternals<any, string[] | undefined>>>, import("zod/v4").ZodString, {
4162
+ bag_name: string & {
4163
+ __prisma_table: "Bags";
4164
+ __prisma_field: "bag_name";
4165
+ };
4166
+ revision_id: string & {
4167
+ __prisma_table: "Tiddlers";
4168
+ __prisma_field: "revision_id";
4169
+ };
4170
+ }>;
4171
+ rpcSaveRecipeTiddlerList: import("packages/server/src/index").ZodRoute<"PUT", "json", {
4172
+ recipe_name: import("zod/v4").ZodType<string & {
4173
+ __prisma_table: "Recipes";
4174
+ __prisma_field: "recipe_name";
4175
+ }, string, import("zod/v4/core").$ZodTypeInternals<string & {
4176
+ __prisma_table: "Recipes";
4177
+ __prisma_field: "recipe_name";
4178
+ }, string>>;
4179
+ }, Record<string, import("zod/v4").ZodType<any, string[] | undefined, import("zod/v4/core").$ZodTypeInternals<any, string[] | undefined>>>, import("zod/v4").ZodObject<{
4180
+ tiddlers: import("zod/v4").ZodArray<import("zod/v4").ZodRecord<import("zod/v4").ZodString, import("zod/v4").ZodString>>;
4181
+ }, import("zod/v4/core").$strict>, ({
4182
+ bag: {
4183
+ bag_id: string & {
4184
+ __prisma_table: "Bags";
4185
+ __prisma_field: "bag_id";
4186
+ };
4187
+ bag_name: string & {
4188
+ __prisma_table: "Bags";
4189
+ __prisma_field: "bag_name";
4190
+ };
4191
+ };
4192
+ } & {
4193
+ title: string & {
4194
+ __prisma_table: "Tiddlers";
4195
+ __prisma_field: "title";
4196
+ };
4197
+ bag_id: string & {
4198
+ __prisma_table: "Bags";
4199
+ __prisma_field: "bag_id";
4200
+ };
4201
+ revision_id: string & {
4202
+ __prisma_table: "Tiddlers";
4203
+ __prisma_field: "revision_id";
4204
+ };
4205
+ is_deleted: PrismaField<"Tiddlers", "is_deleted">;
4206
+ attachment_hash: PrismaField<"Tiddlers", "attachment_hash">;
4207
+ })[]>;
4208
+ handleDeleteRecipeTiddler: import("packages/server/src/index").ZodRoute<"DELETE", "json", {
4209
+ recipe_name: import("zod/v4").ZodType<string & {
4210
+ __prisma_table: "Recipes";
4211
+ __prisma_field: "recipe_name";
4212
+ }, string, import("zod/v4/core").$ZodTypeInternals<string & {
4213
+ __prisma_table: "Recipes";
4214
+ __prisma_field: "recipe_name";
4215
+ }, string>>;
4216
+ title: import("zod/v4").ZodType<string & {
4217
+ __prisma_table: "Tiddlers";
4218
+ __prisma_field: "title";
2363
4219
  }, string, import("zod/v4/core").$ZodTypeInternals<string & {
2364
- __prisma_table: "Users";
2365
- __prisma_field: "user_id";
4220
+ __prisma_table: "Tiddlers";
4221
+ __prisma_field: "title";
2366
4222
  }, string>>;
2367
- registrationRequest: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
2368
- registrationRecord: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
2369
- session_id: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
2370
- signature: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
2371
- }, import("zod/v4/core").$strip>, string | null>;
2372
- role_create: import("@tiddlywiki/server").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
2373
- role_name: import("zod/v4").ZodString;
2374
- description: import("zod/v4").ZodString;
2375
- }, import("zod/v4/core").$strip>, {
2376
- description: PrismaField<"Roles", "description">;
2377
- role_id: string & {
2378
- __prisma_table: "Roles";
2379
- __prisma_field: "role_id";
4223
+ }, Record<string, import("zod/v4").ZodType<any, string[] | undefined, import("zod/v4/core").$ZodTypeInternals<any, string[] | undefined>>>, import("zod/v4").ZodUndefined, {
4224
+ bag_id: string & {
4225
+ __prisma_table: "Bags";
4226
+ __prisma_field: "bag_id";
2380
4227
  };
2381
- role_name: string & {
2382
- __prisma_table: "Roles";
2383
- __prisma_field: "role_name";
4228
+ bag_name: string & {
4229
+ __prisma_table: "Bags";
4230
+ __prisma_field: "bag_name";
4231
+ };
4232
+ revision_id: string & {
4233
+ __prisma_table: "Tiddlers";
4234
+ __prisma_field: "revision_id";
2384
4235
  };
2385
4236
  }>;
2386
- role_update: import("@tiddlywiki/server").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
2387
- role_id: import("zod/v4").ZodType<string & {
2388
- __prisma_table: "Roles";
2389
- __prisma_field: "role_id";
4237
+ rpcDeleteRecipeTiddlerList: import("packages/server/src/index").ZodRoute<"PUT", "json", {
4238
+ recipe_name: import("zod/v4").ZodType<string & {
4239
+ __prisma_table: "Recipes";
4240
+ __prisma_field: "recipe_name";
2390
4241
  }, string, import("zod/v4/core").$ZodTypeInternals<string & {
2391
- __prisma_table: "Roles";
2392
- __prisma_field: "role_id";
4242
+ __prisma_table: "Recipes";
4243
+ __prisma_field: "recipe_name";
2393
4244
  }, string>>;
2394
- role_name: import("zod/v4").ZodType<string & {
2395
- __prisma_table: "Roles";
2396
- __prisma_field: "role_name";
4245
+ }, Record<string, import("zod/v4").ZodType<any, string[] | undefined, import("zod/v4/core").$ZodTypeInternals<any, string[] | undefined>>>, import("zod/v4").ZodObject<{
4246
+ titles: import("zod/v4").ZodArray<import("zod/v4").ZodType<string & {
4247
+ __prisma_table: "Tiddlers";
4248
+ __prisma_field: "title";
2397
4249
  }, string, import("zod/v4/core").$ZodTypeInternals<string & {
2398
- __prisma_table: "Roles";
2399
- __prisma_field: "role_name";
2400
- }, string>>;
2401
- description: import("zod/v4").ZodType<PrismaField<"Roles", "description">, string | null, import("zod/v4/core").$ZodTypeInternals<PrismaField<"Roles", "description">, string | null>>;
2402
- }, import("zod/v4/core").$strip>, {
2403
- description: PrismaField<"Roles", "description">;
2404
- role_id: string & {
2405
- __prisma_table: "Roles";
2406
- __prisma_field: "role_id";
4250
+ __prisma_table: "Tiddlers";
4251
+ __prisma_field: "title";
4252
+ }, string>>>;
4253
+ }, import("zod/v4/core").$strict>, {
4254
+ title: string & {
4255
+ __prisma_table: "Tiddlers";
4256
+ __prisma_field: "title";
2407
4257
  };
2408
- role_name: string & {
2409
- __prisma_table: "Roles";
2410
- __prisma_field: "role_name";
4258
+ bag_id: string & {
4259
+ __prisma_table: "Bags";
4260
+ __prisma_field: "bag_id";
2411
4261
  };
2412
- }>;
2413
- }
2414
- }
2415
- declare module "packages/mws/src/managers/admin-settings" {
2416
- import { RouterKeyMap, RouterRouteMap, ServerRoute } from "packages/server/src/index";
2417
- export const SettingsKeyMap: RouterKeyMap<SettingsManager, true>;
2418
- export type SettingsManagerMap = RouterRouteMap<SettingsManager>;
2419
- class SettingsManager {
2420
- static defineRoutes(root: ServerRoute): void;
2421
- settings_read: import("@tiddlywiki/server").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodUndefined, {
2422
- value: (string & {
2423
- __prisma_table: "Settings";
2424
- __prisma_field: "value";
2425
- }) | undefined;
2426
- key: string;
2427
- description: string;
2428
- valueType: "string" | "boolean" | "number";
4262
+ revision_id: string & {
4263
+ __prisma_table: "Tiddlers";
4264
+ __prisma_field: "revision_id";
4265
+ };
4266
+ is_deleted: PrismaField<"Tiddlers", "is_deleted">;
4267
+ attachment_hash: PrismaField<"Tiddlers", "attachment_hash">;
2429
4268
  }[]>;
2430
- settings_update: import("@tiddlywiki/server").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
2431
- key: import("zod/v4").ZodString;
2432
- value: import("zod/v4").ZodString;
2433
- }, import("zod/v4/core").$strip>, {
2434
- success: true;
2435
- }>;
2436
- }
2437
- }
2438
- declare module "packages/mws/src/managers/WikiStateStore" {
2439
- import { TiddlerStore_PrismaTransaction } from "packages/mws/src/managers/TiddlerStore";
2440
- import { ServerRequest } from "packages/server/src/index";
2441
- /** Basically a bunch of methods to help with wiki routes. */
2442
- export class WikiStateStore extends TiddlerStore_PrismaTransaction {
2443
- protected state: ServerRequest;
2444
- constructor(state: ServerRequest, prisma: PrismaTxnClient);
2445
- serveIndexFile(recipe_name: PrismaField<"Recipes", "recipe_name">): Promise<symbol>;
2446
- private serveStoreTiddlers;
2447
- serveBagTiddler(bag_id: PrismaField<"Bags", "bag_id">, bag_name: PrismaField<"Bags", "bag_name">, title: PrismaField<"Tiddlers", "title">): Promise<symbol>;
2448
- }
2449
- }
2450
- declare module "packages/mws/src/managers/wiki-routes" {
2451
- import { TiddlerFields } from "tiddlywiki";
2452
- import { BodyFormat, JsonValue, RouterKeyMap, RouterRouteMap, ServerRoute, zod, ZodRoute } from "packages/server/src/index";
2453
- export const WikiRouterKeyMap: RouterKeyMap<WikiRoutes, true>;
2454
- export type TiddlerManagerMap = RouterRouteMap<WikiRoutes>;
2455
- export interface WikiRoute<M extends string, B extends BodyFormat, P extends Record<string, zod.ZodType<any, string | undefined>>, Q extends Record<string, zod.ZodType<any, string[] | undefined>>, T extends zod.ZodTypeAny, R extends JsonValue> extends ZodRoute<M, B, P, Q, T, R> {
2456
- routeType: "wiki" | "recipe" | "bag";
2457
- routeName: string;
2458
4269
  }
2459
4270
  module "packages/events/src/index" {
2460
4271
  interface ServerEventsMap {
2461
- "mws.tiddler.save": [
2462
- {
2463
- recipe_name?: string;
2464
- bag_name: string;
2465
- title: string;
2466
- revision_id: string;
2467
- }
2468
- ];
2469
- "mws.tiddler.delete": [
4272
+ "mws.tiddler.events": [
2470
4273
  {
4274
+ recipe_id?: string;
2471
4275
  recipe_name?: string;
4276
+ bag_id: string;
2472
4277
  bag_name: string;
2473
- title: string;
2474
- revision_id: string;
4278
+ results: {
4279
+ title: string;
4280
+ revision_id: string;
4281
+ is_deleted: boolean;
4282
+ }[];
2475
4283
  }
2476
4284
  ];
2477
4285
  }
2478
4286
  }
2479
- module "packages/server/src/index" {
2480
- interface IncomingHttpHeaders {
2481
- 'last-event-id'?: string;
2482
- }
2483
- }
2484
- export class WikiRoutes {
2485
- static defineRoutes: (root: ServerRoute) => void;
2486
- handleGetRecipeStatus: ZodRoute<"GET" | "HEAD", "ignore", {
4287
+ }
4288
+ declare module "packages/mws/src/managers/wiki-status" {
4289
+ import { zod } from "packages/server/src/index";
4290
+ export class WikiStatusRoutes {
4291
+ handleGetRecipeStatus: import("packages/server/src/index").ZodRoute<"GET" | "HEAD", "ignore", {
2487
4292
  recipe_name: zod.ZodType<string & {
2488
4293
  __prisma_table: "Recipes";
2489
4294
  __prisma_field: "recipe_name";
@@ -2504,7 +4309,7 @@ declare module "packages/mws/src/managers/wiki-routes" {
2504
4309
  isLoggedIn: boolean;
2505
4310
  isReadOnly: boolean;
2506
4311
  }>;
2507
- handleGetRecipeEvents: ZodRoute<"GET" | "HEAD", "ignore", {
4312
+ handleGetRecipeEvents: import("packages/server/src/index").ZodRoute<"GET" | "HEAD", "ignore", {
2508
4313
  recipe_name: zod.ZodType<string & {
2509
4314
  __prisma_table: "Recipes";
2510
4315
  __prisma_field: "recipe_name";
@@ -2515,7 +4320,7 @@ declare module "packages/mws/src/managers/wiki-routes" {
2515
4320
  }, {
2516
4321
  "first-event-id": zod.ZodOptional<zod.ZodArray<zod.ZodString>>;
2517
4322
  }, zod.ZodType<unknown, unknown, zod.z.core.$ZodTypeInternals<unknown, unknown>>, never>;
2518
- handleGetBags: ZodRoute<"GET" | "HEAD", "ignore", {
4323
+ handleGetBags: import("packages/server/src/index").ZodRoute<"GET" | "HEAD", "ignore", {
2519
4324
  recipe_name: zod.ZodType<string & {
2520
4325
  __prisma_table: "Recipes";
2521
4326
  __prisma_field: "recipe_name";
@@ -2537,7 +4342,7 @@ declare module "packages/mws/src/managers/wiki-routes" {
2537
4342
  __prisma_field: "position";
2538
4343
  };
2539
4344
  }[]>;
2540
- handleGetBagState: ZodRoute<"GET" | "HEAD", "ignore", {
4345
+ handleGetBagState: import("packages/server/src/index").ZodRoute<"GET" | "HEAD", "ignore", {
2541
4346
  recipe_name: zod.ZodType<string & {
2542
4347
  __prisma_table: "Recipes";
2543
4348
  __prisma_field: "recipe_name";
@@ -2573,7 +4378,7 @@ declare module "packages/mws/src/managers/wiki-routes" {
2573
4378
  is_deleted: boolean;
2574
4379
  }[];
2575
4380
  }>;
2576
- handleGetAllBagStates: ZodRoute<"GET" | "HEAD", "ignore", {
4381
+ handleGetAllBagStates: import("packages/server/src/index").ZodRoute<"GET" | "HEAD", "ignore", {
2577
4382
  recipe_name: zod.ZodType<string & {
2578
4383
  __prisma_table: "Recipes";
2579
4384
  __prisma_field: "recipe_name";
@@ -2607,98 +4412,23 @@ declare module "packages/mws/src/managers/wiki-routes" {
2607
4412
  is_deleted: boolean;
2608
4413
  }[];
2609
4414
  }[]>;
2610
- rpcLoadRecipeTiddlerList: ZodRoute<"PUT", "json", {
2611
- recipe_name: zod.ZodType<string & {
2612
- __prisma_table: "Recipes";
2613
- __prisma_field: "recipe_name";
2614
- }, string, zod.z.core.$ZodTypeInternals<string & {
2615
- __prisma_table: "Recipes";
2616
- __prisma_field: "recipe_name";
2617
- }, string>>;
2618
- }, Record<string, zod.ZodType<any, string[] | undefined, zod.z.core.$ZodTypeInternals<any, string[] | undefined>>>, zod.ZodObject<{
2619
- titles: zod.ZodArray<zod.ZodType<string & {
2620
- __prisma_table: "Tiddlers";
2621
- __prisma_field: "title";
2622
- }, string, zod.z.core.$ZodTypeInternals<string & {
2623
- __prisma_table: "Tiddlers";
2624
- __prisma_field: "title";
2625
- }, string>>>;
2626
- }, zod.z.core.$strict>, TiddlerFields[]>;
2627
- handleLoadRecipeTiddler: ZodRoute<"GET" | "HEAD", "ignore", {
2628
- recipe_name: zod.ZodType<string & {
2629
- __prisma_table: "Recipes";
2630
- __prisma_field: "recipe_name";
2631
- }, string, zod.z.core.$ZodTypeInternals<string & {
2632
- __prisma_table: "Recipes";
2633
- __prisma_field: "recipe_name";
2634
- }, string>>;
2635
- title: zod.ZodType<string & {
2636
- __prisma_table: "Tiddlers";
2637
- __prisma_field: "title";
2638
- }, string, zod.z.core.$ZodTypeInternals<string & {
2639
- __prisma_table: "Tiddlers";
2640
- __prisma_field: "title";
2641
- }, string>>;
2642
- }, Record<string, zod.ZodType<any, string[] | undefined, zod.z.core.$ZodTypeInternals<any, string[] | undefined>>>, zod.ZodType<unknown, unknown, zod.z.core.$ZodTypeInternals<unknown, unknown>>, never>;
2643
- handleSaveRecipeTiddler: ZodRoute<"PUT", "string", {
2644
- recipe_name: zod.ZodType<string & {
2645
- __prisma_table: "Recipes";
2646
- __prisma_field: "recipe_name";
2647
- }, string, zod.z.core.$ZodTypeInternals<string & {
2648
- __prisma_table: "Recipes";
2649
- __prisma_field: "recipe_name";
2650
- }, string>>;
2651
- title: zod.ZodType<string & {
2652
- __prisma_table: "Tiddlers";
2653
- __prisma_field: "title";
2654
- }, string, zod.z.core.$ZodTypeInternals<string & {
2655
- __prisma_table: "Tiddlers";
2656
- __prisma_field: "title";
2657
- }, string>>;
2658
- }, Record<string, zod.ZodType<any, string[] | undefined, zod.z.core.$ZodTypeInternals<any, string[] | undefined>>>, zod.ZodString, {
2659
- bag_name: string & {
2660
- __prisma_table: "Bags";
2661
- __prisma_field: "bag_name";
2662
- };
2663
- revision_id: string & {
2664
- __prisma_table: "Tiddlers";
2665
- __prisma_field: "revision_id";
2666
- };
2667
- }>;
2668
- handleDeleteRecipeTiddler: ZodRoute<"DELETE", "json", {
2669
- recipe_name: zod.ZodType<string & {
4415
+ }
4416
+ }
4417
+ declare module "packages/mws/src/managers/wiki-external" {
4418
+ export class WikiExternalRoutes {
4419
+ handleFormMultipartRecipeTiddler: import("packages/server/src/index").ZodRoute<"POST", "stream", {
4420
+ recipe_name: import("zod/v4").ZodType<string & {
2670
4421
  __prisma_table: "Recipes";
2671
4422
  __prisma_field: "recipe_name";
2672
- }, string, zod.z.core.$ZodTypeInternals<string & {
4423
+ }, string, import("zod/v4/core").$ZodTypeInternals<string & {
2673
4424
  __prisma_table: "Recipes";
2674
4425
  __prisma_field: "recipe_name";
2675
4426
  }, string>>;
2676
- title: zod.ZodType<string & {
2677
- __prisma_table: "Tiddlers";
2678
- __prisma_field: "title";
2679
- }, string, zod.z.core.$ZodTypeInternals<string & {
2680
- __prisma_table: "Tiddlers";
2681
- __prisma_field: "title";
2682
- }, string>>;
2683
- }, Record<string, zod.ZodType<any, string[] | undefined, zod.z.core.$ZodTypeInternals<any, string[] | undefined>>>, zod.ZodUndefined, {
2684
- bag_name: string & {
4427
+ }, Record<string, import("zod/v4").ZodType<any, string[] | undefined, import("zod/v4/core").$ZodTypeInternals<any, string[] | undefined>>>, import("zod/v4").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, {
4428
+ bag_id: string & {
2685
4429
  __prisma_table: "Bags";
2686
- __prisma_field: "bag_name";
2687
- };
2688
- revision_id: string & {
2689
- __prisma_table: "Tiddlers";
2690
- __prisma_field: "revision_id";
4430
+ __prisma_field: "bag_id";
2691
4431
  };
2692
- }>;
2693
- handleFormMultipartRecipeTiddler: ZodRoute<"POST", "stream", {
2694
- recipe_name: zod.ZodType<string & {
2695
- __prisma_table: "Recipes";
2696
- __prisma_field: "recipe_name";
2697
- }, string, zod.z.core.$ZodTypeInternals<string & {
2698
- __prisma_table: "Recipes";
2699
- __prisma_field: "recipe_name";
2700
- }, string>>;
2701
- }, Record<string, zod.ZodType<any, string[] | undefined, zod.z.core.$ZodTypeInternals<any, string[] | undefined>>>, zod.ZodType<unknown, unknown, zod.z.core.$ZodTypeInternals<unknown, unknown>>, {
2702
4432
  bag_name: string & {
2703
4433
  __prisma_table: "Bags";
2704
4434
  __prisma_field: "bag_name";
@@ -2714,95 +4444,158 @@ declare module "packages/mws/src/managers/wiki-routes" {
2714
4444
  };
2715
4445
  };
2716
4446
  }>;
2717
- handleLoadBagTiddler: ZodRoute<"GET" | "HEAD", "ignore", {
2718
- bag_name: zod.ZodType<string & {
4447
+ handleLoadBagTiddler: import("packages/server/src/index").ZodRoute<"GET" | "HEAD", "ignore", {
4448
+ bag_name: import("zod/v4").ZodType<string & {
2719
4449
  __prisma_table: "Bags";
2720
4450
  __prisma_field: "bag_name";
2721
- }, string, zod.z.core.$ZodTypeInternals<string & {
4451
+ }, string, import("zod/v4/core").$ZodTypeInternals<string & {
2722
4452
  __prisma_table: "Bags";
2723
4453
  __prisma_field: "bag_name";
2724
4454
  }, string>>;
2725
- title: zod.ZodType<string & {
4455
+ title: import("zod/v4").ZodType<string & {
2726
4456
  __prisma_table: "Tiddlers";
2727
4457
  __prisma_field: "title";
2728
- }, string, zod.z.core.$ZodTypeInternals<string & {
4458
+ }, string, import("zod/v4/core").$ZodTypeInternals<string & {
2729
4459
  __prisma_table: "Tiddlers";
2730
4460
  __prisma_field: "title";
2731
4461
  }, string>>;
2732
- }, Record<string, zod.ZodType<any, string[] | undefined, zod.z.core.$ZodTypeInternals<any, string[] | undefined>>>, zod.ZodType<unknown, unknown, zod.z.core.$ZodTypeInternals<unknown, unknown>>, never>;
2733
- handleSaveBagTiddler: ZodRoute<"PUT", "string", {
2734
- bag_name: zod.ZodType<string & {
4462
+ }, Record<string, import("zod/v4").ZodType<any, string[] | undefined, import("zod/v4/core").$ZodTypeInternals<any, string[] | undefined>>>, import("zod/v4").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, never>;
4463
+ handleSaveBagTiddler: import("packages/server/src/index").ZodRoute<"PUT", "string", {
4464
+ bag_name: import("zod/v4").ZodType<string & {
2735
4465
  __prisma_table: "Bags";
2736
4466
  __prisma_field: "bag_name";
2737
- }, string, zod.z.core.$ZodTypeInternals<string & {
4467
+ }, string, import("zod/v4/core").$ZodTypeInternals<string & {
2738
4468
  __prisma_table: "Bags";
2739
4469
  __prisma_field: "bag_name";
2740
4470
  }, string>>;
2741
- title: zod.ZodType<string & {
4471
+ title: import("zod/v4").ZodType<string & {
2742
4472
  __prisma_table: "Tiddlers";
2743
4473
  __prisma_field: "title";
2744
- }, string, zod.z.core.$ZodTypeInternals<string & {
4474
+ }, string, import("zod/v4/core").$ZodTypeInternals<string & {
2745
4475
  __prisma_table: "Tiddlers";
2746
4476
  __prisma_field: "title";
2747
4477
  }, string>>;
2748
- }, Record<string, zod.ZodType<any, string[] | undefined, zod.z.core.$ZodTypeInternals<any, string[] | undefined>>>, zod.ZodString, {
4478
+ }, Record<string, import("zod/v4").ZodType<any, string[] | undefined, import("zod/v4/core").$ZodTypeInternals<any, string[] | undefined>>>, import("zod/v4").ZodString, {
4479
+ bag: {
4480
+ bag_id: string & {
4481
+ __prisma_table: "Bags";
4482
+ __prisma_field: "bag_id";
4483
+ };
4484
+ bag_name: string & {
4485
+ __prisma_table: "Bags";
4486
+ __prisma_field: "bag_name";
4487
+ };
4488
+ };
4489
+ } & {
4490
+ title: string & {
4491
+ __prisma_table: "Tiddlers";
4492
+ __prisma_field: "title";
4493
+ };
4494
+ bag_id: string & {
4495
+ __prisma_table: "Bags";
4496
+ __prisma_field: "bag_id";
4497
+ };
2749
4498
  revision_id: string & {
2750
4499
  __prisma_table: "Tiddlers";
2751
4500
  __prisma_field: "revision_id";
2752
4501
  };
4502
+ is_deleted: PrismaField<"Tiddlers", "is_deleted">;
4503
+ attachment_hash: PrismaField<"Tiddlers", "attachment_hash">;
2753
4504
  }>;
2754
- handleDeleteBagTiddler: ZodRoute<"DELETE", "ignore", {
2755
- bag_name: zod.ZodType<string & {
4505
+ handleDeleteBagTiddler: import("packages/server/src/index").ZodRoute<"DELETE", "ignore", {
4506
+ bag_name: import("zod/v4").ZodType<string & {
2756
4507
  __prisma_table: "Bags";
2757
4508
  __prisma_field: "bag_name";
2758
- }, string, zod.z.core.$ZodTypeInternals<string & {
4509
+ }, string, import("zod/v4/core").$ZodTypeInternals<string & {
2759
4510
  __prisma_table: "Bags";
2760
4511
  __prisma_field: "bag_name";
2761
4512
  }, string>>;
2762
- title: zod.ZodType<string & {
4513
+ title: import("zod/v4").ZodType<string & {
2763
4514
  __prisma_table: "Tiddlers";
2764
4515
  __prisma_field: "title";
2765
- }, string, zod.z.core.$ZodTypeInternals<string & {
4516
+ }, string, import("zod/v4/core").$ZodTypeInternals<string & {
2766
4517
  __prisma_table: "Tiddlers";
2767
4518
  __prisma_field: "title";
2768
4519
  }, string>>;
2769
- }, Record<string, zod.ZodType<any, string[] | undefined, zod.z.core.$ZodTypeInternals<any, string[] | undefined>>>, zod.ZodType<unknown, unknown, zod.z.core.$ZodTypeInternals<unknown, unknown>>, {
4520
+ }, Record<string, import("zod/v4").ZodType<any, string[] | undefined, import("zod/v4/core").$ZodTypeInternals<any, string[] | undefined>>>, import("zod/v4").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, {
4521
+ title: string & {
4522
+ __prisma_table: "Tiddlers";
4523
+ __prisma_field: "title";
4524
+ };
4525
+ bag_id: string & {
4526
+ __prisma_table: "Bags";
4527
+ __prisma_field: "bag_id";
4528
+ };
2770
4529
  revision_id: string & {
2771
4530
  __prisma_table: "Tiddlers";
2772
4531
  __prisma_field: "revision_id";
2773
4532
  };
4533
+ is_deleted: PrismaField<"Tiddlers", "is_deleted">;
4534
+ attachment_hash: PrismaField<"Tiddlers", "attachment_hash">;
2774
4535
  }>;
2775
- handleFormMultipartBagTiddler: ZodRoute<"POST", "stream", {
2776
- bag_name: zod.ZodType<string & {
4536
+ handleFormMultipartBagTiddler: import("packages/server/src/index").ZodRoute<"POST", "stream", {
4537
+ bag_name: import("zod/v4").ZodType<string & {
2777
4538
  __prisma_table: "Bags";
2778
4539
  __prisma_field: "bag_name";
2779
- }, string, zod.z.core.$ZodTypeInternals<string & {
4540
+ }, string, import("zod/v4/core").$ZodTypeInternals<string & {
2780
4541
  __prisma_table: "Bags";
2781
4542
  __prisma_field: "bag_name";
2782
4543
  }, string>>;
2783
- }, Record<string, zod.ZodType<any, string[] | undefined, zod.z.core.$ZodTypeInternals<any, string[] | undefined>>>, zod.ZodType<unknown, unknown, zod.z.core.$ZodTypeInternals<unknown, unknown>>, {
4544
+ }, Record<string, import("zod/v4").ZodType<any, string[] | undefined, import("zod/v4/core").$ZodTypeInternals<any, string[] | undefined>>>, import("zod/v4").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, {
4545
+ bag: {
4546
+ bag_id: string & {
4547
+ __prisma_table: "Bags";
4548
+ __prisma_field: "bag_id";
4549
+ };
4550
+ bag_name: string & {
4551
+ __prisma_table: "Bags";
4552
+ __prisma_field: "bag_name";
4553
+ };
4554
+ };
4555
+ } & {
4556
+ title: string & {
4557
+ __prisma_table: "Tiddlers";
4558
+ __prisma_field: "title";
4559
+ };
4560
+ bag_id: string & {
4561
+ __prisma_table: "Bags";
4562
+ __prisma_field: "bag_id";
4563
+ };
2784
4564
  revision_id: string & {
2785
4565
  __prisma_table: "Tiddlers";
2786
4566
  __prisma_field: "revision_id";
2787
4567
  };
4568
+ is_deleted: PrismaField<"Tiddlers", "is_deleted">;
4569
+ attachment_hash: PrismaField<"Tiddlers", "attachment_hash">;
2788
4570
  }>;
2789
4571
  }
2790
4572
  }
4573
+ declare module "packages/mws/src/managers/wiki-index" {
4574
+ import { WikiRecipeRoutes } from "packages/mws/src/managers/wiki-recipe";
4575
+ import { WikiStatusRoutes } from "packages/mws/src/managers/wiki-status";
4576
+ import { WikiExternalRoutes } from "packages/mws/src/managers/wiki-external";
4577
+ export { WikiExternalRoutes, WikiRecipeRoutes, WikiStatusRoutes };
4578
+ module "packages/server/src/index" {
4579
+ interface IncomingHttpHeaders {
4580
+ 'last-event-id'?: string;
4581
+ }
4582
+ }
4583
+ }
2791
4584
  declare module "packages/mws/src/managers/index" {
2792
4585
  import "packages/mws/src/managers/admin-recipes";
2793
4586
  import "packages/mws/src/managers/admin-users";
2794
4587
  import "packages/mws/src/managers/admin-settings";
2795
- import "packages/mws/src/managers/wiki-routes";
4588
+ import "packages/mws/src/managers/wiki-index";
2796
4589
  import { RouterKeyMap, RouterRouteMap, ServerRoute } from "packages/server/src/index";
2797
4590
  export * from "packages/mws/src/managers/admin-recipes";
2798
4591
  export * from "packages/mws/src/managers/admin-users";
2799
- export * from "packages/mws/src/managers/wiki-routes";
4592
+ export * from "packages/mws/src/managers/wiki-index";
2800
4593
  export const StatusKeyMap: RouterKeyMap<StatusManager, true>;
2801
4594
  export type StatusManagerMap = RouterRouteMap<StatusManager>;
2802
4595
  export class StatusManager {
2803
4596
  static defineRoutes(root: ServerRoute): void;
2804
4597
  constructor();
2805
- index_json: import("@tiddlywiki/server").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodUndefined, {
4598
+ index_json: import("packages/server/src/index").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodUndefined, {
2806
4599
  bagList: ({
2807
4600
  _count: {
2808
4601
  recipe_bags: number;
@@ -2890,6 +4683,8 @@ declare module "packages/mws/src/managers/index" {
2890
4683
  };
2891
4684
  skip_required_plugins: PrismaField<"Recipes", "skip_required_plugins">;
2892
4685
  skip_core: PrismaField<"Recipes", "skip_core">;
4686
+ preload_store: PrismaField<"Recipes", "preload_store">;
4687
+ custom_wiki: PrismaField<"Recipes", "custom_wiki">;
2893
4688
  })[];
2894
4689
  isAdmin: boolean;
2895
4690
  user_id: string & {
@@ -2968,7 +4763,7 @@ declare module "packages/mws/src/commands/build-types" {
2968
4763
  export const info: CommandInfo;
2969
4764
  export class Command extends BaseCommand<[], {}> {
2970
4765
  execute(): Promise<void>;
2971
- getEndpoints(): (readonly ["index_json", import("@tiddlywiki/server").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodUndefined, {
4766
+ getEndpoints(): (readonly ["index_json", import("packages/server/src/index").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodUndefined, {
2972
4767
  bagList: ({
2973
4768
  _count: {
2974
4769
  recipe_bags: number;
@@ -3056,6 +4851,8 @@ declare module "packages/mws/src/commands/build-types" {
3056
4851
  };
3057
4852
  skip_required_plugins: PrismaField<"Recipes", "skip_required_plugins">;
3058
4853
  skip_core: PrismaField<"Recipes", "skip_core">;
4854
+ preload_store: PrismaField<"Recipes", "preload_store">;
4855
+ custom_wiki: PrismaField<"Recipes", "custom_wiki">;
3059
4856
  })[];
3060
4857
  isAdmin: boolean;
3061
4858
  user_id: string & {
@@ -3118,495 +4915,201 @@ declare module "packages/mws/src/commands/build-types" {
3118
4915
  __prisma_field: "username";
3119
4916
  };
3120
4917
  clientPlugins: string[];
3121
- corePlugins: string[];
3122
- isLoggedIn: boolean;
3123
- allowAnonReads: false;
3124
- allowAnonWrites: false;
3125
- versions: {
3126
- tw5: any;
3127
- mws: string;
3128
- };
3129
- }>] | readonly ["user_edit_data" | "user_list" | "user_create" | "user_update" | "user_delete" | "user_update_password" | "role_create" | "role_update", import("@tiddlywiki/server").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
3130
- user_id: import("zod/v4").ZodType<string & {
3131
- __prisma_table: "Users";
3132
- __prisma_field: "user_id";
3133
- }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3134
- __prisma_table: "Users";
3135
- __prisma_field: "user_id";
3136
- }, string>>;
3137
- }, import("zod/v4/core").$strip>, {
3138
- user: {
3139
- username: string & {
3140
- __prisma_table: "Users";
3141
- __prisma_field: "username";
3142
- };
3143
- email: string & {
3144
- __prisma_table: "Users";
3145
- __prisma_field: "email";
3146
- };
3147
- roles: {
3148
- description: PrismaField<"Roles", "description">;
3149
- role_id: string & {
3150
- __prisma_table: "Roles";
3151
- __prisma_field: "role_id";
3152
- };
3153
- role_name: string & {
3154
- __prisma_table: "Roles";
3155
- __prisma_field: "role_name";
3156
- };
3157
- }[];
3158
- user_id: string & {
3159
- __prisma_table: "Users";
3160
- __prisma_field: "user_id";
3161
- };
3162
- created_at: Date & {
3163
- __prisma_table: "Users";
3164
- __prisma_field: "created_at";
3165
- };
3166
- last_login: PrismaField<"Users", "last_login">;
3167
- };
3168
- allRoles: {
3169
- description: PrismaField<"Roles", "description">;
3170
- role_id: string & {
3171
- __prisma_table: "Roles";
3172
- __prisma_field: "role_id";
3173
- };
3174
- role_name: string & {
3175
- __prisma_table: "Roles";
3176
- __prisma_field: "role_name";
3177
- };
3178
- }[];
3179
- }> | import("@tiddlywiki/server").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodUndefined, {
3180
- last_login: string | undefined;
3181
- created_at: string;
3182
- username: string & {
3183
- __prisma_table: "Users";
3184
- __prisma_field: "username";
3185
- };
3186
- email: string & {
3187
- __prisma_table: "Users";
3188
- __prisma_field: "email";
3189
- };
3190
- roles: {
3191
- description: PrismaField<"Roles", "description">;
3192
- role_id: string & {
3193
- __prisma_table: "Roles";
3194
- __prisma_field: "role_id";
3195
- };
3196
- role_name: string & {
3197
- __prisma_table: "Roles";
3198
- __prisma_field: "role_name";
3199
- };
3200
- }[];
3201
- user_id: string & {
3202
- __prisma_table: "Users";
3203
- __prisma_field: "user_id";
3204
- };
3205
- }[]> | import("@tiddlywiki/server").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
3206
- username: import("zod/v4").ZodString;
3207
- email: import("zod/v4").ZodString;
3208
- role_ids: import("zod/v4").ZodArray<import("zod/v4").ZodType<string & {
3209
- __prisma_table: "Roles";
3210
- __prisma_field: "role_id";
3211
- }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3212
- __prisma_table: "Roles";
3213
- __prisma_field: "role_id";
3214
- }, string>>>;
3215
- }, import("zod/v4/core").$strip>, {
3216
- user_id: string & {
3217
- __prisma_table: "Users";
3218
- __prisma_field: "user_id";
3219
- };
3220
- created_at: Date & {
3221
- __prisma_table: "Users";
3222
- __prisma_field: "created_at";
3223
- };
3224
- }> | import("@tiddlywiki/server").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
3225
- user_id: import("zod/v4").ZodType<string & {
3226
- __prisma_table: "Users";
3227
- __prisma_field: "user_id";
3228
- }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3229
- __prisma_table: "Users";
3230
- __prisma_field: "user_id";
3231
- }, string>>;
3232
- username: import("zod/v4").ZodType<string & {
3233
- __prisma_table: "Users";
3234
- __prisma_field: "username";
3235
- }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3236
- __prisma_table: "Users";
3237
- __prisma_field: "username";
3238
- }, string>>;
3239
- email: import("zod/v4").ZodType<string & {
3240
- __prisma_table: "Users";
3241
- __prisma_field: "email";
3242
- }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3243
- __prisma_table: "Users";
3244
- __prisma_field: "email";
3245
- }, string>>;
3246
- role_ids: import("zod/v4").ZodArray<import("zod/v4").ZodType<string & {
3247
- __prisma_table: "Roles";
3248
- __prisma_field: "role_id";
3249
- }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3250
- __prisma_table: "Roles";
3251
- __prisma_field: "role_id";
3252
- }, string>>>;
3253
- }, import("zod/v4/core").$strip>, null> | import("@tiddlywiki/server").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
3254
- user_id: import("zod/v4").ZodType<string & {
3255
- __prisma_table: "Users";
3256
- __prisma_field: "user_id";
3257
- }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3258
- __prisma_table: "Users";
3259
- __prisma_field: "user_id";
3260
- }, string>>;
3261
- }, import("zod/v4/core").$strip>, null> | import("@tiddlywiki/server").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
3262
- user_id: import("zod/v4").ZodType<string & {
3263
- __prisma_table: "Users";
3264
- __prisma_field: "user_id";
3265
- }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3266
- __prisma_table: "Users";
3267
- __prisma_field: "user_id";
3268
- }, string>>;
3269
- registrationRequest: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
3270
- registrationRecord: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
3271
- session_id: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
3272
- signature: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
3273
- }, import("zod/v4/core").$strip>, string | null> | import("@tiddlywiki/server").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
3274
- role_name: import("zod/v4").ZodString;
3275
- description: import("zod/v4").ZodString;
3276
- }, import("zod/v4/core").$strip>, {
3277
- description: PrismaField<"Roles", "description">;
3278
- role_id: string & {
3279
- __prisma_table: "Roles";
3280
- __prisma_field: "role_id";
3281
- };
3282
- role_name: string & {
3283
- __prisma_table: "Roles";
3284
- __prisma_field: "role_name";
3285
- };
3286
- }> | import("@tiddlywiki/server").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
3287
- role_id: import("zod/v4").ZodType<string & {
3288
- __prisma_table: "Roles";
3289
- __prisma_field: "role_id";
3290
- }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3291
- __prisma_table: "Roles";
3292
- __prisma_field: "role_id";
3293
- }, string>>;
3294
- role_name: import("zod/v4").ZodType<string & {
3295
- __prisma_table: "Roles";
3296
- __prisma_field: "role_name";
3297
- }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3298
- __prisma_table: "Roles";
3299
- __prisma_field: "role_name";
3300
- }, string>>;
3301
- description: import("zod/v4").ZodType<PrismaField<"Roles", "description">, string | null, import("zod/v4/core").$ZodTypeInternals<PrismaField<"Roles", "description">, string | null>>;
3302
- }, import("zod/v4/core").$strip>, {
3303
- description: PrismaField<"Roles", "description">;
3304
- role_id: string & {
3305
- __prisma_table: "Roles";
3306
- __prisma_field: "role_id";
3307
- };
3308
- role_name: string & {
3309
- __prisma_table: "Roles";
3310
- __prisma_field: "role_name";
3311
- };
3312
- }>] | readonly ["recipe_create_or_update" | "bag_create_or_update" | "recipe_delete" | "bag_delete" | "recipe_acl_update" | "bag_acl_update", import("@tiddlywiki/server").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
3313
- recipe_name: import("zod/v4").ZodType<string & {
3314
- __prisma_table: "Recipes";
3315
- __prisma_field: "recipe_name";
3316
- }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3317
- __prisma_table: "Recipes";
3318
- __prisma_field: "recipe_name";
3319
- }, string>>;
3320
- description: import("zod/v4").ZodType<string & {
3321
- __prisma_table: "Recipes";
3322
- __prisma_field: "description";
3323
- }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3324
- __prisma_table: "Recipes";
3325
- __prisma_field: "description";
3326
- }, string>>;
3327
- bag_names: import("zod/v4").ZodArray<import("zod/v4").ZodObject<{
3328
- bag_name: import("zod/v4").ZodString;
3329
- with_acl: import("zod/v4").ZodBoolean;
3330
- }, import("zod/v4/core").$strip>>;
3331
- plugin_names: import("zod/v4").ZodArray<import("zod/v4").ZodString>;
3332
- owner_id: import("zod/v4").ZodOptional<import("zod/v4").ZodType<PrismaField<"Recipes", "owner_id">, string | null, import("zod/v4/core").$ZodTypeInternals<PrismaField<"Recipes", "owner_id">, string | null>>>;
3333
- skip_required_plugins: import("zod/v4").ZodType<PrismaField<"Recipes", "skip_required_plugins">, boolean, import("zod/v4/core").$ZodTypeInternals<PrismaField<"Recipes", "skip_required_plugins">, boolean>>;
3334
- skip_core: import("zod/v4").ZodType<PrismaField<"Recipes", "skip_core">, boolean, import("zod/v4/core").$ZodTypeInternals<PrismaField<"Recipes", "skip_core">, boolean>>;
3335
- create_only: import("zod/v4").ZodBoolean;
3336
- }, import("zod/v4/core").$strip>, {
3337
- description: string & {
3338
- __prisma_table: "Recipes";
3339
- __prisma_field: "description";
3340
- };
3341
- recipe_id: string & {
3342
- __prisma_table: "Recipes";
3343
- __prisma_field: "recipe_id";
3344
- };
3345
- recipe_name: string & {
3346
- __prisma_table: "Recipes";
3347
- __prisma_field: "recipe_name";
3348
- };
3349
- owner_id: PrismaField<"Recipes", "owner_id">;
3350
- plugin_names: PrismaJson.Recipes_plugin_names & {
3351
- __prisma_table: "Recipes";
3352
- __prisma_field: "plugin_names";
4918
+ corePlugins: string[];
4919
+ isLoggedIn: boolean;
4920
+ allowAnonReads: false;
4921
+ allowAnonWrites: false;
4922
+ versions: {
4923
+ tw5: any;
4924
+ mws: string;
3353
4925
  };
3354
- skip_required_plugins: PrismaField<"Recipes", "skip_required_plugins">;
3355
- skip_core: PrismaField<"Recipes", "skip_core">;
3356
- }> | import("@tiddlywiki/server").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
3357
- bag_name: import("zod/v4").ZodType<string & {
3358
- __prisma_table: "Bags";
3359
- __prisma_field: "bag_name";
3360
- }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3361
- __prisma_table: "Bags";
3362
- __prisma_field: "bag_name";
3363
- }, string>>;
3364
- description: import("zod/v4").ZodType<string & {
3365
- __prisma_table: "Bags";
3366
- __prisma_field: "description";
4926
+ }>] | readonly ["user_edit_data" | "user_list" | "user_create" | "user_update" | "user_delete" | "user_update_password" | "role_create" | "role_update", import("packages/server/src/index").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
4927
+ user_id: import("zod/v4").ZodType<string & {
4928
+ __prisma_table: "Users";
4929
+ __prisma_field: "user_id";
3367
4930
  }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3368
- __prisma_table: "Bags";
3369
- __prisma_field: "description";
4931
+ __prisma_table: "Users";
4932
+ __prisma_field: "user_id";
3370
4933
  }, string>>;
3371
- owner_id: import("zod/v4").ZodOptional<import("zod/v4").ZodType<PrismaField<"Bags", "owner_id">, string | null, import("zod/v4/core").$ZodTypeInternals<PrismaField<"Bags", "owner_id">, string | null>>>;
3372
- create_only: import("zod/v4").ZodBoolean;
3373
4934
  }, import("zod/v4/core").$strip>, {
3374
- description: string & {
3375
- __prisma_table: "Bags";
3376
- __prisma_field: "description";
3377
- };
3378
- owner_id: PrismaField<"Bags", "owner_id">;
3379
- bag_id: string & {
3380
- __prisma_table: "Bags";
3381
- __prisma_field: "bag_id";
3382
- };
3383
- bag_name: string & {
3384
- __prisma_table: "Bags";
3385
- __prisma_field: "bag_name";
4935
+ user: {
4936
+ username: string & {
4937
+ __prisma_table: "Users";
4938
+ __prisma_field: "username";
4939
+ };
4940
+ email: string & {
4941
+ __prisma_table: "Users";
4942
+ __prisma_field: "email";
4943
+ };
4944
+ roles: {
4945
+ description: PrismaField<"Roles", "description">;
4946
+ role_id: string & {
4947
+ __prisma_table: "Roles";
4948
+ __prisma_field: "role_id";
4949
+ };
4950
+ role_name: string & {
4951
+ __prisma_table: "Roles";
4952
+ __prisma_field: "role_name";
4953
+ };
4954
+ }[];
4955
+ user_id: string & {
4956
+ __prisma_table: "Users";
4957
+ __prisma_field: "user_id";
4958
+ };
4959
+ created_at: Date & {
4960
+ __prisma_table: "Users";
4961
+ __prisma_field: "created_at";
4962
+ };
4963
+ last_login: PrismaField<"Users", "last_login">;
3386
4964
  };
3387
- }> | import("@tiddlywiki/server").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
3388
- recipe_name: import("zod/v4").ZodString;
3389
- }, import("zod/v4/core").$strip>, null> | import("@tiddlywiki/server").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
3390
- bag_name: import("zod/v4").ZodString;
3391
- }, import("zod/v4/core").$strip>, null> | import("@tiddlywiki/server").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
3392
- recipe_name: import("zod/v4").ZodType<string & {
3393
- __prisma_table: "Recipes";
3394
- __prisma_field: "recipe_name";
3395
- }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3396
- __prisma_table: "Recipes";
3397
- __prisma_field: "recipe_name";
3398
- }, string>>;
3399
- acl: import("zod/v4").ZodArray<import("zod/v4").ZodObject<{
3400
- role_id: import("zod/v4").ZodType<string & {
4965
+ allRoles: {
4966
+ description: PrismaField<"Roles", "description">;
4967
+ role_id: string & {
3401
4968
  __prisma_table: "Roles";
3402
4969
  __prisma_field: "role_id";
3403
- }, string, import("zod/v4/core").$ZodTypeInternals<string & {
4970
+ };
4971
+ role_name: string & {
3404
4972
  __prisma_table: "Roles";
3405
- __prisma_field: "role_id";
3406
- }, string>>;
3407
- permission: import("zod/v4").ZodEnum<{
3408
- READ: "READ";
3409
- WRITE: "WRITE";
3410
- ADMIN: "ADMIN";
3411
- }>;
3412
- }, import("zod/v4/core").$strip>>;
3413
- }, import("zod/v4/core").$strip>, null> | import("@tiddlywiki/server").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
3414
- bag_name: import("zod/v4").ZodType<string & {
3415
- __prisma_table: "Bags";
3416
- __prisma_field: "bag_name";
3417
- }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3418
- __prisma_table: "Bags";
3419
- __prisma_field: "bag_name";
3420
- }, string>>;
3421
- acl: import("zod/v4").ZodArray<import("zod/v4").ZodObject<{
3422
- role_id: import("zod/v4").ZodType<string & {
4973
+ __prisma_field: "role_name";
4974
+ };
4975
+ }[];
4976
+ }> | import("packages/server/src/index").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodUndefined, {
4977
+ username: string & {
4978
+ __prisma_table: "Users";
4979
+ __prisma_field: "username";
4980
+ };
4981
+ email: string & {
4982
+ __prisma_table: "Users";
4983
+ __prisma_field: "email";
4984
+ };
4985
+ roles: {
4986
+ description: PrismaField<"Roles", "description">;
4987
+ role_id: string & {
3423
4988
  __prisma_table: "Roles";
3424
4989
  __prisma_field: "role_id";
3425
- }, string, import("zod/v4/core").$ZodTypeInternals<string & {
4990
+ };
4991
+ role_name: string & {
3426
4992
  __prisma_table: "Roles";
3427
- __prisma_field: "role_id";
3428
- }, string>>;
3429
- permission: import("zod/v4").ZodEnum<{
3430
- READ: "READ";
3431
- WRITE: "WRITE";
3432
- ADMIN: "ADMIN";
3433
- }>;
3434
- }, import("zod/v4/core").$strip>>;
3435
- }, import("zod/v4/core").$strip>, null>] | readonly ["handleGetRecipeStatus" | "handleGetRecipeEvents" | "handleGetBags" | "handleGetBagState" | "handleGetAllBagStates" | "rpcLoadRecipeTiddlerList" | "handleLoadRecipeTiddler" | "handleSaveRecipeTiddler" | "handleDeleteRecipeTiddler" | "handleFormMultipartRecipeTiddler" | "handleLoadBagTiddler" | "handleSaveBagTiddler" | "handleDeleteBagTiddler" | "handleFormMultipartBagTiddler", import("@tiddlywiki/server").ZodRoute<"GET" | "HEAD", "ignore", {
3436
- recipe_name: import("zod/v4").ZodType<string & {
3437
- __prisma_table: "Recipes";
3438
- __prisma_field: "recipe_name";
3439
- }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3440
- __prisma_table: "Recipes";
3441
- __prisma_field: "recipe_name";
3442
- }, string>>;
3443
- }, Record<string, import("zod/v4").ZodType<any, string[] | undefined, import("zod/v4/core").$ZodTypeInternals<any, string[] | undefined>>>, import("zod/v4").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, {
3444
- isAdmin: boolean;
4993
+ __prisma_field: "role_name";
4994
+ };
4995
+ }[];
3445
4996
  user_id: string & {
3446
4997
  __prisma_table: "Users";
3447
4998
  __prisma_field: "user_id";
3448
4999
  };
3449
- username: string & {
5000
+ created_at: Date & {
3450
5001
  __prisma_table: "Users";
3451
- __prisma_field: "username";
5002
+ __prisma_field: "created_at";
3452
5003
  };
3453
- isLoggedIn: boolean;
3454
- isReadOnly: boolean;
3455
- }> | import("@tiddlywiki/server").ZodRoute<"GET" | "HEAD", "ignore", {
3456
- recipe_name: import("zod/v4").ZodType<string & {
3457
- __prisma_table: "Recipes";
3458
- __prisma_field: "recipe_name";
3459
- }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3460
- __prisma_table: "Recipes";
3461
- __prisma_field: "recipe_name";
3462
- }, string>>;
3463
- }, {
3464
- "first-event-id": import("zod/v4").ZodOptional<import("zod/v4").ZodArray<import("zod/v4").ZodString>>;
3465
- }, import("zod/v4").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, never> | import("@tiddlywiki/server").ZodRoute<"GET" | "HEAD", "ignore", {
3466
- recipe_name: import("zod/v4").ZodType<string & {
3467
- __prisma_table: "Recipes";
3468
- __prisma_field: "recipe_name";
5004
+ last_login: PrismaField<"Users", "last_login">;
5005
+ }[]> | import("packages/server/src/index").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
5006
+ username: import("zod/v4").ZodString;
5007
+ email: import("zod/v4").ZodString;
5008
+ role_ids: import("zod/v4").ZodArray<import("zod/v4").ZodType<string & {
5009
+ __prisma_table: "Roles";
5010
+ __prisma_field: "role_id";
3469
5011
  }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3470
- __prisma_table: "Recipes";
3471
- __prisma_field: "recipe_name";
3472
- }, string>>;
3473
- }, Record<string, import("zod/v4").ZodType<any, string[] | undefined, import("zod/v4/core").$ZodTypeInternals<any, string[] | undefined>>>, import("zod/v4").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, {
3474
- bag_id: string & {
3475
- __prisma_table: "Bags";
3476
- __prisma_field: "bag_id";
3477
- };
3478
- bag_name: string & {
3479
- __prisma_table: "Bags";
3480
- __prisma_field: "bag_name";
5012
+ __prisma_table: "Roles";
5013
+ __prisma_field: "role_id";
5014
+ }, string>>>;
5015
+ }, import("zod/v4/core").$strip>, {
5016
+ user_id: string & {
5017
+ __prisma_table: "Users";
5018
+ __prisma_field: "user_id";
3481
5019
  };
3482
- position: number & {
3483
- __prisma_table: "Recipe_bags";
3484
- __prisma_field: "position";
5020
+ created_at: Date & {
5021
+ __prisma_table: "Users";
5022
+ __prisma_field: "created_at";
3485
5023
  };
3486
- }[]> | import("@tiddlywiki/server").ZodRoute<"GET" | "HEAD", "ignore", {
3487
- recipe_name: import("zod/v4").ZodType<string & {
3488
- __prisma_table: "Recipes";
3489
- __prisma_field: "recipe_name";
3490
- }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3491
- __prisma_table: "Recipes";
3492
- __prisma_field: "recipe_name";
3493
- }, string>>;
3494
- bag_name: import("zod/v4").ZodType<string & {
3495
- __prisma_table: "Bags";
3496
- __prisma_field: "bag_name";
3497
- }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3498
- __prisma_table: "Bags";
3499
- __prisma_field: "bag_name";
3500
- }, string>>;
3501
- }, {
3502
- last_known_revision_id: import("zod/v4").ZodOptional<import("zod/v4").ZodArray<import("zod/v4").ZodType<string & {
3503
- __prisma_table: "Tiddlers";
3504
- __prisma_field: "revision_id";
3505
- }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3506
- __prisma_table: "Tiddlers";
3507
- __prisma_field: "revision_id";
3508
- }, string>>>>;
3509
- include_deleted: import("zod/v4").ZodOptional<import("zod/v4").ZodArray<import("zod/v4").ZodEnum<{
3510
- yes: "yes";
3511
- no: "no";
3512
- }>>>;
3513
- }, import("zod/v4").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, {
3514
- bag_id: string;
3515
- bag_name: string;
3516
- tiddlers: {
3517
- title: string;
3518
- revision_id: string;
3519
- is_deleted: boolean;
3520
- }[];
3521
- }> | import("@tiddlywiki/server").ZodRoute<"GET" | "HEAD", "ignore", {
3522
- recipe_name: import("zod/v4").ZodType<string & {
3523
- __prisma_table: "Recipes";
3524
- __prisma_field: "recipe_name";
5024
+ }> | import("packages/server/src/index").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
5025
+ user_id: import("zod/v4").ZodType<string & {
5026
+ __prisma_table: "Users";
5027
+ __prisma_field: "user_id";
3525
5028
  }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3526
- __prisma_table: "Recipes";
3527
- __prisma_field: "recipe_name";
5029
+ __prisma_table: "Users";
5030
+ __prisma_field: "user_id";
3528
5031
  }, string>>;
3529
- }, {
3530
- last_known_revision_id: import("zod/v4").ZodOptional<import("zod/v4").ZodArray<import("zod/v4").ZodType<string & {
3531
- __prisma_table: "Tiddlers";
3532
- __prisma_field: "revision_id";
5032
+ username: import("zod/v4").ZodType<string & {
5033
+ __prisma_table: "Users";
5034
+ __prisma_field: "username";
3533
5035
  }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3534
- __prisma_table: "Tiddlers";
3535
- __prisma_field: "revision_id";
3536
- }, string>>>>;
3537
- include_deleted: import("zod/v4").ZodOptional<import("zod/v4").ZodArray<import("zod/v4").ZodEnum<{
3538
- yes: "yes";
3539
- no: "no";
3540
- }>>>;
3541
- gzip_stream: import("zod/v4").ZodOptional<import("zod/v4").ZodArray<import("zod/v4").ZodEnum<{
3542
- yes: "yes";
3543
- no: "no";
3544
- }>>>;
3545
- }, import("zod/v4").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, {
3546
- bag_id: string;
3547
- bag_name: string;
3548
- position: number;
3549
- tiddlers: {
3550
- title: string;
3551
- revision_id: string;
3552
- is_deleted: boolean;
3553
- }[];
3554
- }[]> | import("@tiddlywiki/server").ZodRoute<"PUT", "json", {
3555
- recipe_name: import("zod/v4").ZodType<string & {
3556
- __prisma_table: "Recipes";
3557
- __prisma_field: "recipe_name";
5036
+ __prisma_table: "Users";
5037
+ __prisma_field: "username";
5038
+ }, string>>;
5039
+ email: import("zod/v4").ZodType<string & {
5040
+ __prisma_table: "Users";
5041
+ __prisma_field: "email";
3558
5042
  }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3559
- __prisma_table: "Recipes";
3560
- __prisma_field: "recipe_name";
5043
+ __prisma_table: "Users";
5044
+ __prisma_field: "email";
3561
5045
  }, string>>;
3562
- }, Record<string, import("zod/v4").ZodType<any, string[] | undefined, import("zod/v4/core").$ZodTypeInternals<any, string[] | undefined>>>, import("zod/v4").ZodObject<{
3563
- titles: import("zod/v4").ZodArray<import("zod/v4").ZodType<string & {
3564
- __prisma_table: "Tiddlers";
3565
- __prisma_field: "title";
5046
+ role_ids: import("zod/v4").ZodArray<import("zod/v4").ZodType<string & {
5047
+ __prisma_table: "Roles";
5048
+ __prisma_field: "role_id";
3566
5049
  }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3567
- __prisma_table: "Tiddlers";
3568
- __prisma_field: "title";
5050
+ __prisma_table: "Roles";
5051
+ __prisma_field: "role_id";
3569
5052
  }, string>>>;
3570
- }, import("zod/v4/core").$strict>, import("tiddlywiki").TiddlerFields[]> | import("@tiddlywiki/server").ZodRoute<"GET" | "HEAD", "ignore", {
3571
- recipe_name: import("zod/v4").ZodType<string & {
3572
- __prisma_table: "Recipes";
3573
- __prisma_field: "recipe_name";
5053
+ }, import("zod/v4/core").$strip>, null> | import("packages/server/src/index").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
5054
+ user_id: import("zod/v4").ZodType<string & {
5055
+ __prisma_table: "Users";
5056
+ __prisma_field: "user_id";
3574
5057
  }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3575
- __prisma_table: "Recipes";
3576
- __prisma_field: "recipe_name";
5058
+ __prisma_table: "Users";
5059
+ __prisma_field: "user_id";
3577
5060
  }, string>>;
3578
- title: import("zod/v4").ZodType<string & {
3579
- __prisma_table: "Tiddlers";
3580
- __prisma_field: "title";
5061
+ }, import("zod/v4/core").$strip>, null> | import("packages/server/src/index").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
5062
+ user_id: import("zod/v4").ZodType<string & {
5063
+ __prisma_table: "Users";
5064
+ __prisma_field: "user_id";
3581
5065
  }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3582
- __prisma_table: "Tiddlers";
3583
- __prisma_field: "title";
5066
+ __prisma_table: "Users";
5067
+ __prisma_field: "user_id";
3584
5068
  }, string>>;
3585
- }, Record<string, import("zod/v4").ZodType<any, string[] | undefined, import("zod/v4/core").$ZodTypeInternals<any, string[] | undefined>>>, import("zod/v4").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, never> | import("@tiddlywiki/server").ZodRoute<"PUT", "string", {
3586
- recipe_name: import("zod/v4").ZodType<string & {
3587
- __prisma_table: "Recipes";
3588
- __prisma_field: "recipe_name";
5069
+ registrationRequest: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
5070
+ registrationRecord: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
5071
+ session_id: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
5072
+ signature: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
5073
+ }, import("zod/v4/core").$strip>, string | null> | import("packages/server/src/index").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
5074
+ role_name: import("zod/v4").ZodString;
5075
+ description: import("zod/v4").ZodString;
5076
+ }, import("zod/v4/core").$strip>, {
5077
+ description: PrismaField<"Roles", "description">;
5078
+ role_id: string & {
5079
+ __prisma_table: "Roles";
5080
+ __prisma_field: "role_id";
5081
+ };
5082
+ role_name: string & {
5083
+ __prisma_table: "Roles";
5084
+ __prisma_field: "role_name";
5085
+ };
5086
+ }> | import("packages/server/src/index").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
5087
+ role_id: import("zod/v4").ZodType<string & {
5088
+ __prisma_table: "Roles";
5089
+ __prisma_field: "role_id";
3589
5090
  }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3590
- __prisma_table: "Recipes";
3591
- __prisma_field: "recipe_name";
5091
+ __prisma_table: "Roles";
5092
+ __prisma_field: "role_id";
3592
5093
  }, string>>;
3593
- title: import("zod/v4").ZodType<string & {
3594
- __prisma_table: "Tiddlers";
3595
- __prisma_field: "title";
5094
+ role_name: import("zod/v4").ZodType<string & {
5095
+ __prisma_table: "Roles";
5096
+ __prisma_field: "role_name";
3596
5097
  }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3597
- __prisma_table: "Tiddlers";
3598
- __prisma_field: "title";
5098
+ __prisma_table: "Roles";
5099
+ __prisma_field: "role_name";
3599
5100
  }, string>>;
3600
- }, Record<string, import("zod/v4").ZodType<any, string[] | undefined, import("zod/v4/core").$ZodTypeInternals<any, string[] | undefined>>>, import("zod/v4").ZodString, {
3601
- bag_name: string & {
3602
- __prisma_table: "Bags";
3603
- __prisma_field: "bag_name";
5101
+ description: import("zod/v4").ZodType<PrismaField<"Roles", "description">, string | null, import("zod/v4/core").$ZodTypeInternals<PrismaField<"Roles", "description">, string | null>>;
5102
+ }, import("zod/v4/core").$strip>, {
5103
+ description: PrismaField<"Roles", "description">;
5104
+ role_id: string & {
5105
+ __prisma_table: "Roles";
5106
+ __prisma_field: "role_id";
3604
5107
  };
3605
- revision_id: string & {
3606
- __prisma_table: "Tiddlers";
3607
- __prisma_field: "revision_id";
5108
+ role_name: string & {
5109
+ __prisma_table: "Roles";
5110
+ __prisma_field: "role_name";
3608
5111
  };
3609
- }> | import("@tiddlywiki/server").ZodRoute<"DELETE", "json", {
5112
+ }>] | readonly ["recipe_create_or_update" | "bag_create_or_update" | "recipe_delete" | "bag_delete" | "recipe_acl_update" | "bag_acl_update", import("packages/server/src/index").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
3610
5113
  recipe_name: import("zod/v4").ZodType<string & {
3611
5114
  __prisma_table: "Recipes";
3612
5115
  __prisma_field: "recipe_name";
@@ -3614,46 +5117,47 @@ declare module "packages/mws/src/commands/build-types" {
3614
5117
  __prisma_table: "Recipes";
3615
5118
  __prisma_field: "recipe_name";
3616
5119
  }, string>>;
3617
- title: import("zod/v4").ZodType<string & {
3618
- __prisma_table: "Tiddlers";
3619
- __prisma_field: "title";
5120
+ description: import("zod/v4").ZodType<string & {
5121
+ __prisma_table: "Recipes";
5122
+ __prisma_field: "description";
3620
5123
  }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3621
- __prisma_table: "Tiddlers";
3622
- __prisma_field: "title";
5124
+ __prisma_table: "Recipes";
5125
+ __prisma_field: "description";
3623
5126
  }, string>>;
3624
- }, Record<string, import("zod/v4").ZodType<any, string[] | undefined, import("zod/v4/core").$ZodTypeInternals<any, string[] | undefined>>>, import("zod/v4").ZodUndefined, {
3625
- bag_name: string & {
3626
- __prisma_table: "Bags";
3627
- __prisma_field: "bag_name";
3628
- };
3629
- revision_id: string & {
3630
- __prisma_table: "Tiddlers";
3631
- __prisma_field: "revision_id";
5127
+ bag_names: import("zod/v4").ZodArray<import("zod/v4").ZodObject<{
5128
+ bag_name: import("zod/v4").ZodString;
5129
+ with_acl: import("zod/v4").ZodBoolean;
5130
+ }, import("zod/v4/core").$strip>>;
5131
+ plugin_names: import("zod/v4").ZodArray<import("zod/v4").ZodString>;
5132
+ owner_id: import("zod/v4").ZodOptional<import("zod/v4").ZodType<PrismaField<"Recipes", "owner_id">, string | null, import("zod/v4/core").$ZodTypeInternals<PrismaField<"Recipes", "owner_id">, string | null>>>;
5133
+ skip_required_plugins: import("zod/v4").ZodType<PrismaField<"Recipes", "skip_required_plugins">, boolean, import("zod/v4/core").$ZodTypeInternals<PrismaField<"Recipes", "skip_required_plugins">, boolean>>;
5134
+ skip_core: import("zod/v4").ZodType<PrismaField<"Recipes", "skip_core">, boolean, import("zod/v4/core").$ZodTypeInternals<PrismaField<"Recipes", "skip_core">, boolean>>;
5135
+ preload_store: import("zod/v4").ZodType<PrismaField<"Recipes", "preload_store">, boolean, import("zod/v4/core").$ZodTypeInternals<PrismaField<"Recipes", "preload_store">, boolean>>;
5136
+ custom_wiki: import("zod/v4").ZodType<PrismaField<"Recipes", "custom_wiki">, string | null, import("zod/v4/core").$ZodTypeInternals<PrismaField<"Recipes", "custom_wiki">, string | null>>;
5137
+ create_only: import("zod/v4").ZodBoolean;
5138
+ }, import("zod/v4/core").$strip>, {
5139
+ description: string & {
5140
+ __prisma_table: "Recipes";
5141
+ __prisma_field: "description";
3632
5142
  };
3633
- }> | import("@tiddlywiki/server").ZodRoute<"POST", "stream", {
3634
- recipe_name: import("zod/v4").ZodType<string & {
5143
+ recipe_id: string & {
3635
5144
  __prisma_table: "Recipes";
3636
- __prisma_field: "recipe_name";
3637
- }, string, import("zod/v4/core").$ZodTypeInternals<string & {
5145
+ __prisma_field: "recipe_id";
5146
+ };
5147
+ recipe_name: string & {
3638
5148
  __prisma_table: "Recipes";
3639
5149
  __prisma_field: "recipe_name";
3640
- }, string>>;
3641
- }, Record<string, import("zod/v4").ZodType<any, string[] | undefined, import("zod/v4/core").$ZodTypeInternals<any, string[] | undefined>>>, import("zod/v4").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, {
3642
- bag_name: string & {
3643
- __prisma_table: "Bags";
3644
- __prisma_field: "bag_name";
3645
5150
  };
3646
- results: {
3647
- revision_id: string & {
3648
- __prisma_table: "Tiddlers";
3649
- __prisma_field: "revision_id";
3650
- };
3651
- bag_name: string & {
3652
- __prisma_table: "Bags";
3653
- __prisma_field: "bag_name";
3654
- };
5151
+ owner_id: PrismaField<"Recipes", "owner_id">;
5152
+ plugin_names: PrismaJson.Recipes_plugin_names & {
5153
+ __prisma_table: "Recipes";
5154
+ __prisma_field: "plugin_names";
3655
5155
  };
3656
- }> | import("@tiddlywiki/server").ZodRoute<"GET" | "HEAD", "ignore", {
5156
+ skip_required_plugins: PrismaField<"Recipes", "skip_required_plugins">;
5157
+ skip_core: PrismaField<"Recipes", "skip_core">;
5158
+ preload_store: PrismaField<"Recipes", "preload_store">;
5159
+ custom_wiki: PrismaField<"Recipes", "custom_wiki">;
5160
+ }> | import("packages/server/src/index").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
3657
5161
  bag_name: import("zod/v4").ZodType<string & {
3658
5162
  __prisma_table: "Bags";
3659
5163
  __prisma_field: "bag_name";
@@ -3661,54 +5165,56 @@ declare module "packages/mws/src/commands/build-types" {
3661
5165
  __prisma_table: "Bags";
3662
5166
  __prisma_field: "bag_name";
3663
5167
  }, string>>;
3664
- title: import("zod/v4").ZodType<string & {
3665
- __prisma_table: "Tiddlers";
3666
- __prisma_field: "title";
3667
- }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3668
- __prisma_table: "Tiddlers";
3669
- __prisma_field: "title";
3670
- }, string>>;
3671
- }, Record<string, import("zod/v4").ZodType<any, string[] | undefined, import("zod/v4/core").$ZodTypeInternals<any, string[] | undefined>>>, import("zod/v4").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, never> | import("@tiddlywiki/server").ZodRoute<"PUT", "string", {
3672
- bag_name: import("zod/v4").ZodType<string & {
5168
+ description: import("zod/v4").ZodType<string & {
3673
5169
  __prisma_table: "Bags";
3674
- __prisma_field: "bag_name";
5170
+ __prisma_field: "description";
3675
5171
  }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3676
5172
  __prisma_table: "Bags";
3677
- __prisma_field: "bag_name";
3678
- }, string>>;
3679
- title: import("zod/v4").ZodType<string & {
3680
- __prisma_table: "Tiddlers";
3681
- __prisma_field: "title";
3682
- }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3683
- __prisma_table: "Tiddlers";
3684
- __prisma_field: "title";
5173
+ __prisma_field: "description";
3685
5174
  }, string>>;
3686
- }, Record<string, import("zod/v4").ZodType<any, string[] | undefined, import("zod/v4/core").$ZodTypeInternals<any, string[] | undefined>>>, import("zod/v4").ZodString, {
3687
- revision_id: string & {
3688
- __prisma_table: "Tiddlers";
3689
- __prisma_field: "revision_id";
5175
+ owner_id: import("zod/v4").ZodOptional<import("zod/v4").ZodType<PrismaField<"Bags", "owner_id">, string | null, import("zod/v4/core").$ZodTypeInternals<PrismaField<"Bags", "owner_id">, string | null>>>;
5176
+ create_only: import("zod/v4").ZodBoolean;
5177
+ }, import("zod/v4/core").$strip>, {
5178
+ description: string & {
5179
+ __prisma_table: "Bags";
5180
+ __prisma_field: "description";
3690
5181
  };
3691
- }> | import("@tiddlywiki/server").ZodRoute<"DELETE", "ignore", {
3692
- bag_name: import("zod/v4").ZodType<string & {
5182
+ owner_id: PrismaField<"Bags", "owner_id">;
5183
+ bag_id: string & {
3693
5184
  __prisma_table: "Bags";
3694
- __prisma_field: "bag_name";
3695
- }, string, import("zod/v4/core").$ZodTypeInternals<string & {
5185
+ __prisma_field: "bag_id";
5186
+ };
5187
+ bag_name: string & {
3696
5188
  __prisma_table: "Bags";
3697
5189
  __prisma_field: "bag_name";
3698
- }, string>>;
3699
- title: import("zod/v4").ZodType<string & {
3700
- __prisma_table: "Tiddlers";
3701
- __prisma_field: "title";
5190
+ };
5191
+ }> | import("packages/server/src/index").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
5192
+ recipe_name: import("zod/v4").ZodString;
5193
+ }, import("zod/v4/core").$strip>, null> | import("packages/server/src/index").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
5194
+ bag_name: import("zod/v4").ZodString;
5195
+ }, import("zod/v4/core").$strip>, null> | import("packages/server/src/index").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
5196
+ recipe_name: import("zod/v4").ZodType<string & {
5197
+ __prisma_table: "Recipes";
5198
+ __prisma_field: "recipe_name";
3702
5199
  }, string, import("zod/v4/core").$ZodTypeInternals<string & {
3703
- __prisma_table: "Tiddlers";
3704
- __prisma_field: "title";
5200
+ __prisma_table: "Recipes";
5201
+ __prisma_field: "recipe_name";
3705
5202
  }, string>>;
3706
- }, Record<string, import("zod/v4").ZodType<any, string[] | undefined, import("zod/v4/core").$ZodTypeInternals<any, string[] | undefined>>>, import("zod/v4").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, {
3707
- revision_id: string & {
3708
- __prisma_table: "Tiddlers";
3709
- __prisma_field: "revision_id";
3710
- };
3711
- }> | import("@tiddlywiki/server").ZodRoute<"POST", "stream", {
5203
+ acl: import("zod/v4").ZodArray<import("zod/v4").ZodObject<{
5204
+ role_id: import("zod/v4").ZodType<string & {
5205
+ __prisma_table: "Roles";
5206
+ __prisma_field: "role_id";
5207
+ }, string, import("zod/v4/core").$ZodTypeInternals<string & {
5208
+ __prisma_table: "Roles";
5209
+ __prisma_field: "role_id";
5210
+ }, string>>;
5211
+ permission: import("zod/v4").ZodEnum<{
5212
+ READ: "READ";
5213
+ WRITE: "WRITE";
5214
+ ADMIN: "ADMIN";
5215
+ }>;
5216
+ }, import("zod/v4/core").$strip>>;
5217
+ }, import("zod/v4/core").$strip>, null> | import("packages/server/src/index").ZodRoute<"POST", "json", {}, {}, import("zod/v4").ZodObject<{
3712
5218
  bag_name: import("zod/v4").ZodType<string & {
3713
5219
  __prisma_table: "Bags";
3714
5220
  __prisma_field: "bag_name";
@@ -3716,12 +5222,21 @@ declare module "packages/mws/src/commands/build-types" {
3716
5222
  __prisma_table: "Bags";
3717
5223
  __prisma_field: "bag_name";
3718
5224
  }, string>>;
3719
- }, Record<string, import("zod/v4").ZodType<any, string[] | undefined, import("zod/v4/core").$ZodTypeInternals<any, string[] | undefined>>>, import("zod/v4").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>, {
3720
- revision_id: string & {
3721
- __prisma_table: "Tiddlers";
3722
- __prisma_field: "revision_id";
3723
- };
3724
- }>])[];
5225
+ acl: import("zod/v4").ZodArray<import("zod/v4").ZodObject<{
5226
+ role_id: import("zod/v4").ZodType<string & {
5227
+ __prisma_table: "Roles";
5228
+ __prisma_field: "role_id";
5229
+ }, string, import("zod/v4/core").$ZodTypeInternals<string & {
5230
+ __prisma_table: "Roles";
5231
+ __prisma_field: "role_id";
5232
+ }, string>>;
5233
+ permission: import("zod/v4").ZodEnum<{
5234
+ READ: "READ";
5235
+ WRITE: "WRITE";
5236
+ ADMIN: "ADMIN";
5237
+ }>;
5238
+ }, import("zod/v4/core").$strip>>;
5239
+ }, import("zod/v4/core").$strip>, null>])[];
3725
5240
  }
3726
5241
  }
3727
5242
  declare module "packages/mws/src/commands/listen" {
@@ -3770,7 +5285,7 @@ declare module "packages/mws/src/commands/index" {
3770
5285
  };
3771
5286
  }
3772
5287
  declare module "packages/mws/src/zodAssert" {
3773
- import { Prisma } from "prisma-client";
5288
+ import { Prisma } from "@tiddlywiki/mws-prisma";
3774
5289
  import { zod } from "packages/server/src/index";
3775
5290
  type _zod = typeof zod;
3776
5291
  type ExtraFieldType = "string" | "number" | "parse-number" | "boolean" | "parse-boolean";
@@ -3814,7 +5329,8 @@ declare module "packages/mws/src/services/tw-routes" {
3814
5329
  }): (state: ServerRequest) => Promise<symbol>;
3815
5330
  }
3816
5331
  declare module "packages/mws/src/index" {
3817
- import "prisma/global";
5332
+ import "packages/mws/src/globals";
5333
+ import "packages/utils/src/index";
3818
5334
  import "packages/commander/src/index";
3819
5335
  import "packages/server/src/index";
3820
5336
  import "packages/mws/src/registerRequest";
@@ -3827,31 +5343,10 @@ declare module "packages/mws/src/index" {
3827
5343
  import "packages/mws/src/services/tw-routes";
3828
5344
  import "packages/mws/src/services/cache";
3829
5345
  import "packages/mws/src/services/sessions";
5346
+ import "packages/mws/src/SendError";
3830
5347
  export { ZodRoute } from "packages/server/src/index";
3831
5348
  export * from "packages/mws/src/managers/index";
3832
5349
  export default function runMWS(oldOptions?: any): Promise<void>;
3833
- global {
3834
- /** Awaited Return Type */
3835
- type ART<T extends (...args: any) => any> = Awaited<ReturnType<T>>;
3836
- type Complete<T> = {
3837
- [K in keyof T]-?: T[K];
3838
- };
3839
- interface ObjectConstructor {
3840
- keys<T>(t: T): (string & keyof T)[];
3841
- }
3842
- }
3843
- global {
3844
- /** helper function which returns the arguments as an array, but typed as a tuple, which is still an array, but positional. */
3845
- function tuple<P extends any[]>(...arg: P): P;
3846
- }
3847
- global {
3848
- /**
3849
- * Helper function which narrows the type to only truthy values.
3850
- *
3851
- * It uses `!!` so NaN will also be excluded.
3852
- */
3853
- function truthy<T>(obj: T): obj is Exclude<T, false | null | undefined | 0 | '' | void>;
3854
- }
3855
5350
  }
3856
5351
  declare module "packages/mws/src/commands/_empty" {
3857
5352
  import { BaseCommand, CommandInfo } from "packages/commander/src/index";
@@ -3867,14 +5362,14 @@ declare module "packages/mws/src/commands/load-tiddlers" {
3867
5362
  tiddlersPath: string;
3868
5363
  bagName: PrismaField<"Bags", "bag_name">;
3869
5364
  constructor(...args: ConstructorParameters<typeof BaseCommand>);
3870
- execute(): Promise<"Missing pathname and/or bag name" | null>;
5365
+ execute(): Promise<string | null>;
3871
5366
  }
3872
5367
  }
3873
5368
  declare module "packages/mws/src/commands/save-tiddler-text" {
3874
5369
  import { BaseCommand, CommandInfo } from "packages/commander/src/index";
3875
5370
  export const info: CommandInfo;
3876
5371
  export class Command extends BaseCommand {
3877
- execute(): Promise<void>;
5372
+ execute(): Promise<string | undefined>;
3878
5373
  }
3879
5374
  }
3880
5375
  declare module "packages/mws/src/services/attachments" {