@flusys/nestjs-entity-builder 9.1.0-rc.1 → 9.1.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/README.md +52 -23
- package/config/entity-builder.constants.d.ts +2 -0
- package/config/message-keys.d.ts +102 -13
- package/controllers/definition-bundle.controller.d.ts +15 -0
- package/controllers/flow-definition.controller.d.ts +7 -1
- package/controllers/flow-runtime.controller.d.ts +16 -8
- package/controllers/index.d.ts +1 -1
- package/dtos/definition-bundle.dto.d.ts +57 -0
- package/dtos/flow.dto.d.ts +13 -20
- package/dtos/index.d.ts +1 -0
- package/entities/flow-definition.entity.d.ts +3 -9
- package/entities/flow-execution.entity.d.ts +3 -0
- package/entities/flow-version.entity.d.ts +10 -0
- package/entities/index.d.ts +3 -3
- package/fesm/21.js +105 -15
- package/fesm/458.js +695 -0
- package/fesm/{489.js → 582.js} +22 -30
- package/fesm/{996.js → 677.js} +1562 -1064
- package/fesm/794.js +135 -240
- package/fesm/{719.js → 870.js} +2065 -324
- package/fesm/{362.js → 897.js} +572 -8
- package/fesm/{606.js → 946.js} +621 -296
- package/fesm/config/index.js +15 -2
- package/fesm/controllers/index.js +9 -9
- package/fesm/docs/index.js +7 -4
- package/fesm/dtos/index.js +451 -256
- package/fesm/entities/index.js +58 -3
- package/fesm/guards/index.js +106 -22
- package/fesm/index.js +429 -937
- package/fesm/interfaces/index.js +19 -2
- package/fesm/modules/index.js +10 -627
- package/fesm/rule-engine/index.js +12 -3
- package/fesm/services/index.js +101 -29
- package/flow-engine/flow-api-key.d.ts +3 -7
- package/flow-engine/flow-graph.validator.d.ts +5 -4
- package/flow-engine/flow-permission-logic.d.ts +2 -0
- package/flow-engine/flow-run.types.d.ts +19 -9
- package/flow-engine/flow.types.d.ts +115 -11
- package/guards/designer-writable.interceptor.d.ts +12 -0
- package/guards/index.d.ts +1 -0
- package/interfaces/definition-bundle.interface.d.ts +111 -0
- package/interfaces/entity-builder-module.interface.d.ts +6 -0
- package/interfaces/flow-definition.interface.d.ts +13 -9
- package/interfaces/index.d.ts +1 -0
- package/package.json +5 -5
- package/rule-engine/rule-engine.service.d.ts +1 -0
- package/rule-engine/rule-permission.d.ts +3 -7
- package/services/definition-bundle.diff.d.ts +62 -0
- package/services/definition-bundle.file.d.ts +7 -0
- package/services/definition-bundle.service.d.ts +32 -0
- package/services/entity-builder-config.service.d.ts +2 -0
- package/services/entity-flow-scaffold.d.ts +4 -3
- package/services/flow-definition.service.d.ts +26 -12
- package/services/flow-execution.service.d.ts +7 -0
- package/services/flow-executor.service.d.ts +9 -8
- package/services/flow-runtime.service.d.ts +2 -1
- package/services/generic-entity.service.d.ts +1 -1
- package/services/index.d.ts +3 -1
- package/services/schema-evolution.service.d.ts +3 -1
- package/services/schema-sync.service.d.ts +6 -2
- package/controllers/flow-api-key.controller.d.ts +0 -14
- package/entities/flow-api-key.entity.d.ts +0 -10
- package/services/flow-api-key.service.d.ts +0 -31
package/fesm/{489.js → 582.js}
RENAMED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RE2JS } from "re2js";
|
|
2
|
+
import * as __rspack_external__flusys_nestjs_shared_interfaces_413f2706 from "@flusys/nestjs-shared/interfaces";
|
|
2
3
|
import * as __rspack_external__flusys_nestjs_shared_modules_24702bee from "@flusys/nestjs-shared/modules";
|
|
3
4
|
import * as __rspack_external__flusys_nestjs_shared_utils_9125c1f1 from "@flusys/nestjs-shared/utils";
|
|
4
5
|
import * as __rspack_external__nestjs_common_a04939da from "@nestjs/common";
|
|
5
|
-
import * as __rspack_external_node_crypto_2e7c4b46 from "node:crypto";
|
|
6
6
|
import * as __rspack_external_node_net_5ed819e1 from "node:net";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export const __rspack_esm_id = 489;
|
|
10
|
-
export const __rspack_esm_ids = [489];
|
|
7
|
+
export const __rspack_esm_id = 582;
|
|
8
|
+
export const __rspack_esm_ids = [582];
|
|
11
9
|
export const __webpack_modules__ = {
|
|
12
10
|
3372(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
13
11
|
const RECORD_FILTER_OPS = [
|
|
@@ -47,7 +45,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
47
45
|
|
|
48
46
|
|
|
49
47
|
},
|
|
50
|
-
|
|
48
|
+
8429(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
51
49
|
|
|
52
50
|
// EXPORTS
|
|
53
51
|
__webpack_require__.d(__webpack_exports__, {
|
|
@@ -64,8 +62,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
64
62
|
|
|
65
63
|
// EXTERNAL MODULE: ./projects/nestjs-entity-builder/src/rule-engine/rule.interface.ts
|
|
66
64
|
var rule_interface = __webpack_require__(2354);
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
// EXTERNAL MODULE: external "@flusys/nestjs-shared/interfaces"
|
|
66
|
+
var interfaces_ = __webpack_require__(5103);
|
|
69
67
|
// EXTERNAL MODULE: external "@flusys/nestjs-shared/modules"
|
|
70
68
|
var modules_ = __webpack_require__(1236);
|
|
71
69
|
// EXTERNAL MODULE: external "@flusys/nestjs-shared/utils"
|
|
@@ -267,6 +265,9 @@ class RuleEngineService {
|
|
|
267
265
|
return this.resolveLookup(expression, ctx, budget);
|
|
268
266
|
}
|
|
269
267
|
}
|
|
268
|
+
/** For HTML the author writes: the values a template fills in are escaped; any other expression is taken as the HTML it resolves to. */ async resolveHtml(expression, ctx) {
|
|
269
|
+
return expression.type === 'template' ? this.resolveTemplate(expression.template, ctx, utils_.escapeHtml) : this.resolveExpression(expression, ctx);
|
|
270
|
+
}
|
|
270
271
|
async resolveLookup(expression, ctx, budget) {
|
|
271
272
|
if (!ctx.lookupResolver) {
|
|
272
273
|
throw new common_.BadRequestException({
|
|
@@ -321,7 +322,7 @@ class RuleEngineService {
|
|
|
321
322
|
}
|
|
322
323
|
}
|
|
323
324
|
}
|
|
324
|
-
resolveTemplate(template, ctx) {
|
|
325
|
+
resolveTemplate(template, ctx, format = (text)=>text) {
|
|
325
326
|
if (template.length > (/* inlined export .RULE_TEMPLATE_MAX_LENGTH */4000)) {
|
|
326
327
|
throw new common_.BadRequestException({
|
|
327
328
|
message: `Template is longer than ${(/* inlined export .RULE_TEMPLATE_MAX_LENGTH */4000)} characters.`,
|
|
@@ -337,7 +338,7 @@ class RuleEngineService {
|
|
|
337
338
|
for (const match of template.matchAll(pattern)){
|
|
338
339
|
result += template.slice(last, match.index);
|
|
339
340
|
const value = this.resolveFieldReference(match[1], ctx);
|
|
340
|
-
result += value === null || value === undefined ? '' : typeof value === 'object' ? JSON.stringify(value) : String(value);
|
|
341
|
+
result += value === null || value === undefined ? '' : format(typeof value === 'object' ? JSON.stringify(value) : String(value));
|
|
341
342
|
last = match.index + match[0].length;
|
|
342
343
|
}
|
|
343
344
|
return result + template.slice(last);
|
|
@@ -655,7 +656,7 @@ class RuleEngineService {
|
|
|
655
656
|
RuleEngineService = _ts_decorate([
|
|
656
657
|
(0,common_.Injectable)(),
|
|
657
658
|
_ts_param(0, (0,common_.Optional)()),
|
|
658
|
-
_ts_param(0, (0,common_.Inject)(
|
|
659
|
+
_ts_param(0, (0,common_.Inject)(interfaces_.PERMISSION_RESOLVER)),
|
|
659
660
|
_ts_param(1, (0,common_.Optional)()),
|
|
660
661
|
_ts_param(1, (0,common_.Inject)(modules_.SharedPermissionCacheService)),
|
|
661
662
|
_ts_metadata("design:type", Function),
|
|
@@ -761,7 +762,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
761
762
|
|
|
762
763
|
},
|
|
763
764
|
5191(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
764
|
-
/* import */ var
|
|
765
|
+
/* import */ var _flusys_nestjs_shared_utils__rspack_import_0 = __webpack_require__(9216);
|
|
765
766
|
/* import */ var _nestjs_common__rspack_import_1 = __webpack_require__(6157);
|
|
766
767
|
/* import */ var _config_message_keys_js__rspack_import_3 = __webpack_require__(5732);
|
|
767
768
|
/* import */ var _rule_interface_js__rspack_import_2 = __webpack_require__(2354);
|
|
@@ -782,7 +783,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
782
783
|
const key = branch ?? '';
|
|
783
784
|
let codes = memo.get(key);
|
|
784
785
|
if (!codes) {
|
|
785
|
-
codes =
|
|
786
|
+
codes = (0,_flusys_nestjs_shared_utils__rspack_import_0.loadPermissionCodes)({
|
|
786
787
|
userId: user.id,
|
|
787
788
|
companyId: user.companyId ?? null,
|
|
788
789
|
branchId: branch
|
|
@@ -793,11 +794,6 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
793
794
|
}
|
|
794
795
|
};
|
|
795
796
|
}
|
|
796
|
-
async function loadCodes(scope, sources) {
|
|
797
|
-
if (sources.resolver) return sources.resolver.getPermissionCodes(scope);
|
|
798
|
-
if (sources.cache?.isCacheConfigured()) return sources.cache.getPermissions(scope);
|
|
799
|
-
throw new _flusys_nestjs_shared_exceptions__rspack_import_0.PermissionSystemUnavailableException();
|
|
800
|
-
}
|
|
801
797
|
/** A list, or text separated by commas / whitespace, as distinct codes. */ function parsePermissionCodes(value) {
|
|
802
798
|
const raw = Array.isArray(value) ? value : typeof value === 'string' ? value.split(/[\s,]+/) : [];
|
|
803
799
|
const codes = [
|
|
@@ -1051,7 +1047,7 @@ function patternError(problem, pattern) {
|
|
|
1051
1047
|
}
|
|
1052
1048
|
}
|
|
1053
1049
|
function compile(pattern) {
|
|
1054
|
-
return remember(compiled, pattern, (p)=>
|
|
1050
|
+
return remember(compiled, pattern, (p)=>RE2JS.compile(p));
|
|
1055
1051
|
}
|
|
1056
1052
|
|
|
1057
1053
|
|
|
@@ -1127,7 +1123,9 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
1127
1123
|
|
|
1128
1124
|
},
|
|
1129
1125
|
2354(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
1130
|
-
|
|
1126
|
+
/* import */ var _flusys_nestjs_shared_utils__rspack_import_0 = __webpack_require__(9216);
|
|
1127
|
+
/** Declarative JSON rule/expression grammar - evaluated by a closed switch, never as code. */
|
|
1128
|
+
const RULE_COMPARISON_OPERATORS = [
|
|
1131
1129
|
'equals',
|
|
1132
1130
|
'not_equals',
|
|
1133
1131
|
'greater_than',
|
|
@@ -1181,7 +1179,7 @@ const RULE_ENGINE_LIMITS = {
|
|
|
1181
1179
|
/** Largest `{n,m}` count, also for the product of nested counts. */ MAX_REGEX_REPEAT: 100,
|
|
1182
1180
|
/** How much larger counted repeats may make the unrolled pattern than the pattern itself. */ MAX_REGEX_REPEAT_EXPANSION: 300,
|
|
1183
1181
|
/** Largest `offsetMinutes` accepted by START_OF_DAY / END_OF_DAY (UTC+14 / UTC-12). */ MAX_UTC_OFFSET_MINUTES: 840,
|
|
1184
|
-
MAX_PERMISSION_CODES:
|
|
1182
|
+
MAX_PERMISSION_CODES: _flusys_nestjs_shared_utils__rspack_import_0.MAX_PERMISSION_LOGIC_CODES,
|
|
1185
1183
|
MAX_IP_RANGES: 100
|
|
1186
1184
|
};
|
|
1187
1185
|
|
|
@@ -1198,9 +1196,9 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
1198
1196
|
|
|
1199
1197
|
|
|
1200
1198
|
},
|
|
1201
|
-
|
|
1199
|
+
5103(module) {
|
|
1202
1200
|
|
|
1203
|
-
module.exports =
|
|
1201
|
+
module.exports = __rspack_external__flusys_nestjs_shared_interfaces_413f2706;
|
|
1204
1202
|
|
|
1205
1203
|
|
|
1206
1204
|
},
|
|
@@ -1221,12 +1219,6 @@ module.exports = __rspack_external__flusys_nestjs_shared_utils_9125c1f1;
|
|
|
1221
1219
|
module.exports = __rspack_external__nestjs_common_a04939da;
|
|
1222
1220
|
|
|
1223
1221
|
|
|
1224
|
-
},
|
|
1225
|
-
2561(module) {
|
|
1226
|
-
|
|
1227
|
-
module.exports = __rspack_external_node_crypto_2e7c4b46;
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
1222
|
},
|
|
1231
1223
|
8299(module) {
|
|
1232
1224
|
|