@luckystack/core 0.7.6 → 0.8.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.
@@ -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-LTCDQU5Z.js";
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-DBLSQ3NY.js.map
15
+ //# sourceMappingURL=projectConfig-PB5VK5AD.js.map
@@ -4,8 +4,8 @@ import {
4
4
  initSharedSentry,
5
5
  setSentryUser,
6
6
  startSpan
7
- } from "./chunk-J3UOWYT4.js";
8
- import "./chunk-LTCDQU5Z.js";
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-MF6JSVWA.js.map
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 };
@@ -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/number literal types (single-quoted or double-quoted).
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luckystack/core",
3
- "version": "0.7.6",
3
+ "version": "0.8.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public",