@l-v-yonsama/multi-platform-database-drivers 0.11.15 → 0.13.20

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 (68) hide show
  1. package/README.md +5 -0
  2. package/built/schema/log-parse-config.schema.json +406 -0
  3. package/built/src/drivers/memcache/helper.js +1 -1
  4. package/built/src/drivers/memcache/helper.js.map +1 -1
  5. package/built/src/helpers/SQLHelper.d.ts +7 -2
  6. package/built/src/helpers/SQLHelper.js +41 -2
  7. package/built/src/helpers/SQLHelper.js.map +1 -1
  8. package/built/src/types/helpers/index.d.ts +2 -0
  9. package/built/src/types/helpers/index.js +3 -1
  10. package/built/src/types/helpers/index.js.map +1 -1
  11. package/built/src/types/index.d.ts +1 -0
  12. package/built/src/types/index.js +1 -0
  13. package/built/src/types/index.js.map +1 -1
  14. package/built/src/types/utils/index.d.ts +186 -0
  15. package/built/src/types/utils/index.js +29 -0
  16. package/built/src/types/utils/index.js.map +1 -0
  17. package/built/src/utils/index.d.ts +1 -0
  18. package/built/src/utils/index.js +1 -0
  19. package/built/src/utils/index.js.map +1 -1
  20. package/built/src/utils/log/LogParser.d.ts +8 -0
  21. package/built/src/utils/log/LogParser.js +162 -0
  22. package/built/src/utils/log/LogParser.js.map +1 -0
  23. package/built/src/utils/log/buildSqlExecutions.d.ts +7 -0
  24. package/built/src/utils/log/buildSqlExecutions.js +267 -0
  25. package/built/src/utils/log/buildSqlExecutions.js.map +1 -0
  26. package/built/src/utils/log/classify/classifyEvent.d.ts +3 -0
  27. package/built/src/utils/log/classify/classifyEvent.js +91 -0
  28. package/built/src/utils/log/classify/classifyEvent.js.map +1 -0
  29. package/built/src/utils/log/constant/base.d.ts +97 -0
  30. package/built/src/utils/log/constant/base.js +136 -0
  31. package/built/src/utils/log/constant/base.js.map +1 -0
  32. package/built/src/utils/log/constant/index.d.ts +3 -0
  33. package/built/src/utils/log/constant/index.js +7 -0
  34. package/built/src/utils/log/constant/index.js.map +1 -0
  35. package/built/src/utils/log/constant/logEventSplitPreset.d.ts +34 -0
  36. package/built/src/utils/log/constant/logEventSplitPreset.js +299 -0
  37. package/built/src/utils/log/constant/logEventSplitPreset.js.map +1 -0
  38. package/built/src/utils/log/constant/sqlLogParsePreset.d.ts +328 -0
  39. package/built/src/utils/log/constant/sqlLogParsePreset.js +383 -0
  40. package/built/src/utils/log/constant/sqlLogParsePreset.js.map +1 -0
  41. package/built/src/utils/log/detect/presetDetector.d.ts +11 -0
  42. package/built/src/utils/log/detect/presetDetector.js +140 -0
  43. package/built/src/utils/log/detect/presetDetector.js.map +1 -0
  44. package/built/src/utils/log/extract/runExtractors.d.ts +2 -0
  45. package/built/src/utils/log/extract/runExtractors.js +105 -0
  46. package/built/src/utils/log/extract/runExtractors.js.map +1 -0
  47. package/built/src/utils/log/index.d.ts +10 -0
  48. package/built/src/utils/log/index.js +14 -0
  49. package/built/src/utils/log/index.js.map +1 -0
  50. package/built/src/utils/log/logSummary.d.ts +6 -0
  51. package/built/src/utils/log/logSummary.js +91 -0
  52. package/built/src/utils/log/logSummary.js.map +1 -0
  53. package/built/src/utils/log/pattern/logEventPattern.d.ts +3 -0
  54. package/built/src/utils/log/pattern/logEventPattern.js +123 -0
  55. package/built/src/utils/log/pattern/logEventPattern.js.map +1 -0
  56. package/built/src/utils/log/rdh/convertExtractedSqlRdhResult.d.ts +11 -0
  57. package/built/src/utils/log/rdh/convertExtractedSqlRdhResult.js +161 -0
  58. package/built/src/utils/log/rdh/convertExtractedSqlRdhResult.js.map +1 -0
  59. package/built/src/utils/log/split/splitLogEvents.d.ts +2 -0
  60. package/built/src/utils/log/split/splitLogEvents.js +38 -0
  61. package/built/src/utils/log/split/splitLogEvents.js.map +1 -0
  62. package/built/src/utils/log/sql/removeSqlComments.d.ts +1 -0
  63. package/built/src/utils/log/sql/removeSqlComments.js +11 -0
  64. package/built/src/utils/log/sql/removeSqlComments.js.map +1 -0
  65. package/built/src/utils/log/validator.d.ts +6 -0
  66. package/built/src/utils/log/validator.js +272 -0
  67. package/built/src/utils/log/validator.js.map +1 -0
  68. package/package.json +15 -7
