blufin 0.1.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 (113) hide show
  1. checksums.yaml +7 -0
  2. data/bin/bf +5 -0
  3. data/bin/blufin +5 -0
  4. data/lib/blufin.rb +245 -0
  5. data/lib/core/code_scanners/common/scanner_common.rb +83 -0
  6. data/lib/core/code_scanners/common/scanner_java.rb +106 -0
  7. data/lib/core/code_scanners/scanner_java_embedded_objects.rb +386 -0
  8. data/lib/core/code_scanners/scanner_java_enums.rb +125 -0
  9. data/lib/core/code_scanners/scanner_java_source.rb +29 -0
  10. data/lib/core/code_scanners/scanner_java_tests.rb +157 -0
  11. data/lib/core/error_handling/schema_error.rb +9 -0
  12. data/lib/core/error_handling/sql_error.rb +21 -0
  13. data/lib/core/error_handling/sql_error_handler.rb +149 -0
  14. data/lib/core/error_handling/yml_error.rb +21 -0
  15. data/lib/core/error_handling/yml_error_handler.rb +437 -0
  16. data/lib/core/mysql.rb +347 -0
  17. data/lib/core/opt.rb +21 -0
  18. data/lib/core/site/site.rb +26 -0
  19. data/lib/core/site/site_auth.rb +88 -0
  20. data/lib/core/site/site_embedded.rb +27 -0
  21. data/lib/core/site/site_ports.rb +9 -0
  22. data/lib/core/site/site_resolver.rb +276 -0
  23. data/lib/core/site/site_services.rb +162 -0
  24. data/lib/core/site/site_ui.rb +16 -0
  25. data/lib/core/yml/config/yml_config_validator.rb +219 -0
  26. data/lib/core/yml/maven/yml_maven_validator.rb +1132 -0
  27. data/lib/core/yml/resource/yml_resource_validator.rb +154 -0
  28. data/lib/core/yml/schema/yml_schema_flags.rb +9 -0
  29. data/lib/core/yml/schema/yml_schema_validator.rb +1850 -0
  30. data/lib/core/yml/yml_cache_handler.rb +115 -0
  31. data/lib/core/yml/yml_common.rb +487 -0
  32. data/lib/core/yml/yml_meta_writer_base.rb +300 -0
  33. data/lib/core/yml/yml_outputter.rb +307 -0
  34. data/lib/core/yml/yml_validator_base.rb +630 -0
  35. data/lib/core/yml_writers/yml_configuration_writer.rb +40 -0
  36. data/lib/core/yml_writers/yml_java_api_resource_writer.rb +348 -0
  37. data/lib/core/yml_writers/yml_java_cron_type_writer.rb +113 -0
  38. data/lib/core/yml_writers/yml_java_css_dependency_writer.rb +59 -0
  39. data/lib/core/yml_writers/yml_java_dao_writer.rb +364 -0
  40. data/lib/core/yml_writers/yml_java_dto_writer.rb +251 -0
  41. data/lib/core/yml_writers/yml_java_embedded_object_writer.rb +968 -0
  42. data/lib/core/yml_writers/yml_java_enum_writer.rb +161 -0
  43. data/lib/core/yml_writers/yml_java_js_dependency_writer.rb +59 -0
  44. data/lib/core/yml_writers/yml_java_message_type_writer.rb +106 -0
  45. data/lib/core/yml_writers/yml_java_meta_writer.rb +173 -0
  46. data/lib/core/yml_writers/yml_java_model_writer.rb +510 -0
  47. data/lib/core/yml_writers/yml_java_pom_writer.rb +1050 -0
  48. data/lib/core/yml_writers/yml_java_resource_data_writer.rb +251 -0
  49. data/lib/core/yml_writers/yml_java_sdk_writer.rb +732 -0
  50. data/lib/core/yml_writers/yml_java_validator_writer.rb +280 -0
  51. data/lib/core/yml_writers/yml_java_worker_writer.rb +81 -0
  52. data/lib/core/yml_writers/yml_sql_structure_writer.rb +307 -0
  53. data/lib/core/yml_writers/yml_sql_template_writer.rb +243 -0
  54. data/lib/core/yml_writers/yml_vue_service_writer.rb +170 -0
  55. data/lib/core/yml_writers/yml_writer_base.rb +114 -0
  56. data/lib/routes/api_list.rb +35 -0
  57. data/lib/routes/api_meta.rb +59 -0
  58. data/lib/routes/build.rb +46 -0
  59. data/lib/routes/create/create_api.rb +35 -0
  60. data/lib/routes/create/create_ui.rb +84 -0
  61. data/lib/routes/export.rb +56 -0
  62. data/lib/routes/generate/generate_api.rb +225 -0
  63. data/lib/routes/generate/generate_img_favicon.rb +56 -0
  64. data/lib/routes/generate/generate_img_landing.rb +94 -0
  65. data/lib/routes/generate/generate_lambda.rb +43 -0
  66. data/lib/routes/lint.rb +35 -0
  67. data/lib/routes/mysql_reset.rb +43 -0
  68. data/lib/routes/release_blufin.rb +351 -0
  69. data/lib/routes/run.rb +35 -0
  70. data/lib/version.rb +1 -0
  71. data/opt/README.MD +2 -0
  72. data/opt/config/schema.yml +73 -0
  73. data/opt/config/template.yml +25 -0
  74. data/opt/sql/data/config/data-client.sql +7 -0
  75. data/opt/sql/data/config/data-db-configuration-property.sql +47 -0
  76. data/opt/sql/data/config/data-db-configuration.sql +9 -0
  77. data/opt/sql/data/config/data-db.sql +175 -0
  78. data/opt/sql/data/config/data-profile-api.sql +47 -0
  79. data/opt/sql/data/config/data-profile-cron.sql +0 -0
  80. data/opt/sql/data/config/data-profile-worker.sql +0 -0
  81. data/opt/sql/data/config/data-profile.sql +87 -0
  82. data/opt/sql/data/config/data-project.sql +95 -0
  83. data/opt/sql/structure/blufin-master-structure-fks.sql +65 -0
  84. data/opt/sql/structure/blufin-master-structure.sql +97 -0
  85. data/opt/sql/structure/blufin-mock-structure-fks.sql +38 -0
  86. data/opt/sql/structure/blufin-mock-structure.sql +98 -0
  87. data/opt/sql/templates/config/template-client.sql +7 -0
  88. data/opt/sql/templates/config/template-db-configuration-property.sql +11 -0
  89. data/opt/sql/templates/config/template-db-configuration.sql +9 -0
  90. data/opt/sql/templates/config/template-db.sql +21 -0
  91. data/opt/sql/templates/config/template-profile-api.sql +11 -0
  92. data/opt/sql/templates/config/template-profile-cron.sql +7 -0
  93. data/opt/sql/templates/config/template-profile-worker.sql +7 -0
  94. data/opt/sql/templates/config/template-profile.sql +21 -0
  95. data/opt/sql/templates/config/template-project.sql +23 -0
  96. data/opt/yml/api/schema/config/client.yml +14 -0
  97. data/opt/yml/api/schema/config/db.yml +45 -0
  98. data/opt/yml/api/schema/config/db_configuration.yml +22 -0
  99. data/opt/yml/api/schema/config/db_configuration_property.yml +22 -0
  100. data/opt/yml/api/schema/config/profile.yml +53 -0
  101. data/opt/yml/api/schema/config/profile_api.yml +22 -0
  102. data/opt/yml/api/schema/config/profile_cron.yml +14 -0
  103. data/opt/yml/api/schema/config/profile_worker.yml +14 -0
  104. data/opt/yml/api/schema/config/project.yml +48 -0
  105. data/opt/yml/api/schema/mock/mock.yml +99 -0
  106. data/opt/yml/api/schema/mock/mock_nested_if_enum.yml +16 -0
  107. data/opt/yml/api/schema/mock/mock_nested_if_enum_system.yml +16 -0
  108. data/opt/yml/api/schema/mock/mock_nested_linked.yml +43 -0
  109. data/opt/yml/api/schema/mock/mock_nested_multiple.yml +61 -0
  110. data/opt/yml/api/schema/mock/mock_nested_single.yml +67 -0
  111. data/opt/yml/api/schema/mock/mock_nested_single_super_deep.yml +32 -0
  112. data/opt/yml/api/schema/mock/mock_nested_single_super_super_deep.yml +17 -0
  113. metadata +240 -0
