@zeesoft/i18n-verify 2.1.4 → 2.1.7

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 (61) hide show
  1. package/dist/genrc.mjs +1 -0
  2. package/dist/i18n.mjs +1 -0
  3. package/dist/index.mjs +1 -0
  4. package/package.json +25 -17
  5. package/postinstall.js +28 -0
  6. package/readme.md +21 -1
  7. package/dist/driver/adapters/cypress.js +0 -161
  8. package/dist/driver/adapters/nightwatch.js +0 -160
  9. package/dist/driver/adapters/selenium.js +0 -90
  10. package/dist/driver/adapters/webdriver.io.js +0 -81
  11. package/dist/driver/baseDriver.js +0 -93
  12. package/dist/driver/factory.js +0 -27
  13. package/dist/index.js +0 -52
  14. package/dist/lib/config.js +0 -102
  15. package/dist/lib/i18n.js +0 -259
  16. package/dist/lib/reports.js +0 -140
  17. package/dist/lib/validator/base.js +0 -125
  18. package/dist/lib/validator/currency.js +0 -94
  19. package/dist/lib/validator/date.js +0 -72
  20. package/dist/lib/validator/datetime.js +0 -72
  21. package/dist/lib/validator/index.js +0 -156
  22. package/dist/lib/validator/number.js +0 -58
  23. package/dist/lib/validator/percentage.js +0 -78
  24. package/dist/lib/validator/string.js +0 -172
  25. package/dist/lib/validator/time.js +0 -72
  26. package/dist/template/report.html +0 -1678
  27. package/dist/utils/cache.js +0 -47
  28. package/dist/utils/common.js +0 -18
  29. package/dist/utils/configFile.js +0 -65
  30. package/dist/utils/constants.js +0 -148
  31. package/dist/utils/cypress.js +0 -120
  32. package/dist/utils/dateUtils/chronoNode.js +0 -52
  33. package/dist/utils/file.js +0 -61
  34. package/dist/utils/graphic.js +0 -57
  35. package/dist/utils/logs.js +0 -79
  36. package/dist/utils/objects/cacheData.js +0 -72
  37. package/dist/utils/objects/metaData.js +0 -29
  38. package/dist/utils/objects/reportData.js +0 -30
  39. package/dist/utils/objects/statData.js +0 -380
  40. package/dist/utils/objects/stringData.js +0 -64
  41. package/dist/utils/objects/stringInfo.js +0 -51
  42. package/dist/utils/regex.js +0 -8
  43. package/dist/utils/reportFactory/base.js +0 -59
  44. package/dist/utils/reportFactory/html/index.js +0 -51
  45. package/dist/utils/reportFactory/html/template/body.js +0 -117
  46. package/dist/utils/reportFactory/html/template/css.js +0 -476
  47. package/dist/utils/reportFactory/html/template/html.js +0 -63
  48. package/dist/utils/reportFactory/html/template/javascript/data.js +0 -66
  49. package/dist/utils/reportFactory/html/template/javascript/global.js +0 -45
  50. package/dist/utils/reportFactory/html/template/javascript/grid.js +0 -129
  51. package/dist/utils/reportFactory/html/template/javascript/index.js +0 -22
  52. package/dist/utils/reportFactory/html/template/javascript/insight.js +0 -248
  53. package/dist/utils/reportFactory/html/template/javascript/log.js +0 -19
  54. package/dist/utils/reportFactory/html/template/javascript/menuBar.js +0 -123
  55. package/dist/utils/reportFactory/html/template/javascript/overview.js +0 -818
  56. package/dist/utils/reportFactory/index.js +0 -36
  57. package/dist/utils/reportFactory/table.js +0 -95
  58. package/dist/utils/resource.js +0 -58
  59. package/dist/utils/runtime.js +0 -36
  60. package/dist/utils/scripts/genreport.js +0 -1
  61. package/dist/utils/scripts/postinstall.js +0 -22
