@flusys/nestjs-entity-builder 9.1.0-rc.1 → 9.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -23
- package/config/entity-builder.constants.d.ts +2 -0
- package/config/message-keys.d.ts +102 -13
- package/controllers/definition-bundle.controller.d.ts +15 -0
- package/controllers/flow-definition.controller.d.ts +7 -1
- package/controllers/flow-runtime.controller.d.ts +16 -8
- package/controllers/index.d.ts +1 -1
- package/dtos/definition-bundle.dto.d.ts +57 -0
- package/dtos/flow.dto.d.ts +13 -20
- package/dtos/index.d.ts +1 -0
- package/entities/flow-definition.entity.d.ts +3 -9
- package/entities/flow-execution.entity.d.ts +3 -0
- package/entities/flow-version.entity.d.ts +10 -0
- package/entities/index.d.ts +3 -3
- package/fesm/21.js +105 -15
- package/fesm/458.js +695 -0
- package/fesm/{489.js → 582.js} +22 -30
- package/fesm/{996.js → 677.js} +1562 -1064
- package/fesm/794.js +135 -240
- package/fesm/{719.js → 870.js} +2065 -324
- package/fesm/{362.js → 897.js} +572 -8
- package/fesm/{606.js → 946.js} +621 -296
- package/fesm/config/index.js +15 -2
- package/fesm/controllers/index.js +9 -9
- package/fesm/docs/index.js +7 -4
- package/fesm/dtos/index.js +451 -256
- package/fesm/entities/index.js +58 -3
- package/fesm/guards/index.js +106 -22
- package/fesm/index.js +429 -937
- package/fesm/interfaces/index.js +19 -2
- package/fesm/modules/index.js +10 -627
- package/fesm/rule-engine/index.js +12 -3
- package/fesm/services/index.js +101 -29
- package/flow-engine/flow-api-key.d.ts +3 -7
- package/flow-engine/flow-graph.validator.d.ts +5 -4
- package/flow-engine/flow-permission-logic.d.ts +2 -0
- package/flow-engine/flow-run.types.d.ts +19 -9
- package/flow-engine/flow.types.d.ts +115 -11
- package/guards/designer-writable.interceptor.d.ts +12 -0
- package/guards/index.d.ts +1 -0
- package/interfaces/definition-bundle.interface.d.ts +111 -0
- package/interfaces/entity-builder-module.interface.d.ts +6 -0
- package/interfaces/flow-definition.interface.d.ts +13 -9
- package/interfaces/index.d.ts +1 -0
- package/package.json +5 -5
- package/rule-engine/rule-engine.service.d.ts +1 -0
- package/rule-engine/rule-permission.d.ts +3 -7
- package/services/definition-bundle.diff.d.ts +62 -0
- package/services/definition-bundle.file.d.ts +7 -0
- package/services/definition-bundle.service.d.ts +32 -0
- package/services/entity-builder-config.service.d.ts +2 -0
- package/services/entity-flow-scaffold.d.ts +4 -3
- package/services/flow-definition.service.d.ts +26 -12
- package/services/flow-execution.service.d.ts +7 -0
- package/services/flow-executor.service.d.ts +9 -8
- package/services/flow-runtime.service.d.ts +2 -1
- package/services/generic-entity.service.d.ts +1 -1
- package/services/index.d.ts +3 -1
- package/services/schema-evolution.service.d.ts +3 -1
- package/services/schema-sync.service.d.ts +6 -2
- package/controllers/flow-api-key.controller.d.ts +0 -14
- package/entities/flow-api-key.entity.d.ts +0 -10
- package/services/flow-api-key.service.d.ts +0 -31
package/fesm/config/index.js
CHANGED
|
@@ -3,6 +3,11 @@ 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
|
+
* Largest bundle file plan-import / apply-import accept. The bundle is uploaded as a file, so the app's
|
|
8
|
+
* JSON body limit (Express's 100kb default) never applies to it and the app needs no setup for it.
|
|
9
|
+
*/ const ENTITY_BUNDLE_MAX_BYTES = 20 * 1024 * 1024;
|
|
10
|
+
/** A name `${var:NAME}` can carry; any other name could never be resolved on import. */ const BUNDLE_VARIABLE_NAME_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
6
11
|
/**
|
|
7
12
|
* Identifier whitelist enforced on every EntityDefinition/FieldDefinition `code`.
|
|
8
13
|
* Also the exact contract SchemaSyncService's DDL engine validates against
|
|
@@ -26,6 +31,8 @@ const ENTITY_BUILDER_MODULE_OPTIONS = 'ENTITY_BUILDER_MODULE_OPTIONS';
|
|
|
26
31
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
32
|
}, {
|
|
28
33
|
CP: ENTITY_BUILDER_MODULE_OPTIONS,
|
|
34
|
+
EA: ENTITY_BUNDLE_MAX_BYTES,
|
|
35
|
+
JI: BUNDLE_VARIABLE_NAME_PATTERN,
|
|
29
36
|
WT: ENTITY_FLOW_ENDPOINTS,
|
|
30
37
|
vs: ENTITY_CODE_PATTERN
|
|
31
38
|
});
|
|
@@ -61,10 +68,12 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
61
68
|
__webpack_require__.d(__webpack_exports__, {
|
|
62
69
|
CB: () => (/* reexport safe */ _message_keys_js__rspack_import_2.CB),
|
|
63
70
|
CP: () => (/* reexport safe */ _entity_builder_constants_js__rspack_import_0.CP),
|
|
71
|
+
EA: () => (/* reexport safe */ _entity_builder_constants_js__rspack_import_0.EA),
|
|
64
72
|
EQ: () => (/* reexport safe */ _message_keys_js__rspack_import_2.EQ),
|
|
65
73
|
GY: () => (/* reexport safe */ _message_keys_js__rspack_import_2.GY),
|
|
66
74
|
Hu: () => (/* reexport safe */ _message_keys_js__rspack_import_2.Hu),
|
|
67
75
|
IP: () => (/* reexport safe */ _message_keys_js__rspack_import_2.IP),
|
|
76
|
+
JI: () => (/* reexport safe */ _entity_builder_constants_js__rspack_import_0.JI),
|
|
68
77
|
KA: () => (/* reexport safe */ (/* inlined export _entity_builder_constants_js__rspack_import_0 */63)),
|
|
69
78
|
KE: () => (/* reexport safe */ _message_keys_js__rspack_import_2.KE),
|
|
70
79
|
M3: () => (/* reexport safe */ _message_keys_js__rspack_import_2.M3),
|
|
@@ -76,6 +85,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
76
85
|
WT: () => (/* reexport safe */ _entity_builder_constants_js__rspack_import_0.WT),
|
|
77
86
|
aB: () => (/* reexport safe */ _message_keys_js__rspack_import_2.aB),
|
|
78
87
|
bc: () => (/* reexport safe */ _message_keys_js__rspack_import_2.bc),
|
|
88
|
+
iX: () => (/* reexport safe */ _message_keys_js__rspack_import_2.iX),
|
|
79
89
|
j4: () => (/* reexport safe */ _message_keys_js__rspack_import_2.j4),
|
|
80
90
|
oc: () => (/* reexport safe */ _message_keys_js__rspack_import_2.oc),
|
|
81
91
|
pL: () => (/* reexport safe */ _message_keys_js__rspack_import_2.pL),
|
|
@@ -97,9 +107,12 @@ import * as __rspack_chunk_1 from '../21.js';
|
|
|
97
107
|
__webpack_require__.C(__rspack_chunk_1);
|
|
98
108
|
import * as __rspack_chunk_2 from './index.js';
|
|
99
109
|
__webpack_require__.C(__rspack_chunk_2);
|
|
100
|
-
var __webpack_exports__ = __webpack_exec__(4112);var
|
|
110
|
+
var __webpack_exports__ = __webpack_exec__(4112);var __webpack_exports__BUNDLE_MESSAGES = __webpack_exports__.iX;
|
|
111
|
+
var __webpack_exports__BUNDLE_VARIABLE_NAME_PATTERN = __webpack_exports__.JI;
|
|
112
|
+
var __webpack_exports__ENTITY_BUILDER_EVENT_ENTITIES = __webpack_exports__.P1;
|
|
101
113
|
var __webpack_exports__ENTITY_BUILDER_EVENT_MODULE = __webpack_exports__.SD;
|
|
102
114
|
var __webpack_exports__ENTITY_BUILDER_MODULE_OPTIONS = __webpack_exports__.CP;
|
|
115
|
+
var __webpack_exports__ENTITY_BUNDLE_MAX_BYTES = __webpack_exports__.EA;
|
|
103
116
|
var __webpack_exports__ENTITY_CODE_MAX_LENGTH = __webpack_exports__.KA;
|
|
104
117
|
var __webpack_exports__ENTITY_CODE_PATTERN = __webpack_exports__.vs;
|
|
105
118
|
var __webpack_exports__ENTITY_DEFINITION_MESSAGES = __webpack_exports__.pL;
|
|
@@ -123,4 +136,4 @@ var __webpack_exports__SCHEMA_MESSAGES = __webpack_exports__.Hu;
|
|
|
123
136
|
var __webpack_exports__SCHEMA_PRECHECK_MESSAGES = __webpack_exports__.NE;
|
|
124
137
|
var __webpack_exports__SCHEMA_STEP_MESSAGES = __webpack_exports__.EQ;
|
|
125
138
|
var __webpack_exports__SCHEMA_WARNING_MESSAGES = __webpack_exports__.Uu;
|
|
126
|
-
export { __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_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 };
|
|
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 };
|
|
@@ -5,24 +5,24 @@ import { __webpack_require__ } from '../runtime.js';
|
|
|
5
5
|
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
|
|
6
6
|
import * as __rspack_chunk_1 from '../21.js';
|
|
7
7
|
__webpack_require__.C(__rspack_chunk_1);
|
|
8
|
-
import * as __rspack_chunk_2 from '../
|
|
8
|
+
import * as __rspack_chunk_2 from '../897.js';
|
|
9
9
|
__webpack_require__.C(__rspack_chunk_2);
|
|
10
|
-
import * as __rspack_chunk_3 from '../
|
|
10
|
+
import * as __rspack_chunk_3 from '../582.js';
|
|
11
11
|
__webpack_require__.C(__rspack_chunk_3);
|
|
12
|
-
import * as __rspack_chunk_4 from '../
|
|
12
|
+
import * as __rspack_chunk_4 from '../794.js';
|
|
13
13
|
__webpack_require__.C(__rspack_chunk_4);
|
|
14
|
-
import * as __rspack_chunk_5 from '../
|
|
14
|
+
import * as __rspack_chunk_5 from '../677.js';
|
|
15
15
|
__webpack_require__.C(__rspack_chunk_5);
|
|
16
|
-
import * as __rspack_chunk_6 from '../
|
|
16
|
+
import * as __rspack_chunk_6 from '../870.js';
|
|
17
17
|
__webpack_require__.C(__rspack_chunk_6);
|
|
18
|
-
import * as __rspack_chunk_7 from '../
|
|
18
|
+
import * as __rspack_chunk_7 from '../946.js';
|
|
19
19
|
__webpack_require__.C(__rspack_chunk_7);
|
|
20
20
|
import * as __rspack_chunk_8 from './index.js';
|
|
21
21
|
__webpack_require__.C(__rspack_chunk_8);
|
|
22
|
-
var __webpack_exports__ = __webpack_exec__(
|
|
22
|
+
var __webpack_exports__ = __webpack_exec__(729);var __webpack_exports__DefinitionBundleController = __webpack_exports__.AP;
|
|
23
|
+
var __webpack_exports__EntityDefinitionController = __webpack_exports__.hv;
|
|
23
24
|
var __webpack_exports__FieldDefinitionController = __webpack_exports__.GX;
|
|
24
|
-
var __webpack_exports__FlowApiKeyController = __webpack_exports__.Sv;
|
|
25
25
|
var __webpack_exports__FlowDefinitionController = __webpack_exports__.W8;
|
|
26
26
|
var __webpack_exports__FlowExecutionController = __webpack_exports__.VU;
|
|
27
27
|
var __webpack_exports__FlowRuntimeController = __webpack_exports__.bw;
|
|
28
|
-
export {
|
|
28
|
+
export { __webpack_exports__DefinitionBundleController as DefinitionBundleController, __webpack_exports__EntityDefinitionController as EntityDefinitionController, __webpack_exports__FieldDefinitionController as FieldDefinitionController, __webpack_exports__FlowDefinitionController as FlowDefinitionController, __webpack_exports__FlowExecutionController as FlowExecutionController, __webpack_exports__FlowRuntimeController as FlowRuntimeController };
|
package/fesm/docs/index.js
CHANGED
|
@@ -33,10 +33,10 @@ Runtime-defined business entities backed by real database tables, whose records
|
|
|
33
33
|
### 📄 Records
|
|
34
34
|
- No record API: flow entity steps are the only way records are read or written
|
|
35
35
|
- Field validation, relation checks, search, filter, sort and pagination inside those steps
|
|
36
|
-
- Permissions per entity and action: \`entity_builder.entity.<entityCode>.<create|read|update|delete>\`,
|
|
36
|
+
- Permissions per entity and action: \`entity_builder.entity.<entityCode>.<create|read|update|delete>\`, asked for by the entity's ready-made flow as its URLs' access (flow steps run no per-entity check)
|
|
37
37
|
|
|
38
38
|
### ⚙️ Automation
|
|
39
|
-
- **Flows**: visual virtual APIs served at \`POST /api-flows/:slug\` (jwt, permission, api_key or public) - validate, branch, loop, read/write entities
|
|
39
|
+
- **Flows**: visual virtual APIs served at \`POST /api-flows/:slug[/:path]\` - each Request step sets its own access (jwt, permission, api_key or public), transaction, time limit and rate limit - validate, branch, loop, read/write entities, call other flows, HTTP requests and events
|
|
40
40
|
|
|
41
41
|
## Data Isolation
|
|
42
42
|
|
|
@@ -49,8 +49,9 @@ to a company or branch, add fields such as \`company_id\` / \`branch_id\` and ma
|
|
|
49
49
|
|
|
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
|
-
- \`/entity-builder/flows/*\`, \`/entity-builder/flow-
|
|
52
|
+
- \`/entity-builder/flows/*\`, \`/entity-builder/flow-executions/*\` - Flows
|
|
53
53
|
- \`/api-flows/:slug\` - Call a flow
|
|
54
|
+
- \`/entity-builder/bundles/*\` - Promote entities and flows between environments: export a bundle, plan and apply its import
|
|
54
55
|
|
|
55
56
|
## Common Error Codes
|
|
56
57
|
|
|
@@ -58,7 +59,9 @@ to a company or branch, add fields such as \`company_id\` / \`branch_id\` and ma
|
|
|
58
59
|
- **401 Unauthorized**: Missing or invalid authentication
|
|
59
60
|
- **403 Forbidden**: Insufficient permissions, or the entity is deprecated
|
|
60
61
|
- **404 Not Found**: Entity, record or flow not found
|
|
61
|
-
- **409 Conflict**: Duplicate code
|
|
62
|
+
- **409 Conflict**: Duplicate code, a blocked schema change or a blocked import
|
|
63
|
+
- **413 Payload Too Large**: A bundle file over \`ENTITY_BUNDLE_MAX_BYTES\` (20 MB); bundles are uploaded as files, so the app's JSON limit never applies
|
|
64
|
+
- **423 Locked**: The designer is read-only in this environment (\`designer.readOnly\`): import a bundle instead
|
|
62
65
|
`,
|
|
63
66
|
version: '1.0',
|
|
64
67
|
path: 'api/docs/entity-builder',
|