@x-fiber-sys/dev-tool 0.3.0 → 0.4.0

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.
@@ -2,24 +2,24 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ManagerKindMapping = exports.TelegramKindMapping = exports.SlackKindMapping = exports.EmailsKindMapping = exports.SqlMethodKindMapping = exports.ClickHouseKindMapping = exports.BrokerKindMapping = exports.StorixKindMapping = exports.ScramblerKindMapping = exports.SqlKindMapping = exports.RedisKindMapping = exports.LoggerKindMapping = exports.ConfigKindMapping = exports.CommonKindTypingsMapping = exports.CommonKindItemsMapping = exports.TracerKindMapping = exports.ContextKindMapping = exports.ImportsKindMapping = exports.CommonKindMapping = exports.WsServerKindMapping = exports.HttpServerKindMapping = exports.ReflectionKindMapping = exports.LibrariesNameMapping = exports.LibrariesKindMapping = void 0;
4
4
  exports.LibrariesKindMapping = {
5
- be_common: '@harvestgate/be-common',
6
- be_config: '@harvestgate/be-config',
7
- context: '@harvestgate/context',
8
- reflection: '@harvestgate/reflection',
9
- tracer: '@harvestgate/tracer',
10
- logger: '@harvestgate/logger',
11
- scrambler: '@harvestgate/scrambler',
12
- kafka: '@harvestgate/kafka',
13
- redis: '@harvestgate/redis',
14
- sql: '@harvestgate/sql',
15
- slack: '@harvestgate/slack',
16
- emails: '@harvestgate/emails',
17
- telegram: '@harvestgate/telegram',
18
- click_house: '@harvestgate/click-house',
19
- storix: '@harvestgate/storix',
20
- manager: '@harvestgate/manager',
21
- http_server: '@harvestgate/http-server',
22
- ws_server: '@harvestgate/ws-server',
5
+ be_common: '@x-fiber-sys/be-common',
6
+ be_config: '@x-fiber-sys/be-config',
7
+ context: '@x-fiber-sys/context',
8
+ reflection: '@x-fiber-sys/reflection',
9
+ tracer: '@x-fiber-sys/tracer',
10
+ logger: '@x-fiber-sys/logger',
11
+ scrambler: '@x-fiber-sys/scrambler',
12
+ broker: '@x-fiber-sys/broker',
13
+ redis: '@x-fiber-sys/redis',
14
+ sql: '@x-fiber-sys/sql',
15
+ slack: '@x-fiber-sys/slack',
16
+ emails: '@x-fiber-sys/emails',
17
+ telegram: '@x-fiber-sys/telegram',
18
+ click_house: '@x-fiber-sys/click-house',
19
+ storix: '@x-fiber-sys/storix',
20
+ manager: '@x-fiber-sys/manager',
21
+ http_server: '@x-fiber-sys/http-server',
22
+ ws_server: '@x-fiber-sys/ws-server',
23
23
  };
