@apso/cli 0.5.0 → 0.6.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.
Files changed (69) hide show
  1. package/README.md +510 -1
  2. package/dist/commands/server/new.js +1 -1
  3. package/dist/commands/server/scaffold.js +19 -10
  4. package/dist/lib/apsorc-parser.d.ts +3 -0
  5. package/dist/lib/apsorc-parser.js +11 -6
  6. package/dist/lib/controller.js +3 -1
  7. package/dist/lib/dto.js +9 -9
  8. package/dist/lib/entity.js +6 -5
  9. package/dist/lib/guards.d.ts +4 -3
  10. package/dist/lib/guards.js +64 -25
  11. package/dist/lib/module.js +3 -1
  12. package/dist/lib/templates/guards/auth.guard.eta +228 -0
  13. package/dist/lib/templates/guards/guards.module.eta +72 -12
  14. package/dist/lib/templates/guards/index.eta +18 -0
  15. package/dist/lib/templates/guards/scope.guard.eta +10 -2
  16. package/dist/lib/types/auth.d.ts +203 -0
  17. package/dist/lib/types/auth.js +60 -0
  18. package/dist/lib/types/entity.d.ts +2 -2
  19. package/dist/lib/types/index.d.ts +1 -0
  20. package/dist/lib/types/index.js +8 -0
  21. package/dist/lib/types/relationship.d.ts +1 -1
  22. package/dist/lib/utils/casing.js +5 -5
  23. package/dist/lib/utils/field.js +2 -1
  24. package/dist/lib/utils/file-system.js +1 -1
  25. package/dist/lib/utils/relationships/parse-v1.js +2 -1
  26. package/dist/lib/utils/relationships/parse.js +117 -32
  27. package/dist/lib/utils/relationships/parse.spec.js +168 -141
  28. package/dist/test-nested-relationships.js +10 -10
  29. package/dist/tests/templates/entities/types/array-template.spec.js +45 -45
  30. package/dist/tests/templates/entities/types/bigint-template.spec.js +43 -43
  31. package/dist/tests/templates/entities/types/boolean-template.spec.js +44 -44
  32. package/dist/tests/templates/entities/types/bytea-template.spec.js +35 -35
  33. package/dist/tests/templates/entities/types/char-template.spec.js +35 -35
  34. package/dist/tests/templates/entities/types/date-template.spec.js +29 -29
  35. package/dist/tests/templates/entities/types/decimal-field-validation.spec.js +46 -46
  36. package/dist/tests/templates/entities/types/decimal-template.spec.js +46 -46
  37. package/dist/tests/templates/entities/types/double-template.spec.js +37 -34
  38. package/dist/tests/templates/entities/types/enum-template.spec.js +42 -42
  39. package/dist/tests/templates/entities/types/float-template.spec.js +37 -34
  40. package/dist/tests/templates/entities/types/geometry-template.spec.js +31 -31
  41. package/dist/tests/templates/entities/types/inet-template.spec.js +36 -36
  42. package/dist/tests/templates/entities/types/int4range-template.spec.js +45 -33
  43. package/dist/tests/templates/entities/types/integer-template.spec.js +40 -40
  44. package/dist/tests/templates/entities/types/interval-template.spec.js +35 -35
  45. package/dist/tests/templates/entities/types/json-plain-template.spec.js +27 -27
  46. package/dist/tests/templates/entities/types/json-template.spec.js +19 -19
  47. package/dist/tests/templates/entities/types/jsonb-template.spec.js +19 -19
  48. package/dist/tests/templates/entities/types/money-template.spec.js +35 -35
  49. package/dist/tests/templates/entities/types/numeric-template.spec.js +44 -44
  50. package/dist/tests/templates/entities/types/point-template.spec.js +37 -31
  51. package/dist/tests/templates/entities/types/polygon-template.spec.js +43 -31
  52. package/dist/tests/templates/entities/types/real-template.spec.js +34 -34
  53. package/dist/tests/templates/entities/types/serial-template.spec.js +62 -62
  54. package/dist/tests/templates/entities/types/smallint-template.spec.js +43 -43
  55. package/dist/tests/templates/entities/types/string-template.spec.js +59 -59
  56. package/dist/tests/templates/entities/types/text-template.spec.js +37 -37
  57. package/dist/tests/templates/entities/types/time-template.spec.js +35 -35
  58. package/dist/tests/templates/entities/types/timestamp-template.spec.js +39 -39
  59. package/dist/tests/templates/entities/types/timetz-template.spec.js +35 -35
  60. package/dist/tests/templates/entities/types/tsvector-template.spec.js +28 -28
  61. package/dist/tests/templates/entities/types/uuid-template.spec.js +43 -43
  62. package/dist/tests/templates/entities/types/varchar-template.spec.js +59 -56
  63. package/dist/tests/templates/entities/types/xml-template.spec.js +28 -28
  64. package/dist/tests/templates/entities/utils/template-test-utils.d.ts +1 -1
  65. package/dist/tests/templates/entities/utils/template-test-utils.js +3 -3
  66. package/dist/tests/templates/entities/uuid-entity-template.spec.js +138 -138
  67. package/dist/tests/utils/relationship-deduplication.spec.js +11 -11
  68. package/oclif.manifest.json +1 -1
  69. package/package.json +1 -1
