@dyrected/core 2.13.0 → 2.13.3
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/LICENSE.md +50 -0
- package/dist/{app-D_ODsBWA.d.ts → app-De-3eNn1.d.cts} +6 -0
- package/dist/{app-D_ODsBWA.d.cts → app-De-3eNn1.d.ts} +6 -0
- package/dist/index.cjs +17 -0
- package/dist/index.d.cts +14 -3
- package/dist/index.d.ts +14 -3
- package/dist/index.js +5867 -368
- package/dist/server.cjs +37 -7
- package/dist/server.d.cts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +8487 -1033
- package/package.json +9 -9
- package/dist/access-P6Z2XAFS.js +0 -10
- package/dist/ai-X3M2SE5A.js +0 -17
- package/dist/ai-tools-UPKJY3TX.js +0 -14
- package/dist/chunk-254THFDS.js +0 -202
- package/dist/chunk-27YRIGK5.js +0 -1758
- package/dist/chunk-4RAQJVJM.js +0 -18
- package/dist/chunk-DZMBVIMN.js +0 -3910
- package/dist/chunk-HRRJ3RYT.js +0 -70
- package/dist/chunk-JSBRDJBE.js +0 -30
- package/dist/chunk-W7GKJM2X.js +0 -1136
- package/dist/chunk-ZYYDTHF3.js +0 -635
- package/dist/rag.service-YDGEYTXS.js +0 -11
- package/dist/where-sanitizer-CAAIYSSK.js +0 -76
package/dist/chunk-HRRJ3RYT.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
require_Jexl
|
|
3
|
-
} from "./chunk-27YRIGK5.js";
|
|
4
|
-
import {
|
|
5
|
-
__toESM
|
|
6
|
-
} from "./chunk-JSBRDJBE.js";
|
|
7
|
-
|
|
8
|
-
// src/auth/jexl.ts
|
|
9
|
-
var import_jexl = __toESM(require_Jexl(), 1);
|
|
10
|
-
async function evaluateAccess(expression, context) {
|
|
11
|
-
if (expression === void 0 || expression === null) return false;
|
|
12
|
-
if (typeof expression === "boolean") return expression;
|
|
13
|
-
try {
|
|
14
|
-
const result = await import_jexl.default.eval(expression, context);
|
|
15
|
-
if (result && typeof result === "object" && !Array.isArray(result)) {
|
|
16
|
-
return result;
|
|
17
|
-
}
|
|
18
|
-
return !!result;
|
|
19
|
-
} catch (err) {
|
|
20
|
-
console.error("[dyrected:access] Failed to evaluate access expression:", err);
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// src/auth/access.ts
|
|
26
|
-
function isNamedAccessPolicy(value) {
|
|
27
|
-
return !!value && typeof value === "object" && "policy" in value && typeof value.policy === "string";
|
|
28
|
-
}
|
|
29
|
-
async function resolveAccess(config, access, args) {
|
|
30
|
-
if (access === void 0 || access === null) return void 0;
|
|
31
|
-
if (typeof access === "boolean" || typeof access === "string") {
|
|
32
|
-
return evaluateAccess(access, { ...args, config });
|
|
33
|
-
}
|
|
34
|
-
if (typeof access === "function") {
|
|
35
|
-
try {
|
|
36
|
-
return await access(args);
|
|
37
|
-
} catch (err) {
|
|
38
|
-
console.error("[dyrected:access] Functional access check failed:", err);
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
if (isNamedAccessPolicy(access)) {
|
|
43
|
-
const policy = config.accessPolicies?.[access.policy];
|
|
44
|
-
if (policy === void 0) {
|
|
45
|
-
console.error(`[dyrected:access] Unknown access policy "${access.policy}"`);
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
if (typeof policy === "string" || typeof policy === "boolean") {
|
|
49
|
-
return evaluateAccess(policy, { ...args, config });
|
|
50
|
-
}
|
|
51
|
-
try {
|
|
52
|
-
const resolver = policy;
|
|
53
|
-
return await resolver({ ...args, params: access.params });
|
|
54
|
-
} catch (err) {
|
|
55
|
-
console.error(`[dyrected:access] Access policy "${access.policy}" failed:`, err);
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
async function isAccessAllowed(config, access, args) {
|
|
62
|
-
const result = await resolveAccess(config, access, args);
|
|
63
|
-
if (result === void 0) return true;
|
|
64
|
-
return typeof result === "boolean" ? result : !!result;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export {
|
|
68
|
-
resolveAccess,
|
|
69
|
-
isAccessAllowed
|
|
70
|
-
};
|
package/dist/chunk-JSBRDJBE.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
19
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
20
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
21
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
22
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
23
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
24
|
-
mod
|
|
25
|
-
));
|
|
26
|
-
|
|
27
|
-
export {
|
|
28
|
-
__commonJS,
|
|
29
|
-
__toESM
|
|
30
|
-
};
|