nucleus-core-ts 0.9.714 → 0.9.715

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.
@@ -0,0 +1,28 @@
1
+ /**
2
+ * HTTP-header-safe encoding for lists of possibly-Unicode values (role names,
3
+ * claim actions) carried in the `x-user-roles` / `x-user-claims` headers.
4
+ *
5
+ * HTTP header values must be ISO-8859-1 (latin1). Role names are user-defined and
6
+ * may contain arbitrary Unicode — e.g. a Turkish role "Günlük Kısıtlı Deneme"
7
+ * contains `ı`/`ş`/`ğ` which are outside latin1. Passing such a value to
8
+ * `Headers.set` throws ("Header 'x-user-roles' has invalid value") and 500s EVERY
9
+ * request for any user holding that role — which silently breaks login, entity
10
+ * access, and impersonation enter/exit for that user.
11
+ *
12
+ * Per-item percent-encoding fixes this generically:
13
+ * - ASCII values (`godmin`, `user-free`, `llm.conversations.list`) are left
14
+ * byte-identical, so readers that don't decode still match them correctly.
15
+ * - Unicode values become transport-safe and round-trip losslessly via decode.
16
+ *
17
+ * The comma separator is preserved (encodeURIComponent never emits `,`), so
18
+ * existing `header.split(',')` readers keep working.
19
+ */
20
+ /** Encode a list of role/claim names into a header-safe comma-joined string. */
21
+ export declare function encodeHeaderList(items: string[]): string;
22
+ /**
23
+ * Inverse of {@link encodeHeaderList}: split a header value and restore the
24
+ * original (possibly Unicode) items. Tolerant of legacy/plain values —
25
+ * `decodeURIComponent` is the identity for un-encoded ASCII, and a malformed
26
+ * percent-sequence is returned verbatim rather than throwing.
27
+ */
28
+ export declare function decodeHeaderList(header: string | null | undefined): string[];
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nucleus-core-ts",
3
- "version": "0.9.714",
3
+ "version": "0.9.715",
4
4
  "description": "Production-ready, enterprise-grade TypeScript framework for building multi-tenant APIs",
5
5
  "author": "Hidayet Can Özcan <hidayetcan@gmail.com>",
6
6
  "license": "SEE LICENSE IN LICENSE",