@@ -2,67 +2,67 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const template_test_utils_1 = require("../utils/template-test-utils");
4
4
  const globals_1 = require("@jest/globals");
5
- (0, globals_1.describe)('Interval Entity Template Tests', () => {
5
+ (0, globals_1.describe)("Interval Entity Template Tests", () => {
6
6
  // Setup Eta configuration once before all tests
7
7
  (0, globals_1.beforeAll)(() => {
8
8
  (0, template_test_utils_1.configureEta)();
9
9
  });
10
- const templatePath = './entities/entity-col-interval';
10
+ const templatePath = "./entities/entity-col-interval";
11
11
  const testCases = [
12
12
  {
13
- name: 'should render basic interval field correctly',
13
+ name: "should render basic interval field correctly",
14
14
  field: {
15
- name: 'duration',
16
- dataType: 'string',
17
- nullable: false
15
+ name: "duration",
16
+ dataType: "string",
17
+ nullable: false,
18
18
  },
19
19
  assertions: [
20
- { type: 'contains', text: '@Column({ "type": "interval"' },
21
- { type: 'contains', text: 'duration: string;' },
22
- { type: 'notContains', text: '@Index()' },
23
- { type: 'notContains', text: '@PrimaryColumn()' }
24
- ]
20
+ { type: "contains", text: '@Column({ "type": "interval"' },
21
+ { type: "contains", text: "duration: string;" },
22
+ { type: "notContains", text: "@Index()" },
23
+ { type: "notContains", text: "@PrimaryColumn()" },
24
+ ],
25
25
  },
26
26
  {
27
- name: 'should render nullable interval field correctly',
27
+ name: "should render nullable interval field correctly",
28
28
  field: {
29
- name: 'optionalDuration',
30
- dataType: 'string',
31
- nullable: true
29
+ name: "optionalDuration",
30
+ dataType: "string",
31
+ nullable: true,
32
32
  },
33
33
  assertions: [
34
- { type: 'contains', text: '@Column({ "type": "interval"' },
35
- { type: 'contains', text: 'optionalDuration: string;' }
36
- ]
34
+ { type: "contains", text: '@Column({ "type": "interval"' },
35
+ { type: "contains", text: "optionalDuration: string;" },
36
+ ],
37
37
  },
38
38
  {
39
- name: 'should render interval field with default value correctly',
39
+ name: "should render interval field with default value correctly",
40
40
  field: {
41
- name: 'defaultDuration',
42
- dataType: 'string',
41
+ name: "defaultDuration",
42
+ dataType: "string",
43
43
  nullable: false,
44
- default: '1 day'
44
+ default: "1 day",
45
45
  },
46
46
  assertions: [
47
- { type: 'contains', text: '@Column({ "type": "interval"' },
48
- { type: 'contains', text: 'default: 1 day' },
49
- { type: 'contains', text: 'defaultDuration: string;' }
50
- ]
47
+ { type: "contains", text: '@Column({ "type": "interval"' },
48
+ { type: "contains", text: "default: 1 day" },
49
+ { type: "contains", text: "defaultDuration: string;" },
50
+ ],
51
51
  },
52
52
  {
53
- name: 'should render indexed interval field correctly',
53
+ name: "should render indexed interval field correctly",
54
54
  field: {
55
- name: 'indexedDuration',
56
- dataType: 'string',
55
+ name: "indexedDuration",
56
+ dataType: "string",
57
57
  nullable: false,
58
- index: true
58
+ index: true,
59
59
  },
60
60
  assertions: [
61
- { type: 'contains', text: '@Column({ "type": "interval"' },
62
- { type: 'contains', text: '@Index()' },
63
- { type: 'contains', text: 'indexedDuration: string;' }
64
- ]
65
- }
61
+ { type: "contains", text: '@Column({ "type": "interval"' },
62
+ { type: "contains", text: "@Index()" },
63
+ { type: "contains", text: "indexedDuration: string;" },
64
+ ],
65
+ },
66
66
  ];
