@golemio/core 3.0.7 → 3.1.0-dev.2514160696

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 (51) hide show
  1. package/.dependency-cruiser.base.js +289 -0
  2. package/bin/format-dependency-cruiser-report.js +94 -0
  3. package/dist/helpers/data-access/postgres/IDatabaseConnector.d.ts +1 -1
  4. package/dist/helpers/routing/AbstractGeoJsonRouter.js.map +1 -1
  5. package/dist/input-gateway/helpers/ResponseTimeMiddleware.js +4 -3
  6. package/dist/input-gateway/helpers/ResponseTimeMiddleware.js.map +1 -1
  7. package/dist/integration-engine/connectors/interfaces/IPostgresConnector.d.ts +1 -1
  8. package/dist/integration-engine/data-access/RawDataStorage.d.ts +2 -2
  9. package/dist/integration-engine/data-access/RawDataStorage.js +2 -2
  10. package/dist/integration-engine/data-access/RawDataStorage.js.map +1 -1
  11. package/dist/integration-engine/datasources/BatchWritable.d.ts +16 -0
  12. package/dist/integration-engine/datasources/BatchWritable.js +42 -0
  13. package/dist/integration-engine/datasources/BatchWritable.js.map +1 -0
  14. package/dist/integration-engine/datasources/DataSourceStreamedPipeline.d.ts +25 -0
  15. package/dist/integration-engine/datasources/DataSourceStreamedPipeline.js +72 -0
  16. package/dist/integration-engine/datasources/DataSourceStreamedPipeline.js.map +1 -0
  17. package/dist/integration-engine/datasources/datatype-strategy/JSONStreamTransformer.d.ts +5 -0
  18. package/dist/integration-engine/datasources/datatype-strategy/JSONStreamTransformer.js +12 -0
  19. package/dist/integration-engine/datasources/datatype-strategy/JSONStreamTransformer.js.map +1 -0
  20. package/dist/integration-engine/datasources/index.d.ts +5 -0
  21. package/dist/integration-engine/datasources/index.js +5 -0
  22. package/dist/integration-engine/datasources/index.js.map +1 -1
  23. package/dist/integration-engine/datasources/protocol-strategy/HTTPRequestProtocolStrategyStreamed.d.ts +5 -1
  24. package/dist/integration-engine/datasources/protocol-strategy/HTTPRequestProtocolStrategyStreamed.js +30 -1
  25. package/dist/integration-engine/datasources/protocol-strategy/HTTPRequestProtocolStrategyStreamed.js.map +1 -1
  26. package/dist/integration-engine/datasources/protocol-strategy/IStreamingProtocolStrategy.d.ts +5 -0
  27. package/dist/{output-gateway/routes/interfaces/IHistoryFilterParameters.js → integration-engine/datasources/protocol-strategy/IStreamingProtocolStrategy.js} +1 -1
  28. package/dist/integration-engine/datasources/protocol-strategy/IStreamingProtocolStrategy.js.map +1 -0
  29. package/dist/integration-engine/datasources/protocol-strategy/ProtocolStrategy.d.ts +3 -0
  30. package/dist/integration-engine/datasources/protocol-strategy/ProtocolStrategy.js +42 -3
  31. package/dist/integration-engine/datasources/protocol-strategy/ProtocolStrategy.js.map +1 -1
  32. package/dist/integration-engine/helpers/IntegrationErrorHandler.js +5 -5
  33. package/dist/integration-engine/helpers/IntegrationErrorHandler.js.map +1 -1
  34. package/dist/integration-engine/models/PostgresModel.d.ts +1 -1
  35. package/dist/integration-engine/models/RedisModel.d.ts +1 -1
  36. package/dist/integration-engine/models/RedisModel.js +6 -6
  37. package/dist/integration-engine/models/RedisModel.js.map +1 -1
  38. package/dist/integration-engine/queueprocessors/QueueProcessor.d.ts +1 -1
  39. package/dist/integration-engine/queueprocessors/abstract.d.ts +1 -1
  40. package/dist/integration-engine/transformations/BaseTransformation.d.ts +1 -1
  41. package/dist/integration-engine/workers/AbstractWorker.d.ts +1 -1
  42. package/dist/monitoring/metrics/metrics-middleware.d.ts +1 -1
  43. package/dist/monitoring/metrics/metrics-service.d.ts +1 -1
  44. package/dist/output-gateway/models/SequelizeModel.d.ts +1 -1
  45. package/dist/output-gateway/models/SequelizeModel.js +2 -2
  46. package/dist/output-gateway/models/SequelizeModel.js.map +1 -1
  47. package/dist/output-gateway/models/interfaces/IGeoJsonModel.d.ts +1 -1
  48. package/dist/output-gateway/routes/GeoJsonRouter.js.map +1 -1
  49. package/package.json +19 -9
  50. package/dist/output-gateway/routes/interfaces/IHistoryFilterParameters.d.ts +0 -7
  51. package/dist/output-gateway/routes/interfaces/IHistoryFilterParameters.js.map +0 -1
