nesoi 3.3.2 → 3.3.4

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.
Files changed (48) hide show
  1. package/lib/bundler/distributed/distributed.bundler.d.ts +1 -1
  2. package/lib/bundler/distributed/distributed.bundler.js +1 -1
  3. package/lib/bundler/distributed/stages/1_mkdir_stage.d.ts +1 -1
  4. package/lib/bundler/distributed/stages/2_build_typescript_stage.d.ts +1 -1
  5. package/lib/bundler/distributed/stages/3_copy_types_stage.d.ts +1 -1
  6. package/lib/bundler/distributed/stages/4_dump_modules_stage.d.ts +1 -1
  7. package/lib/bundler/distributed/stages/5_copy_static_stage.js +1 -1
  8. package/lib/bundler/distributed/stages/6_dump_cli_stage.js +1 -1
  9. package/lib/bundler/distributed/stages/7_dump_package_json_stage.js +1 -1
  10. package/lib/bundler/monolyth/monolyth.bundler.d.ts +2 -8
  11. package/lib/bundler/monolyth/monolyth.bundler.js +1 -1
  12. package/lib/bundler/monolyth/stages/1_mkdir_stage.d.ts +1 -1
  13. package/lib/bundler/monolyth/stages/2_build_typescript_stage.d.ts +1 -1
  14. package/lib/bundler/monolyth/stages/3_copy_types_stage.d.ts +1 -1
  15. package/lib/bundler/monolyth/stages/4_dump_modules_stage.d.ts +1 -1
  16. package/lib/bundler/monolyth/stages/5_copy_static_stage.d.ts +1 -1
  17. package/lib/bundler/monolyth/stages/6_dump_cli_stage.d.ts +1 -1
  18. package/lib/bundler/monolyth/stages/7_dump_package_json_stage.d.ts +1 -1
  19. package/lib/bundler/monolyth/stages/7_dump_package_json_stage.js +1 -1
  20. package/lib/{bundler/browser → engine/app/native}/browser.app.d.ts +8 -11
  21. package/lib/{bundler/browser → engine/app/native}/browser.app.js +3 -9
  22. package/lib/{bundler/distributed → engine/app/native}/distributed.app.config.d.ts +6 -6
  23. package/lib/{bundler/distributed → engine/app/native}/distributed.app.d.ts +6 -9
  24. package/lib/{bundler/distributed → engine/app/native}/distributed.app.js +2 -7
  25. package/lib/{bundler/distributed → engine/app/native}/distributed_node.app.d.ts +8 -8
  26. package/lib/{bundler/distributed → engine/app/native}/distributed_node.app.js +8 -8
  27. package/lib/engine/app/native/monolyth.app.config.d.ts +7 -0
  28. package/lib/engine/app/native/monolyth.app.config.js +2 -0
  29. package/lib/{bundler/monolyth → engine/app/native}/monolyth.app.d.ts +9 -12
  30. package/lib/{bundler/monolyth → engine/app/native}/monolyth.app.js +6 -12
  31. package/lib/engine/daemon.d.ts +11 -3
  32. package/lib/engine/daemon.js +23 -4
  33. package/lib/engine/transaction/nodes/bucket.trx_node.d.ts +3 -2
  34. package/lib/engine/transaction/nodes/bucket.trx_node.js +16 -10
  35. package/lib/engine/transaction/nodes/external.trx_node.js +3 -1
  36. package/lib/engine/transaction/nodes/machine.trx_node.d.ts +7 -3
  37. package/lib/engine/transaction/nodes/machine.trx_node.js +43 -23
  38. package/lib/engine/transaction/nodes/queue.trx_node.d.ts +7 -3
  39. package/lib/engine/transaction/nodes/queue.trx_node.js +40 -11
  40. package/lib/engine/transaction/nodes/topic.trx_node.d.ts +7 -3
  41. package/lib/engine/transaction/nodes/topic.trx_node.js +46 -30
  42. package/lib/engine/transaction/trx_engine.d.ts +4 -4
  43. package/lib/engine/transaction/trx_engine.js +10 -10
  44. package/lib/engine/transaction/trx_node.d.ts +1 -1
  45. package/lib/engine/transaction/trx_node.js +21 -27
  46. package/package.json +1 -1
  47. package/tsconfig.build.tsbuildinfo +1 -1
  48. /package/lib/{bundler/distributed → engine/app/native}/distributed.app.config.js +0 -0