@@ -0,0 +1,11 @@
1
+ INSERT IGNORE INTO `blufin-master`.profile_api (
2
+ `id`,
3
+ `profile_id`, -- FK: config.profile.id
4
+ `common_db_id`, -- FK: config.db.id
5
+ `common_db_configuration_id` -- FK: config.db_configuration.id
6
+ ) VALUES (
7
+ 0,
8
+ 0, -- FK: config.profile.id
9
+ 0, -- FK: config.db.id
10
+ 0 -- FK: config.db_configuration.id
11
+ );
@@ -0,0 +1,7 @@
1
+ INSERT IGNORE INTO `blufin-master`.profile_cron (
2
+ `id`,
3
+ `profile_id` -- FK: config.profile.id
4
+ ) VALUES (
5
+ 0,
6
+ 0 -- FK: config.profile.id
7
+ );
@@ -0,0 +1,7 @@
1
+ INSERT IGNORE INTO `blufin-master`.profile_worker (
2
+ `id`,
3
+ `profile_id` -- FK: config.profile.id
4
+ ) VALUES (
5
+ 0,
6
+ 0 -- FK: config.profile.id
7
+ );
@@ -0,0 +1,21 @@
1
+ INSERT IGNORE INTO `blufin-master`.profile (
2
+ `id`,
3
+ `project_id`, -- FK: config.project.id
4
+ `profile_name`,
5
+ `environment`,
6
+ `timezone`,
7
+ `message_queue_host`,
8
+ `slack_log_url`,
9
+ `slack_error_url`,
10
+ `authorization_header`
11
+ ) VALUES (
12
+ 0,
13
+ 0, -- FK: config.project.id
14
+ 'PROFILE_NAME',
15
+ 'LOCAL|DEVELOPMENT|SANDBOX|STAGING|PRODUCTION',
16
+ 'TIMEZONE',
17
+ 'MESSAGE_QUEUE_HOST',
18
+ 'SLACK_LOG_URL',
19
+ 'SLACK_ERROR_URL',
20
+ 'AUTHORIZATION_HEADER'
21
+ );
@@ -0,0 +1,23 @@
1
+ INSERT IGNORE INTO `blufin-master`.project (
2
+ `id`,
3
+ `client_id`, -- FK: config.client.id
4
+ `project_name`,
5
+ `project_name_pascal_case`,
6
+ `project_title`,
7
+ `domain`,
8
+ `alias`,
9
+ `port_range`,
10
+ `encryption_key`,
11
+ `encryption_iv`
12
+ ) VALUES (
13
+ 0,
14
+ 0, -- FK: config.client.id
15
+ 'PROJECT_NAME',
16
+ 'PROJECT_NAME_PASCAL_CASE',
17
+ 'PROJECT_TITLE',
18
+ 'DOMAIN',
19
+ 'ALIAS',
20
+ 'PORT_RANGE',
21
+ 'ENCRYPTION_KEY',
22
+ 'ENCRYPTION_IV'
23
+ );
@@ -0,0 +1,14 @@
1
+ config:
2
+
3
+ internal:
4
+ GET:
5
+
6
+ schema:
7
+
8
+ id:
9
+ type: INT_AUTO
10
+ flag: PRIMARY_KEY
11
+
12
+ client_name:
13
+ type: VARCHAR(64)
14
+ flag: INDEX UNIQUE
@@ -0,0 +1,45 @@
1
+ config:
2
+
3
+ internal:
4
+ GET:
5
+
6
+ schema:
7
+
8
+ id:
9
+ type: INT_AUTO
10
+ flag: PRIMARY_KEY
11
+
12
+ project_id:
13
+ type: INT
14
+ flag: NULLABLE
15
+ fkey: config.project.id
16
+
17
+ db_name:
18
+ type: VARCHAR(32)
19
+ flag: INDEX UNIQUE
20
+ description: "The name for the database as displayed by our internal systems."
21
+
22
+ host:
23
+ type: VARCHAR(255)
24
+ description: "The URL of the server (through SSH connection -- IE: username.abc123.eu-west-1.rds.amazonaws.com )."
25
+
26
+ user:
27
+ type: TEXT
28
+ description: "The username used to connect to the server."
29
+
30
+ password:
31
+ type: TEXT
32
+ description: "The password used to connect to the server."
33
+
34
+ environment:
35
+ type: ENUM_SYSTEM('Environment')
36
+ flag: INDEX
37
+ description: "The environment for which this database will apply to."
38
+
39
+ schema_type:
40
+ type: ENUM_SYSTEM('SchemaType')
41
+ description: "The schema type (IE: config, common or app)."
42
+
43
+ jdbc_url:
44
+ type: VARCHAR(255)
45
+ description: "The URL of the server (through Java JDBC connection -- IE: jdbc:mysql://abc123.com:3306 )."
@@ -0,0 +1,22 @@
1
+ config:
2
+
3
+ internal:
4
+ GET:
5
+
6
+ schema:
7
+
8
+ id:
9
+ type: INT_AUTO
10
+ flag: PRIMARY_KEY
11
+
12
+ db_configuration_name:
13
+ type: VARCHAR(32)
14
+ flag: INDEX UNIQUE
15
+ description: "The name for this configuration."
16
+
17
+ pool_max_size:
18
+ type: INT
19
+ description: "The maximum size of the connection pool."
20
+
21
+ config.db_configuration_property[]:
22
+ description: "Any additional JDBC driver parameters stored as key/value pairs."
@@ -0,0 +1,22 @@
1
+ config:
2
+
3
+ internal:
4
+ GET:
5
+
6
+ schema:
7
+
8
+ id:
9
+ type: INT_AUTO
10
+ flag: PRIMARY_KEY
11
+
12
+ db_configuration_id:
13
+ type: INT
14
+ fkey: config.db_configuration.id
15
+
16
+ key:
17
+ type: VARCHAR(64)
18
+ description: "Database property key (IE: charSet)"
19
+
20
+ value:
21
+ type: VARCHAR(128)
22
+ description: "Database property value (IE: UTF-8)"
@@ -0,0 +1,53 @@
1
+ config:
2
+
3
+ internal:
4
+ GET:
5
+
6
+ schema:
7
+
8
+ id:
9
+ type: INT_AUTO
10
+ flag: PRIMARY_KEY
11
+
12
+ project_id:
13
+ type: INT
14
+ fkey: config.project.id
15
+
16
+ profile_name:
17
+ type: VARCHAR(32)
18
+ flag: INDEX
19
+ description: "The name of the profile (IE: localhost, us-west-1, etc.)"
20
+
21
+ environment:
22
+ type: ENUM_SYSTEM('Environment')
23
+ flag: INDEX
24
+ description: "The environment in which the application will run under this profile."
25
+
26
+ timezone:
27
+ type: VARCHAR(64)
28
+ description: "The timezone in which associated application will run."
29
+
30
+ message_queue_host:
31
+ type: VARCHAR(255)
32
+ description: "The message queue URL."
33
+
34
+ slack_log_url:
35
+ type: VARCHAR(255)
36
+ description: "The Slack Log channel webhook URL."
37
+
38
+ slack_error_url:
39
+ type: VARCHAR(255)
40
+ description: "The Slack Error channel webhook URL."
41
+
42
+ authorization_header:
43
+ type: TEXT
44
+ description: "The Authorization Header used for internal API calls."
45
+
46
+ config.profile_api:
47
+ required: true
48
+
49
+ config.profile_cron:
50
+ required: true
51
+
52
+ config.profile_worker:
53
+ required: true
@@ -0,0 +1,22 @@
1
+ config:
2
+
3
+ internal:
4
+ GET:
5
+
6
+ schema:
7
+
8
+ id:
9
+ type: INT_AUTO
10
+ flag: PRIMARY_KEY
11
+
12
+ profile_id:
13
+ type: INT
14
+ fkey: config.profile.id
15
+
16
+ common_db_id:
17
+ type: INT
18
+ fkey: config.db.id
19
+
20
+ common_db_configuration_id:
21
+ type: INT
22
+ fkey: config.db_configuration.id
@@ -0,0 +1,14 @@
1
+ config:
2
+
3
+ internal:
4
+ GET:
5
+
6
+ schema:
7
+
8
+ id:
9
+ type: INT_AUTO
10
+ flag: PRIMARY_KEY
11
+
12
+ profile_id:
13
+ type: INT
14
+ fkey: config.profile.id
@@ -0,0 +1,14 @@
1
+ config:
2
+
3
+ internal:
4
+ GET:
5
+
6
+ schema:
7
+
8
+ id:
9
+ type: INT_AUTO
10
+ flag: PRIMARY_KEY
11
+
12
+ profile_id:
13
+ type: INT
14
+ fkey: config.profile.id
@@ -0,0 +1,48 @@
1
+ config:
2
+
3
+ internal:
4
+ GET:
5
+
6
+ schema:
7
+
8
+ id:
9
+ type: INT_AUTO
10
+ flag: PRIMARY_KEY
11
+
12
+ client_id:
13
+ type: INT
14
+ fkey: config.client.id
15
+
16
+ project_name:
17
+ type: VARCHAR(64)
18
+ flag: INDEX UNIQUE
19
+ description: "Must be all lowercase & hyphen separated (IE: go-eat)"
20
+
21
+ project_name_pascal_case:
22
+ type: VARCHAR(64)
23
+ description: "Must be camel-cased (IE: GoEat)"
24
+
25
+ project_title:
26
+ type: VARCHAR(128)
27
+ description: "The way you want the project title/name to be displayed in UIs (IE: Go-EAT)"
28
+
29
+ domain:
30
+ type: VARCHAR(128)
31
+ description: "The domain where the project will be hosted (IE: com, co.uk, app). This combined with the {project:project_name:Project name} should make up the public URL."
32
+
33
+ alias:
34
+ type: VARCHAR(8)
35
+ flag: INDEX UNIQUE
36
+ description: "A short alias for the project, mainly for use in CLI commands (IE: ge)"
37
+
38
+ port_range:
39
+ type: VARCHAR(12)
40
+ description: "Ports reserved for this project, must be in sections of 20 (IE: 6000-6019)"
41
+
42
+ encryption_key:
43
+ type: VARCHAR(64)
44
+ description: "Encryption Key for encrypting/decrypting sensitive data. This can never change!"
45
+
46
+ encryption_iv:
47
+ type: VARCHAR(64)
48
+ description: "Encryption IV for encrypting/decrypting sensitive data. This can never change!"
@@ -0,0 +1,99 @@
1
+ config:
2
+
3
+ internal:
4
+ GET:
5
+ POST:
6
+ PUT:
7
+ PATCH:
8
+ DELETE:
9
+
10
+ schema:
11
+
12
+ id:
13
+ type: INT_AUTO
14
+ flag: AUTO_INCREMENT(1000) PRIMARY_KEY
15
+
16
+ bool:
17
+ type: BOOLEAN
18
+
19
+ mock_date:
20
+ type: DATE
21
+
22
+ mock_datetime:
23
+ type: DATETIME
24
+
25
+ mock_created_datetime:
26
+ type: DATETIME_INSERT
27
+
28
+ mock_modified_datetime:
29
+ type: DATETIME_UPDATE
30
+
31
+ decimal:
32
+ type: DECIMAL(13,2)
33
+ flag: INDEX UNIQUE
34
+
35
+ enumeration:
36
+ type: ENUM('VALUE_ONE','VALUE_TWO')
37
+
38
+ enumeration_system:
39
+ type: ENUM_SYSTEM('Environment')
40
+
41
+ integer:
42
+ type: INT
43
+ flag: INDEX
44
+
45
+ integer_tiny:
46
+ type: INT_TINY
47
+
48
+ integer_small:
49
+ type: INT_SMALL
50
+
51
+ integer_big:
52
+ type: INT_BIG
53
+
54
+ integer_nullable:
55
+ type: INT
56
+ flag: NULLABLE
57
+
58
+ integer_tiny_nullable:
59
+ type: INT_TINY
60
+ flag: NULLABLE
61
+
62
+ integer_small_nullable:
63
+ type: INT_SMALL
64
+ flag: NULLABLE
65
+
66
+ integer_big_nullable:
67
+ type: INT_BIG
68
+ flag: NULLABLE
69
+
70
+ text:
71
+ type: TEXT
72
+ flag: INDEX NULLABLE
73
+ description: "This is a text field."
74
+
75
+ text_long:
76
+ type: TEXT_LONG
77
+ flag: INDEX NULLABLE
78
+
79
+ text_encrypted:
80
+ type: TEXT
81
+ flag: INDEX
82
+ encrypted: true
83
+
84
+ varchar:
85
+ type: VARCHAR(12)
86
+ flag: INDEX UNIQUE
87
+
88
+ mock.mock_nested_single:
89
+ required: true
90
+
91
+ mock.mock_nested_if_enum:
92
+ required_if: enumeration=VALUE_TWO
93
+
94
+ mock.mock_nested_if_enum_system:
95
+ required_if: enumeration_system=PRODUCTION
96
+
97
+ mock.mock_nested_multiple[]:
98
+
99
+ mock.mock_nested_linked[link]:
@@ -0,0 +1,16 @@
1
+ config:
2
+
3
+ internal:
4
+ GET:
5
+ PUT:
6
+ PATCH:
7
+
8
+ schema:
9
+
10
+ id:
11
+ type: INT_AUTO
12
+ flag: AUTO_INCREMENT(1000) PRIMARY_KEY
13
+
14
+ mock_id:
15
+ type: INT
16
+ fkey: mock.mock.id