67
67
  (0, template_test_utils_1.runTemplateTests)(templatePath, testCases);
68
68
  });
@@ -2,53 +2,53 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const template_test_utils_1 = require("../utils/template-test-utils");
4
4
  const globals_1 = require("@jest/globals");
5
- (0, globals_1.describe)('Plain JSON Entity Template Tests', () => {
5
+ (0, globals_1.describe)("Plain JSON Entity Template Tests", () => {
6
6
  // Setup Eta configuration once before all tests
7
7
  (0, globals_1.beforeAll)(() => {
8
8
  (0, template_test_utils_1.configureEta)();
9
9
  });
10
- const templatePath = './entities/entity-col-json-plain';
10
+ const templatePath = "./entities/entity-col-json-plain";
11
11
  const testCases = [
12
12
  {
13
- name: 'should render basic plain JSON field correctly',
13
+ name: "should render basic plain JSON field correctly",
14
14
  field: {
15
- name: 'metadata',
16
- dataType: 'Record<string, any>',
17
- nullable: false
15
+ name: "metadata",
16
+ dataType: "Record<string, any>",
17
+ nullable: false,
18
18
  },
19
19
  assertions: [
20
- { type: 'contains', text: "@Column('json'" },
21
- { type: 'contains', text: 'metadata: JSON;' },
22
- { type: 'notContains', text: '@Index()' },
23
- { type: 'notContains', text: '@PrimaryColumn()' }
24
- ]
20
+ { type: "contains", text: "@Column('json'" },
21
+ { type: "contains", text: "metadata: JSON;" },
22
+ { type: "notContains", text: "@Index()" },
23
+ { type: "notContains", text: "@PrimaryColumn()" },
24
+ ],
25
25
  },
26
26
  {
27
- name: 'should render nullable plain JSON field correctly',
27
+ name: "should render nullable plain JSON field correctly",
28
28
  field: {
29
- name: 'optionalMeta',
30
- dataType: 'Record<string, any>',
31
- nullable: true
29
+ name: "optionalMeta",
30
+ dataType: "Record<string, any>",
31
+ nullable: true,
32
32
  },
33
33
  assertions: [
34
- { type: 'contains', text: "@Column('json'" },
35
- { type: 'contains', text: 'nullable: true' },
36
- { type: 'contains', text: 'optionalMeta: JSON;' }
37
- ]
34
+ { type: "contains", text: "@Column('json'" },
35
+ { type: "contains", text: "nullable: true" },
36
+ { type: "contains", text: "optionalMeta: JSON;" },
37
+ ],
38
38
  },
39
39
  {
40
- name: 'should render plain JSON field with default value correctly',
40
+ name: "should render plain JSON field with default value correctly",
41
41
  field: {
42
- name: 'defaultMeta',
43
- dataType: 'Record<string, any>',
42
+ name: "defaultMeta",
43
+ dataType: "Record<string, any>",
44
44
  nullable: false,
45
- default: '{}'
45
+ default: "{}",
46
46
  },
47
47
  assertions: [
48
- { type: 'contains', text: "@Column('json'" },
49
- { type: 'contains', text: 'defaultMeta: JSON;' }
50
- ]
51
- }
48
+ { type: "contains", text: "@Column('json'" },
49
+ { type: "contains", text: "defaultMeta: JSON;" },
50
+ ],
51
+ },
52
52
  ];
53
53
  (0, template_test_utils_1.runTemplateTests)(templatePath, testCases);
54
54
  });
@@ -2,39 +2,39 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const template_test_utils_1 = require("../utils/template-test-utils");
4
4
  const globals_1 = require("@jest/globals");