@@ -0,0 +1,289 @@
1
+ /** @type {import('dependency-cruiser').IConfiguration} */
2
+ module.exports = {
3
+ forbidden: [
4
+ {
5
+ name: "no-circular",
6
+ severity: "error",
7
+ comment:
8
+ "This dependency is part of a circular relationship. You might want to revise " +
9
+ "your solution (i.e. use dependency inversion, make sure the modules have a single " +
10
+ "responsibility) ",
11
+ from: {},
12
+ to: {
13
+ circular: true,
14
+ viaOnly: {
15
+ pathNot: ["^src/.*?/ioc/Di\\.ts$"],
16
+ },
17
+ },
18
+ },
19
+ {
20
+ name: "no-orphans",
21
+ comment:
22
+ "This is an orphan module - it's likely not used (anymore?). Either use it or " +
23
+ "remove it. If it's logical this module is an orphan (i.e. it's a config file), " +
24
+ "add an exception for it in your dependency-cruiser configuration. By default " +
25
+ "this rule does not scrutinize dot-files (e.g. .eslintrc.js), TypeScript declaration " +
26
+ "files (.d.ts), tsconfig.json and some of the babel and webpack configs.",
27
+ severity: "error",
28
+ from: {
29
+ orphan: true,
30
+ pathNot: [
31
+ "(^|/)[.][^/]+[.](?:js|cjs|mjs|ts|cts|mts|json)$", // dot files
32
+ "[.]d[.]ts$", // TypeScript declaration files
33
+ "(^|/)tsconfig[.]json$", // TypeScript config
34
+ "(^|/)(?:babel|webpack)[.]config[.](?:js|cjs|mjs|ts|cts|mts|json)$", // other configs
35
+ ],
36
+ },
37
+ to: {},
38
+ },
39
+ {
40
+ name: "no-deprecated-core",
41
+ comment:
42
+ "A module depends on a node core module that has been deprecated. Find an alternative - " +
43
+ "these are bound to exist - node doesn't deprecate lightly.",
44
+ severity: "warn",
45
+ from: {},
46
+ to: {
47
+ dependencyTypes: ["core"],
48
+ path: [
49
+ "^v8/tools/codemap$",
50
+ "^v8/tools/consarray$",
51
+ "^v8/tools/csvparser$",
52
+ "^v8/tools/logreader$",
53
+ "^v8/tools/profile_view$",
54
+ "^v8/tools/profile$",
55
+ "^v8/tools/SourceMap$",
56
+ "^v8/tools/splaytree$",
57
+ "^v8/tools/tickprocessor-driver$",
58
+ "^v8/tools/tickprocessor$",
59
+ "^node-inspect/lib/_inspect$",
60
+ "^node-inspect/lib/internal/inspect_client$",
61
+ "^node-inspect/lib/internal/inspect_repl$",
62
+ "^async_hooks$",
63
+ "^punycode$",
64
+ "^domain$",
65
+ "^constants$",
66
+ "^sys$",
67
+ "^_linklist$",
68
+ "^_stream_wrap$",
69
+ ],
70
+ },
71
+ },
72
+ {
73
+ name: "not-to-deprecated",
74
+ comment:
75
+ "This module uses a (version of an) npm module that has been deprecated. Either upgrade to " +
76
+ "a later version of that module, or find an alternative. Deprecated modules are a security " +
77
+ "risk.",
78
+ severity: "warn",
79
+ from: {},
80
+ to: {
81
+ dependencyTypes: ["deprecated"],
82
+ },
83
+ },
84
+ {
85
+ name: "no-non-package-json",
86
+ severity: "error",
87
+ comment:
88
+ "This module depends on an npm package that isn't in the 'dependencies' section of your " +
89
+ "package.json. That's problematic as the package either (1) won't be available on live (2 " +
90
+ "- worse) will be available on live with an non-guaranteed version. Fix it by adding the " +
91
+ "package to the dependencies in your package.json.",
92
+ from: {},
93
+ to: {
94
+ dependencyTypes: ["npm-no-pkg", "npm-unknown"],
95
+ },
96
+ },
97
+ {
98
+ name: "not-to-unresolvable",
99
+ comment:
100
+ "This module depends on a module that cannot be found ('resolved to disk'). If it's an npm " +
101
+ "module: add it to your package.json. In all other cases you likely already know what to do.",
102
+ severity: "error",
103
+ from: {},
104
+ to: {
105
+ couldNotResolve: true,
106
+ },
107
+ },
108
+ {
109
+ name: "no-duplicate-dep-types",
110
+ comment:
111
+ "Likely this module depends on an external ('npm') package that occurs more than once " +
112
+ "in your package.json i.e. bot as a devDependencies and in dependencies. This will cause " +
113
+ "maintenance problems later on.",
114
+ severity: "error",
115
+ from: {},
116
+ to: {
117
+ moreThanOneDependencyType: true,
118
+ dependencyTypesNot: ["type-only", "npm-peer"],
119
+ },
120
+ },
121
+ {
122
+ name: "not-to-test-dir",
123
+ comment:
124
+ "This module depends on code within a folder that should only contain tests. As tests " +
125
+ "don't implement functionality this is odd. Either you're writing a test outside the test " +
126
+ "folder or there's something in the test folder that isn't a test.",
127
+ severity: "error",
128
+ from: {
129
+ pathNot: "^(test)",
130
+ },
131
+ to: {
132
+ path: "^(test)",
133
+ },
134
+ },
135
+ {
136
+ name: "not-to-test-file",
137
+ comment:
138
+ "This module depends on a spec (test) file. The sole responsibility of a spec file is to " +
139
+ "test code. If there's something in a spec that's of use to other modules, it doesn't have " +
140
+ "that single responsibility anymore. Factor it out into (e.g.) a separate utility/ helper " +
141
+ "or a mock.",
142
+ severity: "error",
143
+ from: {},
144
+ to: {
145
+ path: "[.](?:spec|test)[.](?:js|mjs|cjs|jsx|ts|mts|cts|tsx)$",
146
+ },
147
+ },
148
+ {
149
+ name: "not-to-dev-dep",
150
+ severity: "error",
151
+ comment:
152
+ "This module depends on an npm package from the 'devDependencies' section of your " +
153
+ "package.json. It looks like something that ships to production, though. To prevent " +
154
+ "problems with npm packages that aren't there on production declare it (only!) in the " +
155
+ "'dependencies' section of your package.json. If this module is development only - add it " +
156
+ "to the from.pathNot re of the not-to-dev-dep rule in the dependency-cruiser configuration",
157
+ from: {
158
+ path: "^(src)",
159
+ pathNot: "[.](?:spec|test)[.](?:js|mjs|cjs|jsx|ts|mts|cts|tsx)$",
160
+ },
161
+ to: {
162
+ dependencyTypes: ["npm-dev"],
163
+ dependencyTypesNot: ["type-only", "npm-peer"],
164
+ pathNot: ["node_modules/@types/"],
165
+ },
166
+ },
167
+ {
168
+ name: "optional-deps-used",
169
+ severity: "error",
170
+ comment:
171
+ "This module depends on an npm package that is declared as an optional dependency " +
172
+ "in your package.json. As this makes sense in limited situations only, it's flagged here. " +
173
+ "If you're using an optional dependency here by design - add an exception to your " +
174
+ "dependency-cruiser configuration.",
175
+ from: {},
176
+ to: {
177
+ dependencyTypes: ["npm-optional"],
178
+ },
179
+ },
180
+ {
181
+ name: "peer-deps-used",
182
+ comment:
183
+ "This module depends on an npm package that is declared as a peer dependency " +
184
+ "in your package.json. This makes sense if your package is e.g. a plugin, but in " +
185
+ "other cases - maybe not so much. If the use of a peer dependency is intentional " +
186
+ "add an exception to your dependency-cruiser configuration.",
187
+ severity: "error",
188
+ from: {},
189
+ to: {
190
+ dependencyTypes: ["npm-peer"],
191
+ pathNot: ["node_modules/@golemio/core/"],
192
+ },
193
+ },
194
+ {
195
+ name: "no-crossing-input-gateway-boundary",
196
+ severity: "error",
197
+ comment: "`src/input-gateway` should not import from other service directories",
198
+ from: { path: "^src/input-gateway" },
199
+ to: {
200
+ path: ["^src/integration-engine", "^src/output-gateway"],
201
+ },
202
+ },
203
+ {
204
+ name: "no-crossing-integration-engine-boundary",
205
+ severity: "error",
206
+ comment: "`src/integration-engine` should not import from other service directories",
207
+ from: { path: "^src/integration-engine" },
208
+ to: {
209
+ path: ["^src/input-gateway", "^src/output-gateway"],
210
+ },
211
+ },
212
+ {
213
+ name: "no-crossing-output-gateway-boundary",
214
+ severity: "error",
215
+ comment: "`src/output-gateway` should not import from other service directories",
216
+ from: { path: "^src/output-gateway" },
217
+ to: {
218
+ path: ["^src/input-gateway", "^src/integration-engine"],
219
+ },
220
+ },
221
+ {
222
+ name: "no-crossing-service-boundary",
223
+ severity: "error",
224
+ comment: "Non-service directories (e.g. `src/helpers`) should not import from service directories",
225
+ from: {
226
+ path: "^src",
227
+ pathNot: [
228
+ "^src/index.ts$",
229
+ "^src/(?:input-gateway|integration-engine|output-gateway)",
230
+ ],
231
+ },
232
+ to: {
233
+ path: ["^src/input-gateway", "^src/integration-engine", "^src/output-gateway"],
234
+ },
235
+ },
236
+ {
237
+ name: "no-MIT-license-incompatible",
238
+ comment:
239
+ "Do not use dependencies with a license that is incompatible with the permissive FOSS MIT " +
240
+ "license (e.g. strong copyleft licenses such as the GPL)",
241
+ severity: "error",
242
+ from: {},
243
+ to: {
244
+ licenseNot: [
245
+ "MIT",
246
+ "Apache-2.0",
247
+ "ISC",
248
+ "BSD-3-Clause",
249
+ "BSD-2-Clause",
250
+ "LGPL-3.0",
251
+ "LGPL-2.1",
252
+ "MPL-2.0",
253
+ "EPL-2.0",
254
+ "EPL-1.0",
255
+ "Unlicense",
256
+ "CC0-1.0",
257
+ "WTFPL",
258
+ ],
259
+ },
260
+ },
261
+ ],
262
+ options: {
263
+ doNotFollow: {
264
+ path: ["node_modules"],
265
+ },
266
+ tsPreCompilationDeps: true,
267
+ tsConfig: {
268
+ fileName: "tsconfig.json",
269
+ },
270
+ enhancedResolveOptions: {
271
+ exportsFields: ["exports"],
272
+ conditionNames: ["import", "require", "node", "default", "types"],
273
+ mainFields: ["main", "types", "typings"],
274
+ },
275
+ skipAnalysisNotInRules: true,
276
+ reporterOptions: {
277
+ dot: {
278
+ collapsePattern: "node_modules/(?:@[^/]+/[^/]+|[^/]+)",
279
+ },
280
+ archi: {
281
+ collapsePattern:
282
+ "^(?:packages|src|lib(s?)|app(s?)|bin|test(s?)|spec(s?))/[^/]+|node_modules/(?:@[^/]+/[^/]+|[^/]+)",
283
+ },
284
+ text: {
285
+ highlightFocused: true,
286
+ },
287
+ },
288
+ },
289
+ };
@@ -0,0 +1,94 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require("fs");
4
+
5
+ if (process.argv.length < 3) {
6
+ console.error("Usage: node format-dependency-cruiser-report.js <report.json>");
7
+ process.exit(1);
8
+ }
9
+
10
+ const filePath = process.argv[2];
11
+ const report = JSON.parse(fs.readFileSync(filePath, "utf8"));
12
+
13
+ const summaryViolations = Array.isArray(report?.summary?.violations) ? report.summary.violations : [];
14
+
15
+ const sv = summaryViolations.map((v) => ({
16
+ ...v,
17
+ ruleName: v?.rule?.name ?? String(v?.rule ?? ""),
18
+ severity: v?.rule?.severity ?? v?.severity,
19
+ }));
20
+
21
+ const BOUNDARY_RULES = ["input-gateway-boundary", "integration-engine-boundary", "output-gateway-boundary", "test-boundary"];
22
+
23
+ const boundaryViolations = sv.filter((v) => BOUNDARY_RULES.includes(v.ruleName));
24
+ const mitViolations = sv.filter((v) => v.ruleName === "MIT-license-compatible");
25
+
26
+ const cycleViolations = sv.filter((v) => v.type === "cycle" || v.ruleName === "no-circular");
27
+
28
+ const orphans = (report.modules || []).filter((m) => m.orphan && !m.valid);
29
+
30
+ function renderTable(headers, rows) {
31
+ if (rows.length === 0) return "";
32
+ const headerLine = `| ${headers.join(" | ")} |`;
33
+ const separator = `| ${headers.map(() => "---").join(" | ")} |`;
34
+ const body = rows.map((row) => `| ${row.map((cell) => String(cell)).join(" | ")} |`).join("\n");
35
+ return `${headerLine}\n${separator}\n${body}\n`;
36
+ }
37
+
38
+ function renderBoundaryViolations() {
39
+ if (boundaryViolations.length === 0) return "";
40
+ let out = "## 🧭 Code Boundaries Summary\n\n";
41
+ for (const rule of BOUNDARY_RULES) {
42
+ const list = boundaryViolations.filter((v) => v.ruleName === rule);
43
+ if (list.length > 0) {
44
+ out += `### ${rule}\n`;
45
+ out += renderTable(
46
+ ["Severity", "From", "To"],
47
+ list.map((v) => [v.severity ?? "", v.from ?? "", v.to ?? ""])
48
+ );
49
+ out += "\n";
50
+ }
51
+ }
52
+ return out;
53
+ }
54
+
55
+ function renderMitViolations() {
56
+ if (mitViolations.length === 0) return "";
57
+ let out = "## ⚖️ MIT License Violations\n\n";
58
+ out += renderTable(
59
+ ["Severity", "From", "To"],
60
+ mitViolations.map((v) => [v.severity ?? "", v.from ?? "", v.to ?? ""])
61
+ );
62
+ return out;
63
+ }
64
+
65
+ function renderCycleViolations() {
66
+ if (cycleViolations.length === 0) return "";
67
+ let out = "## ♻️ Cyclical Dependencies (no-circular)\n\n";
68
+ const rows = cycleViolations.map((v) => {
69
+ const nodes = Array.isArray(v.cycle) ? v.cycle.map((n) => n?.name).filter(Boolean) : [];
70
+ // Make a cycle path like "A → B → C → A" if nodes present
71
+ const path = nodes.length > 0 ? `${nodes.join(" → ")} → ${nodes[0]}` : "";
72
+ return [v.severity ?? "", v.from ?? "", v.to ?? "", path];
73
+ });
74
+
75
+ out += renderTable(["Severity", "From", "To", "Cycle Path"], rows);
76
+ return out;
77
+ }
78
+
79
+ function renderOrphans() {
80
+ if (orphans.length === 0) return "";
81
+ let out = "## 🧩 Orphan Modules\n\n";
82
+ out += renderTable(
83
+ ["Source"],
84
+ orphans.map((o) => [o.source ?? ""])
85
+ );
86
+ return out;
87
+ }
88
+
89
+ const sections = [renderBoundaryViolations(), renderMitViolations(), renderCycleViolations(), renderOrphans()].filter(Boolean);
90
+
91
+ let output = "# 📊 Dependency Report\n\n";
92
+ output += sections.length > 0 ? sections.join("") : "✅ no dependency violations found";
93
+
94
+ console.log(output);
@@ -1,4 +1,4 @@
1
- import { Options, Sequelize } from "sequelize/types";
1
+ import { Options, Sequelize } from "sequelize";
2
2
  export interface IDatabaseConnector {
3
3
  connect(additionalOptions?: Options): Promise<Sequelize>;
4
4
  getConnection(): Sequelize;
@@ -1 +1 @@
1
- {"version":3,"file":"AbstractGeoJsonRouter.js","sourceRoot":"","sources":["../../../src/helpers/routing/AbstractGeoJsonRouter.ts"],"names":[],"mappings":";;;AAAA,qDAAiE;AAGjE,kDAA2C;AAC3C,4EAAwD;AACxD,oDAAoD;AACpD,wDAAiC;AAGjC,gEAAwE;AAExE,yDAA+E;AAE/E,4CAA+C;AAE/C;;;;;;GAMG;AACH,MAAsB,qBAAsB,SAAQ,+BAAc;IAwB9D,YAAsB,OAAe,EAAE,IAAY,EAAE,OAAsB;QACvE,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QArBf,mBAAc,GAAG;YACvB,IAAA,yBAAK,EAAC,cAAc,CAAC,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE;YAC5D,IAAA,yBAAK,EAAC,WAAW,CAAC,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC;YACxE,IAAA,yBAAK,EAAC,KAAK,CAAC;iBACP,QAAQ,EAAE;iBACV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 = require("./");
4
+ const LoggerEmitter_1 = require("../../helpers/logger/LoggerEmitter");
5
+ const Logger_1 = require("./Logger");
5
6
  /**
6
7
  * Middleware function for response time measurement
7
8
  */
@@ -10,7 +11,7 @@ let responseTimeMiddleware = (fn) => {
10
11
  if (fn.length === 2) {
11
12
  return function (req, res) {
12
13
  const start = Date.now();
13
- res.once("finish", () => helpers_1.loggerEvents.emit(helpers_1.LoggerEventType.ResponseTimes, {
14
+ res.once("finish", () => Logger_1.loggerEvents.emit(LoggerEmitter_1.LoggerEventType.ResponseTimes, {
14
15
  elapsedMS: Date.now() - start,
15
16
  name: fn.name || "route",
16
17
  req,
@@ -23,7 +24,7 @@ let responseTimeMiddleware = (fn) => {
23
24
  return (req, res, next) => {
24
25
  const start = Date.now();
25
26
  fn.call(this, req, res, function () {
26
- helpers_1.loggerEvents.emit(helpers_1.LoggerEventType.ResponseTimes, {
27
+ Logger_1.loggerEvents.emit(LoggerEmitter_1.LoggerEventType.ResponseTimes, {
27
28
  elapsedMS: Date.now() - start,
28
29
  name: fn.name || "route",
29
30
  req,
@@ -1 +1 @@
1
- {"version":3,"file":"ResponseTimeMiddleware.js","sourceRoot":"","sources":["../../../src/input-gateway/helpers/ResponseTimeMiddleware.ts"],"names":[],"mappings":";;;AAAA,gCAA4D;AAI5D;;GAEG;AACI,IAAI,sBAAsB,GAAG,CAAC,EAAsB,EAAE,EAAE;IAC3D,6BAA6B;IAC7B,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE;QACjB,OAAO,UAAU,GAAY,EAAE,GAAa;YACxC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YACzB,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,CACpB,sBAAY,CAAC,IAAI,CAAC,yBAAe,CAAC,aAAa,EAAE;gBAC7C,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK;gBAC7B,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,OAAO;gBACxB,GAAG;aACN,CAAC,CACL,CAAC;YACF,aAAa;YACb,OAAO,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QACrC,CAAC,CAAC;KACL;SAAM,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE;QACxB,OAAO,CAAC,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;YACvD,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YACzB,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE;gBACpB,sBAAY,CAAC,IAAI,CAAC,yBAAe,CAAC,aAAa,EAAE;oBAC7C,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK;oBAC7B,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,OAAO;oBACxB,GAAG;iBACN,CAAC,CAAC;gBACH,aAAa;gBACb,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;YAChC,CAAC,CAAC,CAAC;QACP,CAAC,CAAC;KACL;SAAM;QACH,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;KAC1D;AACL,CAAC,CAAC;AA/BS,QAAA,sBAAsB,0BA+B/B"}
1
+ {"version":3,"file":"ResponseTimeMiddleware.js","sourceRoot":"","sources":["../../../src/input-gateway/helpers/ResponseTimeMiddleware.ts"],"names":[],"mappings":";;;AAAA,sEAAgE;AAChE,qCAAkD;AAIlD;;GAEG;AACI,IAAI,sBAAsB,GAAG,CAAC,EAAsB,EAAE,EAAE;IAC3D,6BAA6B;IAC7B,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE;QACjB,OAAO,UAAU,GAAY,EAAE,GAAa;YACxC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YACzB,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,CACpB,qBAAY,CAAC,IAAI,CAAC,+BAAe,CAAC,aAAa,EAAE;gBAC7C,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK;gBAC7B,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,OAAO;gBACxB,GAAG;aACN,CAAC,CACL,CAAC;YACF,aAAa;YACb,OAAO,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QACrC,CAAC,CAAC;KACL;SAAM,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE;QACxB,OAAO,CAAC,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;YACvD,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YACzB,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE;gBACpB,qBAAY,CAAC,IAAI,CAAC,+BAAe,CAAC,aAAa,EAAE;oBAC7C,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK;oBAC7B,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,OAAO;oBACxB,GAAG;iBACN,CAAC,CAAC;gBACH,aAAa;gBACb,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;YAChC,CAAC,CAAC,CAAC;QACP,CAAC,CAAC;KACL;SAAM;QACH,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;KAC1D;AACL,CAAC,CAAC;AA/BS,QAAA,sBAAsB,0BA+B/B"}
@@ -1,4 +1,4 @@
1
- import { Sequelize } from "sequelize/types";
1
+ import { Sequelize } from "sequelize";
2
2
  export default interface IPostgresConnector {
3
3
  connect(connectionString?: string | undefined): Promise<Sequelize>;
4
4
  getConnection(): Sequelize;
@@ -1,7 +1,7 @@
1
- import { ILogger } from "../../helpers";
1
+ import { ILogger } from "../../helpers/logger/LoggerProvider";
2
2
  import { ISimpleConfig } from "../../helpers/configuration/ISimpleConfig";
3
3
  import { AbstractStorageService } from "../../helpers/data-access/storage";
4
- import { IConfiguration } from "..";
4
+ import { IConfiguration } from "../config/abstract";
5
5
  export default class RawDataStorage {
6
6
  private storageService;
7
7
  private readonly log;
@@ -15,7 +15,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
15
15
  return (mod && mod.__esModule) ? mod : { "default": mod };
16
16
  };
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- const _helpers_1 = require("../../helpers");
18
+ const DateTime_1 = require("../../helpers/DateTime");
19
19
  const storage_1 = require("../../helpers/data-access/storage");
20
20
  const CoreToken_1 = require("../../helpers/ioc/CoreToken");
21
21
  const ContentTypeHelper_1 = require("../helpers/ContentTypeHelper");
@@ -31,7 +31,7 @@ let RawDataStorage = class RawDataStorage {
31
31
  this.log.verbose(`Raw data storage upload not enabled for \`${name}\` datasource.`);
32
32
  return;
33
33
  }
34
- const now = (0, _helpers_1.dateTime)(new Date()).setTimeZone("Europe/Prague");
34
+ const now = (0, DateTime_1.dateTime)(new Date()).setTimeZone("Europe/Prague");
35
35
  let ext = null;
36
36
  let headers = null;
37
37
  if (meta.headers) {
@@ -1 +1 @@
1
- {"version":3,"file":"RawDataStorage.js","sourceRoot":"","sources":["../../../src/integration-engine/data-access/RawDataStorage.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,4CAA6C;AAE7C,+DAAsE;AACtE,2DAAmD;AAEnD,oEAAuE;AACvE,gCAAyC;AACzC,gEAAuC;AACvC,uCAA8C;AAG/B,IAAM,cAAc,GAApB,MAAM,cAAc;IAI/B,YACmC,MAAsB,EACd,cAA8C,EACrD,YAA2B,EACjC,GAA6B;QAFR,mBAAc,GAAd,cAAc,CAAwB;QAE1C,QAAG,GAAH,GAAG,CAAS;QAMpD,SAAI,GAAG,KAAK,EAAE,IAAS,EAAE,IAAS,EAAE,IAAI,GAAG,SAAS,EAAE,EAAE;YAC3D,IAAI,CAAC,IAAI,CAAC,cAAc,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,C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Q,CAAC,qBAAqB,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC;QACvF,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC,oBAAoB,CAAC;IACxD,CAAC;CAsCJ,CAAA;AAlDoB,cAAc;IADlC,IAAA,qBAAU,GAAE;IAMJ,WAAA,IAAA,iBAAM,EAAC,oBAAc,CAAC,MAAM,CAAC,CAAA;IAC7B,WAAA,IAAA,iBAAM,EAAC,oBAAc,CAAC,cAAc,CAAC,CAAA;IACrC,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,YAAY,CAAC,CAAA;IAC9B,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,MAAM,CAAC,CAAA;6CAFsC,gCAAsB;GANxE,cAAc,CAkDlC;kBAlDoB,cAAc"}
@@ -0,0 +1,16 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import { Writable } from "node:stream";
4
+ export interface BatchWritableOptions<T> {
5
+ batchSize: number;
6
+ onFlush: (batch: T[]) => Promise<void>;
7
+ }
8
+ export declare class BatchWritable<T> extends Writable {
9
+ private batch;
10
+ private readonly batchSize;
11
+ private readonly onFlush;
12
+ constructor(options: BatchWritableOptions<T>);
13
+ _write(item: T, _encoding: BufferEncoding, callback: (err?: Error | null) => void): void;
14
+ _final(callback: (err?: Error | null) => void): void;
15
+ private flush;
16
+ }
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BatchWritable = void 0;
4
+ const node_stream_1 = require("node:stream");
5
+ class BatchWritable extends node_stream_1.Writable {
6
+ constructor(options) {
7
+ super({
8
+ objectMode: true,
9
+ });
10
+ this.batch = [];
11
+ this.batchSize = options.batchSize;
12
+ this.onFlush = options.onFlush;
13
+ }
14
+ _write(item, _encoding, callback) {
15
+ this.batch.push(item);
16
+ if (this.batch.length < this.batchSize) {
17
+ callback();
18
+ return;
19
+ }
20
+ this.flush(callback);
21
+ }
22
+ _final(callback) {
23
+ if (this.batch.length === 0) {
24
+ callback();
25
+ return;
26
+ }
27
+ this.flush(callback);
28
+ }
29
+ async flush(callback) {
30
+ const fullBatch = this.batch;
31
+ this.batch = [];
32
+ try {
33
+ await this.onFlush(fullBatch);
34
+ callback();
35
+ }
36
+ catch (err) {
37
+ callback(err instanceof Error ? err : new Error(String(err)));
38
+ }
39
+ }
40
+ }
41
+ exports.BatchWritable = BatchWritable;
42
+ //# sourceMappingURL=BatchWritable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BatchWritable.js","sourceRoot":"","sources":["../../../src/integration-engine/datasources/BatchWritable.ts"],"names":[],"mappings":";;;AAAA,6CAAuC;AAOvC,MAAa,aAAiB,SAAQ,sBAAQ;IAK1C,YAAY,OAAgC;QACxC,KAAK,CAAC;YACF,UAAU,EAAE,IAAI;SACnB,CAAC,CAAC;QAPC,UAAK,GAAQ,EAAE,CAAC;QAQpB,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACnC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IACnC,CAAC;IAEe,MAAM,CAAC,IAAO,EAAE,SAAyB,EAAE,QAAsC;QAC7F,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtB,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE;YACpC,QAAQ,EAAE,CAAC;YACX,OAAO;SACV;QACD,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACzB,CAAC;IAEe,MAAM,CAAC,QAAsC;QACzD,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YACzB,QAAQ,EAAE,CAAC;YACX,OAAO;SACV;QACD,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACzB,CAAC;IAEO,KAAK,CAAC,KAAK,CAAC,QAAsC;QACtD,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC;QAC7B,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI;YACA,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;YAC9B,QAAQ,EAAE,CAAC;SACd;QAAC,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SACjE;IACL,CAAC;CACJ;AAxCD,sCAwCC"}
@@ -0,0 +1,25 @@
1
+ /// <reference types="node" />
2
+ import { IDataSource } from "./IDataSource";
3
+ import { IValidator } from "@golemio/validator";
4
+ import { Transform } from "node:stream";
5
+ import { DataSource } from "./DataSource";
6
+ import { IStreamingProtocolStrategy } from "./protocol-strategy/IStreamingProtocolStrategy";
7
+ export interface DataSourceStreamedPipelineOptions {
8
+ validator?: IValidator | null;
9
+ batchSize?: number;
10
+ timeoutMs?: number;
11
+ }
12
+ export declare class DataSourceStreamedPipeline<T extends object = any> extends DataSource implements IDataSource {
13
+ static readonly DEFAULT_BATCH_SIZE: number;
14
+ static readonly DEFAULT_PIPELINE_TIMEOUT_MS: number;
15
+ private readonly streamTransformer;
16
+ private readonly batchSize;
17
+ private readonly timeoutMs;
18
+ private dataProcessor;
19
+ constructor(name: string, streamingStrategy: IStreamingProtocolStrategy, streamTransformer: Transform, options?: DataSourceStreamedPipelineOptions);
20
+ private get streamingStrategy();
21
+ setDataProcessor(fn: (batch: T[]) => Promise<void>): this;
22
+ proceed(): Promise<void>;
23
+ private createBatchWriter;
24
+ private validateAndProcess;
25
+ }