@@ -0,0 +1,272 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateConfig = void 0;
4
+ const types_1 = require("../../types");
5
+ function validateConfig(config, state) {
6
+ if (!isLogParseConfig(config)) {
7
+ return {
8
+ ok: false,
9
+ errorMessage: 'Invalid config structure.',
10
+ };
11
+ }
12
+ let availableStage = undefined;
13
+ let errorMessage = validateSplitFields(config.split.fields);
14
+ if (state === 'split') {
15
+ if (errorMessage) {
16
+ return {
17
+ ok: false,
18
+ errorMessage,
19
+ };
20
+ }
21
+ return {
22
+ ok: true,
23
+ availableStage: 'split',
24
+ errorMessage,
25
+ };
26
+ }
27
+ if (!errorMessage) {
28
+ availableStage = 'split';
29
+ errorMessage = validateClassify(config.classify);
30
+ }
31
+ if (state === 'classify') {
32
+ if (errorMessage) {
33
+ return {
34
+ ok: false,
35
+ availableStage,
36
+ errorMessage,
37
+ };
38
+ }
39
+ return {
40
+ ok: true,
41
+ availableStage: 'classify',
42
+ errorMessage,
43
+ };
44
+ }
45
+ if (!errorMessage) {
46
+ availableStage = 'classify';
47
+ errorMessage = validateExtractors(config.extractors, config.classify);
48
+ }
49
+ availableStage = 'sqlExecution';
50
+ return {
51
+ ok: !errorMessage,
52
+ availableStage,
53
+ errorMessage,
54
+ };
55
+ }
56
+ exports.validateConfig = validateConfig;
57
+ function isLogParseConfig(obj) {
58
+ return (obj &&
59
+ typeof obj === 'object' &&
60
+ obj.split &&
61
+ Array.isArray(obj.split.fields) &&
62
+ Array.isArray(obj.classify) &&
63
+ Array.isArray(obj.extractors));
64
+ }
65
+ function validateSplitFields(fields) {
66
+ if (fields.length === 0) {
67
+ return 'At least one field definition is required.';
68
+ }
69
+ let hasMessage = false;
70
+ let hasStart = false;
71
+ for (let i = 0; i < fields.length; i++) {
72
+ const rowNo = i + 1;
73
+ const field = fields[i];
74
+ if (field.type === 'line-break-literal' || field.type === 'literal') {
75
+ continue;
76
+ }
77
+ if (!field.name) {
78
+ return `Row ${rowNo}: Name is required.`;
79
+ }
80
+ if (!field.type) {
81
+ return `Row ${rowNo}: Field type is required.`;
82
+ }
83
+ if (!field.pattern) {
84
+ return `Row ${rowNo}: Pattern is required.`;
85
+ }
86
+ if (field.type === 'builtin' && !(0, types_1.isBuiltInPattern)(field.pattern)) {
87
+ return `Row ${rowNo}: Invalid built-in pattern[${field.pattern}].`;
88
+ }
89
+ if (field.type === 'regex') {
90
+ try {
91
+ new RegExp(field.pattern);
92
+ }
93
+ catch (_a) {
94
+ return `Row ${rowNo}: Invalid regular expression[${field.pattern}].`;
95
+ }
96
+ }
97
+ if (field.eventStartMarker) {
98
+ hasStart = true;
99
+ }
100
+ if (field.name === 'message') {
101
+ hasMessage = true;
102
+ }
103
+ }
104
+ if (!hasMessage) {
105
+ return 'A field named "message" is required for SQL extraction.';
106
+ }
107
+ if (!hasStart) {
108
+ return 'At least one field must be marked as Event start marker.';
109
+ }
110
+ return '';
111
+ }
112
+ function validateClassify(classify) {
113
+ if (!classify || classify.length === 0) {
114
+ return 'At least one classify rule is required.';
115
+ }
116
+ for (let i = 0; i < classify.length; i++) {
117
+ const rowNo = i + 1;
118
+ const rule = classify[i];
119
+ if (!rule.type) {
120
+ return `Classify row ${rowNo}: type is required.`;
121
+ }
122
+ if (!rule.pattern) {
123
+ return `Classify row ${rowNo}: pattern is required.`;
124
+ }
125
+ try {
126
+ new RegExp(rule.pattern);
127
+ }
128
+ catch (_a) {
129
+ return `Classify row ${rowNo}: Invalid regex pattern[${rule.pattern}].`;
130
+ }
131
+ if (rule.field && typeof rule.field !== 'string') {
132
+ return `Classify row ${rowNo}: field must be string.`;
133
+ }
134
+ if (rule.transforms) {
135
+ for (const transform of rule.transforms) {
136
+ if (!transform.pattern) {
137
+ return `Classify row ${rowNo}: transform.pattern is required.`;
138
+ }
139
+ try {
140
+ new RegExp(transform.pattern);
141
+ }
142
+ catch (_b) {
143
+ return `Classify row ${rowNo}: Invalid transform.pattern[${transform.pattern}].`;
144
+ }
145
+ if (typeof transform.replace !== 'string') {
146
+ return `Classify row ${rowNo}: transform.replace must be string.`;
147
+ }
148
+ }
149
+ }
150
+ if (rule.context) {
151
+ for (let j = 0; j < rule.context.length; j++) {
152
+ const ctx = rule.context[j];
153
+ const ctxRow = `${rowNo}.${j + 1}`;
154
+ if (!ctx.contextName) {
155
+ return `Classify row ${ctxRow}: contextName is required.`;
156
+ }
157
+ if (!ctx.pattern) {
158
+ return `Classify row ${ctxRow}: context.pattern is required.`;
159
+ }
160
+ try {
161
+ new RegExp(ctx.pattern);
162
+ }
163
+ catch (_c) {
164
+ return `Classify row ${ctxRow}: Invalid context.pattern[${ctx.pattern}].`;
165
+ }
166
+ if (typeof ctx.replace !== 'string') {
167
+ return `Classify row ${ctxRow}: context.replace must be string.`;
168
+ }
169
+ if (ctx.eventFieldName && typeof ctx.eventFieldName !== 'string') {
170
+ return `Classify row ${ctxRow}: eventFieldName must be string.`;
171
+ }
172
+ }
173
+ }
174
+ }
175
+ return '';
176
+ }
177
+ function validateExtractors(extractors, classify) {
178
+ if (!extractors || extractors.length === 0) {
179
+ return 'At least one extractor is required.';
180
+ }
181
+ const classifyTypes = new Set(classify.map((c) => c.type));
182
+ const names = new Set();
183
+ for (let i = 0; i < extractors.length; i++) {
184
+ const rowNo = i + 1;
185
+ const ex = extractors[i];
186
+ if (!ex.name) {
187
+ return `Extractor row ${rowNo}: name is required.`;
188
+ }
189
+ if (names.has(ex.name)) {
190
+ return `Extractor row ${rowNo}: duplicate name[${ex.name}].`;
191
+ }
192
+ names.add(ex.name);
193
+ if (!ex.start) {
194
+ return `Extractor row ${rowNo}: start event type is required.`;
195
+ }
196
+ if (!classifyTypes.has(ex.start)) {
197
+ return `Extractor row ${rowNo}: start type[${ex.start}] is not defined in classify.`;
198
+ }
199
+ if (!ex.steps || ex.steps.length === 0) {
200
+ return `Extractor row ${rowNo}: at least one step is required.`;
201
+ }
202
+ let hasCaptureSql = false;
203
+ let hasErrorSql = false;
204
+ let captureSqlIndex = -1;
205
+ let captureParamsIndex = -1;
206
+ let captureResultIndex = -1;
207
+ for (let j = 0; j < ex.steps.length; j++) {
208
+ const step = ex.steps[j];
209
+ const stepRow = `${rowNo}.${j + 1}`;
210
+ if (!step.type) {
211
+ return `Extractor row ${stepRow}: step.type is required.`;
212
+ }
213
+ if (!classifyTypes.has(step.type)) {
214
+ return `Extractor row ${stepRow}: step.type[${step.type}] is not defined in classify.`;
215
+ }
216
+ if (step.action) {
217
+ const validActions = [
218
+ 'captureSql',
219
+ 'captureParams',
220
+ 'captureColumns',
221
+ 'captureRow',
222
+ 'captureResult',
223
+ 'captureError',
224
+ 'captureErrorDetail',
225
+ 'captureField',
226
+ ];
227
+ if (!validActions.includes(step.action)) {
228
+ return `Extractor row ${stepRow}: Invalid action[${step.action}].`;
229
+ }
230
+ if (step.action === 'captureSql') {
231
+ hasCaptureSql = true;
232
+ captureSqlIndex = j;
233
+ }
234
+ if (step.action === 'captureParams') {
235
+ captureParamsIndex = j;
236
+ }
237
+ if (step.action === 'captureResult') {
238
+ captureResultIndex = j;
239
+ }
240
+ if (step.action === 'captureError') {
241
+ hasErrorSql = true;
242
+ }
243
+ if (step.action === 'captureField' && !step.field) {
244
+ return `Extractor row ${stepRow}: field is required for captureField action.`;
245
+ }
246
+ }
247
+ if (step.field && typeof step.field !== 'string') {
248
+ return `Extractor row ${stepRow}: field must be string.`;
249
+ }
250
+ }
251
+ if (!hasCaptureSql && !hasErrorSql) {
252
+ return `Extractor row ${rowNo}: at least one captureSql step is required.`;
253
+ }
254
+ if (hasCaptureSql) {
255
+ if (captureSqlIndex > 1) {
256
+ return `Extractor row ${rowNo}: captureSql should appear early in steps.`;
257
+ }
258
+ if (captureParamsIndex !== -1 &&
259
+ captureSqlIndex !== -1 &&
260
+ captureParamsIndex < captureSqlIndex) {
261
+ return `Extractor row ${rowNo}: captureParams must come after captureSql.`;
262
+ }
263
+ if (captureResultIndex !== -1 &&
264
+ captureParamsIndex !== -1 &&
265
+ captureResultIndex < captureParamsIndex) {
266
+ return `Extractor row ${rowNo}: captureResult must come after captureParams.`;
267
+ }
268
+ }
269
+ }
270
+ return '';
271
+ }
272
+ //# sourceMappingURL=validator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validator.js","sourceRoot":"","sources":["../../../../src/utils/log/validator.ts"],"names":[],"mappings":";;;AAAA,uCAOqB;AAErB,SAAgB,cAAc,CAC5B,MAAe,EACf,KAAqB;IAMrB,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE;QAC7B,OAAO;YACL,EAAE,EAAE,KAAK;YACT,YAAY,EAAE,2BAA2B;SAC1C,CAAC;KACH;IAED,IAAI,cAAc,GAA8B,SAAS,CAAC;IAC1D,IAAI,YAAY,GAAG,mBAAmB,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC5D,IAAI,KAAK,KAAK,OAAO,EAAE;QACrB,IAAI,YAAY,EAAE;YAChB,OAAO;gBACL,EAAE,EAAE,KAAK;gBACT,YAAY;aACb,CAAC;SACH;QACD,OAAO;YACL,EAAE,EAAE,IAAI;YACR,cAAc,EAAE,OAAO;YACvB,YAAY;SACb,CAAC;KACH;IACD,IAAI,CAAC,YAAY,EAAE;QACjB,cAAc,GAAG,OAAO,CAAC;QACzB,YAAY,GAAG,gBAAgB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;KAClD;IACD,IAAI,KAAK,KAAK,UAAU,EAAE;QACxB,IAAI,YAAY,EAAE;YAChB,OAAO;gBACL,EAAE,EAAE,KAAK;gBACT,cAAc;gBACd,YAAY;aACb,CAAC;SACH;QACD,OAAO;YACL,EAAE,EAAE,IAAI;YACR,cAAc,EAAE,UAAU;YAC1B,YAAY;SACb,CAAC;KACH;IACD,IAAI,CAAC,YAAY,EAAE;QACjB,cAAc,GAAG,UAAU,CAAC;QAC5B,YAAY,GAAG,kBAAkB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K,CAAC,CAAC;gBACzB,kBAAkB,GAAG,kBAAkB,EACvC;gBACA,OAAO,iBAAiB,KAAK,gDAAgD,CAAC;aAC/E;SACF;KACF;IAED,OAAO,EAAE,CAAC;AACZ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@l-v-yonsama/multi-platform-database-drivers",
3
- "version": "0.11.15",
3
+ "version": "0.13.20",
4
4
  "description": "multi-platform database drivers in TypeScript.",
