tina4-nodejs 3.13.121 → 3.13.123
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/CLAUDE.md +2 -2
- package/package.json +1 -1
- package/packages/cli/dist/bin.js +27 -0
- package/packages/core/dist/index.js +27 -0
- package/packages/core/src/middleware.ts +1156 -1120
- package/packages/orm/dist/index.js +27 -0
- package/types/core/src/middleware.d.ts +15 -0
package/CLAUDE.md
CHANGED
|
@@ -13,13 +13,13 @@ Even if the skill text is not currently loaded, these are non-negotiable:
|
|
|
13
13
|
|
|
14
14
|
The full discipline lives in `.claude/skills/tina4-maintainer/SKILL.md`; this block is the always-on floor.
|
|
15
15
|
|
|
16
|
-
# CLAUDE.md - AI Developer Guide for tina4-nodejs (v3.13.
|
|
16
|
+
# CLAUDE.md - AI Developer Guide for tina4-nodejs (v3.13.123)
|
|
17
17
|
|
|
18
18
|
> This file helps AI assistants (Claude, Copilot, Cursor, etc.) understand and work on this codebase effectively.
|
|
19
19
|
|
|
20
20
|
## What This Project Is
|
|
21
21
|
|
|
22
|
-
Tina4 for Node.js/TypeScript v3.13.
|
|
22
|
+
Tina4 for Node.js/TypeScript v3.13.123 - The Intelligent Native Application 4ramework. A convention-over-configuration structural paradigm. The developer writes TypeScript; Tina4 is invisible infrastructure.
|
|
23
23
|
|
|
24
24
|
The philosophy: zero ceremony, batteries included, file system as source of truth.
|
|
25
25
|
|
package/package.json
CHANGED
package/packages/cli/dist/bin.js
CHANGED
|
@@ -5339,6 +5339,9 @@ var init_middleware = __esm({
|
|
|
5339
5339
|
`max-age=${hsts}; includeSubDomains`
|
|
5340
5340
|
);
|
|
5341
5341
|
}
|
|
5342
|
+
if (process.env.TINA4_CSP === void 0) {
|
|
5343
|
+
_SecurityHeadersMiddleware.warnCspDefaultOnce();
|
|
5344
|
+
}
|
|
5342
5345
|
res.header(
|
|
5343
5346
|
"Content-Security-Policy",
|
|
5344
5347
|
process.env.TINA4_CSP ?? "default-src 'self'"
|
|
@@ -5354,6 +5357,30 @@ var init_middleware = __esm({
|
|
|
5354
5357
|
);
|
|
5355
5358
|
return [req2, res];
|
|
5356
5359
|
}
|
|
5360
|
+
/** Warn-once ledger for the default-CSP heads-up (per process). */
|
|
5361
|
+
static cspDefaultWarned = false;
|
|
5362
|
+
/**
|
|
5363
|
+
* Warn once per process that the default CSP is in force (TINA4_CSP unset).
|
|
5364
|
+
*
|
|
5365
|
+
* Secure-by-default keeps `default-src 'self'` (SECHDR-DEC-01), but that
|
|
5366
|
+
* default is invisible: it blocks runtime-injected inline styles, cross-origin
|
|
5367
|
+
* fonts/scripts/CDNs, `data:` URIs, and cross-origin WebSocket/XHR (a separate
|
|
5368
|
+
* API or LiveKit host) — and the failure surfaces only in the browser at
|
|
5369
|
+
* runtime, long after a deploy has gone green. So the framework says so once,
|
|
5370
|
+
* naming the escape hatch. It NEVER fails the boot or a request — logging a
|
|
5371
|
+
* heads-up must not be the reason the server or a request dies. Fires only when
|
|
5372
|
+
* TINA4_CSP is ABSENT; setting it (even to empty) is an explicit opt-in.
|
|
5373
|
+
*/
|
|
5374
|
+
static warnCspDefaultOnce() {
|
|
5375
|
+
if (_SecurityHeadersMiddleware.cspDefaultWarned) return;
|
|
5376
|
+
_SecurityHeadersMiddleware.cspDefaultWarned = true;
|
|
5377
|
+
const message = `TINA4_CSP is not set, so Tina4 is serving the default Content-Security-Policy "default-src 'self'" on every response. That default blocks runtime-injected inline styles, cross-origin fonts/scripts/CDNs, data: URIs, and cross-origin WebSocket/XHR (e.g. a separate API or LiveKit host). If your app uses any of these, set TINA4_CSP to a policy that allows them (see https://tina4.com); to silence this notice without changing behaviour, set TINA4_CSP="default-src 'self'".`;
|
|
5378
|
+
try {
|
|
5379
|
+
Log.warning(message);
|
|
5380
|
+
} catch {
|
|
5381
|
+
console.warn(message);
|
|
5382
|
+
}
|
|
5383
|
+
}
|
|
5357
5384
|
/**
|
|
5358
5385
|
* True when the client request is HTTPS. Proxy-aware and byte-parity with
|
|
5359
5386
|
* Python (request.is_secure_scheme), PHP (Request::isSecureScheme) and Ruby
|
|
@@ -5338,6 +5338,9 @@ var init_middleware = __esm({
|
|
|
5338
5338
|
`max-age=${hsts}; includeSubDomains`
|
|
5339
5339
|
);
|
|
5340
5340
|
}
|
|
5341
|
+
if (process.env.TINA4_CSP === void 0) {
|
|
5342
|
+
_SecurityHeadersMiddleware.warnCspDefaultOnce();
|
|
5343
|
+
}
|
|
5341
5344
|
res.header(
|
|
5342
5345
|
"Content-Security-Policy",
|
|
5343
5346
|
process.env.TINA4_CSP ?? "default-src 'self'"
|
|
@@ -5353,6 +5356,30 @@ var init_middleware = __esm({
|
|
|
5353
5356
|
);
|
|
5354
5357
|
return [req2, res];
|
|
5355
5358
|
}
|
|
5359
|
+
/** Warn-once ledger for the default-CSP heads-up (per process). */
|
|
5360
|
+
static cspDefaultWarned = false;
|
|
5361
|
+
/**
|
|
5362
|
+
* Warn once per process that the default CSP is in force (TINA4_CSP unset).
|
|
5363
|
+
*
|
|
5364
|
+
* Secure-by-default keeps `default-src 'self'` (SECHDR-DEC-01), but that
|
|
5365
|
+
* default is invisible: it blocks runtime-injected inline styles, cross-origin
|
|
5366
|
+
* fonts/scripts/CDNs, `data:` URIs, and cross-origin WebSocket/XHR (a separate
|
|
5367
|
+
* API or LiveKit host) — and the failure surfaces only in the browser at
|
|
5368
|
+
* runtime, long after a deploy has gone green. So the framework says so once,
|
|
5369
|
+
* naming the escape hatch. It NEVER fails the boot or a request — logging a
|
|
5370
|
+
* heads-up must not be the reason the server or a request dies. Fires only when
|
|
5371
|
+
* TINA4_CSP is ABSENT; setting it (even to empty) is an explicit opt-in.
|
|
5372
|
+
*/
|
|
5373
|
+
static warnCspDefaultOnce() {
|
|
5374
|
+
if (_SecurityHeadersMiddleware.cspDefaultWarned) return;
|
|
5375
|
+
_SecurityHeadersMiddleware.cspDefaultWarned = true;
|
|
5376
|
+
const message = `TINA4_CSP is not set, so Tina4 is serving the default Content-Security-Policy "default-src 'self'" on every response. That default blocks runtime-injected inline styles, cross-origin fonts/scripts/CDNs, data: URIs, and cross-origin WebSocket/XHR (e.g. a separate API or LiveKit host). If your app uses any of these, set TINA4_CSP to a policy that allows them (see https://tina4.com); to silence this notice without changing behaviour, set TINA4_CSP="default-src 'self'".`;
|
|
5377
|
+
try {
|
|
5378
|
+
Log.warning(message);
|
|
5379
|
+
} catch {
|
|
5380
|
+
console.warn(message);
|
|
5381
|
+
}
|
|
5382
|
+
}
|
|
5356
5383
|
/**
|
|
5357
5384
|
* True when the client request is HTTPS. Proxy-aware and byte-parity with
|
|
5358
5385
|
* Python (request.is_secure_scheme), PHP (Request::isSecureScheme) and Ruby
|