@slingr/cli 0.0.2 → 0.0.4

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 (251) hide show
  1. package/LICENSE.txt +202 -0
  2. package/README.md +490 -319
  3. package/bin/dev.cmd +2 -2
  4. package/bin/dev.js +5 -5
  5. package/bin/run.cmd +2 -2
  6. package/bin/run.js +4 -4
  7. package/bin/slingr +1 -0
  8. package/dist/commands/build.d.ts +20 -0
  9. package/dist/commands/build.d.ts.map +1 -0
  10. package/dist/commands/build.js +206 -0
  11. package/dist/commands/build.js.map +1 -0
  12. package/dist/commands/create-app.d.ts +0 -1
  13. package/dist/commands/create-app.d.ts.map +1 -1
  14. package/dist/commands/create-app.js +38 -57
  15. package/dist/commands/create-app.js.map +1 -1
  16. package/dist/commands/debug.d.ts +28 -0
  17. package/dist/commands/debug.d.ts.map +1 -0
  18. package/dist/commands/debug.js +474 -0
  19. package/dist/commands/debug.js.map +1 -0
  20. package/dist/commands/ds.d.ts +14 -1
  21. package/dist/commands/ds.d.ts.map +1 -1
  22. package/dist/commands/ds.js +450 -121
  23. package/dist/commands/ds.js.map +1 -1
  24. package/dist/commands/gql.d.ts +1 -1
  25. package/dist/commands/gql.d.ts.map +1 -1
  26. package/dist/commands/gql.js +190 -184
  27. package/dist/commands/gql.js.map +1 -1
  28. package/dist/commands/infra/down.d.ts.map +1 -1
  29. package/dist/commands/infra/down.js +8 -7
  30. package/dist/commands/infra/down.js.map +1 -1
  31. package/dist/commands/infra/up.d.ts.map +1 -1
  32. package/dist/commands/infra/up.js +8 -7
  33. package/dist/commands/infra/up.js.map +1 -1
  34. package/dist/commands/infra/update.d.ts +1 -0
  35. package/dist/commands/infra/update.d.ts.map +1 -1
  36. package/dist/commands/infra/update.js +33 -69
  37. package/dist/commands/infra/update.js.map +1 -1
  38. package/dist/commands/run.d.ts +29 -2
  39. package/dist/commands/run.d.ts.map +1 -1
  40. package/dist/commands/run.js +628 -130
  41. package/dist/commands/run.js.map +1 -1
  42. package/dist/commands/setup.d.ts +1 -1
  43. package/dist/commands/setup.d.ts.map +1 -1
  44. package/dist/commands/setup.js +34 -71
  45. package/dist/commands/setup.js.map +1 -1
  46. package/dist/commands/sync-metadata.d.ts +15 -0
  47. package/dist/commands/sync-metadata.d.ts.map +1 -0
  48. package/dist/commands/sync-metadata.js +225 -0
  49. package/dist/commands/sync-metadata.js.map +1 -0
  50. package/dist/commands/users.d.ts +30 -0
  51. package/dist/commands/users.d.ts.map +1 -0
  52. package/dist/commands/users.js +472 -0
  53. package/dist/commands/users.js.map +1 -0
  54. package/dist/commands/views.d.ts +11 -0
  55. package/dist/commands/views.d.ts.map +1 -0
  56. package/dist/commands/views.js +73 -0
  57. package/dist/commands/views.js.map +1 -0
  58. package/dist/projectStructure.d.ts +2 -2
  59. package/dist/projectStructure.d.ts.map +1 -1
  60. package/dist/projectStructure.js +281 -69
  61. package/dist/projectStructure.js.map +1 -1
  62. package/dist/scripts/generate-metadata.d.ts +13 -0
  63. package/dist/scripts/generate-metadata.d.ts.map +1 -0
  64. package/dist/scripts/generate-metadata.js +412 -0
  65. package/dist/scripts/generate-metadata.js.map +1 -0
  66. package/dist/scripts/generate-metadata.ts +498 -0
  67. package/dist/scripts/generate-schema.d.ts +1 -1
  68. package/dist/scripts/generate-schema.js +168 -74
  69. package/dist/scripts/generate-schema.js.map +1 -1
  70. package/dist/scripts/generate-schema.ts +258 -143
  71. package/dist/templates/.env.template +23 -0
  72. package/dist/templates/.firebaserc.template +5 -0
  73. package/dist/templates/.github/copilot-instructions.md.template +652 -17
  74. package/dist/templates/backend/Dockerfile.template +30 -0
  75. package/dist/templates/config/datasource.ts.template +12 -9
  76. package/dist/templates/config/jest.config.ts +30 -30
  77. package/dist/templates/config/jest.setup.ts +1 -1
  78. package/dist/templates/config/tsconfig.json.template +50 -29
  79. package/dist/templates/dataSources/mysql.ts.template +16 -13
  80. package/dist/templates/dataSources/postgres.ts.template +15 -13
  81. package/dist/templates/dataset-generator-script.ts.template +139 -139
  82. package/dist/templates/datasets/mysql-default/.slingr-schema.json.template +5 -0
  83. package/dist/templates/datasets/mysql-default/Address.jsonl.template +3 -3
  84. package/dist/templates/datasets/mysql-default/App.jsonl.template +4 -4
  85. package/dist/templates/datasets/mysql-default/Company.jsonl.template +3 -3
  86. package/dist/templates/datasets/mysql-default/Person.jsonl.template +2 -2
  87. package/dist/templates/datasets/mysql-default/User.jsonl.template +1 -0
  88. package/dist/templates/datasets/mysql-default/instructions.md.template +1 -0
  89. package/dist/templates/datasets/postgres-default/.slingr-schema.json.template +5 -0
  90. package/dist/templates/datasets/postgres-default/Address.jsonl.template +3 -3
  91. package/dist/templates/datasets/postgres-default/App.jsonl.template +4 -4
  92. package/dist/templates/datasets/postgres-default/Company.jsonl.template +3 -3
  93. package/dist/templates/datasets/postgres-default/Person.jsonl.template +2 -2
  94. package/dist/templates/datasets/postgres-default/User.jsonl.template +1 -0
  95. package/dist/templates/datasets/postgres-default/instructions.md.template +1 -0
  96. package/dist/templates/docker-compose.prod-test.yml.template +32 -0
  97. package/dist/templates/docker-compose.yml.template +24 -0
  98. package/dist/templates/docs/app-description.md.template +33 -33
  99. package/dist/templates/firebase.json.template +68 -0
  100. package/dist/templates/frontend/.umirc.ts.template +23 -0
  101. package/dist/templates/frontend/package.json.template +45 -0
  102. package/dist/templates/frontend/public/config.json +6 -0
  103. package/dist/templates/frontend/public/logo.svg +6 -0
  104. package/dist/templates/frontend/src/app.tsx.template +44 -0
  105. package/dist/templates/frontend/src/global.less.template +117 -0
  106. package/dist/templates/frontend/src/layouts/MainLayout.tsx.template +75 -0
  107. package/dist/templates/frontend/src/types/graphql-augmentation.d.ts.template +44 -0
  108. package/dist/templates/frontend/src/views/customViews/user/UserCreateView.tsx.template +18 -0
  109. package/dist/templates/frontend/src/views/customViews/user/UserEditView.tsx.template +29 -0
  110. package/dist/templates/frontend/src/views/customViews/user/UserReadView.tsx.template +24 -0
  111. package/dist/templates/frontend/src/views/customViews/user/UserTableView.tsx.template +38 -0
  112. package/dist/templates/frontend/src/views/customViews/welcome.tsx.template +34 -0
  113. package/dist/templates/frontend/tsconfig.json.template +50 -0
  114. package/dist/templates/gql/codegen.yml.template +25 -25
  115. package/dist/templates/gql/index.ts.template +17 -24
  116. package/dist/templates/gql/operations.graphql.template +30 -30
  117. package/dist/templates/ops/README.md.template +1045 -0
  118. package/dist/templates/ops/cloudbuild.yaml.template +161 -0
  119. package/dist/templates/ops/scripts/_utils.js.template +217 -0
  120. package/dist/templates/ops/scripts/deploy.js.template +145 -0
  121. package/dist/templates/ops/scripts/setup-gcp.js.template +330 -0
  122. package/dist/templates/ops/scripts/setup-secrets.js.template +76 -0
  123. package/dist/templates/ops/scripts/test-prod-local.js.template +49 -0
  124. package/dist/templates/package.json.template +50 -38
  125. package/dist/templates/pnpm-workspace.yaml.template +3 -0
  126. package/dist/templates/prompt-analysis.md.template +110 -110
  127. package/dist/templates/prompt-script-generation.md.template +258 -258
  128. package/dist/templates/src/Address.ts.template +28 -31
  129. package/dist/templates/src/App.ts.template +17 -61
  130. package/dist/templates/src/Company.ts.template +41 -47
  131. package/dist/templates/src/Models.test.ts.template +654 -654
  132. package/dist/templates/src/Person.test.ts.template +289 -289
  133. package/dist/templates/src/Person.ts.template +90 -105
  134. package/dist/templates/src/actions/index.ts.template +11 -11
  135. package/dist/templates/src/auth/permissions.ts.template +34 -0
  136. package/dist/templates/src/data/App.ts.template +48 -0
  137. package/dist/templates/src/data/User.ts.template +35 -0
  138. package/dist/templates/src/types/gql.d.ts.template +17 -17
  139. package/dist/templates/vscode/extensions.json +4 -3
  140. package/dist/templates/vscode/settings.json +17 -11
  141. package/dist/templates/workspace-package.json.template +21 -0
  142. package/dist/utils/buildCache.d.ts +12 -0
  143. package/dist/utils/buildCache.d.ts.map +1 -0
  144. package/dist/utils/buildCache.js +102 -0
  145. package/dist/utils/buildCache.js.map +1 -0
  146. package/dist/utils/checkFramework.d.ts +27 -0
  147. package/dist/utils/checkFramework.d.ts.map +1 -0
  148. package/dist/utils/checkFramework.js +104 -0
  149. package/dist/utils/checkFramework.js.map +1 -0
  150. package/dist/utils/datasourceParser.d.ts +11 -0
  151. package/dist/utils/datasourceParser.d.ts.map +1 -1
  152. package/dist/utils/datasourceParser.js +154 -56
  153. package/dist/utils/datasourceParser.js.map +1 -1
  154. package/dist/utils/dockerManager.d.ts +25 -0
  155. package/dist/utils/dockerManager.d.ts.map +1 -0
  156. package/dist/utils/dockerManager.js +281 -0
  157. package/dist/utils/dockerManager.js.map +1 -0
  158. package/dist/utils/infraFileParser.d.ts +26 -0
  159. package/dist/utils/infraFileParser.d.ts.map +1 -0
  160. package/dist/utils/infraFileParser.js +75 -0
  161. package/dist/utils/infraFileParser.js.map +1 -0
  162. package/dist/utils/jsonlLoader.d.ts +91 -12
  163. package/dist/utils/jsonlLoader.d.ts.map +1 -1
  164. package/dist/utils/jsonlLoader.js +674 -63
  165. package/dist/utils/jsonlLoader.js.map +1 -1
  166. package/dist/utils/model-analyzer.d.ts.map +1 -1
  167. package/dist/utils/model-analyzer.js +67 -13
  168. package/dist/utils/model-analyzer.js.map +1 -1
  169. package/dist/utils/userManagement.d.ts +57 -0
  170. package/dist/utils/userManagement.d.ts.map +1 -0
  171. package/dist/utils/userManagement.js +288 -0
  172. package/dist/utils/userManagement.js.map +1 -0
  173. package/dist/utils/viewsGenerator.d.ts +15 -0
  174. package/dist/utils/viewsGenerator.d.ts.map +1 -0
  175. package/dist/utils/viewsGenerator.js +311 -0
  176. package/dist/utils/viewsGenerator.js.map +1 -0
  177. package/oclif.manifest.json +445 -20
  178. package/package.json +29 -27
  179. package/src/templates/.env.template +23 -0
  180. package/src/templates/.firebaserc.template +5 -0
  181. package/src/templates/.github/copilot-instructions.md.template +652 -17
  182. package/src/templates/backend/Dockerfile.template +30 -0
  183. package/src/templates/config/datasource.ts.template +12 -9
  184. package/src/templates/config/jest.config.ts +30 -30
  185. package/src/templates/config/jest.setup.ts +1 -1
  186. package/src/templates/config/tsconfig.json.template +50 -29
  187. package/src/templates/dataSources/mysql.ts.template +16 -13
  188. package/src/templates/dataSources/postgres.ts.template +15 -13
  189. package/src/templates/dataset-generator-script.ts.template +139 -139
  190. package/src/templates/datasets/mysql-default/.slingr-schema.json.template +5 -0
  191. package/src/templates/datasets/mysql-default/Address.jsonl.template +3 -3
  192. package/src/templates/datasets/mysql-default/App.jsonl.template +4 -4
  193. package/src/templates/datasets/mysql-default/Company.jsonl.template +3 -3
  194. package/src/templates/datasets/mysql-default/Person.jsonl.template +2 -2
  195. package/src/templates/datasets/mysql-default/User.jsonl.template +1 -0
  196. package/src/templates/datasets/mysql-default/instructions.md.template +1 -0
  197. package/src/templates/datasets/postgres-default/.slingr-schema.json.template +5 -0
  198. package/src/templates/datasets/postgres-default/Address.jsonl.template +3 -3
  199. package/src/templates/datasets/postgres-default/App.jsonl.template +4 -4
  200. package/src/templates/datasets/postgres-default/Company.jsonl.template +3 -3
  201. package/src/templates/datasets/postgres-default/Person.jsonl.template +2 -2
  202. package/src/templates/datasets/postgres-default/User.jsonl.template +1 -0
  203. package/src/templates/datasets/postgres-default/instructions.md.template +1 -0
  204. package/src/templates/docker-compose.prod-test.yml.template +32 -0
  205. package/src/templates/docker-compose.yml.template +24 -0
  206. package/src/templates/docs/app-description.md.template +33 -33
  207. package/src/templates/firebase.json.template +68 -0
  208. package/src/templates/frontend/.umirc.ts.template +23 -0
  209. package/src/templates/frontend/package.json.template +45 -0
  210. package/src/templates/frontend/public/config.json +6 -0
  211. package/src/templates/frontend/public/logo.svg +6 -0
  212. package/src/templates/frontend/src/app.tsx.template +44 -0
  213. package/src/templates/frontend/src/global.less.template +117 -0
  214. package/src/templates/frontend/src/layouts/MainLayout.tsx.template +75 -0
  215. package/src/templates/frontend/src/types/graphql-augmentation.d.ts.template +44 -0
  216. package/src/templates/frontend/src/views/customViews/user/UserCreateView.tsx.template +18 -0
  217. package/src/templates/frontend/src/views/customViews/user/UserEditView.tsx.template +29 -0
  218. package/src/templates/frontend/src/views/customViews/user/UserReadView.tsx.template +24 -0
  219. package/src/templates/frontend/src/views/customViews/user/UserTableView.tsx.template +38 -0
  220. package/src/templates/frontend/src/views/customViews/welcome.tsx.template +34 -0
  221. package/src/templates/frontend/tsconfig.json.template +50 -0
  222. package/src/templates/gql/codegen.yml.template +25 -25
  223. package/src/templates/gql/index.ts.template +17 -24
  224. package/src/templates/gql/operations.graphql.template +30 -30
  225. package/src/templates/ops/README.md.template +1045 -0
  226. package/src/templates/ops/cloudbuild.yaml.template +161 -0
  227. package/src/templates/ops/scripts/_utils.js.template +217 -0
  228. package/src/templates/ops/scripts/deploy.js.template +145 -0
  229. package/src/templates/ops/scripts/setup-gcp.js.template +330 -0
  230. package/src/templates/ops/scripts/setup-secrets.js.template +76 -0
  231. package/src/templates/ops/scripts/test-prod-local.js.template +49 -0
  232. package/src/templates/package.json.template +50 -38
  233. package/src/templates/pnpm-workspace.yaml.template +3 -0
  234. package/src/templates/prompt-analysis.md.template +110 -110
  235. package/src/templates/prompt-script-generation.md.template +258 -258
  236. package/src/templates/src/Address.ts.template +28 -31
  237. package/src/templates/src/App.ts.template +17 -61
  238. package/src/templates/src/Company.ts.template +41 -47
  239. package/src/templates/src/Models.test.ts.template +654 -654
  240. package/src/templates/src/Person.test.ts.template +289 -289
  241. package/src/templates/src/Person.ts.template +90 -105
  242. package/src/templates/src/actions/index.ts.template +11 -11
  243. package/src/templates/src/auth/permissions.ts.template +34 -0
  244. package/src/templates/src/data/App.ts.template +48 -0
  245. package/src/templates/src/data/User.ts.template +35 -0
  246. package/src/templates/src/types/gql.d.ts.template +17 -17
  247. package/src/templates/vscode/extensions.json +4 -3
  248. package/src/templates/vscode/settings.json +17 -11
  249. package/src/templates/workspace-package.json.template +21 -0
  250. package/dist/templates/src/index.ts +0 -66
  251. package/src/templates/src/index.ts +0 -66
