gemi 0.91.1 → 0.93.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai/index.js +2 -2
- package/dist/ai/index.js.map +1 -1
- package/dist/app/index.js +1 -1
- package/dist/bun/plugin.js +1 -1
- package/dist/bun/preload.js +1 -1
- package/dist/{chunk-7k7dfy74.js → chunk-0n8t329w.js} +2 -2
- package/dist/{chunk-7k7dfy74.js.map → chunk-0n8t329w.js.map} +1 -1
- package/dist/{chunk-3470jpmr.js → chunk-0rs8a7re.js} +2 -2
- package/dist/{chunk-3470jpmr.js.map → chunk-0rs8a7re.js.map} +1 -1
- package/dist/{chunk-bj6gsxkv.js → chunk-1wdfjmkx.js} +2 -2
- package/dist/{chunk-bj6gsxkv.js.map → chunk-1wdfjmkx.js.map} +1 -1
- package/dist/{chunk-f2vjbxh6.js → chunk-1yt4hjqx.js} +2 -2
- package/dist/{chunk-f2vjbxh6.js.map → chunk-1yt4hjqx.js.map} +1 -1
- package/dist/{chunk-ed346kf4.js → chunk-241aehp3.js} +2 -2
- package/dist/{chunk-ed346kf4.js.map → chunk-241aehp3.js.map} +1 -1
- package/dist/{chunk-n4mfv24c.js → chunk-3jpetvsj.js} +2 -2
- package/dist/{chunk-n4mfv24c.js.map → chunk-3jpetvsj.js.map} +1 -1
- package/dist/{chunk-p3n8jjjf.js → chunk-3m10ve1n.js} +3 -3
- package/dist/{chunk-p3n8jjjf.js.map → chunk-3m10ve1n.js.map} +1 -1
- package/dist/{chunk-4czqjqs7.js → chunk-3prm2e2t.js} +2 -2
- package/dist/{chunk-4czqjqs7.js.map → chunk-3prm2e2t.js.map} +1 -1
- package/dist/chunk-4bh0maq0.js +5 -0
- package/dist/{chunk-ddbbxg9m.js.map → chunk-4bh0maq0.js.map} +1 -1
- package/dist/{chunk-x97zectc.js → chunk-4k4mh3gh.js} +2 -2
- package/dist/{chunk-x97zectc.js.map → chunk-4k4mh3gh.js.map} +1 -1
- package/dist/{chunk-kmebynhc.js → chunk-5v2rx0rk.js} +2 -2
- package/dist/{chunk-kmebynhc.js.map → chunk-5v2rx0rk.js.map} +1 -1
- package/dist/{chunk-b1wjymn0.js → chunk-5y9jk4h4.js} +2 -2
- package/dist/{chunk-b1wjymn0.js.map → chunk-5y9jk4h4.js.map} +1 -1
- package/dist/{chunk-ez0c0mpt.js → chunk-6ak8jfhm.js} +2 -2
- package/dist/{chunk-ez0c0mpt.js.map → chunk-6ak8jfhm.js.map} +1 -1
- package/dist/{chunk-ttckhvew.js → chunk-6qyc4e22.js} +2 -2
- package/dist/{chunk-ttckhvew.js.map → chunk-6qyc4e22.js.map} +1 -1
- package/dist/{chunk-w9j1kxmc.js → chunk-6xh4e55j.js} +2 -2
- package/dist/{chunk-fc28h7g2.js.map → chunk-6xh4e55j.js.map} +1 -1
- package/dist/{chunk-kdpc26j2.js → chunk-7jshf4ms.js} +1 -1
- package/dist/{chunk-d33qcg5b.js → chunk-7k7a6h9j.js} +2 -2
- package/dist/{chunk-d33qcg5b.js.map → chunk-7k7a6h9j.js.map} +1 -1
- package/dist/chunk-9pcsm8g3.js +54 -0
- package/dist/{chunk-k5j65f2c.js.map → chunk-9pcsm8g3.js.map} +5 -5
- package/dist/{chunk-r6jytsz3.js → chunk-a1y7pa5z.js} +2 -2
- package/dist/{chunk-r6jytsz3.js.map → chunk-a1y7pa5z.js.map} +1 -1
- package/dist/{chunk-fj7yk6a7.js → chunk-aawtyngp.js} +3 -3
- package/dist/{chunk-fj7yk6a7.js.map → chunk-aawtyngp.js.map} +1 -1
- package/dist/{chunk-dedazpms.js → chunk-aq1hjk00.js} +1 -1
- package/dist/{chunk-q7gkfkbz.js → chunk-bb8e7rhf.js} +2 -2
- package/dist/{chunk-q7gkfkbz.js.map → chunk-bb8e7rhf.js.map} +1 -1
- package/dist/chunk-c37g1gzy.js +17 -0
- package/dist/{chunk-087r45fw.js.map → chunk-c37g1gzy.js.map} +4 -4
- package/dist/{chunk-sh1cfx9j.js → chunk-cyze295m.js} +3 -3
- package/dist/{chunk-sh1cfx9j.js.map → chunk-cyze295m.js.map} +1 -1
- package/dist/{chunk-6tt3ynm7.js → chunk-d869bd41.js} +2 -2
- package/dist/{chunk-6tt3ynm7.js.map → chunk-d869bd41.js.map} +1 -1
- package/dist/{chunk-6ffpdkjw.js → chunk-dmvrx8nm.js} +3 -3
- package/dist/{chunk-6ffpdkjw.js.map → chunk-dmvrx8nm.js.map} +1 -1
- package/dist/{chunk-9kfnd4bf.js → chunk-dve6ryfd.js} +1 -1
- package/dist/{chunk-cv2sargd.js → chunk-dwkhs81y.js} +2 -2
- package/dist/{chunk-cv2sargd.js.map → chunk-dwkhs81y.js.map} +1 -1
- package/dist/{chunk-3z8fkczm.js → chunk-ej5mkm7t.js} +2 -2
- package/dist/{chunk-3z8fkczm.js.map → chunk-ej5mkm7t.js.map} +1 -1
- package/dist/{chunk-kk5x6grc.js → chunk-ffpm75zs.js} +2 -2
- package/dist/{chunk-kk5x6grc.js.map → chunk-ffpm75zs.js.map} +1 -1
- package/dist/{chunk-t6hma13w.js → chunk-fx02sqe2.js} +3 -3
- package/dist/{chunk-t6hma13w.js.map → chunk-fx02sqe2.js.map} +1 -1
- package/dist/{chunk-49v5xq8q.js → chunk-fz805r97.js} +2 -2
- package/dist/{chunk-49v5xq8q.js.map → chunk-fz805r97.js.map} +1 -1
- package/dist/{chunk-8acf5bf3.js → chunk-g2xbpr8r.js} +2 -2
- package/dist/{chunk-8acf5bf3.js.map → chunk-g2xbpr8r.js.map} +1 -1
- package/dist/{chunk-fc28h7g2.js → chunk-g6byqmdq.js} +2 -2
- package/dist/{chunk-w9j1kxmc.js.map → chunk-g6byqmdq.js.map} +1 -1
- package/dist/{chunk-6mdw41s5.js → chunk-g8tgp3ja.js} +2 -2
- package/dist/{chunk-6mdw41s5.js.map → chunk-g8tgp3ja.js.map} +1 -1
- package/dist/{chunk-e70ggm2m.js → chunk-jj0ynn5t.js} +2 -2
- package/dist/{chunk-e70ggm2m.js.map → chunk-jj0ynn5t.js.map} +1 -1
- package/dist/{chunk-a9a3tbyr.js → chunk-khvnm11p.js} +2 -2
- package/dist/{chunk-a9a3tbyr.js.map → chunk-khvnm11p.js.map} +1 -1
- package/dist/{chunk-6p62z1h3.js → chunk-knw4t9e6.js} +2 -2
- package/dist/{chunk-6p62z1h3.js.map → chunk-knw4t9e6.js.map} +1 -1
- package/dist/{chunk-2mrgrjy6.js → chunk-mmfstb0z.js} +2 -2
- package/dist/{chunk-2mrgrjy6.js.map → chunk-mmfstb0z.js.map} +1 -1
- package/dist/{chunk-j0qwgrp6.js → chunk-nvbbgbdk.js} +4 -4
- package/dist/{chunk-j0qwgrp6.js.map → chunk-nvbbgbdk.js.map} +1 -1
- package/dist/{chunk-5rpeez39.js → chunk-pgn3yh5k.js} +3 -3
- package/dist/{chunk-5rpeez39.js.map → chunk-pgn3yh5k.js.map} +1 -1
- package/dist/{chunk-17nh5gfm.js → chunk-pwchwgkc.js} +2 -2
- package/dist/{chunk-17nh5gfm.js.map → chunk-pwchwgkc.js.map} +1 -1
- package/dist/{chunk-5c7nyk5k.js → chunk-qrczhr16.js} +2 -2
- package/dist/{chunk-5c7nyk5k.js.map → chunk-qrczhr16.js.map} +1 -1
- package/dist/{chunk-hc1mcgs9.js → chunk-qs9drxja.js} +2 -2
- package/dist/{chunk-hc1mcgs9.js.map → chunk-qs9drxja.js.map} +1 -1
- package/dist/chunk-qv2sdxbq.js +9 -0
- package/dist/chunk-qv2sdxbq.js.map +10 -0
- package/dist/{chunk-dyq9gcwa.js → chunk-rgcfqq21.js} +2 -2
- package/dist/{chunk-dyq9gcwa.js.map → chunk-rgcfqq21.js.map} +1 -1
- package/dist/{chunk-w4qek53d.js → chunk-s22afmm9.js} +2 -2
- package/dist/{chunk-w4qek53d.js.map → chunk-s22afmm9.js.map} +1 -1
- package/dist/{chunk-66g9yytx.js → chunk-sppjqk4n.js} +3 -3
- package/dist/{chunk-66g9yytx.js.map → chunk-sppjqk4n.js.map} +1 -1
- package/dist/{chunk-7ct4y1zh.js → chunk-sqd77ksy.js} +3 -3
- package/dist/{chunk-7ct4y1zh.js.map → chunk-sqd77ksy.js.map} +1 -1
- package/dist/{chunk-vqhcztw0.js → chunk-svzdv2rf.js} +2 -2
- package/dist/{chunk-vqhcztw0.js.map → chunk-svzdv2rf.js.map} +1 -1
- package/dist/{chunk-q18fb0cr.js → chunk-t328955a.js} +2 -2
- package/dist/{chunk-q18fb0cr.js.map → chunk-t328955a.js.map} +1 -1
- package/dist/{chunk-2dfar4d1.js → chunk-t4x7q9x8.js} +2 -2
- package/dist/{chunk-2dfar4d1.js.map → chunk-t4x7q9x8.js.map} +1 -1
- package/dist/{chunk-j2402q2z.js → chunk-v51a4g6w.js} +2 -2
- package/dist/{chunk-j2402q2z.js.map → chunk-v51a4g6w.js.map} +1 -1
- package/dist/{chunk-xqyx8kzr.js → chunk-v6vsjdp7.js} +2 -2
- package/dist/{chunk-xqyx8kzr.js.map → chunk-v6vsjdp7.js.map} +1 -1
- package/dist/{chunk-gzfat1x1.js → chunk-vbfwvyb8.js} +2 -2
- package/dist/{chunk-gzfat1x1.js.map → chunk-vbfwvyb8.js.map} +1 -1
- package/dist/{chunk-mn5xnk02.js → chunk-vpcys0ty.js} +2 -2
- package/dist/{chunk-mn5xnk02.js.map → chunk-vpcys0ty.js.map} +1 -1
- package/dist/{chunk-n2rq7wp8.js → chunk-vryvdzmk.js} +2 -2
- package/dist/{chunk-n2rq7wp8.js.map → chunk-vryvdzmk.js.map} +1 -1
- package/dist/{chunk-araqww9d.js → chunk-wd9zab3e.js} +2 -2
- package/dist/{chunk-araqww9d.js.map → chunk-wd9zab3e.js.map} +1 -1
- package/dist/{chunk-ngrr6wvw.js → chunk-xk4r9372.js} +2 -2
- package/dist/{chunk-ngrr6wvw.js.map → chunk-xk4r9372.js.map} +1 -1
- package/dist/{chunk-hx1jg944.js → chunk-y3hdh6q6.js} +2 -2
- package/dist/{chunk-hx1jg944.js.map → chunk-y3hdh6q6.js.map} +1 -1
- package/dist/{chunk-01n76z2m.js → chunk-z10c81a9.js} +2 -2
- package/dist/{chunk-01n76z2m.js.map → chunk-z10c81a9.js.map} +1 -1
- package/dist/{chunk-d476f9f6.js → chunk-z405ks42.js} +2 -2
- package/dist/{chunk-d476f9f6.js.map → chunk-z405ks42.js.map} +1 -1
- package/dist/{chunk-3nh3h2df.js → chunk-za1ncjh0.js} +2 -2
- package/dist/{chunk-3nh3h2df.js.map → chunk-za1ncjh0.js.map} +1 -1
- package/dist/client/Mutation.d.ts +12 -3
- package/dist/client/Mutation.d.ts.map +1 -1
- package/dist/client/MutationError.d.ts +32 -2
- package/dist/client/MutationError.d.ts.map +1 -1
- package/dist/client/auth/useForgotPassword.d.ts +1 -1
- package/dist/client/auth/useResetPassword.d.ts +1 -1
- package/dist/client/auth/useSignIn.d.ts +1 -1
- package/dist/client/auth/useSignOut.d.ts +1 -1
- package/dist/client/auth/useSignUp.d.ts +1 -1
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +19 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/useMutation.d.ts +38 -26
- package/dist/client/useMutation.d.ts.map +1 -1
- package/dist/config/index.js +1 -1
- package/dist/console/run.js +2 -2
- package/dist/console/run.js.map +1 -1
- package/dist/container/index.js +2 -2
- package/dist/container/index.js.map +1 -1
- package/dist/database/index.js +2 -2
- package/dist/database/index.js.map +1 -1
- package/dist/email/index.js +2 -2
- package/dist/email/index.js.map +1 -1
- package/dist/facades/index.js +2 -2
- package/dist/facades/index.js.map +1 -1
- package/dist/foundation/index.js +2 -2
- package/dist/foundation/index.js.map +1 -1
- package/dist/http/ApiRouter.d.ts +10 -4
- package/dist/http/ApiRouter.d.ts.map +1 -1
- package/dist/http/HttpResponse.d.ts +85 -10
- package/dist/http/HttpResponse.d.ts.map +1 -1
- package/dist/http/index.d.ts +1 -1
- package/dist/http/index.d.ts.map +1 -1
- package/dist/http/index.js +2 -2
- package/dist/http/index.js.map +1 -1
- package/dist/i18n/dictionaryRuntime.js +2 -2
- package/dist/i18n/dictionaryRuntime.js.map +1 -1
- package/dist/i18n/index.js +2 -2
- package/dist/i18n/index.js.map +1 -1
- package/dist/kernel/index.js +2 -2
- package/dist/kernel/index.js.map +1 -1
- package/dist/orm/Model.d.ts +81 -0
- package/dist/orm/Model.d.ts.map +1 -1
- package/dist/orm/compile/where.d.ts +17 -0
- package/dist/orm/compile/where.d.ts.map +1 -1
- package/dist/orm/compile/write.d.ts.map +1 -1
- package/dist/orm/context.d.ts +27 -0
- package/dist/orm/context.d.ts.map +1 -1
- package/dist/orm/dialect/index.d.ts +28 -0
- package/dist/orm/dialect/index.d.ts.map +1 -1
- package/dist/orm/dialect/postgres.d.ts +15 -0
- package/dist/orm/dialect/postgres.d.ts.map +1 -1
- package/dist/orm/dialect/sqlite.d.ts +17 -0
- package/dist/orm/dialect/sqlite.d.ts.map +1 -1
- package/dist/orm/index.d.ts +2 -1
- package/dist/orm/index.d.ts.map +1 -1
- package/dist/orm/index.js +4 -4
- package/dist/orm/index.js.map +8 -8
- package/dist/orm/plan.d.ts.map +1 -1
- package/dist/orm/soft-deletes.d.ts +50 -0
- package/dist/orm/soft-deletes.d.ts.map +1 -1
- package/dist/orm/types.d.ts +22 -5
- package/dist/orm/types.d.ts.map +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/index.js.map +1 -1
- package/dist/services/index.js +2 -2
- package/dist/services/index.js.map +1 -1
- package/dist/services/queue/work.js +2 -2
- package/dist/services/queue/work.js.map +1 -1
- package/dist/support/index.js +2 -2
- package/dist/support/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/gemi-react-best-practices/rules/controller-throw-framework-errors.md +9 -0
- package/dist/chunk-087r45fw.js +0 -17
- package/dist/chunk-6y62ccam.js +0 -9
- package/dist/chunk-6y62ccam.js.map +0 -10
- package/dist/chunk-ddbbxg9m.js +0 -5
- package/dist/chunk-k5j65f2c.js +0 -54
- /package/dist/{chunk-kdpc26j2.js.map → chunk-7jshf4ms.js.map} +0 -0
- /package/dist/{chunk-dedazpms.js.map → chunk-aq1hjk00.js.map} +0 -0
- /package/dist/{chunk-9kfnd4bf.js.map → chunk-dve6ryfd.js.map} +0 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Refusal } from "./refusal";
|
|
1
2
|
/**
|
|
2
3
|
* Marks an `HttpResponse` at runtime. A registered symbol rather than
|
|
3
4
|
* `instanceof`, so a route built against one copy of gemi is still recognised by
|
|
@@ -5,9 +6,9 @@
|
|
|
5
6
|
* reason `RequestBreakerError` is recognised by its `kind` too.
|
|
6
7
|
*/
|
|
7
8
|
declare const HTTP_RESPONSE: unique symbol;
|
|
8
|
-
export type HttpResponseOptions = {
|
|
9
|
+
export type HttpResponseOptions<S extends number = number> = {
|
|
9
10
|
/** The status code. `200` when omitted. */
|
|
10
|
-
status?:
|
|
11
|
+
status?: S;
|
|
11
12
|
/**
|
|
12
13
|
* Set on top of everything the request already put on the response. Each
|
|
13
14
|
* header named here replaces the one the context holds; a `Set-Cookie` is
|
|
@@ -40,10 +41,10 @@ type HttpResponseKind = "json";
|
|
|
40
41
|
* For api routes. A view's handler returns its props; returning one there
|
|
41
42
|
* throws.
|
|
42
43
|
*/
|
|
43
|
-
export declare class HttpResponse<T = unknown> {
|
|
44
|
+
export declare class HttpResponse<T = unknown, S extends number = number> {
|
|
44
45
|
readonly kind: HttpResponseKind;
|
|
45
46
|
readonly body: T;
|
|
46
|
-
readonly status:
|
|
47
|
+
readonly status: S;
|
|
47
48
|
readonly headers: Headers;
|
|
48
49
|
readonly [HTTP_RESPONSE] = true;
|
|
49
50
|
private constructor();
|
|
@@ -56,7 +57,27 @@ export declare class HttpResponse<T = unknown> {
|
|
|
56
57
|
* behind `cache` would otherwise let a shared cache replay one client's 404
|
|
57
58
|
* to everyone.
|
|
58
59
|
*/
|
|
59
|
-
static json<T>(data: T, options?: HttpResponseOptions): HttpResponse<T>;
|
|
60
|
+
static json<T, S extends number = 200>(data: T, options?: HttpResponseOptions<S>): HttpResponse<T, S>;
|
|
61
|
+
/**
|
|
62
|
+
* A typed error: `{ "error": body }` with a status from 400 to 599, the
|
|
63
|
+
* envelope gemi's own errors answer.
|
|
64
|
+
*
|
|
65
|
+
* ```ts
|
|
66
|
+
* if (expired(link)) {
|
|
67
|
+
* return HttpResponse.error(410, { kind: "gone", message: "Link has expired" });
|
|
68
|
+
* }
|
|
69
|
+
* return { catalogId };
|
|
70
|
+
* ```
|
|
71
|
+
*
|
|
72
|
+
* The route's client type leaves it out of the data and adds `body` to the
|
|
73
|
+
* error type instead: `onError` and `error` on `useMutation`, `usePost`,
|
|
74
|
+
* `useUpload` and `<Form>` are `MutationError | typeof body` (with `status`
|
|
75
|
+
* added), so `if (!(e instanceof Error) && e.kind === "gone")` narrows.
|
|
76
|
+
* `httpError(status, body)` is the same function.
|
|
77
|
+
*/
|
|
78
|
+
static error<const E, S extends number>(status: S, body: E, options?: Omit<HttpResponseOptions, "status">): HttpResponse<{
|
|
79
|
+
error: E;
|
|
80
|
+
}, S>;
|
|
60
81
|
/** Whether the status is 2xx, as `Response.ok`. */
|
|
61
82
|
get ok(): boolean;
|
|
62
83
|
/**
|
|
@@ -72,12 +93,66 @@ export declare class HttpResponse<T = unknown> {
|
|
|
72
93
|
private serialize;
|
|
73
94
|
}
|
|
74
95
|
export declare function isHttpResponse(value: unknown): value is HttpResponse<unknown>;
|
|
75
|
-
type UnwrapHttpResponse<T> = T extends HttpResponse<infer Data> ? Data : T;
|
|
76
96
|
/**
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
|
|
97
|
+
* `HttpResponse.error(status, body)`: a typed error response. See
|
|
98
|
+
* `HttpResponse.error`.
|
|
99
|
+
*/
|
|
100
|
+
export declare function httpError<const E, S extends number>(status: S, body: E, options?: Omit<HttpResponseOptions, "status">): HttpResponse<{
|
|
101
|
+
error: E;
|
|
102
|
+
}, S>;
|
|
103
|
+
type Digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";
|
|
104
|
+
/**
|
|
105
|
+
* Whether `S` is known to be 400 or more: a literal status, or a union of
|
|
106
|
+
* them, every one of which is. `number`, and a union with a 2xx in it, are
|
|
107
|
+
* not, so a status picked at run time stays in the data as it always was.
|
|
108
|
+
*/
|
|
109
|
+
type IsErrorStatus<S> = [S] extends [never] ? false : [`${S & number}`] extends [`4${Digit}${Digit}` | `5${Digit}${Digit}`] ? true : false;
|
|
110
|
+
type SuccessMember<T> = T extends HttpResponse<infer Data, infer S> ? IsErrorStatus<S> extends true ? never : Data : T;
|
|
111
|
+
/**
|
|
112
|
+
* A raw `Response` in a union with typed returns is dropped: the client never
|
|
113
|
+
* receives a `Response` object, and it was the success type `if (r instanceof
|
|
114
|
+
* Response)` had to be written against. A route that only ever returns one (a
|
|
115
|
+
* file, a stream) keeps it, as before.
|
|
116
|
+
*/
|
|
117
|
+
type SuccessData<T> = [Exclude<SuccessMember<T>, Response>] extends [never] ? SuccessMember<T> : Exclude<SuccessMember<T>, Response>;
|
|
118
|
+
/**
|
|
119
|
+
* What a handler returning `Output` answers the client with on success:
|
|
120
|
+
* `Output` itself, with every `HttpResponse<T>` in it — under a `Promise` or
|
|
121
|
+
* not, alone or in a union with plain returns — replaced by its `T`.
|
|
122
|
+
*
|
|
123
|
+
* Left out: an `HttpResponse` whose status is a literal 400 or more
|
|
124
|
+
* (`HttpResponse.error`, `httpError`, `HttpResponse.json(x, { status: 409 })`),
|
|
125
|
+
* which `ResponseError` collects instead, and a raw `Response` in a union with
|
|
126
|
+
* anything else. `any` stays `any`.
|
|
127
|
+
*/
|
|
128
|
+
export type ResponseData<Output> = 0 extends 1 & Output ? Output : [
|
|
129
|
+
Output
|
|
130
|
+
] extends [Promise<infer Resolved>] ? Promise<SuccessData<Resolved>> : [Extract<Output, Promise<any>>] extends [never] ? SuccessData<Output> : Output extends Promise<infer Resolved> ? Promise<SuccessData<Resolved>> : SuccessData<Output>;
|
|
131
|
+
/**
|
|
132
|
+
* The value the client's `onError` receives for an error body `E` answered
|
|
133
|
+
* with status `S`, as `mutationErrorFromBody` builds it: `status` is added
|
|
134
|
+
* unless `E` has one, an object with a `message` and no `kind` is given the
|
|
135
|
+
* kind its status stands for, and a string (or nothing) becomes a refusal.
|
|
136
|
+
*/
|
|
137
|
+
export type ClientHttpError<E, S extends number = number> = E extends string | null | undefined ? Refusal : E extends object ? E extends {
|
|
138
|
+
kind: string;
|
|
139
|
+
} ? WithStatus<E, S> : E extends {
|
|
140
|
+
message: string;
|
|
141
|
+
} ? WithStatus<E, S> & {
|
|
142
|
+
kind: Refusal["kind"];
|
|
143
|
+
} : WithStatus<E, S> : E;
|
|
144
|
+
type WithStatus<E, S extends number> = "status" extends keyof E ? E : E & {
|
|
145
|
+
status: S;
|
|
146
|
+
};
|
|
147
|
+
type ErrorMember<T> = T extends HttpResponse<infer Data, infer S> ? IsErrorStatus<S> extends true ? Data extends {
|
|
148
|
+
error: infer E;
|
|
149
|
+
} ? ClientHttpError<E, S> : ClientHttpError<Data, S> : never : never;
|
|
150
|
+
/**
|
|
151
|
+
* The typed errors a handler returning `Output` can answer: every
|
|
152
|
+
* `HttpResponse` in it whose status is a literal 400 or more, as the client's
|
|
153
|
+
* `onError` receives it (see `ClientHttpError`). `never` when there are none,
|
|
154
|
+
* and for `any`.
|
|
80
155
|
*/
|
|
81
|
-
export type
|
|
156
|
+
export type ResponseError<Output> = 0 extends 1 & Output ? never : ErrorMember<Awaited<Output>>;
|
|
82
157
|
export {};
|
|
83
158
|
//# sourceMappingURL=HttpResponse.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpResponse.d.ts","sourceRoot":"","sources":["../../http/HttpResponse.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,QAAA,MAAM,aAAa,eAAkC,CAAC;AAEtD,MAAM,MAAM,mBAAmB,GAAG;
|
|
1
|
+
{"version":3,"file":"HttpResponse.d.ts","sourceR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AAC;AAIxF,KAAK,WAAW,CAAC,CAAC,IAChB,CAAC,SAAS,YAAY,CAAC,MAAM,IAAI,EAAE,MAAM,CAAC,CAAC,GACvC,aAAa,CAAC,CAAC,CAAC,SAAS,IAAI,GAC3B,IAAI,SAAS;IAAE,KAAK,EAAE,MAAM,CAAC,CAAA;CAAE,GAC7B,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,GACrB,eAAe,CAAC,IAAI,EAAE,CAAC,CAAC,GAC1B,KAAK,GACP,KAAK,CAAC;AAEZ;;;;;GAKG;AACH,MAAM,MAAM,aAAa,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,MAAM,GAAG,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC"}
|
package/dist/http/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export { Middleware } from "./Middleware";
|
|
|
12
12
|
export { getCookies } from "./getCookies";
|
|
13
13
|
export { RequestBreakerError, type RequestBreakerOptions } from "./Error";
|
|
14
14
|
export type { Refusal, RefusalKind } from "./refusal";
|
|
15
|
-
export { HttpResponse, type HttpResponseOptions } from "./HttpResponse";
|
|
15
|
+
export { HttpResponse, httpError, type HttpResponseOptions, type ClientHttpError, } from "./HttpResponse";
|
|
16
16
|
export { defineMiddlewareConfig, middlewareConfigDefaults, type MiddlewareConfig, } from "./middleware-config";
|
|
17
17
|
export { AuthenticationMiddleware } from "./AuthenticationMiddlware";
|
|
18
18
|
export { CacheMiddleware } from "./CacheMiddleware";
|
package/dist/http/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../http/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EACL,SAAS,EACT,mBAAmB,EAC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Ae,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,QAAQ,EACR,KAAK,yBAAyB,GAC/B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,4BAA4B,EAC5B,wBAAwB,GACzB,MAAM,UAAU,CAAC"}
|
package/dist/http/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Cd as I,Dd as J,Ed as K,Fd as L,Gd as M,Hd as N,ec as n,fc as o,gc as p,hc as v,ic as w,jc as x,lc as y,mc as z,nc as A,oc as B,pc as C,qc as D,rc as E,wc as F,xc as G,yc as H}from"../chunk-c37g1gzy.js";import"../chunk-sppjqk4n.js";import"../chunk-9pcsm8g3.js";import{Je as a,Ke as b,Le as d,Pe as e,Qe as f,Re as g,Se as h,Te as i,Ue as j,Ze as k,_e as l,cf as m,df as q,ef as r,ff as s,gf as t,hf as u}from"../chunk-sqd77ksy.js";import{wf as c}from"../chunk-v6vsjdp7.js";import"../chunk-pwchwgkc.js";import"../chunk-qv2sdxbq.js";import"../chunk-vbfwvyb8.js";import"../chunk-fz805r97.js";import"../chunk-6qyc4e22.js";import"../chunk-dwkhs81y.js";import"../chunk-cyze295m.js";import"../chunk-rgcfqq21.js";import"../chunk-241aehp3.js";import"../chunk-5v2rx0rk.js";import"../chunk-bb8e7rhf.js";import"../chunk-g6byqmdq.js";export{g as toRangeHeaderValue,n as toMiddlewareList,f as resolveRange,e as parseRangeHeader,h as parseContentRange,E as middlewareConfigDefaults,z as httpError,d as getCookies,j as formatUnsatisfiedContentRange,i as formatContentRange,D as defineMiddlewareConfig,o as createUnsatisfiableResponse,p as createStreamResponse,A as createFileResponse,H as clientIp,B as ViewRouter,k as ValidationError,b as ResourceController,c as RequestBreakerError,G as RateLimitMiddleware,F as RateLimitExceededError,s as RangeNotSatisfiableError,M as PoliciesServiceProvider,N as Policies,C as Middleware,x as McpRouter,w as McpRouteDeclaration,l as InvalidValidationRuleError,r as InsufficientPermissionsError,y as HttpResponse,m as HttpRequest,t as FileNotFoundError,K as CorsMiddleware,a as Controller,J as CacheMiddleware,L as CSRFMiddleware,q as AuthorizationError,I as AuthenticationMiddleware,u as AuthenticationError,v as ApiRouter};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=33E8B53A64218C5364756E2164756E21
|
package/dist/http/index.js.map
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{aa as y,ba as p}from"../chunk-
|
|
2
|
+
import{aa as y,ba as p}from"../chunk-d869bd41.js";import{qa as c,ra as d,ta as l}from"../chunk-9a8qz3s7.js";import{gg as e,hg as i,jg as t,kg as r,lg as o,mg as n,ng as a,og as s}from"../chunk-fz805r97.js";import"../chunk-g6byqmdq.js";export{o as setActiveLocale,r as seedDictionaries,t as preloadDictionaries,d as localeStrings,i as loadDictionary,n as getActiveLocale,e as dictionaryRegistrationMark,c as dictionaryLocales,l as dictionaryId,y as defineDictionary,s as createDictionarySink,a as __resetDictionaryRegistry,p as __gemi_dict__};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=60015ED29BBAFE3D64756E2164756E21
|
package/dist/i18n/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{aa as R}from"../chunk-
|
|
2
|
+
import{aa as R}from"../chunk-d869bd41.js";import"../chunk-9a8qz3s7.js";import{Wa as L}from"../chunk-4bh0maq0.js";import{bc as E,cc as V}from"../chunk-7bmctvep.js";import"../chunk-p0px3ym0.js";import{Kc as j}from"../chunk-c37g1gzy.js";import"../chunk-sppjqk4n.js";import"../chunk-9pcsm8g3.js";import"../chunk-sqd77ksy.js";import"../chunk-v6vsjdp7.js";import"../chunk-pwchwgkc.js";import"../chunk-qv2sdxbq.js";import"../chunk-vbfwvyb8.js";import"../chunk-fz805r97.js";import"../chunk-6qyc4e22.js";import{xg as X}from"../chunk-dwkhs81y.js";import"../chunk-cyze295m.js";import"../chunk-rgcfqq21.js";import"../chunk-241aehp3.js";import"../chunk-5v2rx0rk.js";import"../chunk-bb8e7rhf.js";import"../chunk-g6byqmdq.js";import{createElement as J,Fragment as M,isValidElement as U}from"react";function $(q,B){let G=Object.values(B).some((z)=>typeof z==="function"&&U(z(""))),Q=/{{([^{}]+?)(?::([^{}\[\]]+?))?(?:\[(.*?)\])?}}/g;if(!G)return q.replace(Q,(W,O,_,Z)=>{let C=O.includes(":")?O.split(":")[0]:O,H=B[C];if(H===void 0)return W;if(typeof H==="function"){let K=H(Z!==void 0?Z:"");if(U(K))throw Error("JSX returned in string context");return String(K)}if(_)switch(_.toLowerCase()){case"number":return Number(H).toString();case"string":return String(H);case"boolean":return Boolean(H).toString();default:return String(H)}return String(H)});else{let z=[],W=0,O=null;while((O=Q.exec(q))!==null){let[_,Z,C,H]=O,F=O.index,K=Z.includes(":")?Z.split(":")[0]:Z;if(F>W)z.push(q.substring(W,F));let Y=B[K];if(Y===void 0)z.push(_);else if(typeof Y==="function"){let A=Y(H!==void 0?H:"");z.push(A)}else if(C)switch(C.toLowerCase()){case"number":z.push(Number(Y).toString());break;case"string":z.push(String(Y));break;case"boolean":z.push(Boolean(Y).toString());break;default:z.push(String(Y))}else z.push(String(Y));W=F+_.length}if(W<q.length)z.push(q.substring(W));return J(M,{},...z)}}class P{name;dictionary;constructor(q,B){this.name=q;this.dictionary=B}reference(q){if(typeof window<"u")throw Error("Cannot use reference in the browser");if(!this.dictionary?.[q])throw Error(`Translation not found for ${String(q)}`);return this.dictionary[q]}render(q,...B){let{locale:G=j.locale(),params:Q}={params:{},...B[0]};if(typeof window<"u")throw Error("Cannot use render in the browser");if(!this.dictionary?.[q]?.[G])throw Error(`Translation not found for ${String(q)} in ${String(G)}`);return $(this.dictionary[q][G],Q??{})}static create(q,B){return new P(q,B)}static text(q,...B){let{locale:G=j.locale(),params:Q}={params:{},...B?.[0]};if(!q?.[G])throw Error(`Translation not found for ${String(G)}`);return $(q[G],Q??{})}}async function N(q,B,...G){let{locale:Q=j.locale(),params:z}={params:{},...G[0]},O=(await q.load(String(Q)))[B];if(typeof O!=="string")throw Error(`Translation not found for "${B}" in "${String(Q)}" (dictionary ${q.id})`);return $(O,z??{})}export{V as translationConfigDefaults,N as translate,E as defineTranslationConfig,R as defineDictionary,X as Translator,L as TranslationServiceProvider,P as Dictionary};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=7BF5883AACC69F8064756E2164756E21
|
package/dist/i18n/index.js.map
CHANGED
|
@@ -7,6 +7,6 @@
|
|
|
7
7
|
"import { Lang } from \"../facades\";\nimport { parseTranslation } from \"../utils/parseTranslation\";\nimport type { ParseTranslationParamsServer, Prettify } from \"../utils/type\";\nimport type { DictionaryHandle } from \"./defineDictionary\";\nimport type { DictionaryTranslations } from \"./dictionaryShape\";\n\n/**\n * Read one string from a `defineDictionary` dictionary outside React — a\n * controller, a job, an email template.\n *\n * Async because a bundled dictionary loads its locale on demand. Server code\n * does not go through the bundler, so in practice this resolves without ever\n * yielding; the `await` is what makes the same call work either way.\n *\n * Kept out of `defineDictionary.ts` on purpose: that module is imported by\n * components and has to stay free of the server facades this one needs.\n */\nexport async function translate<\n T extends DictionaryTranslations,\n K extends keyof T & string,\n U extends keyof T[K],\n R = Prettify<ParseTranslationParamsServer<T[K][U] & string>>,\n>(\n dictionary: DictionaryHandle<T>,\n key: K,\n ...args: R extends Record<string, never>\n ? [args?: { locale?: U | (string & {}) }]\n : [args: { locale?: U | (string & {}); params: R }]\n): Promise<string> {\n const { locale = Lang.locale(), params } = { params: {}, ...args[0] };\n const strings = await dictionary.load(String(locale));\n const template = strings[key];\n\n if (typeof template !== \"string\") {\n throw new Error(\n `Translation not found for \"${key}\" in \"${String(locale)}\" (dictionary ${dictionary.id})`,\n );\n }\n\n return parseTranslation(template, (params ?? {}) as any) as string;\n}\n"
|
|
8
8
|
],
|
|
9
9
|
"mappings": ";gzBAAA,mBAAS,SAAe,eAAU,SAO3B,IAAS,JAAgB,JAAC,HAAkB,HAAwB,JAEzE,DAAM,HAAS,EAAO,EAAO,JAAM,HAAE,AACnC,JAAC,DACC,EAAO,DAAU,YACjB,EAAgB,EAAkC,EAAE,CAAC,CACzD,EAMM,EAAQ,kDAEd,GAAI,CAAC,EAqCH,OAnCe,EAAS,QAAQ,EAAO,CAAC,EAAO,EAAM,EAAM,IAAY,CAErE,IAAM,EAAY,EAAK,SAAS,GAAG,EAAI,EAAK,MAAM,GAAG,EAAE,GAAK,EAEtD,EAAQ,EAAO,GACrB,GAAI,IAAU,OACZ,OAAO,EAGT,GAAI,OAAO,IAAU,WAAY,CAG/B,IAAM,EAAiB,EADD,IAAY,OAAY,EAAU,EACd,EAE1C,GAAI,EAAe,CAAc,EAC/B,MAAU,MAAM,gCAAgC,EAElD,OAAO,OAAO,CAAc,EAI9B,GAAI,EACF,OAAQ,EAAK,YAAY,OAClB,SACH,OAAO,OAAO,CAAK,EAAE,SAAS,MAC3B,SACH,OAAO,OAAO,CAAK,MAChB,UACH,OAAO,QAAQ,CAAK,EAAE,SAAS,UAE/B,OAAO,OAAO,CAAK,EAGzB,OAAO,OAAO,CAAK,EACpB,EAEI,KAEL,IAAM,EAAqC,CAAC,EACxC,EAAY,EACZ,EAAgC,KAEpC,OAAQ,EAAQ,EAAM,KAAK,CAAQ,KAAO,KAAM,CAC9C,IAAO,EAAW,EAAM,EAAM,GAAW,EACnC,EAAa,EAAM,MAGnB,EAAY,EAAK,SAAS,GAAG,EAAI,EAAK,MA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C,CAAC,QAU7D,OAAoC,CAAC,EAAc,EAAiB,CACzE,OAAO,IAAI,EAAc,EAAM,CAAY,QAGtC,KAA+D,CACpE,KACG,EAWK,CACR,IAAQ,SAAS,EAAK,OAAO,EAAG,UAAW,CAAE,OAAQ,CAAC,KAAM,IAAO,EAAG,EAEtE,GAAI,CAAC,IAAU,GACb,MAAU,MAAM,6BAA6B,OAAO,CAAM,GAAG,EAG/D,OAAO,EAAiB,EAAQ,GAAS,GAAU,CAAC,CAAC,EAEzD,CC7EA,eAAsB,CAKrB,CACC,EACA,KACG,EAGc,CACjB,IAAQ,SAAS,EAAK,OAAO,EAAG,UAAW,CAAE,OAAQ,CAAC,KAAM,EAAK,EAAG,EAE9D,GADU,MAAM,EAAW,KAAK,OAAO,CAAM,CAAC,GAC3B,GAEzB,GAAI,OAAO,IAAa,SACtB,MAAU,MACR,8BAA8B,UAAY,OAAO,CAAM,kBAAkB,EAAW,KACtF,EAGF,OAAO,EAAiB,EAAW,GAAU,CAAC,CAAS",
|
|
10
|
-
"debugId": "
|
|
10
|
+
"debugId": "7BF5883AACC69F8064756E2164756E21",
|
|
11
11
|
"names": []
|
|
12
12
|
}
|
package/dist/kernel/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ya as y}from"../chunk-
|
|
2
|
+
import{ya as y}from"../chunk-3prm2e2t.js";import{Va as i}from"../chunk-t328955a.js";import{Wa as g}from"../chunk-4bh0maq0.js";import{$a as e,Za as T,_a as D,ab as A,bb as w,fb as P,gb as S,ib as h,jb as R,kb as u,lb as l,ob as v,pb as d,sb as c,vb as p,yb as n}from"../chunk-svzdv2rf.js";import"../chunk-wc46df4w.js";import"../chunk-g8tgp3ja.js";import{Yb as r}from"../chunk-t4x7q9x8.js";import"../chunk-7bmctvep.js";import"../chunk-p0px3ym0.js";import{Ad as o,Dc as Zj,Ec as $j,Hc as Gj,Ic as Hj,kd as x,pd as I,qd as E,td as K,ud as M,vd as s,wd as C,xd as m,yd as Q,zd as t}from"../chunk-c37g1gzy.js";import{Ld as a}from"../chunk-sppjqk4n.js";import{Yd as V,be as f}from"../chunk-9pcsm8g3.js";import{cf as F}from"../chunk-sqd77ksy.js";import{vf as B}from"../chunk-v6vsjdp7.js";import{Bf as L}from"../chunk-pwchwgkc.js";import"../chunk-qv2sdxbq.js";import"../chunk-vbfwvyb8.js";import"../chunk-fz805r97.js";import"../chunk-6qyc4e22.js";import"../chunk-fx02sqe2.js";import"../chunk-dwkhs81y.js";import{Ag as b,zg as N}from"../chunk-cyze295m.js";import{Bg as _}from"../chunk-rgcfqq21.js";import"../chunk-241aehp3.js";import"../chunk-ffpm75zs.js";import"../chunk-5v2rx0rk.js";import{Og as q}from"../chunk-bb8e7rhf.js";import"../chunk-g6byqmdq.js";function Jj(j){let X=j.headers.get("Cache-Control")?.toLowerCase()??"";return/(^|[\s,])(public|s-maxage)\b/.test(X)}var Wj=new Set,Xj={refusal:null,apply:(j)=>j,carried:null};async function k(j){let X=b(x);if(X.config.global.length===0)return Xj;let{pathname:Z}=new URL(j.url),W=q(Z),z=new F(j,{},W?"api":"view","");return await L.run(z,async()=>{let $=L.getStore(),{headers:H,cookies:zj}=$,Y=(J)=>{if(!Jj(J))return Q(J,H,zj);let G=new Headers(H);return G.delete("Set-Cookie"),Q(J,G,Wj)};try{return await X.runGlobalMiddleware(),{refusal:null,apply:Y,carried:{user:$.user}}}catch(J){let G=!W&&Z.endsWith(".json");if(J?.kind===B){let O=W?m(J.payload.api):G?M(J.payload.viewData??J.payload.api):K(J.payload.view);return{refusal:Y(O),apply:Y,carried:null}}if(V(J)&&(W||G))return{refusal:Y(C()),apply:Y,carried:null};if(f(J)){console.error(J);let O=W||G?I():K(E());return{refusal:Y(O),apply:Y,carried:null}}throw J}finally{$.destroy()}})}var U=[l,d,y,P,n,A,S,v,R,D,h,p,u,g,c,w];class jj{config={};providers=[];services=[];serviceInstances=[];serviceTokens=new Set;servicesBooted=!1;models=[];app=new N;boot(){if(this.models.length>0)i(...this.models);else Yj();this.app.config.merge(this.config),N.setInstance(this.app),this.app.registerMany([...U,...this.providers]),this.registerServices()}registerServices(){let j=this.serviceTokens;this.serviceInstances=[],this.serviceTokens=new Set,this.servicesBooted=!1;let X=new Map;for(let Z of this.services){let W=typeof Z==="function"?new Z:Z,z=W.constructor;if(!z.token)throw Error(`Service [${z.name}] is listed in \`services\` but does not declare a \`static token\`.`);let $=X.get(z.token);if($)throw Error(`Services [${$}] and [${z.name}] both declare the token "${z.token}". Tokens are the container's keys, so they must be unique.`);X.set(z.token,z.name);let H=z;if(!j.has(z.token)&&this.app.bound(H))throw Error(`Service [${z.name}] declares the token "${z.token}", which is already bound in the container by the framework or a provider. Binding it would replace that service everywhere, so pick a token nothing else owns.`);this.app.instance(H,W),this.serviceInstances.push(W),this.serviceTokens.add(z.token)}}async waitForBoot(){await this.app.boot(),await this.bootServices(),e(this.app)}async bootServices(){if(this.servicesBooted)return;for(let j of this.serviceInstances)await j.boot();this.servicesBooted=!0}shutdown(j){return this.run(()=>this.app.shutdown(j))}run(j){return _.run(this.app,j)}resolve(j){return this.app.make(j)}apiRoutes(){return this.app.make(t)}viewRoutes(){return this.app.make(s)}domains(){return this.app.make(o)}queue(){return this.app.make(r)}globalMiddleware(j){return k(j)}destroy(){if(this.app.resolved(T))this.app.make(T).stop();if(this.app.flush(),N.getInstance()===this.app)N.setInstance(void 0);_.disable()}}function Yj(){if(Bun.env.NODE_ENV==="production")return;let j=a();if(j.length===0)return;console.warn(`[gemi] ${j.length} model${j.length===1?" is":"s are"} registered, but Kernel.models is empty.
|
|
3
3
|
Nested relation reads resolve a model by name, so a policy on a subclass that does not own its
|
|
4
4
|
`+" name is skipped inside every include \u2014 scoped at the root, "+`unscoped in an include, with nothing
|
|
5
5
|
to notice it. Declaring the modules registers each class under its own name and audits the set:
|
|
@@ -13,4 +13,4 @@ import{ya as y}from"../chunk-4czqjqs7.js";import{Va as i}from"../chunk-q18fb0cr.
|
|
|
13
13
|
|
|
14
14
|
See docs/orm.md#your-model-class. Development only; this never prints in production.`)}export{$j as oneTimeSecretMatches,Zj as hashOneTimeSecret,U as frameworkProviders,Hj as UserProvider,Gj as SESSION_SELECT,jj as Kernel};
|
|
15
15
|
|
|
16
|
-
//# debugId=
|
|
16
|
+
//# debugId=F93B3AC82437B84864756E2164756E21
|
package/dist/kernel/index.js.map
CHANGED
|
@@ -7,6 +7,6 @@
|
|
|
7
7
|
"import { Application } from \"../foundation/Application\";\nimport type { ServiceProviderConstructor, ShutdownReport } from \"../foundation/Application\";\nimport type { ServiceToken } from \"../container/Container\";\nimport type { ConfigItems } from \"../support/Repository\";\nimport type { Service, ServiceConstructor } from \"../support/Service\";\nimport { registerModels } from \"../orm/registration\";\nimport { registeredNames } from \"../orm/registry\";\nimport { Scheduler } from \"../services/cron/Scheduler\";\nimport { QueueManager } from \"../services/queue/QueueManager\";\nimport { startClaimingIfServing } from \"../services/queue/QueueServiceProvider\";\nimport { ApiRouteDispatcher } from \"../services/router/ApiRouteDispatcher\";\nimport { ViewRouteDispatcher } from \"../services/router/ViewRouteDispatcher\";\nimport { DomainRouter } from \"../services/router/DomainRouter\";\nimport { runGlobalMiddleware } from \"../services/router/globalMiddleware\";\nimport { kernelContext } from \"./context\";\nimport { frameworkProviders } from \"./providers\";\n\n/**\n * The app's entry point into the framework. A Kernel subclass declares what the\n * app adds — its `config` slices and any extra `providers` — and everything\n * else lives in the Application container it owns.\n */\nexport class Kernel {\n /**\n * App-level config, merged over the framework defaults. Each key is a config\n * slice: `{ mail: { ... }, route: { ... } }`, normally the modules under\n * `app/config`.\n */\n protected config: ConfigItems = {};\n\n /**\n * App-level providers, registered after the framework's own so they can\n * rebind anything the framework bound.\n */\n protected providers: ServiceProviderConstructor[] = [];\n\n /**\n * The app's own singleton services. Each is constructed during the\n * synchronous boot phase and its `boot()` awaited during the asynchronous\n * one, in the order listed — so a service whose `boot()` depends on another\n * goes after it.\n *\n * An entry is either the class itself or a configured instance from\n * `Service.with({ ... })`. Listing is explicit rather than discovered because\n * the order is load-bearing here, and because a service is always imported by\n * whatever injects it — there is no file the import graph would miss.\n */\n protected services: Array<ServiceConstructor | Service> = [];\n\n private serviceInstances: Service[] = [];\n private serviceTokens = new Set<string>();\n private servicesBooted = false;\n\n /**\n * The modules holding the app's model classes — normally\n * `[generated, models]`, the generated namespace and the barrel of subclasses\n * written over it. Every model class they export is registered under the name\n * its schema carries, later modules winning, and the whole set is audited\n * before anything else boots.\n *\n * ### Why this is a Kernel field and not a line in a file somewhere\n *\n * Registration used to be `register(\"User\", User)` next to each subclass, and\n * the failure mode of forgetting it is an authorization hole that nothing\n * reports: a relation read resolves its target by name, so an unregistered\n * policied subclass leaves the generated base owning the name and every\n * nested `include` of that model comes back unscoped. No error at the root\n * either, because `$exec`'s divergence guard begins `registered !== this` and\n * the base it is running on *is* the registered one. A model only ever read\n * through an include — a membership, a pivot, the kind that carries a tenant\n * scope — never trips anything.\n *\n * Listing the modules here says it once, in the same place the app already\n * declares its config slices and providers, and turns the mistake into a\n * failure to boot rather than a quiet cross-tenant read.\n *\n * It sees the modules it is given, so a model class in a file that no barrel\n * re-exports is still invisible. That is the residual, and it is a smaller\n * one: a barrel is a place to notice an omission, and thirteen `register`\n * lines scattered across thirteen files is not.\n */\n protected models: Array<Record<string, unknown>> = [];\n\n readonly app = new Application();\n\n /**\n * Phase one, synchronous: every provider is constructed and its `register()`\n * runs. Only bindings are recorded here — no service is instantiated, so this\n * is safe to call from a synchronous constructor (`new App({ kernel })`).\n * Phase two is `waitForBoot()`.\n */\n boot() {\n // Before the container, deliberately. This throws on a model whose policies\n // would be skipped, and the useful moment for that is the one where nothing\n // has been constructed and no request can be in flight.\n if (this.models.length > 0) registerModels(...this.models);\n else warnIfModelsAreRegisteredButUndeclared();\n\n this.app.config.merge(this.config);\n Application.setInstance(this.app);\n this.app.registerMany([...frameworkProviders, ...this.providers]);\n this.registerServices();\n }\n\n /**\n * Constructs every listed service and binds it into the container. Runs after\n * the providers have registered, so a provider's `boot()` can `inject()` one;\n * a `Service` constructor does no I/O, so doing this synchronously costs\n * nothing beyond the field initializers.\n */\n private registerServices() {\n // What a previous pass bound, so re-running this on the same kernel is not\n // mistaken for a collision with something else.\n const ours = this.serviceTokens;\n\n this.serviceInstances = [];\n this.serviceTokens = new Set();\n this.servicesBooted = false;\n\n const owners = new Map<string, string>();\n\n for (const declaration of this.services) {\n const instance =\n typeof declaration === \"function\" ? new declaration() : declaration;\n const ctor = instance.constructor as ServiceConstructor;\n\n if (!ctor.token) {\n throw new Error(\n `Service [${ctor.name}] is listed in \\`services\\` but does not declare a \\`static token\\`.`,\n );\n }\n\n // Two services under one token is the failure this refuses to have\n // silently: the second would replace the first in the container, and\n // every `inject()` written against either would hand back whichever was\n // listed last.\n const owner = owners.get(ctor.token);\n if (owner) {\n throw new Error(\n `Services [${owner}] and [${ctor.name}] both declare the token \"${ctor.token}\". Tokens are the container's keys, so they must be unique.`,\n );\n }\n owners.set(ctor.token, ctor.name);\n\n // The same failure one level out. `Container.instance()` writes into\n // `instances`, which `make()` consults before `bindings`, so a token that\n // is already spoken for is not shared with its owner — it replaces it, for\n // every `app()` and `inject()` in the process. An app service that named\n // itself \"mail\" would leave `Mail.send()` resolving to an object with no\n // `send`, and the boot that caused it would report nothing. Providers have\n // all registered by now, so anything bound here belongs to somebody else.\n const token = ctor as unknown as ServiceToken<Service>;\n if (!ours.has(ctor.token) && this.app.bound(token)) {\n throw new Error(\n `Service [${ctor.name}] declares the token \"${ctor.token}\", which is already bound in the container by the framework or a provider. Binding it would replace that service everywhere, so pick a token nothing else owns.`,\n );\n }\n\n this.app.instance(token, instance);\n this.serviceInstances.push(instance);\n this.serviceTokens.add(ctor.token);\n }\n }\n\n /**\n * Phase two, asynchronous: every provider's `boot()` runs, in registration\n * order, after all of them have registered. Idempotent.\n */\n async waitForBoot() {\n await this.app.boot();\n await this.bootServices();\n // Last, once every job — queued listeners included — is registered.\n startClaimingIfServing(this.app);\n }\n\n /**\n * Phase two for services, after every provider's `boot()` — so a service may\n * use the facades and anything else a provider owns. Idempotent, like the\n * provider phase it follows.\n */\n private async bootServices() {\n if (this.servicesBooted) {\n return;\n }\n for (const service of this.serviceInstances) {\n await service.boot();\n }\n this.servicesBooted = true;\n }\n\n /**\n * Every provider's `shutdown()`, in reverse registration order, inside the\n * application context — so a hook may use the facades, as a cron tick or a\n * request would. See `Application.shutdown` for the deadline and the\n * report. Idempotent.\n */\n shutdown(options?: { timeoutMs?: number }): Promise<ShutdownReport> {\n return this.run(() => this.app.shutdown(options));\n }\n\n run<T>(cb: () => T) {\n return kernelContext.run(this.app, cb);\n }\n\n /**\n * Resolve a service by token. Callers outside this module should prefer the\n * named accessors below or `app()`; this exists for tooling that holds a\n * Kernel but no ambient context.\n */\n resolve<T>(token: ServiceToken<T>): T {\n return this.app.make(token);\n }\n\n // Named accessors. `app/App.ts` goes through these rather than importing the\n // service classes itself — see the note in that file about the two copies of\n // gemi that coexist at build time.\n apiRoutes(): ApiRouteDispatcher {\n return this.app.make(ApiRouteDispatcher);\n }\n\n viewRoutes(): ViewRouteDispatcher {\n return this.app.make(ViewRouteDispatcher);\n }\n\n domains(): DomainRouter {\n return this.app.make(DomainRouter);\n }\n\n queue(): QueueManager {\n return this.app.make(QueueManager);\n }\n\n /** The `global` middleware list for one request. Call it inside `run`. */\n globalMiddleware(req: Request) {\n return runGlobalMiddleware(req);\n }\n\n destroy() {\n // Only touch services that were actually resolved — resolving one here\n // would construct it purely to tear it down.\n if (this.app.resolved(Scheduler)) {\n this.app.make(Scheduler).stop();\n }\n\n this.app.flush();\n\n if (Application.getInstance() === this.app) {\n Application.setInstance(undefined);\n }\n\n kernelContext.disable();\n }\n}\n\n/**\n * Says something to an application that has models and has not declared them.\n *\n * Without this the fix for #316 defaults to off. `models` is `[]`, `boot()`\n * no-ops, and an app upgrading from 0.48 is in exactly the state the issue\n * describes until somebody edits their Kernel by hand — while the only place\n * that says to is the **Setup** section of `docs/orm.md`, which an existing app\n * read once and will not read again. #316 was filed by an app mid-migration\n * with a 79-model schema, which is precisely the reader who never sees it.\n *\n * The condition is what makes this worth printing. A populated registry with an\n * empty `models` means the generated `index.ts` was imported and its bases are\n * what every nested read resolves to — so if any policy lives on a subclass, it\n * is being skipped inside includes right now. A Kernel with no ORM at all has\n * an empty registry and hears nothing.\n *\n * Development only, and a warning rather than a throw: an app in this state is\n * running today, and turning a working deploy into a failure to start over an\n * arrangement that *might* be fine is not a patch-level thing to do. The\n * failure it points at is silent, so the fix for it has to be noisy somewhere,\n * and the terminal an author is already looking at is the cheapest somewhere\n * there is.\n */\nfunction warnIfModelsAreRegisteredButUndeclared(): void {\n if (process.env.NODE_ENV === \"production\") return;\n\n const registered = registeredNames();\n if (registered.length === 0) return;\n\n console.warn(\n `[gemi] ${registered.length} model${registered.length === 1 ? \" is\" : \"s are\"} ` +\n `registered, but Kernel.models is empty.\\n` +\n ` Nested relation reads resolve a model by name, so a policy on a ` +\n `subclass that does not own its\\n` +\n ` name is skipped inside every include — scoped at the root, ` +\n `unscoped in an include, with nothing\\n` +\n ` to notice it. Declaring the modules registers each class under ` +\n `its own name and audits the set:\\n\\n` +\n ` import * as generated from \"../models/generated\"\\n` +\n ` import * as models from \"../models\"\\n\\n` +\n ` export default class extends Kernel {\\n` +\n ` models = [generated, models]\\n` +\n ` }\\n\\n` +\n ` See docs/orm.md#your-model-class. Development only; this never ` +\n `prints in production.`,\n );\n}\n"
|
|
8
8
|
],
|
|
9
9
|
"mappings": ";q2CAqCA,IAAS,HAAe,JAAC,HAAoB,JAC3C,DAAM,HAAe,HAAS,GAAQ,DAAI,UAAe,FAAG,OAAY,FAAK,FAC7E,CAAO,0BAA+B,AAAK,JAAY,HAGzD,DAAM,FAAY,DAAI,DAEhB,FAAuC,JAC3C,GAAS,KACT,MAAO,CAAC,IAAa,EACrB,QAAS,IACX,EA8BA,eAAsB,CAAmB,CAAC,EAAgD,CACxF,IAAM,EAAW,EAAI,CAAkB,EACvC,GAAI,EAA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756E2164756E21",
|
|
11
11
|
"names": []
|
|
12
12
|
}
|
package/dist/orm/Model.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { type TrashedMode } from "./context";
|
|
1
2
|
import { type ExecOptions, type Operation, type QueryPlan } from "./plan";
|
|
2
3
|
import { type PolicyEntry } from "./policy";
|
|
4
|
+
import { type SoftDeletesSetting } from "./soft-deletes";
|
|
3
5
|
import type { ModelSchema } from "./schema";
|
|
4
6
|
export declare abstract class Model {
|
|
5
7
|
/**
|
|
@@ -66,6 +68,21 @@ export declare abstract class Model {
|
|
|
66
68
|
* typing, which a bare `$policies = [...]` does not get on its own.
|
|
67
69
|
*/
|
|
68
70
|
static $policies?: readonly PolicyEntry[];
|
|
71
|
+
/**
|
|
72
|
+
* Make `skipIfUnchanged: true` the default for this model's `update` and
|
|
73
|
+
* `updateMany` (#664): a row whose assigned columns already hold the values
|
|
74
|
+
* being written is not written, so its `@updatedAt` keeps meaning "last real
|
|
75
|
+
* change".
|
|
76
|
+
*
|
|
77
|
+
* export class AsyncJob extends AsyncJobModel {
|
|
78
|
+
* static $skipNoopUpdates = true;
|
|
79
|
+
* }
|
|
80
|
+
*
|
|
81
|
+
* A call can still opt out with `skipIfUnchanged: false`. Applies to the
|
|
82
|
+
* calls an application makes, not to the updates the ORM issues itself for a
|
|
83
|
+
* nested relation write — those keep their exact row counts.
|
|
84
|
+
*/
|
|
85
|
+
static $skipNoopUpdates?: boolean;
|
|
69
86
|
/**
|
|
70
87
|
* The connection this class's operations run on, set only by `on` below.
|
|
71
88
|
*
|
|
@@ -132,6 +149,70 @@ export declare abstract class Model {
|
|
|
132
149
|
* await Model.asUser(owner, () => Invoice.findMany({}))
|
|
133
150
|
*/
|
|
134
151
|
static asUser<T>(user: unknown, fn: () => Promise<T>): Promise<T>;
|
|
152
|
+
/**
|
|
153
|
+
* Soft deletes as a model setting (#663): every read, `count`, aggregate,
|
|
154
|
+
* update and delete on this model skips rows whose timestamp column is set —
|
|
155
|
+
* including the nested reads another model makes of it (`include`, `_count`,
|
|
156
|
+
* relation filters and orderings) under either relation strategy.
|
|
157
|
+
*
|
|
158
|
+
* export class PriceOffer extends PriceOfferModel {
|
|
159
|
+
* static $softDeletes = true; // `deletedAt`
|
|
160
|
+
* // static $softDeletes = { field: "archivedAt" };
|
|
161
|
+
* }
|
|
162
|
+
*
|
|
163
|
+
* **Unlike the `softDeletes()` policy it survives `Model.asSystem`.** That
|
|
164
|
+
* suspends authorization; it does not resurrect deleted rows. Opt out per
|
|
165
|
+
* call with {@link withTrashed} / {@link onlyTrashed}, which keep every other
|
|
166
|
+
* policy in force.
|
|
167
|
+
*
|
|
168
|
+
* `delete()` stays a hard delete — see `softDelete` in `soft-deletes.ts` for
|
|
169
|
+
* the recipe that turns one into an update, which this setting scopes like
|
|
170
|
+
* any other update. `upsert` is not scoped: its conflict target is a unique
|
|
171
|
+
* key, and a trashed row still holds it.
|
|
172
|
+
*/
|
|
173
|
+
static $softDeletes?: SoftDeletesSetting;
|
|
174
|
+
/**
|
|
175
|
+
* Set on the subclass `withTrashed()` / `onlyTrashed()` return. Not for
|
|
176
|
+
* applications to write: the methods are the interface.
|
|
177
|
+
*/
|
|
178
|
+
static $trashed?: TrashedMode;
|
|
179
|
+
/**
|
|
180
|
+
* Includes soft-deleted rows. Two spellings:
|
|
181
|
+
*
|
|
182
|
+
* await PriceOffer.withTrashed().findMany({ where }) // this query
|
|
183
|
+
* await PriceOffer.withTrashed(() => // a block
|
|
184
|
+
* Order.findMany({ include: { offer: true } }),
|
|
185
|
+
* )
|
|
186
|
+
*
|
|
187
|
+
* The chain lifts the scope for the query it starts — the root model only.
|
|
188
|
+
* The block lifts it for every query on this model inside `fn`, which is the
|
|
189
|
+
* spelling that reaches a nested read *of* this model from another one.
|
|
190
|
+
*
|
|
191
|
+
* Only the soft-delete scope is lifted: tenant scopes and every other
|
|
192
|
+
* `$policies` entry still apply, which is what `asSystem` could not offer.
|
|
193
|
+
*/
|
|
194
|
+
static withTrashed<T extends typeof Model>(this: T): T;
|
|
195
|
+
static withTrashed<R>(fn: () => Promise<R>): Promise<R>;
|
|
196
|
+
/** Reads soft-deleted rows only. Same two spellings as {@link withTrashed}. */
|
|
197
|
+
static onlyTrashed<T extends typeof Model>(this: T): T;
|
|
198
|
+
static onlyTrashed<R>(fn: () => Promise<R>): Promise<R>;
|
|
199
|
+
/**
|
|
200
|
+
* Clears the timestamp on one soft-deleted row and returns it.
|
|
201
|
+
*
|
|
202
|
+
* Scoped to trashed rows, so a `where` naming a row that is not deleted is a
|
|
203
|
+
* miss and raises `RecordNotFoundError` — the same answer `expire` gives for
|
|
204
|
+
* a row that already is. Takes `delete`'s arguments: a unique `where` and an
|
|
205
|
+
* optional projection.
|
|
206
|
+
*/
|
|
207
|
+
static restore<C extends typeof Model & {
|
|
208
|
+
delete(args: any): Promise<any>;
|
|
209
|
+
}>(this: C, args: Parameters<C["delete"]>[0]): ReturnType<C["delete"]>;
|
|
210
|
+
/** {@link restore} for every trashed row matching `where`; returns the count. */
|
|
211
|
+
static restoreMany<C extends typeof Model & {
|
|
212
|
+
deleteMany(args?: any): Promise<any>;
|
|
213
|
+
}>(this: C, args?: Parameters<C["deleteMany"]>[0]): Promise<{
|
|
214
|
+
count: number;
|
|
215
|
+
}>;
|
|
135
216
|
/**
|
|
136
217
|
* Persists the changes made to a *tracked* row: `update` with only the columns
|
|
137
218
|
* whose value differs from what was fetched.
|
package/dist/orm/Model.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Model.d.ts","sourceRoot":"","sources":["../../orm/Model.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Model.d.ts","sourceRoot":"","sources":["../../orm/Model.ts"],"names":[],"mappings":"AAKA,OAAO,EAOL,KAAK,WAAW,EAIjB,MAAM,WAAW,CAAC;AAuBnB,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,QAAQ,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kG7D;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG;IA0B7B;;;OAGG;IACH,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC;IAIxB,MAAM,CAAC,YAAY,IAAI,WAAW;IAMlC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4DG;WAMU,WAAW,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAY7D;;;;;;;;;;;;;;;;;;;;;;OAsBG;WACU,KAAK,CAChB,EAAE,EAAE,SAAS,EACb,IAAI,GAAE,GAAQ,EACd,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,OAAO,CAAC;mBAME,QAAQ;IAmuB7B;;;;;OAKG;IACH,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO;CAGzD"}
|
|
@@ -129,5 +129,22 @@ export declare function assertListDialect(schema: ModelSchema, field: FieldSchem
|
|
|
129
129
|
declare const JSON_FILTER_NAMES: readonly ["equals", "not", "string_contains", "string_starts_with", "string_ends_with", "array_contains", "lt", "lte", "gt", "gte"];
|
|
130
130
|
/** One of {@link JSON_FILTER_NAMES}. `JsonPathFilter` maps over this. */
|
|
131
131
|
export type JsonFilterName = (typeof JSON_FILTER_NAMES)[number];
|
|
132
|
+
/**
|
|
133
|
+
* The key-exists filters on a `Json` column (#664). Not Prisma's — it has no
|
|
134
|
+
* way to ask whether a document holds a key — so they are kept apart from
|
|
135
|
+
* {@link JSON_FILTER_NAMES}, whose whole job is to track Prisma's set.
|
|
136
|
+
*
|
|
137
|
+
* where: { payload: { has_key: "a" } }
|
|
138
|
+
* where: { payload: { has_some_keys: ["a", "b"] } }
|
|
139
|
+
* where: { payload: { has_every_key: ["a", "b"] } }
|
|
140
|
+
* where: { payload: { path: ["meta"], has_key: "a" } }
|
|
141
|
+
*
|
|
142
|
+
* Named after Postgres's `?`, `?|` and `?&`, in the snake case the neighbouring
|
|
143
|
+
* JSON filters use. They work on the column and at a `path`, on both dialects;
|
|
144
|
+
* the value there has to be an object (see `SqlDialect.jsonHasKeys`).
|
|
145
|
+
*/
|
|
146
|
+
export declare const JSON_KEY_FILTER_NAMES: readonly ["has_key", "has_some_keys", "has_every_key"];
|
|
147
|
+
/** One of {@link JSON_KEY_FILTER_NAMES}. */
|
|
148
|
+
export type JsonKeyFilterName = (typeof JSON_KEY_FILTER_NAMES)[number];
|
|
132
149
|
export {};
|
|
133
150
|
//# sourceMappingURL=where.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"where.d.ts","sourceRoot":"","sources":["../../../orm/compile/where.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAU7C,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAkB,MAAM,WAAW,CAAC;AAG1E,OAAO,EAEL,KAAK,QAAQ,EAKd,MAAM,YAAY,CAAC;AAIpB;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,YAAY;AACrB;;;;;GAKG;AACH,MAAM,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,GAAG,GACzB,QAAQ,GAAG,IAAI,CA8EjB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,UAAU,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;;;OASG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AA8VD;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,YA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export interface OrmScope {
|
|
|
100
100
|
* when a savepoint rolls back.
|
|
101
101
|
*/
|
|
102
102
|
commitDependsOn?: Promise<unknown>[];
|
|
103
|
+
/**
|
|
104
|
+
* Models whose soft-delete scope (`static $softDeletes`) is lifted or
|
|
105
|
+
* inverted for this async subtree, by name — set only by
|
|
106
|
+
* `Model.withTrashed(fn)` / `Model.onlyTrashed(fn)`.
|
|
107
|
+
*
|
|
108
|
+
* Keyed by model name rather than class because a nested relation read
|
|
109
|
+
* resolves its target through the registry by name, and the block has to
|
|
110
|
+
* reach those reads too. A fresh map per block, never mutated, so an inner
|
|
111
|
+
* block cannot leak its entry back into the enclosing one.
|
|
112
|
+
*/
|
|
113
|
+
trashed?: ReadonlyMap<string, TrashedMode>;
|
|
103
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* How a soft-deleted model's trashed rows are treated: `"with"` includes them,
|
|
117
|
+
* `"only"` reads nothing else. Absent means the default — they are hidden.
|
|
118
|
+
*/
|
|
119
|
+
export type TrashedMode = "with" | "only";
|
|
104
120
|
/**
|
|
105
121
|
* Work deferred to a transaction's commit.
|
|
106
122
|
*
|
|
@@ -237,6 +253,17 @@ export declare function isSystemScope(): boolean;
|
|
|
237
253
|
* handle.
|
|
238
254
|
*/
|
|
239
255
|
export declare function runAsSystem<T>(fn: () => Promise<T>): Promise<T>;
|
|
256
|
+
/**
|
|
257
|
+
* How `model`'s trashed rows are treated in this async scope, or `undefined`
|
|
258
|
+
* for the default (hidden). See `OrmScope.trashed`.
|
|
259
|
+
*/
|
|
260
|
+
export declare function trashedMode(model: string): TrashedMode | undefined;
|
|
261
|
+
/**
|
|
262
|
+
* Run `fn` with `model`'s soft-delete scope lifted (`"with"`) or inverted
|
|
263
|
+
* (`"only"`). Merged into the current scope like `runAsSystem`, so it keeps an
|
|
264
|
+
* open transaction, the system flag and the actor — and every other policy.
|
|
265
|
+
*/
|
|
266
|
+
export declare function runWithTrashed<T>(model: string, mode: TrashedMode, fn: () => Promise<T>): Promise<T>;
|
|
240
267
|
/** The explicitly-set actor, or `undefined` when none was. */
|
|
241
268
|
export declare function currentActor(): {
|
|
242
269
|
user: unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../orm/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAOrD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,QAAQ;IACvB;;;;;OAKG;IACH,EAAE,CAAC,EAAE,cAAc,CAAC;IACpB,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;;;;;;;;;OAgBG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,CAAC;IAC1B;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,WAAW,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACpC;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../orm/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAOrD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,QAAQ;IACvB;;;;;OAKG;IACH,EAAE,CAAC,EAAE,cAAc,CAAC;IACpB,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;;;;;;;;;OAgBG;IACH,UAAU,CAAC,EA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C,EAAE;IAAE,wBAAwB,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GAC3E,OAAO,CAAC,CAAC,CAAC,CA2JZ"}
|
|
@@ -339,6 +339,34 @@ export interface SqlDialect {
|
|
|
339
339
|
* Bound, never interpolated, for the same reason `jsonExtract` is.
|
|
340
340
|
*/
|
|
341
341
|
jsonValueAt(column: string, path: Binder): Fragment;
|
|
342
|
+
/**
|
|
343
|
+
* Whether the JSON value at `path` — the column itself when `path` is
|
|
344
|
+
* `undefined` — is an **object** holding the key, any of the keys, or all of
|
|
345
|
+
* them: `has_key`, `has_some_keys`, `has_every_key` (#664).
|
|
346
|
+
*
|
|
347
|
+
* `keys` binds a string for `"one"` and a string array for the other two;
|
|
348
|
+
* `count` is that array's length, which SQLite needs because it tests one
|
|
349
|
+
* key per term. Postgres binds the array whole, so its text does not depend
|
|
350
|
+
* on `count` and the plan key collapses the list (`LIST_KEYS` in `plan.ts`).
|
|
351
|
+
*
|
|
352
|
+
* **Objects only, on both dialects.** Postgres's `?` also matches a string
|
|
353
|
+
* *element* of a top-level array; SQLite's path lookup does not. Both forms
|
|
354
|
+
* are guarded with "the value is an object" so the two answer the same rows:
|
|
355
|
+
* `has_every_key: []` is "is an object", and `has_some_keys: []` is false.
|
|
356
|
+
* A key holding the JSON value `null` exists.
|
|
357
|
+
*/
|
|
358
|
+
jsonHasKeys(column: string, path: Binder | undefined, keys: Binder, mode: "one" | "some" | "every", count: number): Fragment;
|
|
359
|
+
/**
|
|
360
|
+
* `lhs` differs from `rhs`, treating NULL as equal to NULL — the guard
|
|
361
|
+
* `skipIfUnchanged` adds to an update's `where` (#664).
|
|
362
|
+
*
|
|
363
|
+
* `rhs` is the same parameter the `set` binds, so the comparison is against
|
|
364
|
+
* the stored encoding of the value. A `Json` column compares as JSON rather
|
|
365
|
+
* than as text: `jsonb` equality on Postgres (key order and whitespace do not
|
|
366
|
+
* matter), and `json()`-normalised text on SQLite (whitespace does not
|
|
367
|
+
* matter; key order does).
|
|
368
|
+
*/
|
|
369
|
+
distinctFrom(lhs: string, rhs: Fragment, field: FieldSchema): Fragment;
|
|
342
370
|
/**
|
|
343
371
|
* `limit`/`offset`. Both are values and therefore parameters — this is the
|
|
344
372
|
* single most tempting place in the compiler to inline a number.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../orm/dialect/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAC;IAE1C;;;;;;;;;OASG;IACH,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAC;IAE1C;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;IAEpC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IAEpC;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,QAAQ,CAAC,4BAA4B,EAAE,OAAO,CAAC;IAE/C,iFAAiF;IACjF,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAEjC;;;OAGG;IACH,WAAW,CAA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