5
5
  "engines": {
6
6
  "node": ">= 18"
@@ -33,17 +33,21 @@
33
33
  "tsutils": "~3.21",
34
34
  "typedoc": "^0.25.1",
35
35
  "typedoc-plugin-markdown": "^3.16.0",
36
- "typescript": "~4.9"
36
+ "typescript": "~4.9",
37
+ "typescript-json-schema": "^0.67.1"
37
38
  },
38
39
  "scripts": {
39
40
  "start": "node built/src/index.js",
40
- "clean": "rimraf coverage built tmp",
41
+ "clean": "rimraf coverage built tmp *.tgz __tests__/data/logs/parse/*.json",
41
42
  "clean:examples": "rimraf built/src/examples",
42
43
  "prebuild": "npm run lint",
43
44
  "doc": "typedoc --cleanOutputDir --excludePrivate --plugin typedoc-plugin-markdown --out doc src",
44
45
  "build": "npm run clean && tsc -p tsconfig.json",
45
46
  "build:watch": "npm run clean && tsc -w -p tsconfig.json",
46
- "build:release": "npm run clean && tsc -p tsconfig.release.json && npm run clean:examples && npm run doc",
47
+ "build:schema": "typescript-json-schema tsconfig.json LogParseConfig --required --noExtraProps --out schema/log-parse-config.schema.json",
48
+ "build:core": "npm run clean && tsc -p tsconfig.release.json && npm run build:schema && cp -r schema built/schema",
49
+ "build:pack": "npm run build:core && npm run clean:examples && npm pack",
50
+ "build:release": "npm run build:core && npm run clean:examples && npm run doc",
47
51
  "prepublishOnly": "npm run build:release",
48
52
  "lint": "eslint . --ext .ts --ext .mts",
49
53
  "lint:fix": "eslint --fix . --ext .ts --ext .mts",
@@ -63,6 +67,7 @@
63
67
  "test0": "jest --coverage",
64
68
  "test": "npm run clean && jest --runInBand",
65
69
  "test:util": "npm run clean && jest __tests__/util/util.test.ts",
70
+ "test:logParserUtil": "npm run clean && jest __tests__/util/logParseUtil.test.ts",
66
71
  "test:driver:mysql": "npm run clean && jest __tests__/db/drivers/MySQLDriver.test.ts",
67
72
  "test:driver:mssql": "npm run clean && jest __tests__/db/drivers/SQLServerDriver.test.ts",
68
73
  "test:driver:postgres": "npm run clean && jest __tests__/db/drivers/PostgresDriver.test.ts",
@@ -93,7 +98,7 @@
93
98
  "@aws-sdk/credential-providers": "^3.279.0",
94
99
  "@aws-sdk/lib-dynamodb": "^3.656.0",
95
100
  "@aws-sdk/s3-request-presigner": "^3.427.0",
96
- "@l-v-yonsama/rdh": "^0.2.10",
101
+ "@l-v-yonsama/rdh": "^0.2.13",
97
102
  "auth0": "^3.7.1",
98
103
  "axios": "^1.6.0",
99
104
  "bytes": "^3.1.2",
@@ -117,7 +122,9 @@
117
122
  "pgsql-ast-parser": "^11.0.1",
118
123
  "pluralize": "^8.0.0",
119
124
  "short-unique-id": "^4.4.4",
120
- "sql.js": "^1.10.3"
125
+ "sql-formatter": "^15.7.2",
126
+ "sql.js": "^1.10.3",
127
+ "xregexp": "^5.1.2"
121
128
  },
122
129
  "volta": {
123
130
  "node": "18.12.1"
@@ -125,7 +132,8 @@
125
132
  "main": "built/src/index.js",
126
133
  "types": "built/src/index.d.ts",
127
134
  "files": [
128
- "built/src"
135
+ "built/src",
136
+ "built/schema"
129
137
  ],
130
138
  "repository": {
131
139
  "type": "git",