nesoi 3.2.9 → 3.3.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 +33 -2
- package/lib/bundler/browser/browser.app.d.ts +32 -0
- package/lib/bundler/browser/browser.app.js +51 -0
- package/lib/bundler/browser/browser.bundler.d.ts +5 -0
- package/lib/bundler/browser/browser.bundler.js +27 -0
- package/lib/bundler/browser/stages/8_replace_nesoi_for_browser_stage.d.ts +13 -0
- package/lib/bundler/browser/stages/8_replace_nesoi_for_browser_stage.js +74 -0
- package/lib/bundler/distributed/distributed.app.config.d.ts +43 -0
- package/lib/{engine/apps → bundler}/distributed/distributed.app.config.js +1 -1
- package/lib/{engine/apps → bundler}/distributed/distributed.app.d.ts +14 -14
- package/lib/{engine/apps → bundler}/distributed/distributed.app.js +8 -3
- package/lib/{compiler/apps/distributed/distributed_compiler.d.ts → bundler/distributed/distributed.bundler.d.ts} +7 -7
- package/lib/{compiler/apps/distributed/distributed_compiler.js → bundler/distributed/distributed.bundler.js} +11 -11
- package/lib/{engine/apps → bundler}/distributed/distributed_node.app.d.ts +14 -20
- package/lib/{engine/apps → bundler}/distributed/distributed_node.app.js +18 -50
- package/lib/bundler/distributed/stages/1_mkdir_stage.d.ts +15 -0
- package/lib/{compiler/apps → bundler}/distributed/stages/1_mkdir_stage.js +6 -6
- package/lib/bundler/distributed/stages/2_build_typescript_stage.d.ts +15 -0
- package/lib/{compiler/apps → bundler}/distributed/stages/2_build_typescript_stage.js +7 -7
- package/lib/bundler/distributed/stages/3_copy_types_stage.d.ts +15 -0
- package/lib/{compiler/apps → bundler}/distributed/stages/3_copy_types_stage.js +7 -7
- package/lib/bundler/distributed/stages/4_dump_modules_stage.d.ts +16 -0
- package/lib/{compiler/apps → bundler}/distributed/stages/4_dump_modules_stage.js +5 -5
- package/lib/{compiler/apps → bundler}/distributed/stages/5_copy_static_stage.js +3 -3
- package/lib/{compiler/apps → bundler}/distributed/stages/6_dump_cli_stage.js +3 -3
- package/lib/{compiler/apps → bundler}/distributed/stages/7_dump_package_json_stage.js +3 -3
- package/lib/{engine/apps → bundler}/monolyth/monolyth.app.d.ts +13 -13
- package/lib/{engine/apps → bundler}/monolyth/monolyth.app.js +13 -10
- package/lib/{compiler/apps/monolyth/monolyth_compiler.d.ts → bundler/monolyth/monolyth.bundler.d.ts} +9 -7
- package/lib/{compiler/apps/monolyth/monolyth_compiler.js → bundler/monolyth/monolyth.bundler.js} +13 -12
- package/lib/bundler/monolyth/stages/1_mkdir_stage.d.ts +15 -0
- package/lib/{compiler/apps → bundler}/monolyth/stages/1_mkdir_stage.js +6 -6
- package/lib/bundler/monolyth/stages/2_build_typescript_stage.d.ts +15 -0
- package/lib/{compiler/apps → bundler}/monolyth/stages/2_build_typescript_stage.js +8 -7
- package/lib/bundler/monolyth/stages/3_copy_types_stage.d.ts +15 -0
- package/lib/{compiler/apps → bundler}/monolyth/stages/3_copy_types_stage.js +7 -7
- package/lib/{compiler/apps → bundler}/monolyth/stages/4_dump_modules_stage.d.ts +4 -4
- package/lib/{compiler/apps → bundler}/monolyth/stages/4_dump_modules_stage.js +29 -16
- package/lib/{compiler/apps → bundler}/monolyth/stages/5_copy_static_stage.d.ts +4 -4
- package/lib/{compiler/apps → bundler}/monolyth/stages/5_copy_static_stage.js +7 -7
- package/lib/bundler/monolyth/stages/6_dump_cli_stage.d.ts +15 -0
- package/lib/{compiler/apps → bundler}/monolyth/stages/6_dump_cli_stage.js +4 -4
- package/lib/{compiler/apps → bundler}/monolyth/stages/7_dump_package_json_stage.d.ts +4 -4
- package/lib/{compiler/apps → bundler}/monolyth/stages/7_dump_package_json_stage.js +14 -11
- package/lib/compiler/compiler.d.ts +1 -6
- package/lib/compiler/compiler.js +1 -1
- package/lib/compiler/elements/bucket.element.d.ts +2 -1
- package/lib/compiler/elements/bucket.element.js +16 -21
- package/lib/compiler/elements/cached.element.d.ts +1 -1
- package/lib/compiler/elements/cached.element.js +2 -2
- package/lib/compiler/elements/constants.element.d.ts +1 -1
- package/lib/compiler/elements/constants.element.js +2 -0
- package/lib/compiler/elements/controller.element.js +3 -3
- package/lib/compiler/elements/element.d.ts +6 -13
- package/lib/compiler/elements/element.js +11 -9
- package/lib/compiler/elements/externals.element.js +2 -2
- package/lib/compiler/elements/job.element.d.ts +1 -1
- package/lib/compiler/elements/job.element.js +1 -1
- package/lib/compiler/elements/machine.element.d.ts +2 -2
- package/lib/compiler/elements/machine.element.js +7 -7
- package/lib/compiler/elements/message.element.d.ts +1 -1
- package/lib/compiler/elements/message.element.js +26 -26
- package/lib/compiler/elements/queue.element.js +1 -1
- package/lib/compiler/elements/resource.element.d.ts +1 -1
- package/lib/compiler/elements/resource.element.js +9 -9
- package/lib/compiler/elements/topic.element.js +1 -1
- package/lib/compiler/error.d.ts +1 -5
- package/lib/compiler/error.js +3 -15
- package/lib/compiler/helpers/dump_helpers.d.ts +1 -1
- package/lib/compiler/helpers/dump_helpers.js +1 -1
- package/lib/compiler/index.d.ts +1 -3
- package/lib/compiler/index.js +15 -7
- package/lib/compiler/module.js +12 -12
- package/lib/compiler/progressive.d.ts +3 -4
- package/lib/compiler/progressive.js +3 -4
- package/lib/compiler/stages/2_treeshake_stage.js +4 -0
- package/lib/compiler/stages/3_extract_ts_stage.js +7 -7
- package/lib/compiler/stages/4_build_schemas_stage.js +3 -16
- package/lib/compiler/stages/6_build_elements_stage.js +1 -1
- package/lib/compiler/stages/7_dump_stage.js +35 -10
- package/lib/compiler/typescript/bridge/extract.js +24 -0
- package/lib/compiler/typescript/bridge/inject.js +18 -3
- package/lib/compiler/typescript/bridge/organize.d.ts +4 -0
- package/lib/compiler/typescript/bridge/organize.js +41 -22
- package/lib/compiler/typescript/error.d.ts +2 -83
- package/lib/compiler/typescript/error.js +6 -219
- package/lib/compiler/typescript/parser.js +3 -3
- package/lib/compiler/typescript/source.d.ts +2 -2
- package/lib/compiler/typescript/transformers/app_inject.transformer.js +13 -4
- package/lib/compiler/typescript/typescript_compiler.d.ts +3 -3
- package/lib/compiler/typescript/typescript_compiler.js +2 -2
- package/lib/elements/blocks/block.builder.d.ts +7 -4
- package/lib/elements/blocks/block.builder.js +24 -13
- package/lib/elements/blocks/block.js +2 -2
- package/lib/elements/blocks/block.schema.d.ts +12 -9
- package/lib/elements/blocks/block.schema.js +2 -2
- package/lib/elements/blocks/job/internal/machine_job.builder.d.ts +6 -5
- package/lib/elements/blocks/job/internal/machine_job.builder.js +3 -3
- package/lib/elements/blocks/job/internal/resource_job.builder.d.ts +11 -10
- package/lib/elements/blocks/job/internal/resource_job.builder.js +9 -6
- package/lib/elements/blocks/job/internal/resource_job.js +3 -6
- package/lib/elements/blocks/job/job.builder.d.ts +5 -5
- package/lib/elements/blocks/job/job.builder.js +7 -7
- package/lib/elements/blocks/job/job.js +1 -1
- package/lib/elements/blocks/job/job.schema.d.ts +5 -5
- package/lib/elements/blocks/job/job.schema.js +3 -3
- package/lib/elements/blocks/machine/machine.builder.d.ts +2 -2
- package/lib/elements/blocks/machine/machine.builder.js +12 -9
- package/lib/elements/blocks/machine/machine.js +7 -7
- package/lib/elements/blocks/machine/machine.schema.d.ts +23 -23
- package/lib/elements/blocks/machine/machine.schema.js +9 -9
- package/lib/elements/blocks/machine/machine_state.builder.d.ts +1 -0
- package/lib/elements/blocks/machine/machine_state.builder.js +31 -29
- package/lib/elements/blocks/machine/machine_transition.builder.d.ts +2 -2
- package/lib/elements/blocks/machine/machine_transition.builder.js +8 -8
- package/lib/elements/blocks/queue/queue.builder.d.ts +3 -3
- package/lib/elements/blocks/queue/queue.builder.js +3 -3
- package/lib/elements/blocks/queue/queue.schema.d.ts +6 -6
- package/lib/elements/blocks/queue/queue.schema.js +3 -3
- package/lib/elements/blocks/resource/resource.builder.d.ts +2 -2
- package/lib/elements/blocks/resource/resource.builder.js +37 -40
- package/lib/elements/blocks/resource/resource.d.ts +2 -2
- package/lib/elements/blocks/resource/resource.js +10 -18
- package/lib/elements/blocks/resource/resource.schema.d.ts +15 -15
- package/lib/elements/blocks/resource/resource.schema.js +8 -8
- package/lib/elements/blocks/topic/topic.builder.d.ts +2 -2
- package/lib/elements/blocks/topic/topic.builder.js +4 -4
- package/lib/elements/blocks/topic/topic.d.ts +2 -2
- package/lib/elements/blocks/topic/topic.js +7 -7
- package/lib/elements/blocks/topic/topic.schema.d.ts +6 -6
- package/lib/elements/blocks/topic/topic.schema.js +3 -3
- package/lib/elements/edge/controller/adapters/cli.controller_adapter.js +1 -1
- package/lib/elements/edge/controller/adapters/controller_adapter.d.ts +2 -2
- package/lib/elements/edge/controller/adapters/controller_adapter.js +2 -2
- package/lib/elements/edge/controller/controller.builder.d.ts +14 -13
- package/lib/elements/edge/controller/controller.builder.js +52 -42
- package/lib/elements/edge/controller/controller.d.ts +3 -3
- package/lib/elements/edge/controller/controller.js +12 -12
- package/lib/elements/edge/controller/controller.schema.d.ts +17 -16
- package/lib/elements/edge/controller/controller.schema.js +11 -11
- package/lib/elements/edge/externals/externals.builder.d.ts +8 -13
- package/lib/elements/edge/externals/externals.builder.js +43 -11
- package/lib/elements/edge/externals/externals.schema.d.ts +8 -7
- package/lib/elements/edge/externals/externals.schema.js +5 -3
- package/lib/elements/entities/bucket/adapters/browserdb.bucket_adapter.d.ts +45 -0
- package/lib/elements/entities/bucket/adapters/browserdb.bucket_adapter.js +164 -0
- package/lib/elements/entities/bucket/adapters/browserdb.service.d.ts +30 -0
- package/lib/elements/entities/bucket/adapters/browserdb.service.js +97 -0
- package/lib/elements/entities/bucket/adapters/bucket_adapter.d.ts +6 -1
- package/lib/elements/entities/bucket/adapters/bucket_adapter.js +7 -6
- package/lib/elements/entities/bucket/adapters/json.bucket_adapter.d.ts +1 -1
- package/lib/elements/entities/bucket/adapters/json.bucket_adapter.js +1 -0
- package/lib/elements/entities/bucket/adapters/memory.bucket_adapter.d.ts +1 -0
- package/lib/elements/entities/bucket/adapters/memory.bucket_adapter.js +14 -13
- package/lib/elements/entities/bucket/adapters/memory.nql.js +41 -35
- package/lib/elements/entities/bucket/bucket.builder.d.ts +6 -8
- package/lib/elements/entities/bucket/bucket.builder.js +19 -34
- package/lib/elements/entities/bucket/bucket.d.ts +2 -2
- package/lib/elements/entities/bucket/bucket.infer.d.ts +5 -5
- package/lib/elements/entities/bucket/bucket.js +19 -17
- package/lib/elements/entities/bucket/bucket.schema.d.ts +3 -3
- package/lib/elements/entities/bucket/bucket.schema.js +2 -2
- package/lib/elements/entities/bucket/cache/bucket_cache.js +14 -2
- package/lib/elements/entities/bucket/graph/bucket_graph.d.ts +3 -3
- package/lib/elements/entities/bucket/graph/bucket_graph.js +101 -29
- package/lib/elements/entities/bucket/graph/bucket_graph.schema.d.ts +3 -3
- package/lib/elements/entities/bucket/graph/bucket_graph_link.builder.d.ts +2 -2
- package/lib/elements/entities/bucket/graph/bucket_graph_link.builder.js +5 -3
- package/lib/elements/entities/bucket/model/bucket_model.builder.d.ts +2 -1
- package/lib/elements/entities/bucket/model/bucket_model.builder.js +2 -2
- package/lib/elements/entities/bucket/model/bucket_model.convert.js +3 -6
- package/lib/elements/entities/bucket/model/bucket_model.d.ts +13 -0
- package/lib/elements/entities/bucket/model/bucket_model.js +93 -0
- package/lib/elements/entities/bucket/model/bucket_model.schema.d.ts +4 -8
- package/lib/elements/entities/bucket/model/bucket_model.schema.js +0 -68
- package/lib/elements/entities/bucket/model/bucket_model_field.builder.d.ts +12 -4
- package/lib/elements/entities/bucket/model/bucket_model_field.builder.js +30 -33
- package/lib/elements/entities/bucket/query/nql.schema.d.ts +1 -1
- package/lib/elements/entities/bucket/query/nql_compiler.d.ts +8 -4
- package/lib/elements/entities/bucket/query/nql_compiler.js +44 -38
- package/lib/elements/entities/bucket/query/nql_engine.d.ts +1 -1
- package/lib/elements/entities/bucket/query/nql_engine.js +5 -2
- package/lib/elements/entities/bucket/view/bucket_view.builder.d.ts +2 -2
- package/lib/elements/entities/bucket/view/bucket_view.js +113 -81
- package/lib/elements/entities/bucket/view/bucket_view_field.builder.d.ts +9 -8
- package/lib/elements/entities/bucket/view/bucket_view_field.builder.js +8 -10
- package/lib/elements/entities/constants/constants.builder.d.ts +3 -3
- package/lib/elements/entities/constants/constants.builder.js +8 -8
- package/lib/elements/entities/constants/constants.schema.d.ts +8 -3
- package/lib/elements/entities/constants/constants.schema.js +7 -2
- package/lib/elements/entities/message/message.infer.d.ts +1 -5
- package/lib/elements/entities/message/message.js +2 -7
- package/lib/elements/entities/message/message.schema.js +1 -1
- package/lib/elements/entities/message/template/message_template.schema.d.ts +7 -5
- package/lib/elements/entities/message/template/message_template_field.builder.d.ts +18 -3
- package/lib/elements/entities/message/template/message_template_field.builder.js +49 -30
- package/lib/elements/entities/message/template/message_template_parser.js +2 -2
- package/lib/engine/{apps → app}/app.config.d.ts +11 -5
- package/lib/engine/{apps → app}/app.config.js +2 -2
- package/lib/engine/{apps → app}/app.d.ts +3 -2
- package/lib/engine/{apps → app}/app.js +3 -1
- package/lib/engine/{apps/distributed → app}/inc/inc.client.js +1 -1
- package/lib/engine/{apps/distributed → app}/inc/inc.server.js +3 -3
- package/lib/engine/{apps/distributed → app}/inc/sandbox.js +1 -1
- package/lib/engine/{apps → app}/inline.app.d.ts +2 -12
- package/lib/engine/{apps → app}/inline.app.js +37 -34
- package/lib/engine/auth/authn.d.ts +10 -12
- package/lib/engine/auth/zero.authn_provider.d.ts +3 -4
- package/lib/engine/auth/zero.authn_provider.js +0 -1
- package/lib/engine/builder.d.ts +28 -0
- package/lib/engine/builder.js +99 -0
- package/lib/engine/cli/cli.js +3 -2
- package/lib/engine/cli/ui.js +1 -0
- package/lib/engine/daemon.d.ts +28 -25
- package/lib/engine/daemon.js +37 -8
- package/lib/engine/data/error.d.ts +37 -3
- package/lib/engine/data/error.js +58 -16
- package/lib/engine/data/file.d.ts +1 -0
- package/lib/engine/data/file.js +4 -0
- package/lib/engine/dependency.d.ts +53 -81
- package/lib/engine/dependency.js +246 -120
- package/lib/engine/module.d.ts +18 -48
- package/lib/engine/module.js +78 -158
- package/lib/engine/space.d.ts +2 -2
- package/lib/engine/space.js +6 -6
- package/lib/engine/transaction/nodes/bucket.trx_node.d.ts +7 -4
- package/lib/engine/transaction/nodes/bucket.trx_node.js +66 -43
- package/lib/engine/transaction/nodes/bucket_query.trx_node.d.ts +10 -4
- package/lib/engine/transaction/nodes/bucket_query.trx_node.js +56 -45
- package/lib/engine/transaction/nodes/external.trx_node.d.ts +15 -0
- package/lib/engine/transaction/nodes/external.trx_node.js +53 -0
- package/lib/engine/transaction/nodes/job.trx_node.d.ts +7 -3
- package/lib/engine/transaction/nodes/job.trx_node.js +49 -29
- package/lib/engine/transaction/nodes/machine.trx_node.js +6 -6
- package/lib/engine/transaction/nodes/queue.trx_node.js +3 -3
- package/lib/engine/transaction/nodes/resource.trx_node.d.ts +7 -4
- package/lib/engine/transaction/nodes/resource.trx_node.js +68 -51
- package/lib/engine/transaction/nodes/topic.trx_node.js +9 -9
- package/lib/engine/transaction/trx.d.ts +15 -12
- package/lib/engine/transaction/trx.js +19 -3
- package/lib/engine/transaction/trx_engine.config.d.ts +4 -4
- package/lib/engine/transaction/trx_engine.d.ts +25 -7
- package/lib/engine/transaction/trx_engine.js +67 -16
- package/lib/engine/transaction/trx_node.d.ts +25 -21
- package/lib/engine/transaction/trx_node.js +99 -57
- package/lib/engine/tree.d.ts +4 -16
- package/lib/engine/tree.js +87 -57
- package/lib/{compiler → engine}/treeshake.d.ts +32 -32
- package/lib/{compiler → engine}/treeshake.js +272 -242
- package/lib/engine/util/console.js +3 -0
- package/lib/engine/util/crypto.d.ts +4 -3
- package/lib/engine/util/crypto.js +15 -5
- package/lib/engine/util/hash.js +5 -0
- package/lib/engine/util/log.d.ts +6 -8
- package/lib/engine/util/log.js +1 -1
- package/lib/engine/util/name_helpers.d.ts +37 -0
- package/lib/{compiler/helpers → engine/util}/name_helpers.js +33 -0
- package/lib/engine/util/parse.d.ts +4 -3
- package/lib/engine/util/parse.js +13 -28
- package/lib/engine/util/path.d.ts +1 -0
- package/lib/engine/util/path.js +14 -0
- package/lib/engine/util/random.d.ts +4 -0
- package/lib/engine/util/random.js +31 -0
- package/lib/engine/util/type.d.ts +8 -0
- package/lib/schema.d.ts +1 -1
- package/package.json +4 -1
- package/tools/joaquin/bucket.js +1 -1
- package/tools/joaquin/job.js +1 -1
- package/tools/joaquin/message.js +1 -1
- package/tools/joaquin/mock.js +2 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/lib/compiler/apps/distributed/stages/1_mkdir_stage.d.ts +0 -15
- package/lib/compiler/apps/distributed/stages/2_build_typescript_stage.d.ts +0 -15
- package/lib/compiler/apps/distributed/stages/3_copy_types_stage.d.ts +0 -15
- package/lib/compiler/apps/distributed/stages/4_dump_modules_stage.d.ts +0 -16
- package/lib/compiler/apps/monolyth/stages/1_mkdir_stage.d.ts +0 -15
- package/lib/compiler/apps/monolyth/stages/2_build_typescript_stage.d.ts +0 -15
- package/lib/compiler/apps/monolyth/stages/3_copy_types_stage.d.ts +0 -15
- package/lib/compiler/apps/monolyth/stages/6_dump_cli_stage.d.ts +0 -15
- package/lib/compiler/helpers/name_helpers.d.ts +0 -20
- package/lib/engine/apps/distributed/distributed.app.config.d.ts +0 -44
- package/lib/engine/apps/distributed/elements/distributed_job.d.ts +0 -7
- package/lib/engine/apps/distributed/elements/distributed_job.js +0 -11
- /package/lib/{compiler/apps → bundler}/distributed/stages/5_copy_static_stage.d.ts +0 -0
- /package/lib/{compiler/apps → bundler}/distributed/stages/6_dump_cli_stage.d.ts +0 -0
- /package/lib/{compiler/apps → bundler}/distributed/stages/7_dump_package_json_stage.d.ts +0 -0
- /package/lib/engine/{apps/distributed → app}/inc/inc.client.d.ts +0 -0
- /package/lib/engine/{apps/distributed → app}/inc/inc.server.d.ts +0 -0
- /package/lib/engine/{apps/distributed → app}/inc/sandbox.d.ts +0 -0
- /package/lib/engine/{apps → app}/service.d.ts +0 -0
- /package/lib/engine/{apps → app}/service.js +0 -0
|
@@ -40,12 +40,13 @@ exports.DumpStage = void 0;
|
|
|
40
40
|
const fs = __importStar(require("fs"));
|
|
41
41
|
const path_1 = __importDefault(require("path"));
|
|
42
42
|
const log_1 = require("../../engine/util/log");
|
|
43
|
-
const name_helpers_1 = require("
|
|
44
|
-
const dependency_1 = require("../../engine/dependency");
|
|
43
|
+
const name_helpers_1 = require("../../engine/util/name_helpers");
|
|
45
44
|
const bucket_element_1 = require("../elements/bucket.element");
|
|
46
45
|
const dump_helpers_1 = require("../helpers/dump_helpers");
|
|
47
46
|
const space_1 = require("../../engine/space");
|
|
47
|
+
/* @nesoi:browser ignore-start */
|
|
48
48
|
const progressive_1 = require("../progressive");
|
|
49
|
+
/* @nesoi:browser ignore-end */
|
|
49
50
|
/**
|
|
50
51
|
* [Compiler Stage #7]
|
|
51
52
|
* Dump the element schemas and types to the .nesoi folder.
|
|
@@ -60,8 +61,29 @@ class DumpStage {
|
|
|
60
61
|
async run() {
|
|
61
62
|
log_1.Log.info('compiler', 'stage.dump', 'Dumping Schemas and Types...');
|
|
62
63
|
const t0 = new Date().getTime();
|
|
64
|
+
/* @nesoi:browser ignore-start */
|
|
63
65
|
this.cache = await progressive_1.ProgressiveBuild.cache(this.compiler);
|
|
64
66
|
this.hash = await progressive_1.ProgressiveBuild.hash(this.compiler);
|
|
67
|
+
/* @nesoi:browser ignore-end */
|
|
68
|
+
/* @nesoi:browser add
|
|
69
|
+
this.cache = {
|
|
70
|
+
nesoidir: Space.path(this.compiler.space, '.nesoi'),
|
|
71
|
+
hash: {
|
|
72
|
+
$: 'old',
|
|
73
|
+
files: {},
|
|
74
|
+
modules: {},
|
|
75
|
+
space: 'old'
|
|
76
|
+
},
|
|
77
|
+
files: {},
|
|
78
|
+
modules: {},
|
|
79
|
+
types: {
|
|
80
|
+
space: {},
|
|
81
|
+
modules: {},
|
|
82
|
+
elements: {}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
this.hash = 'new';
|
|
86
|
+
*/
|
|
65
87
|
let spaceType;
|
|
66
88
|
if (this.hash.$ !== this.cache.hash.$) {
|
|
67
89
|
spaceType = this.dumpSpace();
|
|
@@ -75,7 +97,9 @@ class DumpStage {
|
|
|
75
97
|
this.dumpModule(module, spaceType);
|
|
76
98
|
}
|
|
77
99
|
});
|
|
100
|
+
/* @nesoi:browser ignore-start */
|
|
78
101
|
await progressive_1.ProgressiveBuild.save(this.compiler.space, this.cache, this.hash);
|
|
102
|
+
/* @nesoi:browser ignore-end */
|
|
79
103
|
const t = new Date().getTime();
|
|
80
104
|
log_1.Log.debug('compiler', 'stage.dump', `[t: ${(t - t0) / 1000} ms]`);
|
|
81
105
|
}
|
|
@@ -123,8 +147,8 @@ class DumpStage {
|
|
|
123
147
|
module.elements.forEach((element) => {
|
|
124
148
|
if (element.schema.$t === 'constants'
|
|
125
149
|
|| element.schema.$t === 'externals'
|
|
126
|
-
|| (this.hash.modules[element.schema.module].nodes[element.tag]
|
|
127
|
-
!== this.cache.hash.modules[element.schema.module]?.nodes[element.tag])) {
|
|
150
|
+
|| (this.hash.modules[element.schema.module].nodes[element.tag.full]
|
|
151
|
+
!== this.cache.hash.modules[element.schema.module]?.nodes[element.tag.full])) {
|
|
128
152
|
const filename = path_1.default.basename(element.filepath());
|
|
129
153
|
const elPath = path_1.default.resolve(dumpDir, filename);
|
|
130
154
|
fs.writeFileSync(elPath, element.dumpFileSchema(nesoiPath));
|
|
@@ -136,6 +160,7 @@ class DumpStage {
|
|
|
136
160
|
const nesoiPath = this.compiler.config?.nesoiPath ?? 'nesoi';
|
|
137
161
|
const moduleFile = [];
|
|
138
162
|
moduleFile.push(`import { $Module, $Constants, $Bucket, $Message, $Job, $Resource, $Machine, $Controller, $Queue, $Topic } from '${nesoiPath}/lib/elements';`);
|
|
163
|
+
moduleFile.push('import Space from \'./space\';');
|
|
139
164
|
moduleFile.push(`import { NesoiDate } from '${nesoiPath}/lib/engine/data/date';`);
|
|
140
165
|
moduleFile.push(`import { NesoiDatetime } from '${nesoiPath}/lib/engine/data/datetime';`);
|
|
141
166
|
moduleFile.push(`import { NesoiDecimal } from '${nesoiPath}/lib/engine/data/decimal';`);
|
|
@@ -196,8 +221,8 @@ class DumpStage {
|
|
|
196
221
|
.filter(el => el.$t !== 'externals')
|
|
197
222
|
.forEach((element) => {
|
|
198
223
|
const type = element.dumpTypeSchema(this.cache);
|
|
199
|
-
this.cache.types.elements[element.tag] = type;
|
|
200
|
-
moduleFile.push(this.cache.types.elements[element.tag]);
|
|
224
|
+
this.cache.types.elements[element.tag.full] = type;
|
|
225
|
+
moduleFile.push(this.cache.types.elements[element.tag.full]);
|
|
201
226
|
});
|
|
202
227
|
// Write to file
|
|
203
228
|
const moduleFilename = `../${module.lowName}.module`;
|
|
@@ -239,25 +264,25 @@ class DumpStage {
|
|
|
239
264
|
type.buckets = {};
|
|
240
265
|
}
|
|
241
266
|
Object.entries(externals.schema.buckets).forEach(([tag, ref]) => {
|
|
242
|
-
type.buckets[tag] =
|
|
267
|
+
type.buckets[tag] = name_helpers_1.NameHelpers.tagType(ref, module.lowName);
|
|
243
268
|
});
|
|
244
269
|
if (!type.messages) {
|
|
245
270
|
type.messages = {};
|
|
246
271
|
}
|
|
247
272
|
Object.entries(externals.schema.messages).forEach(([tag, ref]) => {
|
|
248
|
-
type.messages[tag] =
|
|
273
|
+
type.messages[tag] = name_helpers_1.NameHelpers.tagType(ref, module.lowName);
|
|
249
274
|
});
|
|
250
275
|
if (!type.jobs) {
|
|
251
276
|
type.jobs = {};
|
|
252
277
|
}
|
|
253
278
|
Object.entries(externals.schema.jobs).forEach(([tag, ref]) => {
|
|
254
|
-
type.jobs[tag] =
|
|
279
|
+
type.jobs[tag] = name_helpers_1.NameHelpers.tagType(ref, module.lowName);
|
|
255
280
|
});
|
|
256
281
|
if (!type.machines) {
|
|
257
282
|
type.machines = {};
|
|
258
283
|
}
|
|
259
284
|
Object.entries(externals.schema.machines).forEach(([tag, ref]) => {
|
|
260
|
-
type.machines[tag] =
|
|
285
|
+
type.machines[tag] = name_helpers_1.NameHelpers.tagType(ref, module.lowName);
|
|
261
286
|
});
|
|
262
287
|
}
|
|
263
288
|
if (module.elements.some(el => el.$t === 'constants')) {
|
|
@@ -98,6 +98,10 @@ class TSBridgeExtract {
|
|
|
98
98
|
query: 'bucket.*.view.1.return.**.computed.0',
|
|
99
99
|
expectedKinds: [ts.SyntaxKind.FunctionExpression, ts.SyntaxKind.ArrowFunction, ts.SyntaxKind.Identifier, ts.SyntaxKind.CallExpression]
|
|
100
100
|
}));
|
|
101
|
+
functions.push(...tsCompiler.query(node.filepath, {
|
|
102
|
+
query: 'bucket.*.tenancy.0.*',
|
|
103
|
+
expectedKinds: [ts.SyntaxKind.FunctionExpression, ts.SyntaxKind.ArrowFunction, ts.SyntaxKind.Identifier, ts.SyntaxKind.CallExpression]
|
|
104
|
+
}));
|
|
101
105
|
}
|
|
102
106
|
if (node.builder.$b === 'message') {
|
|
103
107
|
functions.push(...tsCompiler.query(node.filepath, {
|
|
@@ -110,6 +114,10 @@ class TSBridgeExtract {
|
|
|
110
114
|
}));
|
|
111
115
|
}
|
|
112
116
|
if (node.builder.$b === 'job') {
|
|
117
|
+
functions.push(...tsCompiler.query(node.filepath, {
|
|
118
|
+
query: 'job.*.auth.1',
|
|
119
|
+
expectedKinds: [ts.SyntaxKind.FunctionExpression, ts.SyntaxKind.ArrowFunction, ts.SyntaxKind.Identifier, ts.SyntaxKind.CallExpression, ts.SyntaxKind.PropertyAccessExpression]
|
|
120
|
+
}));
|
|
113
121
|
functions.push(...tsCompiler.query(node.filepath, {
|
|
114
122
|
query: 'job.*.message.1.return.*.rule.0',
|
|
115
123
|
expectedKinds: [ts.SyntaxKind.FunctionExpression, ts.SyntaxKind.ArrowFunction, ts.SyntaxKind.Identifier, ts.SyntaxKind.CallExpression, ts.SyntaxKind.PropertyAccessExpression]
|
|
@@ -124,6 +132,14 @@ class TSBridgeExtract {
|
|
|
124
132
|
}));
|
|
125
133
|
}
|
|
126
134
|
if (node.builder.$b === 'resource') {
|
|
135
|
+
functions.push(...tsCompiler.query(node.filepath, {
|
|
136
|
+
query: 'resource.*.auth.1',
|
|
137
|
+
expectedKinds: [ts.SyntaxKind.FunctionExpression, ts.SyntaxKind.ArrowFunction, ts.SyntaxKind.Identifier, ts.SyntaxKind.CallExpression, ts.SyntaxKind.PropertyAccessExpression]
|
|
138
|
+
}));
|
|
139
|
+
functions.push(...tsCompiler.query(node.filepath, {
|
|
140
|
+
query: 'resource.*.create.0.return.auth.1',
|
|
141
|
+
expectedKinds: [ts.SyntaxKind.FunctionExpression, ts.SyntaxKind.ArrowFunction, ts.SyntaxKind.Identifier, ts.SyntaxKind.CallExpression, ts.SyntaxKind.PropertyAccessExpression]
|
|
142
|
+
}));
|
|
127
143
|
functions.push(...tsCompiler.query(node.filepath, {
|
|
128
144
|
query: 'resource.*.create.0.return.input.0.return.*.rule.0',
|
|
129
145
|
expectedKinds: [ts.SyntaxKind.FunctionExpression, ts.SyntaxKind.ArrowFunction, ts.SyntaxKind.Identifier, ts.SyntaxKind.CallExpression, ts.SyntaxKind.PropertyAccessExpression]
|
|
@@ -136,6 +152,10 @@ class TSBridgeExtract {
|
|
|
136
152
|
query: 'resource.*.create.0.return.extra|assert|prepare|after.0',
|
|
137
153
|
expectedKinds: [ts.SyntaxKind.FunctionExpression, ts.SyntaxKind.ArrowFunction, ts.SyntaxKind.Identifier, ts.SyntaxKind.CallExpression]
|
|
138
154
|
}));
|
|
155
|
+
functions.push(...tsCompiler.query(node.filepath, {
|
|
156
|
+
query: 'resource.*.update.0.return.auth.1',
|
|
157
|
+
expectedKinds: [ts.SyntaxKind.FunctionExpression, ts.SyntaxKind.ArrowFunction, ts.SyntaxKind.Identifier, ts.SyntaxKind.CallExpression, ts.SyntaxKind.PropertyAccessExpression]
|
|
158
|
+
}));
|
|
139
159
|
functions.push(...tsCompiler.query(node.filepath, {
|
|
140
160
|
query: 'resource.*.update.0.return.input.0.return.*.rule.0',
|
|
141
161
|
expectedKinds: [ts.SyntaxKind.FunctionExpression, ts.SyntaxKind.ArrowFunction, ts.SyntaxKind.Identifier, ts.SyntaxKind.CallExpression, ts.SyntaxKind.PropertyAccessExpression]
|
|
@@ -148,6 +168,10 @@ class TSBridgeExtract {
|
|
|
148
168
|
query: 'resource.*.update.0.return.extra|assert|prepare|after.0',
|
|
149
169
|
expectedKinds: [ts.SyntaxKind.FunctionExpression, ts.SyntaxKind.ArrowFunction, ts.SyntaxKind.Identifier, ts.SyntaxKind.CallExpression]
|
|
150
170
|
}));
|
|
171
|
+
functions.push(...tsCompiler.query(node.filepath, {
|
|
172
|
+
query: 'resource.*.delete.0.return.auth.1',
|
|
173
|
+
expectedKinds: [ts.SyntaxKind.FunctionExpression, ts.SyntaxKind.ArrowFunction, ts.SyntaxKind.Identifier, ts.SyntaxKind.CallExpression, ts.SyntaxKind.PropertyAccessExpression]
|
|
174
|
+
}));
|
|
151
175
|
functions.push(...tsCompiler.query(node.filepath, {
|
|
152
176
|
query: 'resource.*.delete.0.return.input.0.return.*.rule.0',
|
|
153
177
|
expectedKinds: [ts.SyntaxKind.FunctionExpression, ts.SyntaxKind.ArrowFunction, ts.SyntaxKind.Identifier, ts.SyntaxKind.CallExpression, ts.SyntaxKind.PropertyAccessExpression]
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TSBridgeInject = void 0;
|
|
4
|
+
const dependency_1 = require("../../../engine/dependency");
|
|
4
5
|
const log_1 = require("../../../engine/util/log");
|
|
5
6
|
const message_template_schema_1 = require("../../../elements/entities/message/template/message_template.schema");
|
|
6
|
-
const name_helpers_1 = require("
|
|
7
|
+
const name_helpers_1 = require("../../../engine/util/name_helpers");
|
|
7
8
|
class TSBridgeInject {
|
|
8
9
|
static inject(compiler, nodes, node) {
|
|
9
10
|
const { tsCompiler } = compiler;
|
|
@@ -51,6 +52,12 @@ class TSBridgeInject {
|
|
|
51
52
|
f['#data'] = tsCompiler.getReturnType(node);
|
|
52
53
|
});
|
|
53
54
|
});
|
|
55
|
+
Object.entries(extract.tenancy).forEach(([provider, node]) => {
|
|
56
|
+
schema.tenancy[provider] = {
|
|
57
|
+
__fn: tsCompiler.getFnText(node, ''),
|
|
58
|
+
__fn_type: `(acc: Space['authnUsers']['${provider}']) => any`,
|
|
59
|
+
};
|
|
60
|
+
});
|
|
54
61
|
}
|
|
55
62
|
static message(compiler, extract, nodes, node) {
|
|
56
63
|
const { tsCompiler } = compiler;
|
|
@@ -61,9 +68,9 @@ class TSBridgeInject {
|
|
|
61
68
|
message_template_schema_1.$MessageTemplate.forEachField(schema.template, (field, path) => {
|
|
62
69
|
if (!field.meta.msg)
|
|
63
70
|
return;
|
|
64
|
-
const ref = nodes.find(node => node.tag
|
|
71
|
+
const ref = nodes.find(node => dependency_1.Tag.matches(node.tag, field.meta.msg.tag));
|
|
65
72
|
if (!ref) {
|
|
66
|
-
throw new Error(`Unable to inject code from .msg() field, ${field.meta.msg.tag} not found`);
|
|
73
|
+
throw new Error(`Unable to inject code from .msg() field, ${field.meta.msg.tag.full} not found`);
|
|
67
74
|
}
|
|
68
75
|
const refExtract = ref.bridge?.extract;
|
|
69
76
|
if (!refExtract)
|
|
@@ -104,6 +111,14 @@ class TSBridgeInject {
|
|
|
104
111
|
static job(compiler, extract, node) {
|
|
105
112
|
const { tsCompiler } = compiler;
|
|
106
113
|
const schema = node.schema;
|
|
114
|
+
if (extract.authResolver) {
|
|
115
|
+
schema.auth.forEach((a, i) => {
|
|
116
|
+
a.resolver = {
|
|
117
|
+
__fn: tsCompiler.getFnText(extract.authResolver[i]),
|
|
118
|
+
__fn_type: '(...args: any[]) => any', // TODO: evaluate
|
|
119
|
+
};
|
|
120
|
+
});
|
|
121
|
+
}
|
|
107
122
|
if (extract.extrasAndAsserts) {
|
|
108
123
|
if (extract.extrasAndAsserts.length !== schema.extrasAndAsserts.length) {
|
|
109
124
|
throw new Error(`Mismatching length of extracted asserts/extras for job ${schema.module}::${schema.name}. Expected ${schema.extrasAndAsserts.length}, but found ${extract.extrasAndAsserts.length}`);
|
|
@@ -8,11 +8,15 @@ export type BucketFnExtract = {
|
|
|
8
8
|
computed: Record<string, tsFn>;
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
|
+
tenancy: {
|
|
12
|
+
[name: string]: tsFn;
|
|
13
|
+
};
|
|
11
14
|
};
|
|
12
15
|
export type MessageFnExtract = {
|
|
13
16
|
rules: Record<string, tsFn[]>;
|
|
14
17
|
};
|
|
15
18
|
export type JobFnExtract = {
|
|
19
|
+
authResolver?: tsFn[];
|
|
16
20
|
extrasAndAsserts?: ({
|
|
17
21
|
extra: tsFn;
|
|
18
22
|
} | {
|
|
@@ -15,7 +15,7 @@ class TSBridgeOrganize {
|
|
|
15
15
|
if (!match)
|
|
16
16
|
return;
|
|
17
17
|
const [_, tag, path] = match;
|
|
18
|
-
const { type } = dependency_1
|
|
18
|
+
const { type } = dependency_1.Tag.from(tag);
|
|
19
19
|
if (type === 'bucket') {
|
|
20
20
|
this.bucket(organized, tag, path, fn.node);
|
|
21
21
|
}
|
|
@@ -37,7 +37,7 @@ class TSBridgeOrganize {
|
|
|
37
37
|
if (!match)
|
|
38
38
|
return;
|
|
39
39
|
const [_, tag, path] = match;
|
|
40
|
-
const { type } = dependency_1
|
|
40
|
+
const { type } = dependency_1.Tag.from(tag);
|
|
41
41
|
if (type === 'job') {
|
|
42
42
|
this.type_job(organized, tag, path, _type.type);
|
|
43
43
|
}
|
|
@@ -45,15 +45,22 @@ class TSBridgeOrganize {
|
|
|
45
45
|
return organized;
|
|
46
46
|
}
|
|
47
47
|
static bucket(organized, tag, path, node) {
|
|
48
|
-
var _a, _b;
|
|
48
|
+
var _a, _b, _c;
|
|
49
49
|
const viewComputed = path.match(/view▹(\w+)▹1▹return▹([\w|\\.]+)▹computed▹0/);
|
|
50
50
|
if (viewComputed) {
|
|
51
51
|
const [_, view, prop] = viewComputed;
|
|
52
|
-
(_a = organized.buckets)[tag] ?? (_a[tag] = { views: {} });
|
|
52
|
+
(_a = organized.buckets)[tag] ?? (_a[tag] = { views: {}, tenancy: {} });
|
|
53
53
|
(_b = organized.buckets[tag].views)[view] ?? (_b[view] = { computed: {} });
|
|
54
54
|
organized.buckets[tag].views[view].computed[prop] = node;
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
|
+
const tenancy = path.match(/tenancy▹0▹(\w+)/);
|
|
58
|
+
if (tenancy) {
|
|
59
|
+
const [_, provider] = tenancy;
|
|
60
|
+
(_c = organized.buckets)[tag] ?? (_c[tag] = { views: {}, tenancy: {} });
|
|
61
|
+
organized.buckets[tag].tenancy[provider] = node;
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
57
64
|
}
|
|
58
65
|
static message(organized, tag, path, node) {
|
|
59
66
|
var _a, _b;
|
|
@@ -74,7 +81,7 @@ class TSBridgeOrganize {
|
|
|
74
81
|
const message = path.match(/message▹(@|\w+)▹1▹return▹(.*)/);
|
|
75
82
|
if (message) {
|
|
76
83
|
const [_, inlineName, path] = message;
|
|
77
|
-
const parent = dependency_1
|
|
84
|
+
const parent = dependency_1.Tag.from(parentTag);
|
|
78
85
|
const msgName = inlineName === '@' ? parent.name : `${parent.name}.${inlineName}`;
|
|
79
86
|
const msgTag = `${parent.module}::message:${msgName}`;
|
|
80
87
|
const templatePath = `template▹0▹return▹${path}`;
|
|
@@ -86,7 +93,7 @@ class TSBridgeOrganize {
|
|
|
86
93
|
const message = path.match(/input▹0▹return▹(.*)/);
|
|
87
94
|
if (message) {
|
|
88
95
|
const [_, path] = message;
|
|
89
|
-
const parent = dependency_1
|
|
96
|
+
const parent = dependency_1.Tag.from(parentTag);
|
|
90
97
|
const msgTag = `${parent.module}::message:${parent.name}`;
|
|
91
98
|
const templatePath = `template▹0▹return▹${path}`;
|
|
92
99
|
this.message(organized, msgTag, templatePath, node);
|
|
@@ -94,25 +101,31 @@ class TSBridgeOrganize {
|
|
|
94
101
|
}
|
|
95
102
|
}
|
|
96
103
|
static job(organized, tag, path, node) {
|
|
97
|
-
var _a, _b, _c, _d, _e;
|
|
104
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
98
105
|
this.inlineMessage(organized, tag, path, node);
|
|
106
|
+
const authResolver = path.match(/auth▹.+▹1$/);
|
|
107
|
+
if (authResolver) {
|
|
108
|
+
(_a = organized.jobs)[tag] ?? (_a[tag] = {});
|
|
109
|
+
(_b = organized.jobs[tag]).authResolver ?? (_b.authResolver = []);
|
|
110
|
+
organized.jobs[tag].authResolver.push(node);
|
|
111
|
+
}
|
|
99
112
|
const extra = path.match(/extra▹0/);
|
|
100
113
|
if (extra) {
|
|
101
|
-
(
|
|
102
|
-
(
|
|
114
|
+
(_c = organized.jobs)[tag] ?? (_c[tag] = {});
|
|
115
|
+
(_d = organized.jobs[tag]).extrasAndAsserts ?? (_d.extrasAndAsserts = []);
|
|
103
116
|
organized.jobs[tag].extrasAndAsserts.push({ extra: node });
|
|
104
117
|
return;
|
|
105
118
|
}
|
|
106
119
|
const assert = path.match(/assert▹0/);
|
|
107
120
|
if (assert) {
|
|
108
|
-
(
|
|
109
|
-
(
|
|
121
|
+
(_e = organized.jobs)[tag] ?? (_e[tag] = {});
|
|
122
|
+
(_f = organized.jobs[tag]).extrasAndAsserts ?? (_f.extrasAndAsserts = []);
|
|
110
123
|
organized.jobs[tag].extrasAndAsserts.push({ assert: node });
|
|
111
124
|
return;
|
|
112
125
|
}
|
|
113
126
|
const method = path.match(/method▹0/);
|
|
114
127
|
if (method) {
|
|
115
|
-
(
|
|
128
|
+
(_g = organized.jobs)[tag] ?? (_g[tag] = {});
|
|
116
129
|
organized.jobs[tag].method = node;
|
|
117
130
|
return;
|
|
118
131
|
}
|
|
@@ -127,31 +140,37 @@ class TSBridgeOrganize {
|
|
|
127
140
|
}
|
|
128
141
|
}
|
|
129
142
|
static resourceJob(organized, tag, path, node) {
|
|
130
|
-
var _a, _b, _c, _d, _e, _f;
|
|
143
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
131
144
|
this.inputMessage(organized, tag, path, node);
|
|
145
|
+
const authResolver = path.match(/auth▹.+▹1$/);
|
|
146
|
+
if (authResolver) {
|
|
147
|
+
(_a = organized.jobs)[tag] ?? (_a[tag] = {});
|
|
148
|
+
(_b = organized.jobs[tag]).authResolver ?? (_b.authResolver = []);
|
|
149
|
+
organized.jobs[tag].authResolver.push(node);
|
|
150
|
+
}
|
|
132
151
|
const extra = path.match(/extra▹0/);
|
|
133
152
|
if (extra) {
|
|
134
|
-
(
|
|
135
|
-
(
|
|
153
|
+
(_c = organized.jobs)[tag] ?? (_c[tag] = {});
|
|
154
|
+
(_d = organized.jobs[tag]).extrasAndAsserts ?? (_d.extrasAndAsserts = []);
|
|
136
155
|
organized.jobs[tag].extrasAndAsserts.push({ extra: node });
|
|
137
156
|
return;
|
|
138
157
|
}
|
|
139
158
|
const assert = path.match(/assert▹0/);
|
|
140
159
|
if (assert) {
|
|
141
|
-
(
|
|
142
|
-
(
|
|
160
|
+
(_e = organized.jobs)[tag] ?? (_e[tag] = { extrasAndAsserts: [] });
|
|
161
|
+
(_f = organized.jobs[tag]).extrasAndAsserts ?? (_f.extrasAndAsserts = []);
|
|
143
162
|
organized.jobs[tag].extrasAndAsserts.push({ assert: node });
|
|
144
163
|
return;
|
|
145
164
|
}
|
|
146
165
|
const prepare = path.match(/prepare▹0/);
|
|
147
166
|
if (prepare) {
|
|
148
|
-
(
|
|
167
|
+
(_g = organized.jobs)[tag] ?? (_g[tag] = { extrasAndAsserts: [] });
|
|
149
168
|
organized.jobs[tag].prepare = node;
|
|
150
169
|
return;
|
|
151
170
|
}
|
|
152
171
|
const after = path.match(/after▹0/);
|
|
153
172
|
if (after) {
|
|
154
|
-
(
|
|
173
|
+
(_h = organized.jobs)[tag] ?? (_h[tag] = { extrasAndAsserts: [] });
|
|
155
174
|
organized.jobs[tag].after = node;
|
|
156
175
|
return;
|
|
157
176
|
}
|
|
@@ -160,7 +179,7 @@ class TSBridgeOrganize {
|
|
|
160
179
|
const job = path.match(/(create|update|delete)▹0▹return▹(.*)/);
|
|
161
180
|
if (job) {
|
|
162
181
|
const [_, method, path] = job;
|
|
163
|
-
const resource = dependency_1
|
|
182
|
+
const resource = dependency_1.Tag.from(tag);
|
|
164
183
|
const jobName = `${resource.name}.${method}`;
|
|
165
184
|
const jobTag = `${resource.module}::job:${jobName}`;
|
|
166
185
|
this.resourceJob(organized, jobTag, path, node);
|
|
@@ -183,7 +202,7 @@ class TSBridgeOrganize {
|
|
|
183
202
|
}
|
|
184
203
|
static machineState(organized, machineTag, stateName, path, node) {
|
|
185
204
|
var _a, _b;
|
|
186
|
-
const machine = dependency_1
|
|
205
|
+
const machine = dependency_1.Tag.from(machineTag);
|
|
187
206
|
const job = path.match(/(beforeEnter|afterEnter|beforeLeave|afterLeave)▹0▹return▹(.*)/);
|
|
188
207
|
if (job) {
|
|
189
208
|
const [_, moment, path] = job;
|
|
@@ -233,7 +252,7 @@ class TSBridgeOrganize {
|
|
|
233
252
|
}
|
|
234
253
|
static machineTransition(organized, extract, machineTag, stateName, msg, path, node) {
|
|
235
254
|
var _a;
|
|
236
|
-
const machine = dependency_1
|
|
255
|
+
const machine = dependency_1.Tag.from(machineTag);
|
|
237
256
|
if (msg.startsWith('@.')) {
|
|
238
257
|
msg = msg.replace('@', machine.name);
|
|
239
258
|
}
|
|
@@ -1,88 +1,7 @@
|
|
|
1
1
|
import * as ts from 'typescript';
|
|
2
|
-
export declare class
|
|
2
|
+
export declare class TypescriptParserError extends Error {
|
|
3
3
|
constructor(message: string);
|
|
4
|
-
static
|
|
5
|
-
static FileDoesntExist(path: string): MetaError;
|
|
6
|
-
static NoModulesFolder(): MetaError;
|
|
7
|
-
}
|
|
8
|
-
export declare class ParserError extends Error {
|
|
9
|
-
constructor(message: string);
|
|
10
|
-
static ObjectPropertyIsNotAssignment(): MetaError;
|
|
4
|
+
static ObjectPropertyIsNotAssignment(): TypescriptParserError;
|
|
11
5
|
static StrangeValueKind(kind: ts.SyntaxKind): void;
|
|
12
6
|
static StrangeTypeKind(kind: ts.SyntaxKind): void;
|
|
13
7
|
}
|
|
14
|
-
export declare class ConstParserError extends Error {
|
|
15
|
-
constructor(message: string);
|
|
16
|
-
static ConstValueIsWrongKind(kind: string): void;
|
|
17
|
-
static ConstValueIsStrange(): void;
|
|
18
|
-
static ConstEnumIsWrongKind(kind: string): void;
|
|
19
|
-
static ConstEnumReturnIsWrongKind(kind: string): void;
|
|
20
|
-
static ConstEnumOptionIsWrongKind(kind: string): void;
|
|
21
|
-
static ConstEnumOptionIsStrange(): void;
|
|
22
|
-
}
|
|
23
|
-
export declare class ControllerParserError extends Error {
|
|
24
|
-
constructor(message: string);
|
|
25
|
-
static ControllerIsWrongKind(kind: string): void;
|
|
26
|
-
static ControllerEndpointIsWrongKind(kind: string): void;
|
|
27
|
-
static ControllerEndpointDefIsWrongKind(kind: string): void;
|
|
28
|
-
static ControllerEndpointHasNoName(): void;
|
|
29
|
-
static ControllerEndpointHasNoMessage(): void;
|
|
30
|
-
static ControllerGroupIsWrongKind(kind: string): void;
|
|
31
|
-
static ControllerGroupHasNoName(): void;
|
|
32
|
-
static ControllerGroupDefIsWrongKind(kind: string): void;
|
|
33
|
-
}
|
|
34
|
-
export declare class MsgParserError extends Error {
|
|
35
|
-
constructor(message: string);
|
|
36
|
-
static MessageHasNoTemplate(): void;
|
|
37
|
-
static MessageTemplateIsWrongKind(kind: string): void;
|
|
38
|
-
static MessageTemplateFieldIsWrongKind(kind: string): void;
|
|
39
|
-
static MessageTemplateFieldHasNoType(): void;
|
|
40
|
-
static MessageMultiTemplateIsWrongKind(kind: string): void;
|
|
41
|
-
static MessageTemplateFieldEnumIsWrongKind(kind: string): void;
|
|
42
|
-
}
|
|
43
|
-
export declare class EnumParserError extends Error {
|
|
44
|
-
constructor(message: string);
|
|
45
|
-
static ModelFieldEnumIsWrongKind(kind: string): void;
|
|
46
|
-
}
|
|
47
|
-
export declare class BucketParserError extends Error {
|
|
48
|
-
constructor(message: string);
|
|
49
|
-
static BucketHasNoModel(): void;
|
|
50
|
-
static BucketModelIsWrongKind(kind: string): void;
|
|
51
|
-
static BucketModelFieldIsWrongKind(kind: string): void;
|
|
52
|
-
static BucketModelFieldHasNoType(): void;
|
|
53
|
-
static BucketHasNoGraph(): void;
|
|
54
|
-
static BucketGraphIsWrongKind(kind: string): void;
|
|
55
|
-
static BucketGraphLinkIsWrongKind(kind: string): void;
|
|
56
|
-
static BucketGraphLinkHasNoType(): void;
|
|
57
|
-
static BucketGraphLinkInvalid(): void;
|
|
58
|
-
static BucketHasNoView(): void;
|
|
59
|
-
static BucketViewHasNoTemplate(): void;
|
|
60
|
-
static BucketViewIsWrongKind(kind: string): void;
|
|
61
|
-
static BucketViewFieldIsWrongKind(kind: string): void;
|
|
62
|
-
static BucketViewFieldHasNoType(): void;
|
|
63
|
-
static BucketViewFieldInvalid(): void;
|
|
64
|
-
}
|
|
65
|
-
export declare class JobParserError extends Error {
|
|
66
|
-
constructor(message: string);
|
|
67
|
-
static JobHasNoTemplate(): void;
|
|
68
|
-
static JobTemplateIsWrongKind(kind: string): void;
|
|
69
|
-
static JobTemplateFieldIsWrongKind(kind: string): void;
|
|
70
|
-
static JobTemplateFieldHasNoType(): void;
|
|
71
|
-
static JobAuthnHasInvalidValue(): void;
|
|
72
|
-
}
|
|
73
|
-
export declare class ResourceParserError extends Error {
|
|
74
|
-
constructor(message: string);
|
|
75
|
-
static ResourceJobInputHasNoTemplate(): void;
|
|
76
|
-
}
|
|
77
|
-
export declare class HelperError extends Error {
|
|
78
|
-
constructor(message: string);
|
|
79
|
-
static ArrayElementIsNotString(kind: string): void;
|
|
80
|
-
static NotAStringOrArray(kind: string): void;
|
|
81
|
-
static StringIsUndefined(): void;
|
|
82
|
-
static NotAString(kind: string): void;
|
|
83
|
-
}
|
|
84
|
-
export declare class TypegenError extends Error {
|
|
85
|
-
constructor(message: string);
|
|
86
|
-
static BuildMethodNotCalled(context: string): MetaError;
|
|
87
|
-
static Resource_BucketRequired(context: string): MetaError;
|
|
88
|
-
}
|