@luckystack/core 0.7.6 → 0.8.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/CHANGELOG.md +22 -0
- package/CLAUDE.md +7 -5
- package/dist/{chunk-DVGSWLLS.js → chunk-6HGH6S36.js} +2 -2
- package/dist/{chunk-DVGSWLLS.js.map → chunk-6HGH6S36.js.map} +1 -1
- package/dist/{chunk-AFG7KKMS.js → chunk-6K7MAXMT.js} +48 -33
- package/dist/{chunk-AFG7KKMS.js.map → chunk-6K7MAXMT.js.map} +1 -1
- package/dist/{chunk-J3UOWYT4.js → chunk-I4R7DMIX.js} +2 -2
- package/dist/{chunk-LTCDQU5Z.js → chunk-RH65K3US.js} +4 -1
- package/dist/{chunk-LTCDQU5Z.js.map → chunk-RH65K3US.js.map} +1 -1
- package/dist/client.d.ts +25 -4
- package/dist/client.js +223 -15
- package/dist/client.js.map +1 -1
- package/dist/{config-Dl2CBINY.d.ts → config-DV8DGNt6.d.ts} +7 -1
- package/dist/config.d.ts +2 -2
- package/dist/config.js +2 -2
- package/dist/index.d.ts +11 -6
- package/dist/index.js +31 -8
- package/dist/index.js.map +1 -1
- package/dist/{pageRouteValidation-CWkPqPW3.d.ts → pageRouteValidation-bz2LFVQq.d.ts} +7 -7
- package/dist/{projectConfig-DBLSQ3NY.js → projectConfig-PB5VK5AD.js} +2 -2
- package/dist/{sentrySetup-MF6JSVWA.js → sentrySetup-G7NGISBY.js} +3 -3
- package/dist/{sessionTypes-Dzen_rPK.d.ts → sessionTypes-iyUMf_pf.d.ts} +12 -1
- package/docs/app-bootstrap.md +3 -2
- package/docs/session-types.md +1 -1
- package/package.json +1 -1
- /package/dist/{chunk-J3UOWYT4.js.map → chunk-I4R7DMIX.js.map} +0 -0
- /package/dist/{projectConfig-DBLSQ3NY.js.map → projectConfig-PB5VK5AD.js.map} +0 -0
- /package/dist/{sentrySetup-MF6JSVWA.js.map → sentrySetup-G7NGISBY.js.map} +0 -0
|
@@ -113,7 +113,7 @@ declare const defaultHttpStatusForResponse: ({ status, explicitHttpStatus, fallb
|
|
|
113
113
|
* null in token mode or when no session exists. Callers should attach the
|
|
114
114
|
* returned value as the `X-CSRF-Token` request header.
|
|
115
115
|
*/
|
|
116
|
-
declare const getCsrfToken: () => Promise<string | null>;
|
|
116
|
+
declare const getCsrfToken: (origin?: string) => Promise<string | null>;
|
|
117
117
|
/** Drop the cached token. Call this on logout or when a 403 csrfMismatch is seen. */
|
|
118
118
|
declare const clearCsrfToken: () => void;
|
|
119
119
|
/**
|
|
@@ -139,6 +139,12 @@ declare const clearCsrfToken: () => void;
|
|
|
139
139
|
*/
|
|
140
140
|
declare const httpFetch: typeof fetch;
|
|
141
141
|
|
|
142
|
+
type HttpMethodLiteral = 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
143
|
+
type ApiMethodMap = Record<string, Record<string, Record<string, HttpMethodLiteral>>>;
|
|
144
|
+
declare const registerApiMethodMap: (map: ApiMethodMap) => void;
|
|
145
|
+
declare const getRegisteredApiMethod: (pagePath: string, apiName: string, version: string) => HttpMethodLiteral | undefined;
|
|
146
|
+
declare const isApiMethodMapRegistered: () => boolean;
|
|
147
|
+
|
|
142
148
|
interface ServiceRouteParseSuccess {
|
|
143
149
|
status: 'success';
|
|
144
150
|
normalizedRouteName: string;
|
|
@@ -225,12 +231,6 @@ declare const getLogger: () => Logger;
|
|
|
225
231
|
declare const isLoggerRegistered: () => boolean;
|
|
226
232
|
declare const resetLoggerForTests: () => void;
|
|
227
233
|
|
|
228
|
-
type HttpMethodLiteral = 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
229
|
-
type ApiMethodMap = Record<string, Record<string, Record<string, HttpMethodLiteral>>>;
|
|
230
|
-
declare const registerApiMethodMap: (map: ApiMethodMap) => void;
|
|
231
|
-
declare const getRegisteredApiMethod: (pagePath: string, apiName: string, version: string) => HttpMethodLiteral | undefined;
|
|
232
|
-
declare const isApiMethodMapRegistered: () => boolean;
|
|
233
|
-
|
|
234
234
|
interface PageRouteRules {
|
|
235
235
|
/**
|
|
236
236
|
* Single-character prefix that marks a folder as **invisible-parent** for
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
getProjectName,
|
|
5
5
|
isProjectConfigRegistered,
|
|
6
6
|
registerProjectConfig
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-RH65K3US.js";
|
|
8
8
|
export {
|
|
9
9
|
DEFAULT_PROJECT_CONFIG,
|
|
10
10
|
getProjectConfig,
|
|
@@ -12,4 +12,4 @@ export {
|
|
|
12
12
|
isProjectConfigRegistered,
|
|
13
13
|
registerProjectConfig
|
|
14
14
|
};
|
|
15
|
-
//# sourceMappingURL=projectConfig-
|
|
15
|
+
//# sourceMappingURL=projectConfig-PB5VK5AD.js.map
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
initSharedSentry,
|
|
5
5
|
setSentryUser,
|
|
6
6
|
startSpan
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-I4R7DMIX.js";
|
|
8
|
+
import "./chunk-RH65K3US.js";
|
|
9
9
|
export {
|
|
10
10
|
captureException,
|
|
11
11
|
captureMessage,
|
|
@@ -13,4 +13,4 @@ export {
|
|
|
13
13
|
setSentryUser,
|
|
14
14
|
startSpan
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=sentrySetup-
|
|
16
|
+
//# sourceMappingURL=sentrySetup-G7NGISBY.js.map
|
|
@@ -518,6 +518,16 @@ interface SyncStreamThrottleConfig {
|
|
|
518
518
|
/** Default `field` (payload key) for emitted chunks. */
|
|
519
519
|
field: string;
|
|
520
520
|
}
|
|
521
|
+
interface TransportConfig {
|
|
522
|
+
/**
|
|
523
|
+
* Transport used for typed API/sync invocations. Socket.io remains connected
|
|
524
|
+
* in both modes for rooms, presence, reconnect state and realtime callbacks.
|
|
525
|
+
* `'socket'` is the backwards-compatible monolith default; `'routed-http'`
|
|
526
|
+
* sends invocations over same-origin HTTP/SSE so @luckystack/router can select
|
|
527
|
+
* the service owner.
|
|
528
|
+
*/
|
|
529
|
+
invocation: 'socket' | 'routed-http';
|
|
530
|
+
}
|
|
521
531
|
interface ApiConfig {
|
|
522
532
|
/**
|
|
523
533
|
* Default response timeout (ms) for `apiRequest`. After this elapses with no
|
|
@@ -696,6 +706,7 @@ interface ProjectConfig {
|
|
|
696
706
|
http: HttpConfig;
|
|
697
707
|
auth: AuthConfig;
|
|
698
708
|
socket: SocketConfig;
|
|
709
|
+
transport: TransportConfig;
|
|
699
710
|
api: ApiConfig;
|
|
700
711
|
sync: SyncConfig;
|
|
701
712
|
validation: ValidationConfig;
|
|
@@ -809,4 +820,4 @@ interface AuthProps {
|
|
|
809
820
|
}[];
|
|
810
821
|
}
|
|
811
822
|
|
|
812
|
-
export { type AppConfig as A, type BaseSessionLayout as B, type CorsConfig as C, type DeepPartial as D, type HealthHashConfig as H, type Jsonify as J, type LoggingConfig as L, type OfflineQueueConfig as O, type ProjectConfig as P, type RateLimitingConfig as R, type SessionConfig as S, type ValidationConfig as V, type AuthProps as a, type SessionLocation as b, type ApiConfig as c, type AuthConfig as d, type AuthRateLimitConfig as e, DEFAULT_PROJECT_CONFIG as f, getProjectConfig as g, type DevConfig as h, isProjectConfigRegistered as i, type HttpConfig as j, type HttpStreamConfig as k, type PasswordPolicyConfig as l, type PathsConfig as m, type ProjectConfigInput as n, type RateLimitIdentity as o, type RateLimitIdentityParams as p, type SecurityHeadersConfig as q, registerProjectConfig as r, type SocketConfig as s, type SyncConfig as t, type SyncFlushPressureConfig as u, type SyncStreamThrottleConfig as v, deepMerge as w, getProjectName as x, isPlainObject as y };
|
|
823
|
+
export { type AppConfig as A, type BaseSessionLayout as B, type CorsConfig as C, type DeepPartial as D, type HealthHashConfig as H, type Jsonify as J, type LoggingConfig as L, type OfflineQueueConfig as O, type ProjectConfig as P, type RateLimitingConfig as R, type SessionConfig as S, type TransportConfig as T, type ValidationConfig as V, type AuthProps as a, type SessionLocation as b, type ApiConfig as c, type AuthConfig as d, type AuthRateLimitConfig as e, DEFAULT_PROJECT_CONFIG as f, getProjectConfig as g, type DevConfig as h, isProjectConfigRegistered as i, type HttpConfig as j, type HttpStreamConfig as k, type PasswordPolicyConfig as l, type PathsConfig as m, type ProjectConfigInput as n, type RateLimitIdentity as o, type RateLimitIdentityParams as p, type SecurityHeadersConfig as q, registerProjectConfig as r, type SocketConfig as s, type SyncConfig as t, type SyncFlushPressureConfig as u, type SyncStreamThrottleConfig as v, deepMerge as w, getProjectName as x, isPlainObject as y };
|
package/docs/app-bootstrap.md
CHANGED
|
@@ -291,9 +291,10 @@ Returns the registered reloader, or `null` when none was supplied (watcher no-op
|
|
|
291
291
|
|
|
292
292
|
`BOOT_KEY_PREFIX` is exported as the single source of truth so `@luckystack/router`'s `bootHandshake.ts` cannot drift.
|
|
293
293
|
|
|
294
|
-
###
|
|
294
|
+
### Runtime mode versus deploy environment
|
|
295
295
|
|
|
296
|
-
|
|
296
|
+
- `resolveRuntimeMode()` returns the validated `NODE_ENV` application mode (`development`, `production` or `test`). `isProductionRuntime()` and `isTestRuntime()` are convenience predicates. Security, route-map, cookie and dev-tool behavior uses this axis.
|
|
297
|
+
- `resolveEnvKey()` returns `process.env.LUCKYSTACK_ENV` ?? `process.env.NODE_ENV` ?? `'development'`. This is only the deploy-topology identity used by boot UUIDs, health attestation, routing and observability labels. A production process may therefore use `LUCKYSTACK_ENV=staging` without enabling development behavior.
|
|
297
298
|
|
|
298
299
|
### `writeBootUuid(envKey?: string): Promise<string>`
|
|
299
300
|
|
package/docs/session-types.md
CHANGED
|
@@ -158,7 +158,7 @@ export const validateInputByType = async ({
|
|
|
158
158
|
|
|
159
159
|
**Supported type forms (validateType):**
|
|
160
160
|
- Primitives: `string`, `number`, `boolean`, `true`, `false`, `null`, `undefined`, `Date` (accepts ISO string or `Date` instance).
|
|
161
|
-
- String
|
|
161
|
+
- String literal types (single-quoted or double-quoted) and finite numeric literals, including negative, decimal, exponent, hexadecimal, binary, octal, and numeric-separator forms.
|
|
162
162
|
- Unions (`A | B`) — succeeds on first matching branch.
|
|
163
163
|
- Intersections (`A & B`) — requires all branches to succeed.
|
|
164
164
|
- Arrays (`T[]`) — checks every element.
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|