@palbase/backend 25.1.0 → 27.0.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/bin/palbase-backend.cjs +2401 -1039
- package/dist/bin/palbase-backend.cjs.map +1 -1
- package/dist/bin/palbase-backend.js +87 -51
- package/dist/bin/palbase-backend.js.map +1 -1
- package/dist/chunk-CGNN2PUH.js +213 -0
- package/dist/chunk-CGNN2PUH.js.map +1 -0
- package/dist/chunk-DRZFQRJI.js +370 -0
- package/dist/chunk-DRZFQRJI.js.map +1 -0
- package/dist/chunk-GYK6QYS4.js +708 -0
- package/dist/chunk-GYK6QYS4.js.map +1 -0
- package/dist/chunk-I3C4PFIW.js +930 -0
- package/dist/chunk-I3C4PFIW.js.map +1 -0
- package/dist/{chunk-VDF2T4AS.js → chunk-OO7R25AI.js} +1213 -591
- package/dist/chunk-OO7R25AI.js.map +1 -0
- package/dist/chunk-TS4U7NBD.js +885 -0
- package/dist/chunk-TS4U7NBD.js.map +1 -0
- package/dist/{chunk-YOY5DFQS.js → chunk-TWX6JTGJ.js} +76 -34
- package/dist/{chunk-YOY5DFQS.js.map → chunk-TWX6JTGJ.js.map} +1 -1
- package/dist/{chunk-35PNTIRN.js → chunk-VVMJEVQP.js} +63 -162
- package/dist/chunk-VVMJEVQP.js.map +1 -0
- package/dist/{chunk-7D4SUZUM.js → chunk-VXPNPVAG.js} +3 -1
- package/dist/db/env.cjs.map +1 -1
- package/dist/db/env.d.cts +2 -2
- package/dist/db/env.d.ts +2 -2
- package/dist/db/index.cjs +754 -344
- package/dist/db/index.cjs.map +1 -1
- package/dist/db/index.d.cts +2 -2
- package/dist/db/index.d.ts +2 -2
- package/dist/db/index.js +7 -4
- package/dist/engine/index.cjs +2339 -1006
- package/dist/engine/index.cjs.map +1 -1
- package/dist/engine/index.d.cts +6 -6
- package/dist/engine/index.d.ts +6 -6
- package/dist/engine/index.js +7 -6
- package/dist/index-BrvvxSpn.d.ts +4844 -0
- package/dist/index-Bve7BBTL.d.cts +4844 -0
- package/dist/{index-CUomTA3e.d.ts → index-NuzRCuxe.d.ts} +171 -296
- package/dist/{index-ClpDeSos.d.cts → index-VtToZmUm.d.cts} +171 -296
- package/dist/index.cjs +2694 -1169
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +165 -19
- package/dist/index.d.ts +165 -19
- package/dist/index.js +738 -477
- package/dist/index.js.map +1 -1
- package/dist/module-Dl1KFVtc.d.cts +54 -0
- package/dist/module-Dl1KFVtc.d.ts +54 -0
- package/dist/openapi/index.cjs +1330 -484
- package/dist/openapi/index.cjs.map +1 -1
- package/dist/openapi/index.d.cts +4 -2
- package/dist/openapi/index.d.ts +4 -2
- package/dist/openapi/index.js +1264 -474
- package/dist/openapi/index.js.map +1 -1
- package/dist/{registry-dZZ5JKYg.d.ts → registry-B0eyOF9x.d.ts} +1 -1
- package/dist/{registry-CC0WBQq6.d.cts → registry-Bk9_rbNd.d.cts} +1 -1
- package/dist/stack.cjs.map +1 -1
- package/dist/test/index.cjs +705 -141
- package/dist/test/index.cjs.map +1 -1
- package/dist/test/index.d.cts +30 -4
- package/dist/test/index.d.ts +30 -4
- package/dist/test/index.js +472 -124
- package/dist/test/index.js.map +1 -1
- package/docs/README.md +33 -18
- package/docs/auth.md +1 -1
- package/docs/background.md +2 -2
- package/docs/database.md +221 -50
- package/docs/endpoints.md +3 -4
- package/docs/events.md +3 -3
- package/docs/getting-started.md +1 -1
- package/docs/llms-full.txt +401 -117
- package/docs/migrations.md +2 -2
- package/docs/schema.md +19 -10
- package/docs/services.md +116 -26
- package/package.json +8 -4
- package/stager/generics.js +205 -0
- package/stager/stage.js +39 -3
- package/template/AGENTS.md +110 -72
- package/template/db/public.ts +1 -1
- package/template/{controllers → modules/health}/health.controller.ts +1 -1
- package/template/modules/health/health.module.ts +24 -0
- package/template/modules/notes/note.service.test.ts +49 -0
- package/template/modules/notes/note.service.ts +108 -0
- package/template/{controllers → modules/notes}/notes.controller.ts +17 -11
- package/template/modules/notes/notes.module.ts +37 -0
- package/template/package.json +5 -3
- package/template/scripts/test.sh +33 -0
- package/template/tsconfig.json +29 -30
- package/dist/chunk-35PNTIRN.js.map +0 -1
- package/dist/chunk-CJSKYY76.js +0 -627
- package/dist/chunk-CJSKYY76.js.map +0 -1
- package/dist/chunk-CRQKCRGF.js +0 -276
- package/dist/chunk-CRQKCRGF.js.map +0 -1
- package/dist/chunk-G4R6BTLV.js +0 -662
- package/dist/chunk-G4R6BTLV.js.map +0 -1
- package/dist/chunk-VDF2T4AS.js.map +0 -1
- package/dist/chunk-XABBC7JP.js +0 -55
- package/dist/chunk-XABBC7JP.js.map +0 -1
- package/dist/endpoint-CTEHhb7A.d.ts +0 -2386
- package/dist/endpoint-DYHMo6cC.d.cts +0 -2386
- package/dist/index-CW21M9Z3.d.ts +0 -1222
- package/dist/index-CmBK76nx.d.cts +0 -1222
- package/template/services/note.service.test.ts +0 -45
- package/template/services/note.service.ts +0 -76
- /package/dist/{chunk-7D4SUZUM.js.map → chunk-VXPNPVAG.js.map} +0 -0
- /package/template/{models/notes → modules/notes/dto}/create.ts +0 -0
package/dist/test/index.d.cts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import '
|
|
1
|
+
import { T as Token } from '../module-Dl1KFVtc.cjs';
|
|
2
|
+
import { D as DBClient } from '../index-Bve7BBTL.cjs';
|
|
3
|
+
import '../db/env.cjs';
|
|
3
4
|
import '../stack.cjs';
|
|
5
|
+
import 'zod';
|
|
6
|
+
import 'node:async_hooks';
|
|
4
7
|
|
|
5
8
|
/** The client a tenant's tests use to call their own backend.
|
|
6
9
|
*
|
|
@@ -130,7 +133,30 @@ interface TestApi {
|
|
|
130
133
|
declare function createTestApi(config: TestApiConfig): TestApi;
|
|
131
134
|
declare const api: TestApi;
|
|
132
135
|
|
|
133
|
-
|
|
136
|
+
interface IsolatedContainer {
|
|
137
|
+
/** Substitutes a token. Chainable; the last write for a token wins. */
|
|
138
|
+
with<T>(t: Token<T>, v: T): IsolatedContainer;
|
|
139
|
+
get<T>(t: Token<T>): T;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* How a test replaces a dependency.
|
|
143
|
+
*
|
|
144
|
+
* Rebuilds the graph with the overrides in place and never touches the process
|
|
145
|
+
* singleton cache, so the next test in the same process does not meet a doubled
|
|
146
|
+
* instance left behind by this one. Substitution is DEEP: `Report` asks for
|
|
147
|
+
* `Money` and gets whatever the graph was rebuilt with, however many hops down.
|
|
148
|
+
*
|
|
149
|
+
* Substitution is by `with` alone — there is no separate platform map, because
|
|
150
|
+
* platform services are ambient rather than injected (FR-005).
|
|
151
|
+
*
|
|
152
|
+
* Module boundaries are NOT enforced here, deliberately. They are a build-time
|
|
153
|
+
* rule about the shipped application; making a unit test fail on them would
|
|
154
|
+
* force every test to restate a module layout it is not testing. What a test
|
|
155
|
+
* gets is a graph, not a second opinion about the architecture.
|
|
156
|
+
*/
|
|
157
|
+
declare function isolated(): IsolatedContainer;
|
|
158
|
+
|
|
159
|
+
/** One `Database.$query(...)` call, as the service made it. */
|
|
134
160
|
interface RecordedQuery {
|
|
135
161
|
sql: string;
|
|
136
162
|
params: unknown[];
|
|
@@ -152,4 +178,4 @@ interface FakeDatabase {
|
|
|
152
178
|
}
|
|
153
179
|
declare function fakeDatabase(): FakeDatabase;
|
|
154
180
|
|
|
155
|
-
export { type CallOptions, type ErrorEnvelope, type FakeDatabase, type RecordedQuery, type RecordedRequest, type TestApi, type TestApiConfig, TestApiError, type TestIdentity, api, createTestApi, fakeDatabase };
|
|
181
|
+
export { type CallOptions, type ErrorEnvelope, type FakeDatabase, type IsolatedContainer, type RecordedQuery, type RecordedRequest, type TestApi, type TestApiConfig, TestApiError, type TestIdentity, api, createTestApi, fakeDatabase, isolated };
|
package/dist/test/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import '
|
|
1
|
+
import { T as Token } from '../module-Dl1KFVtc.js';
|
|
2
|
+
import { D as DBClient } from '../index-BrvvxSpn.js';
|
|
3
|
+
import '../db/env.js';
|
|
3
4
|
import '../stack.js';
|
|
5
|
+
import 'zod';
|
|
6
|
+
import 'node:async_hooks';
|
|
4
7
|
|
|
5
8
|
/** The client a tenant's tests use to call their own backend.
|
|
6
9
|
*
|
|
@@ -130,7 +133,30 @@ interface TestApi {
|
|
|
130
133
|
declare function createTestApi(config: TestApiConfig): TestApi;
|
|
131
134
|
declare const api: TestApi;
|
|
132
135
|
|
|
133
|
-
|
|
136
|
+
interface IsolatedContainer {
|
|
137
|
+
/** Substitutes a token. Chainable; the last write for a token wins. */
|
|
138
|
+
with<T>(t: Token<T>, v: T): IsolatedContainer;
|
|
139
|
+
get<T>(t: Token<T>): T;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* How a test replaces a dependency.
|
|
143
|
+
*
|
|
144
|
+
* Rebuilds the graph with the overrides in place and never touches the process
|
|
145
|
+
* singleton cache, so the next test in the same process does not meet a doubled
|
|
146
|
+
* instance left behind by this one. Substitution is DEEP: `Report` asks for
|
|
147
|
+
* `Money` and gets whatever the graph was rebuilt with, however many hops down.
|
|
148
|
+
*
|
|
149
|
+
* Substitution is by `with` alone — there is no separate platform map, because
|
|
150
|
+
* platform services are ambient rather than injected (FR-005).
|
|
151
|
+
*
|
|
152
|
+
* Module boundaries are NOT enforced here, deliberately. They are a build-time
|
|
153
|
+
* rule about the shipped application; making a unit test fail on them would
|
|
154
|
+
* force every test to restate a module layout it is not testing. What a test
|
|
155
|
+
* gets is a graph, not a second opinion about the architecture.
|
|
156
|
+
*/
|
|
157
|
+
declare function isolated(): IsolatedContainer;
|
|
158
|
+
|
|
159
|
+
/** One `Database.$query(...)` call, as the service made it. */
|
|
134
160
|
interface RecordedQuery {
|
|
135
161
|
sql: string;
|
|
136
162
|
params: unknown[];
|
|
@@ -152,4 +178,4 @@ interface FakeDatabase {
|
|
|
152
178
|
}
|
|
153
179
|
declare function fakeDatabase(): FakeDatabase;
|
|
154
180
|
|
|
155
|
-
export { type CallOptions, type ErrorEnvelope, type FakeDatabase, type RecordedQuery, type RecordedRequest, type TestApi, type TestApiConfig, TestApiError, type TestIdentity, api, createTestApi, fakeDatabase };
|
|
181
|
+
export { type CallOptions, type ErrorEnvelope, type FakeDatabase, type IsolatedContainer, type RecordedQuery, type RecordedRequest, type TestApi, type TestApiConfig, TestApiError, type TestIdentity, api, createTestApi, fakeDatabase, isolated };
|