sasat 0.14.6 → 0.14.9
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/lib/cli/cli.d.ts +2 -2
- package/lib/cli/cli.js +30 -30
- package/lib/cli/commands/createMigration.d.ts +2 -2
- package/lib/cli/commands/createMigration.js +35 -35
- package/lib/cli/commands/dumpDb.d.ts +1 -1
- package/lib/cli/commands/dumpDb.js +42 -42
- package/lib/cli/commands/generate.d.ts +1 -1
- package/lib/cli/commands/generate.js +19 -19
- package/lib/cli/commands/init.d.ts +1 -1
- package/lib/cli/commands/init.js +12 -12
- package/lib/cli/commands/migrate.d.ts +3 -3
- package/lib/cli/commands/migrate.js +29 -29
- package/lib/cli/console.d.ts +5 -5
- package/lib/cli/console.js +12 -12
- package/lib/config/config.d.ts +34 -34
- package/lib/config/config.js +34 -34
- package/lib/config/loader.d.ts +8 -8
- package/lib/config/loader.js +41 -41
- package/lib/constants/directory.d.ts +20 -20
- package/lib/constants/directory.js +34 -34
- package/lib/constants/interfaceConstants.d.ts +6 -6
- package/lib/constants/interfaceConstants.js +6 -6
- package/lib/db/connectors/dbClient.d.ts +31 -31
- package/lib/db/connectors/dbClient.js +26 -26
- package/lib/db/connectors/mariadb/client.d.ts +8 -8
- package/lib/db/connectors/mariadb/client.js +24 -24
- package/lib/db/connectors/mariadb/transaction.d.ts +9 -9
- package/lib/db/connectors/mariadb/transaction.js +20 -20
- package/lib/db/connectors/mockClient.d.ts +13 -13
- package/lib/db/connectors/mockClient.js +26 -26
- package/lib/db/connectors/mysql/client.d.ts +8 -8
- package/lib/db/connectors/mysql/client.js +25 -27
- package/lib/db/connectors/mysql/transaction.d.ts +9 -9
- package/lib/db/connectors/mysql/transaction.js +21 -22
- package/lib/db/formatQuery.d.ts +1 -1
- package/lib/db/formatQuery.js +14 -14
- package/lib/db/getDbClient.d.ts +2 -2
- package/lib/db/getDbClient.js +8 -8
- package/lib/db/sql/columnToSql.d.ts +2 -2
- package/lib/db/sql/columnToSql.js +27 -27
- package/lib/db/sql/condition.d.ts +22 -22
- package/lib/db/sql/condition.js +50 -50
- package/lib/db/sql/createTable/createTableParser.d.ts +17 -17
- package/lib/db/sql/createTable/createTableParser.js +241 -241
- package/lib/db/sql/createTable/createTableSerializer.d.ts +2 -2
- package/lib/db/sql/createTable/createTableSerializer.js +135 -135
- package/lib/db/sql/createTable/lexer/columnLexer.d.ts +2 -2
- package/lib/db/sql/createTable/lexer/columnLexer.js +20 -20
- package/lib/db/sql/createTable/lexer/createSimpleLexer.d.ts +3 -3
- package/lib/db/sql/createTable/lexer/createSimpleLexer.js +8 -8
- package/lib/db/sql/createTable/lexer/createTableLexer.d.ts +2 -2
- package/lib/db/sql/createTable/lexer/createTableLexer.js +22 -22
- package/lib/db/sql/createTable/lexer/lexer.d.ts +30 -30
- package/lib/db/sql/createTable/lexer/lexer.js +126 -126
- package/lib/db/sql/createTable/lexer/lexer2.d.ts +22 -22
- package/lib/db/sql/createTable/lexer/lexer2.js +110 -110
- package/lib/db/sql/createTable/lexer/rules.d.ts +21 -21
- package/lib/db/sql/createTable/lexer/rules.js +92 -92
- package/lib/db/sql/expression/comparison.d.ts +19 -19
- package/lib/db/sql/expression/comparison.js +36 -36
- package/lib/db/sql/expression/compositeCondition.d.ts +9 -9
- package/lib/db/sql/expression/compositeCondition.js +16 -16
- package/lib/db/sql/expression/conditionExpression.d.ts +5 -5
- package/lib/db/sql/expression/conditionExpression.js +10 -10
- package/lib/db/sql/sqlCreater.d.ts +8 -8
- package/lib/db/sql/sqlCreater.js +12 -12
- package/lib/error.d.ts +3 -3
- package/lib/error.js +7 -7
- package/lib/generator/controller.d.ts +20 -20
- package/lib/generator/controller.js +68 -68
- package/lib/generator/generator.d.ts +21 -21
- package/lib/generator/generator.js +1 -1
- package/lib/generator/gql/columnToGqlType.d.ts +3 -3
- package/lib/generator/gql/columnToGqlType.js +27 -27
- package/lib/generator/gql/types.d.ts +7 -7
- package/lib/generator/gql/types.js +8 -8
- package/lib/generator/ts/code/abstruct/exportableDeclaration.d.ts +6 -6
- package/lib/generator/ts/code/abstruct/exportableDeclaration.js +14 -14
- package/lib/generator/ts/code/abstruct/statement.d.ts +4 -4
- package/lib/generator/ts/code/abstruct/statement.js +7 -7
- package/lib/generator/ts/code/abstruct/tsCode.d.ts +9 -9
- package/lib/generator/ts/code/abstruct/tsCode.js +22 -22
- package/lib/generator/ts/code/accessors.d.ts +5 -5
- package/lib/generator/ts/code/accessors.js +6 -6
- package/lib/generator/ts/code/factory.d.ts +68 -68
- package/lib/generator/ts/code/factory.js +80 -80
- package/lib/generator/ts/code/importDeclaration.d.ts +6 -6
- package/lib/generator/ts/code/importDeclaration.js +11 -11
- package/lib/generator/ts/code/node/ExpressionStatement.d.ts +7 -7
- package/lib/generator/ts/code/node/ExpressionStatement.js +11 -11
- package/lib/generator/ts/code/node/block.d.ts +6 -6
- package/lib/generator/ts/code/node/block.js +11 -11
- package/lib/generator/ts/code/node/class.d.ts +20 -20
- package/lib/generator/ts/code/node/class.js +42 -42
- package/lib/generator/ts/code/node/enumDeclaration.d.ts +10 -10
- package/lib/generator/ts/code/node/enumDeclaration.js +17 -17
- package/lib/generator/ts/code/node/enumMember.d.ts +8 -8
- package/lib/generator/ts/code/node/enumMember.js +16 -16
- package/lib/generator/ts/code/node/expressions.d.ts +103 -103
- package/lib/generator/ts/code/node/expressions.js +188 -188
- package/lib/generator/ts/code/node/extendsClause.d.ts +7 -7
- package/lib/generator/ts/code/node/extendsClause.js +11 -11
- package/lib/generator/ts/code/node/ifStatement.d.ts +8 -8
- package/lib/generator/ts/code/node/ifStatement.js +12 -12
- package/lib/generator/ts/code/node/implementsClause.d.ts +7 -7
- package/lib/generator/ts/code/node/implementsClause.js +11 -11
- package/lib/generator/ts/code/node/interface.d.ts +11 -11
- package/lib/generator/ts/code/node/interface.js +21 -21
- package/lib/generator/ts/code/node/methodDeclaration.d.ts +16 -16
- package/lib/generator/ts/code/node/methodDeclaration.js +30 -30
- package/lib/generator/ts/code/node/modifier/methodModifiers.d.ts +8 -8
- package/lib/generator/ts/code/node/modifier/methodModifiers.js +18 -18
- package/lib/generator/ts/code/node/modifier/modifiers.d.ts +17 -17
- package/lib/generator/ts/code/node/modifier/modifiers.js +47 -47
- package/lib/generator/ts/code/node/modifier/propertyModifiers.d.ts +10 -10
- package/lib/generator/ts/code/node/modifier/propertyModifiers.js +21 -21
- package/lib/generator/ts/code/node/parameter.d.ts +8 -9
- package/lib/generator/ts/code/node/parameter.js +17 -17
- package/lib/generator/ts/code/node/propertyAssignment.d.ts +8 -8
- package/lib/generator/ts/code/node/propertyAssignment.js +14 -14
- package/lib/generator/ts/code/node/propertyDeclaration.d.ts +15 -15
- package/lib/generator/ts/code/node/propertyDeclaration.js +32 -32
- package/lib/generator/ts/code/node/propertySignature.d.ts +11 -11
- package/lib/generator/ts/code/node/propertySignature.js +18 -18
- package/lib/generator/ts/code/node/rawCodeStatement.d.ts +6 -6
- package/lib/generator/ts/code/node/rawCodeStatement.js +10 -10
- package/lib/generator/ts/code/node/returnStatement.d.ts +7 -7
- package/lib/generator/ts/code/node/returnStatement.js +11 -11
- package/lib/generator/ts/code/node/spreadAssignment.d.ts +7 -7
- package/lib/generator/ts/code/node/spreadAssignment.js +11 -11
- package/lib/generator/ts/code/node/type/arrayType.d.ts +7 -7
- package/lib/generator/ts/code/node/type/arrayType.js +13 -13
- package/lib/generator/ts/code/node/type/intersectionType.d.ts +8 -8
- package/lib/generator/ts/code/node/type/intersectionType.js +11 -11
- package/lib/generator/ts/code/node/type/type.d.ts +10 -10
- package/lib/generator/ts/code/node/type/type.js +3 -3
- package/lib/generator/ts/code/node/type/typeAliasDeclaration.d.ts +8 -8
- package/lib/generator/ts/code/node/type/typeAliasDeclaration.js +14 -14
- package/lib/generator/ts/code/node/type/typeKeyword.d.ts +15 -15
- package/lib/generator/ts/code/node/type/typeKeyword.js +15 -15
- package/lib/generator/ts/code/node/type/typeLiteral.d.ts +9 -9
- package/lib/generator/ts/code/node/type/typeLiteral.js +16 -16
- package/lib/generator/ts/code/node/type/typeReference.d.ts +12 -12
- package/lib/generator/ts/code/node/type/typeReference.js +25 -25
- package/lib/generator/ts/code/node/type/unionType.d.ts +7 -7
- package/lib/generator/ts/code/node/type/unionType.js +13 -13
- package/lib/generator/ts/code/node/variableDeclaration.d.ts +12 -13
- package/lib/generator/ts/code/node/variableDeclaration.js +16 -16
- package/lib/generator/ts/code/tsUtil.d.ts +4 -4
- package/lib/generator/ts/code/tsUtil.js +4 -4
- package/lib/generator/ts/db/generatedRepositoryGenerator.d.ts +11 -11
- package/lib/generator/ts/db/generatedRepositoryGenerator.js +110 -111
- package/lib/generator/ts/db/repositoryGenerator.d.ts +5 -5
- package/lib/generator/ts/db/repositoryGenerator.js +13 -13
- package/lib/generator/ts/entityGenerator.d.ts +10 -10
- package/lib/generator/ts/entityGenerator.js +27 -27
- package/lib/generator/ts/fieldGenerator.d.ts +6 -6
- package/lib/generator/ts/fieldGenerator.js +25 -25
- package/lib/generator/ts/file.d.ts +10 -10
- package/lib/generator/ts/file.js +31 -31
- package/lib/generator/ts/generator.d.ts +18 -18
- package/lib/generator/ts/generator.js +53 -53
- package/lib/generator/ts/gql/contextGenerator.d.ts +5 -5
- package/lib/generator/ts/gql/contextGenerator.js +10 -10
- package/lib/generator/ts/gql/mutationGenerator.d.ts +15 -15
- package/lib/generator/ts/gql/mutationGenerator.js +87 -87
- package/lib/generator/ts/gql/queryGenerator.d.ts +6 -6
- package/lib/generator/ts/gql/queryGenerator.js +38 -38
- package/lib/generator/ts/gql/resolverGenerator.d.ts +8 -8
- package/lib/generator/ts/gql/resolverGenerator.js +45 -45
- package/lib/generator/ts/gql/subscriptionGenerator.d.ts +9 -9
- package/lib/generator/ts/gql/subscriptionGenerator.js +58 -58
- package/lib/generator/ts/gql/typeDefGenerator.d.ts +9 -9
- package/lib/generator/ts/gql/typeDefGenerator.js +42 -42
- package/lib/generator/ts/relationMapGenerator.d.ts +9 -9
- package/lib/generator/ts/relationMapGenerator.js +56 -56
- package/lib/generator/ts/staticFiles.d.ts +2 -2
- package/lib/generator/ts/staticFiles.js +23 -23
- package/lib/generator/ts/tsValueString.d.ts +1 -1
- package/lib/generator/ts/tsValueString.js +27 -27
- package/lib/index.d.ts +17 -17
- package/lib/index.js +8 -8
- package/lib/migration/column/columnTypes.d.ts +27 -27
- package/lib/migration/column/columnTypes.js +44 -44
- package/lib/migration/controller.d.ts +12 -12
- package/lib/migration/controller.js +72 -72
- package/lib/migration/creators/columnBuilder.d.ts +91 -91
- package/lib/migration/creators/columnBuilder.js +179 -179
- package/lib/migration/creators/columnCreator.d.ts +24 -24
- package/lib/migration/creators/columnCreator.js +28 -28
- package/lib/migration/creators/tableCreator.d.ts +33 -33
- package/lib/migration/creators/tableCreator.js +53 -53
- package/lib/migration/data/foreignKey.d.ts +9 -9
- package/lib/migration/data/foreignKey.js +1 -1
- package/lib/migration/data/gqlOption.d.ts +21 -21
- package/lib/migration/data/gqlOption.js +28 -28
- package/lib/migration/data/index.d.ts +15 -15
- package/lib/migration/data/index.js +22 -22
- package/lib/migration/data/relation.d.ts +1 -1
- package/lib/migration/data/relation.js +1 -1
- package/lib/migration/dataStore.d.ts +12 -12
- package/lib/migration/dataStore.js +17 -17
- package/lib/migration/front/migration.d.ts +9 -9
- package/lib/migration/front/migration.js +1 -1
- package/lib/migration/front/storeMigrator.d.ts +23 -23
- package/lib/migration/front/storeMigrator.js +53 -53
- package/lib/migration/front/tableMigrator.d.ts +39 -39
- package/lib/migration/front/tableMigrator.js +84 -84
- package/lib/migration/functions/assembleColumn.d.ts +4 -4
- package/lib/migration/functions/assembleColumn.js +7 -7
- package/lib/migration/migrationReader.d.ts +7 -7
- package/lib/migration/migrationReader.js +54 -54
- package/lib/migration/migrationTargetResolver.d.ts +9 -9
- package/lib/migration/migrationTargetResolver.js +34 -34
- package/lib/migration/serializable/column.d.ts +41 -41
- package/lib/migration/serializable/column.js +59 -59
- package/lib/migration/serializable/serializable.d.ts +3 -3
- package/lib/migration/serializable/serializable.js +1 -1
- package/lib/migration/serializable/table.d.ts +48 -48
- package/lib/migration/serializable/table.js +161 -161
- package/lib/migration/serialized/serializedColumn.d.ts +38 -38
- package/lib/migration/serialized/serializedColumn.js +10 -10
- package/lib/migration/serialized/serializedStore.d.ts +14 -14
- package/lib/migration/serialized/serializedStore.js +1 -1
- package/lib/parser/node/entityName.d.ts +22 -22
- package/lib/parser/node/entityName.js +59 -59
- package/lib/parser/node/entityNode.d.ts +23 -23
- package/lib/parser/node/entityNode.js +43 -43
- package/lib/parser/node/fieldNode.d.ts +25 -25
- package/lib/parser/node/fieldNode.js +43 -43
- package/lib/parser/node/findMethod.d.ts +10 -10
- package/lib/parser/node/findMethod.js +12 -12
- package/lib/parser/node/gql/contextNode.d.ts +6 -6
- package/lib/parser/node/gql/contextNode.js +6 -6
- package/lib/parser/node/gql/contextParamNode.d.ts +5 -5
- package/lib/parser/node/gql/contextParamNode.js +6 -6
- package/lib/parser/node/gql/mutationNode.d.ts +43 -43
- package/lib/parser/node/gql/mutationNode.js +68 -68
- package/lib/parser/node/gql/queryNode.d.ts +10 -10
- package/lib/parser/node/gql/queryNode.js +12 -12
- package/lib/parser/node/gql/subscriptionFilterNode.d.ts +6 -6
- package/lib/parser/node/gql/subscriptionFilterNode.js +6 -6
- package/lib/parser/node/gql/typeDefNode.d.ts +9 -9
- package/lib/parser/node/gql/typeDefNode.js +21 -21
- package/lib/parser/node/parameterNode.d.ts +8 -8
- package/lib/parser/node/parameterNode.js +12 -12
- package/lib/parser/node/relationNode.d.ts +20 -20
- package/lib/parser/node/relationNode.js +31 -31
- package/lib/parser/node/repositoryNode.d.ts +21 -21
- package/lib/parser/node/repositoryNode.js +55 -55
- package/lib/parser/node/rootNode.d.ts +20 -20
- package/lib/parser/node/rootNode.js +28 -28
- package/lib/parser/node/typeNode.d.ts +12 -12
- package/lib/parser/node/typeNode.js +28 -28
- package/lib/parser/nodeFactory/contextNodeFactory.d.ts +5 -5
- package/lib/parser/nodeFactory/contextNodeFactory.js +12 -12
- package/lib/parser/nodeFactory/mutationNodeFactory.d.ts +7 -7
- package/lib/parser/nodeFactory/mutationNodeFactory.js +33 -33
- package/lib/parser/nodeFactory/queryNodeFactory.d.ts +7 -7
- package/lib/parser/nodeFactory/queryNodeFactory.js +17 -17
- package/lib/parser/parser.d.ts +5 -5
- package/lib/parser/parser.js +10 -10
- package/lib/runtime/createTypeDef.d.ts +1 -1
- package/lib/runtime/createTypeDef.js +4 -4
- package/lib/runtime/dsl/factory.d.ts +30 -30
- package/lib/runtime/dsl/factory.js +108 -108
- package/lib/runtime/dsl/mutation/mutation.d.ts +24 -24
- package/lib/runtime/dsl/mutation/mutation.js +20 -20
- package/lib/runtime/dsl/query/createQueryResolveInfo.d.ts +26 -26
- package/lib/runtime/dsl/query/createQueryResolveInfo.js +25 -25
- package/lib/runtime/dsl/query/fieldToQuery.d.ts +4 -4
- package/lib/runtime/dsl/query/fieldToQuery.js +22 -22
- package/lib/runtime/dsl/query/query.d.ts +106 -106
- package/lib/runtime/dsl/query/query.js +16 -16
- package/lib/runtime/dsl/query/sql/hydrate.d.ts +13 -13
- package/lib/runtime/dsl/query/sql/hydrate.js +81 -81
- package/lib/runtime/dsl/query/sql/nodeToSql.d.ts +22 -22
- package/lib/runtime/dsl/query/sql/nodeToSql.js +63 -63
- package/lib/runtime/dsl/query/sql/queryToSql.d.ts +2 -2
- package/lib/runtime/dsl/query/sql/queryToSql.js +13 -13
- package/lib/runtime/dsl/replaceAliases.d.ts +4 -4
- package/lib/runtime/dsl/replaceAliases.js +66 -66
- package/lib/runtime/field.d.ts +5 -5
- package/lib/runtime/field.js +1 -1
- package/lib/runtime/gqlResolveInfoToField.d.ts +3 -3
- package/lib/runtime/gqlResolveInfoToField.js +25 -25
- package/lib/runtime/sasatRepository.d.ts +31 -31
- package/lib/runtime/sasatRepository.js +75 -75
- package/lib/runtime/sql/sqlString.d.ts +5 -5
- package/lib/runtime/sql/sqlString.js +6 -6
- package/lib/util/arrayUtil.d.ts +3 -3
- package/lib/util/arrayUtil.js +11 -11
- package/lib/util/assignDeep.d.ts +5 -5
- package/lib/util/assignDeep.js +21 -21
- package/lib/util/dateUtil.d.ts +1 -1
- package/lib/util/dateUtil.js +20 -20
- package/lib/util/fsUtil.d.ts +7 -7
- package/lib/util/fsUtil.js +37 -37
- package/lib/util/stringUtil.d.ts +4 -4
- package/lib/util/stringUtil.js +12 -12
- package/lib/util/type.d.ts +3 -3
- package/lib/util/type.js +1 -1
- package/package.json +1 -1
package/lib/cli/cli.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
export {};
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
export {};
|
package/lib/cli/cli.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { cac } from 'cac';
|
|
3
|
-
import { createMigration } from './commands/createMigration.js';
|
|
4
|
-
import { migrate } from './commands/migrate.js';
|
|
5
|
-
import { init } from './commands/init.js';
|
|
6
|
-
import { generate } from './commands/generate.js';
|
|
7
|
-
import { dumpDB } from './commands/dumpDb.js';
|
|
8
|
-
const cli = cac();
|
|
9
|
-
try {
|
|
10
|
-
cli
|
|
11
|
-
.usage('yarn sasat <command> [options]\n')
|
|
12
|
-
.command('migrate', 'execute migration')
|
|
13
|
-
.option('-g, --generateFiles', 'migrate with generate files')
|
|
14
|
-
.action(async (options) => {
|
|
15
|
-
await migrate(options).catch(() => {
|
|
16
|
-
process.exit(1);
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
cli.command('generate', 'generate files').action(generate);
|
|
20
|
-
cli.command('migration:create [name]', 'generate new migration file').action(createMigration);
|
|
21
|
-
cli.command('dump-db', 'dump database schema').action(dumpDB);
|
|
22
|
-
cli.command('init').action(init);
|
|
23
|
-
cli.parse();
|
|
24
|
-
if (!cli.matchedCommand)
|
|
25
|
-
cli.outputHelp();
|
|
26
|
-
}
|
|
27
|
-
catch (e) {
|
|
28
|
-
console.error(e);
|
|
29
|
-
process.exit(1);
|
|
30
|
-
}
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { cac } from 'cac';
|
|
3
|
+
import { createMigration } from './commands/createMigration.js';
|
|
4
|
+
import { migrate } from './commands/migrate.js';
|
|
5
|
+
import { init } from './commands/init.js';
|
|
6
|
+
import { generate } from './commands/generate.js';
|
|
7
|
+
import { dumpDB } from './commands/dumpDb.js';
|
|
8
|
+
const cli = cac();
|
|
9
|
+
try {
|
|
10
|
+
cli
|
|
11
|
+
.usage('yarn sasat <command> [options]\n')
|
|
12
|
+
.command('migrate', 'execute migration')
|
|
13
|
+
.option('-g, --generateFiles', 'migrate with generate files')
|
|
14
|
+
.action(async (options) => {
|
|
15
|
+
await migrate(options).catch(() => {
|
|
16
|
+
process.exit(1);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
cli.command('generate', 'generate files').action(generate);
|
|
20
|
+
cli.command('migration:create [name]', 'generate new migration file').action(createMigration);
|
|
21
|
+
cli.command('dump-db', 'dump database schema').action(dumpDB);
|
|
22
|
+
cli.command('init').action(init);
|
|
23
|
+
cli.parse();
|
|
24
|
+
if (!cli.matchedCommand)
|
|
25
|
+
cli.outputHelp();
|
|
26
|
+
}
|
|
27
|
+
catch (e) {
|
|
28
|
+
console.error(e);
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const createMigrationFile: (migrationName: string) => string;
|
|
2
|
-
export declare const createMigration: (args: string) => void;
|
|
1
|
+
export declare const createMigrationFile: (migrationName: string) => string;
|
|
2
|
+
export declare const createMigration: (args: string) => void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as fs from 'fs';
|
|
2
|
-
import { join } from 'path';
|
|
3
|
-
import { config } from '../../config/config.js';
|
|
4
|
-
import { capitalizeFirstLetter } from '../../util/stringUtil.js';
|
|
5
|
-
import { mkDirIfNotExist } from '../../util/fsUtil.js';
|
|
6
|
-
import { Console } from '../console.js';
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
import { config } from '../../config/config.js';
|
|
4
|
+
import { capitalizeFirstLetter } from '../../util/stringUtil.js';
|
|
5
|
+
import { mkDirIfNotExist } from '../../util/fsUtil.js';
|
|
6
|
+
import { Console } from '../console.js';
|
|
7
7
|
const getMigrationFile = (className) => `import { SasatMigration, MigrationStore } from "sasat";
|
|
8
8
|
|
|
9
9
|
class ${capitalizeFirstLetter(className)} implements SasatMigration {
|
|
@@ -21,32 +21,32 @@ class ${capitalizeFirstLetter(className)} implements SasatMigration {
|
|
|
21
21
|
// DO NOT EDIT (last line is used)
|
|
22
22
|
new ${capitalizeFirstLetter(className)}()
|
|
23
23
|
|
|
24
|
-
`;
|
|
25
|
-
export const createMigrationFile = (migrationName) => {
|
|
26
|
-
const date = new Date();
|
|
27
|
-
const pad = (val) => val.toString().padStart(2, '0');
|
|
28
|
-
const now = date.getFullYear() +
|
|
29
|
-
pad(date.getMonth() + 1) +
|
|
30
|
-
pad(date.getDate()) +
|
|
31
|
-
`_` +
|
|
32
|
-
pad(date.getHours()) +
|
|
33
|
-
pad(date.getMinutes()) +
|
|
34
|
-
pad(date.getSeconds());
|
|
35
|
-
const fileName = now + migrationName;
|
|
36
|
-
const outDir = join(config().migration.dir);
|
|
37
|
-
mkDirIfNotExist(outDir);
|
|
38
|
-
fs.writeFileSync(join(outDir, fileName) + '.ts', getMigrationFile(migrationName));
|
|
39
|
-
return fileName;
|
|
40
|
-
};
|
|
41
|
-
export const createMigration = (args) => {
|
|
42
|
-
if (!args) {
|
|
43
|
-
Console.error('missing argument migration name');
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
if (!/^[$A-Za-z_][0-9A-Za-z_]+$/.test(args)) {
|
|
47
|
-
Console.error('migration name should be match /^[$A-Za-z_][0-9A-Za-z_]+$/');
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
Console.success(createMigrationFile(args) + ' Successfully created');
|
|
51
|
-
return;
|
|
52
|
-
};
|
|
24
|
+
`;
|
|
25
|
+
export const createMigrationFile = (migrationName) => {
|
|
26
|
+
const date = new Date();
|
|
27
|
+
const pad = (val) => val.toString().padStart(2, '0');
|
|
28
|
+
const now = date.getFullYear() +
|
|
29
|
+
pad(date.getMonth() + 1) +
|
|
30
|
+
pad(date.getDate()) +
|
|
31
|
+
`_` +
|
|
32
|
+
pad(date.getHours()) +
|
|
33
|
+
pad(date.getMinutes()) +
|
|
34
|
+
pad(date.getSeconds());
|
|
35
|
+
const fileName = now + migrationName;
|
|
36
|
+
const outDir = join(config().migration.dir);
|
|
37
|
+
mkDirIfNotExist(outDir);
|
|
38
|
+
fs.writeFileSync(join(outDir, fileName) + '.ts', getMigrationFile(migrationName));
|
|
39
|
+
return fileName;
|
|
40
|
+
};
|
|
41
|
+
export const createMigration = (args) => {
|
|
42
|
+
if (!args) {
|
|
43
|
+
Console.error('missing argument migration name');
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (!/^[$A-Za-z_][0-9A-Za-z_]+$/.test(args)) {
|
|
47
|
+
Console.error('migration name should be match /^[$A-Za-z_][0-9A-Za-z_]+$/');
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
Console.success(createMigrationFile(args) + ' Successfully created');
|
|
51
|
+
return;
|
|
52
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const dumpDB: () => Promise<void>;
|
|
1
|
+
export declare const dumpDB: () => Promise<void>;
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { Console } from '../console.js';
|
|
2
|
-
import { serializeCreateTable } from '../../db/sql/createTable/createTableSerializer.js';
|
|
3
|
-
import { SqlString } from '../../runtime/sql/sqlString.js';
|
|
4
|
-
import { writeYmlFile } from '../../util/fsUtil.js';
|
|
5
|
-
import { DBColumnTypes } from '../../migration/column/columnTypes.js';
|
|
6
|
-
import { config } from '../../config/config.js';
|
|
7
|
-
import { getDbClient } from
|
|
8
|
-
export const dumpDB = async () => {
|
|
9
|
-
const con = getDbClient();
|
|
10
|
-
try {
|
|
11
|
-
const tables = await con.rawQuery('show tables').then(it => it.flatMap(it => Object.values(it)));
|
|
12
|
-
const serialized = await Promise.all(tables.map(table => {
|
|
13
|
-
return con
|
|
14
|
-
.rawQuery('show create table ' + SqlString.escapeId(table))
|
|
15
|
-
.then(it => it[0]['Create Table'])
|
|
16
|
-
.then(serializeCreateTable);
|
|
17
|
-
}));
|
|
18
|
-
const supportedTypes = Object.values(DBColumnTypes);
|
|
19
|
-
const store = {
|
|
20
|
-
tables: serialized.filter(it => {
|
|
21
|
-
if (it.primaryKey.length === 0) {
|
|
22
|
-
Console.error(`table ${it.tableName} skipped, reason: missing primary key`);
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
const notSupported = it.columns.find(it => !supportedTypes.includes(it.type));
|
|
26
|
-
if (notSupported) {
|
|
27
|
-
Console.error(`table ${it.tableName} skipped, reason: ${it.tableName}.${notSupported.columnName} column type "${notSupported.type}" is Not Supported`);
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
return true;
|
|
31
|
-
}),
|
|
32
|
-
};
|
|
33
|
-
writeYmlFile(config().migration.dir, 'initialSchema.yml', store);
|
|
34
|
-
}
|
|
35
|
-
catch (e) {
|
|
36
|
-
Console.error(e.message);
|
|
37
|
-
throw e;
|
|
38
|
-
}
|
|
39
|
-
finally {
|
|
40
|
-
await con.release();
|
|
41
|
-
}
|
|
42
|
-
};
|
|
1
|
+
import { Console } from '../console.js';
|
|
2
|
+
import { serializeCreateTable } from '../../db/sql/createTable/createTableSerializer.js';
|
|
3
|
+
import { SqlString } from '../../runtime/sql/sqlString.js';
|
|
4
|
+
import { writeYmlFile } from '../../util/fsUtil.js';
|
|
5
|
+
import { DBColumnTypes } from '../../migration/column/columnTypes.js';
|
|
6
|
+
import { config } from '../../config/config.js';
|
|
7
|
+
import { getDbClient } from '../../db/getDbClient.js';
|
|
8
|
+
export const dumpDB = async () => {
|
|
9
|
+
const con = getDbClient();
|
|
10
|
+
try {
|
|
11
|
+
const tables = await con.rawQuery('show tables').then(it => it.flatMap(it => Object.values(it)));
|
|
12
|
+
const serialized = await Promise.all(tables.map(table => {
|
|
13
|
+
return con
|
|
14
|
+
.rawQuery('show create table ' + SqlString.escapeId(table))
|
|
15
|
+
.then(it => it[0]['Create Table'])
|
|
16
|
+
.then(serializeCreateTable);
|
|
17
|
+
}));
|
|
18
|
+
const supportedTypes = Object.values(DBColumnTypes);
|
|
19
|
+
const store = {
|
|
20
|
+
tables: serialized.filter(it => {
|
|
21
|
+
if (it.primaryKey.length === 0) {
|
|
22
|
+
Console.error(`table ${it.tableName} skipped, reason: missing primary key`);
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
const notSupported = it.columns.find(it => !supportedTypes.includes(it.type));
|
|
26
|
+
if (notSupported) {
|
|
27
|
+
Console.error(`table ${it.tableName} skipped, reason: ${it.tableName}.${notSupported.columnName} column type "${notSupported.type}" is Not Supported`);
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
return true;
|
|
31
|
+
}),
|
|
32
|
+
};
|
|
33
|
+
writeYmlFile(config().migration.dir, 'initialSchema.yml', store);
|
|
34
|
+
}
|
|
35
|
+
catch (e) {
|
|
36
|
+
Console.error(e.message);
|
|
37
|
+
throw e;
|
|
38
|
+
}
|
|
39
|
+
finally {
|
|
40
|
+
await con.release();
|
|
41
|
+
}
|
|
42
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const generate: () => Promise<void>;
|
|
1
|
+
export declare const generate: () => Promise<void>;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { Parser } from '../../parser/parser.js';
|
|
2
|
-
import { CodeGenerateController } from '../../generator/controller.js';
|
|
3
|
-
import { Console } from '../console.js';
|
|
4
|
-
import { MigrationReader } from '../../migration/migrationReader.js';
|
|
5
|
-
import { DataStoreHandler } from '../../migration/dataStore.js';
|
|
6
|
-
import { writeCurrentSchema } from '../../util/fsUtil.js';
|
|
7
|
-
export const generate = async () => {
|
|
8
|
-
try {
|
|
9
|
-
const store = new MigrationReader().read().serialize();
|
|
10
|
-
const storeHandler = new DataStoreHandler(store);
|
|
11
|
-
writeCurrentSchema(store);
|
|
12
|
-
const ir = new Parser().parse(storeHandler);
|
|
13
|
-
await new CodeGenerateController(ir).generate();
|
|
14
|
-
}
|
|
15
|
-
catch (e) {
|
|
16
|
-
Console.error(e.message);
|
|
17
|
-
throw e;
|
|
18
|
-
}
|
|
19
|
-
};
|
|
1
|
+
import { Parser } from '../../parser/parser.js';
|
|
2
|
+
import { CodeGenerateController } from '../../generator/controller.js';
|
|
3
|
+
import { Console } from '../console.js';
|
|
4
|
+
import { MigrationReader } from '../../migration/migrationReader.js';
|
|
5
|
+
import { DataStoreHandler } from '../../migration/dataStore.js';
|
|
6
|
+
import { writeCurrentSchema } from '../../util/fsUtil.js';
|
|
7
|
+
export const generate = async () => {
|
|
8
|
+
try {
|
|
9
|
+
const store = new MigrationReader().read().serialize();
|
|
10
|
+
const storeHandler = new DataStoreHandler(store);
|
|
11
|
+
writeCurrentSchema(store);
|
|
12
|
+
const ir = new Parser().parse(storeHandler);
|
|
13
|
+
await new CodeGenerateController(ir).generate();
|
|
14
|
+
}
|
|
15
|
+
catch (e) {
|
|
16
|
+
Console.error(e.message);
|
|
17
|
+
throw e;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const init: () => void;
|
|
1
|
+
export declare const init: () => void;
|
package/lib/cli/commands/init.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { writeYmlFile } from '../../util/fsUtil.js';
|
|
2
|
-
import { defaultConf } from '../../config/config.js';
|
|
3
|
-
import { Console } from '../console.js';
|
|
4
|
-
import * as fs from 'fs';
|
|
5
|
-
export const init = () => {
|
|
6
|
-
if (fs.existsSync('./sasat.yml')) {
|
|
7
|
-
Console.error('sasat.yml already exist');
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
writeYmlFile('./', 'sasat.yml', defaultConf);
|
|
11
|
-
Console.success('sasat.yml created');
|
|
12
|
-
};
|
|
1
|
+
import { writeYmlFile } from '../../util/fsUtil.js';
|
|
2
|
+
import { defaultConf } from '../../config/config.js';
|
|
3
|
+
import { Console } from '../console.js';
|
|
4
|
+
import * as fs from 'fs';
|
|
5
|
+
export const init = () => {
|
|
6
|
+
if (fs.existsSync('./sasat.yml')) {
|
|
7
|
+
Console.error('sasat.yml already exist');
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
writeYmlFile('./', 'sasat.yml', defaultConf);
|
|
11
|
+
Console.success('sasat.yml created');
|
|
12
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const migrate: (options: {
|
|
2
|
-
[key: string]: boolean;
|
|
3
|
-
}) => Promise<void>;
|
|
1
|
+
export declare const migrate: (options: {
|
|
2
|
+
[key: string]: boolean;
|
|
3
|
+
}) => Promise<void>;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { MigrationController } from '../../migration/controller.js';
|
|
2
|
-
import { Console } from '../console.js';
|
|
3
|
-
import { Parser } from '../../parser/parser.js';
|
|
4
|
-
import { CodeGenerateController } from '../../generator/controller.js';
|
|
5
|
-
import { DataStoreHandler } from '../../migration/dataStore.js';
|
|
6
|
-
import { writeCurrentSchema } from '../../util/fsUtil.js';
|
|
7
|
-
import { getDbClient } from
|
|
8
|
-
export const migrate = async (options) => {
|
|
9
|
-
let current;
|
|
10
|
-
try {
|
|
11
|
-
const migration = new MigrationController();
|
|
12
|
-
const result = await migration.migrate();
|
|
13
|
-
current = result.currentMigration;
|
|
14
|
-
if (options.generateFiles) {
|
|
15
|
-
const storeHandler = new DataStoreHandler(result.store);
|
|
16
|
-
writeCurrentSchema(result.store);
|
|
17
|
-
const ir = new Parser().parse(storeHandler);
|
|
18
|
-
await new CodeGenerateController(ir).generate();
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
catch (e) {
|
|
22
|
-
Console.error(e.message);
|
|
23
|
-
throw e;
|
|
24
|
-
}
|
|
25
|
-
finally {
|
|
26
|
-
await getDbClient().release();
|
|
27
|
-
}
|
|
28
|
-
Console.success(`current migration is ${current}`);
|
|
29
|
-
};
|
|
1
|
+
import { MigrationController } from '../../migration/controller.js';
|
|
2
|
+
import { Console } from '../console.js';
|
|
3
|
+
import { Parser } from '../../parser/parser.js';
|
|
4
|
+
import { CodeGenerateController } from '../../generator/controller.js';
|
|
5
|
+
import { DataStoreHandler } from '../../migration/dataStore.js';
|
|
6
|
+
import { writeCurrentSchema } from '../../util/fsUtil.js';
|
|
7
|
+
import { getDbClient } from '../../db/getDbClient.js';
|
|
8
|
+
export const migrate = async (options) => {
|
|
9
|
+
let current;
|
|
10
|
+
try {
|
|
11
|
+
const migration = new MigrationController();
|
|
12
|
+
const result = await migration.migrate();
|
|
13
|
+
current = result.currentMigration;
|
|
14
|
+
if (options.generateFiles) {
|
|
15
|
+
const storeHandler = new DataStoreHandler(result.store);
|
|
16
|
+
writeCurrentSchema(result.store);
|
|
17
|
+
const ir = new Parser().parse(storeHandler);
|
|
18
|
+
await new CodeGenerateController(ir).generate();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
catch (e) {
|
|
22
|
+
Console.error(e.message);
|
|
23
|
+
throw e;
|
|
24
|
+
}
|
|
25
|
+
finally {
|
|
26
|
+
await getDbClient().release();
|
|
27
|
+
}
|
|
28
|
+
Console.success(`current migration is ${current}`);
|
|
29
|
+
};
|
package/lib/cli/console.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const Console: {
|
|
2
|
-
success: (msg: string) => void;
|
|
3
|
-
error: (msg: string) => void;
|
|
4
|
-
log: (msg: any) => void;
|
|
5
|
-
};
|
|
1
|
+
export declare const Console: {
|
|
2
|
+
success: (msg: string) => void;
|
|
3
|
+
error: (msg: string) => void;
|
|
4
|
+
log: (msg: any) => void;
|
|
5
|
+
};
|
package/lib/cli/console.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
export const Console = {
|
|
3
|
-
success: (msg) => {
|
|
4
|
-
console.log(chalk.green(msg));
|
|
5
|
-
},
|
|
6
|
-
error: (msg) => {
|
|
7
|
-
console.error(chalk.bold.red(msg));
|
|
8
|
-
},
|
|
9
|
-
log: (msg) => {
|
|
10
|
-
console.log(msg);
|
|
11
|
-
},
|
|
12
|
-
};
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
export const Console = {
|
|
3
|
+
success: (msg) => {
|
|
4
|
+
console.log(chalk.green(msg));
|
|
5
|
+
},
|
|
6
|
+
error: (msg) => {
|
|
7
|
+
console.error(chalk.bold.red(msg));
|
|
8
|
+
},
|
|
9
|
+
log: (msg) => {
|
|
10
|
+
console.log(msg);
|
|
11
|
+
},
|
|
12
|
+
};
|
package/lib/config/config.d.ts
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { NestedPartial } from '../util/type.js';
|
|
2
|
-
export interface SasatConfigDb {
|
|
3
|
-
host: string;
|
|
4
|
-
port: number;
|
|
5
|
-
user: string;
|
|
6
|
-
password?: string;
|
|
7
|
-
database: string;
|
|
8
|
-
}
|
|
9
|
-
export interface SasatConfigRedis {
|
|
10
|
-
host: string;
|
|
11
|
-
port: number;
|
|
12
|
-
password?: string;
|
|
13
|
-
}
|
|
14
|
-
export interface SasatConfigMigration {
|
|
15
|
-
table: string;
|
|
16
|
-
dir: string;
|
|
17
|
-
out: string;
|
|
18
|
-
target?: string;
|
|
19
|
-
}
|
|
20
|
-
export interface SasatConfigGenerator {
|
|
21
|
-
addJsExtToImportStatement: boolean;
|
|
22
|
-
gql: {
|
|
23
|
-
subscription: boolean;
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
export interface SasatConfig {
|
|
27
|
-
db: SasatConfigDb;
|
|
28
|
-
migration: SasatConfigMigration;
|
|
29
|
-
generator: SasatConfigGenerator;
|
|
30
|
-
redis: SasatConfigRedis;
|
|
31
|
-
}
|
|
32
|
-
export declare type PartialSasatConfig = NestedPartial<SasatConfig>;
|
|
33
|
-
export declare const defaultConf: SasatConfig;
|
|
34
|
-
export declare const config: () => SasatConfig;
|
|
1
|
+
import { NestedPartial } from '../util/type.js';
|
|
2
|
+
export interface SasatConfigDb {
|
|
3
|
+
host: string;
|
|
4
|
+
port: number;
|
|
5
|
+
user: string;
|
|
6
|
+
password?: string;
|
|
7
|
+
database: string;
|
|
8
|
+
}
|
|
9
|
+
export interface SasatConfigRedis {
|
|
10
|
+
host: string;
|
|
11
|
+
port: number;
|
|
12
|
+
password?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface SasatConfigMigration {
|
|
15
|
+
table: string;
|
|
16
|
+
dir: string;
|
|
17
|
+
out: string;
|
|
18
|
+
target?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface SasatConfigGenerator {
|
|
21
|
+
addJsExtToImportStatement: boolean;
|
|
22
|
+
gql: {
|
|
23
|
+
subscription: boolean;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export interface SasatConfig {
|
|
27
|
+
db: SasatConfigDb;
|
|
28
|
+
migration: SasatConfigMigration;
|
|
29
|
+
generator: SasatConfigGenerator;
|
|
30
|
+
redis: SasatConfigRedis;
|
|
31
|
+
}
|
|
32
|
+
export declare type PartialSasatConfig = NestedPartial<SasatConfig>;
|
|
33
|
+
export declare const defaultConf: SasatConfig;
|
|
34
|
+
export declare const config: () => SasatConfig;
|
package/lib/config/config.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { SasatConfigLoader } from './loader.js';
|
|
2
|
-
const defaultConfDb = {
|
|
3
|
-
host: '127.0.0.1',
|
|
4
|
-
port: 3306,
|
|
5
|
-
user: 'root',
|
|
6
|
-
database: 'sasat',
|
|
7
|
-
password: '',
|
|
8
|
-
};
|
|
9
|
-
const defaultCofRedis = {
|
|
10
|
-
host: '127.0.0.1',
|
|
11
|
-
port: 6379,
|
|
12
|
-
};
|
|
13
|
-
const defaultConfMigration = {
|
|
14
|
-
table: '__migrate__',
|
|
15
|
-
dir: 'migrations',
|
|
16
|
-
out: 'sasat',
|
|
17
|
-
};
|
|
18
|
-
export const defaultConf = {
|
|
19
|
-
db: defaultConfDb,
|
|
20
|
-
migration: defaultConfMigration,
|
|
21
|
-
generator: {
|
|
22
|
-
addJsExtToImportStatement: false,
|
|
23
|
-
gql: {
|
|
24
|
-
subscription: true,
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
redis: defaultCofRedis,
|
|
28
|
-
};
|
|
29
|
-
let conf;
|
|
30
|
-
export const config = () => {
|
|
31
|
-
if (conf === undefined)
|
|
32
|
-
conf = new SasatConfigLoader().getConfig();
|
|
33
|
-
return conf;
|
|
34
|
-
};
|
|
1
|
+
import { SasatConfigLoader } from './loader.js';
|
|
2
|
+
const defaultConfDb = {
|
|
3
|
+
host: '127.0.0.1',
|
|
4
|
+
port: 3306,
|
|
5
|
+
user: 'root',
|
|
6
|
+
database: 'sasat',
|
|
7
|
+
password: '',
|
|
8
|
+
};
|
|
9
|
+
const defaultCofRedis = {
|
|
10
|
+
host: '127.0.0.1',
|
|
11
|
+
port: 6379,
|
|
12
|
+
};
|
|
13
|
+
const defaultConfMigration = {
|
|
14
|
+
table: '__migrate__',
|
|
15
|
+
dir: 'migrations',
|
|
16
|
+
out: 'sasat',
|
|
17
|
+
};
|
|
18
|
+
export const defaultConf = {
|
|
19
|
+
db: defaultConfDb,
|
|
20
|
+
migration: defaultConfMigration,
|
|
21
|
+
generator: {
|
|
22
|
+
addJsExtToImportStatement: false,
|
|
23
|
+
gql: {
|
|
24
|
+
subscription: true,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
redis: defaultCofRedis,
|
|
28
|
+
};
|
|
29
|
+
let conf;
|
|
30
|
+
export const config = () => {
|
|
31
|
+
if (conf === undefined)
|
|
32
|
+
conf = new SasatConfigLoader().getConfig();
|
|
33
|
+
return conf;
|
|
34
|
+
};
|
package/lib/config/loader.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { SasatConfig } from './config.js';
|
|
2
|
-
export declare class SasatConfigLoader {
|
|
3
|
-
private static loadConfig;
|
|
4
|
-
readonly conf: SasatConfig;
|
|
5
|
-
constructor();
|
|
6
|
-
getConfig(): SasatConfig;
|
|
7
|
-
private readValue;
|
|
8
|
-
}
|
|
1
|
+
import { SasatConfig } from './config.js';
|
|
2
|
+
export declare class SasatConfigLoader {
|
|
3
|
+
private static loadConfig;
|
|
4
|
+
readonly conf: SasatConfig;
|
|
5
|
+
constructor();
|
|
6
|
+
getConfig(): SasatConfig;
|
|
7
|
+
private readValue;
|
|
8
|
+
}
|