@palbase/backend 23.1.0 → 24.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/palbase-backend.cjs +400 -47
- package/dist/bin/palbase-backend.cjs.map +1 -1
- package/dist/bin/palbase-backend.js +4 -5
- package/dist/bin/palbase-backend.js.map +1 -1
- package/dist/{chunk-OHALWEOG.js → chunk-7Z6MGMXQ.js} +57 -2
- package/dist/chunk-7Z6MGMXQ.js.map +1 -0
- package/dist/{chunk-RCLNBJCM.js → chunk-H3JAISUY.js} +136 -1
- package/dist/chunk-H3JAISUY.js.map +1 -0
- package/dist/{chunk-PY7YJDCT.js → chunk-LCL7TUAI.js} +32 -3
- package/dist/chunk-LCL7TUAI.js.map +1 -0
- package/dist/{chunk-NS5V43YQ.js → chunk-P2Q27SGP.js} +19 -3
- package/dist/chunk-P2Q27SGP.js.map +1 -0
- package/dist/{chunk-R3KN6RHD.js → chunk-T5IOSOE5.js} +7 -2
- package/dist/chunk-T5IOSOE5.js.map +1 -0
- package/dist/{chunk-M5MCBWJI.js → chunk-YSQBC2VL.js} +275 -31
- package/dist/chunk-YSQBC2VL.js.map +1 -0
- package/dist/db/index.cjs +48 -3
- 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 +2 -2
- package/dist/{endpoint-CVWXh6oG.d.ts → endpoint-0_DGBajf.d.ts} +100 -3
- package/dist/{endpoint-c9h5jriX.d.cts → endpoint-CcQ1a36a.d.cts} +100 -3
- package/dist/engine/index.cjs +389 -34
- package/dist/engine/index.cjs.map +1 -1
- package/dist/engine/index.d.cts +4 -4
- package/dist/engine/index.d.ts +4 -4
- package/dist/engine/index.js +4 -4
- package/dist/{index-CwAJ7HEe.d.ts → index-BOS_rFBO.d.ts} +125 -21
- package/dist/{index-CxeQSfJP.d.cts → index-C84bLgeO.d.cts} +134 -9
- package/dist/{index-By8Dle5U.d.cts → index-MoQ31B6M.d.cts} +125 -21
- package/dist/{index-BZrJXnVh.d.ts → index-dJNhDZ7j.d.ts} +134 -9
- package/dist/index.cjs +166 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +54 -12
- package/dist/index.d.ts +54 -12
- package/dist/index.js +28 -11
- package/dist/index.js.map +1 -1
- package/dist/openapi/index.cjs +16 -1
- package/dist/openapi/index.cjs.map +1 -1
- package/dist/openapi/index.d.cts +6 -4
- package/dist/openapi/index.d.ts +6 -4
- package/dist/openapi/index.js +6 -7
- package/dist/openapi/index.js.map +1 -1
- package/dist/{registry-CqPK2Qby.d.cts → registry-1X-skBNu.d.cts} +1 -1
- package/dist/{registry-B3niOVYp.d.ts → registry-CEod_5sz.d.ts} +1 -1
- package/dist/test/index.cjs +27 -0
- package/dist/test/index.cjs.map +1 -1
- package/dist/test/index.d.cts +1 -1
- package/dist/test/index.d.ts +1 -1
- package/dist/test/index.js +27 -0
- package/dist/test/index.js.map +1 -1
- package/docs/README.md +4 -4
- package/docs/database.md +115 -11
- package/docs/getting-started.md +5 -4
- package/docs/llms-full.txt +385 -89
- package/docs/migrations.md +81 -59
- package/docs/schema.md +82 -2
- package/docs/services.md +98 -9
- package/package.json +2 -2
- package/template/AGENTS.md +121 -41
- package/template/controllers/notes.controller.ts +64 -0
- package/template/package.json +1 -1
- package/template/services/note.service.ts +74 -0
- package/template/tsconfig.json +11 -1
- package/dist/chunk-HQRJDARQ.js +0 -90
- package/dist/chunk-HQRJDARQ.js.map +0 -1
- package/dist/chunk-M5MCBWJI.js.map +0 -1
- package/dist/chunk-NS5V43YQ.js.map +0 -1
- package/dist/chunk-OHALWEOG.js.map +0 -1
- package/dist/chunk-PY7YJDCT.js.map +0 -1
- package/dist/chunk-R3KN6RHD.js.map +0 -1
- package/dist/chunk-RCLNBJCM.js.map +0 -1
package/dist/openapi/index.cjs
CHANGED
|
@@ -5869,6 +5869,11 @@ function getErrorRegistry() {
|
|
|
5869
5869
|
["forbidden", 403, "Forbidden"],
|
|
5870
5870
|
["not_found", 404, "NotFound"],
|
|
5871
5871
|
["conflict", 409, "Conflict"],
|
|
5872
|
+
// The engine's own 23505 conversion (engine/db.ts) throws this, and an
|
|
5873
|
+
// author may too. Registered like every other built-in so the spec
|
|
5874
|
+
// emitter resolves it — an unregistered code is SKIPPED silently there
|
|
5875
|
+
// (openapi/convert.ts) and would degrade to the client's `.other` case.
|
|
5876
|
+
["unique_violation", 409, "UniqueViolation"],
|
|
5872
5877
|
["too_many_requests", 429, "TooManyRequests"]
|
|
5873
5878
|
]) {
|
|
5874
5879
|
const dataSchema = BUILTIN_DATA_SCHEMAS[code];
|
|
@@ -5948,6 +5953,16 @@ function getRoutes(ctor) {
|
|
|
5948
5953
|
|
|
5949
5954
|
// src/decorators/controller.ts
|
|
5950
5955
|
var CONTROLLER_META = /* @__PURE__ */ Symbol.for("palbase.backend.controllerMeta");
|
|
5956
|
+
var APP_DEFAULT_AUTH = /* @__PURE__ */ Symbol.for("palbase.backend.appDefaultAuth");
|
|
5957
|
+
function appAuthSlot() {
|
|
5958
|
+
return globalThis;
|
|
5959
|
+
}
|
|
5960
|
+
function getDefaultAuth() {
|
|
5961
|
+
return appAuthSlot()[APP_DEFAULT_AUTH];
|
|
5962
|
+
}
|
|
5963
|
+
function resolveEffectiveAuth(routeAuth, controllerAuth) {
|
|
5964
|
+
return routeAuth ?? controllerAuth ?? getDefaultAuth() ?? true;
|
|
5965
|
+
}
|
|
5951
5966
|
function isController(value) {
|
|
5952
5967
|
if (typeof value !== "function" && (typeof value !== "object" || value === null)) {
|
|
5953
5968
|
return false;
|
|
@@ -6031,7 +6046,7 @@ function flattenController(controller) {
|
|
|
6031
6046
|
const out = [];
|
|
6032
6047
|
for (const route of routes) {
|
|
6033
6048
|
const fullPath = joinControllerPath(meta.basePath, route.subpath);
|
|
6034
|
-
const effectiveAuth = route.options.auth
|
|
6049
|
+
const effectiveAuth = resolveEffectiveAuth(route.options.auth, meta.defaultAuth);
|
|
6035
6050
|
const inputSchemas = {};
|
|
6036
6051
|
const pathParams = [];
|
|
6037
6052
|
for (const p of route.params) {
|