@@ -1,6 +1,6 @@
1
1
  import { Compiler } from "../../compiler/compiler";
2
2
  import { AnyApp } from "../../engine/app/app";
3
- import { DistributedApp } from './distributed.app';
3
+ import { DistributedApp } from "../../engine/app/native/distributed.app";
4
4
  export type DistributedBundlerConfig = {
5
5
  libPaths?: string[];
6
6
  staticPaths?: string[];
@@ -50,7 +50,7 @@ const _4_dump_modules_stage_1 = require("./stages/4_dump_modules_stage");
50
50
  // import { DumpPackageJsonStage } from './stages/7_dump_package_json_stage';
51
51
  const log_1 = require("../../engine/util/log");
52
52
  const app_1 = require("../../engine/app/app");
53
- const distributed_app_1 = require("./distributed.app");
53
+ const distributed_app_1 = require("../../engine/app/native/distributed.app");
54
54
  const path_1 = require("../../engine/util/path");
55
55
  class DistributedBundler {
56
56
  constructor(compiler, appPath, config = {}) {
@@ -1,4 +1,4 @@
1
- import { DistributedApp } from '../distributed.app';
1
+ import { DistributedApp } from "../../../engine/app/native/distributed.app";
2
2
  import { DistributedBundler } from '../distributed.bundler';
3
3
  /**
4
4
  * [Distributed Compiler Stage #1]
@@ -1,4 +1,4 @@
1
- import { DistributedApp } from '../distributed.app';
1
+ import { DistributedApp } from "../../../engine/app/native/distributed.app";
2
2
  import { DistributedBundler } from '../distributed.bundler';
3
3
  /**
4
4
  * [Distributed Compiler Stage #2]
@@ -1,4 +1,4 @@
1
- import { DistributedApp } from '../distributed.app';
1
+ import { DistributedApp } from "../../../engine/app/native/distributed.app";
2
2
  import { DistributedBundler } from '../distributed.bundler';
3
3
  /**
4
4
  * [distributed Compiler Stage #3]
@@ -1,5 +1,5 @@
1
1
  import { DistributedBundler } from '../distributed.bundler';
2
- import { DistributedApp } from '../distributed.app';
2
+ import { DistributedApp } from "../../../engine/app/native/distributed.app";
3
3
  /**
4
4
  * [distributed Compiler Stage #4]
5
5
  * Dump modules to build/modules folder.
@@ -2,7 +2,7 @@
2
2
  // import * as fs from 'fs';
3
3
  // import * as path from 'path';
4
4
  // import { Log } from '~/engine/util/log';
5
- // import { MonolythApp } from '~/bundler/monolyth/monolyth.app';
5
+ // import { MonolythApp } from '~/engine/app/native/monolyth.app';
6
6
  // import { MonolythBundler } from '../monolyth.bundler';
7
7
  // import { Space } from '~/engine/space';
8
8
  // /**
@@ -2,7 +2,7 @@
2
2
  // import * as fs from 'fs';
3
3
  // import * as path from 'path';
4
4
  // import { Log } from '~/engine/util/log';
5
- // import { MonolythApp } from '~/bundler/monolyth/monolyth.app';
5
+ // import { MonolythApp } from '~/engine/app/native/monolyth.app';
6
6
  // import { MonolythBundler } from '../monolyth.bundler';
7
7
  // /**
8
8
  // * [Monolyth Compiler Stage #6]
@@ -4,7 +4,7 @@
4
4
  // import { Log } from '~/engine/util/log';
5
5
  // import { MonolythBundler } from '../monolyth.bundler';
6
6
  // import { Space } from '~/engine/space';
7
- // import { MonolythApp } from '~/bundler/monolyth/monolyth.app';
7
+ // import { MonolythApp } from '~/engine/app/native/monolyth.app';
8
8
  // /**
9
9
  // * [Monolyth Compiler Stage #7]
10
10
  // * Dump the package.json file to build folder.
@@ -1,13 +1,7 @@
1
1
  import { Compiler } from "../../compiler/compiler";
2
2
  import { AnyApp } from "../../engine/app/app";
3
- import { MonolythApp } from "./monolyth.app";
4
- export type MonolythBundlerConfig = {
5
- libPaths?: string[];
6
- staticPaths?: string[];
7
- scripts?: Record<string, string>;
8
- nesoiPath?: string;
9
- nesoiVersion?: string;
10
- };
3
+ import { MonolythApp } from "../../engine/app/native/monolyth.app";
4
+ import { MonolythBundlerConfig } from "../../engine/app/native/monolyth.app.config";
11
5
  export declare class MonolythBundler {
12
6
  compiler: Compiler;
13
7
  appPath: string;
@@ -50,7 +50,7 @@ const _7_dump_package_json_stage_1 = require("./stages/7_dump_package_json_stage
50
50
  const _2_build_typescript_stage_1 = require("./stages/2_build_typescript_stage");
51
51
  const log_1 = require("../../engine/util/log");
52
52
  const app_1 = require("../../engine/app/app");
53
- const monolyth_app_1 = require("./monolyth.app");
53
+ const monolyth_app_1 = require("../../engine/app/native/monolyth.app");
54
54
  const path_1 = require("../../engine/util/path");
55
55
  class MonolythBundler {
56
56
  constructor(compiler, appPath, config = {}) {
@@ -1,4 +1,4 @@
1
- import { MonolythApp } from "../monolyth.app";
1
+ import { MonolythApp } from "../../../engine/app/native/monolyth.app";
2
2
  import { MonolythBundler } from '../monolyth.bundler';
3
3
  /**
4
4
  * [Monolyth Compiler Stage #1]
@@ -1,4 +1,4 @@
1
- import { MonolythApp } from "../monolyth.app";
1
+ import { MonolythApp } from "../../../engine/app/native/monolyth.app";
2
2
  import { MonolythBundler } from '../monolyth.bundler';
3
3
  /**
4
4
  * [Monolyth Compiler Stage #2]
@@ -1,4 +1,4 @@
1
- import { MonolythApp } from "../monolyth.app";
1
+ import { MonolythApp } from "../../../engine/app/native/monolyth.app";
2
2
  import { MonolythBundler } from '../monolyth.bundler';
3
3
  /**
4
4
  * [Monolyth Compiler Stage #3]
@@ -1,4 +1,4 @@
1
- import { MonolythApp } from "../monolyth.app";
1
+ import { MonolythApp } from "../../../engine/app/native/monolyth.app";
2
2
  import { MonolythBundler } from '../monolyth.bundler';
3
3
  /**
4
4
  * [Monolyth Compiler Stage #4]
@@ -1,4 +1,4 @@
1
- import { MonolythApp } from "../monolyth.app";
1
+ import { MonolythApp } from "../../../engine/app/native/monolyth.app";
2
2
  import { MonolythBundler } from '../monolyth.bundler';
3
3
  /**
4
4
  * [Monolyth Compiler Stage #5]
@@ -1,4 +1,4 @@
1
- import { MonolythApp } from "../monolyth.app";
1
+ import { MonolythApp } from "../../../engine/app/native/monolyth.app";
2
2
  import { MonolythBundler } from '../monolyth.bundler';
3
3
  /**
4
4
  * [Monolyth Compiler Stage #6]
@@ -1,5 +1,5 @@
1
1
  import { MonolythBundler } from '../monolyth.bundler';
2
- import { MonolythApp } from "../monolyth.app";
2
+ import { MonolythApp } from "../../../engine/app/native/monolyth.app";
3
3
  /**
4
4
  * [Monolyth Compiler Stage #7]
5
5
  * Dump the package.json file to build folder.
@@ -38,7 +38,7 @@ const fs = __importStar(require("fs"));
38
38
  const path = __importStar(require("path"));
39
39
  const log_1 = require("../../../engine/util/log");
40
40
  const space_1 = require("../../../engine/space");
41
- const monolyth_app_1 = require("../monolyth.app");
41
+ const monolyth_app_1 = require("../../../engine/app/native/monolyth.app");
42
42
  const app_1 = require("../../../engine/app/app");
43
43
  /**
44
44
  * [Monolyth Compiler Stage #7]
@@ -1,12 +1,10 @@
1
- import { $Space, ModuleName } from "../../schema";
2
- import { MonolythDaemon } from '../monolyth/monolyth.app';
3
- import { Compiler } from "../../compiler/compiler";
4
- import { MonolythBundlerConfig } from "../monolyth/monolyth.bundler";
5
- import { AppConfigBuilder } from "../../engine/app/app.config";
6
- import { InlineApp } from "../../engine/app/inline.app";
7
- import { IService } from "../../engine/app/service";
8
- import { Space } from "../../engine/space";
9
- import { AnyTrxEngine } from "../../engine/transaction/trx_engine";
1
+ import { $Space, ModuleName } from "../../../schema";
2
+ import { MonolythDaemon } from './monolyth.app';
3
+ import { AppConfigBuilder } from "../app.config";
4
+ import { InlineApp } from "../inline.app";
5
+ import { IService } from "../service";
6
+ import { Space } from "../../space";
7
+ import { AnyTrxEngine } from "../../transaction/trx_engine";
10
8
  /**
11
9
  * @category App
12
10
  * @subcategory Browser
@@ -15,10 +13,9 @@ export declare class BrowserApp<S extends $Space, ModuleNames extends string = M
15
13
  protected _nesoiNpmPkg: string;
16
14
  constructor(name: string, space?: Space<S>);
17
15
  protected _packageJson?: Record<string, any>;
18
- static bundle(compiler: Compiler, appPath: string, config?: MonolythBundlerConfig): Promise<void>;
19
16
  daemon($?: {
20
17
  watch?: boolean;
21
- }): Promise<import("../../engine/daemon").Daemon<S, ModuleNames>>;
18
+ }): Promise<import("../../daemon").Daemon<S, ModuleNames>>;
22
19
  protected makeDaemon(trxEngines: Record<ModuleNames, AnyTrxEngine>, services: Record<string, IService>): BrowserDaemon<$Space, ModuleNames>;
23
20
  modules<M extends ModuleName<S>>(modules: M[]): BrowserApp<S, M & ModuleNames>;
24
21
  service<T extends IService>($: T): BrowserApp<S, ModuleNames, Services & { [K in T["name"]]: T; }>;
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BrowserDaemon = exports.BrowserApp = void 0;
4
- const monolyth_app_1 = require("../monolyth/monolyth.app");
5
- const browser_bundler_1 = require("./browser.bundler");
6
- const app_config_1 = require("../../engine/app/app.config");
7
- const inline_app_1 = require("../../engine/app/inline.app");
4
+ const monolyth_app_1 = require("./monolyth.app");
5
+ const app_config_1 = require("../app.config");
6
+ const inline_app_1 = require("../inline.app");
8
7
  /**
9
8
  * @category App
10
9
  * @subcategory Browser
@@ -16,11 +15,6 @@ class BrowserApp extends inline_app_1.InlineApp {
16
15
  this.builders = undefined;
17
16
  this.space = space;
18
17
  }
19
- //
20
- static bundle(compiler, appPath, config) {
21
- return new browser_bundler_1.BrowserBundler(compiler, appPath, config)
22
- .run();
23
- }
24
18
  // Override InlineApp abstract methods
25
19
  async daemon($) {
26
20
  return super.daemon();
@@ -1,10 +1,10 @@
1
- import { $Space, ModuleName } from "../../schema";
2
- import { AppConfig, AppControllerConfig, AppI18nConfig, AppTrashConfig, AppAuthConfig, CompilerConfig } from "../../engine/app/app.config";
3
- import { CLIConfig } from "../../engine/cli/cli";
1
+ import { $Space, ModuleName } from "../../../schema";
2
+ import { AppConfig, AppControllerConfig, AppI18nConfig, AppTrashConfig, AppAuthConfig, CompilerConfig } from "../app.config";
3
+ import { CLIConfig } from "../../cli/cli";
4
4
  import { DistributedNodeApp } from './distributed_node.app';
5
- import { TrxEngineConfig } from "../../engine/transaction/trx_engine.config";
6
- import { BucketConfig } from "../../elements/entities/bucket/bucket.config";
7
- import { IService } from "../../engine/app/service";
5
+ import { TrxEngineConfig } from "../../transaction/trx_engine.config";
6
+ import { BucketConfig } from "../../../elements/entities/bucket/bucket.config";
7
+ import { IService } from "../service";
8
8
  export type DistributedAppModuleConfig<S extends $Space, M extends ModuleName<S>, Nodes extends Record<string, DistributedNodeApp<any, any, any, any>>, Services extends Record<string, IService>> = {
9
9
  buckets?: DistributedAppBucketConfig<S, M, Nodes, Services>;
10
10
  jobs?: DistributedAppJobConfig<S, M, Nodes>;
@@ -1,13 +1,11 @@
1
- import { $Space } from "../../schema";
2
- import { Space } from "../../engine/space";
3
- import { Daemon } from "../../engine/daemon";
1
+ import { $Space } from "../../../schema";
2
+ import { Space } from "../../space";
3
+ import { Daemon } from "../../daemon";
4
4
  import { DistributedAppConfig } from './distributed.app.config';
5
- import { App } from "../../engine/app/app";
5
+ import { App } from "../app";
6
6
  import { DistributedNodeApp, DistributedAppNodeDef, DistributedNodeDaemon } from './distributed_node.app';
7
- import { AnyElementSchema } from "../../engine/module";
8
- import { Compiler } from "../../compiler/compiler";
9
- import { Tag } from "../../engine/dependency";
10
- import { DistributedBundlerConfig } from './distributed.bundler';
7
+ import { AnyElementSchema } from "../../module";
8
+ import { Tag } from "../../dependency";
11
9
  /**
12
10
  * @category App
13
11
  * @subcategory Distributed
@@ -15,7 +13,6 @@ import { DistributedBundlerConfig } from './distributed.bundler';
15
13
  export declare class DistributedApp<S extends $Space, Name extends string, Nodes extends Record<string, DistributedNodeApp<any, any, any, any>> = {}> extends App<S, never, never> {
16
14
  nodes: Nodes;
17
15
  constructor(name: Name, space?: Space<S>);
18
- static compile(compiler: Compiler, appPath: string, config?: DistributedBundlerConfig): Promise<void>;
19
16
  boot(): DistributedApp<S, Name, Nodes>;
20
17
  daemon(): Promise<DistributedDaemon<S, { [N in keyof Nodes as `${Name}-${N & string}`]: Nodes[N]; }>>;
21
18
  node<N extends string, ModuleNames extends string, Services extends Record<string, any>, Def extends DistributedAppNodeDef<S, Nodes, ModuleNames, Services>>(name: N, def: Def): DistributedApp<S, Name, Nodes & {
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DistributedDaemon = exports.DistributedApp = void 0;
4
- const daemon_1 = require("../../engine/daemon");
5
- const app_1 = require("../../engine/app/app");
4
+ const daemon_1 = require("../../daemon");
5
+ const app_1 = require("../app");
6
6
  const distributed_node_app_1 = require("./distributed_node.app");
7
- const distributed_bundler_1 = require("./distributed.bundler");
8
7
  /**
9
8
  * @category App
10
9
  * @subcategory Distributed
@@ -17,10 +16,6 @@ class DistributedApp extends app_1.App {
17
16
  this.space = space;
18
17
  }
19
18
  // Override App abstract methods
20
- static compile(compiler, appPath, config) {
21
- return new distributed_bundler_1.DistributedBundler(compiler, appPath, config)
22
- .run();
23
- }
24
19
  boot() {
25
20
  return this;
26
21
  }
@@ -1,11 +1,11 @@
1
- import { $Module, $Space, ModuleName } from "../../schema";
2
- import { AnyTrxEngine } from "../../engine/transaction/trx_engine";
3
- import { AnyModule, Module } from "../../engine/module";
4
- import { Space } from "../../engine/space";
5
- import { App } from "../../engine/app/app";
6
- import { AppConfigBuilder } from "../../engine/app/app.config";
7
- import { IService } from "../../engine/app/service";
8
- import { MonolythDaemon } from '../monolyth/monolyth.app';
1
+ import { $Module, $Space, ModuleName } from "../../../schema";
2
+ import { AnyTrxEngine } from "../../transaction/trx_engine";
3
+ import { AnyModule, Module } from "../../module";
4
+ import { Space } from "../../space";
5
+ import { App } from "../app";
6
+ import { AppConfigBuilder } from "../app.config";
7
+ import { IService } from "../service";
8
+ import { MonolythDaemon } from "./monolyth.app";
9
9
  import { DistributedAppConfig } from './distributed.app.config';
10
10
  export declare class DistributedNodeApp<S extends $Space, Nodes extends Record<string, DistributedNodeApp<any, any, any, any>>, ModuleNames extends string, Services extends Record<string, any>> extends App<S, ModuleNames, Services> {
11
11
  _host: {
@@ -4,14 +4,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.DistributedNodeDaemon = exports.DistributedNodeApp = void 0;
7
- const trx_engine_1 = require("../../engine/transaction/trx_engine");
8
- const tree_1 = require("../../engine/tree");
9
- const log_1 = require("../../engine/util/log");
10
- const promise_1 = __importDefault(require("../../engine/util/promise"));
11
- const builder_1 = require("../../engine/builder");
12
- const app_1 = require("../../engine/app/app");
13
- const inc_server_1 = require("../../engine/app/inc/inc.server");
14
- const monolyth_app_1 = require("../monolyth/monolyth.app");
7
+ const trx_engine_1 = require("../../transaction/trx_engine");
8
+ const tree_1 = require("../../tree");
9
+ const log_1 = require("../../util/log");
10
+ const promise_1 = __importDefault(require("../../util/promise"));
11
+ const builder_1 = require("../../builder");
12
+ const app_1 = require("../app");
13
+ const inc_server_1 = require("../inc/inc.server");
14
+ const monolyth_app_1 = require("./monolyth.app");
15
15
  const distributed_app_config_1 = require("./distributed.app.config");
16
16
  class DistributedNodeApp extends app_1.App {
17
17
  constructor(name, space) {
@@ -0,0 +1,7 @@
1
+ export type MonolythBundlerConfig = {
2
+ libPaths?: string[];
3
+ staticPaths?: string[];
4
+ scripts?: Record<string, string>;
5
+ nesoiPath?: string;
6
+ nesoiVersion?: string;
7
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,14 +1,12 @@
1
- import { $Space, ModuleName } from "../../schema";
2
- import { Daemon } from "../../engine/daemon";
3
- import { AnyElementSchema } from "../../engine/module";
4
- import { Tag } from "../../engine/dependency";
5
- import { Compiler } from "../../compiler/compiler";
6
- import { MonolythBundlerConfig } from "./monolyth.bundler";
7
- import { AppConfigBuilder } from "../../engine/app/app.config";
8
- import { InlineApp } from "../../engine/app/inline.app";
9
- import { IService } from "../../engine/app/service";
10
- import { Space } from "../../engine/space";
11
- import { AnyTrxEngine } from "../../engine/transaction/trx_engine";
1
+ import { $Space, ModuleName } from "../../../schema";
2
+ import { Daemon } from "../../daemon";
3
+ import { AnyElementSchema } from "../../module";
4
+ import { Tag } from "../../dependency";
5
+ import { AppConfigBuilder } from "../app.config";
6
+ import { InlineApp } from "../inline.app";
7
+ import { IService } from "../service";
8
+ import { Space } from "../../space";
9
+ import { AnyTrxEngine } from "../../transaction/trx_engine";
12
10
  /**
13
11
  * @category App
14
12
  * @subcategory Monolyth
@@ -17,7 +15,6 @@ export declare class MonolythApp<S extends $Space, ModuleNames extends string =
17
15
  private watcher?;
18
16
  constructor(name: string, space?: Space<S>);
19
17
  protected _packageJson?: Record<string, any>;
20
- static bundle(compiler: Compiler, appPath: string, config?: MonolythBundlerConfig): Promise<void>;
21
18
  daemon($?: {
22
19
  watch?: boolean;
23
20
  }): Promise<Daemon<S, ModuleNames>>;
@@ -34,13 +34,12 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.MonolythDaemon = exports.MonolythApp = void 0;
37
- const daemon_1 = require("../../engine/daemon");
38
- const log_1 = require("../../engine/util/log");
39
- const dependency_1 = require("../../engine/dependency");
40
- const monolyth_bundler_1 = require("./monolyth.bundler");
41
- const app_config_1 = require("../../engine/app/app.config");
42
- const inline_app_1 = require("../../engine/app/inline.app");
43
- const space_1 = require("../../engine/space");
37
+ const daemon_1 = require("../../daemon");
38
+ const log_1 = require("../../util/log");
39
+ const dependency_1 = require("../../dependency");
40
+ const app_config_1 = require("../app.config");
41
+ const inline_app_1 = require("../inline.app");
42
+ const space_1 = require("../../space");
44
43
  /**
45
44
  * @category App
46
45
  * @subcategory Monolyth
@@ -51,11 +50,6 @@ class MonolythApp extends inline_app_1.InlineApp {
51
50
  this.builders = undefined;
52
51
  this.space = space;
53
52
  }
54
- //
55
- static bundle(compiler, appPath, config) {
56
- return new monolyth_bundler_1.MonolythBundler(compiler, appPath, config)
57
- .run();
58
- }
59
53
  // Override InlineApp abstract methods
60
54
  async daemon($) {
61
55
  /**
@@ -3,7 +3,7 @@ import { ModuleName } from "../schema";
3
3
  import { AnyTrxEngine, HeldTrxNode } from './transaction/trx_engine';
4
4
  import { AnyAppConfig } from './app/app.config';
5
5
  import { AnyUsers, AuthRequest } from './auth/authn';
6
- import { TrxNode } from './transaction/trx_node';
6
+ import { AnyTrxNode, TrxNode } from './transaction/trx_node';
7
7
  import { TrxStatus } from './transaction/trx';
8
8
  import { AnyModule } from './module';
9
9
  import { IService } from './app/service';
@@ -114,21 +114,29 @@ export declare abstract class Daemon<S extends $Space, Modules extends ModuleNam
114
114
  */
115
115
  export declare class DaemonTrx<S extends $Space, M extends $Module, AuthUsers extends AnyUsers = {}> {
116
116
  private trxEngine;
117
+ /**
118
+ * The node from which this transaction was inherited
119
+ */
120
+ private _inherit?;
117
121
  /**
118
122
  * The authentication request which will be used to
119
123
  * authenticate this transaction prior to running.
120
124
  */
121
- private authnRequest?;
125
+ private tokens?;
122
126
  /**
123
127
  * @param trxEngine The transaction engine where to run the transaction.
124
128
  */
125
129
  constructor(trxEngine: AnyTrxEngine);
130
+ /**
131
+ * Inherit authentication from another transaction node.
132
+ */
133
+ auth_inherit(trx: AnyTrxNode): this;
126
134
  /**
127
135
  * Authenticate/authorize the transaction with the given credentials.
128
136
  * You can specify one or more credentials, so the transaction
129
137
  * is able to access elements with different authn providers.
130
138
  */
131
- auth<Auth extends AuthRequest<keyof S['authnUsers']>>(auth?: Auth): DaemonTrx<S, M, { [K in keyof Auth]: S["authnUsers"][K & keyof S["authnUsers"]]; }>;
139
+ auth<Auth extends AuthRequest<keyof S['authnUsers']>>(tokens?: Auth): DaemonTrx<S, M, { [K in keyof Auth]: S["authnUsers"][K & keyof S["authnUsers"]]; }>;
132
140
  /**
133
141
  * Run a method inside the transaction.
134
142
  *
@@ -168,13 +168,20 @@ class DaemonTrx {
168
168
  constructor(trxEngine) {
169
169
  this.trxEngine = trxEngine;
170
170
  }
171
+ /**
172
+ * Inherit authentication from another transaction node.
173
+ */
174
+ auth_inherit(trx) {
175
+ this._inherit = trx;
176
+ return this;
177
+ }
171
178
  /**
172
179
  * Authenticate/authorize the transaction with the given credentials.
173
180
  * You can specify one or more credentials, so the transaction
174
181
  * is able to access elements with different authn providers.
175
182
  */
176
- auth(auth) {
177
- this.authnRequest = auth;
183
+ auth(tokens) {
184
+ this.tokens = tokens;
178
185
  return this;
179
186
  }
180
187
  /**
@@ -184,7 +191,13 @@ class DaemonTrx {
184
191
  * @returns A `TrxStatus` containing metadata about the transaction and the function response
185
192
  */
186
193
  run(fn, id) {
187
- return this.trxEngine.trx(fn, id, this.authnRequest);
194
+ const inheritedAuth = this._inherit?.auth;
195
+ const tokens = {
196
+ ...inheritedAuth?.tokens,
197
+ ...this.tokens
198
+ };
199
+ const users = inheritedAuth?.users;
200
+ return this.trxEngine.trx(fn, id, tokens, users);
188
201
  }
189
202
  /**
190
203
  * Run a method inside the transaction, and hold it until
@@ -194,7 +207,13 @@ class DaemonTrx {
194
207
  * @returns A `TrxStatus` containing metadata about the transaction and the function response
195
208
  */
196
209
  run_and_hold(fn, id) {
197
- return this.trxEngine.trx_hold(fn, id, this.authnRequest);
210
+ const inheritedAuth = this._inherit.auth;
211
+ const tokens = {
212
+ ...inheritedAuth?.tokens,
213
+ ...this.tokens
214
+ };
215
+ const users = inheritedAuth?.users;
216
+ return this.trxEngine.trx_hold(fn, id, tokens, users);
198
217
  }
199
218
  }
200
219
  exports.DaemonTrx = DaemonTrx;
@@ -7,6 +7,7 @@ import { CreateObj, PatchObj, PutObj } from "../../../elements/entities/bucket/b
7
7
  import { NQL_Query } from "../../../elements/entities/bucket/query/nql.schema";
8
8
  import { NesoiFile } from "../../data/file";
9
9
  import { Tag } from "../../dependency";
10
+ import { DriveAdapter } from "../../../elements/entities/drive/drive_adapter";
10
11
  /**
11
12
  * @category Engine
12
13
  * @subcategory Transaction
@@ -229,8 +230,8 @@ export declare class BucketUnsafeTrxNode<M extends $Module, $ extends $Bucket> {
229
230
  */
230
231
  export declare class BucketDriveTrxNode<M extends $Module, $ extends $Bucket> {
231
232
  private bucketTrx;
232
- private bucket;
233
- constructor(bucketTrx: BucketTrxNode<M, $>, bucket: Bucket<M, $>);
233
+ private drive;
234
+ constructor(bucketTrx: BucketTrxNode<M, $>, drive: DriveAdapter);
234
235
  /**
235
236
  * Read the contents of a File of this bucket's drive
236
237
  */
@@ -6,6 +6,7 @@ const bucket_query_trx_node_1 = require("./bucket_query.trx_node");
6
6
  const error_1 = require("../../data/error");
7
7
  const dependency_1 = require("../../dependency");
8
8
  const external_trx_node_1 = require("./external.trx_node");
9
+ const daemon_1 = require("../../daemon");
9
10
  /**
10
11
  * @category Engine
11
12
  * @subcategory Transaction
@@ -328,10 +329,18 @@ class BucketTrxNode {
328
329
  * Methods to use the Bucket's drive (file storage).
329
330
  */
330
331
  get drive() {
332
+ let drive;
331
333
  if (!this.bucket) {
332
- throw new Error('Drive not supported for external buckets');
334
+ const module = trx_node_1.TrxNode.getModule(this.trx);
335
+ drive = daemon_1.Daemon.getBucketDrive(module.daemon, this.tag);
333
336
  }
334
- return new BucketDriveTrxNode(this, this.bucket);
337
+ else {
338
+ drive = this.bucket.drive;
339
+ }
340
+ if (!drive) {
341
+ throw error_1.NesoiError.Bucket.Drive.NoAdapter({ bucket: this.bucket?.schema.alias || this.tag.full });
342
+ }
343
+ return new BucketDriveTrxNode(this, drive);
335
344
  }
336
345
  /*
337
346
  Unsafe
@@ -436,19 +445,16 @@ exports.BucketUnsafeTrxNode = BucketUnsafeTrxNode;
436
445
  * @subcategory Transaction
437
446
  */
438
447
  class BucketDriveTrxNode {
439
- constructor(bucketTrx, bucket) {
448
+ constructor(bucketTrx, drive) {
440
449
  this.bucketTrx = bucketTrx;
441
- this.bucket = bucket;
442
- if (!this.bucket.drive) {
443
- throw error_1.NesoiError.Bucket.Drive.NoAdapter({ bucket: this.bucket.schema.alias });
444
- }
450
+ this.drive = drive;
445
451
  }
446
452
  /**
447
453
  * Read the contents of a File of this bucket's drive
448
454
  */
449
455
  read(file, options) {
450
456
  try {
451
- return this.bucket.drive.read(file);
457
+ return this.drive.read(file);
452
458
  }
453
459
  catch (e) {
454
460
  if (options?.silent) {
@@ -463,7 +469,7 @@ class BucketDriveTrxNode {
463
469
  */
464
470
  move(file, to, options) {
465
471
  try {
466
- return this.bucket.drive.move(file, to);
472
+ return this.drive.move(file, to);
467
473
  }
468
474
  catch (e) {
469
475
  if (options?.silent) {
@@ -478,7 +484,7 @@ class BucketDriveTrxNode {
478
484
  */
479
485
  delete(file, options) {
480
486
  try {
481
- return this.bucket.drive.delete(file);
487
+ return this.drive.delete(file);
482
488
  }
483
489
  catch (e) {
484
490
  if (options?.silent) {
@@ -26,7 +26,9 @@ class ExternalTrxNode {
26
26
  });
27
27
  let out;
28
28
  try {
29
- const res = await this.daemon.trx(this.tag.module).run_and_hold(async (extTrx) => {
29
+ const res = await this.daemon.trx(this.tag.module)
30
+ .auth_inherit(trx)
31
+ .run_and_hold(async (extTrx) => {
30
32
  try {
31
33
  return await fn(extTrx, element(extTrx));
32
34
  }