@lunora/server 1.0.0-alpha.8 → 1.0.0-alpha.9
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/index.d.mts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.mjs +7 -7
- package/dist/packem_shared/{LunoraError-DhggBJZF.mjs → LunoraError-DN7Zhhvu.mjs} +4 -1
- package/dist/packem_shared/{PRESENCE_DEFAULT_TTL_MS-C7j9gY_d.mjs → PRESENCE_DEFAULT_TTL_MS-D8viLY1S.mjs} +1 -1
- package/dist/packem_shared/{buildRlsReadRegistry-CkxuS69B.mjs → buildRlsReadRegistry-1jexWrb3.mjs} +1 -1
- package/dist/packem_shared/{httpAction-B7FYUEgr.mjs → httpAction-FLwfsePg.mjs} +1 -1
- package/dist/packem_shared/{mask-eCUYOwhd.mjs → mask-BV_jNzsN.mjs} +1 -1
- package/dist/packem_shared/{rls-ClmjkkxZ.mjs → rls-2Jhd0uev.mjs} +1 -1
- package/dist/packem_shared/{storageRules-4a30FSpI.mjs → storageRules-Cje6Woea.mjs} +1 -1
- package/dist/rls/testing.mjs +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -283,7 +283,10 @@ declare const defineEnv: <S extends EnvShape>(shape: S) => EnvAccessor<S>;
|
|
|
283
283
|
* The runtime's structural error mapper keys off `name === "LunoraError"` plus
|
|
284
284
|
* the numeric `status`, so throwing one of these from a handler or middleware
|
|
285
285
|
* yields the right RPC/HTTP status without any further wiring. `code` carries
|
|
286
|
-
* the machine-readable reason for clients
|
|
286
|
+
* the machine-readable reason for clients; the optional `data` carries a
|
|
287
|
+
* structured, JSON+wire-encodable payload propagated verbatim to the client
|
|
288
|
+
* (e.g. `{ retryAfterMs }`). Only an explicit `LunoraError`'s `data` crosses the
|
|
289
|
+
* wire — an unhandled throw is still redacted to a generic message server-side.
|
|
287
290
|
*/
|
|
288
291
|
declare const CODE_STATUS: {
|
|
289
292
|
readonly BAD_REQUEST: 400;
|
|
@@ -329,7 +332,9 @@ declare class LunoraError extends Error {
|
|
|
329
332
|
override readonly name = "LunoraError";
|
|
330
333
|
readonly code: LunoraErrorCode;
|
|
331
334
|
readonly status: number;
|
|
332
|
-
|
|
335
|
+
/** Structured, JSON+wire-encodable payload surfaced to the client alongside `code`. */
|
|
336
|
+
readonly data?: unknown;
|
|
337
|
+
constructor(code: LunoraErrorCode, message?: string, data?: unknown);
|
|
333
338
|
}
|
|
334
339
|
/**
|
|
335
340
|
* Minimal structural writer the facade binds over. Declared with **method**
|
package/dist/index.d.ts
CHANGED
|
@@ -283,7 +283,10 @@ declare const defineEnv: <S extends EnvShape>(shape: S) => EnvAccessor<S>;
|
|
|
283
283
|
* The runtime's structural error mapper keys off `name === "LunoraError"` plus
|
|
284
284
|
* the numeric `status`, so throwing one of these from a handler or middleware
|
|
285
285
|
* yields the right RPC/HTTP status without any further wiring. `code` carries
|
|
286
|
-
* the machine-readable reason for clients
|
|
286
|
+
* the machine-readable reason for clients; the optional `data` carries a
|
|
287
|
+
* structured, JSON+wire-encodable payload propagated verbatim to the client
|
|
288
|
+
* (e.g. `{ retryAfterMs }`). Only an explicit `LunoraError`'s `data` crosses the
|
|
289
|
+
* wire — an unhandled throw is still redacted to a generic message server-side.
|
|
287
290
|
*/
|
|
288
291
|
declare const CODE_STATUS: {
|
|
289
292
|
readonly BAD_REQUEST: 400;
|
|
@@ -329,7 +332,9 @@ declare class LunoraError extends Error {
|
|
|
329
332
|
override readonly name = "LunoraError";
|
|
330
333
|
readonly code: LunoraErrorCode;
|
|
331
334
|
readonly status: number;
|
|
332
|
-
|
|
335
|
+
/** Structured, JSON+wire-encodable payload surfaced to the client alongside `code`. */
|
|
336
|
+
readonly data?: unknown;
|
|
337
|
+
constructor(code: LunoraErrorCode, message?: string, data?: unknown);
|
|
333
338
|
}
|
|
334
339
|
/**
|
|
335
340
|
* Minimal structural writer the facade binds over. Declared with **method**
|
package/dist/index.mjs
CHANGED
|
@@ -2,26 +2,26 @@ export { default as asBucketStorage } from './packem_shared/asBucketStorage-Cnxd
|
|
|
2
2
|
export { initLunora } from './packem_shared/initLunora-lxwHTEV3.mjs';
|
|
3
3
|
export { createSecrets } from './packem_shared/createSecrets-TsIP9lOa.mjs';
|
|
4
4
|
export { LunoraEnvError, defineEnv, redactSecrets } from './packem_shared/LunoraEnvError-DjFkpkSP.mjs';
|
|
5
|
-
export { LunoraError } from './packem_shared/LunoraError-
|
|
5
|
+
export { LunoraError } from './packem_shared/LunoraError-DN7Zhhvu.mjs';
|
|
6
6
|
export { bindOrm, bindTableFacade } from './packem_shared/bindOrm-Ce57S3N9.mjs';
|
|
7
|
-
export { httpAction, httpRoute, httpRouter, serveStorageObject } from './packem_shared/httpAction-
|
|
7
|
+
export { httpAction, httpRoute, httpRouter, serveStorageObject } from './packem_shared/httpAction-FLwfsePg.mjs';
|
|
8
8
|
export { onConnect, onDisconnect } from './packem_shared/onConnect-CIPXKPyw.mjs';
|
|
9
9
|
export { defineMigration } from './packem_shared/defineMigration-CAJLr6fx.mjs';
|
|
10
10
|
export { defineMutator } from './packem_shared/defineMutator-EIXAWhs9.mjs';
|
|
11
11
|
export { composePluginMiddleware, defineComponent, definePlugin, defineSchemaExtension, installPlugins, mergeSchemaExtension } from './packem_shared/composePluginMiddleware-Ck5_TUO8.mjs';
|
|
12
|
-
export { PRESENCE_DEFAULT_TTL_MS, PRESENCE_TABLE, definePresence, presenceExtension } from './packem_shared/PRESENCE_DEFAULT_TTL_MS-
|
|
12
|
+
export { PRESENCE_DEFAULT_TTL_MS, PRESENCE_TABLE, definePresence, presenceExtension } from './packem_shared/PRESENCE_DEFAULT_TTL_MS-D8viLY1S.mjs';
|
|
13
13
|
export { protectPublic } from './packem_shared/protectPublic-BjFkQ_Or.mjs';
|
|
14
14
|
export { defineAggregateIndex, defineRankIndex, defineSchema, defineTable, defineVectorIndex } from './packem_shared/defineAggregateIndex-ZdyU78gh.mjs';
|
|
15
15
|
export { defineShape } from './packem_shared/defineShape-CJ27Wx7o.mjs';
|
|
16
16
|
export { anyApi } from './types.mjs';
|
|
17
17
|
export { cronJobs } from '@lunora/scheduler';
|
|
18
18
|
export { ValidationError, v } from '@lunora/values';
|
|
19
|
-
export { buildRlsReadRegistry, composeShapeReadWhere } from './packem_shared/buildRlsReadRegistry-
|
|
19
|
+
export { buildRlsReadRegistry, composeShapeReadWhere } from './packem_shared/buildRlsReadRegistry-1jexWrb3.mjs';
|
|
20
20
|
export { createPolicyDsl, definePermission, definePolicies, definePolicy, defineRole } from './packem_shared/createPolicyDsl-De67zPDS.mjs';
|
|
21
21
|
export { defineStorageRule, defineStorageRules } from './packem_shared/defineStorageRule-qu0mpilX.mjs';
|
|
22
|
-
export { mask } from './packem_shared/mask-
|
|
23
|
-
export { rls } from './packem_shared/rls-
|
|
24
|
-
export { storageRules } from './packem_shared/storageRules-
|
|
22
|
+
export { mask } from './packem_shared/mask-BV_jNzsN.mjs';
|
|
23
|
+
export { rls } from './packem_shared/rls-2Jhd0uev.mjs';
|
|
24
|
+
export { storageRules } from './packem_shared/storageRules-Cje6Woea.mjs';
|
|
25
25
|
|
|
26
26
|
const VERSION = "0.0.0";
|
|
27
27
|
|
|
@@ -41,10 +41,13 @@ class LunoraError extends Error {
|
|
|
41
41
|
name = "LunoraError";
|
|
42
42
|
code;
|
|
43
43
|
status;
|
|
44
|
-
|
|
44
|
+
/** Structured, JSON+wire-encodable payload surfaced to the client alongside `code`. */
|
|
45
|
+
data;
|
|
46
|
+
constructor(code, message, data) {
|
|
45
47
|
super(message ?? code);
|
|
46
48
|
this.code = code;
|
|
47
49
|
this.status = CODE_STATUS[code];
|
|
50
|
+
this.data = data;
|
|
48
51
|
}
|
|
49
52
|
}
|
|
50
53
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { v } from '@lunora/values';
|
|
2
2
|
import { initLunora } from './initLunora-lxwHTEV3.mjs';
|
|
3
|
-
import { LunoraError } from './LunoraError-
|
|
3
|
+
import { LunoraError } from './LunoraError-DN7Zhhvu.mjs';
|
|
4
4
|
import { onDisconnect } from './onConnect-CIPXKPyw.mjs';
|
|
5
5
|
import { defineSchemaExtension, defineComponent } from './composePluginMiddleware-Ck5_TUO8.mjs';
|
|
6
6
|
import { defineTable } from './defineAggregateIndex-ZdyU78gh.mjs';
|
package/dist/packem_shared/{buildRlsReadRegistry-CkxuS69B.mjs → buildRlsReadRegistry-1jexWrb3.mjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { indexRolePermissions, computeReadBaseWhere, permissionName } from './rls-
|
|
1
|
+
import { indexRolePermissions, computeReadBaseWhere, permissionName } from './rls-2Jhd0uev.mjs';
|
|
2
2
|
import { r as readRlsTag } from './policy-tag-DvpVH2tv.mjs';
|
|
3
3
|
|
|
4
4
|
const FALSE_PREDICATE = { OR: [] };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { parseValidatorMap, ValidationError } from '@lunora/values';
|
|
2
2
|
import { Hono } from 'hono';
|
|
3
|
-
import { LunoraError } from './LunoraError-
|
|
3
|
+
import { LunoraError } from './LunoraError-DN7Zhhvu.mjs';
|
|
4
4
|
|
|
5
5
|
const httpAction = (handler) => async (c) => handler(c.get("lunora"), c.req.raw);
|
|
6
6
|
const httpRouter = () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LunoraError } from './LunoraError-
|
|
1
|
+
import { LunoraError } from './LunoraError-DN7Zhhvu.mjs';
|
|
2
2
|
import { bindTableFacade, bindOrm } from './bindOrm-Ce57S3N9.mjs';
|
|
3
3
|
|
|
4
4
|
const permissionName = (permission) => typeof permission === "string" ? permission : permission.name;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LunoraError } from './LunoraError-
|
|
1
|
+
import { LunoraError } from './LunoraError-DN7Zhhvu.mjs';
|
|
2
2
|
|
|
3
3
|
const permissionName = (permission) => typeof permission === "string" ? permission : permission.name;
|
|
4
4
|
const indexRolePermissions = (roles = []) => {
|
package/dist/rls/testing.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { indexRolePermissions, computeReadBaseWhere, matchesWhere, evaluateWrite, permissionName } from '../packem_shared/rls-
|
|
1
|
+
import { indexRolePermissions, computeReadBaseWhere, matchesWhere, evaluateWrite, permissionName } from '../packem_shared/rls-2Jhd0uev.mjs';
|
|
2
2
|
|
|
3
3
|
const expectPolicy = (policies, options = {}) => {
|
|
4
4
|
const rolePermissions = indexRolePermissions(options.roles);
|