@@ -0,0 +1,281 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isDockerRunning = isDockerRunning;
4
+ exports.tryStartDocker = tryStartDocker;
5
+ exports.ensureDockerIsRunning = ensureDockerIsRunning;
6
+ const child_process_1 = require("child_process");
7
+ const DOCKER_READY_CYCLE_TIMEOUT_ENV = 'SLINGR_DOCKER_READY_CYCLE_TIMEOUT_MS';
8
+ const DOCKER_READY_MAX_TOTAL_TIMEOUT_ENV = 'SLINGR_DOCKER_READY_MAX_TOTAL_TIMEOUT_MS';
9
+ const DEFAULT_DOCKER_READY_CYCLE_TIMEOUT_MS = 30_000;
10
+ const DEFAULT_DOCKER_READY_MAX_TOTAL_TIMEOUT_MS = 120_000;
11
+ const MIN_DOCKER_TIMEOUT_MS = 5_000;
12
+ const DEFAULT_DOCKER_READY_DELAY_MS = 2_000;
13
+ const DEFAULT_DOCKER_START_ATTEMPT_TIMEOUT_MS = 5_000;
14
+ const DEFAULT_DOCKER_START_RETRY_INTERVAL_MS = 5_000;
15
+ const DOCKER_PROBE_COMMAND = 'docker ps';
16
+ class DockerPermissionError extends Error {
17
+ constructor(message) {
18
+ super(message);
19
+ this.name = 'DockerPermissionError';
20
+ }
21
+ }
22
+ function isWslEnvironment() {
23
+ return Boolean(process.env.WSL_DISTRO_NAME || process.env.WSL_INTEROP);
24
+ }
25
+ function parseTimeoutFromEnv(envName, defaultValue) {
26
+ const rawValue = process.env[envName];
27
+ if (!rawValue) {
28
+ return defaultValue;
29
+ }
30
+ const parsedValue = Number.parseInt(rawValue, 10);
31
+ if (!Number.isFinite(parsedValue) || parsedValue < MIN_DOCKER_TIMEOUT_MS) {
32
+ console.warn(`Invalid ${envName}='${rawValue}'. Using default ${defaultValue}ms.`);
33
+ return defaultValue;
34
+ }
35
+ return parsedValue;
36
+ }
37
+ function getDockerTimeoutConfig() {
38
+ const cycleTimeoutMs = parseTimeoutFromEnv(DOCKER_READY_CYCLE_TIMEOUT_ENV, DEFAULT_DOCKER_READY_CYCLE_TIMEOUT_MS);
39
+ const maxTotalTimeoutMs = parseTimeoutFromEnv(DOCKER_READY_MAX_TOTAL_TIMEOUT_ENV, DEFAULT_DOCKER_READY_MAX_TOTAL_TIMEOUT_MS);
40
+ return {
41
+ cycleTimeoutMs,
42
+ maxTotalTimeoutMs,
43
+ };
44
+ }
45
+ function canRunDockerCommand(timeout = 5000) {
46
+ try {
47
+ (0, child_process_1.execSync)(DOCKER_PROBE_COMMAND, { stdio: 'pipe', timeout });
48
+ return true;
49
+ }
50
+ catch {
51
+ return false;
52
+ }
53
+ }
54
+ function isDockerPermissionDeniedError(errorMessage) {
55
+ return /permission denied|got permission denied/i.test(errorMessage);
56
+ }
57
+ function getLinuxPermissionsHintMessage() {
58
+ return ('Docker is running but your user does not have permission to access the Docker daemon.\n' +
59
+ 'Add your user to the docker group and re-open your shell:\n' +
60
+ ` sudo usermod -aG docker $USER\n` +
61
+ ' newgrp docker\n' +
62
+ 'Or run docker commands with sudo.');
63
+ }
64
+ function showLinuxPermissionsHint() {
65
+ console.warn(`\n⚠️ ${getLinuxPermissionsHintMessage()}`);
66
+ }
67
+ function getStartPlanForPlatform(platform) {
68
+ if (platform === 'darwin') {
69
+ return {
70
+ introLog: 'Starting Docker Desktop on macOS...',
71
+ attempts: [{ label: 'open Docker Desktop', command: 'open -a Docker' }],
72
+ failureLog: 'Failed to start Docker Desktop. Please start it manually from Applications.',
73
+ };
74
+ }
75
+ if (platform === 'win32') {
76
+ return {
77
+ introLog: 'Starting Docker Desktop on Windows...',
78
+ attempts: [
79
+ {
80
+ label: 'start Docker Desktop executable',
81
+ command: 'start "" "C:\\Program Files\\Docker\\Docker\\Docker Desktop.exe"',
82
+ },
83
+ ],
84
+ failureLog: 'Failed to start Docker Desktop. Please start it manually from the Start menu.',
85
+ };
86
+ }
87
+ if (platform === 'linux') {
88
+ const attempts = [];
89
+ if (isWslEnvironment()) {
90
+ attempts.push({
91
+ label: 'start Docker Desktop from Windows host via PowerShell',
92
+ command: 'powershell.exe -NoProfile -Command "Start-Process \'C:\\Program Files\\Docker\\Docker\\Docker Desktop.exe\'"',
93
+ }, {
94
+ label: 'start Docker Desktop from Windows host via cmd',
95
+ command: 'cmd.exe /C start "" "C:\\Program Files\\Docker\\Docker\\Docker Desktop.exe"',
96
+ });
97
+ }
98
+ attempts.push({ label: 'docker desktop start', command: 'docker desktop start' }, { label: 'systemd user docker-desktop', command: 'systemctl --user start docker-desktop' }, {
99
+ label: 'systemd docker engine',
100
+ command: 'sudo systemctl start docker',
101
+ stdio: 'inherit',
102
+ showLinuxPermissionHint: true,
103
+ }, {
104
+ label: 'service docker engine',
105
+ command: 'sudo service docker start',
106
+ stdio: 'inherit',
107
+ showLinuxPermissionHint: true,
108
+ });
109
+ return {
110
+ introLog: 'Starting Docker on Linux...',
111
+ attempts,
112
+ failureLog: 'Failed to start Docker automatically on Linux.',
113
+ };
114
+ }
115
+ return undefined;
116
+ }
117
+ /**
118
+ * Utility functions for Docker management.
119
+ * Provides automatic Docker daemon startup and health checking.
120
+ */
121
+ /**
122
+ * Check if Docker is running by attempting to execute `docker ps`.
123
+ *
124
+ * @returns true if Docker daemon is running, false otherwise
125
+ */
126
+ function isDockerRunning() {
127
+ return canRunDockerCommand();
128
+ }
129
+ /**
130
+ * Attempt to start Docker daemon based on the operating system.
131
+ * Tries different commands based on the platform.
132
+ *
133
+ * @returns Promise resolving to true if Docker was started successfully, false otherwise
134
+ */
135
+ async function tryStartDocker() {
136
+ const { cycleTimeoutMs, maxTotalTimeoutMs } = getDockerTimeoutConfig();
137
+ const totalDeadline = Date.now() + maxTotalTimeoutMs;
138
+ let permissionError;
139
+ try {
140
+ const platform = process.platform;
141
+ const startPlan = getStartPlanForPlatform(platform);
142
+ if (!startPlan) {
143
+ console.warn(`Unsupported platform: ${platform}. Cannot auto-start Docker.`);
144
+ return false;
145
+ }
146
+ if (isWslEnvironment() && platform === 'linux') {
147
+ console.log('WSL environment detected. Trying to start Docker Desktop on Windows...');
148
+ }
149
+ console.log(startPlan.introLog);
150
+ while (Date.now() < totalDeadline) {
151
+ const remainingTotalMs = Math.max(0, totalDeadline - Date.now());
152
+ const currentCycleTimeoutMs = Math.min(cycleTimeoutMs, remainingTotalMs);
153
+ for (const attempt of startPlan.attempts) {
154
+ if (Date.now() >= totalDeadline) {
155
+ break;
156
+ }
157
+ const attemptStdio = attempt.stdio ?? 'pipe';
158
+ const isInteractive = attemptStdio === 'inherit';
159
+ const commandTimeoutMs = isInteractive
160
+ ? currentCycleTimeoutMs
161
+ : Math.min(DEFAULT_DOCKER_START_ATTEMPT_TIMEOUT_MS, currentCycleTimeoutMs);
162
+ const periodicStart = {
163
+ command: attempt.command,
164
+ stdio: attemptStdio,
165
+ commandTimeoutMs,
166
+ retryIntervalMs: DEFAULT_DOCKER_START_RETRY_INTERVAL_MS,
167
+ };
168
+ try {
169
+ console.log(`Attempting: ${attempt.label}...`);
170
+ await waitForDockerReady(currentCycleTimeoutMs, DEFAULT_DOCKER_READY_DELAY_MS, periodicStart);
171
+ if (attempt.showLinuxPermissionHint) {
172
+ showLinuxPermissionsHint();
173
+ }
174
+ return true;
175
+ }
176
+ catch (error) {
177
+ if (error instanceof DockerPermissionError) {
178
+ permissionError = error;
179
+ break;
180
+ }
181
+ continue;
182
+ }
183
+ }
184
+ if (permissionError) {
185
+ break;
186
+ }
187
+ if (Date.now() < totalDeadline) {
188
+ console.log('Docker is still not ready after the current cycle. Retrying startup sequence...');
189
+ }
190
+ }
191
+ if (permissionError) {
192
+ throw permissionError;
193
+ }
194
+ console.warn(startPlan.failureLog);
195
+ return false;
196
+ }
197
+ catch (error) {
198
+ if (error instanceof DockerPermissionError) {
199
+ throw error;
200
+ }
201
+ console.warn(`Error attempting to start Docker: ${error.message}`);
202
+ return false;
203
+ }
204
+ }
205
+ /**
206
+ * Wait for Docker daemon to be ready after starting.
207
+ * Polls `docker ps` until it succeeds or timeout is reached.
208
+ *
209
+ * @param timeoutMs - Maximum time to wait in milliseconds (default: 30000, configurable via SLINGR_DOCKER_READY_CYCLE_TIMEOUT_MS)
210
+ * @param delayMs - Delay between attempts in milliseconds (default: 2000)
211
+ */
212
+ async function waitForDockerReady(timeoutMs = DEFAULT_DOCKER_READY_CYCLE_TIMEOUT_MS, delayMs = DEFAULT_DOCKER_READY_DELAY_MS, periodicStart) {
213
+ console.log(`Waiting for Docker to be ready (timeout: ${Math.ceil(timeoutMs / 1000)}s)...`);
214
+ const startedAt = Date.now();
215
+ let lastErrorMessage = '';
216
+ let nextStartAttemptAt = startedAt;
217
+ while (Date.now() - startedAt < timeoutMs) {
218
+ if (periodicStart && Date.now() >= nextStartAttemptAt) {
219
+ try {
220
+ (0, child_process_1.execSync)(periodicStart.command, {
221
+ stdio: periodicStart.stdio,
222
+ timeout: periodicStart.commandTimeoutMs,
223
+ });
224
+ }
225
+ catch (error) {
226
+ const errorMessage = error.message || '';
227
+ const timedOut = /timed out|ETIMEDOUT/i.test(errorMessage);
228
+ if (timedOut) {
229
+ console.warn(`Command timed out after ${Math.ceil(periodicStart.commandTimeoutMs / 1000)}s: ${periodicStart.command}`);
230
+ }
231
+ lastErrorMessage = errorMessage || lastErrorMessage;
232
+ }
233
+ nextStartAttemptAt = Date.now() + periodicStart.retryIntervalMs;
234
+ }
235
+ try {
236
+ (0, child_process_1.execSync)(DOCKER_PROBE_COMMAND, { stdio: 'pipe', timeout: 5000 });
237
+ console.log('✅ Docker is now running!');
238
+ return;
239
+ }
240
+ catch (error) {
241
+ const errorMessage = error.message || '';
242
+ lastErrorMessage = errorMessage;
243
+ const isLinuxLike = process.platform === 'linux';
244
+ if (isLinuxLike && isDockerPermissionDeniedError(errorMessage)) {
245
+ throw new DockerPermissionError(getLinuxPermissionsHintMessage());
246
+ }
247
+ await new Promise(resolve => setTimeout(resolve, delayMs));
248
+ }
249
+ }
250
+ throw new Error(`Docker did not become ready within ${Math.ceil(timeoutMs / 1000)} seconds. ` +
251
+ `Please verify Docker Desktop/Engine is fully started and try again.` +
252
+ (lastErrorMessage ? `\nLast check error: ${lastErrorMessage}` : ''));
253
+ }
254
+ /**
255
+ * Ensure Docker is running by checking status and attempting to start if needed.
256
+ * Throws an error with helpful message if Docker cannot be started.
257
+ *
258
+ * @param commandName - Name of the command requiring Docker (for error messages)
259
+ */
260
+ async function ensureDockerIsRunning(commandName = 'this command') {
261
+ // Check if Docker is running
262
+ if (isDockerRunning()) {
263
+ return; // Docker is already running
264
+ }
265
+ // Docker is not running, attempt to start it
266
+ console.log('🐳 Docker is not running. Attempting to start Docker...');
267
+ const dockerStarted = await tryStartDocker();
268
+ if (!dockerStarted) {
269
+ // Failed to start Docker automatically
270
+ throw new Error(`Docker is not running and could not be started automatically.\n\n` +
271
+ `Please start Docker manually:\n` +
272
+ ` • On macOS/Windows: Start Docker Desktop\n` +
273
+ ` • On WSL: Start Docker Desktop in Windows and enable WSL integration\n` +
274
+ ` • On Linux (Docker Desktop): Run "docker desktop start" or "systemctl --user start docker-desktop"\n` +
275
+ ` • On Linux (Docker Engine): Run "sudo systemctl start docker" or "sudo service docker start"\n\n` +
276
+ `Then try running ${commandName} again.`);
277
+ }
278
+ // Docker started successfully
279
+ console.log(`✅ Docker started successfully!`);
280
+ }
281
+ //# sourceMappingURL=dockerManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dockerManager.js","sourceRoot":"","sources":["../../src/utils/dockerManager.ts"],"names":[],"mappings":";;AAmLA,0CAEC;AAQD,wCAiFC;AAuED,sDA0BC;AA/WD,iDAAyC;AAEzC,MAAM,8BAA8B,GAAG,sCAAsC,CAAC;AAC9E,MAAM,kCAAkC,GAAG,0CAA0C,CAAC;AACtF,MAAM,qCAAqC,GAAG,MAAM,CAAC;AACrD,MAAM,yCAAyC,GAAG,OAAO,CAAC;AAC1D,MAAM,qBAAqB,GAAG,KAAK,CAAC;AACpC,MAAM,6BAA6B,GAAG,KAAK,CAAC;AAC5C,MAAM,uCAAuC,GAAG,KAAK,CAAC;AACtD,MAAM,sCAAsC,GAAG,KAAK,CAAC;AACrD,MAAM,oBAAoB,GAAG,WAAW,CAAC;AAwBzC,MAAM,qBAAsB,SAAQ,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AqE;QACrE,CAAC,gBAAgB,CAAC,CAAC,CAAC,uBAAuB,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CACtE,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,qBAAqB,CAAC,cAAsB,cAAc;IAC9E,6BAA6B;IAC7B,IAAI,eAAe,EAAE,EAAE,CAAC;QACtB,OAAO,CAAC,4BAA4B;IACtC,CAAC;IAED,6CAA6C;IAC7C,OAAO,CAAC,GAAG,CAAC,yDAAyD,CAAC,CAAC;IAEvE,MAAM,aAAa,GAAG,MAAM,cAAc,EAAE,CAAC;IAE7C,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,uCAAuC;QACvC,MAAM,IAAI,KAAK,CACb,mEAAmE;YACjE,iCAAiC;YACjC,8CAA8C;YAC9C,0EAA0E;YAC1E,wGAAwG;YACxG,oGAAoG;YACpG,oBAAoB,WAAW,SAAS,CAC3C,CAAC;IACJ,CAAC;IAED,8BAA8B;IAC9B,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;AAChD,CAAC"}
@@ -0,0 +1,26 @@
1
+ export interface DataSourceConfig {
2
+ connectTimeout?: number;
3
+ database?: string;
4
+ host?: string;
5
+ logging?: boolean;
6
+ managed?: boolean;
7
+ name: string;
8
+ password?: string;
9
+ port?: number;
10
+ synchronize?: boolean;
11
+ type: 'mysql' | 'postgres' | 'sqlite';
12
+ username?: string;
13
+ }
14
+ /**
15
+ * Extracts a datasource configuration from the text content of a TypeScript
16
+ * datasource file. Supports the `=` assignment style used in class-based
17
+ * injected datasources:
18
+ *
19
+ * override port?: number | undefined = 5433;
20
+ * override type = 'postgres' as const;
21
+ * override host = process.env.DB_HOST || 'localhost';
22
+ *
23
+ * Returns null when no recognised database type is found.
24
+ */
25
+ export declare function parseDataSourceFile(fileContent: string, name: string): DataSourceConfig | null;
26
+ //# sourceMappingURL=infraFileParser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"infraFileParser.d.ts","sourceRoot":"","sources":["../../src/utils/infraFileParser.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,EAAE,OAAO,GAAG,UAAU,GAAG,QAAQ,CAAC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CA+D9F"}
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseDataSourceFile = parseDataSourceFile;
4
+ /**
5
+ * Extracts a datasource configuration from the text content of a TypeScript
6
+ * datasource file. Supports the `=` assignment style used in class-based
7
+ * injected datasources:
8
+ *
9
+ * override port?: number | undefined = 5433;
10
+ * override type = 'postgres' as const;
11
+ * override host = process.env.DB_HOST || 'localhost';
12
+ *
13
+ * Returns null when no recognised database type is found.
14
+ */
15
+ function parseDataSourceFile(fileContent, name) {
16
+ // Match: <field-name> <optional type annotation> = <value> <;>
17
+ const extractRaw = (key) => {
18
+ const re = new RegExp('\\b' + key + '\\b[^=\\n]*=\\s*([^;\\n]+)', 'i');
19
+ const m = fileContent.match(re);
20
+ return m ? m[1].trim() : null;
21
+ };
22
+ const interpret = (raw) => {
23
+ if (!raw) {
24
+ return undefined;
25
+ }
26
+ raw = raw.replace(/,$/, '').trim();
27
+ // Strip TypeScript `as const` suffix
28
+ raw = raw.replace(/\s+as\s+\w+$/, '').trim();
29
+ if (/^(true|false)$/i.test(raw)) {
30
+ return raw.toLowerCase() === 'true';
31
+ }
32
+ let m = raw.match(/parseInt\([^|?]+(?:\|\||[?]{2})\s*['"]([^'"]+)['"][^)]*\)/i);
33
+ if (m) {
34
+ return Number.parseInt(m[1], 10);
35
+ }
36
+ m = raw.match(/process\.env\.[A-Z0-9_]+\s*(?:\|\||[?]{2})\s*['"]([^'"]+)['"]/i);
37
+ if (m) {
38
+ return m[1];
39
+ }
40
+ m = raw.match(/^['"]([^'"]+)['"]$/);
41
+ if (m) {
42
+ return m[1];
43
+ }
44
+ m = raw.match(/^(\d+)$/);
45
+ if (m) {
46
+ return Number.parseInt(m[1], 10);
47
+ }
48
+ return raw;
49
+ };
50
+ const typeRaw = extractRaw('type');
51
+ if (!typeRaw) {
52
+ return null;
53
+ }
54
+ let typeVal = (typeRaw.match(/['"]([^'"]+)['"]/i) || [null, typeRaw])[1].toLowerCase();
55
+ if (typeVal === 'postgresql') {
56
+ typeVal = 'postgres';
57
+ }
58
+ if (!['mysql', 'postgres', 'sqlite'].includes(typeVal)) {
59
+ return null;
60
+ }
61
+ return {
62
+ connectTimeout: interpret(extractRaw('connectTimeout')) ?? undefined,
63
+ database: interpret(extractRaw('database')) ?? 'slingr',
64
+ host: interpret(extractRaw('host')) ?? undefined,
65
+ logging: interpret(extractRaw('logging')) ?? undefined,
66
+ managed: interpret(extractRaw('managed')) ?? undefined,
67
+ name,
68
+ password: interpret(extractRaw('password')) ?? (typeVal === 'mysql' ? 'root' : 'postgres'),
69
+ port: interpret(extractRaw('port')) ?? (typeVal === 'mysql' ? 3306 : 5432),
70
+ synchronize: interpret(extractRaw('synchronize')) ?? undefined,
71
+ type: typeVal,
72
+ username: interpret(extractRaw('username')) ?? (typeVal === 'mysql' ? 'root' : 'postgres'),
73
+ };
74
+ }
75
+ //# sourceMappingURL=infraFileParser.js.map
@@ -0,0 +1 @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AAI,SAAS;QACtD,OAAO,EAAE,SAAS,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,IAAI,SAAS;QACtD,IAAI;QACJ,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC;QAC1F,IAAI,EAAE,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;QAC1E,WAAW,EAAE,SAAS,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,IAAI,SAAS;QAC9D,IAAI,EAAE,OAAmC;QACzC,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC;KAC3F,CAAC;AACJ,CAAC"}
@@ -1,9 +1,9 @@
1
- import { BaseModel, TypeOrmSqlDataSource } from 'slingr-framework';
1
+ import { BaseDataModel, TypeOrmSqlDataSource } from '@slingr/framework-backend';
2
2
  import 'reflect-metadata';