24
24
  exports.LibrariesNameMapping = {
25
25
  be_axios: 'Axios',
@@ -5,13 +5,14 @@ const node_path_1 = require("node:path");
5
5
  const prettier_1 = require("prettier");
6
6
  const fs_extra_1 = require("fs-extra");
7
7
  const navigator_1 = require("./navigator");
8
- const templates_1 = require("../templates");
9
8
  const runner_1 = require("./runner");
9
+ const installer_1 = require("./installer");
10
+ const templates_1 = require("../templates");
10
11
  class Generator {
11
12
  constructor() {
12
13
  this._navigator = new navigator_1.Navigator();
13
14
  this._runner = new runner_1.Runner();
14
- this._kind = 'business';
15
+ this._installer = new installer_1.Installer();
15
16
  this._formatConfig = {
16
17
  trailingComma: 'all',
17
18
  tabWidth: 2,
@@ -54,10 +55,12 @@ class Generator {
54
55
  wsServer: packages.includes('Ws server'),
55
56
  },
56
57
  };
58
+ this._installer.packages(concept);
57
59
  // contents
58
60
  new templates_1.InitiatorTemplate((0, node_path_1.join)(this._cwd, '/src/initiator.ts'), concept).generate();
59
61
  new templates_1.IocTemplate((0, node_path_1.join)(this._cwd, '/src/ioc.ts'), concept).generate();
60
- new templates_1.IndexTemplate((0, node_path_1.join)(this._cwd, '/src/index.ts')).generate();
62
+ new templates_1.IndexTemplate((0, node_path_1.join)(this._cwd, '/src/index.ts'), { service: concept.service }).generate();
63
+ new templates_1.EnvsTemplate((0, node_path_1.join)(this._cwd, 'src/types/envs.d.ts'), concept).generate();
61
64
  // file structures
62
65
  const sys = new templates_1.SysTemplate();
63
66
  (0, fs_extra_1.outputFileSync)((0, node_path_1.join)(this._schema, '/index.ts'), '');
@@ -67,13 +70,11 @@ class Generator {
67
70
  (0, fs_extra_1.outputFileSync)((0, node_path_1.join)(this._schema, '/domains/index.ts'), '');
68
71
  (0, fs_extra_1.outputFileSync)((0, node_path_1.join)(this._schema, '/common/index.ts'), '');
69
72
  (0, fs_extra_1.outputFileSync)((0, node_path_1.join)(this._types, 'broker.d.ts'), '');
70
- (0, fs_extra_1.outputFileSync)((0, node_path_1.join)(this._types, 'envs.d.ts'), '');
71
73
  (0, fs_extra_1.outputFileSync)((0, node_path_1.join)(this._types, 'service.d.ts'), '');
72
74
  (0, fs_extra_1.outputFileSync)((0, node_path_1.join)(this._types, 'sql.d.ts'), '');
73
75
  (0, fs_extra_1.outputFileSync)((0, node_path_1.join)(this._cwd, '.env'), '');
74
76
  sys.eslintrc((0, node_path_1.join)(this._cwd, '.eslintrc.cjs'));
75
77
  sys.dockerfileDev({ path: (0, node_path_1.join)(this._cwd, 'Dockerfile.dev'), name, kind });
76
- (0, fs_extra_1.outputFileSync)((0, node_path_1.join)(this._cwd, 'Dockerfile.dev'), '');
77
78
  (0, fs_extra_1.outputJSONSync)((0, node_path_1.join)(this._cwd, 'nodemon.json'), sys.nodemon());
78
79
  (0, fs_extra_1.outputJSONSync)((0, node_path_1.join)(this._cwd, 'package.json'), sys.package({ name, description }));
79
80
  (0, fs_extra_1.outputJSONSync)((0, node_path_1.join)(this._cwd, 'project.json'), sys.project(name));
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Installer = void 0;
4
+ const runner_1 = require("./runner");
4
5
  class Installer {
6
+ constructor() {
7
+ this._runner = new runner_1.Runner();
8
+ }
5
9
  packages({ libraries }) {
6
10
  const packages = [
7
11
  '@x-fiber-sys/be-common',
@@ -40,7 +44,7 @@ class Installer {
40
44
  packages.push('@x-fiber-sys/http-server');
41
45
  if (libraries.wsServer)
42
46
  packages.push('@x-fiber-sys/ws-server');
43
- return packages;
47
+ this._runner.install(packages);
44
48
  }
45
49
  }
46
50
  exports.Installer = Installer;
@@ -40,30 +40,29 @@ class Navigator {
40
40
  return item;
41
41
  }
42
42
  async service() {
43
- // const { name } = await prompt<{ name: string }>([
44
- // {
45
- // type: 'input',
46
- // name: 'name',
47
- // message: '',
48
- // },
49
- // ])
50
- //
51
- // const { description } = await prompt<{ description: string }>([
52
- // {
53
- // type: 'input',
54
- // name: 'description',
55
- // message: '',
56
- // },
57
- // ])
58
- //
59
- // const { kind } = await prompt<{ kind: string }>([
60
- // {
61
- // type: 'input',
62
- // name: 'kind',
63
- // message: '',
64
- // },
65
- // ])
66
- return { name: 'test', description: 'test-description', kind: 'business' };
43
+ const { name } = await (0, enquirer_1.prompt)([
44
+ {
45
+ type: 'input',
46
+ name: 'name',
47
+ message: 'Enter the service name',
48
+ },
49
+ ]);
50
+ const { description } = await (0, enquirer_1.prompt)([
51
+ {
52
+ type: 'input',
53
+ name: 'description',
54
+ message: 'Provide a short description of the service',
55
+ },
56
+ ]);
57
+ const { kind } = await (0, enquirer_1.prompt)([
58
+ {
59
+ type: 'select',
60
+ name: 'kind',
61
+ message: 'Select the service type:',
62
+ choices: ['domains', 'getaways', 'sys'],
63
+ },
64
+ ]);
65
+ return { name, description, kind };
67
66
  }
68
67
  }
69
68
  exports.Navigator = Navigator;
@@ -2,18 +2,27 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Runner = void 0;
4
4
  const child_process_1 = require("child_process");
5
+ const path_1 = require("path");
6
+ const fs_extra_1 = require("fs-extra");
5
7
  class Runner {
6
8
  install(packages, dev = false) {
7
9
  const args = ['install', ...packages];
8
10
  if (dev)
9
11
  args.push('--save-dev');
12
+ const cwd = (0, path_1.join)(process.cwd(), './test');
13
+ (0, fs_extra_1.ensureDirSync)(cwd);
10
14
  const result = (0, child_process_1.spawnSync)('npm', args, {
11
- cwd: process.cwd() + '/test',
12
- shell: true,
15
+ cwd,
13
16
  stdio: 'inherit',
14
17
  });
18
+ if (result.error) {
19
+ throw result.error;
20
+ }
21
+ if (result.signal) {
22
+ throw new Error(`npm was killed by signal ${result.signal}`);
23
+ }
15
24
  if (result.status !== 0) {
16
- throw new Error(`npm init failed with code ${result.status}`);
25
+ throw new Error(`npm install failed with code ${result.status}`);
17
26
  }
18
27
  }
19
28
  }
@@ -6,9 +6,13 @@ const common_1 = require("../common");
6
6
  const ts_morph_1 = require("ts-morph");
7
7
  class EnvsTemplate {
8
8
  constructor(path, concept) {
9
- const { libraries } = concept;
10
9
  this._typings = new morphix_1.TypingsSculptor();
11
- let source = new ts_morph_1.Project().createSourceFile(path, '', { overwrite: true });
10
+ this._path = path;
11
+ this._concept = concept;
12
+ }
13
+ generate() {
14
+ const { libraries } = this._concept;
15
+ let source = new ts_morph_1.Project().createSourceFile(this._path, '', { overwrite: true });
12
16
  this._typings.addTypings(source, {
13
17
  name: 'ConfigEnvs',
14
18
  body: (writer) => {
@@ -109,7 +113,7 @@ class EnvsTemplate {
109
113
  writer.writeLine(`}`);
110
114
  },
111
115
  });
112
- console.log(source.getText());
116
+ source.saveSync();
113
117
  }
114
118
  }
115
119
  exports.EnvsTemplate = EnvsTemplate;
@@ -5,14 +5,18 @@ const morphix_1 = require("@x-fiber-sys/morphix");
5
5
  const ts_morph_1 = require("ts-morph");
6
6
  const common_1 = require("../common");
7
7
  class IndexTemplate {
8
- constructor(path) {
8
+ constructor(path, { service }) {
9
9
  this._imports = new morphix_1.ImportsSculptor();
10
10
  this._variables = new morphix_1.VariablesSculptor();
11
11
  this._path = path;
12
+ this._service = service;
12
13
  }
13
14
  generate() {
14
15
  const source = new ts_morph_1.Project().createSourceFile(this._path, '', { overwrite: true });
15
16
  this._imports.addModule(source, [{ module: './initiator', namedImports: 'Initiator' }]);
17
+ this._imports.addModule(source, [
18
+ { module: `~${this._service}/ioc`, namedImports: ['container', 'Symbols'] },
19
+ ]);
16
20
  this._variables.addVariable(source, {
17
21
  name: 'initiator',
18
22
  value: (writer) => {
@@ -131,7 +131,7 @@ class InitiatorTemplate {
131
131
  }
132
132
  if (libraries.broker) {
133
133
  imports.push({
134
- module: common_1.LibrariesKindMapping.kafka,
134
+ module: common_1.LibrariesKindMapping.broker,
135
135
  namedImports: common_1.BrokerKindMapping.broker,
136
136
  isTypings: true,
137
137
  });
@@ -1,22 +1,22 @@
1
1
  export declare const LibrariesKindMapping: {
2
- readonly be_common: "@harvestgate/be-common";
3
- readonly be_config: "@harvestgate/be-config";
4
- readonly context: "@harvestgate/context";
5
- readonly reflection: "@harvestgate/reflection";
6
- readonly tracer: "@harvestgate/tracer";
7
- readonly logger: "@harvestgate/logger";
8
- readonly scrambler: "@harvestgate/scrambler";
9
- readonly kafka: "@harvestgate/kafka";
10
- readonly redis: "@harvestgate/redis";
11
- readonly sql: "@harvestgate/sql";
12
- readonly slack: "@harvestgate/slack";
13
- readonly emails: "@harvestgate/emails";
14
- readonly telegram: "@harvestgate/telegram";
15
- readonly click_house: "@harvestgate/click-house";
16
- readonly storix: "@harvestgate/storix";
17
- readonly manager: "@harvestgate/manager";
18
- readonly http_server: "@harvestgate/http-server";
19
- readonly ws_server: "@harvestgate/ws-server";
2
+ readonly be_common: "@x-fiber-sys/be-common";
3
+ readonly be_config: "@x-fiber-sys/be-config";
4
+ readonly context: "@x-fiber-sys/context";
5
+ readonly reflection: "@x-fiber-sys/reflection";
6
+ readonly tracer: "@x-fiber-sys/tracer";
7
+ readonly logger: "@x-fiber-sys/logger";
8
+ readonly scrambler: "@x-fiber-sys/scrambler";
9
+ readonly broker: "@x-fiber-sys/broker";
10
+ readonly redis: "@x-fiber-sys/redis";
11
+ readonly sql: "@x-fiber-sys/sql";
12
+ readonly slack: "@x-fiber-sys/slack";
13
+ readonly emails: "@x-fiber-sys/emails";
14
+ readonly telegram: "@x-fiber-sys/telegram";
15
+ readonly click_house: "@x-fiber-sys/click-house";
16
+ readonly storix: "@x-fiber-sys/storix";
17
+ readonly manager: "@x-fiber-sys/manager";
18
+ readonly http_server: "@x-fiber-sys/http-server";
19
+ readonly ws_server: "@x-fiber-sys/ws-server";
20
20
  };
21
21
  export declare const LibrariesNameMapping: {
22
22
  readonly be_axios: "Axios";
@@ -1,6 +1,6 @@
1
1
  import { ActionKind } from '../common';
2
2
  import { RowSchema } from './row.schema';
3
- import type { DomainObject } from '@harvestgate/contract';
3
+ import type { DomainObject } from '@x-fiber-sys/contract';
4
4
  export type AbstractDomainReference = {
5
5
  Service: string;
6
6
  Domain: string;
@@ -1,4 +1,4 @@
1
- import { type DomainObject, Row } from '@harvestgate/contract';
1
+ import { type DomainObject, Row } from '@x-fiber-sys/contract';
2
2
  export type HttpClause = 'body' | 'querystring' | 'params' | 'headers';
3
3
  export type RowSchema<O extends DomainObject, R extends Row<O> = Row<O>> = {
4
4
  [key in keyof R]: {
@@ -1,6 +1,7 @@
1
1
  export declare class Generator {
2
2
  private readonly _navigator;
3
3
  private readonly _runner;
4
+ private readonly _installer;
4
5
  private _kind;
5
6
  private readonly _formatConfig;
6
7
  constructor();
@@ -1,5 +1,7 @@
1
1
  import type { ServiceConcept } from '../types';
2
2
  export type XFiberPackage = '@x-fiber-sys/be-common' | '@x-fiber-sys/be-config' | '@x-fiber-sys/context' | '@x-fiber-sys/contract' | '@x-fiber-sys/github' | '@x-fiber-sys/metrics' | '@x-fiber-sys/morphix' | '@x-fiber-sys/performance' | '@x-fiber-sys/reflection' | '@x-fiber-sys/trigger' | '@x-fiber-sys/be-axios' | '@x-fiber-sys/click-house' | '@x-fiber-sys/docs' | '@x-fiber-sys/emails' | '@x-fiber-sys/http-server' | '@x-fiber-sys/kafka' | '@x-fiber-sys/logger' | '@x-fiber-sys/manager' | '@x-fiber-sys/meteo' | '@x-fiber-sys/neura' | '@x-fiber-sys/queue' | '@x-fiber-sys/redis' | '@x-fiber-sys/scrambler' | '@x-fiber-sys/slack' | '@x-fiber-sys/sql' | '@x-fiber-sys/storix' | '@x-fiber-sys/telegram' | '@x-fiber-sys/tracer' | '@x-fiber-sys/ws-server';
3
3
  export declare class Installer {
4
- packages({ libraries }: ServiceConcept): XFiberPackage[];
4
+ private _runner;
5
+ constructor();
6
+ packages({ libraries }: ServiceConcept): void;
5
7
  }
@@ -1,5 +1,8 @@
1
1
  import type { ServiceConcept } from '../types';
2
2
  export declare class EnvsTemplate {
3
3
  private readonly _typings;
4
+ private readonly _path;
5
+ private readonly _concept;
4
6
  constructor(path: string, concept: ServiceConcept);
7
+ generate(): void;
5
8
  }
@@ -2,6 +2,9 @@ export declare class IndexTemplate {
2
2
  private _imports;
3
3
  private _variables;
4
4
  private readonly _path;
5
- constructor(path: string);
5
+ private readonly _service;
6
+ constructor(path: string, { service }: {
7
+ service: string;
8
+ });
6
9
  generate(): void;
7
10
  }
@@ -1,4 +1,4 @@
1
- import type { DomainObject } from '@harvestgate/contract';
1
+ import type { DomainObject } from '@x-fiber-sys/contract';
2
2
  import type { ClassMethod } from '@x-fiber-sys/morphix';
3
3
  import type { DomainConcept, DomainRef, RowSchema } from '../schemas';
4
4
  export declare class PostgresRepositoryTemplate {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x-fiber-sys/dev-tool",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Command line interface for generating and managing microservices in a monorepo",
5
5
  "author": "pestsov-v <pestsov.js@gmail.com>",
6
6
  "license": "ISC",
@@ -29,15 +29,21 @@
29
29
  "url": "git+https://github.com/pestsov-v/c-argo-back-mono.git"
30
30
  },
31
31
  "scripts": {
32
- "dev": "nodemon ./src/index.ts",
33
- "start": "ts-node -r tsconfig-paths/register --files ./src/index.ts",
32
+ "dev": "nodemon ./src/debug.ts",
33
+ "start": "ts-node -r tsconfig-paths/register --files ./src/debug.ts",
34
34
  "packages": "rm -rf dist && tsc -p tsconfig.cjs.json && tsc -p tsconfig.types.json",
35
35
  "build": "npm run packages",
36
36
  "serve": "node ./dist/_cjs/index.js"
37
37
  },
38
38
  "dependencies": {
39
- "@x-fiber-sys/dev-tool": "^0.2.0",
40
- "@x-fiber-sys/morphix": "^0.1.0",
39
+ "@x-fiber-sys/be-common": "^0.1.0",
40
+ "@x-fiber-sys/be-config": "^0.1.0",
41
+ "@x-fiber-sys/context": "^0.1.0",
42
+ "@x-fiber-sys/contract": "^0.1.0",
43
+ "@x-fiber-sys/logger": "^0.1.0",
44
+ "@x-fiber-sys/morphix": "^0.3.0",
45
+ "@x-fiber-sys/reflection": "^0.1.0",
46
+ "@x-fiber-sys/tracer": "^0.1.0",
41
47
  "cfonts": "^3.3.1",
42
48
  "commander": "^14.0.1",
43
49
  "fs-extra": "^11.3.2",
@@ -1,195 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.concept = void 0;
4
- const typebox_1 = require("@sinclair/typebox");
5
- const be_common_1 = require("@harvestgate/be-common");
6
- const severity_kind_1 = require("@harvestgate/alerts-service/src/schemas/latest/common/severity-kind");
7
- const templates_1 = require("./templates");
8
- const AlertValidationSchema = typebox_1.Type.Object({
9
- name: typebox_1.Type.String(),
10
- sysCode: typebox_1.Type.String(),
11
- cooldownSeconds: typebox_1.Type.Union([typebox_1.Type.Null(), typebox_1.Type.Number()]),
12
- severity: (0, be_common_1.LiteralUnion)(severity_kind_1.SeverityKindMapping),
13
- description: typebox_1.Type.Optional(typebox_1.Type.String()),
14
- createdAt: be_common_1.DateSchema,
15
- updatedAt: be_common_1.DateSchema,
16
- });
17
- exports.concept = {
18
- ref: {
19
- service: 'alerts',
20
- domain: 'alerts',
21
- class: 'Alerts',
22
- item: 'alert',
23
- entity: 'alt_alerts',
24
- },
25
- actions: {
26
- createOne: {
27
- properties: {
28
- withIdReturn: true,
29
- },
30
- modules: {
31
- transport: true,
32
- controller: true,
33
- postresRepository: true,
34
- },
35
- },
36
- updateById: {
37
- modules: { transport: true, controller: true, postresRepository: true },
38
- properties: {},
39
- },
40
- patchById: {
41
- modules: { transport: true, controller: true, postresRepository: true },
42
- properties: {},
43
- },
44
- getById: {
45
- properties: {},
46
- modules: {
47
- transport: true,
48
- controller: true,
49
- postresRepository: true,
50
- },
51
- },
52
- softDeleteById: {
53
- properties: {},
54
- modules: {
55
- transport: true,
56
- controller: true,
57
- postresRepository: true,
58
- },
59
- },
60
- restoreById: {
61
- properties: {},
62
- modules: {
63
- transport: true,
64
- controller: true,
65
- postresRepository: true,
66
- },
67
- },
68
- archiveById: {
69
- properties: {},
70
- modules: {
71
- transport: true,
72
- controller: true,
73
- postresRepository: true,
74
- },
75
- },
76
- unarchiveById: {
77
- properties: {},
78
- modules: {
79
- transport: true,
80
- controller: true,
81
- postresRepository: true,
82
- },
83
- },
84
- deleteById: {
85
- properties: {},
86
- modules: {
87
- transport: true,
88
- controller: true,
89
- postresRepository: true,
90
- },
91
- },
92
- },
93
- item: {
94
- name: {
95
- structure: {
96
- domain: { key: 'string', properties: { min: 3, max: 100 } },
97
- isReadonly: false,
98
- isPrimary: false,
99
- isUnique: false,
100
- },
101
- generator: {
102
- sqlAlias: 'name',
103
- httpClause: 'body',
104
- isTimestampGenerate: false,
105
- isOptional: false,
106
- isUpdated: true,
107
- },
108
- },
109
- description: {
110
- structure: {
111
- domain: { key: 'string', properties: { min: 5, max: 2000 } },
112
- isRequired: false,
113
- },
114
- generator: {
115
- sqlAlias: 'description',
116
- httpClause: 'body',
117
- isOptional: true,
118
- isUpdated: true,
119
- },
120
- },
121
- sysCode: {
122
- structure: {
123
- domain: { key: 'string', properties: { min: 5, max: 15 } },
124
- isUnique: true,
125
- isReadonly: true,
126
- },
127
- generator: {
128
- sqlAlias: 'sys_code',
129
- httpClause: 'body',
130
- isOptional: false,
131
- },
132
- },
133
- cooldownSeconds: {
134
- structure: {
135
- domain: { key: 'number', properties: { min: 0, max: 60 * 60 * 24, step: 60 } },
136
- },
137
- generator: {
138
- sqlAlias: 'cooldown_seconds',
139
- httpClause: 'body',
140
- isNullable: true,
141
- isUpdated: true,
142
- },
143
- },
144
- severity: {
145
- structure: {
146
- domain: { key: 'enum', properties: { values: (0, be_common_1.createObjectEnum)(severity_kind_1.SeverityKindMapping) } },
147
- isRequired: true,
148
- },
149
- generator: {
150
- sqlAlias: 'severity',
151
- httpClause: 'body',
152
- isOptional: true,
153
- isUpdated: true,
154
- },
155
- },
156
- createdAt: {
157
- structure: {
158
- domain: { key: 'date', properties: {} },
159
- isRequired: true,
160
- isReadonly: true,
161
- },
162
- generator: {
163
- isTimestampGenerate: true,
164
- sqlAlias: 'created_at',
165
- },
166
- },
167
- updatedAt: {
168
- structure: {
169
- domain: { key: 'date', properties: {} },
170
- isRequired: true,
171
- isReadonly: true,
172
- },
173
- generator: {
174
- isTimestampGenerate: true,
175
- sqlAlias: 'updated_at',
176
- },
177
- },
178
- },
179
- };
180
- // new Initiator().start().catch((e) => console.log(e))
181
- new templates_1.InitiatorTemplate('./index.ts', {
182
- service: 'users',
183
- libraries: {
184
- broker: true,
185
- axios: true,
186
- storix: true,
187
- redis: true,
188
- postgres: true,
189
- scrambler: true,
190
- httpServer: true,
191
- timescale: true,
192
- emails: true,
193
- wsServer: true,
194
- },
195
- });
@@ -1,19 +0,0 @@
1
- import { DomainConcept } from './schemas';
2
- import { Static } from '@sinclair/typebox';
3
- declare const AlertValidationSchema: import("@sinclair/typebox").TObject<{
4
- name: import("@sinclair/typebox").TString;
5
- sysCode: import("@sinclair/typebox").TString;
6
- cooldownSeconds: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNull, import("@sinclair/typebox").TNumber]>;
7
- severity: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"critical" | "error" | "warning" | "info">, ...import("@sinclair/typebox").TLiteral<"critical" | "error" | "warning" | "info">[]]>;
8
- description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
9
- createdAt: import("@sinclair/typebox").TUnsafe<Date>;
10
- updatedAt: import("@sinclair/typebox").TUnsafe<Date>;
11
- }>;
12
- export declare const concept: DomainConcept<{
13
- Service: 'alerts';
14
- Domain: 'alerts';
15
- Class: 'Alerts';
16
- Item: 'alert';
17
- Entity: 'alt_alerts';
18
- }, Static<typeof AlertValidationSchema>>;
19
- export {};