@flusys/nestjs-entity-builder 9.1.0 → 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 -25
- package/config/entity-builder.constants.d.ts +2 -0
- package/config/message-keys.d.ts +93 -12
- package/controllers/definition-bundle.controller.d.ts +15 -0
- package/controllers/flow-definition.controller.d.ts +7 -1
- package/controllers/index.d.ts +1 -1
- package/dtos/definition-bundle.dto.d.ts +57 -0
- package/dtos/flow.dto.d.ts +12 -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 +96 -14
- package/fesm/458.js +695 -0
- package/fesm/{489.js → 582.js} +22 -30
- package/fesm/{996.js → 677.js} +1453 -1078
- package/fesm/794.js +135 -240
- package/fesm/{719.js → 870.js} +1955 -220
- package/fesm/{362.js → 897.js} +566 -2
- package/fesm/{606.js → 946.js} +564 -290
- 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 +101 -22
- package/fesm/index.js +429 -948
- package/fesm/interfaces/index.js +19 -2
- package/fesm/modules/index.js +10 -628
- package/fesm/rule-engine/index.js +12 -3
- package/fesm/services/index.js +97 -27
- package/flow-engine/flow-api-key.d.ts +3 -7
- package/flow-engine/flow-graph.validator.d.ts +4 -2
- package/flow-engine/flow-permission-logic.d.ts +2 -0
- package/flow-engine/flow-run.types.d.ts +17 -8
- package/flow-engine/flow.types.d.ts +101 -13
- 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 +1 -1
- package/services/flow-definition.service.d.ts +25 -12
- package/services/flow-execution.service.d.ts +7 -0
- package/services/flow-executor.service.d.ts +8 -8
- 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 +5 -1
- 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/services/index.js
CHANGED
|
@@ -6,16 +6,17 @@ export const __webpack_modules__ = {
|
|
|
6
6
|
// EXPORTS
|
|
7
7
|
__webpack_require__.d(__webpack_exports__, {
|
|
8
8
|
zb: () => (/* reexport */ generic_entity_service/* .ACTOR_BRANCH_METADATA_KEY */.zb),
|
|
9
|
-
Ty: () => (/* reexport */ (/* inlined export .BULK_MAX_ITEMS */200)),
|
|
10
9
|
Fz: () => (/* reexport */ (/* inlined export .DRAFT_TEST_RETAIN */200)),
|
|
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),
|
|
12
13
|
IP: () => (/* reexport */ entity_flow_scaffold/* .ENTITY_FLOW_PATHS */.IP),
|
|
13
14
|
E: () => (/* reexport */ entity_builder_config_service/* .EntityBuilderConfigService */.E),
|
|
14
15
|
DR: () => (/* reexport */ entity_builder_datasource_provider/* .EntityBuilderDataSourceProvider */.D),
|
|
15
16
|
oc: () => (/* reexport */ entity_definition_service/* .EntityDefinitionService */.o),
|
|
16
17
|
u4: () => (/* reexport */ entity_permission_service/* .EntityPermissionService */.u),
|
|
18
|
+
mT: () => (/* reexport */ definition_bundle_diff/* .FIELD_COMPARED_KEYS */.mT),
|
|
17
19
|
J: () => (/* reexport */ field_definition_service/* .FieldDefinitionService */.J),
|
|
18
|
-
Td: () => (/* reexport */ flow_api_key_service/* .FlowApiKeyService */.T),
|
|
19
20
|
Tk: () => (/* reexport */ flow_definition_service/* .FlowDefinitionService */.Tk),
|
|
20
21
|
AJ: () => (/* reexport */ flow_execution_service/* .FlowExecutionService */.A),
|
|
21
22
|
FT: () => (/* reexport */ flow_executor_service/* .FlowExecutorService */.F),
|
|
@@ -34,34 +35,50 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
34
35
|
WQ: () => (/* reexport */ schema_sync_service/* .SchemaSyncService */.W),
|
|
35
36
|
DG: () => (/* reexport */ generic_entity_service/* .actorMetadata */.DG),
|
|
36
37
|
$6: () => (/* reexport */ schema_columns/* .addUnique */.$6),
|
|
38
|
+
gT: () => (/* reexport */ definition_bundle_diff/* .applyVariables */.gT),
|
|
37
39
|
fY: () => (/* reexport */ identifier_rules/* .assertIndexableField */.fY),
|
|
38
40
|
kV: () => (/* reexport */ identifier_rules/* .assertValidIdentifier */.kV),
|
|
39
41
|
HK: () => (/* reexport */ schema_columns/* .auditColumns */.HK),
|
|
40
42
|
CO: () => (/* reexport */ entity_flow_scaffold/* .buildEntityFlow */.CO),
|
|
41
43
|
fu: () => (/* reexport */ schema_columns/* .buildFieldColumn */.fu),
|
|
42
44
|
Rm: () => (/* reexport */ schema_columns/* .buildSystemColumns */.Rm),
|
|
45
|
+
i9: () => (/* reexport */ definition_bundle_diff/* .bundleChecksum */.i9),
|
|
46
|
+
bs: () => (/* reexport */ definition_bundle_diff/* .bundleSubject */.bs),
|
|
47
|
+
VU: () => (/* reexport */ definition_bundle_diff/* .byCode */.VU),
|
|
48
|
+
Q5: () => (/* reexport */ definition_bundle_diff/* .calledFlowSlugs */.Q5),
|
|
49
|
+
dj: () => (/* reexport */ definition_bundle_diff/* .canonicalJson */.dj),
|
|
43
50
|
Er: () => (/* reexport */ flow_definition_service/* .defaultFlowPermissionCode */.Er),
|
|
44
51
|
an: () => (/* reexport */ schema_change_types/* .describeImpact */.a),
|
|
52
|
+
Sy: () => (/* reexport */ definition_bundle_diff/* .diffEntities */.zb),
|
|
45
53
|
x2: () => (/* reexport */ entity_flow_scaffold/* .entityFlowSlug */.x2),
|
|
54
|
+
lj: () => (/* reexport */ definition_bundle_diff/* .extractVariables */.lj),
|
|
46
55
|
HQ: () => (/* reexport */ schema_dialect_adapter_service/* .fitIdentifier */.H),
|
|
47
56
|
YW: () => (/* reexport */ flow_definition_service/* .flowNotFound */.YW),
|
|
57
|
+
j4: () => (/* reexport */ flow_definition_service/* .flowPermissions */.j4),
|
|
48
58
|
gl: () => (/* reexport */ flow_executor_service/* .flowTimeout */.g),
|
|
49
59
|
mo: () => (/* reexport */ schema_columns/* .indexName */.mo),
|
|
50
60
|
C5: () => (/* reexport */ schema_evolution_service/* .isDestructiveSchemaAction */.C),
|
|
51
61
|
d4: () => (/* reexport */ schema_columns/* .isIndexableFieldType */.d4),
|
|
62
|
+
HF: () => (/* reexport */ flow_definition_service/* .isPublished */.HF),
|
|
52
63
|
Eq: () => (/* reexport */ database_error_mapper/* .mapDatabaseError */.E),
|
|
53
64
|
iw: () => (/* reexport */ database_error_mapper/* .mapSchemaError */.i),
|
|
65
|
+
Og: () => (/* reexport */ definition_bundle_diff/* .matchDefinitions */.Og),
|
|
66
|
+
qG: () => (/* reexport */ definition_bundle_diff/* .orderFlows */.qG),
|
|
54
67
|
v7: () => (/* reexport */ schema_columns/* .plainIndex */.v7),
|
|
55
68
|
IM: () => (/* reexport */ field_type_conversion/* .planTypeConversion */.I),
|
|
69
|
+
zi: () => (/* reexport */ definition_bundle_file/* .readBundleFile */.z),
|
|
56
70
|
e1: () => (/* reexport */ schema_change_executor_service/* .relationTargetCodes */.e),
|
|
57
71
|
Sd: () => (/* reexport */ flow_runtime_service/* .requestInfo */.S),
|
|
58
72
|
G7: () => (/* reexport */ schema_columns/* .sameColumns */.G7),
|
|
73
|
+
eY: () => (/* reexport */ flow_definition_service/* .snapshotOf */.eY),
|
|
59
74
|
OG: () => (/* reexport */ schema_columns/* .softDeleteColumn */.OG),
|
|
60
75
|
cg: () => (/* reexport */ schema_columns/* .sqlTypeFor */.cg),
|
|
76
|
+
dX: () => (/* reexport */ definition_bundle_diff/* .stripApiKeys */.dX),
|
|
61
77
|
uy: () => (/* reexport */ schema_columns/* .tableUnique */.uy),
|
|
62
78
|
RK: () => (/* reexport */ flow_definition_service/* .toFlowSettings */.RK),
|
|
63
79
|
jp: () => (/* reexport */ schema_columns/* .typeFamily */.jp),
|
|
64
|
-
eV: () => (/* reexport */ field_value_validator/* .validateRecord */.e)
|
|
80
|
+
eV: () => (/* reexport */ field_value_validator/* .validateRecord */.e),
|
|
81
|
+
lw: () => (/* reexport */ flow_definition_service/* .workingCopy */.lw)
|
|
65
82
|
});
|
|
66
83
|
|
|
67
84
|
// EXTERNAL MODULE: ./projects/nestjs-entity-builder/src/services/entity-builder-config.service.ts
|
|
@@ -106,12 +123,10 @@ var field_value_validator = __webpack_require__(3525);
|
|
|
106
123
|
var database_error_mapper = __webpack_require__(8323);
|
|
107
124
|
// EXTERNAL MODULE: ./projects/nestjs-entity-builder/src/services/flow-definition.service.ts
|
|
108
125
|
var flow_definition_service = __webpack_require__(5229);
|
|
109
|
-
// EXTERNAL MODULE: ./projects/nestjs-entity-builder/src/services/flow-api-key.service.ts + 1 modules
|
|
110
|
-
var flow_api_key_service = __webpack_require__(8888);
|
|
111
126
|
// EXTERNAL MODULE: ./projects/nestjs-entity-builder/src/services/flow-execution.service.ts
|
|
112
127
|
var flow_execution_service = __webpack_require__(7810);
|
|
113
|
-
// EXTERNAL MODULE: ./projects/nestjs-entity-builder/src/services/flow-executor.service.ts +
|
|
114
|
-
var flow_executor_service = __webpack_require__(
|
|
128
|
+
// EXTERNAL MODULE: ./projects/nestjs-entity-builder/src/services/flow-executor.service.ts + 6 modules
|
|
129
|
+
var flow_executor_service = __webpack_require__(3908);
|
|
115
130
|
// EXTERNAL MODULE: ./projects/nestjs-entity-builder/src/services/flow-runtime.service.ts
|
|
116
131
|
var flow_runtime_service = __webpack_require__(2300);
|
|
117
132
|
// EXTERNAL MODULE: external "@flusys/nestjs-shared/utils"
|
|
@@ -124,6 +139,8 @@ var external_typeorm_ = __webpack_require__(7158);
|
|
|
124
139
|
var message_keys = __webpack_require__(5732);
|
|
125
140
|
// EXTERNAL MODULE: ./projects/nestjs-entity-builder/src/entities/flow-definition.entity.ts
|
|
126
141
|
var flow_definition_entity = __webpack_require__(3770);
|
|
142
|
+
// EXTERNAL MODULE: ./projects/nestjs-entity-builder/src/entities/flow-version.entity.ts
|
|
143
|
+
var flow_version_entity = __webpack_require__(2399);
|
|
127
144
|
;// CONCATENATED MODULE: ./projects/nestjs-entity-builder/src/services/reference-rewrite.ts
|
|
128
145
|
/** Pure JSON string helpers for finding and rewriting `<prefix>.<field>` references inside definitions. */ function mapStrings(value, fn) {
|
|
129
146
|
if (typeof value === 'string') return fn(value);
|
|
@@ -325,23 +342,24 @@ function _ts_param(paramIndex, decorator) {
|
|
|
325
342
|
|
|
326
343
|
|
|
327
344
|
|
|
345
|
+
|
|
328
346
|
class FlowReferenceProvider {
|
|
329
347
|
provider;
|
|
330
348
|
constructor(provider){
|
|
331
349
|
this.provider = provider;
|
|
332
350
|
}
|
|
333
|
-
async flows(
|
|
334
|
-
return (await this.repo(
|
|
351
|
+
async flows() {
|
|
352
|
+
return (await this.repo(flow_definition_entity/* .FlowDefinition */.G)).find({
|
|
335
353
|
where: {
|
|
336
354
|
deletedAt: (0,external_typeorm_.IsNull)()
|
|
337
355
|
}
|
|
338
356
|
});
|
|
339
357
|
}
|
|
340
|
-
async repo(manager) {
|
|
341
|
-
return manager ? manager.getRepository(
|
|
358
|
+
async repo(entity, manager) {
|
|
359
|
+
return manager ? manager.getRepository(entity) : this.provider.getRepository(entity);
|
|
342
360
|
}
|
|
343
361
|
async findEntityReferences(entityCode) {
|
|
344
|
-
return (await this.flows()).filter((f)=>flowUsesEntity(f.nodes, entityCode)).map((f)=>({
|
|
362
|
+
return (await this.flows()).filter((f)=>flowUsesEntity(f.nodes, entityCode) || !!f.draft && flowUsesEntity(f.draft.nodes, entityCode)).map((f)=>({
|
|
345
363
|
kind: 'flow',
|
|
346
364
|
id: f.id,
|
|
347
365
|
name: f.name,
|
|
@@ -351,7 +369,7 @@ class FlowReferenceProvider {
|
|
|
351
369
|
}));
|
|
352
370
|
}
|
|
353
371
|
async findFieldReferences(entityCode, fieldCode) {
|
|
354
|
-
return (await this.flows()).filter((f)=>flowRefersToField(f.nodes, entityCode, fieldCode)).map((f)=>({
|
|
372
|
+
return (await this.flows()).filter((f)=>flowRefersToField(f.nodes, entityCode, fieldCode) || !!f.draft && flowRefersToField(f.draft.nodes, entityCode, fieldCode)).map((f)=>({
|
|
355
373
|
kind: 'flow',
|
|
356
374
|
id: f.id,
|
|
357
375
|
name: f.name,
|
|
@@ -363,15 +381,42 @@ class FlowReferenceProvider {
|
|
|
363
381
|
}
|
|
364
382
|
async rewriteFieldReferences(entityCode, from, to, manager) {
|
|
365
383
|
let count = 0;
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
384
|
+
const flows = await this.repo(flow_definition_entity/* .FlowDefinition */.G, manager);
|
|
385
|
+
// Deleted flows too: one restored later must not bring the old field name back.
|
|
386
|
+
for (const flow of (await flows.find({
|
|
387
|
+
withDeleted: true
|
|
388
|
+
}))){
|
|
389
|
+
// The published flow and its unpublished draft both keep working after the rename.
|
|
390
|
+
const live = rewriteFlowField(flow.nodes, entityCode, from, to);
|
|
391
|
+
const draft = flow.draft ? rewriteFlowField(flow.draft.nodes, entityCode, from, to) : null;
|
|
392
|
+
if (!live.changed && !draft?.changed) continue;
|
|
393
|
+
await flows.update(flow.id, {
|
|
394
|
+
nodes: live.nodes,
|
|
395
|
+
...draft?.changed ? {
|
|
396
|
+
draft: {
|
|
397
|
+
...flow.draft,
|
|
398
|
+
nodes: draft.nodes
|
|
399
|
+
}
|
|
400
|
+
} : {}
|
|
372
401
|
});
|
|
373
402
|
count++;
|
|
374
403
|
}
|
|
404
|
+
// A version restored later must not bring the old field name back.
|
|
405
|
+
const versions = await this.repo(flow_version_entity/* .FlowVersion */.p, manager);
|
|
406
|
+
for (const version of (await versions.find({
|
|
407
|
+
select: {
|
|
408
|
+
id: true,
|
|
409
|
+
definition: true
|
|
410
|
+
}
|
|
411
|
+
}))){
|
|
412
|
+
const { nodes, changed } = rewriteFlowField(version.definition.nodes, entityCode, from, to);
|
|
413
|
+
if (changed) await versions.update(version.id, {
|
|
414
|
+
definition: {
|
|
415
|
+
...version.definition,
|
|
416
|
+
nodes
|
|
417
|
+
}
|
|
418
|
+
});
|
|
419
|
+
}
|
|
375
420
|
return count;
|
|
376
421
|
}
|
|
377
422
|
}
|
|
@@ -388,6 +433,12 @@ FlowReferenceProvider = _ts_decorate([
|
|
|
388
433
|
|
|
389
434
|
// EXTERNAL MODULE: ./projects/nestjs-entity-builder/src/services/entity-flow-scaffold.ts
|
|
390
435
|
var entity_flow_scaffold = __webpack_require__(8271);
|
|
436
|
+
// EXTERNAL MODULE: ./projects/nestjs-entity-builder/src/services/definition-bundle.diff.ts
|
|
437
|
+
var definition_bundle_diff = __webpack_require__(3801);
|
|
438
|
+
// EXTERNAL MODULE: ./projects/nestjs-entity-builder/src/services/definition-bundle.file.ts
|
|
439
|
+
var definition_bundle_file = __webpack_require__(6412);
|
|
440
|
+
// EXTERNAL MODULE: ./projects/nestjs-entity-builder/src/services/definition-bundle.service.ts
|
|
441
|
+
var definition_bundle_service = __webpack_require__(7463);
|
|
391
442
|
;// CONCATENATED MODULE: ./projects/nestjs-entity-builder/src/services/index.ts
|
|
392
443
|
|
|
393
444
|
|
|
@@ -415,6 +466,8 @@ var entity_flow_scaffold = __webpack_require__(8271);
|
|
|
415
466
|
|
|
416
467
|
|
|
417
468
|
|
|
469
|
+
|
|
470
|
+
|
|
418
471
|
|
|
419
472
|
|
|
420
473
|
|
|
@@ -425,29 +478,30 @@ import { __webpack_require__ } from '../runtime.js';
|
|
|
425
478
|
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
|
|
426
479
|
import * as __rspack_chunk_1 from '../21.js';
|
|
427
480
|
__webpack_require__.C(__rspack_chunk_1);
|
|
428
|
-
import * as __rspack_chunk_2 from '../
|
|
481
|
+
import * as __rspack_chunk_2 from '../897.js';
|
|
429
482
|
__webpack_require__.C(__rspack_chunk_2);
|
|
430
|
-
import * as __rspack_chunk_3 from '../
|
|
483
|
+
import * as __rspack_chunk_3 from '../582.js';
|
|
431
484
|
__webpack_require__.C(__rspack_chunk_3);
|
|
432
|
-
import * as __rspack_chunk_4 from '../
|
|
485
|
+
import * as __rspack_chunk_4 from '../794.js';
|
|
433
486
|
__webpack_require__.C(__rspack_chunk_4);
|
|
434
|
-
import * as __rspack_chunk_5 from '../
|
|
487
|
+
import * as __rspack_chunk_5 from '../677.js';
|
|
435
488
|
__webpack_require__.C(__rspack_chunk_5);
|
|
436
|
-
import * as __rspack_chunk_6 from '../
|
|
489
|
+
import * as __rspack_chunk_6 from '../870.js';
|
|
437
490
|
__webpack_require__.C(__rspack_chunk_6);
|
|
438
491
|
import * as __rspack_chunk_7 from './index.js';
|
|
439
492
|
__webpack_require__.C(__rspack_chunk_7);
|
|
440
493
|
var __webpack_exports__ = __webpack_exec__(8752);var __webpack_exports__ACTOR_BRANCH_METADATA_KEY = __webpack_exports__.zb;
|
|
441
|
-
var __webpack_exports__BULK_MAX_ITEMS = __webpack_exports__.Ty;
|
|
442
494
|
var __webpack_exports__DRAFT_TEST_RETAIN = __webpack_exports__.Fz;
|
|
495
|
+
var __webpack_exports__DefinitionBundleService = __webpack_exports__.P0;
|
|
443
496
|
var __webpack_exports__DefinitionCacheService = __webpack_exports__.Vo;
|
|
497
|
+
var __webpack_exports__ENTITY_COMPARED_KEYS = __webpack_exports__.$I;
|
|
444
498
|
var __webpack_exports__ENTITY_FLOW_PATHS = __webpack_exports__.IP;
|
|
445
499
|
var __webpack_exports__EntityBuilderConfigService = __webpack_exports__.E;
|
|
446
500
|
var __webpack_exports__EntityBuilderDataSourceProvider = __webpack_exports__.DR;
|
|
447
501
|
var __webpack_exports__EntityDefinitionService = __webpack_exports__.oc;
|
|
448
502
|
var __webpack_exports__EntityPermissionService = __webpack_exports__.u4;
|
|
503
|
+
var __webpack_exports__FIELD_COMPARED_KEYS = __webpack_exports__.mT;
|
|
449
504
|
var __webpack_exports__FieldDefinitionService = __webpack_exports__.J;
|
|
450
|
-
var __webpack_exports__FlowApiKeyService = __webpack_exports__.Td;
|
|
451
505
|
var __webpack_exports__FlowDefinitionService = __webpack_exports__.Tk;
|
|
452
506
|
var __webpack_exports__FlowExecutionService = __webpack_exports__.AJ;
|
|
453
507
|
var __webpack_exports__FlowExecutorService = __webpack_exports__.FT;
|
|
@@ -466,32 +520,48 @@ var __webpack_exports__SchemaRegistryService = __webpack_exports__.Cy;
|
|
|
466
520
|
var __webpack_exports__SchemaSyncService = __webpack_exports__.WQ;
|
|
467
521
|
var __webpack_exports__actorMetadata = __webpack_exports__.DG;
|
|
468
522
|
var __webpack_exports__addUnique = __webpack_exports__.$6;
|
|
523
|
+
var __webpack_exports__applyVariables = __webpack_exports__.gT;
|
|
469
524
|
var __webpack_exports__assertIndexableField = __webpack_exports__.fY;
|
|
470
525
|
var __webpack_exports__assertValidIdentifier = __webpack_exports__.kV;
|
|
471
526
|
var __webpack_exports__auditColumns = __webpack_exports__.HK;
|
|
472
527
|
var __webpack_exports__buildEntityFlow = __webpack_exports__.CO;
|
|
473
528
|
var __webpack_exports__buildFieldColumn = __webpack_exports__.fu;
|
|
474
529
|
var __webpack_exports__buildSystemColumns = __webpack_exports__.Rm;
|
|
530
|
+
var __webpack_exports__bundleChecksum = __webpack_exports__.i9;
|
|
531
|
+
var __webpack_exports__bundleSubject = __webpack_exports__.bs;
|
|
532
|
+
var __webpack_exports__byCode = __webpack_exports__.VU;
|
|
533
|
+
var __webpack_exports__calledFlowSlugs = __webpack_exports__.Q5;
|
|
534
|
+
var __webpack_exports__canonicalJson = __webpack_exports__.dj;
|
|
475
535
|
var __webpack_exports__defaultFlowPermissionCode = __webpack_exports__.Er;
|
|
476
536
|
var __webpack_exports__describeImpact = __webpack_exports__.an;
|
|
537
|
+
var __webpack_exports__diffEntities = __webpack_exports__.Sy;
|
|
477
538
|
var __webpack_exports__entityFlowSlug = __webpack_exports__.x2;
|
|
539
|
+
var __webpack_exports__extractVariables = __webpack_exports__.lj;
|
|
478
540
|
var __webpack_exports__fitIdentifier = __webpack_exports__.HQ;
|
|
479
541
|
var __webpack_exports__flowNotFound = __webpack_exports__.YW;
|
|
542
|
+
var __webpack_exports__flowPermissions = __webpack_exports__.j4;
|
|
480
543
|
var __webpack_exports__flowTimeout = __webpack_exports__.gl;
|
|
481
544
|
var __webpack_exports__indexName = __webpack_exports__.mo;
|
|
482
545
|
var __webpack_exports__isDestructiveSchemaAction = __webpack_exports__.C5;
|
|
483
546
|
var __webpack_exports__isIndexableFieldType = __webpack_exports__.d4;
|
|
547
|
+
var __webpack_exports__isPublished = __webpack_exports__.HF;
|
|
484
548
|
var __webpack_exports__mapDatabaseError = __webpack_exports__.Eq;
|
|
485
549
|
var __webpack_exports__mapSchemaError = __webpack_exports__.iw;
|
|
550
|
+
var __webpack_exports__matchDefinitions = __webpack_exports__.Og;
|
|
551
|
+
var __webpack_exports__orderFlows = __webpack_exports__.qG;
|
|
486
552
|
var __webpack_exports__plainIndex = __webpack_exports__.v7;
|
|
487
553
|
var __webpack_exports__planTypeConversion = __webpack_exports__.IM;
|
|
554
|
+
var __webpack_exports__readBundleFile = __webpack_exports__.zi;
|
|
488
555
|
var __webpack_exports__relationTargetCodes = __webpack_exports__.e1;
|
|
489
556
|
var __webpack_exports__requestInfo = __webpack_exports__.Sd;
|
|
490
557
|
var __webpack_exports__sameColumns = __webpack_exports__.G7;
|
|
558
|
+
var __webpack_exports__snapshotOf = __webpack_exports__.eY;
|
|
491
559
|
var __webpack_exports__softDeleteColumn = __webpack_exports__.OG;
|
|
492
560
|
var __webpack_exports__sqlTypeFor = __webpack_exports__.cg;
|
|
561
|
+
var __webpack_exports__stripApiKeys = __webpack_exports__.dX;
|
|
493
562
|
var __webpack_exports__tableUnique = __webpack_exports__.uy;
|
|
494
563
|
var __webpack_exports__toFlowSettings = __webpack_exports__.RK;
|
|
495
564
|
var __webpack_exports__typeFamily = __webpack_exports__.jp;
|
|
496
565
|
var __webpack_exports__validateRecord = __webpack_exports__.eV;
|
|
497
|
-
|
|
566
|
+
var __webpack_exports__workingCopy = __webpack_exports__.lw;
|
|
567
|
+
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_COMPARED_KEYS as ENTITY_COMPARED_KEYS, __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__FIELD_COMPARED_KEYS as FIELD_COMPARED_KEYS, __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__NON_INDEXABLE_FIELD_TYPES as NON_INDEXABLE_FIELD_TYPES, __webpack_exports__RESERVED_WORDS as RESERVED_WORDS, __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__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__extractVariables as extractVariables, __webpack_exports__fitIdentifier as fitIdentifier, __webpack_exports__flowNotFound as flowNotFound, __webpack_exports__flowPermissions as flowPermissions, __webpack_exports__flowTimeout as flowTimeout, __webpack_exports__indexName as indexName, __webpack_exports__isDestructiveSchemaAction as isDestructiveSchemaAction, __webpack_exports__isIndexableFieldType as isIndexableFieldType, __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__plainIndex as plainIndex, __webpack_exports__planTypeConversion as planTypeConversion, __webpack_exports__readBundleFile as readBundleFile, __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__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__workingCopy as workingCopy };
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function generateApiKey(): {
|
|
3
|
-
key: string;
|
|
4
|
-
prefix: string;
|
|
5
|
-
hash: string;
|
|
6
|
-
};
|
|
1
|
+
import { type IFlowNode, type IStoredApiKey } from './flow.types.js';
|
|
7
2
|
export declare const hashApiKey: (key: string) => string;
|
|
8
3
|
export declare const apiKeyPrefix: (key: string) => string;
|
|
9
4
|
export declare function looksLikeApiKey(key: unknown): key is string;
|
|
10
|
-
export declare
|
|
5
|
+
export declare const apiKeyOpens: (stored: IStoredApiKey | null, presented: unknown) => boolean;
|
|
6
|
+
export declare function sealApiKeys(nodes: IFlowNode[]): IFlowNode[];
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import { type IMessageRef } from '@flusys/nestjs-shared/interfaces';
|
|
2
|
-
import { type
|
|
2
|
+
import { type FlowMessageService, type IFlowEndpoint, type IFlowSettings } from './flow.types.js';
|
|
3
3
|
export interface IFlowValidationResult {
|
|
4
4
|
errors: IMessageRef[];
|
|
5
5
|
warnings: IMessageRef[];
|
|
6
6
|
}
|
|
7
7
|
export interface ICallableFlow {
|
|
8
8
|
isActive: boolean;
|
|
9
|
-
authMode: FlowAuthMode;
|
|
10
9
|
endpoints: Array<Omit<IFlowEndpoint, 'nodeId'>>;
|
|
11
10
|
calls: string[];
|
|
12
11
|
}
|
|
13
12
|
export interface IFlowValidationContext {
|
|
14
13
|
knownEntityCodes?: Set<string>;
|
|
15
14
|
knownFlows?: Map<string, ICallableFlow>;
|
|
15
|
+
messageServices?: Partial<Record<FlowMessageService, boolean>>;
|
|
16
|
+
companyMembers?: boolean;
|
|
16
17
|
}
|
|
17
18
|
export declare function usesPermissionFunction(value: unknown, depth?: number): boolean;
|
|
18
19
|
export declare function validateFlow(flow: IFlowSettings, context?: IFlowValidationContext): IFlowValidationResult;
|
|
20
|
+
export declare function callProblems(caller: IFlowSettings, slug: string, known: Map<string, ICallableFlow>): IMessageRef[];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type ILoggedUserInfo, type IMessageRef } from '@flusys/nestjs-shared/interfaces';
|
|
1
|
+
import { type IEmailAdapter, type ILogicNode, type ILoggedUserInfo, type IMessageRef, type INotificationAdapter, type IUserCompanyAccess } from '@flusys/nestjs-shared/interfaces';
|
|
2
2
|
import { type QueryRunner } from 'typeorm';
|
|
3
3
|
import { type IGenericRecord } from '../interfaces/generic-record.interface.js';
|
|
4
4
|
import { type IRulePermissionResolver, type RuleEngineService, type RuleExpression } from '../rule-engine/index.js';
|
|
5
5
|
import { type IFlowHttpRequest, type IFlowHttpResponse } from './flow-http.client.js';
|
|
6
|
-
import { type FlowInput, type
|
|
6
|
+
import { type FlowInput, type FlowRunMode } from './flow.types.js';
|
|
7
7
|
export interface IFlowTraceEntry {
|
|
8
8
|
nodeId: string;
|
|
9
9
|
name: string;
|
|
@@ -17,14 +17,18 @@ export interface IFlowTraceEntry {
|
|
|
17
17
|
}
|
|
18
18
|
export interface IPendingRecordEvent {
|
|
19
19
|
entityCode: string;
|
|
20
|
-
action: 'created' | 'updated' | 'deleted';
|
|
20
|
+
action: 'created' | 'updated' | 'deleted' | 'purged';
|
|
21
21
|
row: IGenericRecord;
|
|
22
22
|
}
|
|
23
23
|
export interface IPendingFlowEvent {
|
|
24
24
|
eventName: string;
|
|
25
25
|
payload: Record<string, unknown>;
|
|
26
26
|
}
|
|
27
|
-
export
|
|
27
|
+
export interface IPendingDelivery {
|
|
28
|
+
delivery: string;
|
|
29
|
+
send: () => Promise<void>;
|
|
30
|
+
}
|
|
31
|
+
export type IPendingEvent = IPendingRecordEvent | IPendingFlowEvent | IPendingDelivery;
|
|
28
32
|
export interface IFlowLoopScope {
|
|
29
33
|
item: unknown;
|
|
30
34
|
index: number;
|
|
@@ -43,12 +47,12 @@ export interface IFlowRunState {
|
|
|
43
47
|
loop?: IFlowLoopScope;
|
|
44
48
|
request: Record<string, unknown>;
|
|
45
49
|
user: ILoggedUserInfo | null;
|
|
50
|
+
authorization?: string;
|
|
46
51
|
permissions?: IRulePermissionResolver;
|
|
47
52
|
mode: FlowRunMode;
|
|
48
|
-
runAs: FlowRunAs;
|
|
49
|
-
systemAuthorized?: boolean;
|
|
50
53
|
steps: number;
|
|
51
54
|
httpCalls: number;
|
|
55
|
+
messages: number;
|
|
52
56
|
writes: number;
|
|
53
57
|
deadline: number;
|
|
54
58
|
qr?: QueryRunner;
|
|
@@ -70,15 +74,20 @@ export interface IFlowEnv {
|
|
|
70
74
|
publish(eventName: string, payload: Record<string, unknown>, user: ILoggedUserInfo | null): Promise<void>;
|
|
71
75
|
atomic<T>(state: IFlowRunState, work: () => Promise<T>): Promise<T>;
|
|
72
76
|
commit(state: IFlowRunState): Promise<void>;
|
|
73
|
-
|
|
77
|
+
companyAccess(userId: string): Promise<IUserCompanyAccess>;
|
|
78
|
+
branchTree?(branchIds: string[]): Promise<string[]>;
|
|
79
|
+
companyMembers?(companyId: string, branchIds?: string[]): Promise<string[]>;
|
|
80
|
+
assertPermissions(logic: ILogicNode, user: ILoggedUserInfo | null): Promise<void>;
|
|
74
81
|
allowPrivateHttp: boolean;
|
|
82
|
+
notifications?: INotificationAdapter;
|
|
83
|
+
email?: IEmailAdapter;
|
|
75
84
|
}
|
|
76
85
|
export interface IFlowEntityAccess {
|
|
77
86
|
insert(dto: Record<string, unknown>, user: ILoggedUserInfo | null, options?: IFlowWriteOptions): Promise<IGenericRecord>;
|
|
78
87
|
update(dto: Record<string, unknown> & {
|
|
79
88
|
id: string;
|
|
80
89
|
}, user: ILoggedUserInfo | null, options?: IFlowWriteOptions): Promise<IGenericRecord>;
|
|
81
|
-
delete(id: string, user: ILoggedUserInfo | null, options?: IFlowWriteOptions): Promise<
|
|
90
|
+
delete(id: string, user: ILoggedUserInfo | null, options?: IFlowWriteOptions): Promise<'deleted' | 'purged'>;
|
|
82
91
|
findById(id: string, options?: IFlowReadOptions): Promise<IGenericRecord>;
|
|
83
92
|
getAll(search: string | undefined, dto: {
|
|
84
93
|
filter?: Record<string, unknown>;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { type ILogicNode } from '@flusys/nestjs-shared/interfaces';
|
|
1
2
|
import { type RecordFilterOp } from '../interfaces/generic-record.interface.js';
|
|
2
3
|
import { type RuleExpression, type RuleGroup } from '../rule-engine/index.js';
|
|
3
|
-
export declare const FLOW_NODE_TYPES: readonly ["trigger", "validate", "permission_check", "set", "condition", "switch", "foreach", "entity_insert", "entity_update", "entity_delete", "entity_get", "entity_query", "commit", "call_flow", "http_request", "publish_event", "respond", "code"];
|
|
4
|
+
export declare const FLOW_NODE_TYPES: readonly ["trigger", "validate", "permission_check", "company_branch_check", "set", "condition", "switch", "foreach", "entity_insert", "entity_update", "entity_delete", "entity_get", "entity_query", "commit", "call_flow", "http_request", "publish_event", "send_notification", "send_email", "respond", "code"];
|
|
4
5
|
export type FlowNodeType = (typeof FLOW_NODE_TYPES)[number];
|
|
5
6
|
export declare const NON_CONTINUABLE_NODE_TYPES: ReadonlySet<FlowNodeType>;
|
|
6
7
|
export declare const FLOW_AUTH_MODES: readonly ["public", "api_key", "jwt", "permission", "internal"];
|
|
7
8
|
export type FlowAuthMode = (typeof FLOW_AUTH_MODES)[number];
|
|
8
|
-
export declare const
|
|
9
|
-
export
|
|
9
|
+
export declare const DEFAULT_AUTH_MODE: FlowAuthMode;
|
|
10
|
+
export declare const KEYLESS_AUTH_MODES: ReadonlySet<FlowAuthMode>;
|
|
10
11
|
export type FlowRunMode = 'live' | 'dry_run';
|
|
11
12
|
export declare const FLOW_BODY_TYPES: readonly ["object", "list"];
|
|
12
13
|
export type FlowBodyType = (typeof FLOW_BODY_TYPES)[number];
|
|
@@ -52,11 +53,6 @@ export interface IFlowGraph {
|
|
|
52
53
|
}
|
|
53
54
|
export interface IFlowSettings extends IFlowGraph {
|
|
54
55
|
slug: string;
|
|
55
|
-
authMode: FlowAuthMode;
|
|
56
|
-
runAs: FlowRunAs;
|
|
57
|
-
isTransactional: boolean;
|
|
58
|
-
bodyType: FlowBodyType;
|
|
59
|
-
inputSchema: IFlowInputField[];
|
|
60
56
|
}
|
|
61
57
|
export type ExpressionMap = Record<string, RuleExpression>;
|
|
62
58
|
export interface IValidateCheck {
|
|
@@ -73,9 +69,24 @@ export interface IValidateConfig {
|
|
|
73
69
|
}
|
|
74
70
|
export type PermissionDeniedMode = 'reject' | 'branch';
|
|
75
71
|
export interface IPermissionCheckConfig {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
72
|
+
permissions: ILogicNode;
|
|
73
|
+
onDenied?: PermissionDeniedMode;
|
|
74
|
+
statusCode?: number;
|
|
75
|
+
message?: string;
|
|
76
|
+
}
|
|
77
|
+
export declare const FLOW_ACCESS_SUBJECTS: readonly ["caller", "user"];
|
|
78
|
+
export type FlowAccessSubject = (typeof FLOW_ACCESS_SUBJECTS)[number];
|
|
79
|
+
export declare const FLOW_BRANCH_MATCHES: readonly ["direct", "within"];
|
|
80
|
+
export type FlowBranchMatch = (typeof FLOW_BRANCH_MATCHES)[number];
|
|
81
|
+
export declare const FLOW_BRANCH_COMPANIES: readonly ["any", "current"];
|
|
82
|
+
export type FlowBranchCompany = (typeof FLOW_BRANCH_COMPANIES)[number];
|
|
83
|
+
export interface ICompanyBranchCheckConfig {
|
|
84
|
+
subject?: FlowAccessSubject;
|
|
85
|
+
userId?: RuleExpression;
|
|
86
|
+
companyIds?: RuleExpression;
|
|
87
|
+
branchIds?: RuleExpression;
|
|
88
|
+
branchMatch?: FlowBranchMatch;
|
|
89
|
+
branchCompany?: FlowBranchCompany;
|
|
79
90
|
onDenied?: PermissionDeniedMode;
|
|
80
91
|
statusCode?: number;
|
|
81
92
|
message?: string;
|
|
@@ -158,7 +169,18 @@ export interface ITriggerConfig {
|
|
|
158
169
|
path?: string;
|
|
159
170
|
bodyType?: FlowBodyType;
|
|
160
171
|
inputSchema?: IFlowInputField[];
|
|
172
|
+
authMode?: FlowAuthMode;
|
|
173
|
+
permissions?: ILogicNode;
|
|
174
|
+
isTransactional?: boolean;
|
|
175
|
+
timeoutMs?: number;
|
|
176
|
+
rateLimitPerMinute?: number;
|
|
177
|
+
apiKey?: string | IStoredApiKey;
|
|
161
178
|
}
|
|
179
|
+
export interface IStoredApiKey {
|
|
180
|
+
prefix: string;
|
|
181
|
+
hash: string;
|
|
182
|
+
}
|
|
183
|
+
export declare function isStoredApiKey(value: unknown): value is IStoredApiKey;
|
|
162
184
|
export interface ICallFlowConfig {
|
|
163
185
|
flowSlug: string;
|
|
164
186
|
endpoint?: string;
|
|
@@ -171,11 +193,57 @@ export interface IHttpRequestConfig {
|
|
|
171
193
|
headers?: ExpressionMap;
|
|
172
194
|
body?: ExpressionMap;
|
|
173
195
|
timeoutMs?: number;
|
|
196
|
+
forwardAuth?: boolean;
|
|
174
197
|
}
|
|
175
198
|
export interface IPublishEventConfig {
|
|
176
199
|
eventName: string;
|
|
177
200
|
payload: ExpressionMap;
|
|
178
201
|
}
|
|
202
|
+
export declare const FLOW_MESSAGE_SERVICES: {
|
|
203
|
+
readonly send_notification: "notification";
|
|
204
|
+
readonly send_email: "email";
|
|
205
|
+
};
|
|
206
|
+
export type FlowMessageNodeType = keyof typeof FLOW_MESSAGE_SERVICES;
|
|
207
|
+
export type FlowMessageService = (typeof FLOW_MESSAGE_SERVICES)[FlowMessageNodeType];
|
|
208
|
+
export declare const isMessageNode: (type: string) => type is FlowMessageNodeType;
|
|
209
|
+
export declare const FLOW_NOTIFICATION_TYPES: readonly ["info", "success", "warning", "error"];
|
|
210
|
+
export type FlowNotificationType = (typeof FLOW_NOTIFICATION_TYPES)[number];
|
|
211
|
+
export declare const FLOW_NOTIFICATION_TARGETS: readonly ["one", "many", "company"];
|
|
212
|
+
export type FlowNotificationTarget = (typeof FLOW_NOTIFICATION_TARGETS)[number];
|
|
213
|
+
export declare const FLOW_EMAIL_TARGETS: readonly ["one", "many"];
|
|
214
|
+
export type FlowEmailTarget = (typeof FLOW_EMAIL_TARGETS)[number];
|
|
215
|
+
export interface ISendNotificationConfig {
|
|
216
|
+
target?: FlowNotificationTarget;
|
|
217
|
+
items?: RuleExpression;
|
|
218
|
+
userIds?: RuleExpression;
|
|
219
|
+
companyIds?: RuleExpression;
|
|
220
|
+
branchIds?: RuleExpression;
|
|
221
|
+
title: RuleExpression;
|
|
222
|
+
message?: RuleExpression;
|
|
223
|
+
type?: FlowNotificationType;
|
|
224
|
+
data?: ExpressionMap;
|
|
225
|
+
companyId?: RuleExpression;
|
|
226
|
+
realtime?: boolean;
|
|
227
|
+
}
|
|
228
|
+
export declare const FLOW_EMAIL_MODES: readonly ["content", "template"];
|
|
229
|
+
export type FlowEmailMode = (typeof FLOW_EMAIL_MODES)[number];
|
|
230
|
+
export declare const FLOW_EMAIL_FORMATS: readonly ["text", "html"];
|
|
231
|
+
export type FlowEmailFormat = (typeof FLOW_EMAIL_FORMATS)[number];
|
|
232
|
+
export interface ISendEmailConfig {
|
|
233
|
+
target?: FlowEmailTarget;
|
|
234
|
+
items?: RuleExpression;
|
|
235
|
+
to: RuleExpression;
|
|
236
|
+
cc?: RuleExpression;
|
|
237
|
+
bcc?: RuleExpression;
|
|
238
|
+
replyTo?: RuleExpression;
|
|
239
|
+
mode?: FlowEmailMode;
|
|
240
|
+
subject?: RuleExpression;
|
|
241
|
+
body?: RuleExpression;
|
|
242
|
+
format?: FlowEmailFormat;
|
|
243
|
+
templateSlug?: string;
|
|
244
|
+
variables?: ExpressionMap;
|
|
245
|
+
emailConfigId?: string;
|
|
246
|
+
}
|
|
179
247
|
export interface IRespondConfig {
|
|
180
248
|
statusCode: number;
|
|
181
249
|
body?: ExpressionMap;
|
|
@@ -193,6 +261,13 @@ export declare const FLOW_LIMITS: {
|
|
|
193
261
|
readonly MAX_LOOP_DEPTH: 3;
|
|
194
262
|
readonly MAX_CALL_DEPTH: 5;
|
|
195
263
|
readonly MAX_HTTP_CALLS: 10;
|
|
264
|
+
readonly MAX_MESSAGES_PER_RUN: 100;
|
|
265
|
+
readonly MAX_NOTIFICATION_RECIPIENTS: 500;
|
|
266
|
+
readonly MAX_COMPANY_NOTIFICATION_RECIPIENTS: 5000;
|
|
267
|
+
readonly MAX_EMAIL_RECIPIENTS: 50;
|
|
268
|
+
readonly MAX_NOTIFICATION_TITLE_LENGTH: 255;
|
|
269
|
+
readonly MAX_EMAIL_SUBJECT_LENGTH: 255;
|
|
270
|
+
readonly MAX_EMAIL_TEMPLATE_SLUG_LENGTH: 255;
|
|
196
271
|
readonly MAX_HTTP_TIMEOUT_MS: 15000;
|
|
197
272
|
readonly MAX_HTTP_RESPONSE_BYTES: 1000000;
|
|
198
273
|
readonly MAX_QUERY_LIMIT: 200;
|
|
@@ -203,6 +278,8 @@ export declare const FLOW_LIMITS: {
|
|
|
203
278
|
readonly DEFAULT_TIMEOUT_MS: 30000;
|
|
204
279
|
readonly MIN_TIMEOUT_MS: 1000;
|
|
205
280
|
readonly MAX_TIMEOUT_MS: 120000;
|
|
281
|
+
readonly DEFAULT_RATE_LIMIT_PER_MINUTE: 60;
|
|
282
|
+
readonly MAX_RATE_LIMIT_PER_MINUTE: 100000;
|
|
206
283
|
readonly TRACE_PREVIEW_CHARS: 2000;
|
|
207
284
|
readonly MAX_INPUT_FIELDS: 50;
|
|
208
285
|
readonly MAX_INPUT_DEPTH: 4;
|
|
@@ -221,13 +298,24 @@ export declare const FLOW_NODE_ID_PATTERN: RegExp;
|
|
|
221
298
|
export declare const FLOW_SLUG_PATTERN: RegExp;
|
|
222
299
|
export declare const FLOW_INPUT_NAME_PATTERN: RegExp;
|
|
223
300
|
export declare const FLOW_ENDPOINT_PATH_PATTERN: RegExp;
|
|
301
|
+
export declare const FLOW_ID_PATTERN: RegExp;
|
|
224
302
|
export interface IFlowEndpoint {
|
|
225
303
|
nodeId: string;
|
|
226
304
|
path: string | null;
|
|
227
305
|
bodyType: FlowBodyType;
|
|
228
306
|
inputSchema: IFlowInputField[];
|
|
307
|
+
authMode: FlowAuthMode;
|
|
308
|
+
permissions: ILogicNode | null;
|
|
309
|
+
isTransactional: boolean;
|
|
310
|
+
timeoutMs: number;
|
|
311
|
+
rateLimitPerMinute: number;
|
|
312
|
+
apiKey: IStoredApiKey | null;
|
|
229
313
|
}
|
|
314
|
+
type EndpointSource = Pick<IFlowSettings, 'nodes'>;
|
|
315
|
+
export declare const isFunctionFlow: (flow: EndpointSource) => boolean;
|
|
230
316
|
export declare function triggerPath(node: Pick<IFlowNode, 'config'>): string | null;
|
|
231
|
-
export declare function flowEndpoints(flow:
|
|
232
|
-
export declare function findEndpoint(flow:
|
|
317
|
+
export declare function flowEndpoints(flow: EndpointSource): IFlowEndpoint[];
|
|
318
|
+
export declare function findEndpoint(flow: EndpointSource, path?: string | null): IFlowEndpoint | undefined;
|
|
319
|
+
export declare function startEndpoint(flow: EndpointSource, nodeId?: string): IFlowEndpoint | undefined;
|
|
233
320
|
export declare function portsOf(node: Pick<IFlowNode, 'type' | 'config'>): string[];
|
|
321
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type CallHandler, type ExecutionContext, type NestInterceptor } from '@nestjs/common';
|
|
2
|
+
import { Reflector } from '@nestjs/core';
|
|
3
|
+
import { type Observable } from 'rxjs';
|
|
4
|
+
import { EntityBuilderConfigService } from '../services/entity-builder-config.service.js';
|
|
5
|
+
export declare const DesignerWrites: (...handlers: string[]) => import("@nestjs/common").CustomDecorator<string>;
|
|
6
|
+
export declare class DesignerWritableInterceptor implements NestInterceptor {
|
|
7
|
+
private readonly reflector;
|
|
8
|
+
private readonly config;
|
|
9
|
+
constructor(reflector: Reflector, config: EntityBuilderConfigService);
|
|
10
|
+
intercept(context: ExecutionContext, next: CallHandler): Observable<unknown>;
|
|
11
|
+
private isLocked;
|
|
12
|
+
}
|
package/guards/index.d.ts
CHANGED