@flusys/nestjs-entity-builder 9.1.2 → 9.2.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 +49 -25
- package/config/entity-builder.constants.d.ts +1 -0
- package/config/message-keys.d.ts +37 -2
- package/controllers/definition-bundle.controller.d.ts +2 -2
- package/controllers/entity-definition.controller.d.ts +1 -1
- package/controllers/field-definition.controller.d.ts +1 -1
- package/controllers/flow-definition.controller.d.ts +3 -1
- package/controllers/flow-runtime.controller.d.ts +4 -3
- package/dtos/definition-bundle.dto.d.ts +1 -0
- package/dtos/entity-definition.dto.d.ts +1 -2
- package/fesm/21.js +39 -5
- package/fesm/{458.js → 28.js} +110 -63
- package/fesm/677.js +1543 -513
- package/fesm/794.js +1 -1
- package/fesm/857.js +3 -3
- package/fesm/870.js +974 -558
- package/fesm/897.js +187 -51
- package/fesm/946.js +72 -43
- package/fesm/config/index.js +10 -14
- package/fesm/docs/index.js +1 -1
- package/fesm/dtos/index.js +11 -0
- package/fesm/guards/index.js +16 -10
- package/fesm/index.js +44 -26
- package/fesm/modules/index.js +4 -3
- package/fesm/services/index.js +40 -59
- package/flow-engine/flow-code-runner.d.ts +16 -0
- package/flow-engine/flow-graph.validator.d.ts +1 -0
- package/flow-engine/flow-input.validator.d.ts +16 -1
- package/flow-engine/flow-run.types.d.ts +16 -0
- package/flow-engine/flow.types.d.ts +18 -1
- package/guards/designer-writable.interceptor.d.ts +1 -0
- package/interfaces/definition-bundle.interface.d.ts +4 -1
- package/interfaces/entity-builder-module.interface.d.ts +9 -0
- package/modules/entity-builder.module.d.ts +1 -0
- package/modules/index.d.ts +1 -0
- package/modules/tenant-context-id.strategy.d.ts +16 -0
- package/package.json +3 -4
- package/services/definition-bundle.diff.d.ts +6 -2
- package/services/definition-bundle.file.d.ts +2 -1
- package/services/definition-bundle.service.d.ts +10 -3
- package/services/entity-builder-config.service.d.ts +3 -0
- package/services/entity-builder-datasource.provider.d.ts +1 -0
- package/services/entity-flow-scaffold.d.ts +2 -1
- package/services/entity-permission.service.d.ts +1 -0
- package/services/field-value-validator.d.ts +7 -0
- package/services/flow-definition.service.d.ts +11 -3
- package/services/flow-executor.service.d.ts +3 -0
- package/services/flow-runtime.service.d.ts +7 -1
- package/services/generic-entity-service.factory.d.ts +5 -1
- package/services/generic-entity.service.d.ts +25 -2
- package/services/identifier-rules.d.ts +0 -1
- package/services/save-loaded.d.ts +2 -0
- package/services/schema-change-executor.service.d.ts +1 -0
- package/services/schema-columns.d.ts +7 -2
- package/services/schema-dialect-adapter.service.d.ts +2 -0
- package/services/schema-evolution.service.d.ts +8 -2
- package/services/schema-registry.service.d.ts +12 -0
- package/services/schema-sync.service.d.ts +3 -1
- package/flow-engine/flow-code-sandbox.d.ts +0 -5
package/fesm/services/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const __rspack_esm_id = 995;
|
|
2
2
|
export const __rspack_esm_ids = [995];
|
|
3
3
|
export const __webpack_modules__ = {
|
|
4
|
-
|
|
4
|
+
712(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
5
5
|
|
|
6
6
|
// EXPORTS
|
|
7
7
|
__webpack_require__.d(__webpack_exports__, {
|
|
@@ -9,13 +9,11 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
9
9
|
Fz: () => (/* reexport */ (/* inlined export .DRAFT_TEST_RETAIN */200)),
|
|
10
10
|
P0: () => (/* reexport */ definition_bundle_service/* .DefinitionBundleService */.P),
|
|
11
11
|
Vo: () => (/* reexport */ definition_cache_service/* .DefinitionCacheService */.V),
|
|
12
|
-
$I: () => (/* reexport */ definition_bundle_diff/* .ENTITY_COMPARED_KEYS */.$I),
|
|
13
12
|
IP: () => (/* reexport */ entity_flow_scaffold/* .ENTITY_FLOW_PATHS */.IP),
|
|
14
13
|
E: () => (/* reexport */ entity_builder_config_service/* .EntityBuilderConfigService */.E),
|
|
15
14
|
DR: () => (/* reexport */ entity_builder_datasource_provider/* .EntityBuilderDataSourceProvider */.D),
|
|
16
15
|
oc: () => (/* reexport */ entity_definition_service/* .EntityDefinitionService */.o),
|
|
17
16
|
u4: () => (/* reexport */ entity_permission_service/* .EntityPermissionService */.u),
|
|
18
|
-
mT: () => (/* reexport */ definition_bundle_diff/* .FIELD_COMPARED_KEYS */.mT),
|
|
19
17
|
J: () => (/* reexport */ field_definition_service/* .FieldDefinitionService */.J),
|
|
20
18
|
Tk: () => (/* reexport */ flow_definition_service/* .FlowDefinitionService */.Tk),
|
|
21
19
|
AJ: () => (/* reexport */ flow_execution_service/* .FlowExecutionService */.A),
|
|
@@ -24,8 +22,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
24
22
|
a$: () => (/* reexport */ flow_runtime_service/* .FlowRuntimeService */.a),
|
|
25
23
|
GK: () => (/* reexport */ generic_entity_service/* .GenericEntityService */.GK),
|
|
26
24
|
GR: () => (/* reexport */ generic_entity_service_factory/* .GenericEntityServiceFactory */.G),
|
|
27
|
-
|
|
28
|
-
xJ: () => (/* reexport */ identifier_rules/* .RESERVED_WORDS */.xJ),
|
|
25
|
+
vx: () => (/* reexport */ schema_columns/* .LIVE_ROWS_WHERE */.vx),
|
|
29
26
|
tH: () => (/* reexport */ reference_scanner_service/* .ReferenceScannerService */.t),
|
|
30
27
|
mq: () => (/* reexport */ schema_columns/* .SYSTEM_COLUMN_NAMES */.mq),
|
|
31
28
|
TQ: () => (/* reexport */ schema_change_executor_service/* .SchemaChangeExecutor */.T),
|
|
@@ -36,8 +33,9 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
36
33
|
DG: () => (/* reexport */ generic_entity_service/* .actorMetadata */.DG),
|
|
37
34
|
$6: () => (/* reexport */ schema_columns/* .addUnique */.$6),
|
|
38
35
|
gT: () => (/* reexport */ definition_bundle_diff/* .applyVariables */.gT),
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
b$: () => (/* reexport */ flow_definition_service/* .asksExecutePermission */.b$),
|
|
37
|
+
fY: () => (/* reexport */ identifier_rules/* .assertIndexableField */.f),
|
|
38
|
+
kV: () => (/* reexport */ identifier_rules/* .assertValidIdentifier */.k),
|
|
41
39
|
HK: () => (/* reexport */ schema_columns/* .auditColumns */.HK),
|
|
42
40
|
CO: () => (/* reexport */ entity_flow_scaffold/* .buildEntityFlow */.CO),
|
|
43
41
|
fu: () => (/* reexport */ schema_columns/* .buildFieldColumn */.fu),
|
|
@@ -51,34 +49,43 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
51
49
|
an: () => (/* reexport */ schema_change_types/* .describeImpact */.a),
|
|
52
50
|
Sy: () => (/* reexport */ definition_bundle_diff/* .diffEntities */.zb),
|
|
53
51
|
x2: () => (/* reexport */ entity_flow_scaffold/* .entityFlowSlug */.x2),
|
|
52
|
+
ZM: () => (/* reexport */ entity_permission_service/* .entityPermissionCodes */.Z),
|
|
54
53
|
lj: () => (/* reexport */ definition_bundle_diff/* .extractVariables */.lj),
|
|
55
54
|
HQ: () => (/* reexport */ schema_dialect_adapter_service/* .fitIdentifier */.H),
|
|
55
|
+
f7: () => (/* reexport */ definition_bundle_diff/* .fixedIds */.f7),
|
|
56
56
|
YW: () => (/* reexport */ flow_definition_service/* .flowNotFound */.YW),
|
|
57
57
|
j4: () => (/* reexport */ flow_definition_service/* .flowPermissions */.j4),
|
|
58
58
|
gl: () => (/* reexport */ flow_executor_service/* .flowTimeout */.g),
|
|
59
59
|
mo: () => (/* reexport */ schema_columns/* .indexName */.mo),
|
|
60
|
+
w5: () => (/* reexport */ schema_columns/* .indexedByDefault */.w5),
|
|
60
61
|
C5: () => (/* reexport */ schema_evolution_service/* .isDestructiveSchemaAction */.C),
|
|
61
62
|
d4: () => (/* reexport */ schema_columns/* .isIndexableFieldType */.d4),
|
|
63
|
+
YS: () => (/* reexport */ schema_columns/* .isLiveRowsIndex */.YS),
|
|
62
64
|
HF: () => (/* reexport */ flow_definition_service/* .isPublished */.HF),
|
|
63
65
|
Eq: () => (/* reexport */ database_error_mapper/* .mapDatabaseError */.E),
|
|
64
66
|
iw: () => (/* reexport */ database_error_mapper/* .mapSchemaError */.i),
|
|
65
67
|
Og: () => (/* reexport */ definition_bundle_diff/* .matchDefinitions */.Og),
|
|
66
68
|
qG: () => (/* reexport */ definition_bundle_diff/* .orderFlows */.qG),
|
|
69
|
+
QJ: () => (/* reexport */ definition_bundle_diff/* .permissionCodes */.QJ),
|
|
67
70
|
v7: () => (/* reexport */ schema_columns/* .plainIndex */.v7),
|
|
68
71
|
IM: () => (/* reexport */ field_type_conversion/* .planTypeConversion */.I),
|
|
69
72
|
zi: () => (/* reexport */ definition_bundle_file/* .readBundleFile */.z),
|
|
73
|
+
KA: () => (/* reexport */ definition_bundle_file/* .readBundleFiles */.K),
|
|
70
74
|
e1: () => (/* reexport */ schema_change_executor_service/* .relationTargetCodes */.e),
|
|
71
75
|
Sd: () => (/* reexport */ flow_runtime_service/* .requestInfo */.S),
|
|
72
76
|
G7: () => (/* reexport */ schema_columns/* .sameColumns */.G7),
|
|
73
77
|
eY: () => (/* reexport */ flow_definition_service/* .snapshotOf */.eY),
|
|
74
78
|
OG: () => (/* reexport */ schema_columns/* .softDeleteColumn */.OG),
|
|
75
79
|
cg: () => (/* reexport */ schema_columns/* .sqlTypeFor */.cg),
|
|
80
|
+
xV: () => (/* reexport */ generic_entity_service/* .statementTimeoutSql */.xV),
|
|
76
81
|
dX: () => (/* reexport */ definition_bundle_diff/* .stripApiKeys */.dX),
|
|
77
82
|
uy: () => (/* reexport */ schema_columns/* .tableUnique */.uy),
|
|
78
83
|
RK: () => (/* reexport */ flow_definition_service/* .toFlowSettings */.RK),
|
|
79
84
|
jp: () => (/* reexport */ schema_columns/* .typeFamily */.jp),
|
|
80
85
|
eV: () => (/* reexport */ field_value_validator/* .validateRecord */.e),
|
|
81
|
-
|
|
86
|
+
CM: () => (/* reexport */ field_value_validator/* .valueRulesOf */.C),
|
|
87
|
+
lw: () => (/* reexport */ flow_definition_service/* .workingCopy */.lw),
|
|
88
|
+
l6: () => (/* reexport */ definition_bundle_diff/* .writtenSecrets */.l6)
|
|
82
89
|
});
|
|
83
90
|
|
|
84
91
|
// EXTERNAL MODULE: ./projects/nestjs-entity-builder/src/services/entity-builder-config.service.ts
|
|
@@ -95,8 +102,8 @@ var schema_sync_service = __webpack_require__(3474);
|
|
|
95
102
|
var entity_definition_service = __webpack_require__(1296);
|
|
96
103
|
// EXTERNAL MODULE: ./projects/nestjs-entity-builder/src/services/field-definition.service.ts
|
|
97
104
|
var field_definition_service = __webpack_require__(9487);
|
|
98
|
-
// EXTERNAL MODULE: ./projects/nestjs-entity-builder/src/services/generic-entity.service.ts
|
|
99
|
-
var generic_entity_service = __webpack_require__(
|
|
105
|
+
// EXTERNAL MODULE: ./projects/nestjs-entity-builder/src/services/generic-entity.service.ts + 3 modules
|
|
106
|
+
var generic_entity_service = __webpack_require__(3052);
|
|
100
107
|
// EXTERNAL MODULE: ./projects/nestjs-entity-builder/src/services/generic-entity-service.factory.ts
|
|
101
108
|
var generic_entity_service_factory = __webpack_require__(7705);
|
|
102
109
|
// EXTERNAL MODULE: ./projects/nestjs-entity-builder/src/services/entity-permission.service.ts
|
|
@@ -133,39 +140,14 @@ var flow_runtime_service = __webpack_require__(2300);
|
|
|
133
140
|
var utils_ = __webpack_require__(9216);
|
|
134
141
|
// EXTERNAL MODULE: external "@nestjs/common"
|
|
135
142
|
var common_ = __webpack_require__(6157);
|
|
136
|
-
// EXTERNAL MODULE: external "typeorm"
|
|
137
|
-
var external_typeorm_ = __webpack_require__(7158);
|
|
138
143
|
// EXTERNAL MODULE: ./projects/nestjs-entity-builder/src/config/message-keys.ts
|
|
139
144
|
var message_keys = __webpack_require__(5732);
|
|
140
145
|
// EXTERNAL MODULE: ./projects/nestjs-entity-builder/src/entities/flow-definition.entity.ts
|
|
141
146
|
var flow_definition_entity = __webpack_require__(3770);
|
|
142
147
|
// EXTERNAL MODULE: ./projects/nestjs-entity-builder/src/entities/flow-version.entity.ts
|
|
143
148
|
var flow_version_entity = __webpack_require__(2399);
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
if (typeof value === 'string') return fn(value);
|
|
147
|
-
if (Array.isArray(value)) return value.map((v)=>mapStrings(v, fn));
|
|
148
|
-
if (value && typeof value === 'object') {
|
|
149
|
-
return Object.fromEntries(Object.entries(value).map(([k, v])=>[
|
|
150
|
-
k,
|
|
151
|
-
mapStrings(v, fn)
|
|
152
|
-
]));
|
|
153
|
-
}
|
|
154
|
-
return value;
|
|
155
|
-
}
|
|
156
|
-
function anyString(value, test) {
|
|
157
|
-
if (typeof value === 'string') return test(value);
|
|
158
|
-
if (Array.isArray(value)) return value.some((v)=>anyString(v, test));
|
|
159
|
-
if (value && typeof value === 'object') return Object.values(value).some((v)=>anyString(v, test));
|
|
160
|
-
return false;
|
|
161
|
-
}
|
|
162
|
-
const escapeRe = (s)=>s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
163
|
-
/**
|
|
164
|
-
* `<prefix>.<field>`, `<prefix>.<field>.x` or `{{ <prefix>.<field> }}` inside a template - but not
|
|
165
|
-
* `<prefix>.<field>_2`. The prefix is a regex source (e.g. `context\.find\.items\.\d+`), captured so a rewrite keeps it.
|
|
166
|
-
*/ const referencePatternSource = (prefixSource, field, flags = '')=>new RegExp(`(^|\\{\\{\\s*)(${prefixSource})\\.${escapeRe(field)}(?!\\w)`, flags);
|
|
167
|
-
const replaceReferenceSource = (s, prefixSource, from, to)=>s.replace(referencePatternSource(prefixSource, from, 'g'), (_match, lead, prefix)=>`${lead}${prefix}.${to}`);
|
|
168
|
-
|
|
149
|
+
// EXTERNAL MODULE: ./projects/nestjs-entity-builder/src/services/reference-rewrite.ts
|
|
150
|
+
var reference_rewrite = __webpack_require__(3086);
|
|
169
151
|
;// CONCATENATED MODULE: ./projects/nestjs-entity-builder/src/flow-engine/flow-reference.ts
|
|
170
152
|
|
|
171
153
|
const entityOf = (node)=>node.config?.entityCode;
|
|
@@ -199,20 +181,20 @@ const ITEM = '\\.items\\.\\d+';
|
|
|
199
181
|
/** Regex sources of every output path that holds a record of the entity. */ function recordPrefixes(nodes, entityCode) {
|
|
200
182
|
const out = [];
|
|
201
183
|
for (const node of nodes){
|
|
202
|
-
const base = `context\\.${escapeRe(node.id)}`;
|
|
184
|
+
const base = `context\\.${(0,reference_rewrite/* .escapeRe */.NF)(node.id)}`;
|
|
203
185
|
if (entityOf(node) === entityCode) {
|
|
204
186
|
if (node.type === 'entity_get') out.push(base);
|
|
205
187
|
else if (node.type === 'entity_insert' || node.type === 'entity_update') out.push(`${base}(?:${ITEM})?`);
|
|
206
188
|
else if (node.type === 'entity_query') out.push(`${base}${ITEM}`);
|
|
207
189
|
}
|
|
208
190
|
for (const child of childrenOf(node)){
|
|
209
|
-
if (child.entityCode === entityCode && typeof child.as === 'string' && child.as) out.push(`${base}(?:${ITEM})?\\.${escapeRe(child.as)}\\.\\d+`);
|
|
191
|
+
if (child.entityCode === entityCode && typeof child.as === 'string' && child.as) out.push(`${base}(?:${ITEM})?\\.${(0,reference_rewrite/* .escapeRe */.NF)(child.as)}\\.\\d+`);
|
|
210
192
|
}
|
|
211
193
|
}
|
|
212
194
|
return out;
|
|
213
195
|
}
|
|
214
196
|
function flowRefersToField(nodes, entityCode, field) {
|
|
215
|
-
const patterns = recordPrefixes(nodes, entityCode).map((prefix)=>referencePatternSource(prefix, field));
|
|
197
|
+
const patterns = recordPrefixes(nodes, entityCode).map((prefix)=>(0,reference_rewrite/* .referencePatternSource */.LV)(prefix, field));
|
|
216
198
|
return nodes.some((node)=>{
|
|
217
199
|
if (entityOf(node) === entityCode) {
|
|
218
200
|
const c = node.config;
|
|
@@ -222,7 +204,7 @@ function flowRefersToField(nodes, entityCode, field) {
|
|
|
222
204
|
}
|
|
223
205
|
if (childrenOf(node).some((child)=>child.entityCode === entityCode && childUsesField(child, field))) return true;
|
|
224
206
|
if (anyLookup(node.config, entityCode, (lookup)=>lookupUsesField(lookup, field))) return true;
|
|
225
|
-
return patterns.length > 0 && anyString(node.config, (s)=>patterns.some((p)=>p.test(s)));
|
|
207
|
+
return patterns.length > 0 && (0,reference_rewrite/* .anyString */.gp)(node.config, (s)=>patterns.some((p)=>p.test(s)));
|
|
226
208
|
});
|
|
227
209
|
}
|
|
228
210
|
function rewriteFlowField(nodes, entityCode, from, to) {
|
|
@@ -294,8 +276,8 @@ function rewriteFlowField(nodes, entityCode, from, to) {
|
|
|
294
276
|
};
|
|
295
277
|
});
|
|
296
278
|
if (prefixes.length) {
|
|
297
|
-
config = mapStrings(config, (s)=>{
|
|
298
|
-
const out = prefixes.reduce((acc, prefix)=>replaceReferenceSource(acc, prefix, from, to), s);
|
|
279
|
+
config = (0,reference_rewrite/* .mapStrings */.to)(config, (s)=>{
|
|
280
|
+
const out = prefixes.reduce((acc, prefix)=>(0,reference_rewrite/* .replaceReferenceSource */.Ni)(acc, prefix, from, to), s);
|
|
299
281
|
if (out !== s) changed = true;
|
|
300
282
|
return out;
|
|
301
283
|
});
|
|
@@ -342,18 +324,13 @@ function _ts_param(paramIndex, decorator) {
|
|
|
342
324
|
|
|
343
325
|
|
|
344
326
|
|
|
345
|
-
|
|
346
327
|
class FlowReferenceProvider {
|
|
347
328
|
provider;
|
|
348
329
|
constructor(provider){
|
|
349
330
|
this.provider = provider;
|
|
350
331
|
}
|
|
351
332
|
async flows() {
|
|
352
|
-
return (await this.repo(flow_definition_entity/* .FlowDefinition */.G)).find(
|
|
353
|
-
where: {
|
|
354
|
-
deletedAt: (0,external_typeorm_.IsNull)()
|
|
355
|
-
}
|
|
356
|
-
});
|
|
333
|
+
return (await this.repo(flow_definition_entity/* .FlowDefinition */.G)).find();
|
|
357
334
|
}
|
|
358
335
|
async repo(entity, manager) {
|
|
359
336
|
return manager ? manager.getRepository(entity) : this.provider.getRepository(entity);
|
|
@@ -382,10 +359,7 @@ class FlowReferenceProvider {
|
|
|
382
359
|
async rewriteFieldReferences(entityCode, from, to, manager) {
|
|
383
360
|
let count = 0;
|
|
384
361
|
const flows = await this.repo(flow_definition_entity/* .FlowDefinition */.G, manager);
|
|
385
|
-
|
|
386
|
-
for (const flow of (await flows.find({
|
|
387
|
-
withDeleted: true
|
|
388
|
-
}))){
|
|
362
|
+
for (const flow of (await flows.find())){
|
|
389
363
|
// The published flow and its unpublished draft both keep working after the rename.
|
|
390
364
|
const live = rewriteFlowField(flow.nodes, entityCode, from, to);
|
|
391
365
|
const draft = flow.draft ? rewriteFlowField(flow.draft.nodes, entityCode, from, to) : null;
|
|
@@ -490,17 +464,15 @@ import * as __rspack_chunk_6 from '../870.js';
|
|
|
490
464
|
__webpack_require__.C(__rspack_chunk_6);
|
|
491
465
|
import * as __rspack_chunk_7 from './index.js';
|
|
492
466
|
__webpack_require__.C(__rspack_chunk_7);
|
|
493
|
-
var __webpack_exports__ = __webpack_exec__(
|
|
467
|
+
var __webpack_exports__ = __webpack_exec__(712);var __webpack_exports__ACTOR_BRANCH_METADATA_KEY = __webpack_exports__.zb;
|
|
494
468
|
var __webpack_exports__DRAFT_TEST_RETAIN = __webpack_exports__.Fz;
|
|
495
469
|
var __webpack_exports__DefinitionBundleService = __webpack_exports__.P0;
|
|
496
470
|
var __webpack_exports__DefinitionCacheService = __webpack_exports__.Vo;
|
|
497
|
-
var __webpack_exports__ENTITY_COMPARED_KEYS = __webpack_exports__.$I;
|
|
498
471
|
var __webpack_exports__ENTITY_FLOW_PATHS = __webpack_exports__.IP;
|
|
499
472
|
var __webpack_exports__EntityBuilderConfigService = __webpack_exports__.E;
|
|
500
473
|
var __webpack_exports__EntityBuilderDataSourceProvider = __webpack_exports__.DR;
|
|
501
474
|
var __webpack_exports__EntityDefinitionService = __webpack_exports__.oc;
|
|
502
475
|
var __webpack_exports__EntityPermissionService = __webpack_exports__.u4;
|
|
503
|
-
var __webpack_exports__FIELD_COMPARED_KEYS = __webpack_exports__.mT;
|
|
504
476
|
var __webpack_exports__FieldDefinitionService = __webpack_exports__.J;
|
|
505
477
|
var __webpack_exports__FlowDefinitionService = __webpack_exports__.Tk;
|
|
506
478
|
var __webpack_exports__FlowExecutionService = __webpack_exports__.AJ;
|
|
@@ -509,8 +481,7 @@ var __webpack_exports__FlowReferenceProvider = __webpack_exports__.Ly;
|
|
|
509
481
|
var __webpack_exports__FlowRuntimeService = __webpack_exports__.a$;
|
|
510
482
|
var __webpack_exports__GenericEntityService = __webpack_exports__.GK;
|
|
511
483
|
var __webpack_exports__GenericEntityServiceFactory = __webpack_exports__.GR;
|
|
512
|
-
var
|
|
513
|
-
var __webpack_exports__RESERVED_WORDS = __webpack_exports__.xJ;
|
|
484
|
+
var __webpack_exports__LIVE_ROWS_WHERE = __webpack_exports__.vx;
|
|
514
485
|
var __webpack_exports__ReferenceScannerService = __webpack_exports__.tH;
|
|
515
486
|
var __webpack_exports__SYSTEM_COLUMN_NAMES = __webpack_exports__.mq;
|
|
516
487
|
var __webpack_exports__SchemaChangeExecutor = __webpack_exports__.TQ;
|
|
@@ -521,6 +492,7 @@ var __webpack_exports__SchemaSyncService = __webpack_exports__.WQ;
|
|
|
521
492
|
var __webpack_exports__actorMetadata = __webpack_exports__.DG;
|
|
522
493
|
var __webpack_exports__addUnique = __webpack_exports__.$6;
|
|
523
494
|
var __webpack_exports__applyVariables = __webpack_exports__.gT;
|
|
495
|
+
var __webpack_exports__asksExecutePermission = __webpack_exports__.b$;
|
|
524
496
|
var __webpack_exports__assertIndexableField = __webpack_exports__.fY;
|
|
525
497
|
var __webpack_exports__assertValidIdentifier = __webpack_exports__.kV;
|
|
526
498
|
var __webpack_exports__auditColumns = __webpack_exports__.HK;
|
|
@@ -536,32 +508,41 @@ var __webpack_exports__defaultFlowPermissionCode = __webpack_exports__.Er;
|
|
|
536
508
|
var __webpack_exports__describeImpact = __webpack_exports__.an;
|
|
537
509
|
var __webpack_exports__diffEntities = __webpack_exports__.Sy;
|
|
538
510
|
var __webpack_exports__entityFlowSlug = __webpack_exports__.x2;
|
|
511
|
+
var __webpack_exports__entityPermissionCodes = __webpack_exports__.ZM;
|
|
539
512
|
var __webpack_exports__extractVariables = __webpack_exports__.lj;
|
|
540
513
|
var __webpack_exports__fitIdentifier = __webpack_exports__.HQ;
|
|
514
|
+
var __webpack_exports__fixedIds = __webpack_exports__.f7;
|
|
541
515
|
var __webpack_exports__flowNotFound = __webpack_exports__.YW;
|
|
542
516
|
var __webpack_exports__flowPermissions = __webpack_exports__.j4;
|
|
543
517
|
var __webpack_exports__flowTimeout = __webpack_exports__.gl;
|
|
544
518
|
var __webpack_exports__indexName = __webpack_exports__.mo;
|
|
519
|
+
var __webpack_exports__indexedByDefault = __webpack_exports__.w5;
|
|
545
520
|
var __webpack_exports__isDestructiveSchemaAction = __webpack_exports__.C5;
|
|
546
521
|
var __webpack_exports__isIndexableFieldType = __webpack_exports__.d4;
|
|
522
|
+
var __webpack_exports__isLiveRowsIndex = __webpack_exports__.YS;
|
|
547
523
|
var __webpack_exports__isPublished = __webpack_exports__.HF;
|
|
548
524
|
var __webpack_exports__mapDatabaseError = __webpack_exports__.Eq;
|
|
549
525
|
var __webpack_exports__mapSchemaError = __webpack_exports__.iw;
|
|
550
526
|
var __webpack_exports__matchDefinitions = __webpack_exports__.Og;
|
|
551
527
|
var __webpack_exports__orderFlows = __webpack_exports__.qG;
|
|
528
|
+
var __webpack_exports__permissionCodes = __webpack_exports__.QJ;
|
|
552
529
|
var __webpack_exports__plainIndex = __webpack_exports__.v7;
|
|
553
530
|
var __webpack_exports__planTypeConversion = __webpack_exports__.IM;
|
|
554
531
|
var __webpack_exports__readBundleFile = __webpack_exports__.zi;
|
|
532
|
+
var __webpack_exports__readBundleFiles = __webpack_exports__.KA;
|
|
555
533
|
var __webpack_exports__relationTargetCodes = __webpack_exports__.e1;
|
|
556
534
|
var __webpack_exports__requestInfo = __webpack_exports__.Sd;
|
|
557
535
|
var __webpack_exports__sameColumns = __webpack_exports__.G7;
|
|
558
536
|
var __webpack_exports__snapshotOf = __webpack_exports__.eY;
|
|
559
537
|
var __webpack_exports__softDeleteColumn = __webpack_exports__.OG;
|
|
560
538
|
var __webpack_exports__sqlTypeFor = __webpack_exports__.cg;
|
|
539
|
+
var __webpack_exports__statementTimeoutSql = __webpack_exports__.xV;
|
|
561
540
|
var __webpack_exports__stripApiKeys = __webpack_exports__.dX;
|
|
562
541
|
var __webpack_exports__tableUnique = __webpack_exports__.uy;
|
|
563
542
|
var __webpack_exports__toFlowSettings = __webpack_exports__.RK;
|
|
564
543
|
var __webpack_exports__typeFamily = __webpack_exports__.jp;
|
|
565
544
|
var __webpack_exports__validateRecord = __webpack_exports__.eV;
|
|
545
|
+
var __webpack_exports__valueRulesOf = __webpack_exports__.CM;
|
|
566
546
|
var __webpack_exports__workingCopy = __webpack_exports__.lw;
|
|
567
|
-
|
|
547
|
+
var __webpack_exports__writtenSecrets = __webpack_exports__.l6;
|
|
548
|
+
export { __webpack_exports__ACTOR_BRANCH_METADATA_KEY as ACTOR_BRANCH_METADATA_KEY, __webpack_exports__DRAFT_TEST_RETAIN as DRAFT_TEST_RETAIN, __webpack_exports__DefinitionBundleService as DefinitionBundleService, __webpack_exports__DefinitionCacheService as DefinitionCacheService, __webpack_exports__ENTITY_FLOW_PATHS as ENTITY_FLOW_PATHS, __webpack_exports__EntityBuilderConfigService as EntityBuilderConfigService, __webpack_exports__EntityBuilderDataSourceProvider as EntityBuilderDataSourceProvider, __webpack_exports__EntityDefinitionService as EntityDefinitionService, __webpack_exports__EntityPermissionService as EntityPermissionService, __webpack_exports__FieldDefinitionService as FieldDefinitionService, __webpack_exports__FlowDefinitionService as FlowDefinitionService, __webpack_exports__FlowExecutionService as FlowExecutionService, __webpack_exports__FlowExecutorService as FlowExecutorService, __webpack_exports__FlowReferenceProvider as FlowReferenceProvider, __webpack_exports__FlowRuntimeService as FlowRuntimeService, __webpack_exports__GenericEntityService as GenericEntityService, __webpack_exports__GenericEntityServiceFactory as GenericEntityServiceFactory, __webpack_exports__LIVE_ROWS_WHERE as LIVE_ROWS_WHERE, __webpack_exports__ReferenceScannerService as ReferenceScannerService, __webpack_exports__SYSTEM_COLUMN_NAMES as SYSTEM_COLUMN_NAMES, __webpack_exports__SchemaChangeExecutor as SchemaChangeExecutor, __webpack_exports__SchemaDialectAdapterService as SchemaDialectAdapterService, __webpack_exports__SchemaEvolutionService as SchemaEvolutionService, __webpack_exports__SchemaRegistryService as SchemaRegistryService, __webpack_exports__SchemaSyncService as SchemaSyncService, __webpack_exports__actorMetadata as actorMetadata, __webpack_exports__addUnique as addUnique, __webpack_exports__applyVariables as applyVariables, __webpack_exports__asksExecutePermission as asksExecutePermission, __webpack_exports__assertIndexableField as assertIndexableField, __webpack_exports__assertValidIdentifier as assertValidIdentifier, __webpack_exports__auditColumns as auditColumns, __webpack_exports__buildEntityFlow as buildEntityFlow, __webpack_exports__buildFieldColumn as buildFieldColumn, __webpack_exports__buildSystemColumns as buildSystemColumns, __webpack_exports__bundleChecksum as bundleChecksum, __webpack_exports__bundleSubject as bundleSubject, __webpack_exports__byCode as byCode, __webpack_exports__calledFlowSlugs as calledFlowSlugs, __webpack_exports__canonicalJson as canonicalJson, __webpack_exports__defaultFlowPermissionCode as defaultFlowPermissionCode, __webpack_exports__describeImpact as describeImpact, __webpack_exports__diffEntities as diffEntities, __webpack_exports__entityFlowSlug as entityFlowSlug, __webpack_exports__entityPermissionCodes as entityPermissionCodes, __webpack_exports__extractVariables as extractVariables, __webpack_exports__fitIdentifier as fitIdentifier, __webpack_exports__fixedIds as fixedIds, __webpack_exports__flowNotFound as flowNotFound, __webpack_exports__flowPermissions as flowPermissions, __webpack_exports__flowTimeout as flowTimeout, __webpack_exports__indexName as indexName, __webpack_exports__indexedByDefault as indexedByDefault, __webpack_exports__isDestructiveSchemaAction as isDestructiveSchemaAction, __webpack_exports__isIndexableFieldType as isIndexableFieldType, __webpack_exports__isLiveRowsIndex as isLiveRowsIndex, __webpack_exports__isPublished as isPublished, __webpack_exports__mapDatabaseError as mapDatabaseError, __webpack_exports__mapSchemaError as mapSchemaError, __webpack_exports__matchDefinitions as matchDefinitions, __webpack_exports__orderFlows as orderFlows, __webpack_exports__permissionCodes as permissionCodes, __webpack_exports__plainIndex as plainIndex, __webpack_exports__planTypeConversion as planTypeConversion, __webpack_exports__readBundleFile as readBundleFile, __webpack_exports__readBundleFiles as readBundleFiles, __webpack_exports__relationTargetCodes as relationTargetCodes, __webpack_exports__requestInfo as requestInfo, __webpack_exports__sameColumns as sameColumns, __webpack_exports__snapshotOf as snapshotOf, __webpack_exports__softDeleteColumn as softDeleteColumn, __webpack_exports__sqlTypeFor as sqlTypeFor, __webpack_exports__statementTimeoutSql as statementTimeoutSql, __webpack_exports__stripApiKeys as stripApiKeys, __webpack_exports__tableUnique as tableUnique, __webpack_exports__toFlowSettings as toFlowSettings, __webpack_exports__typeFamily as typeFamily, __webpack_exports__validateRecord as validateRecord, __webpack_exports__valueRulesOf as valueRulesOf, __webpack_exports__workingCopy as workingCopy, __webpack_exports__writtenSecrets as writtenSecrets };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type IFlowHttpResponse } from './flow-http.client.js';
|
|
2
|
+
export interface ICodeRunResult {
|
|
3
|
+
output: unknown;
|
|
4
|
+
logs: string[];
|
|
5
|
+
}
|
|
6
|
+
export interface ICodeHttpRequest {
|
|
7
|
+
url: string;
|
|
8
|
+
method: string;
|
|
9
|
+
headers: Record<string, string>;
|
|
10
|
+
body?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ICodeRunOptions {
|
|
13
|
+
modules?: Record<string, string>;
|
|
14
|
+
http?: (request: ICodeHttpRequest) => Promise<IFlowHttpResponse>;
|
|
15
|
+
}
|
|
16
|
+
export declare function runFlowCode(code: string, ctx: Record<string, unknown>, timeoutMs: number, node: string, options?: ICodeRunOptions): Promise<ICodeRunResult>;
|
|
@@ -14,6 +14,7 @@ export interface IFlowValidationContext {
|
|
|
14
14
|
knownFlows?: Map<string, ICallableFlow>;
|
|
15
15
|
messageServices?: Partial<Record<FlowMessageService, boolean>>;
|
|
16
16
|
companyMembers?: boolean;
|
|
17
|
+
codeModules?: string[];
|
|
17
18
|
}
|
|
18
19
|
export declare function usesPermissionFunction(value: unknown, depth?: number): boolean;
|
|
19
20
|
export declare function validateFlow(flow: IFlowSettings, context?: IFlowValidationContext): IFlowValidationResult;
|
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
import { type IFieldError } from '../services/field-value-validator.js';
|
|
2
|
-
import { type FlowBodyType, type FlowInput, type IFlowInputField } from './flow.types.js';
|
|
2
|
+
import { type FlowBodyType, type FlowInput, type IFlowEndpoint, type IFlowInputField } from './flow.types.js';
|
|
3
3
|
export interface IFlowInputResult {
|
|
4
4
|
values: FlowInput;
|
|
5
5
|
errors: IFieldError[];
|
|
6
6
|
}
|
|
7
7
|
export declare function validateFlowInput(schema: IFlowInputField[], body: unknown, bodyType?: FlowBodyType): IFlowInputResult;
|
|
8
|
+
export declare function validateEndpointInput(endpoint: Pick<IFlowEndpoint, 'contract' | 'bodyType' | 'inputSchema'>, body: unknown): IFlowInputResult;
|
|
9
|
+
export interface IRequestQuery {
|
|
10
|
+
filter?: Record<string, unknown>;
|
|
11
|
+
sort?: Record<string, 'ASC' | 'DESC'>;
|
|
12
|
+
pagination?: {
|
|
13
|
+
currentPage: number;
|
|
14
|
+
pageSize?: number;
|
|
15
|
+
};
|
|
16
|
+
select?: string[];
|
|
17
|
+
withDeleted?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function readRequestQuery(body: unknown): {
|
|
20
|
+
query: IRequestQuery;
|
|
21
|
+
errors: IFieldError[];
|
|
22
|
+
};
|
|
@@ -60,6 +60,9 @@ export interface IFlowRunState {
|
|
|
60
60
|
savedUpTo?: IFlowSavePoint;
|
|
61
61
|
callStack: string[];
|
|
62
62
|
pendingEvents: IPendingEvent[];
|
|
63
|
+
publisher?: {
|
|
64
|
+
chain: Promise<void>;
|
|
65
|
+
};
|
|
63
66
|
trace: IFlowTraceEntry[];
|
|
64
67
|
response?: {
|
|
65
68
|
status: number;
|
|
@@ -79,6 +82,7 @@ export interface IFlowEnv {
|
|
|
79
82
|
companyMembers?(companyId: string, branchIds?: string[]): Promise<string[]>;
|
|
80
83
|
assertPermissions(logic: ILogicNode, user: ILoggedUserInfo | null): Promise<void>;
|
|
81
84
|
allowPrivateHttp: boolean;
|
|
85
|
+
codeModules: Record<string, string>;
|
|
82
86
|
notifications?: INotificationAdapter;
|
|
83
87
|
email?: IEmailAdapter;
|
|
84
88
|
}
|
|
@@ -89,6 +93,16 @@ export interface IFlowEntityAccess {
|
|
|
89
93
|
}, user: ILoggedUserInfo | null, options?: IFlowWriteOptions): Promise<IGenericRecord>;
|
|
90
94
|
delete(id: string, user: ILoggedUserInfo | null, options?: IFlowWriteOptions): Promise<'deleted' | 'purged'>;
|
|
91
95
|
findById(id: string, options?: IFlowReadOptions): Promise<IGenericRecord>;
|
|
96
|
+
batchInsertable?: boolean;
|
|
97
|
+
prepareInsert?(dto: Record<string, unknown>): Record<string, unknown>;
|
|
98
|
+
firstMissingRelation?(rows: Record<string, unknown>[], queryRunner: QueryRunner): Promise<{
|
|
99
|
+
index: number;
|
|
100
|
+
error: Error;
|
|
101
|
+
} | null>;
|
|
102
|
+
updateLoaded?(row: IGenericRecord, dto: Record<string, unknown>, user: ILoggedUserInfo | null, options?: IFlowWriteOptions): Promise<IGenericRecord>;
|
|
103
|
+
insertValidated?(rows: Record<string, unknown>[], user: ILoggedUserInfo | null, options: IFlowWriteOptions & {
|
|
104
|
+
queryRunner: QueryRunner;
|
|
105
|
+
}): Promise<IGenericRecord[]>;
|
|
92
106
|
getAll(search: string | undefined, dto: {
|
|
93
107
|
filter?: Record<string, unknown>;
|
|
94
108
|
sort?: Record<string, 'ASC' | 'DESC'>;
|
|
@@ -96,6 +110,7 @@ export interface IFlowEntityAccess {
|
|
|
96
110
|
currentPage: number;
|
|
97
111
|
pageSize: number;
|
|
98
112
|
};
|
|
113
|
+
withDeleted?: boolean;
|
|
99
114
|
}, options?: IFlowReadOptions): Promise<{
|
|
100
115
|
data: IGenericRecord[];
|
|
101
116
|
total: number;
|
|
@@ -106,6 +121,7 @@ export interface IFlowReadOptions {
|
|
|
106
121
|
}
|
|
107
122
|
export interface IFlowWriteOptions extends IFlowReadOptions {
|
|
108
123
|
publishEvents?: boolean;
|
|
124
|
+
statementTimeoutMs?: number;
|
|
109
125
|
}
|
|
110
126
|
export interface INodeResult {
|
|
111
127
|
output?: unknown;
|
|
@@ -12,6 +12,10 @@ export type FlowRunMode = 'live' | 'dry_run';
|
|
|
12
12
|
export declare const FLOW_BODY_TYPES: readonly ["object", "list"];
|
|
13
13
|
export type FlowBodyType = (typeof FLOW_BODY_TYPES)[number];
|
|
14
14
|
export type FlowInput = Record<string, unknown> | unknown[];
|
|
15
|
+
export declare const FLOW_REQUEST_CONTRACTS: readonly ["custom", "get_all", "get_by_id", "get_by_ids", "get_by_filter", "insert", "insert_many", "update", "update_many", "bulk_upsert", "delete"];
|
|
16
|
+
export type FlowRequestContract = (typeof FLOW_REQUEST_CONTRACTS)[number];
|
|
17
|
+
export declare const FLOW_RESPONSE_FORMATS: readonly ["raw", "single", "list", "bulk", "message"];
|
|
18
|
+
export type FlowResponseFormat = (typeof FLOW_RESPONSE_FORMATS)[number];
|
|
15
19
|
export declare const FLOW_INPUT_TYPES: readonly ["string", "text", "number", "integer", "boolean", "date", "datetime", "email", "uuid", "object", "array", "choice"];
|
|
16
20
|
export type FlowInputType = (typeof FLOW_INPUT_TYPES)[number];
|
|
17
21
|
export type FlowInputItemType = Exclude<FlowInputType, 'array'>;
|
|
@@ -153,6 +157,7 @@ export interface IEntityGetConfig {
|
|
|
153
157
|
entityCode: string;
|
|
154
158
|
id: RuleExpression;
|
|
155
159
|
onNotFound?: 'error' | 'null';
|
|
160
|
+
fromRequest?: boolean;
|
|
156
161
|
}
|
|
157
162
|
export interface IFlowFilterCondition {
|
|
158
163
|
op: RecordFilterOp;
|
|
@@ -168,9 +173,11 @@ export interface IEntityQueryConfig {
|
|
|
168
173
|
direction: 'ASC' | 'DESC';
|
|
169
174
|
};
|
|
170
175
|
limit?: number;
|
|
176
|
+
fromRequest?: boolean;
|
|
171
177
|
}
|
|
172
178
|
export interface ITriggerConfig {
|
|
173
179
|
path?: string;
|
|
180
|
+
contract?: FlowRequestContract;
|
|
174
181
|
bodyType?: FlowBodyType;
|
|
175
182
|
inputSchema?: IFlowInputField[];
|
|
176
183
|
authMode?: FlowAuthMode;
|
|
@@ -250,8 +257,15 @@ export interface ISendEmailConfig {
|
|
|
250
257
|
}
|
|
251
258
|
export interface IRespondConfig {
|
|
252
259
|
statusCode: number;
|
|
260
|
+
format?: FlowResponseFormat;
|
|
261
|
+
message?: string;
|
|
262
|
+
messageKey?: string;
|
|
263
|
+
messageVariables?: ExpressionMap;
|
|
253
264
|
body?: ExpressionMap;
|
|
254
265
|
bodyExpression?: RuleExpression;
|
|
266
|
+
total?: RuleExpression;
|
|
267
|
+
page?: RuleExpression;
|
|
268
|
+
pageSize?: RuleExpression;
|
|
255
269
|
}
|
|
256
270
|
export interface ICodeConfig {
|
|
257
271
|
code: string;
|
|
@@ -274,6 +288,7 @@ export declare const FLOW_LIMITS: {
|
|
|
274
288
|
readonly MAX_EMAIL_TEMPLATE_SLUG_LENGTH: 255;
|
|
275
289
|
readonly MAX_HTTP_TIMEOUT_MS: 15000;
|
|
276
290
|
readonly MAX_HTTP_RESPONSE_BYTES: 1000000;
|
|
291
|
+
readonly DEFAULT_QUERY_LIMIT: 50;
|
|
277
292
|
readonly MAX_QUERY_LIMIT: 200;
|
|
278
293
|
readonly MAX_WRITE_ITEMS: 1000;
|
|
279
294
|
readonly DEFAULT_WRITE_FILTER_LIMIT: 100;
|
|
@@ -293,7 +308,6 @@ export declare const FLOW_LIMITS: {
|
|
|
293
308
|
readonly MIN_CODE_TIMEOUT_MS: 10;
|
|
294
309
|
readonly MAX_CODE_TIMEOUT_MS: 5000;
|
|
295
310
|
readonly CODE_MEMORY_LIMIT_BYTES: number;
|
|
296
|
-
readonly CODE_STACK_SIZE_BYTES: number;
|
|
297
311
|
readonly MAX_CODE_OUTPUT_BYTES: 1000000;
|
|
298
312
|
readonly MAX_CODE_LOG_LINES: 50;
|
|
299
313
|
readonly MAX_CODE_LOG_LINE_CHARS: 500;
|
|
@@ -306,6 +320,7 @@ export declare const FLOW_ID_PATTERN: RegExp;
|
|
|
306
320
|
export interface IFlowEndpoint {
|
|
307
321
|
nodeId: string;
|
|
308
322
|
path: string | null;
|
|
323
|
+
contract: FlowRequestContract;
|
|
309
324
|
bodyType: FlowBodyType;
|
|
310
325
|
inputSchema: IFlowInputField[];
|
|
311
326
|
authMode: FlowAuthMode;
|
|
@@ -315,6 +330,8 @@ export interface IFlowEndpoint {
|
|
|
315
330
|
rateLimitPerMinute: number;
|
|
316
331
|
apiKey: IStoredApiKey | null;
|
|
317
332
|
}
|
|
333
|
+
export declare function contractFields(contract: FlowRequestContract): IFlowInputField[];
|
|
334
|
+
export declare function triggerContract(config: Pick<ITriggerConfig, 'contract'>): FlowRequestContract;
|
|
318
335
|
type EndpointSource = Pick<IFlowSettings, 'nodes'>;
|
|
319
336
|
export declare const isFunctionFlow: (flow: EndpointSource) => boolean;
|
|
320
337
|
export declare function triggerPath(node: Pick<IFlowNode, 'config'>): string | null;
|
|
@@ -3,6 +3,7 @@ import { Reflector } from '@nestjs/core';
|
|
|
3
3
|
import { type Observable } from 'rxjs';
|
|
4
4
|
import { EntityBuilderConfigService } from '../services/entity-builder-config.service.js';
|
|
5
5
|
export declare const DesignerWrites: (...handlers: string[]) => import("@nestjs/common").CustomDecorator<string>;
|
|
6
|
+
export declare const DesignerAllowsRepair: () => import("@nestjs/common").CustomDecorator<string>;
|
|
6
7
|
export declare class DesignerWritableInterceptor implements NestInterceptor {
|
|
7
8
|
private readonly reflector;
|
|
8
9
|
private readonly config;
|
|
@@ -43,6 +43,7 @@ export interface IDefinitionBundle {
|
|
|
43
43
|
export interface IImportBundleRequest {
|
|
44
44
|
bundle: IDefinitionBundle;
|
|
45
45
|
deprecateMissingFields?: boolean;
|
|
46
|
+
deactivateMissingFlows?: boolean;
|
|
46
47
|
confirm?: boolean;
|
|
47
48
|
expectedChecksum?: string;
|
|
48
49
|
expectedPlanChecksum?: string;
|
|
@@ -52,7 +53,7 @@ export interface IBundleExport {
|
|
|
52
53
|
checksum: string;
|
|
53
54
|
warnings: IMessageRef[];
|
|
54
55
|
}
|
|
55
|
-
export type BundleStepKind = 'update_entity' | 'create_entity' | 'restore_field' | 'rename_field' | 'update_field' | 'add_field' | 'deprecate_field' | 'create_flow' | 'update_flow';
|
|
56
|
+
export type BundleStepKind = 'update_entity' | 'create_entity' | 'restore_field' | 'rename_field' | 'update_field' | 'add_field' | 'deprecate_field' | 'create_flow' | 'update_flow' | 'deactivate_flow';
|
|
56
57
|
export interface IBundleStep {
|
|
57
58
|
kind: BundleStepKind;
|
|
58
59
|
entityCode?: string;
|
|
@@ -86,6 +87,8 @@ export interface IBundleImportPlan {
|
|
|
86
87
|
export interface IBundleSettings {
|
|
87
88
|
readOnly: boolean;
|
|
88
89
|
variables: string[];
|
|
90
|
+
maxFiles: number;
|
|
91
|
+
maxBytes: number;
|
|
89
92
|
}
|
|
90
93
|
export interface IGeneratedApiKey {
|
|
91
94
|
flowSlug: string;
|
|
@@ -5,6 +5,9 @@ export interface IEntityBuilderConfig extends IDataSourceServiceOptions {
|
|
|
5
5
|
events?: IModuleEventsConfig;
|
|
6
6
|
flows?: {
|
|
7
7
|
allowPrivateHttp?: boolean;
|
|
8
|
+
code?: {
|
|
9
|
+
modules?: Record<string, string>;
|
|
10
|
+
};
|
|
8
11
|
};
|
|
9
12
|
bundles?: {
|
|
10
13
|
variables?: Record<string, string>;
|
|
@@ -12,9 +15,14 @@ export interface IEntityBuilderConfig extends IDataSourceServiceOptions {
|
|
|
12
15
|
designer?: {
|
|
13
16
|
readOnly?: boolean;
|
|
14
17
|
};
|
|
18
|
+
performance?: {
|
|
19
|
+
fastUpdates?: boolean;
|
|
20
|
+
partialIndexes?: boolean;
|
|
21
|
+
};
|
|
15
22
|
}
|
|
16
23
|
export interface EntityBuilderModuleOptions extends IDynamicModuleConfig {
|
|
17
24
|
bootstrapAppConfig?: IBootstrapAppConfig;
|
|
25
|
+
tenantScopedServices?: boolean;
|
|
18
26
|
config?: IEntityBuilderConfig;
|
|
19
27
|
providers?: Provider[];
|
|
20
28
|
}
|
|
@@ -23,6 +31,7 @@ export interface EntityBuilderOptionsFactory {
|
|
|
23
31
|
}
|
|
24
32
|
export interface EntityBuilderModuleAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
|
|
25
33
|
global?: boolean;
|
|
34
|
+
tenantScopedServices?: boolean;
|
|
26
35
|
includeController?: boolean;
|
|
27
36
|
bootstrapAppConfig?: IBootstrapAppConfig;
|
|
28
37
|
useFactory?: (...args: any[]) => Promise<IEntityBuilderConfig> | IEntityBuilderConfig;
|
|
@@ -5,6 +5,7 @@ export declare class EntityBuilderModule {
|
|
|
5
5
|
private static readonly EXPORTS;
|
|
6
6
|
static forRoot(options: EntityBuilderModuleOptions): DynamicModule;
|
|
7
7
|
static forRootAsync(options: EntityBuilderModuleAsyncOptions): DynamicModule;
|
|
8
|
+
private static tenantScoped;
|
|
8
9
|
private static buildProviders;
|
|
9
10
|
private static buildAsyncProviders;
|
|
10
11
|
}
|
package/modules/index.d.ts
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ContextId, type ContextIdResolver, type ContextIdStrategy } from '@nestjs/core';
|
|
2
|
+
export interface ITenantContextIdStrategyOptions {
|
|
3
|
+
tenants?: Iterable<string> | ((tenantId: string) => boolean);
|
|
4
|
+
maxTenants?: number;
|
|
5
|
+
}
|
|
6
|
+
type TenantRequest = {
|
|
7
|
+
headers?: Record<string, unknown>;
|
|
8
|
+
};
|
|
9
|
+
export declare class TenantContextIdStrategy implements ContextIdStrategy<TenantRequest> {
|
|
10
|
+
private readonly tenantContexts;
|
|
11
|
+
private readonly isTenant;
|
|
12
|
+
private readonly maxTenants;
|
|
13
|
+
constructor(options?: ITenantContextIdStrategyOptions);
|
|
14
|
+
attach(contextId: ContextId, request: TenantRequest): ContextIdResolver | undefined;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flusys/nestjs-entity-builder",
|
|
3
|
-
"version": "9.1
|
|
3
|
+
"version": "9.2.1",
|
|
4
4
|
"description": "Dynamic entity builder module - runtime entity/field metadata, driven DDL, and generic CRUD",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./fesm/index.js",
|
|
@@ -85,8 +85,7 @@
|
|
|
85
85
|
"rxjs": "^7.8.0"
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
|
-
"@flusys/nestjs-core": "9.1
|
|
89
|
-
"@flusys/nestjs-shared": "9.1
|
|
90
|
-
"quickjs-emscripten": "^0.32.0"
|
|
88
|
+
"@flusys/nestjs-core": "9.2.1",
|
|
89
|
+
"@flusys/nestjs-shared": "9.2.1"
|
|
91
90
|
}
|
|
92
91
|
}
|
|
@@ -16,6 +16,12 @@ export declare function applyVariables(nodes: IFlowNode[], variables: Record<str
|
|
|
16
16
|
nodes: IFlowNode[];
|
|
17
17
|
missing: string[];
|
|
18
18
|
};
|
|
19
|
+
export declare function fixedIds(nodes: IFlowNode[]): string[];
|
|
20
|
+
export declare function permissionCodes(flow: Pick<IBundleFlow, 'slug' | 'nodes'>): string[];
|
|
21
|
+
export declare function writtenSecrets(nodes: IFlowNode[]): Array<{
|
|
22
|
+
step: string;
|
|
23
|
+
name: string;
|
|
24
|
+
}>;
|
|
19
25
|
export declare function calledFlowSlugs(nodes: IFlowNode[]): string[];
|
|
20
26
|
export declare function orderFlows(flows: IBundleFlow[]): IBundleFlow[];
|
|
21
27
|
export interface ICurrentEntity {
|
|
@@ -48,8 +54,6 @@ export interface IEntityDiff {
|
|
|
48
54
|
extras: IBundleExtra[];
|
|
49
55
|
blockers: IMessageRef[];
|
|
50
56
|
}
|
|
51
|
-
export declare const FIELD_COMPARED_KEYS: readonly ["label", "fieldType", "nullable", "unique", "isIndexed", "defaultValue", "validationRules", "selectOptions", "relationTarget", "order", "uiConfig", "isSearchable"];
|
|
52
|
-
export declare const ENTITY_COMPARED_KEYS: readonly ["label", "description", "uiConfig", "isSoftDeleteEnabled", "isAuditEnabled", "status"];
|
|
53
57
|
export declare function matchDefinitions<B extends {
|
|
54
58
|
id: string;
|
|
55
59
|
code: string;
|
|
@@ -4,4 +4,5 @@ export interface IUploadedBundleFile {
|
|
|
4
4
|
size: number;
|
|
5
5
|
originalname?: string;
|
|
6
6
|
}
|
|
7
|
-
export declare function readBundleFile(file: IUploadedBundleFile | undefined): IDefinitionBundle;
|
|
7
|
+
export declare function readBundleFile(file: IUploadedBundleFile | undefined, source?: string): IDefinitionBundle;
|
|
8
|
+
export declare function readBundleFiles(files: IUploadedBundleFile[] | undefined): IDefinitionBundle;
|