3
3
  /**
4
- * Interface for model constructors that extend BaseModel
4
+ * Interface for model constructors that extend BaseDataModel
5
5
  */
6
- export interface ModelConstructor<T extends BaseModel> {
6
+ export interface ModelConstructor<T extends BaseDataModel> {
7
7
  new (): T;
8
8
  fromJSON(data: any): T;
9
9
  prototype: T;
@@ -20,18 +20,35 @@ export interface DatasetLoadOptions {
20
20
  * Map of model name to model constructor
21
21
  * Key: filename without .jsonl extension
22
22
  * Value: Model constructor class
23
+ * This should contain ALL models in the application, not just those being loaded from JSONL.
23
24
  */
24
25
  modelMap: Record<string, ModelConstructor<any>>;
25
26
  /**
26
27
  * Whether to validate each record after loading from JSON
27
28
  * @default true
28
29
  */
29
- validateRecords?: boolean;
30
+ validateRecords?: boolean | undefined;
30
31
  /**
31
32
  * Whether to log detailed information during loading
32
33
  * @default false
33
34
  */
34
- verbose?: boolean;
35
+ verbose?: boolean | undefined;
36
+ /**
37
+ * When provided, only JSONL files whose base name (without .jsonl) is in this list will be loaded.
38
+ * Takes priority over excludeModels.
39
+ */
40
+ includeModels?: string[] | undefined;
41
+ /**
42
+ * When provided, JSONL files whose base name (without .jsonl) is in this list will be skipped.
43
+ * Ignored when includeModels is provided.
44
+ */
45
+ excludeModels?: string[] | undefined;
46
+ /**
47
+ * Optional dataSource to use for loading missing references from database before validation.
48
+ * When provided, array references not found in loadedEntities will be loaded from the database.
49
+ * This is useful when referenced entities were loaded in a previous session.
50
+ */
51
+ dataSource?: TypeOrmSqlDataSource | undefined;
35
52
  }
36
53
  /**
37
54
  * Interface for model dependency information
@@ -51,7 +68,7 @@ export interface DependencyAnalysisResult {
51
68
  /**
52
69
  * Result of loading a dataset
53
70
  */
54
- export interface DatasetLoadResult<T extends BaseModel = BaseModel> {
71
+ export interface DatasetLoadResult<T extends BaseDataModel = BaseDataModel> {
55
72
  /**
56
73
  * Name of the model/file that was loaded
57
74
  */
@@ -76,19 +93,41 @@ export interface DatasetLoadResult<T extends BaseModel = BaseModel> {
76
93
  recordData: any;
77
94
  validationErrors: any[];
78
95
  }>;
96
+ /**
97
+ * Number of records successfully saved to database
98
+ */
99
+ saveSuccessCount: number;
100
+ /**
101
+ * Number of records that failed to save to database
102
+ */
103
+ saveErrorCount: number;
104
+ /**
105
+ * Array of save errors if any
106
+ */
107
+ saveErrors: Array<{
108
+ recordIndex: number;
109
+ record: T;
110
+ error: string;
111
+ }>;
79
112
  }
80
113
  /**
81
114
  * Utility class for loading datasets from JSONL files using Slingr model fromJSON() functionality
82
115
  */
83
116
  export declare class JsonlDatasetLoader {
117
+ /** Per-run cache to avoid repeated DB lookups for the same referenced record. */
118
+ private dbLookupCache;
84
119
  /**
85
120
  * Analyze model dependencies to determine the correct loading order
86
121
  */
87
- analyzeDependencies(modelMap: Record<string, ModelConstructor<any>>, verbose?: boolean): DependencyAnalysisResult;
122
+ analyzeDependencies(modelMap: Record<string, ModelConstructor<any>>, verbose?: boolean, availableModels?: Set<string>): DependencyAnalysisResult;
88
123
  /**
89
124
  * Extract dependencies from a model class by analyzing its decorators/metadata
90
125
  */
91
126
  private extractModelDependencies;
127
+ /**
128
+ * Get the referenced model name from field metadata
129
+ */
130
+ private getReferencedModelName;
92
131
  /**
93
132
  * Perform topological sort to determine loading order
94
133
  */
@@ -101,19 +140,59 @@ export declare class JsonlDatasetLoader {
101
140
  * Load a single JSONL file and convert records using the model's fromJSON method
102
141
  */
103
142
  /**
104
- * Resolves simple references in format {"id": "uuid"} to full objects from loaded entities
143
+ * Resolves simple references in format {"id": "uuid"} to full objects from loaded entities.
144
+ * Only resolves compositions and sharedCompositions, NOT regular references (to avoid circular dependencies).
145
+ * Also handles arrays of compositions.
146
+ */
147
+ resolveSimpleReferences<T extends BaseDataModel>(data: any, ModelClass: ModelConstructor<T>, loadedEntities: Record<string, Record<string, any>>, verbose?: boolean): Promise<any>;
148
+ /**
149
+ * Fetches a referenced entity from the database, using an in-memory cache keyed by
150
+ * `ClassName:id` to eliminate redundant queries for the same record within a load run.
151
+ *
152
+ * When the entity is not found (or an error occurs), returns a minimal object
153
+ * `{ id: referenceId }` so that TypeORM can still extract the FK on save.
105
154
  */
106
- resolveSimpleReferences<T extends BaseModel>(data: any, ModelClass: ModelConstructor<T>, loadedEntities: Record<string, Record<string, any>>, verbose?: boolean): Promise<any>;
107
- loadJsonlFile<T extends BaseModel>(filePath: string, ModelClass: ModelConstructor<T>, modelName: string, loadedEntities: Record<string, Record<string, any>>, validateRecords?: boolean, verbose?: boolean): Promise<DatasetLoadResult<T>>;
155
+ private fetchReferenceFromDb;
156
+ /**
157
+ * Resolves unresolved references from the database before saving.
158
+ * This handles references that couldn't be resolved from loadedEntities (excluded models).
159
+ * For single references, sets the FK column directly for efficiency.
160
+ * For array references, loads entities from DB to populate the relationship.
161
+ */
162
+ private resolveUnresolvedReferencesFromDb;
163
+ /**
164
+ * Resolves string UUID reference fields on a model instance to their loaded BaseDataModel entities.
165
+ *
166
+ * During dataset loading, reference fields are stored as plain UUID strings in JSONL files.
167
+ * After fromJSON(), these remain as strings. However, filter validation (ValidateRelationshipFilter)
168
+ * requires actual BaseDataModel instances to properly evaluate filter criteria like:
169
+ * filter: (company) => ({ state: company.state })
170
+ *
171
+ * Without this resolution, company.state would be a plain string, and the filter validator
172
+ * wouldn't be able to check if the county's state matches. This mirrors what
173
+ * preprocessReferenceFields does in the GraphQL/UI path (fetching from DB), but uses
174
+ * already-loaded entities from the dataset instead.
175
+ *
176
+ * When dataSource is provided, missing array references will be loaded from the database.
177
+ * This is necessary for validation when referenced entities were loaded in a previous session.
178
+ *
179
+ * @param modelMap Full map of all model classes (not filtered) - needed to look up referenced model classes
180
+ */
181
+ private resolveReferenceFieldsToEntities;
182
+ loadJsonlFile<T extends BaseDataModel>(filePath: string, ModelClass: ModelConstructor<T>, modelName: string, loadedEntities: Record<string, Record<string, any>>, validateRecords?: boolean, verbose?: boolean, dataSource?: TypeOrmSqlDataSource, modelMap?: Record<string, ModelConstructor<any>>): Promise<DatasetLoadResult<T>>;
108
183
  /**
109
184
  * Convert loaded model instances to database-friendly format
110
185
  * This method respects the model's field availability settings and converts camelCase to snake_case
111
186
  */
112
- convertToDbFormat<T extends BaseModel>(records: T[], verbose?: boolean): any[];
187
+ convertToDbFormat<T extends BaseDataModel>(records: T[], verbose?: boolean): any[];
113
188
  /**
114
189
  * Convert camelCase string to snake_case
115
190
  */
116
191
  private camelToSnakeCase;
192
+ /**
193
+ * Recursively format validation error constraints for display
194
+ */
195
+ private formatValidationConstraints;
117
196
  /**
118
197
  * Load dataset into database using TypeORM with dynamic table creation
119
198
  * This method creates tables dynamically and uses TypeORM for data insertion
@@ -136,5 +215,5 @@ export declare class JsonlDatasetLoader {
136
215
  /**
137
216
  * Auto-discover models from the compiled JavaScript files
138
217
  */
139
- export declare function discoverModels(distPath: string): Promise<Record<string, ModelConstructor<any>>>;
218
+ export declare function discoverModels(distPath: string, verbose?: boolean): Promise<Record<string, ModelConstructor<any>>>;
140
219
  //# sourceMappingURL=jsonlLoader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"jsonlLoader.d.ts","sourceRoot":"","sources":["../../src/utils/jsonlLoader.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,kBAAkB,CAAC;AAE1B;;GAEG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,SAAS;IACnD,QAAQ,CAAC,CAAC;IACV,QAAQ,CAAC,IAAI,EAAE,GAAG,GAAG,CAAC,CAAC;IACvB,SAAS,EAAE,CAAC,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC;IAEhD;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAC9C,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS;IAChE;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,OAAO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