5
- (0, globals_1.describe)('JSON Entity Template Tests', () => {
5
+ (0, globals_1.describe)("JSON Entity Template Tests", () => {
6
6
  // Setup Eta configuration once before all tests
7
7
  (0, globals_1.beforeAll)(() => {
8
8
  (0, template_test_utils_1.configureEta)();
9
9
  });
10
- const templatePath = './entities/entity-col-json';
10
+ const templatePath = "./entities/entity-col-json";
11
11
  const testCases = [
12
12
  {
13
- name: 'should render basic json field correctly',
13
+ name: "should render basic json field correctly",
14
14
  field: {
15
- name: 'jsonData',
16
- dataType: 'json',
17
- nullable: false
15
+ name: "jsonData",
16
+ dataType: "json",
17
+ nullable: false,
18
18
  },
19
19
  assertions: [
20
- { type: 'contains', text: "@Column('jsonb'" },
21
- { type: 'contains', text: 'nullable: false' },
22
- { type: 'contains', text: 'jsonData: JSON;' }
23
- ]
20
+ { type: "contains", text: "@Column('jsonb'" },
21
+ { type: "contains", text: "nullable: false" },
22
+ { type: "contains", text: "jsonData: JSON;" },
23
+ ],
24
24
  },
25
25
  {
26
- name: 'should render nullable json field correctly',
26
+ name: "should render nullable json field correctly",
27
27
  field: {
28
- name: 'optionalJsonData',
29
- dataType: 'json',
30
- nullable: true
28
+ name: "optionalJsonData",
29
+ dataType: "json",
30
+ nullable: true,
31
31
  },
32
32
  assertions: [
33
- { type: 'contains', text: "@Column('jsonb'" },
34
- { type: 'contains', text: 'nullable: true' },
35
- { type: 'contains', text: 'optionalJsonData: JSON;' }
36
- ]
37
- }
33
+ { type: "contains", text: "@Column('jsonb'" },
34
+ { type: "contains", text: "nullable: true" },
35
+ { type: "contains", text: "optionalJsonData: JSON;" },
36
+ ],
37
+ },
38
38
  ];
39
39
  (0, template_test_utils_1.runTemplateTests)(templatePath, testCases);
40
40
  });
@@ -2,39 +2,39 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const template_test_utils_1 = require("../utils/template-test-utils");
4
4
  const globals_1 = require("@jest/globals");
5
- (0, globals_1.describe)('JSONB Entity Template Tests', () => {
5
+ (0, globals_1.describe)("JSONB Entity Template Tests", () => {
6
6
  // Setup Eta configuration once before all tests
7
7
  (0, globals_1.beforeAll)(() => {
8
8
  (0, template_test_utils_1.configureEta)();
9
9
  });
10
- const templatePath = './entities/entity-col-jsonb';
10
+ const templatePath = "./entities/entity-col-jsonb";
11
11
  const testCases = [
12
12
  {
13
- name: 'should render basic jsonb field correctly',
13
+ name: "should render basic jsonb field correctly",
14
14
  field: {
15
- name: 'jsonData',
16
- dataType: 'jsonb',
17
- nullable: false
15
+ name: "jsonData",
16
+ dataType: "jsonb",
17
+ nullable: false,
18
18
  },
19
19
  assertions: [
20
- { type: 'contains', text: "@Column('jsonb'" },
21
- { type: 'contains', text: 'nullable: false' },
22
- { type: 'contains', text: 'jsonData: any;' }
23
- ]
20
+ { type: "contains", text: "@Column('jsonb'" },
21
+ { type: "contains", text: "nullable: false" },
22
+ { type: "contains", text: "jsonData: any;" },
23
+ ],
24
24
  },
25
25
  {
26
- name: 'should render nullable jsonb field correctly',
26
+ name: "should render nullable jsonb field correctly",
27
27
  field: {
28
- name: 'optionalJsonData',
29
- dataType: 'jsonb',
30
- nullable: true
28
+ name: "optionalJsonData",
29
+ dataType: "jsonb",
30
+ nullable: true,
31
31
  },
32
32
  assertions: [
33
- { type: 'contains', text: "@Column('jsonb'" },
34
- { type: 'contains', text: 'nullable: true' },
35
- { type: 'contains', text: 'optionalJsonData: any;' }
36
- ]
37
- }
33
+ { type: "contains", text: "@Column('jsonb'" },
34
+ { type: "contains", text: "nullable: true" },
35
+ { type: "contains", text: "optionalJsonData: any;" },
36
+ ],
37
+ },
38
38
  ];
39
39
  (0, template_test_utils_1.runTemplateTests)(templatePath, testCases);
40
40
  });
@@ -2,67 +2,67 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const template_test_utils_1 = require("../utils/template-test-utils");
4
4
  const globals_1 = require("@jest/globals");
