@flusys/nestjs-entity-builder 9.2.0 → 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 +40 -22
- package/config/entity-builder.constants.d.ts +1 -0
- package/config/message-keys.d.ts +11 -2
- package/controllers/definition-bundle.controller.d.ts +2 -2
- package/controllers/entity-definition.controller.d.ts +0 -1
- package/controllers/field-definition.controller.d.ts +0 -1
- package/controllers/flow-definition.controller.d.ts +2 -1
- package/controllers/flow-runtime.controller.d.ts +4 -3
- package/fesm/21.js +13 -5
- package/fesm/{458.js → 28.js} +104 -62
- package/fesm/677.js +1234 -469
- package/fesm/794.js +1 -1
- package/fesm/857.js +1 -2
- package/fesm/870.js +415 -332
- package/fesm/897.js +23 -29
- package/fesm/946.js +67 -42
- package/fesm/config/index.js +10 -14
- package/fesm/docs/index.js +1 -1
- package/fesm/guards/index.js +15 -9
- package/fesm/index.js +25 -25
- package/fesm/modules/index.js +4 -3
- package/fesm/services/index.js +29 -58
- 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 +14 -0
- package/flow-engine/flow-run.types.d.ts +15 -0
- package/flow-engine/flow.types.d.ts +1 -1
- package/guards/designer-writable.interceptor.d.ts +1 -0
- package/interfaces/definition-bundle.interface.d.ts +2 -0
- 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 +0 -2
- package/services/definition-bundle.file.d.ts +2 -1
- package/services/definition-bundle.service.d.ts +0 -1
- package/services/entity-builder-config.service.d.ts +3 -0
- package/services/entity-builder-datasource.provider.d.ts +1 -0
- package/services/field-value-validator.d.ts +7 -0
- package/services/flow-definition.service.d.ts +10 -2
- package/services/flow-executor.service.d.ts +3 -0
- package/services/flow-runtime.service.d.ts +6 -1
- package/services/generic-entity-service.factory.d.ts +5 -1
- package/services/generic-entity.service.d.ts +24 -2
- package/services/identifier-rules.d.ts +0 -1
- package/services/save-loaded.d.ts +2 -0
- package/services/schema-columns.d.ts +7 -2
- 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/897.js
CHANGED
|
@@ -9,18 +9,12 @@ export const __rspack_esm_ids = [897];
|
|
|
9
9
|
export const __webpack_modules__ = {
|
|
10
10
|
6576(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
11
11
|
const ENTITY_BUILDER_MODULE_OPTIONS = 'ENTITY_BUILDER_MODULE_OPTIONS';
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
* Identifier whitelist enforced on every EntityDefinition/FieldDefinition `code`.
|
|
19
|
-
* Also the exact contract SchemaSyncService's DDL engine validates against
|
|
20
|
-
* before generating a table/column name.
|
|
21
|
-
*/ const ENTITY_CODE_PATTERN = /^[a-z][a-z0-9_]{2,59}$/;
|
|
22
|
-
/** Matches the `code` column length on both EntityDefinition and FieldDefinition. */ const ENTITY_CODE_MAX_LENGTH = 63;
|
|
23
|
-
/** Defense-in-depth prefix applied to every dynamically created table name. */ const ENTITY_TABLE_PREFIX = 'eb_';
|
|
12
|
+
/** The bundle is uploaded as a file, so the app's JSON body limit (Express's 100kb default) never applies to it - this does. */ const ENTITY_BUNDLE_MAX_BYTES = 20 * 1024 * 1024;
|
|
13
|
+
/** A split export writes one file per entity and per flow; together they stay under ENTITY_BUNDLE_MAX_BYTES. */ const ENTITY_BUNDLE_MAX_FILES = 1000;
|
|
14
|
+
/** Any other `${var:NAME}` name could never be resolved on import. */ const BUNDLE_VARIABLE_NAME_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
15
|
+
/** Every entity and field `code`; the DDL engine checks the same pattern before it names a table or column. */ const ENTITY_CODE_PATTERN = /^[a-z][a-z0-9_]{2,59}$/;
|
|
16
|
+
const ENTITY_CODE_MAX_LENGTH = 63;
|
|
17
|
+
const ENTITY_TABLE_PREFIX = 'eb_';
|
|
24
18
|
/** The generic API controller's record endpoints - each can be created as a ready-made flow with the entity. */ const ENTITY_FLOW_ENDPOINTS = [
|
|
25
19
|
'insert',
|
|
26
20
|
'insertMany',
|
|
@@ -156,11 +150,7 @@ _ts_decorate([
|
|
|
156
150
|
(0,class_validator__rspack_import_3.IsNotEmpty)(),
|
|
157
151
|
_ts_metadata("design:type", String)
|
|
158
152
|
], UpdateEntityDefinitionDto.prototype, "id", void 0);
|
|
159
|
-
/**
|
|
160
|
-
* One initial field spec passed alongside entity creation - identical to
|
|
161
|
-
* CreateFieldDefinitionDto but without entityDefinitionId, which does not
|
|
162
|
-
* exist yet until SchemaSyncService.createEntity assigns it.
|
|
163
|
-
*/ class EntityFieldSpecDto extends (0,_nestjs_swagger__rspack_import_1.OmitType)(_field_definition_dto_js__rspack_import_4/* .CreateFieldDefinitionDto */.Vj, [
|
|
153
|
+
/** A field created with its entity (or by add_field): the entity id comes from the request, not the field. */ class EntityFieldSpecDto extends (0,_nestjs_swagger__rspack_import_1.OmitType)(_field_definition_dto_js__rspack_import_4/* .CreateFieldDefinitionDto */.Vj, [
|
|
164
154
|
'entityDefinitionId'
|
|
165
155
|
]) {
|
|
166
156
|
}
|
|
@@ -326,12 +316,7 @@ _ts_decorate([
|
|
|
326
316
|
(0,class_validator__rspack_import_3.MaxLength)(255),
|
|
327
317
|
_ts_metadata("design:type", String)
|
|
328
318
|
], EntityFlowTextsDto.prototype, "deleteOnlyMessage", void 0);
|
|
329
|
-
/**
|
|
330
|
-
* Creates a dynamic entity and its initial table in one DDL transaction.
|
|
331
|
-
* Consumed by SchemaSyncService.createEntity, not by the generic ApiController
|
|
332
|
-
* insert endpoint (which is disabled for EntityDefinitionController - metadata
|
|
333
|
-
* rows must never be created without a matching real table).
|
|
334
|
-
*/ class CreateDynamicEntityDto extends CreateEntityDefinitionDto {
|
|
319
|
+
/** create-entity: the entity, its table and initial fields in one DDL transaction (the generic insert is disabled). */ class CreateDynamicEntityDto extends CreateEntityDefinitionDto {
|
|
335
320
|
fields;
|
|
336
321
|
flowEndpoints;
|
|
337
322
|
flowTexts;
|
|
@@ -597,6 +582,7 @@ _ts_decorate([
|
|
|
597
582
|
(0,_nestjs_swagger__rspack_import_1.ApiPropertyOptional)({
|
|
598
583
|
description: 'Options for SINGLE_SELECT/MULTI_SELECT fields'
|
|
599
584
|
}),
|
|
585
|
+
(0,class_validator__rspack_import_3.IsArray)(),
|
|
600
586
|
(0,class_validator__rspack_import_3.IsOptional)(),
|
|
601
587
|
_ts_metadata("design:type", Array)
|
|
602
588
|
], CreateFieldDefinitionDto.prototype, "selectOptions", void 0);
|
|
@@ -1302,6 +1288,7 @@ const FLOW_LIMITS = {
|
|
|
1302
1288
|
MAX_EMAIL_TEMPLATE_SLUG_LENGTH: 255,
|
|
1303
1289
|
MAX_HTTP_TIMEOUT_MS: 15_000,
|
|
1304
1290
|
MAX_HTTP_RESPONSE_BYTES: 1_000_000,
|
|
1291
|
+
DEFAULT_QUERY_LIMIT: 50,
|
|
1305
1292
|
MAX_QUERY_LIMIT: 200,
|
|
1306
1293
|
MAX_WRITE_ITEMS: 1000,
|
|
1307
1294
|
DEFAULT_WRITE_FILTER_LIMIT: 100,
|
|
@@ -1320,8 +1307,7 @@ const FLOW_LIMITS = {
|
|
|
1320
1307
|
DEFAULT_CODE_TIMEOUT_MS: 1000,
|
|
1321
1308
|
MIN_CODE_TIMEOUT_MS: 10,
|
|
1322
1309
|
MAX_CODE_TIMEOUT_MS: 5000,
|
|
1323
|
-
CODE_MEMORY_LIMIT_BYTES:
|
|
1324
|
-
CODE_STACK_SIZE_BYTES: 512 * 1024,
|
|
1310
|
+
/** Heap plus buffers of the worker a code step runs on, packages it loaded included. */ CODE_MEMORY_LIMIT_BYTES: 128 * 1024 * 1024,
|
|
1325
1311
|
MAX_CODE_OUTPUT_BYTES: 1_000_000,
|
|
1326
1312
|
MAX_CODE_LOG_LINES: 50,
|
|
1327
1313
|
MAX_CODE_LOG_LINE_CHARS: 500
|
|
@@ -1581,6 +1567,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
1581
1567
|
'updated_by_id',
|
|
1582
1568
|
'deleted_by_id'
|
|
1583
1569
|
];
|
|
1570
|
+
/** A RELATION field is indexed unless the request says otherwise: child lists, parent-id filters and lookups all read by it. */ const indexedByDefault = (spec)=>spec.isIndexed ?? spec.fieldType === _enums_field_type_enum_js__rspack_import_2/* .FieldType.RELATION */.P.RELATION;
|
|
1584
1571
|
/** Field types stored as unbounded text or JSON: an index or unique constraint on them fails (MySQL) or breaks on large values (PostgreSQL). */ const NON_INDEXABLE_FIELD_TYPES = [
|
|
1585
1572
|
_enums_field_type_enum_js__rspack_import_2/* .FieldType.LONG_TEXT */.P.LONG_TEXT,
|
|
1586
1573
|
_enums_field_type_enum_js__rspack_import_2/* .FieldType.JSON */.P.JSON,
|
|
@@ -1648,12 +1635,17 @@ const NAME_HASH_LENGTH = 8;
|
|
|
1648
1635
|
const room = maxLength - prefix.length - hash.length - 2;
|
|
1649
1636
|
return `${prefix}_${`${table}_${column}`.slice(0, room)}_${hash}`;
|
|
1650
1637
|
}
|
|
1651
|
-
|
|
1638
|
+
/** The predicate of a plain index over live rows only (`performance.partialIndexes`, PostgreSQL). */ const LIVE_ROWS_WHERE = '"deleted_at" IS NULL';
|
|
1639
|
+
/** `liveOnly` (PostgreSQL only - MySQL has no partial indexes): the index covers rows that are not soft-deleted. */ const plainIndex = (table, column, driver, adapter, liveOnly = false)=>new typeorm__rspack_import_1.TableIndex({
|
|
1652
1640
|
name: indexName('idx', table, column, adapter.maxIdentifierLength(driver)),
|
|
1653
1641
|
columnNames: [
|
|
1654
1642
|
column
|
|
1655
|
-
]
|
|
1643
|
+
],
|
|
1644
|
+
...liveOnly && driver === 'postgres' ? {
|
|
1645
|
+
where: LIVE_ROWS_WHERE
|
|
1646
|
+
} : {}
|
|
1656
1647
|
});
|
|
1648
|
+
/** Whether an index read back from the database covers live rows only (PostgreSQL reports `(deleted_at IS NULL)`). */ const isLiveRowsIndex = (index)=>/^\(*"?deleted_at"?\s+IS\s+NULL\)*$/i.test((index.where ?? '').trim());
|
|
1657
1649
|
const tableUnique = (table, column, driver, adapter)=>new typeorm__rspack_import_1.TableUnique({
|
|
1658
1650
|
name: indexName('uq', table, column, adapter.maxIdentifierLength(driver)),
|
|
1659
1651
|
columnNames: [
|
|
@@ -1731,11 +1723,13 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
1731
1723
|
G7: sameColumns,
|
|
1732
1724
|
HK: auditColumns,
|
|
1733
1725
|
OG: softDeleteColumn,
|
|
1726
|
+
YS: isLiveRowsIndex,
|
|
1734
1727
|
d4: isIndexableFieldType,
|
|
1735
|
-
gW: NON_INDEXABLE_FIELD_TYPES,
|
|
1736
1728
|
mq: SYSTEM_COLUMN_NAMES,
|
|
1737
1729
|
uy: tableUnique,
|
|
1738
|
-
v7: plainIndex
|
|
1730
|
+
v7: plainIndex,
|
|
1731
|
+
vx: LIVE_ROWS_WHERE,
|
|
1732
|
+
w5: indexedByDefault
|
|
1739
1733
|
});
|
|
1740
1734
|
|
|
1741
1735
|
|
package/fesm/946.js
CHANGED
|
@@ -115,12 +115,11 @@ class EntityDefinitionController extends (0,nestjs_shared_.createApiController)(
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
}) {
|
|
118
|
-
entityDefinitionService;
|
|
119
118
|
schemaSyncService;
|
|
120
119
|
evolution;
|
|
121
120
|
permissionCache;
|
|
122
121
|
constructor(entityDefinitionService, schemaSyncService, evolution, permissionCache){
|
|
123
|
-
super(entityDefinitionService), this.
|
|
122
|
+
super(entityDefinitionService), this.schemaSyncService = schemaSyncService, this.evolution = evolution, this.permissionCache = permissionCache;
|
|
124
123
|
}
|
|
125
124
|
async createEntity(dto, user) {
|
|
126
125
|
const { definition, warnings } = await this.schemaSyncService.createEntity(dto, user);
|
|
@@ -133,7 +132,6 @@ class EntityDefinitionController extends (0,nestjs_shared_.createApiController)(
|
|
|
133
132
|
return this.ok(await this.schemaSyncService.planCreateEntity(dto, user), 'Plan generated', message_keys/* .ENTITY_DEFINITION_MESSAGES.PLAN_SUCCESS */.pL.PLAN_SUCCESS);
|
|
134
133
|
}
|
|
135
134
|
async planChange(dto, user) {
|
|
136
|
-
// A plan counts records, so only someone who could apply the change may see it.
|
|
137
135
|
await this.permissionCache.assertPermission(user, (0,schema_evolution_service/* .isDestructiveSchemaAction */.C)(dto.action) ? nestjs_shared_.ENTITY_DEFINITION_PERMISSIONS.DELETE : nestjs_shared_.ENTITY_DEFINITION_PERMISSIONS.UPDATE);
|
|
138
136
|
return this.ok(await this.evolution.plan(dto, user), 'Plan generated', message_keys/* .ENTITY_DEFINITION_MESSAGES.PLAN_SUCCESS */.pL.PLAN_SUCCESS);
|
|
139
137
|
}
|
|
@@ -242,6 +240,7 @@ _ts_decorate([
|
|
|
242
240
|
], EntityDefinitionController.prototype, "planChange", null);
|
|
243
241
|
_ts_decorate([
|
|
244
242
|
(0,common_.Post)('apply-change'),
|
|
243
|
+
(0,designer_writable_interceptor/* .DesignerAllowsRepair */.H6)(),
|
|
245
244
|
(0,common_.UseGuards)(guards_.JwtAuthGuard, guards_.PermissionGuard),
|
|
246
245
|
(0,__rspack_external__flusys_nestjs_shared_decorators_c129b601.RequirePermission)(nestjs_shared_.ENTITY_DEFINITION_PERMISSIONS.UPDATE),
|
|
247
246
|
(0,swagger_.ApiBearerAuth)(),
|
|
@@ -320,8 +319,8 @@ _ts_decorate([
|
|
|
320
319
|
EntityDefinitionController = _ts_decorate([
|
|
321
320
|
(0,swagger_.ApiTags)('Entity Builder - Entity Definitions'),
|
|
322
321
|
(0,common_.Controller)('entity-builder/entity-definitions'),
|
|
323
|
-
(0,common_.UseInterceptors)(designer_writable_interceptor/* .DesignerWritableInterceptor */.
|
|
324
|
-
(0,designer_writable_interceptor/* .DesignerWrites */.
|
|
322
|
+
(0,common_.UseInterceptors)(designer_writable_interceptor/* .DesignerWritableInterceptor */.Xg),
|
|
323
|
+
(0,designer_writable_interceptor/* .DesignerWrites */.Wq)('createEntity', 'applyChange', 'applyDestructiveChange'),
|
|
325
324
|
_ts_param(0, (0,common_.Inject)(entity_definition_service/* .EntityDefinitionService */.o)),
|
|
326
325
|
_ts_param(1, (0,common_.Inject)(schema_sync_service/* .SchemaSyncService */.W)),
|
|
327
326
|
_ts_param(2, (0,common_.Inject)(schema_evolution_service/* .SchemaEvolutionService */._)),
|
|
@@ -403,9 +402,8 @@ class FieldDefinitionController extends (0,nestjs_shared_.createApiController)(f
|
|
|
403
402
|
}
|
|
404
403
|
}
|
|
405
404
|
}) {
|
|
406
|
-
fieldDefinitionService;
|
|
407
405
|
constructor(fieldDefinitionService){
|
|
408
|
-
super(fieldDefinitionService)
|
|
406
|
+
super(fieldDefinitionService);
|
|
409
407
|
}
|
|
410
408
|
}
|
|
411
409
|
FieldDefinitionController = field_definition_controller_ts_decorate([
|
|
@@ -744,7 +742,7 @@ flow_dto_ts_decorate([
|
|
|
744
742
|
(0,external_class_validator_.Min)(1),
|
|
745
743
|
flow_dto_ts_metadata("design:type", Number)
|
|
746
744
|
], FlowVersionRefDto.prototype, "version", void 0);
|
|
747
|
-
|
|
745
|
+
class IdBodyDto {
|
|
748
746
|
id;
|
|
749
747
|
}
|
|
750
748
|
flow_dto_ts_decorate([
|
|
@@ -1007,6 +1005,14 @@ class FlowDefinitionController extends (0,nestjs_shared_.createApiController)(Cr
|
|
|
1007
1005
|
data: flow
|
|
1008
1006
|
};
|
|
1009
1007
|
}
|
|
1008
|
+
codePackages() {
|
|
1009
|
+
return {
|
|
1010
|
+
success: true,
|
|
1011
|
+
message: 'Code packages loaded',
|
|
1012
|
+
messageKey: message_keys/* .FLOW_MESSAGES.CODE_PACKAGES_SUCCESS */.wu.CODE_PACKAGES_SUCCESS,
|
|
1013
|
+
data: this.flowDefinitionService.codePackages()
|
|
1014
|
+
};
|
|
1015
|
+
}
|
|
1010
1016
|
async versions(dto) {
|
|
1011
1017
|
return {
|
|
1012
1018
|
success: true,
|
|
@@ -1101,6 +1107,19 @@ flow_definition_controller_ts_decorate([
|
|
|
1101
1107
|
]),
|
|
1102
1108
|
flow_definition_controller_ts_metadata("design:returntype", Promise)
|
|
1103
1109
|
], FlowDefinitionController.prototype, "publish", null);
|
|
1110
|
+
flow_definition_controller_ts_decorate([
|
|
1111
|
+
(0,common_.Post)('code-packages'),
|
|
1112
|
+
(0,common_.HttpCode)(common_.HttpStatus.OK),
|
|
1113
|
+
(0,common_.UseGuards)(guards_.JwtAuthGuard, guards_.PermissionGuard),
|
|
1114
|
+
(0,__rspack_external__flusys_nestjs_shared_decorators_c129b601.RequirePermission)(P.READ),
|
|
1115
|
+
(0,swagger_.ApiBearerAuth)(),
|
|
1116
|
+
(0,swagger_.ApiOperation)({
|
|
1117
|
+
summary: 'The package names a code step may require on this server'
|
|
1118
|
+
}),
|
|
1119
|
+
flow_definition_controller_ts_metadata("design:type", Function),
|
|
1120
|
+
flow_definition_controller_ts_metadata("design:paramtypes", []),
|
|
1121
|
+
flow_definition_controller_ts_metadata("design:returntype", typeof nestjs_shared_.SingleResponseDto === "undefined" ? Object : nestjs_shared_.SingleResponseDto)
|
|
1122
|
+
], FlowDefinitionController.prototype, "codePackages", null);
|
|
1104
1123
|
flow_definition_controller_ts_decorate([
|
|
1105
1124
|
(0,common_.Post)('versions'),
|
|
1106
1125
|
(0,common_.HttpCode)(common_.HttpStatus.OK),
|
|
@@ -1209,8 +1228,8 @@ flow_definition_controller_ts_decorate([
|
|
|
1209
1228
|
FlowDefinitionController = flow_definition_controller_ts_decorate([
|
|
1210
1229
|
(0,swagger_.ApiTags)('Entity Builder - Flows'),
|
|
1211
1230
|
(0,common_.Controller)('entity-builder/flows'),
|
|
1212
|
-
(0,common_.UseInterceptors)(designer_writable_interceptor/* .DesignerWritableInterceptor */.
|
|
1213
|
-
(0,designer_writable_interceptor/* .DesignerWrites */.
|
|
1231
|
+
(0,common_.UseInterceptors)(designer_writable_interceptor/* .DesignerWritableInterceptor */.Xg),
|
|
1232
|
+
(0,designer_writable_interceptor/* .DesignerWrites */.Wq)('insert', 'update', 'delete', 'publish', 'restoreVersion', 'discardDraft'),
|
|
1214
1233
|
flow_definition_controller_ts_param(0, (0,common_.Inject)(flow_definition_service/* .FlowDefinitionService */.Tk)),
|
|
1215
1234
|
flow_definition_controller_ts_param(1, (0,common_.Inject)(flow_runtime_service/* .FlowRuntimeService */.a)),
|
|
1216
1235
|
flow_definition_controller_ts_metadata("design:type", Function),
|
|
@@ -1366,10 +1385,10 @@ class FlowRuntimeController {
|
|
|
1366
1385
|
constructor(runtime){
|
|
1367
1386
|
this.runtime = runtime;
|
|
1368
1387
|
}
|
|
1369
|
-
run(
|
|
1388
|
+
run(body, req, res) {
|
|
1370
1389
|
return this.answer(body, req, res);
|
|
1371
1390
|
}
|
|
1372
|
-
runEndpoint(
|
|
1391
|
+
runEndpoint(body, req, res) {
|
|
1373
1392
|
return this.answer(body, req, res);
|
|
1374
1393
|
}
|
|
1375
1394
|
async answer(body, req, res) {
|
|
@@ -1393,15 +1412,13 @@ flow_runtime_controller_ts_decorate([
|
|
|
1393
1412
|
(0,swagger_.ApiParam)({
|
|
1394
1413
|
name: 'slug'
|
|
1395
1414
|
}),
|
|
1396
|
-
flow_runtime_controller_ts_param(0, (0,common_.
|
|
1397
|
-
flow_runtime_controller_ts_param(1, (0,common_.
|
|
1398
|
-
flow_runtime_controller_ts_param(2, (0,common_.
|
|
1399
|
-
flow_runtime_controller_ts_param(3, (0,common_.Res)({
|
|
1415
|
+
flow_runtime_controller_ts_param(0, (0,common_.Body)()),
|
|
1416
|
+
flow_runtime_controller_ts_param(1, (0,common_.Req)()),
|
|
1417
|
+
flow_runtime_controller_ts_param(2, (0,common_.Res)({
|
|
1400
1418
|
passthrough: true
|
|
1401
1419
|
})),
|
|
1402
1420
|
flow_runtime_controller_ts_metadata("design:type", Function),
|
|
1403
1421
|
flow_runtime_controller_ts_metadata("design:paramtypes", [
|
|
1404
|
-
String,
|
|
1405
1422
|
Object,
|
|
1406
1423
|
typeof FlowRequest === "undefined" ? Object : FlowRequest,
|
|
1407
1424
|
Object
|
|
@@ -1421,17 +1438,13 @@ flow_runtime_controller_ts_decorate([
|
|
|
1421
1438
|
(0,swagger_.ApiParam)({
|
|
1422
1439
|
name: 'endpoint'
|
|
1423
1440
|
}),
|
|
1424
|
-
flow_runtime_controller_ts_param(0, (0,common_.
|
|
1425
|
-
flow_runtime_controller_ts_param(1, (0,common_.
|
|
1426
|
-
flow_runtime_controller_ts_param(2, (0,common_.
|
|
1427
|
-
flow_runtime_controller_ts_param(3, (0,common_.Req)()),
|
|
1428
|
-
flow_runtime_controller_ts_param(4, (0,common_.Res)({
|
|
1441
|
+
flow_runtime_controller_ts_param(0, (0,common_.Body)()),
|
|
1442
|
+
flow_runtime_controller_ts_param(1, (0,common_.Req)()),
|
|
1443
|
+
flow_runtime_controller_ts_param(2, (0,common_.Res)({
|
|
1429
1444
|
passthrough: true
|
|
1430
1445
|
})),
|
|
1431
1446
|
flow_runtime_controller_ts_metadata("design:type", Function),
|
|
1432
1447
|
flow_runtime_controller_ts_metadata("design:paramtypes", [
|
|
1433
|
-
String,
|
|
1434
|
-
String,
|
|
1435
1448
|
Object,
|
|
1436
1449
|
typeof FlowRequest === "undefined" ? Object : FlowRequest,
|
|
1437
1450
|
Object
|
|
@@ -1499,10 +1512,13 @@ function definition_bundle_controller_ts_param(paramIndex, decorator) {
|
|
|
1499
1512
|
|
|
1500
1513
|
|
|
1501
1514
|
|
|
1502
|
-
/**
|
|
1515
|
+
/**
|
|
1516
|
+
* The bundle is uploaded as files (not JSON): the app's JSON body limit never applies, only this package's own.
|
|
1517
|
+
* One file holds a whole export, or several hold one entity or flow each (a split folder kept in git).
|
|
1518
|
+
*/ const BundleUpload = ()=>(0,common_.UseInterceptors)((0,__rspack_external__nestjs_platform_express_cb7ac6b9.FilesInterceptor)('bundle', (/* inlined export .ENTITY_BUNDLE_MAX_FILES */1000), {
|
|
1503
1519
|
limits: {
|
|
1504
1520
|
fileSize: entity_builder_constants/* .ENTITY_BUNDLE_MAX_BYTES */.EA,
|
|
1505
|
-
files:
|
|
1521
|
+
files: (/* inlined export .ENTITY_BUNDLE_MAX_FILES */1000),
|
|
1506
1522
|
fields: 10
|
|
1507
1523
|
}
|
|
1508
1524
|
}));
|
|
@@ -1514,9 +1530,12 @@ const IMPORT_BODY = {
|
|
|
1514
1530
|
],
|
|
1515
1531
|
properties: {
|
|
1516
1532
|
bundle: {
|
|
1517
|
-
type: '
|
|
1518
|
-
|
|
1519
|
-
|
|
1533
|
+
type: 'array',
|
|
1534
|
+
items: {
|
|
1535
|
+
type: 'string',
|
|
1536
|
+
format: 'binary'
|
|
1537
|
+
},
|
|
1538
|
+
description: `One bundle file an export wrote, or the files of a split export (one per entity and flow, merged into one bundle). JSON, at most ${(/* inlined export .ENTITY_BUNDLE_MAX_FILES */1000)} files and ${entity_builder_constants/* .ENTITY_BUNDLE_MAX_BYTES */.EA / 1024 / 1024} MB together`
|
|
1520
1539
|
},
|
|
1521
1540
|
deprecateMissingFields: {
|
|
1522
1541
|
type: 'boolean',
|
|
@@ -1557,7 +1576,9 @@ class DefinitionBundleController {
|
|
|
1557
1576
|
settings() {
|
|
1558
1577
|
const data = {
|
|
1559
1578
|
readOnly: this.config.isDesignerReadOnly(),
|
|
1560
|
-
variables: Object.keys(this.config.getBundleVariables()).toSorted(definition_bundle_diff/* .byCode */.VU)
|
|
1579
|
+
variables: Object.keys(this.config.getBundleVariables()).toSorted(definition_bundle_diff/* .byCode */.VU),
|
|
1580
|
+
maxFiles: (/* inlined export .ENTITY_BUNDLE_MAX_FILES */1000),
|
|
1581
|
+
maxBytes: entity_builder_constants/* .ENTITY_BUNDLE_MAX_BYTES */.EA
|
|
1561
1582
|
};
|
|
1562
1583
|
return {
|
|
1563
1584
|
success: true,
|
|
@@ -1574,10 +1595,10 @@ class DefinitionBundleController {
|
|
|
1574
1595
|
data: await this.bundles.export(dto)
|
|
1575
1596
|
};
|
|
1576
1597
|
}
|
|
1577
|
-
async planImport(
|
|
1598
|
+
async planImport(files, options, user) {
|
|
1578
1599
|
const data = await this.bundles.planImport({
|
|
1579
1600
|
...options,
|
|
1580
|
-
bundle: (0,definition_bundle_file/* .
|
|
1601
|
+
bundle: (0,definition_bundle_file/* .readBundleFiles */.K)(files)
|
|
1581
1602
|
}, user);
|
|
1582
1603
|
return {
|
|
1583
1604
|
success: true,
|
|
@@ -1586,10 +1607,10 @@ class DefinitionBundleController {
|
|
|
1586
1607
|
data
|
|
1587
1608
|
};
|
|
1588
1609
|
}
|
|
1589
|
-
async applyImport(
|
|
1610
|
+
async applyImport(files, options, user) {
|
|
1590
1611
|
const data = await this.bundles.applyImport({
|
|
1591
1612
|
...options,
|
|
1592
|
-
bundle: (0,definition_bundle_file/* .
|
|
1613
|
+
bundle: (0,definition_bundle_file/* .readBundleFiles */.K)(files)
|
|
1593
1614
|
}, user);
|
|
1594
1615
|
return data.completed ? {
|
|
1595
1616
|
success: true,
|
|
@@ -1611,7 +1632,7 @@ definition_bundle_controller_ts_decorate([
|
|
|
1611
1632
|
(0,__rspack_external__flusys_nestjs_shared_decorators_c129b601.RequireAnyPermission)(nestjs_shared_.ENTITY_DEFINITION_PERMISSIONS.READ, nestjs_shared_.FLOW_DEFINITION_PERMISSIONS.READ),
|
|
1612
1633
|
(0,swagger_.ApiBearerAuth)(),
|
|
1613
1634
|
(0,swagger_.ApiOperation)({
|
|
1614
|
-
summary: 'Whether the designer is read-only here,
|
|
1635
|
+
summary: 'Whether the designer is read-only here, the names of the variables this environment defines, and the bundle upload limits'
|
|
1615
1636
|
}),
|
|
1616
1637
|
definition_bundle_controller_ts_metadata("design:type", Function),
|
|
1617
1638
|
definition_bundle_controller_ts_metadata("design:paramtypes", []),
|
|
@@ -1650,7 +1671,7 @@ definition_bundle_controller_ts_decorate([
|
|
|
1650
1671
|
(0,swagger_.ApiConsumes)('multipart/form-data'),
|
|
1651
1672
|
(0,swagger_.ApiBody)(IMPORT_BODY),
|
|
1652
1673
|
BundleUpload(),
|
|
1653
|
-
definition_bundle_controller_ts_param(0, (0,common_.
|
|
1674
|
+
definition_bundle_controller_ts_param(0, (0,common_.UploadedFiles)()),
|
|
1654
1675
|
definition_bundle_controller_ts_param(1, (0,common_.Body)()),
|
|
1655
1676
|
definition_bundle_controller_ts_param(2, (0,nestjs_shared_.CurrentUser)()),
|
|
1656
1677
|
definition_bundle_controller_ts_metadata("design:type", Function),
|
|
@@ -1674,7 +1695,7 @@ definition_bundle_controller_ts_decorate([
|
|
|
1674
1695
|
(0,swagger_.ApiConsumes)('multipart/form-data'),
|
|
1675
1696
|
(0,swagger_.ApiBody)(IMPORT_BODY),
|
|
1676
1697
|
BundleUpload(),
|
|
1677
|
-
definition_bundle_controller_ts_param(0, (0,common_.
|
|
1698
|
+
definition_bundle_controller_ts_param(0, (0,common_.UploadedFiles)()),
|
|
1678
1699
|
definition_bundle_controller_ts_param(1, (0,common_.Body)()),
|
|
1679
1700
|
definition_bundle_controller_ts_param(2, (0,nestjs_shared_.CurrentUser)()),
|
|
1680
1701
|
definition_bundle_controller_ts_metadata("design:type", Function),
|
|
@@ -1742,7 +1763,9 @@ function _ts_param(paramIndex, decorator) {
|
|
|
1742
1763
|
|
|
1743
1764
|
|
|
1744
1765
|
const DESIGNER_WRITE_HANDLERS = 'entity_builder:designer_write_handlers';
|
|
1766
|
+
const DESIGNER_REPAIR_HANDLER = 'entity_builder:designer_repair_handler';
|
|
1745
1767
|
/** The handlers of a controller (inherited ones included) that change definitions by hand. */ const DesignerWrites = (...handlers)=>(0,_nestjs_common__rspack_import_0.SetMetadata)(DESIGNER_WRITE_HANDLERS, handlers);
|
|
1768
|
+
/** The one handler whose `repair` action still runs while read-only; any other handler is refused whatever its body says. */ const DesignerAllowsRepair = ()=>(0,_nestjs_common__rspack_import_0.SetMetadata)(DESIGNER_REPAIR_HANDLER, true);
|
|
1746
1769
|
class DesignerWritableInterceptor {
|
|
1747
1770
|
reflector;
|
|
1748
1771
|
config;
|
|
@@ -1762,7 +1785,9 @@ class DesignerWritableInterceptor {
|
|
|
1762
1785
|
isLocked(context) {
|
|
1763
1786
|
if (!this.config.isDesignerReadOnly()) return false;
|
|
1764
1787
|
const handlers = this.reflector.get(DESIGNER_WRITE_HANDLERS, context.getClass()) ?? [];
|
|
1765
|
-
|
|
1788
|
+
const handler = context.getHandler();
|
|
1789
|
+
if (!handlers.includes(handler.name)) return false;
|
|
1790
|
+
if (!this.reflector.get(DESIGNER_REPAIR_HANDLER, handler)) return true;
|
|
1766
1791
|
return context.switchToHttp().getRequest().body?.action !== _dtos_schema_change_dto_js__rspack_import_2/* .SchemaChangeAction.REPAIR */.M3.REPAIR;
|
|
1767
1792
|
}
|
|
1768
1793
|
}
|
|
@@ -1778,9 +1803,10 @@ DesignerWritableInterceptor = _ts_decorate([
|
|
|
1778
1803
|
], DesignerWritableInterceptor);
|
|
1779
1804
|
|
|
1780
1805
|
__webpack_require__.d(__webpack_exports__, {
|
|
1781
|
-
|
|
1806
|
+
Xg: () => (DesignerWritableInterceptor)
|
|
1782
1807
|
}, {
|
|
1783
|
-
|
|
1808
|
+
H6: DesignerAllowsRepair,
|
|
1809
|
+
Wq: DesignerWrites
|
|
1784
1810
|
});
|
|
1785
1811
|
|
|
1786
1812
|
|
|
@@ -1938,8 +1964,7 @@ class FlowAccessGuard {
|
|
|
1938
1964
|
return true;
|
|
1939
1965
|
}
|
|
1940
1966
|
case 'jwt':
|
|
1941
|
-
|
|
1942
|
-
return true;
|
|
1967
|
+
return this.authenticate(context);
|
|
1943
1968
|
case 'permission':
|
|
1944
1969
|
{
|
|
1945
1970
|
if (!await this.authenticate(context)) return false;
|
package/fesm/config/index.js
CHANGED
|
@@ -3,18 +3,12 @@ export const __rspack_esm_ids = [565];
|
|
|
3
3
|
export const __webpack_modules__ = {
|
|
4
4
|
6576(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
5
5
|
const ENTITY_BUILDER_MODULE_OPTIONS = 'ENTITY_BUILDER_MODULE_OPTIONS';
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
* Identifier whitelist enforced on every EntityDefinition/FieldDefinition `code`.
|
|
13
|
-
* Also the exact contract SchemaSyncService's DDL engine validates against
|
|
14
|
-
* before generating a table/column name.
|
|
15
|
-
*/ const ENTITY_CODE_PATTERN = /^[a-z][a-z0-9_]{2,59}$/;
|
|
16
|
-
/** Matches the `code` column length on both EntityDefinition and FieldDefinition. */ const ENTITY_CODE_MAX_LENGTH = 63;
|
|
17
|
-
/** Defense-in-depth prefix applied to every dynamically created table name. */ const ENTITY_TABLE_PREFIX = 'eb_';
|
|
6
|
+
/** The bundle is uploaded as a file, so the app's JSON body limit (Express's 100kb default) never applies to it - this does. */ const ENTITY_BUNDLE_MAX_BYTES = 20 * 1024 * 1024;
|
|
7
|
+
/** A split export writes one file per entity and per flow; together they stay under ENTITY_BUNDLE_MAX_BYTES. */ const ENTITY_BUNDLE_MAX_FILES = 1000;
|
|
8
|
+
/** Any other `${var:NAME}` name could never be resolved on import. */ const BUNDLE_VARIABLE_NAME_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
9
|
+
/** Every entity and field `code`; the DDL engine checks the same pattern before it names a table or column. */ const ENTITY_CODE_PATTERN = /^[a-z][a-z0-9_]{2,59}$/;
|
|
10
|
+
const ENTITY_CODE_MAX_LENGTH = 63;
|
|
11
|
+
const ENTITY_TABLE_PREFIX = 'eb_';
|
|
18
12
|
/** The generic API controller's record endpoints - each can be created as a ready-made flow with the entity. */ const ENTITY_FLOW_ENDPOINTS = [
|
|
19
13
|
'insert',
|
|
20
14
|
'insertMany',
|
|
@@ -40,7 +34,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
40
34
|
|
|
41
35
|
},
|
|
42
36
|
982(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
43
|
-
/**
|
|
37
|
+
/** The entity names the module publishes events under; also reserved as entity codes. */ const ENTITY_BUILDER_EVENT_ENTITIES = {
|
|
44
38
|
ENTITY_DEFINITION: 'entity_definition',
|
|
45
39
|
FIELD_DEFINITION: 'field_definition',
|
|
46
40
|
SCHEMA_CHANGE_LOG: 'schema_change_log',
|
|
@@ -89,6 +83,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
89
83
|
j4: () => (/* reexport safe */ _message_keys_js__rspack_import_2.j4),
|
|
90
84
|
oc: () => (/* reexport safe */ _message_keys_js__rspack_import_2.oc),
|
|
91
85
|
pL: () => (/* reexport safe */ _message_keys_js__rspack_import_2.pL),
|
|
86
|
+
qX: () => (/* reexport safe */ (/* inlined export _entity_builder_constants_js__rspack_import_0 */1000)),
|
|
92
87
|
qj: () => (/* reexport safe */ _message_keys_js__rspack_import_2.qj),
|
|
93
88
|
vs: () => (/* reexport safe */ _entity_builder_constants_js__rspack_import_0.vs),
|
|
94
89
|
wu: () => (/* reexport safe */ _message_keys_js__rspack_import_2.wu),
|
|
@@ -113,6 +108,7 @@ var __webpack_exports__ENTITY_BUILDER_EVENT_ENTITIES = __webpack_exports__.P1;
|
|
|
113
108
|
var __webpack_exports__ENTITY_BUILDER_EVENT_MODULE = __webpack_exports__.SD;
|
|
114
109
|
var __webpack_exports__ENTITY_BUILDER_MODULE_OPTIONS = __webpack_exports__.CP;
|
|
115
110
|
var __webpack_exports__ENTITY_BUNDLE_MAX_BYTES = __webpack_exports__.EA;
|
|
111
|
+
var __webpack_exports__ENTITY_BUNDLE_MAX_FILES = __webpack_exports__.qX;
|
|
116
112
|
var __webpack_exports__ENTITY_CODE_MAX_LENGTH = __webpack_exports__.KA;
|
|
117
113
|
var __webpack_exports__ENTITY_CODE_PATTERN = __webpack_exports__.vs;
|
|
118
114
|
var __webpack_exports__ENTITY_DEFINITION_MESSAGES = __webpack_exports__.pL;
|
|
@@ -136,4 +132,4 @@ var __webpack_exports__SCHEMA_MESSAGES = __webpack_exports__.Hu;
|
|
|
136
132
|
var __webpack_exports__SCHEMA_PRECHECK_MESSAGES = __webpack_exports__.NE;
|
|
137
133
|
var __webpack_exports__SCHEMA_STEP_MESSAGES = __webpack_exports__.EQ;
|
|
138
134
|
var __webpack_exports__SCHEMA_WARNING_MESSAGES = __webpack_exports__.Uu;
|
|
139
|
-
export { __webpack_exports__BUNDLE_MESSAGES as BUNDLE_MESSAGES, __webpack_exports__BUNDLE_VARIABLE_NAME_PATTERN as BUNDLE_VARIABLE_NAME_PATTERN, __webpack_exports__ENTITY_BUILDER_EVENT_ENTITIES as ENTITY_BUILDER_EVENT_ENTITIES, __webpack_exports__ENTITY_BUILDER_EVENT_MODULE as ENTITY_BUILDER_EVENT_MODULE, __webpack_exports__ENTITY_BUILDER_MODULE_OPTIONS as ENTITY_BUILDER_MODULE_OPTIONS, __webpack_exports__ENTITY_BUNDLE_MAX_BYTES as ENTITY_BUNDLE_MAX_BYTES, __webpack_exports__ENTITY_CODE_MAX_LENGTH as ENTITY_CODE_MAX_LENGTH, __webpack_exports__ENTITY_CODE_PATTERN as ENTITY_CODE_PATTERN, __webpack_exports__ENTITY_DEFINITION_MESSAGES as ENTITY_DEFINITION_MESSAGES, __webpack_exports__ENTITY_FLOW_ENDPOINTS as ENTITY_FLOW_ENDPOINTS, __webpack_exports__ENTITY_TABLE_PREFIX as ENTITY_TABLE_PREFIX, __webpack_exports__FIELD_DEFINITION_MESSAGES as FIELD_DEFINITION_MESSAGES, __webpack_exports__FIELD_VALIDATION_MESSAGES as FIELD_VALIDATION_MESSAGES, __webpack_exports__FLOW_DEFINITION_MESSAGES as FLOW_DEFINITION_MESSAGES, __webpack_exports__FLOW_ERROR_MESSAGES as FLOW_ERROR_MESSAGES, __webpack_exports__FLOW_MESSAGES as FLOW_MESSAGES, __webpack_exports__FLOW_SHAPE_MESSAGES as FLOW_SHAPE_MESSAGES, __webpack_exports__FLOW_SKIP_MESSAGES as FLOW_SKIP_MESSAGES, __webpack_exports__FLOW_SUBJECT_MESSAGES as FLOW_SUBJECT_MESSAGES, __webpack_exports__FLOW_VALIDATION_MESSAGES as FLOW_VALIDATION_MESSAGES, __webpack_exports__GENERIC_RECORD_MESSAGES as GENERIC_RECORD_MESSAGES, __webpack_exports__RULE_ENGINE_MESSAGES as RULE_ENGINE_MESSAGES, __webpack_exports__SCHEMA_BLOCKER_MESSAGES as SCHEMA_BLOCKER_MESSAGES, __webpack_exports__SCHEMA_FINDING_MESSAGES as SCHEMA_FINDING_MESSAGES, __webpack_exports__SCHEMA_IMPACT_MESSAGES as SCHEMA_IMPACT_MESSAGES, __webpack_exports__SCHEMA_MESSAGES as SCHEMA_MESSAGES, __webpack_exports__SCHEMA_PRECHECK_MESSAGES as SCHEMA_PRECHECK_MESSAGES, __webpack_exports__SCHEMA_STEP_MESSAGES as SCHEMA_STEP_MESSAGES, __webpack_exports__SCHEMA_WARNING_MESSAGES as SCHEMA_WARNING_MESSAGES };
|
|
135
|
+
export { __webpack_exports__BUNDLE_MESSAGES as BUNDLE_MESSAGES, __webpack_exports__BUNDLE_VARIABLE_NAME_PATTERN as BUNDLE_VARIABLE_NAME_PATTERN, __webpack_exports__ENTITY_BUILDER_EVENT_ENTITIES as ENTITY_BUILDER_EVENT_ENTITIES, __webpack_exports__ENTITY_BUILDER_EVENT_MODULE as ENTITY_BUILDER_EVENT_MODULE, __webpack_exports__ENTITY_BUILDER_MODULE_OPTIONS as ENTITY_BUILDER_MODULE_OPTIONS, __webpack_exports__ENTITY_BUNDLE_MAX_BYTES as ENTITY_BUNDLE_MAX_BYTES, __webpack_exports__ENTITY_BUNDLE_MAX_FILES as ENTITY_BUNDLE_MAX_FILES, __webpack_exports__ENTITY_CODE_MAX_LENGTH as ENTITY_CODE_MAX_LENGTH, __webpack_exports__ENTITY_CODE_PATTERN as ENTITY_CODE_PATTERN, __webpack_exports__ENTITY_DEFINITION_MESSAGES as ENTITY_DEFINITION_MESSAGES, __webpack_exports__ENTITY_FLOW_ENDPOINTS as ENTITY_FLOW_ENDPOINTS, __webpack_exports__ENTITY_TABLE_PREFIX as ENTITY_TABLE_PREFIX, __webpack_exports__FIELD_DEFINITION_MESSAGES as FIELD_DEFINITION_MESSAGES, __webpack_exports__FIELD_VALIDATION_MESSAGES as FIELD_VALIDATION_MESSAGES, __webpack_exports__FLOW_DEFINITION_MESSAGES as FLOW_DEFINITION_MESSAGES, __webpack_exports__FLOW_ERROR_MESSAGES as FLOW_ERROR_MESSAGES, __webpack_exports__FLOW_MESSAGES as FLOW_MESSAGES, __webpack_exports__FLOW_SHAPE_MESSAGES as FLOW_SHAPE_MESSAGES, __webpack_exports__FLOW_SKIP_MESSAGES as FLOW_SKIP_MESSAGES, __webpack_exports__FLOW_SUBJECT_MESSAGES as FLOW_SUBJECT_MESSAGES, __webpack_exports__FLOW_VALIDATION_MESSAGES as FLOW_VALIDATION_MESSAGES, __webpack_exports__GENERIC_RECORD_MESSAGES as GENERIC_RECORD_MESSAGES, __webpack_exports__RULE_ENGINE_MESSAGES as RULE_ENGINE_MESSAGES, __webpack_exports__SCHEMA_BLOCKER_MESSAGES as SCHEMA_BLOCKER_MESSAGES, __webpack_exports__SCHEMA_FINDING_MESSAGES as SCHEMA_FINDING_MESSAGES, __webpack_exports__SCHEMA_IMPACT_MESSAGES as SCHEMA_IMPACT_MESSAGES, __webpack_exports__SCHEMA_MESSAGES as SCHEMA_MESSAGES, __webpack_exports__SCHEMA_PRECHECK_MESSAGES as SCHEMA_PRECHECK_MESSAGES, __webpack_exports__SCHEMA_STEP_MESSAGES as SCHEMA_STEP_MESSAGES, __webpack_exports__SCHEMA_WARNING_MESSAGES as SCHEMA_WARNING_MESSAGES };
|
package/fesm/docs/index.js
CHANGED
|
@@ -50,7 +50,7 @@ to a company or branch, add fields such as \`company_id\` / \`branch_id\` and ma
|
|
|
50
50
|
- \`/entity-builder/entity-definitions/*\` - Entities, schema changes, health and history
|
|
51
51
|
- \`/entity-builder/field-definitions/*\` - Field metadata (read-only; changes go through schema changes)
|
|
52
52
|
- \`/entity-builder/flows/*\`, \`/entity-builder/flow-executions/*\` - Flows
|
|
53
|
-
- \`/api-flows/:slug\` - Call a flow
|
|
53
|
+
- \`/api-flows/:slug[/:path]\` - Call a flow (each Request step with a path answers on its own URL)
|
|
54
54
|
- \`/entity-builder/bundles/*\` - Promote entities and flows between environments: export a bundle, plan and apply its import
|
|
55
55
|
|
|
56
56
|
## Common Error Codes
|
package/fesm/guards/index.js
CHANGED
|
@@ -38,7 +38,9 @@ function _ts_param(paramIndex, decorator) {
|
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
const DESIGNER_WRITE_HANDLERS = 'entity_builder:designer_write_handlers';
|
|
41
|
+
const DESIGNER_REPAIR_HANDLER = 'entity_builder:designer_repair_handler';
|
|
41
42
|
/** The handlers of a controller (inherited ones included) that change definitions by hand. */ const DesignerWrites = (...handlers)=>(0,_nestjs_common__rspack_import_0.SetMetadata)(DESIGNER_WRITE_HANDLERS, handlers);
|
|
43
|
+
/** The one handler whose `repair` action still runs while read-only; any other handler is refused whatever its body says. */ const DesignerAllowsRepair = ()=>(0,_nestjs_common__rspack_import_0.SetMetadata)(DESIGNER_REPAIR_HANDLER, true);
|
|
42
44
|
class DesignerWritableInterceptor {
|
|
43
45
|
reflector;
|
|
44
46
|
config;
|
|
@@ -58,7 +60,9 @@ class DesignerWritableInterceptor {
|
|
|
58
60
|
isLocked(context) {
|
|
59
61
|
if (!this.config.isDesignerReadOnly()) return false;
|
|
60
62
|
const handlers = this.reflector.get(DESIGNER_WRITE_HANDLERS, context.getClass()) ?? [];
|
|
61
|
-
|
|
63
|
+
const handler = context.getHandler();
|
|
64
|
+
if (!handlers.includes(handler.name)) return false;
|
|
65
|
+
if (!this.reflector.get(DESIGNER_REPAIR_HANDLER, handler)) return true;
|
|
62
66
|
return context.switchToHttp().getRequest().body?.action !== _dtos_schema_change_dto_js__rspack_import_2/* .SchemaChangeAction.REPAIR */.M3.REPAIR;
|
|
63
67
|
}
|
|
64
68
|
}
|
|
@@ -74,9 +78,10 @@ DesignerWritableInterceptor = _ts_decorate([
|
|
|
74
78
|
], DesignerWritableInterceptor);
|
|
75
79
|
|
|
76
80
|
__webpack_require__.d(__webpack_exports__, {
|
|
77
|
-
|
|
81
|
+
Xg: () => (DesignerWritableInterceptor)
|
|
78
82
|
}, {
|
|
79
|
-
|
|
83
|
+
H6: DesignerAllowsRepair,
|
|
84
|
+
Wq: DesignerWrites
|
|
80
85
|
});
|
|
81
86
|
|
|
82
87
|
|
|
@@ -234,8 +239,7 @@ class FlowAccessGuard {
|
|
|
234
239
|
return true;
|
|
235
240
|
}
|
|
236
241
|
case 'jwt':
|
|
237
|
-
|
|
238
|
-
return true;
|
|
242
|
+
return this.authenticate(context);
|
|
239
243
|
case 'permission':
|
|
240
244
|
{
|
|
241
245
|
if (!await this.authenticate(context)) return false;
|
|
@@ -278,8 +282,9 @@ FlowAccessGuard = _ts_decorate([
|
|
|
278
282
|
|
|
279
283
|
__webpack_require__.d(__webpack_exports__, {
|
|
280
284
|
CA: () => (/* reexport safe */ _flow_access_guard_js__rspack_import_0.C),
|
|
281
|
-
|
|
282
|
-
|
|
285
|
+
H6: () => (/* reexport safe */ _designer_writable_interceptor_js__rspack_import_1.H6),
|
|
286
|
+
Wq: () => (/* reexport safe */ _designer_writable_interceptor_js__rspack_import_1.Wq),
|
|
287
|
+
Xg: () => (/* reexport safe */ _designer_writable_interceptor_js__rspack_import_1.Xg)
|
|
283
288
|
});
|
|
284
289
|
|
|
285
290
|
|
|
@@ -306,7 +311,8 @@ import * as __rspack_chunk_5 from '../677.js';
|
|
|
306
311
|
__webpack_require__.C(__rspack_chunk_5);
|
|
307
312
|
import * as __rspack_chunk_6 from './index.js';
|
|
308
313
|
__webpack_require__.C(__rspack_chunk_6);
|
|
309
|
-
var __webpack_exports__ = __webpack_exec__(5460);var
|
|
314
|
+
var __webpack_exports__ = __webpack_exec__(5460);var __webpack_exports__DesignerAllowsRepair = __webpack_exports__.H6;
|
|
315
|
+
var __webpack_exports__DesignerWritableInterceptor = __webpack_exports__.Xg;
|
|
310
316
|
var __webpack_exports__DesignerWrites = __webpack_exports__.Wq;
|
|
311
317
|
var __webpack_exports__FlowAccessGuard = __webpack_exports__.CA;
|
|
312
|
-
export { __webpack_exports__DesignerWritableInterceptor as DesignerWritableInterceptor, __webpack_exports__DesignerWrites as DesignerWrites, __webpack_exports__FlowAccessGuard as FlowAccessGuard };
|
|
318
|
+
export { __webpack_exports__DesignerAllowsRepair as DesignerAllowsRepair, __webpack_exports__DesignerWritableInterceptor as DesignerWritableInterceptor, __webpack_exports__DesignerWrites as DesignerWrites, __webpack_exports__FlowAccessGuard as FlowAccessGuard };
|