@@ -1,72 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _cache = _interopRequireDefault(require("../cache.js"));
8
- var _metaData = _interopRequireDefault(require("./metaData.js"));
9
- var _stringData = _interopRequireDefault(require("./stringData.js"));
10
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
- class CacheData {
12
- /**
13
- * @type {MetaData}
14
- */
15
- #metaData;
16
- /**
17
- * @type {StringData}
18
- */
19
- #stringsData;
20
- constructor(data = {}) {
21
- this.#metaData = new _metaData.default(data.metaData);
22
- this.#stringsData = new _stringData.default(data.stringsData);
23
- }
24
- getMetaData() {
25
- return this.#metaData;
26
- }
27
- setMetaData(metaData) {
28
- this.#metaData = metaData;
29
- }
30
- getStringEntry(string) {
31
- return this.#stringsData.getStringData(string);
32
- }
33
- static addString(string, type, description, imagePath) {
34
- const cache = CacheData.getInstance();
35
- const added = cache.#addStringEntry(string, type, description, imagePath.replace(/\\/g, '/'));
36
- added && cache.save();
37
- return added;
38
- }
39
- #addStringEntry(string, type, description, imagePath) {
40
- let dataAdded = false;
41
- const info = {
42
- type,
43
- description,
44
- imagePath
45
- };
46
- if (!this.#stringsData.hasStringData(string)) {
47
- dataAdded = this.#stringsData.setStringData(string, info);
48
- } else {
49
- dataAdded = this.#stringsData.checkAndAdd(string, info);
50
- }
51
- if (dataAdded) {
52
- this.#metaData.getStats().incrementByType(type);
53
- }
54
- return dataAdded;
55
- }
56
- toJSON() {
57
- return {
58
- metaData: this.#metaData,
59
- stringsData: this.#stringsData
60
- };
61
- }
62
- save() {
63
- _cache.default.save(this);
64
- }
65
- remove() {
66
- _cache.default.delete();
67
- }
68
- static getInstance() {
69
- return new CacheData(_cache.default.getData());
70
- }
71
- }
72
- exports.default = CacheData;
@@ -1,29 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _statData = _interopRequireDefault(require("./statData.js"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- class MetaData {
10
- /**
11
- * @type {StatData}
12
- */
13
- #stats;
14
- constructor(data = {}) {
15
- this.#stats = new _statData.default(data.stats);
16
- }
17
- getStats() {
18
- return this.#stats;
19
- }
20
- setStats(stats) {
21
- this.#stats = stats;
22
- }
23
- toJSON() {
24
- return {
25
- stats: this.#stats
26
- };
27
- }
28
- }
29
- exports.default = MetaData;
@@ -1,30 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- class ReportData {
8
- /**
9
- * @type {String}
10
- */
11
- #appName;
12
- /**
13
- * @type {String}
14
- */
15
- #reportTime;
16
- constructor({
17
- appName,
18
- reportTime
19
- }) {
20
- this.#appName = appName;
21
- this.#reportTime = reportTime;
22
- }
23
- getAppName() {
24
- return this.#appName;
25
- }
26
- getReportTime() {
27
- return this.#reportTime;
28
- }
29
- }
30
- exports.default = ReportData;
@@ -1,380 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _constants = require("../constants");
8
- class StatData {
9
- /**
10
- * @type {Number}
11
- */
12
- #localizedStrings;
13
- /**
14
- * @type {Number}
15
- */
16
- #notLocalizedStrings;
17
- /**
18
- * @type {Number}
19
- */
20
- #untranslatedStrings;
21
- /**
22
- * @type {Number}
23
- */
24
- #partialStrings;
25
- /**
26
- * @type {Number}
27
- */
28
- #localizedDateTime;
29
- /**
30
- * @type {Number}
31
- */
32
- #localizedDate;
33
- /**
34
- * @type {Number}
35
- */
36
- #localizedTime;
37
- /**
38
- * @type {Number}
39
- */
40
- #notLocalizedDateTime;
41
- /**
42
- * @type {Number}
43
- */
44
- #notLocalizedDate;
45
- /**
46
- * @type {Number}
47
- */
48
- #notLocalizedTime;
49
- /**
50
- * @type {Number}
51
- */
52
- #localizedNumber;
53
- /**
54
- * @type {Number}
55
- */
56
- #notLocalizedNumber;
57
- /**
58
- * @type {Number}
59
- */
60
- #localizedCurrency;
61
- /**
62
- * @type {Number}
63
- */
64
- #notLocalizedCurrency;
65
- /**
66
- * @type {Number}
67
- */
68
- #localizedPercentage;
69
- /**
70
- * @type {Number}
71
- */
72
- #notLocalizedPercentage;
73
- /**
74
- * @type {Number}
75
- */
76
- #ignored;
77
- /**
78
- * @type {Number}
79
- */
80
- #dnt;
81
- /**
82
- * @type {Number}
83
- */
84
- #autoIgnored;
85
- /**
86
- * @type {Number}
87
- */
88
- #userInput;
89
- /**
90
- * @type {Number}
91
- */
92
- #encoding;
93
- /**
94
- * @type {Number}
95
- */
96
- #truncation;
97
- /**
98
- * @type {Number}
99
- */
100
- #overlapping;
101
- /**
102
- * @type {Number}
103
- */
104
- #reviewed;
105
- constructor(data = {}) {
106
- this.#localizedStrings = data?.localizedStrings || 0;
107
- this.#notLocalizedStrings = data?.notLocalizedStrings || 0;
108
- this.#untranslatedStrings = data?.untranslatedStrings || 0;
109
- this.#partialStrings = data?.partialStrings || 0;
110
- this.#localizedDateTime = data?.localizedDateTime || 0;
111
- this.#localizedDate = data?.localizedDate || 0;
112
- this.#localizedTime = data?.localizedTime || 0;
113
- this.#notLocalizedDateTime = data?.notLocalizedDateTime || 0;
114
- this.#notLocalizedDate = data?.notLocalizedDate || 0;
115
- this.#notLocalizedTime = data?.notLocalizedTime || 0;
116
- this.#localizedNumber = data?.localizedNumber || 0;
117
- this.#notLocalizedNumber = data?.notLocalizedNumber || 0;
118
- this.#localizedCurrency = data?.localizedCurrency || 0;
119
- this.#notLocalizedCurrency = data?.notLocalizedCurrency || 0;
120
- this.#localizedPercentage = data?.localizedPercentage || 0;
121
- this.#notLocalizedPercentage = data?.notLocalizedPercentage || 0;
122
- this.#ignored = data?.ignored || 0;
123
- this.#dnt = data?.dnt || 0;
124
- this.#autoIgnored = data?.autoIgnored || 0;
125
- this.#userInput = data?.userInput || 0;
126
- this.#encoding = data?.encoding || 0;
127
- this.#truncation = data?.truncation || 0;
128
- this.#overlapping = data?.overlapping || 0;
129
- this.#reviewed = data?.reviewed || 0;
130
- }
131
- getLocalizedStrings() {
132
- return this.#localizedStrings;
133
- }
134
- setLocalizedStrings(translatedStrings) {
135
- this.#localizedStrings = translatedStrings;
136
- }
137
- getUntranslatedStrings() {
138
- return this.#untranslatedStrings;
139
- }
140
- setUntranslatedStrings(untranslatedStrings) {
141
- this.#untranslatedStrings = untranslatedStrings;
142
- }
143
- getNotLocalizedStrings() {
144
- return this.#notLocalizedStrings;
145
- }
146
- setNotLocalizedStrings(notLocalizedStrings) {
147
- this.#notLocalizedStrings = notLocalizedStrings;
148
- }
149
- getPartialStrings() {
150
- return this.#partialStrings;
151
- }
152
- setPartialStrings(partialStrings) {
153
- this.#partialStrings = partialStrings;
154
- }
155
- getLocalizedDateTime() {
156
- return this.#localizedDateTime;
157
- }
158
- setLocalizedDateTime(localizedDateTime) {
159
- this.#localizedDateTime = localizedDateTime;
160
- }
161
- getLocalizedDate() {
162
- return this.#localizedDate;
163
- }
164
- setLocalizedDate(localizedDate) {
165
- this.#localizedDate = localizedDate;
166
- }
167
- getLocalizedTime() {
168
- return this.#localizedTime;
169
- }
170
- setLocalizedTime(localizedTime) {
171
- this.#localizedTime = localizedTime;
172
- }
173
- getNotLocalizedDateTime() {
174
- return this.#notLocalizedDateTime;
175
- }
176
- setNotLocalizedDateTime(notLocalizedDateTime) {
177
- this.#notLocalizedDateTime = notLocalizedDateTime;
178
- }
179
- getNotLocalizedDate() {
180
- return this.#notLocalizedDate;
181
- }
182
- setNotLocalizedDate(notLocalizedDate) {
183
- this.#notLocalizedDate = notLocalizedDate;
184
- }
185
- getNotLocalizedTime() {
186
- return this.#notLocalizedTime;
187
- }
188
- setNotLocalizedTime(notLocalizedTime) {
189
- this.#notLocalizedTime = notLocalizedTime;
190
- }
191
- getLocalizedNumber() {
192
- return this.#localizedNumber;
193
- }
194
- setLocalizedNumber(localizedNumber) {
195
- this.#localizedNumber = localizedNumber;
196
- }
197
- getNotLocalizeNumber() {
198
- return this.#notLocalizedNumber;
199
- }
200
- setNotLocalizeNumber(notLocalizedNumber) {
201
- this.#notLocalizedNumber = notLocalizedNumber;
202
- }
203
- getCurrency() {
204
- return this.#localizedCurrency;
205
- }
206
- setCurrency(currency) {
207
- this.#localizedCurrency = currency;
208
- }
209
- getNotLocalizeCurrency() {
210
- return this.#notLocalizedCurrency;
211
- }
212
- setNotLocalizeCurrency(notLocalizedCurrency) {
213
- this.#notLocalizedCurrency = notLocalizedCurrency;
214
- }
215
- getPercentage() {
216
- return this.#localizedPercentage;
217
- }
218
- setPercentage(percentage) {
219
- this.#localizedPercentage = percentage;
220
- }
221
- getNotLocalizePercentage() {
222
- return this.#notLocalizedPercentage;
223
- }
224
- setNotLocalizePercentage(notLocalizedPercentage) {
225
- this.#notLocalizedPercentage = notLocalizedPercentage;
226
- }
227
- getIgnored() {
228
- return this.#ignored;
229
- }
230
- setIgnored(ignored) {
231
- this.#ignored = ignored;
232
- }
233
- getUserInput() {
234
- return this.#userInput;
235
- }
236
- setUserInput(userInput) {
237
- this.#userInput = userInput;
238
- }
239
- getDnt() {
240
- return this.#dnt;
241
- }
242
- setDnt(dnt) {
243
- this.#dnt = dnt;
244
- }
245
- getAutoIgnored() {
246
- return this.#autoIgnored;
247
- }
248
- setAutoIgnored(autoIgnored) {
249
- this.#autoIgnored = autoIgnored;
250
- }
251
- getEncoding() {
252
- return this.#encoding;
253
- }
254
- setEncoding(encoding) {
255
- this.#encoding = encoding;
256
- }
257
- getTruncation() {
258
- return this.#truncation;
259
- }
260
- setTruncation(truncation) {
261
- this.#truncation = truncation;
262
- }
263
- getOverlapping() {
264
- return this.#overlapping;
265
- }
266
- setOverlapping(overlapping) {
267
- this.#overlapping = overlapping;
268
- }
269
- getReviewed() {
270
- return this.#reviewed;
271
- }
272
- setReviewed(reviewed) {
273
- this.#reviewed = reviewed;
274
- }
275
- incrementByType(type) {
276
- switch (type) {
277
- case _constants.I18N_STATUS.STRING_LOCALIZED:
278
- ++this.#localizedStrings;
279
- break;
280
- case _constants.I18N_STATUS.STRING_NOT_LOCALIZED:
281
- ++this.#notLocalizedStrings;
282
- break;
283
- case _constants.I18N_STATUS.UNTRANSLATED:
284
- ++this.#untranslatedStrings;
285
- break;
286
- case _constants.I18N_STATUS.STRING_PARTIALLY_LOCALIZED:
287
- ++this.#partialStrings;
288
- break;
289
- case _constants.I18N_STATUS.AUTO_IGNORE:
290
- ++this.#autoIgnored;
291
- break;
292
- case _constants.I18N_STATUS.IGNORE:
293
- ++this.#ignored;
294
- break;
295
- case _constants.I18N_STATUS.DNT:
296
- ++this.#dnt;
297
- break;
298
- case _constants.I18N_STATUS.ENCODING_ISSUE:
299
- ++this.#encoding;
300
- break;
301
- case _constants.I18N_STATUS.DATE_LOCALIZED:
302
- ++this.#localizedDate;
303
- break;
304
- case _constants.I18N_STATUS.TIME_LOCALIZED:
305
- ++this.#localizedTime;
306
- break;
307
- case _constants.I18N_STATUS.DATE_TIME_LOCALIZED:
308
- ++this.#localizedDateTime;
309
- break;
310
- case _constants.I18N_STATUS.DATE_NOT_LOCALIZED:
311
- ++this.#notLocalizedDate;
312
- break;
313
- case _constants.I18N_STATUS.TIME_NOT_LOCALIZED:
314
- ++this.#notLocalizedTime;
315
- break;
316
- case _constants.I18N_STATUS.DATE_TIME_NOT_LOCALIZED:
317
- ++this.#notLocalizedDateTime;
318
- break;
319
- case _constants.I18N_STATUS.NUMBER_LOCALIZED:
320
- ++this.#localizedNumber;
321
- break;
322
- case _constants.I18N_STATUS.NUMBER_NOT_LOCALIZED:
323
- ++this.#notLocalizedNumber;
324
- break;
325
- case _constants.I18N_STATUS.CURRENCY_LOCALIZED:
326
- ++this.#localizedCurrency;
327
- break;
328
- case _constants.I18N_STATUS.CURRENCY_NOT_LOCALIZED:
329
- ++this.#notLocalizedCurrency;
330
- break;
331
- case _constants.I18N_STATUS.PERCENTAGE_LOCALIZED:
332
- ++this.#localizedPercentage;
333
- break;
334
- case _constants.I18N_STATUS.PERCENTAGE_NOT_LOCALIZED:
335
- ++this.#notLocalizedPercentage;
336
- break;
337
- case _constants.I18N_STATUS.TRUNCATION_ISSUE:
338
- ++this.#truncation;
339
- break;
340
- case _constants.I18N_STATUS.OVERLAPPING_ISSUE:
341
- ++this.#overlapping;
342
- break;
343
- case _constants.I18N_STATUS.REVIEWED:
344
- ++this.#reviewed;
345
- break;
346
- case _constants.I18N_STATUS.USER_INPUT:
347
- ++this.#userInput;
348
- break;
349
- }
350
- }
351
- toJSON() {
352
- return {
353
- localizedStrings: this.#localizedStrings,
354
- notLocalizedStrings: this.#notLocalizedStrings,
355
- untranslatedStrings: this.#untranslatedStrings,
356
- partialStrings: this.#partialStrings,
357
- localizedDateTime: this.#localizedDateTime,
358
- localizedDate: this.#localizedDate,
359
- localizedTime: this.#localizedTime,
360
- notLocalizedDateTime: this.#notLocalizedDateTime,
361
- notLocalizedDate: this.#notLocalizedDate,
362
- notLocalizedTime: this.#notLocalizedTime,
363
- localizedNumber: this.#localizedNumber,
364
- notLocalizedNumber: this.#notLocalizedNumber,
365
- localizedCurrency: this.#localizedCurrency,
366
- notLocalizedCurrency: this.#notLocalizedCurrency,
367
- localizedPercentage: this.#localizedPercentage,
368
- notLocalizedPercentage: this.#notLocalizedPercentage,
369
- ignored: this.#ignored,
370
- dnt: this.#dnt,
371
- autoIgnored: this.#autoIgnored,
372
- userInput: this.#userInput,
373
- encoding: this.#encoding,
374
- truncation: this.#truncation,
375
- overlapping: this.#overlapping,
376
- reviewed: this.#reviewed
377
- };
378
- }
379
- }
380
- exports.default = StatData;
@@ -1,64 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _stringInfo = _interopRequireDefault(require("./stringInfo.js"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- class StringData {
10
- /**
11
- * @type {{[key: string]: StringInfo[]}}
12
- */
13
- #data = {};
14
- constructor(data) {
15
- if (data) {
16
- for (const string in data) {
17
- data[string].forEach(info => {
18
- if (!this.#data[string]) {
19
- this.#data[string] = [];
20
- }
21
- this.#data[string].push(new _stringInfo.default(info));
22
- });
23
- }
24
- }
25
- }
26
- getStringData(string) {
27
- return this.#data[string] || [];
28
- }
29
- setStringData(string, info) {
30
- !this.#data[string] && (this.#data[string] = []);
31
- this.#data[string].push(new _stringInfo.default(info));
32
- return true;
33
- }
34
- checkAndAdd(string, info) {
35
- !this.#data[string] && (this.#data[string] = []);
36
- const canAdd = this.getStringData(string).some(data => data.getDescription() !== info.description || data.getImagePath() !== info.imagePath || data.getType() !== data.type);
37
- if (canAdd) {
38
- this.setStringData(string, info);
39
- }
40
- return canAdd;
41
- }
42
- hasStringData(string) {
43
- return string in this.#data;
44
- }
45
-
46
- /**
47
- *
48
- * @param {String} string
49
- * @param {Object[] | Object} info
50
- * @returns {StringData}
51
- */
52
- static createNew(string, info) {
53
- info = Array.isArray(info) ? info : [info];
54
- return new StringData({
55
- data: {
56
- [string]: info
57
- }
58
- });
59
- }
60
- toJSON() {
61
- return this.#data;
62
- }
63
- }
64
- exports.default = StringData;
@@ -1,51 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- class StringInfo {
8
- /**
9
- * @type {String}
10
- */
11
- #type;
12
- /**
13
- * @type {String}
14
- */
15
- #imagePath;
16
- /**
17
- * @type {String}
18
- */
19
- #description;
20
- constructor(data) {
21
- this.#type = data?.type || '';
22
- this.#imagePath = data?.imagePath || '';
23
- this.#description = data?.description || '';
24
- }
25
- getType() {
26
- return this.#type;
27
- }
28
- setType(type) {
29
- this.#type = type;
30
- }
31
- getImagePath() {
32
- return this.#imagePath;
33
- }
34
- setImagePath(imagePath) {
35
- this.#imagePath = imagePath;
36
- }
37
- getDescription() {
38
- return this.#description;
39
- }
40
- setDescription(description) {
41
- this.#description = description;
42
- }
43
- toJSON() {
44
- return {
45
- type: this.#type,
46
- description: this.#description,
47
- imagePath: this.#imagePath
48
- };
49
- }
50
- }
51
- exports.default = StringInfo;
@@ -1,8 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getSpacePattern = void 0;
7
- const getSpacePattern = (asStr = true) => asStr ? '(?:\\s|\\t|(?: ))' : /(?:\s|\t|(?: ))/g;
8
- exports.getSpacePattern = getSpacePattern;
@@ -1,59 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _config = _interopRequireDefault(require("../../lib/config.js"));
8
- var _constants = require("../constants.js");
9
- var _logs = _interopRequireDefault(require("../logs.js"));
10
- var _reportData = _interopRequireDefault(require("../objects/reportData.js"));
11
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
- class BaseReport {
13
- /**
14
- * @type {ReportData}
15
- */
16
- #reportData;
17
- /**
18
- * @type {String | any}
19
- */
20
- $generatedContent;
21
- /**
22
- * @type {String}
23
- */
24
- $type;
25
- constructor(type) {
26
- this.$type = type;
27
- }
28
- generate(data) {
29
- this.#reportData = data;
30
- this.$generatedContent = this.buildContent();
31
- }
32
- export(path, name = _constants.DEFAULT_REPORT_NAME) {
33
- this.write(path, name, this.$generatedContent);
34
- _logs.default.info(`Exported consolidated I18n Verification ${this.$type} report in ${path}`);
35
- }
36
- write(path, name, data) {
37
- throw new Error('should be implemented by child report classes');
38
- }
39
- buildContent() {
40
- throw new Error('should be implemented by child report classes');
41
- }
42
-
43
- /**
44
- *
45
- * @returns {{
46
- * appName: String,
47
- * defaultLocale: String,
48
- * reportTime: String,
49
- * }}
50
- */
51
- getMetaInfo() {
52
- return {
53
- defaultLocale: _config.default.getDefaultLocale(),
54
- appName: this.#reportData.getAppName(),
55
- reportTime: this.#reportData.getReportTime()
56
- };
57
- }
58
- }
59
- exports.default = BaseReport;