5
- (0, globals_1.describe)('Money Entity Template Tests', () => {
5
+ (0, globals_1.describe)("Money Entity Template Tests", () => {
6
6
  // Setup Eta configuration once before all tests
7
7
  (0, globals_1.beforeAll)(() => {
8
8
  (0, template_test_utils_1.configureEta)();
9
9
  });
10
- const templatePath = './entities/entity-col-money';
10
+ const templatePath = "./entities/entity-col-money";
11
11
  const testCases = [
12
12
  {
13
- name: 'should render basic money field correctly',
13
+ name: "should render basic money field correctly",
14
14
  field: {
15
- name: 'price',
16
- dataType: 'string',
17
- nullable: false
15
+ name: "price",
16
+ dataType: "string",
17
+ nullable: false,
18
18
  },
19
19
  assertions: [
20
- { type: 'contains', text: '@Column({ "type": "money"' },
21
- { type: 'contains', text: 'price: string;' },
22
- { type: 'notContains', text: '@Index()' },
23
- { type: 'notContains', text: '@PrimaryColumn()' }
24
- ]
20
+ { type: "contains", text: '@Column({ "type": "money"' },
21
+ { type: "contains", text: "price: string;" },
22
+ { type: "notContains", text: "@Index()" },
23
+ { type: "notContains", text: "@PrimaryColumn()" },
24
+ ],
25
25
  },
26
26
  {
27
- name: 'should render nullable money field correctly',
27
+ name: "should render nullable money field correctly",
28
28
  field: {
29
- name: 'optionalPrice',
30
- dataType: 'string',
31
- nullable: true
29
+ name: "optionalPrice",
30
+ dataType: "string",
31
+ nullable: true,
32
32
  },
33
33
  assertions: [
34
- { type: 'contains', text: '@Column({ "type": "money"' },
35
- { type: 'contains', text: 'optionalPrice: string;' }
36
- ]
34
+ { type: "contains", text: '@Column({ "type": "money"' },
35
+ { type: "contains", text: "optionalPrice: string;" },
36
+ ],
37
37
  },
38
38
  {
39
- name: 'should render money field with default value correctly',
39
+ name: "should render money field with default value correctly",
40
40
  field: {
41
- name: 'defaultPrice',
42
- dataType: 'string',
41
+ name: "defaultPrice",
42
+ dataType: "string",
43
43
  nullable: false,
44
- default: '0.00'
44
+ default: "0.00",
45
45
  },
46
46
  assertions: [
47
- { type: 'contains', text: '@Column({ "type": "money"' },
48
- { type: 'contains', text: 'default: 0.00' },
49
- { type: 'contains', text: 'defaultPrice: string;' }
50
- ]
47
+ { type: "contains", text: '@Column({ "type": "money"' },
48
+ { type: "contains", text: "default: 0.00" },
49
+ { type: "contains", text: "defaultPrice: string;" },
50
+ ],
51
51
  },
52
52
  {
53
- name: 'should render indexed money field correctly',
53
+ name: "should render indexed money field correctly",
54
54
  field: {
55
- name: 'indexedPrice',
56
- dataType: 'string',
55
+ name: "indexedPrice",
56
+ dataType: "string",
57
57
  nullable: false,
58
- index: true
58
+ index: true,
59
59
  },
60
60
  assertions: [
61
- { type: 'contains', text: '@Column({ "type": "money"' },
62
- { type: 'contains', text: '@Index()' },
63
- { type: 'contains', text: 'indexedPrice: string;' }
64
- ]
65
- }
61
+ { type: "contains", text: '@Column({ "type": "money"' },
62
+ { type: "contains", text: "@Index()" },
63
+ { type: "contains", text: "indexedPrice: string;" },
64
+ ],
65
+ },
66
66
  ];
67
67
  (0, template_test_utils_1.runTemplateTests)(templatePath, testCases);
68
68
  });
@@ -2,83 +2,83 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const template_test_utils_1 = require("../utils/template-test-utils");
4
4
  const globals_1 = require("@jest/globals");
