gemi 0.52.0 → 0.54.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/app/index.js +2 -2
- package/dist/app/index.js.map +1 -1
- package/dist/bin/gemi.js +1456 -5
- package/dist/bin/gemi.js.map +9 -5
- package/dist/broadcasting/index.js +1 -1
- package/dist/bun/plugin.js +2 -2
- package/dist/bun/plugin.js.map +1 -1
- package/dist/bun/preload.js +2 -2
- package/dist/bun/preload.js.map +1 -1
- package/dist/{chunk-msz8rngs.js → chunk-004bcmsa.js} +2 -2
- package/dist/chunk-004bcmsa.js.map +10 -0
- package/dist/chunk-07t0dmdg.js +4 -0
- package/dist/{chunk-faa987e4.js.map → chunk-07t0dmdg.js.map} +2 -2
- package/dist/{chunk-4t6a82fh.js → chunk-0weeq0ke.js} +2 -2
- package/dist/{chunk-4t6a82fh.js.map → chunk-0weeq0ke.js.map} +1 -1
- package/dist/chunk-113khwbw.js +5 -0
- package/dist/{chunk-2qn472j4.js.map → chunk-113khwbw.js.map} +1 -1
- package/dist/{chunk-tmk4zfz9.js → chunk-1sh6kqjn.js} +3 -3
- package/dist/{chunk-tmk4zfz9.js.map → chunk-1sh6kqjn.js.map} +1 -1
- package/dist/{chunk-2gw6cyyj.js → chunk-1snh7yc4.js} +2 -2
- package/dist/{chunk-2gw6cyyj.js.map → chunk-1snh7yc4.js.map} +1 -1
- package/dist/chunk-26r8dcxd.js +6 -0
- package/dist/{chunk-hbycemy5.js.map → chunk-26r8dcxd.js.map} +2 -2
- package/dist/{chunk-ebcgdv00.js → chunk-2pt6kyn9.js} +3 -3
- package/dist/{chunk-ebcgdv00.js.map → chunk-2pt6kyn9.js.map} +1 -1
- package/dist/{chunk-jdfe4dmh.js → chunk-2zmz3pjk.js} +3 -3
- package/dist/{chunk-jdfe4dmh.js.map → chunk-2zmz3pjk.js.map} +1 -1
- package/dist/{chunk-zhsaz9cr.js → chunk-3bw1jk21.js} +1 -1
- package/dist/chunk-4qkzdyj7.js +4 -0
- package/dist/{chunk-4e61qbp4.js.map → chunk-4qkzdyj7.js.map} +1 -1
- package/dist/{chunk-d1ahbza9.js → chunk-50vm7x98.js} +3 -3
- package/dist/{chunk-d1ahbza9.js.map → chunk-50vm7x98.js.map} +1 -1
- package/dist/{chunk-qyaqg07q.js → chunk-6j1z2cqt.js} +2 -2
- package/dist/{chunk-qyaqg07q.js.map → chunk-6j1z2cqt.js.map} +1 -1
- package/dist/chunk-6rhebm18.js +5 -0
- package/dist/chunk-6rhebm18.js.map +10 -0
- package/dist/{chunk-rq770c71.js → chunk-71m47kad.js} +2 -2
- package/dist/{chunk-rq770c71.js.map → chunk-71m47kad.js.map} +1 -1
- package/dist/{chunk-0h3jr9d9.js → chunk-7f5ad759.js} +2 -2
- package/dist/{chunk-8p6rqegw.js.map → chunk-7f5ad759.js.map} +1 -1
- package/dist/{chunk-qj4mmner.js → chunk-85av4ncy.js} +2 -2
- package/dist/{chunk-qj4mmner.js.map → chunk-85av4ncy.js.map} +1 -1
- package/dist/{chunk-23g7qdpg.js → chunk-9taz1h3t.js} +3 -3
- package/dist/{chunk-23g7qdpg.js.map → chunk-9taz1h3t.js.map} +1 -1
- package/dist/{chunk-ppt296ye.js → chunk-agabw2w1.js} +2 -2
- package/dist/{chunk-ppt296ye.js.map → chunk-agabw2w1.js.map} +1 -1
- package/dist/{chunk-092pj2j2.js → chunk-bb3zvxsf.js} +3 -3
- package/dist/{chunk-092pj2j2.js.map → chunk-bb3zvxsf.js.map} +1 -1
- package/dist/{chunk-h7jv3ame.js → chunk-br8ten26.js} +2 -2
- package/dist/{chunk-h7jv3ame.js.map → chunk-br8ten26.js.map} +1 -1
- package/dist/{chunk-4e61qbp4.js → chunk-bzhtymvv.js} +2 -2
- package/dist/{chunk-0h3jr9d9.js.map → chunk-bzhtymvv.js.map} +1 -1
- package/dist/{chunk-68w225rv.js → chunk-c0wcsmpj.js} +2 -2
- package/dist/{chunk-68w225rv.js.map → chunk-c0wcsmpj.js.map} +1 -1
- package/dist/{chunk-xsmt86n3.js → chunk-c22vcxty.js} +2 -2
- package/dist/{chunk-xsmt86n3.js.map → chunk-c22vcxty.js.map} +1 -1
- package/dist/{chunk-a0sy9f9x.js → chunk-c2pv3ah8.js} +2 -2
- package/dist/{chunk-a0sy9f9x.js.map → chunk-c2pv3ah8.js.map} +2 -2
- package/dist/{chunk-q09mmr05.js → chunk-cz3szqhq.js} +2 -2
- package/dist/{chunk-q09mmr05.js.map → chunk-cz3szqhq.js.map} +1 -1
- package/dist/{chunk-69w4egkg.js → chunk-dwx2y7br.js} +4 -4
- package/dist/{chunk-69w4egkg.js.map → chunk-dwx2y7br.js.map} +1 -1
- package/dist/{chunk-2sfz64xh.js → chunk-dxw8k6f1.js} +2 -2
- package/dist/{chunk-2sfz64xh.js.map → chunk-dxw8k6f1.js.map} +1 -1
- package/dist/chunk-e3mggavt.js +5 -0
- package/dist/chunk-e3mggavt.js.map +11 -0
- package/dist/{chunk-j1knf8gv.js → chunk-efsk1wy0.js} +3 -3
- package/dist/{chunk-j1knf8gv.js.map → chunk-efsk1wy0.js.map} +1 -1
- package/dist/{chunk-t4n25km9.js → chunk-f13f68c0.js} +2 -2
- package/dist/{chunk-t4n25km9.js.map → chunk-f13f68c0.js.map} +1 -1
- package/dist/{chunk-vv72kw74.js → chunk-f418jh9k.js} +2 -2
- package/dist/{chunk-vv72kw74.js.map → chunk-f418jh9k.js.map} +1 -1
- package/dist/chunk-f4e7fh95.js +17 -0
- package/dist/chunk-f4e7fh95.js.map +14 -0
- package/dist/{chunk-ewgv1j8q.js → chunk-fcqc3e3r.js} +2 -2
- package/dist/{chunk-ewgv1j8q.js.map → chunk-fcqc3e3r.js.map} +1 -1
- package/dist/{chunk-3y9nf09k.js → chunk-g5tj10p8.js} +2 -2
- package/dist/{chunk-3y9nf09k.js.map → chunk-g5tj10p8.js.map} +1 -1
- package/dist/chunk-gn9zjgep.js +5 -0
- package/dist/chunk-gn9zjgep.js.map +10 -0
- package/dist/{chunk-5s45prj5.js → chunk-h7mcwfg5.js} +4 -4
- package/dist/{chunk-5s45prj5.js.map → chunk-h7mcwfg5.js.map} +1 -1
- package/dist/chunk-hk067634.js +4 -0
- package/dist/{chunk-vnjvd82s.js.map → chunk-hk067634.js.map} +2 -2
- package/dist/{chunk-qx6sahe0.js → chunk-hrrmxreg.js} +2 -2
- package/dist/{chunk-qx6sahe0.js.map → chunk-hrrmxreg.js.map} +1 -1
- package/dist/{chunk-p22rkf1g.js → chunk-jb022m7n.js} +2 -2
- package/dist/{chunk-p22rkf1g.js.map → chunk-jb022m7n.js.map} +1 -1
- package/dist/chunk-jb2nst6v.js +4 -0
- package/dist/{chunk-6scjrbw7.js.map → chunk-jb2nst6v.js.map} +2 -2
- package/dist/{chunk-kxzwem3g.js → chunk-jdgvdddd.js} +2 -2
- package/dist/{chunk-kxzwem3g.js.map → chunk-jdgvdddd.js.map} +1 -1
- package/dist/{chunk-2yth3kk2.js → chunk-jp4pf3yt.js} +4 -4
- package/dist/{chunk-2yth3kk2.js.map → chunk-jp4pf3yt.js.map} +1 -1
- package/dist/{chunk-0tbwn6er.js → chunk-k14dmqwh.js} +3 -3
- package/dist/{chunk-0tbwn6er.js.map → chunk-k14dmqwh.js.map} +1 -1
- package/dist/{chunk-1ce7veh9.js → chunk-k8endm5j.js} +3 -3
- package/dist/{chunk-1ce7veh9.js.map → chunk-k8endm5j.js.map} +1 -1
- package/dist/chunk-kkkqyvwv.js +81 -0
- package/dist/{chunk-km6x37ws.js.map → chunk-kkkqyvwv.js.map} +5 -5
- package/dist/{chunk-cmq5t8p9.js → chunk-kv2ep453.js} +3 -3
- package/dist/{chunk-cmq5t8p9.js.map → chunk-kv2ep453.js.map} +1 -1
- package/dist/{chunk-z4q1ty6w.js → chunk-kz39hphm.js} +3 -3
- package/dist/{chunk-z4q1ty6w.js.map → chunk-kz39hphm.js.map} +1 -1
- package/dist/{chunk-kaxvw75w.js → chunk-ms8qd7da.js} +3 -3
- package/dist/{chunk-kaxvw75w.js.map → chunk-ms8qd7da.js.map} +1 -1
- package/dist/{chunk-ttzkn1qd.js → chunk-n1tkn8gv.js} +2 -2
- package/dist/{chunk-ttzkn1qd.js.map → chunk-n1tkn8gv.js.map} +1 -1
- package/dist/chunk-nncwsdzz.js +5 -0
- package/dist/chunk-nncwsdzz.js.map +10 -0
- package/dist/{chunk-et0j6jx8.js → chunk-pgjk5ft3.js} +3 -3
- package/dist/{chunk-et0j6jx8.js.map → chunk-pgjk5ft3.js.map} +1 -1
- package/dist/{chunk-tztqkat2.js → chunk-r06rxn19.js} +2 -2
- package/dist/{chunk-tztqkat2.js.map → chunk-r06rxn19.js.map} +1 -1
- package/dist/chunk-r9z5rrk0.js +4 -0
- package/dist/{chunk-1ab1ptq5.js.map → chunk-r9z5rrk0.js.map} +2 -2
- package/dist/{chunk-h5g05qwb.js → chunk-s6e7cvek.js} +2 -2
- package/dist/{chunk-h5g05qwb.js.map → chunk-s6e7cvek.js.map} +1 -1
- package/dist/{chunk-53e48ce8.js → chunk-sqp7kn7h.js} +3 -3
- package/dist/{chunk-53e48ce8.js.map → chunk-sqp7kn7h.js.map} +1 -1
- package/dist/{chunk-mt2755rs.js → chunk-w6gb9gc5.js} +3 -3
- package/dist/{chunk-mt2755rs.js.map → chunk-w6gb9gc5.js.map} +1 -1
- package/dist/{chunk-ha7n1c94.js → chunk-xxw0gz4q.js} +2 -2
- package/dist/{chunk-ha7n1c94.js.map → chunk-xxw0gz4q.js.map} +1 -1
- package/dist/chunk-ywr2vd5r.js +5 -0
- package/dist/{chunk-f29vd5mc.js.map → chunk-ywr2vd5r.js.map} +2 -2
- package/dist/{chunk-38ma6gg3.js → chunk-zckj6bs6.js} +3 -3
- package/dist/{chunk-38ma6gg3.js.map → chunk-zckj6bs6.js.map} +1 -1
- package/dist/chunks/ThemeProvider-Bk1eZymb.js +2901 -0
- package/dist/chunks/ThemeProvider-Bk1eZymb.js.map +1 -0
- package/dist/client/ComponentContext.d.ts.map +1 -1
- package/dist/client/DictionarySinkContext.d.ts +10 -0
- package/dist/client/DictionarySinkContext.d.ts.map +1 -0
- package/dist/client/Mutation.d.ts +1 -1
- package/dist/client/Mutation.d.ts.map +1 -1
- package/dist/client/ThemeProvider.d.ts +7 -0
- package/dist/client/ThemeProvider.d.ts.map +1 -1
- package/dist/client/createRoot.d.ts.map +1 -1
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +242 -2629
- package/dist/client/index.js.map +1 -1
- package/dist/client/useDictionary.d.ts +34 -0
- package/dist/client/useDictionary.d.ts.map +1 -0
- package/dist/client/useDictionary.test-d.d.ts +2 -0
- package/dist/client/useDictionary.test-d.d.ts.map +1 -0
- package/dist/client/useIsNavigationPending.d.ts.map +1 -1
- package/dist/client/useMutate.d.ts.map +1 -1
- package/dist/client/useTranslator.d.ts +8 -0
- package/dist/client/useTranslator.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/Lang.d.ts.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/index.js +2 -2
- package/dist/http/index.js.map +1 -1
- package/dist/i18n/Dictionary.d.ts +7 -0
- package/dist/i18n/Dictionary.d.ts.map +1 -1
- package/dist/i18n/Translator.d.ts +12 -0
- package/dist/i18n/Translator.d.ts.map +1 -1
- package/dist/i18n/config.d.ts +6 -0
- package/dist/i18n/config.d.ts.map +1 -1
- package/dist/i18n/defineDictionary.d.ts +65 -0
- package/dist/i18n/defineDictionary.d.ts.map +1 -0
- package/dist/i18n/dictionaryRegistry.d.ts +85 -0
- package/dist/i18n/dictionaryRegistry.d.ts.map +1 -0
- package/dist/i18n/dictionaryRuntime.d.ts +16 -0
- package/dist/i18n/dictionaryRuntime.d.ts.map +1 -0
- package/dist/i18n/dictionaryRuntime.js +4 -0
- package/dist/i18n/dictionaryRuntime.js.map +9 -0
- package/dist/i18n/dictionaryShape.d.ts +66 -0
- package/dist/i18n/dictionaryShape.d.ts.map +1 -0
- package/dist/i18n/dictionarySink.d.ts +31 -0
- package/dist/i18n/dictionarySink.d.ts.map +1 -0
- package/dist/i18n/index.d.ts +3 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +2 -2
- package/dist/i18n/index.js.map +5 -4
- package/dist/i18n/translate.d.ts +21 -0
- package/dist/i18n/translate.d.ts.map +1 -0
- package/dist/internal/gemiExternals.d.ts +1 -1
- package/dist/internal/gemiExternals.d.ts.map +1 -1
- package/dist/kernel/index.js +2 -2
- package/dist/kernel/index.js.map +2 -2
- package/dist/orm/index.js +2 -2
- package/dist/orm/index.js.map +2 -2
- package/dist/server/index.js +2 -2
- package/dist/server/index.js.map +1 -1
- package/dist/services/index.js +4 -4
- package/dist/services/index.js.map +2 -2
- package/dist/services/router/ViewRouteDispatcher.d.ts.map +1 -1
- package/dist/services/router/streamQueryInjection.d.ts +9 -1
- package/dist/services/router/streamQueryInjection.d.ts.map +1 -1
- package/dist/support/index.js +2 -2
- package/dist/support/index.js.map +1 -1
- package/dist/testing/Page.d.ts +166 -0
- package/dist/testing/Page.d.ts.map +1 -0
- package/dist/testing/index.d.ts +3 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +352 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/utils/Subject.d.ts.map +1 -1
- package/dist/utils/variantKey.d.ts +19 -0
- package/dist/utils/variantKey.d.ts.map +1 -0
- package/dist/vite/__vite-browser-external-S5EYS4bz.mjs +7 -0
- package/dist/vite/api_vite-DSBC5Nzy.mjs +5 -0
- package/dist/vite/browser-DFEUWTkA.mjs +6086 -0
- package/dist/vite/build-C0lmnz6d.mjs +5326 -0
- package/dist/vite/index.mjs +1349 -1
- package/dist/vite/lib-TT6NqN6b.mjs +363 -0
- package/dist/vite/lib-U4DF62jt.mjs +48846 -0
- package/dist/vite/main-Drp2rSLR.mjs +2123 -0
- package/dist/vite/node-BgyIm-M7.mjs +17799 -0
- package/dist/vite/node-yGkKTK1d.mjs +789 -0
- package/dist/vite/postcss-hCXrlC4m.mjs +3515 -0
- package/dist/vite/postcss-import-rYEe0OKc.mjs +448 -0
- package/dist/vite/prompt--dNycKSZ-BmZ8jzP_.mjs +889 -0
- package/dist/vite/rolldown-runtime-B4lejLz5.mjs +37 -0
- package/package.json +4 -1
- package/dist/chunk-1ab1ptq5.js +0 -4
- package/dist/chunk-2qn472j4.js +0 -5
- package/dist/chunk-6scjrbw7.js +0 -4
- package/dist/chunk-88pq4gmf.js +0 -5
- package/dist/chunk-88pq4gmf.js.map +0 -10
- package/dist/chunk-8p6rqegw.js +0 -4
- package/dist/chunk-f29vd5mc.js +0 -5
- package/dist/chunk-faa987e4.js +0 -4
- package/dist/chunk-hbycemy5.js +0 -6
- package/dist/chunk-km6x37ws.js +0 -81
- package/dist/chunk-msz8rngs.js.map +0 -10
- package/dist/chunk-vnjvd82s.js +0 -4
- package/dist/chunk-xw44bwnh.js +0 -5
- package/dist/chunk-xw44bwnh.js.map +0 -11
- /package/dist/{chunk-zhsaz9cr.js.map → chunk-3bw1jk21.js.map} +0 -0
|
@@ -7,6 +7,6 @@
|
|
|
7
7
|
"import {\n AmbiguousModelRegistrationError,\n UnregisteredPolicyClassError,\n} from \"./errors\";\nimport { assertPolicyShapes, policiesFor } from \"./policy\";\nimport * as registry from \"./registry\";\nimport type { ModelSchema } from \"./schema\";\n\n/** A model class, as much of one as anything below `Model.ts` can name. */\ntype ModelClass = object & { $schema: ModelSchema };\n\n/**\n * Checks that every policied model class an application defines is the one the\n * registry resolves its name to — **ahead of any query**, rather than when one\n * happens to be run.\n *\n * ### Why this exists\n *\n * `Model.$exec` already refuses a query whose class carries policies the\n * registered class does not (`UnregisteredPolicyClassError`). That guard closed\n * the two shapes found in #51, and it is the right check, but it can only fire\n * on a class somebody actually queries **at the root**. Its condition begins\n * `registered !== this`, and there is a case where that is false and the leak is\n * real:\n *\n * export class Membership extends MembershipModel {\n * static $policies = [{ scope: (ctx) => ({ orgId: ctx.user.orgId }) }]\n * }\n * // ...and no `register(\"Membership\", Membership)`\n *\n * If nothing ever calls `Membership.findMany()` — because memberships are only\n * ever read through `include: { memberships: true }` — then the include resolves\n * the name to the *generated base*, `this` **is** that base, the comparison\n * never runs, and rows come back unscoped with no error. Not a policy chain that\n * fails to diverge: a check that is never reached.\n *\n * A model reached only through includes is usually a membership or a pivot,\n * which is exactly the kind that carries a tenant scope. So the residual runs\n * the wrong way: the guard is weakest where the data is most sensitive.\n *\n * ### What this does about it\n *\n * The same rule, triggered differently. Instead of waiting for a root query,\n * it takes the modules where an application's model classes live and applies the\n * divergence comparison to every one of them:\n *\n * import * as models from \"@/app/models\"\n * assertPoliciesRegistered(models)\n *\n * Reading a class out of a module namespace is what makes the unqueried case\n * visible — the class exists and is exported whether or not anything queries it.\n *\n * `registerModels` runs this after registering, and `Kernel.models` runs\n * `registerModels` at boot, so an application that declares its model modules\n * gets it without asking. This is the same check for modules the Kernel does\n * not own — a test over a package's models, a script that boots nothing.\n *\n * It can only see modules it is handed, which is the residual either way: a\n * policied class in a file no barrel re-exports is invisible to it.\n * `gemi check models` closes that by handing it the files instead of the\n * barrel — see `auditModelRegistrations`, which is the same rule without the\n * throw.\n */\nexport function assertPoliciesRegistered(\n ...modules: Array<Record<string, unknown>>\n): void {\n const [first] = auditModelRegistrations(...modules);\n if (first !== undefined) throw first;\n}\n\n/**\n * Every problem `assertPoliciesRegistered` would report, as values rather than\n * as a throw — in the order it would have reported them, so the first element is\n * exactly what that function throws.\n *\n * ### Why the rule needed a second caller\n *\n * A throw is the right shape at boot: the first policied class that does not own\n * its name is a reason not to start, and the rest of the list is noise nobody\n * reads before fixing the first one.\n *\n * It is the wrong shape for a checker. `gemi check models` walks\n * `app/models/**` and audits each file, so it wants *all* of them, and it wants\n * to sort them — a policied class the Kernel never sees is a leak to report,\n * while a policied view deliberately kept out of the declared modules is the\n * arrangement the error for that case actually recommends, and reporting it\n * would be telling an author to undo what the framework told them to do.\n * `UnregisteredPolicyClassError.carries` is what separates the two, and it can\n * only be read off an error somebody is holding.\n *\n * Errors rather than a plain finding type, because the message is the useful\n * part and it is already written once, in the error. Constructing them is not\n * free — a stack per finding — and it is a check somebody runs, not a request\n * path.\n */\nexport function auditModelRegistrations(\n ...modules: Array<Record<string, unknown>>\n): UnregisteredPolicyClassError[] {\n const problems: UnregisteredPolicyClassError[] = [];\n\n for (const module of modules) {\n for (const exported of Object.values(module)) {\n const model = asModelClass(exported);\n if (model === null) continue;\n\n // #321's boot-time half, run **before** the early return below and for\n // every class rather than only the diverging ones. Left below the return,\n // the two commonest arrangements were never checked at all — a class that\n // already owns its name, and one whose name nothing else claims — so a\n // `{ scopes: … }` typo registered, reported green, and read unscoped.\n //\n // `assertPolicyShapes` and not `policiesFor`, and the difference is the\n // point: this walk checks the entries and constructs nothing. Resolving\n // here instead is one line and would additionally catch a policy class\n // whose constructor throws — at the price of constructing every policy\n // class in the application at `registerModels` time, ahead of whatever\n // config or container the constructor reaches for. A guard against a\n // policy that does nothing must not become the reason a working\n // application stops booting, so the cases that need an instance are left\n // to `policiesFor`, which is reached below, on the first query, and by\n // `Model.$exec`.\n assertPolicyShapes(model);\n\n const name = model.$schema.name;\n const registered = registry.has(name)\n ? (registry.get<unknown>(name) as object)\n : undefined;\n\n // Nothing registered under the name at all. The generated `index.ts`\n // registers every model, so reaching this means it was never imported —\n // a different mistake, and one the first query reports clearly through\n // `ModelNotRegisteredError`. Not this function's business.\n if (registered === undefined || registered === model) continue;\n\n const ours = policiesFor(model);\n const theirs = policiesFor(registered);\n const diverges =\n ours.length !== theirs.length ||\n ours.some((policy, index) => policy !== theirs[index]);\n\n // The two classes are on one prototype chain — a base and something\n // extending it — which is the arrangement almost every application has,\n // and the one this audit used to get wrong in both directions.\n //\n // `policiesFor` accumulates upwards, so a descendant's chain always\n // contains its ancestor's. What separates the two shapes is therefore\n // whether the **ancestor** carries anything of its own.\n if (descendsFrom(registered, model) || descendsFrom(model, registered)) {\n const ancestor = descendsFrom(model, registered) ? registered : model;\n const descendant = ancestor === registered ? model : registered;\n\n if (policiesFor(ancestor).length === 0) {\n // The ancestor contributes nothing, so the descendant is the first\n // class to carry a policy: it is not a view over the model, it *is*\n // the model. A generated base is the usual ancestor here, and a\n // hand-written intermediate behaves the same way.\n //\n // Registered already? Then this is the correct arrangement, and it\n // has to be skipped rather than reported — it used not to be, and\n // that is why the documented\n //\n // assertPoliciesRegistered(generated, models)\n //\n // threw the moment an application wrote its first policy: it walked\n // the generated namespace, found `UserModel` diverging from the\n // registered `User`, and refused the thing it exists to protect.\n // Being reachable through a base is not the bug; querying through one\n // is, and that is a property of a call site rather than of a module's\n // export list, so `Model.$exec` keeps that direction.\n if (registered === descendant) continue;\n\n // Neither class carries anything, so which one owns the name changes\n // no query's scope. An unregistered plain subclass is not a mistake.\n if (!diverges) continue;\n\n // Not registered, and it has policies: #316 itself. The policied\n // class is not the one the name resolves to, so every nested read\n // runs the ancestor and skips it.\n problems.push(\n new UnregisteredPolicyClassError(\n name,\n nameOf(registered),\n nameOf(model),\n ours.length > 0 ? \"queried\" : \"registered\",\n ),\n );\n continue;\n }\n\n // The ancestor carries policies of its own, so it is a registered model\n // in good standing and the descendant is narrowing it. The registry\n // holds one class per name: registering the view applies its narrowing\n // to every nested read, and leaving the ancestor registered skips the\n // view's policies entirely. Both are silent, so neither is chosen.\n if (diverges) {\n problems.push(\n new UnregisteredPolicyClassError(\n name,\n nameOf(ancestor),\n nameOf(descendant),\n \"narrowing\",\n ),\n );\n }\n\n // Same chain, same policies — a plain typed view. Nothing to report.\n continue;\n }\n\n if (!diverges) continue;\n\n // Unrelated classes claiming one name. Whichever is registered, the\n // other's policies are simply not in effect.\n problems.push(\n new UnregisteredPolicyClassError(\n name,\n nameOf(registered),\n nameOf(model),\n ours.length > 0 ? \"queried\" : \"registered\",\n ),\n );\n }\n }\n\n return problems;\n}\n\n/**\n * Registers every model class the given modules export, under the name each\n * one's schema carries, and then audits the result.\n *\n * ### The line this exists to delete\n *\n * `register(\"User\", User)` next to every subclass is a correct instruction and\n * a bad mechanism, because forgetting it is invisible. A relation read resolves\n * its target by name, so an unregistered policied subclass leaves the generated\n * base owning the name and every nested `include` of that model comes back\n * unscoped — no error, no warning, and an authorization hole in the direction\n * nobody checks. `assertPoliciesRegistered` turns that into a loud failure, but\n * only for someone who remembered to run it.\n *\n * Deriving the registration from the module removes the mistake instead of\n * reporting it. The name is not a string an author repeats; it is\n * `$schema.name`, which the generator wrote and the subclass inherits:\n *\n * import * as generated from \"./generated\"\n * import * as models from \"./models\"\n *\n * registerModels(generated, models)\n *\n * Later modules win, so the application's classes replace the generated bases\n * they extend. `register` still exists and still works — this is what an\n * application calls once instead of writing it thirteen times.\n *\n * ### What it still cannot see\n *\n * Modules it is handed. A policied class in a file nothing imports is invisible\n * to this exactly as it is to `assertPoliciesRegistered`, and closing *that*\n * would take the framework enumerating the filesystem at boot. Handing it a\n * barrel is the whole discipline: one file to add a model to, and the audit\n * covers everything in it.\n *\n * `Kernel.models` is that call, wired at boot, so an application declares its\n * model modules the way it already declares config slices and providers.\n */\nexport function registerModels(\n ...modules: Array<Record<string, unknown>>\n): void {\n // Elected into a local map first, and only committed once the audit passes.\n //\n // The registry is process-wide and outlives the throw. Registering as we went\n // meant a refused call left the arrangement it had just refused installed —\n // `registerModels({Ours}, {Theirs})` threw, and `\"User\"` resolved to `Theirs`\n // afterwards, which is the leaking mapping the audit exists to reject. A\n // server whose boot dies never notices; a dev server that catches and keeps\n // serving, or a test harness that continues past the error, serves the rest\n // of the process from it.\n const staged = new Map<string, ModelClass>();\n\n for (const module of modules) {\n const candidates = new Map<string, ModelClass[]>();\n\n // Deduped by identity first: `export { User }` alongside a default export\n // is the same class under two keys, not two classes competing for a name.\n for (const exported of new Set(Object.values(module))) {\n const model = asModelClass(exported);\n if (model === null) continue;\n\n const name = model.$schema.name;\n const existing = candidates.get(name);\n if (existing === undefined) candidates.set(name, [model]);\n else existing.push(model);\n }\n\n // Later modules win, which is what lets an application's classes replace\n // the generated bases they extend.\n for (const [name, classes] of candidates) {\n staged.set(name, elect(name, classes));\n }\n }\n\n // What the registry said before, so a failed audit can put it back. `register`\n // has no inverse, so a name that was previously *absent* cannot be made\n // absent again — it is left pointing at what this call elected. That is the\n // one residue, and it is the harmless direction: the alternative to a wrong\n // registration under a name nothing claimed is `ModelNotRegisteredError`, and\n // the class elected here is the one this module set would have used anyway.\n const previous = [...staged.keys()]\n .filter((name) => registry.has(name))\n .map((name) => [name, registry.get<unknown>(name)] as const);\n\n for (const [name, model] of staged) registry.register(name, model);\n\n try {\n assertPoliciesRegistered(...modules);\n } catch (error) {\n for (const [name, model] of previous) registry.register(name, model);\n throw error;\n }\n}\n\n/**\n * Which of several classes claiming one name in one module gets it.\n *\n * Two shapes put more than one candidate in a namespace, and they want opposite\n * answers, so neither \"most derived\" nor \"least derived\" is the rule on its\n * own:\n *\n * export * from \"./generated\" // UserModel, and\n * export class User extends UserModel { static $policies = [...] }\n *\n * wants the subclass — electing the base here *is* the leak, in the one file an\n * author most plausibly writes it in. While\n *\n * export class User extends UserModel { static $policies = [...] }\n * export class AdminUser extends User {}\n *\n * wants `User`. `AdminUser` is a typed view over the same rows; it inherits the\n * policies either way, so registering it changes nothing when it adds none and\n * silently applies its own narrowing to every nested read when it does.\n *\n * What separates them is which class the *generator* wrote. It emits\n * `static $schema = schema.User` on the base, and a subclass inherits that\n * property rather than declaring one — so an own `$schema` is the mark of a\n * generated base, and it is a fact about the classes rather than about the\n * order somebody exported them in. Application classes are preferred over\n * bases; among application classes the least derived wins, for the reason\n * `AdminUser` gives.\n *\n * When that leaves no single answer the candidates are unrelated classes with a\n * genuine claim each, and there is nothing left to infer. That case is refused\n * rather than guessed at: `register` says which, in the application's own\n * words.\n */\nfunction elect(name: string, classes: ModelClass[]): ModelClass {\n if (classes.length === 1) return classes[0]!;\n\n const written = classes.filter((candidate) => !isGeneratedBase(candidate));\n const eligible = written.length > 0 ? written : classes;\n\n if (eligible.length === 1) return eligible[0]!;\n\n const roots = eligible.filter((candidate) =>\n eligible.every(\n (other) => other === candidate || descendsFrom(other, candidate),\n ),\n );\n\n if (roots.length === 1) return roots[0]!;\n\n throw new AmbiguousModelRegistrationError(\n name,\n eligible.map((candidate) => nameOf(candidate)),\n );\n}\n\n/**\n * Whether the generator wrote this class, rather than an application extending\n * one it wrote.\n *\n * The generator marks its own output — `static $generated = true` on each\n * emitted base, and on nothing else — so for artifacts that carry the mark this\n * is a fact the generator stated rather than a property of how it happens to be\n * written. A subclass *inherits* the mark and does not own it, which is what\n * makes own-vs-inherited the whole test.\n *\n * ### The fallback, and why it is second\n *\n * `$schema` is also declared on the emitted base and inherited below it, so\n * owning *that* used to answer the same question, and it answered it wrongly for\n * one shape (#318): a subclass that redeclares `static $schema` — pointing at a\n * modified schema object, or by copy-paste — read as a base, every candidate\n * looked generated, and the least derived won. That did not pass quietly, since\n * `assertPoliciesRegistered` runs immediately after `elect` and refuses a\n * policied class that lost its name. But loud-and-wrong is still wrong, and the\n * silent half — a subclass with statics and row methods but no policies, whose\n * methods then never run inside a nested read — had nothing to refuse.\n *\n * The inference survives as the fallback for artifacts generated *before* the\n * mark existed, where it is the only signal there is. `\"$generated\" in candidate`\n * is what separates the two worlds: it walks the prototype chain, so it is true\n * for a marked base and for everything under it, and false for every class in an\n * app whose `app/models/generated` predates 0.51. Asking `Object.hasOwn` first\n * and falling back on `false` would send a subclass of a *marked* base back into\n * the inference — which is exactly the case the mark was added to fix.\n *\n * `registration.test.ts` in the template asserts the contract against real\n * generator output, because this is the one place a generator change could\n * quietly invalidate an assumption made here.\n */\nfunction isGeneratedBase(candidate: ModelClass): boolean {\n // Owning the mark, not merely having it — and owning it set to `true`. The\n // declared type is `?: true`, so TypeScript already refuses `false`; reading\n // the value anyway is what makes `static $generated = false` mean the thing\n // it plainly says in an app with no typechecking between it and here.\n if (\"$generated\" in candidate) {\n return (\n Object.hasOwn(candidate, \"$generated\") &&\n (candidate as { $generated?: unknown }).$generated === true\n );\n }\n\n return Object.hasOwn(candidate, \"$schema\");\n}\n\n/**\n * Whether `derived` has `base` in its static prototype chain — the `extends`\n * relation between two classes, walked on the constructor side because that is\n * where `$schema` and `$policies` live.\n */\nfunction descendsFrom(derived: unknown, base: unknown): boolean {\n let current = Object.getPrototypeOf(derived);\n\n while (current !== null && current !== Function.prototype) {\n if (current === base) return true;\n current = Object.getPrototypeOf(current);\n }\n\n return false;\n}\n\nfunction nameOf(value: unknown): string {\n return (value as { name?: string })?.name ?? String(value);\n}\n\n/**\n * A model class, structurally.\n *\n * Structural rather than `instanceof Model` on purpose: this module sits below\n * `Model.ts` in the import graph, and importing it here to answer a question\n * about shape would put a cycle between the registry, the policy hook and the\n * model base for no gain. `$schema` carrying a `name` is what every operation\n * already relies on.\n *\n * A module namespace holds anything the author exported — types erase, but\n * constants, helpers and re-exported values do not — so everything that is not\n * a model class is skipped rather than treated as an error.\n */\nfunction asModelClass(value: unknown): ModelClass | null {\n if (typeof value !== \"function\") return null;\n\n const schema = (value as { $schema?: ModelSchema }).$schema;\n if (schema === undefined || typeof schema.name !== \"string\") return null;\n\n return value as unknown as ModelClass;\n}\n"
|
|
8
8
|
],
|
|
9
9
|
"mappings": ";wMAyBA,FAAM,HAAwB,CAAC,QAAS,OAAQ,MAAM,EAChD,GAAuB,CAAC,KAAM,OAAO,EAsBpC,SAAS,CAAuB,CACrC,EACmB,CACnB,OAAO,IAAS,OAAS,GAAwB,GAgB5C,SAAS,CAAc,CAC5B,EACA,EACS,CACT,IAAM,EAAO,OAAO,KAAK,CAAK,EAC9B,OAAO,EAAK,OAAS,GAAK,EAAK,MAAM,CAAC,IAAQ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