@prisma-psm/pg 1.0.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.
- package/.idea/modules.xml +8 -0
- package/.idea/php.xml +9 -0
- package/.idea/psm-pg.iml +8 -0
- package/.idea/vcs.xml +6 -0
- package/.idea/workspace.xml +73 -0
- package/LICENSE +201 -0
- package/README.md +2 -0
- package/package.json +21 -0
- package/src/index.d.ts +4 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.js +21 -0
- package/src/index.js.map +1 -0
- package/src/index.ts +23 -0
- package/src/migration/migrate.d.ts +3 -0
- package/src/migration/migrate.d.ts.map +1 -0
- package/src/migration/migrate.js +8 -0
- package/src/migration/migrate.js.map +1 -0
- package/src/migration/migrate.ts +7 -0
- package/src/migration/test.d.ts +3 -0
- package/src/migration/test.d.ts.map +1 -0
- package/src/migration/test.js +40 -0
- package/src/migration/test.js.map +1 -0
- package/src/migration/test.ts +43 -0
- package/src/parser/backup/engine.d.ts +16 -0
- package/src/parser/backup/engine.d.ts.map +1 -0
- package/src/parser/backup/engine.js +176 -0
- package/src/parser/backup/engine.js.map +1 -0
- package/src/parser/backup/engine.ts +201 -0
- package/src/parser/backup/index.d.ts +7 -0
- package/src/parser/backup/index.d.ts.map +1 -0
- package/src/parser/backup/index.js +29 -0
- package/src/parser/backup/index.js.map +1 -0
- package/src/parser/backup/index.ts +30 -0
- package/src/parser/constraint.d.ts +22 -0
- package/src/parser/constraint.d.ts.map +1 -0
- package/src/parser/constraint.js +160 -0
- package/src/parser/constraint.js.map +1 -0
- package/src/parser/constraint.ts +161 -0
- package/src/parser/def.d.ts +37 -0
- package/src/parser/def.d.ts.map +1 -0
- package/src/parser/def.js +4 -0
- package/src/parser/def.js.map +1 -0
- package/src/parser/def.ts +22 -0
- package/src/parser/dependencies.d.ts +3 -0
- package/src/parser/dependencies.d.ts.map +1 -0
- package/src/parser/dependencies.js +39 -0
- package/src/parser/dependencies.js.map +1 -0
- package/src/parser/dependencies.ts +43 -0
- package/src/parser/indexes.d.ts +13 -0
- package/src/parser/indexes.d.ts.map +1 -0
- package/src/parser/indexes.js +54 -0
- package/src/parser/indexes.js.map +1 -0
- package/src/parser/indexes.ts +57 -0
- package/src/parser/modelParser.d.ts +19 -0
- package/src/parser/modelParser.d.ts.map +1 -0
- package/src/parser/modelParser.js +24 -0
- package/src/parser/modelParser.js.map +1 -0
- package/src/parser/modelParser.ts +30 -0
- package/src/parser/notice.d.ts +2 -0
- package/src/parser/notice.d.ts.map +1 -0
- package/src/parser/notice.js +8 -0
- package/src/parser/notice.js.map +1 -0
- package/src/parser/notice.ts +5 -0
- package/src/parser/parser.d.ts +15 -0
- package/src/parser/parser.d.ts.map +1 -0
- package/src/parser/parser.js +72 -0
- package/src/parser/parser.js.map +1 -0
- package/src/parser/parser.ts +87 -0
- package/src/parser/shadow.d.ts +4 -0
- package/src/parser/shadow.d.ts.map +1 -0
- package/src/parser/shadow.js +21 -0
- package/src/parser/shadow.js.map +1 -0
- package/src/parser/shadow.ts +20 -0
- package/src/parser/sql.d.ts +3 -0
- package/src/parser/sql.d.ts.map +1 -0
- package/src/parser/sql.js +67 -0
- package/src/parser/sql.js.map +1 -0
- package/src/parser/sql.ts +74 -0
- package/src/parser/sys.d.ts +11 -0
- package/src/parser/sys.d.ts.map +1 -0
- package/src/parser/sys.js +54 -0
- package/src/parser/sys.js.map +1 -0
- package/src/parser/sys.ts +56 -0
- package/src/parser/table/engine.d.ts +7 -0
- package/src/parser/table/engine.d.ts.map +1 -0
- package/src/parser/table/engine.js +103 -0
- package/src/parser/table/engine.js.map +1 -0
- package/src/parser/table/engine.ts +106 -0
- package/src/parser/table/field.d.ts +8 -0
- package/src/parser/table/field.d.ts.map +1 -0
- package/src/parser/table/field.js +25 -0
- package/src/parser/table/field.js.map +1 -0
- package/src/parser/table/field.ts +22 -0
- package/src/parser/table.d.ts +8 -0
- package/src/parser/table.d.ts.map +1 -0
- package/src/parser/table.js +31 -0
- package/src/parser/table.js.map +1 -0
- package/src/parser/table.ts +30 -0
- package/src/utils/escape.d.ts +3 -0
- package/src/utils/escape.d.ts.map +1 -0
- package/src/utils/escape.js +59 -0
- package/src/utils/escape.js.map +1 -0
- package/src/utils/escape.ts +36 -0
- package/src/utils/sha.d.ts +2 -0
- package/src/utils/sha.d.ts.map +1 -0
- package/src/utils/sha.js +33 -0
- package/src/utils/sha.js.map +1 -0
- package/src/utils/sha.ts +6 -0
- package/src/utils/tabs.d.ts +2 -0
- package/src/utils/tabs.d.ts.map +1 -0
- package/src/utils/tabs.js +16 -0
- package/src/utils/tabs.js.map +1 -0
- package/src/utils/tabs.ts +14 -0
- package/tsconfig.json +81 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import {FieldOption} from "@prisma-psm/core";
|
|
2
|
+
import {val} from "../../utils/escape";
|
|
3
|
+
|
|
4
|
+
interface DefaultsOptions {
|
|
5
|
+
name:string,
|
|
6
|
+
args:string[]
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
const PRISMA_DEFAULTS = {
|
|
11
|
+
now:( opts:DefaultsOptions) =>{
|
|
12
|
+
return `now()`
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
uuid:( opts:DefaultsOptions ) => {
|
|
16
|
+
return `gen_random_uuid()`
|
|
17
|
+
},
|
|
18
|
+
autoincrement:( opts:DefaultsOptions ) => {
|
|
19
|
+
return ``
|
|
20
|
+
},
|
|
21
|
+
dbgenerated: ( opts:DefaultsOptions ) => {
|
|
22
|
+
return ` ${ opts.args}`
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const PRISMA_TYPE_MAP = {
|
|
27
|
+
String: "varchar",
|
|
28
|
+
DateTime: "timestamptz",
|
|
29
|
+
Json: "json",
|
|
30
|
+
Float: "double precision",
|
|
31
|
+
SmallInt: "int2",
|
|
32
|
+
Int: "int4",
|
|
33
|
+
BigInt: "int8",
|
|
34
|
+
Boolean: "boolean",
|
|
35
|
+
Bytes: "bytea",
|
|
36
|
+
Decimal: "numeric",
|
|
37
|
+
Uuid: "uuid",
|
|
38
|
+
Timestamptz: "timestamptz",
|
|
39
|
+
JsonB: "jsonb",
|
|
40
|
+
VarChar: "varchar",
|
|
41
|
+
Integer: "int4",
|
|
42
|
+
Oid: "oid",
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
export function parseType ( opts:FieldOption ){
|
|
47
|
+
let type:string = "";
|
|
48
|
+
let autoincrement:boolean = opts?.default?.name === "autoincrement";
|
|
49
|
+
let native = opts.nativeType?.[0];
|
|
50
|
+
if( !!native ) native = PRISMA_TYPE_MAP[native]||native;
|
|
51
|
+
|
|
52
|
+
let primatype = opts.type;
|
|
53
|
+
let datatype = native || PRISMA_TYPE_MAP[primatype] || primatype;
|
|
54
|
+
let serial = false;
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
if( datatype === "int2" && autoincrement ){
|
|
58
|
+
type = "serial2";
|
|
59
|
+
serial = true;
|
|
60
|
+
}
|
|
61
|
+
else if( datatype === "int4" && autoincrement ){
|
|
62
|
+
type = "serial";
|
|
63
|
+
serial = true;
|
|
64
|
+
}
|
|
65
|
+
else if( datatype === "int8" && autoincrement ){
|
|
66
|
+
type = "serial8";
|
|
67
|
+
serial = true;
|
|
68
|
+
}
|
|
69
|
+
else if( datatype === "oid" && autoincrement ){
|
|
70
|
+
type = "serial";
|
|
71
|
+
serial = true;
|
|
72
|
+
}
|
|
73
|
+
else if( !!opts.nativeType ) {
|
|
74
|
+
let args = "";
|
|
75
|
+
if( opts.nativeType?.[1].length > 0 ) args = `(${ opts.nativeType?.[1].join(", ") })`
|
|
76
|
+
type = `${native}${ args }`
|
|
77
|
+
} else if( !!PRISMA_TYPE_MAP[opts.type]) {
|
|
78
|
+
type = PRISMA_TYPE_MAP[opts.type];
|
|
79
|
+
} else type = opts.type;
|
|
80
|
+
|
|
81
|
+
if( !type ) type = "text";
|
|
82
|
+
if( opts.isList ) return {
|
|
83
|
+
type: `${type}[]`,
|
|
84
|
+
serial
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
type: type,
|
|
88
|
+
serial: serial
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
export function parseDefault ( opts:FieldOption, typed:string ){
|
|
94
|
+
let defaults = "";
|
|
95
|
+
if( opts.hasDefaultValue && !!opts.default && Array.isArray( opts.default)) {
|
|
96
|
+
defaults = opts.default.map( value => val( value ) ).join(", ");
|
|
97
|
+
defaults = ` array[ ${defaults} ]`;
|
|
98
|
+
} else if( opts.hasDefaultValue && !!opts.default && typeof opts.default === "object" && !Array.isArray( opts.default)) {
|
|
99
|
+
defaults = PRISMA_DEFAULTS[ opts.default.name ]( opts.default );
|
|
100
|
+
} else if( opts.hasDefaultValue && !!opts.default ) {
|
|
101
|
+
defaults = val( opts.default+"" );
|
|
102
|
+
}
|
|
103
|
+
if( !defaults?.length ) return "";
|
|
104
|
+
return `${defaults}::${typed}`;
|
|
105
|
+
}
|
|
106
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAI7C,wBAAgB,WAAW,CAAC,IAAI,EAAC,WAAW;;;;;EAiB3C"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fieldParser = fieldParser;
|
|
4
|
+
const escape_1 = require("../../utils/escape");
|
|
5
|
+
const engine_1 = require("./engine");
|
|
6
|
+
function fieldParser(opts) {
|
|
7
|
+
const name = (0, escape_1.oid)(opts.name);
|
|
8
|
+
const datatype = (0, engine_1.parseType)(opts);
|
|
9
|
+
let defaults = "", nonnull = "";
|
|
10
|
+
if (opts.isRequired)
|
|
11
|
+
nonnull = " not null";
|
|
12
|
+
if (opts.hasDefaultValue) {
|
|
13
|
+
defaults = (0, engine_1.parseDefault)(opts, datatype.type);
|
|
14
|
+
}
|
|
15
|
+
if (opts.hasDefaultValue && !!defaults.length) {
|
|
16
|
+
defaults = ` default ${defaults}`;
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
declaration: `${name} ${datatype.type}${nonnull}${defaults}`,
|
|
20
|
+
serial: datatype.serial,
|
|
21
|
+
name: opts.name,
|
|
22
|
+
kind: opts.kind,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field.js","sourceRoot":"","sources":["field.ts"],"names":[],"mappings":";;AAIA,kCAiBC;AApBD,+CAAuC;AACvC,qCAAgD;AAEhD,SAAgB,WAAW,CAAC,IAAgB;IACxC,MAAM,IAAI,GAAU,IAAA,YAAG,EAAE,IAAI,CAAC,IAAI,CAAE,CAAC;IACrC,MAAM,QAAQ,GAAG,IAAA,kBAAS,EAAE,IAAI,CAAE,CAAC;IACnC,IAAI,QAAQ,GAAU,EAAE,EAAE,OAAO,GAAU,EAAE,CAAC;IAC9C,IAAI,IAAI,CAAC,UAAU;QAAG,OAAO,GAAG,WAAW,CAAC;IAC5C,IAAI,IAAI,CAAC,eAAe,EAAG,CAAC;QACxB,QAAQ,GAAG,IAAA,qBAAY,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAE,CAAC;IACnD,CAAC;IACD,IAAI,IAAI,CAAC,eAAe,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAG,CAAC;QAC7C,QAAQ,GAAG,YAAY,QAAQ,EAAE,CAAC;IACtC,CAAC;IACD,OAAO;QACH,WAAW,EAAE,GAAG,IAAI,IAAI,QAAQ,CAAC,IAAI,GAAG,OAAO,GAAG,QAAQ,EAAE;QAC5D,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,IAAI,EAAE,IAAI,CAAC,IAAI;KAClB,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {FieldOption} from "@prisma-psm/core";
|
|
2
|
+
import {oid} from "../../utils/escape";
|
|
3
|
+
import {parseDefault,parseType} from "./engine";
|
|
4
|
+
|
|
5
|
+
export function fieldParser(opts:FieldOption){
|
|
6
|
+
const name:string = oid( opts.name );
|
|
7
|
+
const datatype = parseType( opts );
|
|
8
|
+
let defaults:string = "", nonnull:string = "";
|
|
9
|
+
if( opts.isRequired ) nonnull = " not null";
|
|
10
|
+
if( opts.hasDefaultValue ){
|
|
11
|
+
defaults = parseDefault( opts, datatype.type );
|
|
12
|
+
}
|
|
13
|
+
if( opts.hasDefaultValue && !!defaults.length ) {
|
|
14
|
+
defaults = ` default ${defaults}`;
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
declaration: `${name} ${datatype.type}${nonnull}${defaults}`,
|
|
18
|
+
serial: datatype.serial,
|
|
19
|
+
name: opts.name,
|
|
20
|
+
kind: opts.kind,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ModelOptions } from "@prisma-psm/core";
|
|
2
|
+
import { PostgresParserOptions } from "./def";
|
|
3
|
+
export declare function tableParser(model: ModelOptions, parser: PostgresParserOptions): {
|
|
4
|
+
drop_table: () => string[];
|
|
5
|
+
allocate_table: () => string[];
|
|
6
|
+
create_table: () => string[];
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAC,qBAAqB,EAAC,MAAM,OAAO,CAAC;AAK5C,wBAAgB,WAAW,CAAE,KAAK,EAAC,YAAY,EAAE,MAAM,EAAC,qBAAqB;;;;EAuB5E"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tableParser = tableParser;
|
|
4
|
+
const escape_1 = require("../utils/escape");
|
|
5
|
+
const field_1 = require("./table/field");
|
|
6
|
+
const notice_1 = require("./notice");
|
|
7
|
+
function tableParser(model, parser) {
|
|
8
|
+
const fieldSQL = model.fields.map(field_1.fieldParser);
|
|
9
|
+
return {
|
|
10
|
+
drop_table: () => ([
|
|
11
|
+
(0, notice_1.notice)(`DROP TABLE ${model.schema}.${model.name} OF MODEL ${model.model}`),
|
|
12
|
+
`drop table if exists ${(0, escape_1.oid)(model.schema)}.${(0, escape_1.oid)(model.name)} cascade;`,
|
|
13
|
+
(0, notice_1.notice)(`DROP TABLE ${model.schema}.${model.name} OF MODEL ${model.model} OK`),
|
|
14
|
+
]),
|
|
15
|
+
allocate_table: () => [
|
|
16
|
+
(0, notice_1.notice)(`ALLOCATE TABLE ${model.temp} OF MODEL ${model.model}`),
|
|
17
|
+
`alter table ${(0, escape_1.oid)(parser.shadow)}.${(0, escape_1.oid)(model.temp)} set schema ${(0, escape_1.oid)(model.schema)};`,
|
|
18
|
+
`alter table ${(0, escape_1.oid)(model.schema)}.${(0, escape_1.oid)(model.temp)} rename to ${(0, escape_1.oid)(model.name)} ;`,
|
|
19
|
+
(0, notice_1.notice)(`ALLOCATE TABLE ${model.temp} OF MODEL ${model.model} OK`),
|
|
20
|
+
],
|
|
21
|
+
create_table: () => {
|
|
22
|
+
let fields = [...fieldSQL.filter(value => value.kind === "scalar").map(value => ` ${value.declaration}`)].join(",\n");
|
|
23
|
+
return [
|
|
24
|
+
(0, notice_1.notice)(`CREATE TABLE ${model.temp} OF MODEL ${model.model}`),
|
|
25
|
+
`create table ${(0, escape_1.oid)(parser.shadow)}.${(0, escape_1.oid)(model.temp)} (\n${fields} \n);`,
|
|
26
|
+
(0, notice_1.notice)(`CREATE TABLE ${model.temp} OF MODEL ${model.model} OK`),
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.js","sourceRoot":"","sources":["table.ts"],"names":[],"mappings":";;AAMA,kCAuBC;AA3BD,4CAAoC;AACpC,yCAA0C;AAC1C,qCAAgC;AAEhC,SAAgB,WAAW,CAAE,KAAkB,EAAE,MAA4B;IACzE,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,mBAAW,CAAC,CAAC;IAC/C,OAAO;QACH,UAAU,EAAE,GAAE,EAAE,CAAC,CAAC;YACd,IAAA,eAAM,EAAC,cAAc,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,IAAI,aAAa,KAAK,CAAC,KAAK,EAAE,CAAC;YAC1E,wBAAyB,IAAA,YAAG,EAAC,KAAK,CAAC,MAAM,CAAC,IAAK,IAAA,YAAG,EAAE,KAAK,CAAC,IAAI,CAAE,WAAW;YAC3E,IAAA,eAAM,EAAC,cAAc,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,IAAI,aAAa,KAAK,CAAC,KAAK,KAAK,CAAC;SAChF,CAAC;QACF,cAAc,EAAE,GAAE,EAAE,CAAC;YACjB,IAAA,eAAM,EAAC,kBAAkB,KAAK,CAAC,IAAI,aAAa,KAAK,CAAC,KAAK,EAAE,CAAC;YAC9D,eAAe,IAAA,YAAG,EAAC,MAAM,CAAC,MAAM,CAAC,IAAI,IAAA,YAAG,EAAC,KAAK,CAAC,IAAI,CAAC,eAAe,IAAA,YAAG,EAAC,KAAK,CAAC,MAAM,CAAC,GAAG;YACvF,eAAe,IAAA,YAAG,EAAC,KAAK,CAAC,MAAM,CAAC,IAAI,IAAA,YAAG,EAAC,KAAK,CAAC,IAAI,CAAC,cAAc,IAAA,YAAG,EAAC,KAAK,CAAC,IAAI,CAAC,IAAI;YACpF,IAAA,eAAM,EAAC,kBAAkB,KAAK,CAAC,IAAI,aAAa,KAAK,CAAC,KAAK,KAAK,CAAC;SACpE;QACD,YAAY,EAAE,GAAE,EAAE;YACd,IAAI,MAAM,GAAU,CAAE,GAAG,QAAQ,CAAC,MAAM,CAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAE,CAAC,GAAG,CAAE,KAAK,CAAC,EAAE,CAAC,KAAK,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAClI,OAAM;gBACF,IAAA,eAAM,EAAC,gBAAgB,KAAK,CAAC,IAAI,aAAa,KAAK,CAAC,KAAK,EAAE,CAAC;gBAC5D,gBAAgB,IAAA,YAAG,EAAC,MAAM,CAAC,MAAM,CAAC,IAAI,IAAA,YAAG,EAAC,KAAK,CAAC,IAAI,CAAC,OAAQ,MAAO,OAAO;gBAC3E,IAAA,eAAM,EAAC,gBAAgB,KAAK,CAAC,IAAI,aAAa,KAAK,CAAC,KAAK,KAAK,CAAC;aAClE,CAAA;QACL,CAAC;KACJ,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {ModelOptions} from "@prisma-psm/core";
|
|
2
|
+
import {PostgresParserOptions} from "./def";
|
|
3
|
+
import {oid} from "../utils/escape";
|
|
4
|
+
import {fieldParser} from "./table/field";
|
|
5
|
+
import {notice} from "./notice";
|
|
6
|
+
|
|
7
|
+
export function tableParser( model:ModelOptions, parser:PostgresParserOptions ){
|
|
8
|
+
const fieldSQL = model.fields.map(fieldParser);
|
|
9
|
+
return {
|
|
10
|
+
drop_table: ()=> ([
|
|
11
|
+
notice(`DROP TABLE ${model.schema}.${model.name} OF MODEL ${model.model}`),
|
|
12
|
+
`drop table if exists ${ oid(model.schema)}.${ oid( model.name )} cascade;`,
|
|
13
|
+
notice(`DROP TABLE ${model.schema}.${model.name} OF MODEL ${model.model} OK`),
|
|
14
|
+
]),
|
|
15
|
+
allocate_table: ()=> [
|
|
16
|
+
notice(`ALLOCATE TABLE ${model.temp} OF MODEL ${model.model}`),
|
|
17
|
+
`alter table ${oid(parser.shadow)}.${oid(model.temp)} set schema ${oid(model.schema)};`,
|
|
18
|
+
`alter table ${oid(model.schema)}.${oid(model.temp)} rename to ${oid(model.name)} ;`,
|
|
19
|
+
notice(`ALLOCATE TABLE ${model.temp} OF MODEL ${model.model} OK`),
|
|
20
|
+
],
|
|
21
|
+
create_table: ()=> {
|
|
22
|
+
let fields:string = [ ...fieldSQL.filter( value => value.kind === "scalar" ).map( value => ` ${value.declaration}`)].join(",\n");
|
|
23
|
+
return[
|
|
24
|
+
notice(`CREATE TABLE ${model.temp} OF MODEL ${model.model}`),
|
|
25
|
+
`create table ${oid(parser.shadow)}.${oid(model.temp)} (\n${ fields } \n);`,
|
|
26
|
+
notice(`CREATE TABLE ${model.temp} OF MODEL ${model.model} OK`),
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escape.d.ts","sourceRoot":"","sources":["escape.ts"],"names":[],"mappings":"AAkBA,wBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAa1C;AACD,wBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,UAGjC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.oid = oid;
|
|
27
|
+
exports.val = val;
|
|
28
|
+
const pg = __importStar(require("pg"));
|
|
29
|
+
const RESERVED_WORDS = new Set([
|
|
30
|
+
"all", "analyse", "analyze", "and", "any", "array", "as", "asc", "asymmetric",
|
|
31
|
+
"authorization", "binary", "both", "case", "cast", "check", "collate", "column",
|
|
32
|
+
"constraint", "create", "current_catalog", "current_date", "current_role",
|
|
33
|
+
"current_time", "current_timestamp", "current_user", "default", "deferrable",
|
|
34
|
+
"desc", "distinct", "do", "else", "end", "except", "false", "fetch", "for",
|
|
35
|
+
"foreign", "from", "grant", "group", "having", "in", "initially", "intersect",
|
|
36
|
+
"into", "leading", "limit", "localtime", "localtimestamp", "not", "null", "offset",
|
|
37
|
+
"on", "only", "or", "order", "placing", "primary", "references", "returning",
|
|
38
|
+
"select", "session_user", "some", "symmetric", "table", "then", "to", "trailing",
|
|
39
|
+
"true", "union", "unique", "user", "using", "variadic", "verbose", "when", "where",
|
|
40
|
+
"window", "with"
|
|
41
|
+
]);
|
|
42
|
+
const IDENTIFIER_REGEX = /^[a-z_][a-z0-9_$]*$/i; // Regra para identificadores PostgreSQL
|
|
43
|
+
function oid(string) {
|
|
44
|
+
if (!string) {
|
|
45
|
+
throw new Error("Invalid Object identifier name!");
|
|
46
|
+
}
|
|
47
|
+
const isValidIdentifier = IDENTIFIER_REGEX.test(string);
|
|
48
|
+
const isReservedWord = RESERVED_WORDS.has(string.toLowerCase());
|
|
49
|
+
if (isValidIdentifier && !isReservedWord) {
|
|
50
|
+
return string;
|
|
51
|
+
}
|
|
52
|
+
return pg.escapeIdentifier(string);
|
|
53
|
+
}
|
|
54
|
+
function val(string) {
|
|
55
|
+
if (string === null || string === undefined)
|
|
56
|
+
return 'null';
|
|
57
|
+
return pg.escapeLiteral(string);
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=escape.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escape.js","sourceRoot":"","sources":["escape.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,kBAaC;AACD,kBAGC;AAnCD,uCAAyB;AAEzB,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;IAC3B,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY;IAC7E,eAAe,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ;IAC/E,YAAY,EAAE,QAAQ,EAAE,iBAAiB,EAAE,cAAc,EAAE,cAAc;IACzE,cAAc,EAAE,mBAAmB,EAAE,cAAc,EAAE,SAAS,EAAE,YAAY;IAC5E,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK;IAC1E,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW;IAC7E,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ;IAClF,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW;IAC5E,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU;IAChF,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO;IAClF,QAAQ,EAAE,MAAM;CACnB,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAAG,sBAAsB,CAAC,CAAC,wCAAwC;AAEzF,SAAgB,GAAG,CAAC,MAAc;IAC9B,IAAI,CAAC,MAAM,EAAC,CAAC;QACT,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACvD,CAAC;IAED,MAAM,iBAAiB,GAAG,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACxD,MAAM,cAAc,GAAG,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;IAEhE,IAAI,iBAAiB,IAAI,CAAC,cAAc,EAAE,CAAC;QACvC,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,OAAO,EAAE,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;AACvC,CAAC;AACD,SAAgB,GAAG,CAAC,MAAc;IAC9B,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IAC3D,OAAO,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as pg from "pg";
|
|
2
|
+
|
|
3
|
+
const RESERVED_WORDS = new Set([
|
|
4
|
+
"all", "analyse", "analyze", "and", "any", "array", "as", "asc", "asymmetric",
|
|
5
|
+
"authorization", "binary", "both", "case", "cast", "check", "collate", "column",
|
|
6
|
+
"constraint", "create", "current_catalog", "current_date", "current_role",
|
|
7
|
+
"current_time", "current_timestamp", "current_user", "default", "deferrable",
|
|
8
|
+
"desc", "distinct", "do", "else", "end", "except", "false", "fetch", "for",
|
|
9
|
+
"foreign", "from", "grant", "group", "having", "in", "initially", "intersect",
|
|
10
|
+
"into", "leading", "limit", "localtime", "localtimestamp", "not", "null", "offset",
|
|
11
|
+
"on", "only", "or", "order", "placing", "primary", "references", "returning",
|
|
12
|
+
"select", "session_user", "some", "symmetric", "table", "then", "to", "trailing",
|
|
13
|
+
"true", "union", "unique", "user", "using", "variadic", "verbose", "when", "where",
|
|
14
|
+
"window", "with"
|
|
15
|
+
]);
|
|
16
|
+
|
|
17
|
+
const IDENTIFIER_REGEX = /^[a-z_][a-z0-9_$]*$/i; // Regra para identificadores PostgreSQL
|
|
18
|
+
|
|
19
|
+
export function oid(string: string): string {
|
|
20
|
+
if (!string){
|
|
21
|
+
throw new Error("Invalid Object identifier name!");
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const isValidIdentifier = IDENTIFIER_REGEX.test(string);
|
|
25
|
+
const isReservedWord = RESERVED_WORDS.has(string.toLowerCase());
|
|
26
|
+
|
|
27
|
+
if (isValidIdentifier && !isReservedWord) {
|
|
28
|
+
return string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return pg.escapeIdentifier(string);
|
|
32
|
+
}
|
|
33
|
+
export function val(string: string) {
|
|
34
|
+
if (string === null || string === undefined) return 'null';
|
|
35
|
+
return pg.escapeLiteral(string);
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sha.d.ts","sourceRoot":"","sources":["sha.ts"],"names":[],"mappings":"AACA,wBAAgB,aAAa,CAAC,SAAS,EAAC,MAAM,EAAE,IAAI,EAAC,MAAM,UAI1D"}
|
package/src/utils/sha.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.migrationHash = migrationHash;
|
|
27
|
+
const crypto = __importStar(require("crypto"));
|
|
28
|
+
function migrationHash(migration, data) {
|
|
29
|
+
const base = crypto.createHash('md5').update(migration).digest('hex');
|
|
30
|
+
const content = crypto.createHash('sha256').update(data).digest('hex');
|
|
31
|
+
return `${base}:${content}`;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=sha.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sha.js","sourceRoot":"","sources":["sha.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,sCAIC;AALD,+CAAiC;AACjC,SAAgB,aAAa,CAAC,SAAgB,EAAE,IAAW;IACvD,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACtE,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvE,OAAO,GAAG,IAAI,IAAI,OAAO,EAAE,CAAC;AAChC,CAAC"}
|
package/src/utils/sha.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as crypto from 'crypto';
|
|
2
|
+
export function migrationHash(migration:string, data:string) {
|
|
3
|
+
const base = crypto.createHash('md5').update(migration).digest('hex');
|
|
4
|
+
const content = crypto.createHash('sha256').update(data).digest('hex');
|
|
5
|
+
return `${base}:${content}`;
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["tabs.ts"],"names":[],"mappings":"AAAA,wBAAgB,KAAK,CAAE,KAAK,EAAC,MAAM,EAAE,EAAE,GAAG,EAAC,MAAM,YAUhD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.noTab = noTab;
|
|
4
|
+
function noTab(batch, tab) {
|
|
5
|
+
return batch.map(value => {
|
|
6
|
+
return value.split("\n")
|
|
7
|
+
.filter(value => !!value)
|
|
8
|
+
.map(value => {
|
|
9
|
+
if (value.startsWith(tab))
|
|
10
|
+
return value.substring(tab.length);
|
|
11
|
+
return value;
|
|
12
|
+
})
|
|
13
|
+
.join("\n");
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=tabs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.js","sourceRoot":"","sources":["tabs.ts"],"names":[],"mappings":";;AAAA,sBAUC;AAVD,SAAgB,KAAK,CAAE,KAAc,EAAE,GAAU;IAC7C,OAAO,KAAK,CAAC,GAAG,CAAE,KAAK,CAAC,EAAE;QACtB,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC;aACnB,MAAM,CAAE,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAE;aAC1B,GAAG,CAAE,KAAK,CAAC,EAAE;YACV,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;gBAAG,OAAO,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;YAC9D,OAAO,KAAK,CAAC;QACjB,CAAC,CAAC;aACD,IAAI,CAAC,IAAI,CAAC,CAAA;IACnB,CAAC,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export function noTab( batch:string[], tab:string){
|
|
2
|
+
return batch.map( value => {
|
|
3
|
+
return value.split("\n")
|
|
4
|
+
.filter( value => !!value )
|
|
5
|
+
.map( value => {
|
|
6
|
+
if( value.startsWith(tab) ) return value.substring(tab.length)
|
|
7
|
+
return value;
|
|
8
|
+
})
|
|
9
|
+
.join("\n")
|
|
10
|
+
})
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
/* Visit https://aka.ms/tsconfig.json to read more about this file */
|
|
4
|
+
|
|
5
|
+
/* Basic Options */
|
|
6
|
+
// "incremental": true, /* Enable incremental compilation */
|
|
7
|
+
"target": "es2015", /* Specify ECMAScript target tsVersion: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
|
|
8
|
+
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
|
|
9
|
+
// "lib": [], /* Specify library files to be included in the compilation. */
|
|
10
|
+
// "allowJs": true, /* Allow javascript files to be compiled. */
|
|
11
|
+
// "checkJs": true, /* Report errors in .js files. */
|
|
12
|
+
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
|
|
13
|
+
"declaration": true, /* Generates corresponding '.d.ts' file. */
|
|
14
|
+
"declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
|
|
15
|
+
"sourceMap": true, /* Generates corresponding '.map' file. */
|
|
16
|
+
// "outFile": "./", /* Concatenate and emit output to single file. */
|
|
17
|
+
// "outDir": "./", /* Redirect output structure to the directory. */
|
|
18
|
+
"rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
|
19
|
+
// "composite": true, /* Enable project compilation */
|
|
20
|
+
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
|
|
21
|
+
// "removeComments": true, /* Do not emit comments to output. */
|
|
22
|
+
// "noEmit": true, /* Do not emit outputs. */
|
|
23
|
+
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
|
|
24
|
+
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
|
|
25
|
+
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
|
|
26
|
+
|
|
27
|
+
/* Strict Type-Checking Options */
|
|
28
|
+
"strict": true, /* Enable all strict type-checking options. */
|
|
29
|
+
"noImplicitAny": false, /* Raise error on expressions and declarations with an implied 'any' type. */
|
|
30
|
+
"strictNullChecks": false, /* Enable strict null checks. */
|
|
31
|
+
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
|
|
32
|
+
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
|
|
33
|
+
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
|
|
34
|
+
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
|
|
35
|
+
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
|
|
36
|
+
|
|
37
|
+
/* Additional Checks */
|
|
38
|
+
// "noUnusedLocals": true, /* Report errors on unused locals. */
|
|
39
|
+
// "noUnusedParameters": true, /* Report errors on unused parameters. */
|
|
40
|
+
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
|
41
|
+
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
|
42
|
+
|
|
43
|
+
/* Module Resolution Options */
|
|
44
|
+
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
|
45
|
+
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
|
46
|
+
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
|
47
|
+
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
|
48
|
+
// "typeRoots": [], /* List of folders to include type definitions from. */
|
|
49
|
+
// "types": [], /* Type declaration files to be included in compilation. */
|
|
50
|
+
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
|
|
51
|
+
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
|
|
52
|
+
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
|
|
53
|
+
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
54
|
+
|
|
55
|
+
/* Source Map Options */
|
|
56
|
+
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
|
|
57
|
+
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
58
|
+
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
|
|
59
|
+
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
|
|
60
|
+
|
|
61
|
+
/* Experimental Options */
|
|
62
|
+
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
|
63
|
+
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
|
64
|
+
|
|
65
|
+
/* Advanced Options */
|
|
66
|
+
"skipLibCheck": true, /* Skip type checking of declaration files. */
|
|
67
|
+
"forceConsistentCasingInFileNames": true, /* Disallow inconsistently-cased references to the same file. */
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
// "allowJs": true,
|
|
71
|
+
// "skipLibCheck": true,
|
|
72
|
+
// "esModuleInterop": true,
|
|
73
|
+
// "allowSyntheticDefaultImports": true,
|
|
74
|
+
// "strict": true,
|
|
75
|
+
// "forceConsistentCasingInFileNames": true,
|
|
76
|
+
// "moduleResolution": "node",
|
|
77
|
+
"resolveJsonModule": true,
|
|
78
|
+
|
|
79
|
+
// "isolatedModules": true
|
|
80
|
+
}
|
|
81
|
+
}
|