5
- (0, globals_1.describe)('Numeric Entity Template Tests', () => {
5
+ (0, globals_1.describe)("Numeric Entity Template Tests", () => {
6
6
  // Setup Eta configuration once before all tests
7
7
  (0, globals_1.beforeAll)(() => {
8
8
  (0, template_test_utils_1.configureEta)();
9
9
  });
10
- const templatePath = './entities/entity-col-numeric';
10
+ const templatePath = "./entities/entity-col-numeric";
11
11
  const testCases = [
12
12
  {
13
- name: 'should render basic numeric field correctly',
13
+ name: "should render basic numeric field correctly",
14
14
  field: {
15
- name: 'numericValue',
16
- dataType: 'number',
17
- nullable: false
15
+ name: "numericValue",
16
+ dataType: "number",
17
+ nullable: false,
18
18
  },
19
19
  assertions: [
20
- { type: 'contains', text: '@Column({ "type": "numeric"' },
21
- { type: 'contains', text: 'numericValue: number;' },
22
- { type: 'notContains', text: '@Index()' },
23
- { type: 'notContains', text: '@PrimaryColumn()' }
24
- ]
20
+ { type: "contains", text: '@Column({ "type": "numeric"' },
21
+ { type: "contains", text: "numericValue: number;" },
22
+ { type: "notContains", text: "@Index()" },
23
+ { type: "notContains", text: "@PrimaryColumn()" },
24
+ ],
25
25
  },
26
26
  {
27
- name: 'should render nullable numeric field correctly',
27
+ name: "should render nullable numeric field correctly",
28
28
  field: {
29
- name: 'optionalValue',
30
- dataType: 'number',
31
- nullable: true
29
+ name: "optionalValue",
30
+ dataType: "number",
31
+ nullable: true,
32
32
  },
33
33
  assertions: [
34
- { type: 'contains', text: '@Column({ "type": "numeric"' },
35
- { type: 'contains', text: 'optionalValue: number;' }
36
- ]
34
+ { type: "contains", text: '@Column({ "type": "numeric"' },
35
+ { type: "contains", text: "optionalValue: number;" },
36
+ ],
37
37
  },
38
38
  {
39
- name: 'should render numeric field with precision and scale correctly',
39
+ name: "should render numeric field with precision and scale correctly",
40
40
  field: {
41
- name: 'preciseValue',
42
- dataType: 'number',
41
+ name: "preciseValue",
42
+ dataType: "number",
43
43
  nullable: false,
44
44
  precision: 12,
45
- scale: 4
45
+ scale: 4,
46
46
  },
47
47
  assertions: [
48
- { type: 'contains', text: '@Column({ "type": "numeric"' },
49
- { type: 'contains', text: 'precision: 12' },
50
- { type: 'contains', text: 'scale: 4' },
51
- { type: 'contains', text: 'preciseValue: number;' }
52
- ]
48
+ { type: "contains", text: '@Column({ "type": "numeric"' },
49
+ { type: "contains", text: "precision: 12" },
50
+ { type: "contains", text: "scale: 4" },
51
+ { type: "contains", text: "preciseValue: number;" },
52
+ ],
53
53
  },
54
54
  {
55
- name: 'should render numeric field with default value correctly',
55
+ name: "should render numeric field with default value correctly",
56
56
  field: {
57
- name: 'defaultValue',
58
- dataType: 'number',
57
+ name: "defaultValue",
58
+ dataType: "number",
59
59
  nullable: false,
60
- default: 0
60
+ default: 0,
61
61
  },
62
62
  assertions: [
63
- { type: 'contains', text: '@Column({ "type": "numeric"' },
64
- { type: 'contains', text: 'default: 0' },
65
- { type: 'contains', text: 'defaultValue: number;' }
66
- ]
63
+ { type: "contains", text: '@Column({ "type": "numeric"' },
64
+ { type: "contains", text: "default: 0" },
65
+ { type: "contains", text: "defaultValue: number;" },
66
+ ],
67
67
  },
68
68
  {
69
- name: 'should render indexed numeric field correctly',
69
+ name: "should render indexed numeric field correctly",
70
70
  field: {
71
- name: 'indexedValue',
72
- dataType: 'number',
71
+ name: "indexedValue",
72
+ dataType: "number",
73
73
  nullable: false,
74
- index: true
74
+ index: true,
75
75
  },
76
76
  assertions: [
77
- { type: 'contains', text: '@Column({ "type": "numeric"' },
78
- { type: 'contains', text: '@Index()' },
79
- { type: 'contains', text: 'indexedValue: number;' }
80
- ]
81
- }
77
+ { type: "contains", text: '@Column({ "type": "numeric"' },
78
+ { type: "contains", text: "@Index()" },
79
+ { type: "contains", text: "indexedValue: number;" },
80
+ ],
81
+ },
82
82
  ];
83
83
  (0, template_test_utils_1.runTemplateTests)(templatePath, testCases);
84
84
  });