90dc-core 1.1.15 → 1.2.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "90dc-core",
3
- "version": "1.1.15",
3
+ "version": "1.2.2",
4
4
  "description": "A package that contains utils and interfaces used to create 90dc",
5
5
  "main": "build/index.js",
6
6
  "type": "module",
@@ -20,7 +20,8 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@typescript-eslint/parser": "^5.53.0",
23
- "eslint": "^8.34.0"
23
+ "eslint": "^8.34.0",
24
+ "winston": "^3.8.2"
24
25
  },
25
26
  "repository": {
26
27
  "type": "git",
package/src/index.ts CHANGED
@@ -3,3 +3,6 @@ export * from "./lib/models/ProgramInterfaces";
3
3
  export * from "./lib/models/ExerciseInterfaces";
4
4
  export * from "./lib/models/WorkoutInterfaces";
5
5
  export * from "./lib/models/UserInterfaces";
6
+
7
+ //Utils
8
+ export * from "./lib/utils/Logger"
@@ -0,0 +1,68 @@
1
+ import winston from 'winston'
2
+
3
+ class Logger {
4
+
5
+ private static _serviceName = "";
6
+
7
+ static get serviceName(): string {
8
+ return this._serviceName;
9
+ }
10
+
11
+ static set serviceName(value: string) {
12
+ this._serviceName = value;
13
+ }
14
+
15
+ public static getLogger(){
16
+ const levels = {
17
+ error: 0,
18
+ warn: 1,
19
+ info: 2,
20
+ http: 3,
21
+ debug: 4,
22
+ }
23
+
24
+ const level = () => {
25
+ const env = process.env.NODE_ENV || 'development'
26
+ const isDevelopment = env === 'development'
27
+ return isDevelopment ? 'debug' : 'warn'
28
+ }
29
+
30
+ const colors = {
31
+ error: 'red',
32
+ warn: 'yellow',
33
+ info: 'green',
34
+ http: 'magenta',
35
+ debug: 'white',
36
+ }
37
+
38
+ winston.addColors(colors)
39
+
40
+ const format: winston.Logform.Format = winston.format.combine(
41
+ winston.format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss:ms' }),
42
+ winston.format.colorize({ all: true }),
43
+ winston.format.printf(
44
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
45
+ (info) => `${info.timestamp}@${this._serviceName} ${info.level}: ${info.message}`,
46
+ ),
47
+ )
48
+
49
+ const transports = [
50
+ new winston.transports.Console(),
51
+ new winston.transports.File({
52
+ filename: 'logs/error.log',
53
+ level: 'error',
54
+ }),
55
+ new winston.transports.File({ filename: 'logs/all.log' }),
56
+ ]
57
+ return winston.createLogger({
58
+ level: level(),
59
+ levels,
60
+ format,
61
+ transports,
62
+ })
63
+
64
+ }
65
+ }
66
+
67
+
68
+ export default Logger
@@ -1,443 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="AutoImportSettings">
4
- <option name="autoReloadType" value="SELECTIVE" />
5
- </component>
6
- <component name="ChangeListManager">
7
- <list default="true" id="3605d9a9-7b80-48c8-bc15-d5de0935c6ce" name="Changes" comment="added superset" />
8
- <option name="SHOW_DIALOG" value="false" />
9
- <option name="HIGHLIGHT_CONFLICTS" value="true" />
10
- <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
11
- <option name="LAST_RESOLUTION" value="IGNORE" />
12
- </component>
13
- <component name="Git.Settings">
14
- <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
15
- <option name="RESET_MODE" value="MIXED" />
16
- </component>
17
- <component name="GitHubPullRequestSearchHistory">{
18
- &quot;lastFilter&quot;: {
19
- &quot;state&quot;: &quot;OPEN&quot;
20
- }
21
- }</component>
22
- <component name="GithubPullRequestsUISettings">
23
- <option name="selectedUrlAndAccountId">
24
- <UrlAndAccount>
25
- <option name="accountId" value="96c599de-1a0b-47c1-850a-bf4d5def4a4c" />
26
- <option name="url" value="https://github.com/RomaPchel/90DC-core.git" />
27
- </UrlAndAccount>
28
- </option>
29
- </component>
30
- <component name="MarkdownSettingsMigration">
31
- <option name="stateVersion" value="1" />
32
- </component>
33
- <component name="ProjectId" id="2LgJLRASQf4M5Fay0VB2F8z5hFI" />
34
- <component name="ProjectViewState">
35
- <option name="hideEmptyMiddlePackages" value="true" />
36
- <option name="showLibraryContents" value="true" />
37
- </component>
38
- <component name="PropertiesComponent">{
39
- &quot;keyToString&quot;: {
40
- &quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
41
- &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
42
- &quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;,
43
- &quot;last_opened_file_path&quot;: &quot;/Users/romapchel/Impressie/90DC-core&quot;,
44
- &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
45
- &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
46
- &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
47
- &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
48
- &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
49
- &quot;prettierjs.PrettierConfiguration.Package&quot;: &quot;/Users/romapchel/Impressie/90DC-core/node_modules/prettier&quot;,
50
- &quot;ts.external.directory.path&quot;: &quot;/Users/romapchel/Impressie/90DC-core/node_modules/typescript/lib&quot;,
51
- &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
52
- }
53
- }</component>
54
- <component name="RecentsManager">
55
- <key name="CopyFile.RECENT_KEYS">
56
- <recent name="$PROJECT_DIR$" />
57
- <recent name="$PROJECT_DIR$/src/lib/models" />
58
- <recent name="$PROJECT_DIR$/src/lib/db/models" />
59
- </key>
60
- <key name="MoveFile.RECENT_KEYS">
61
- <recent name="$PROJECT_DIR$/src/lib" />
62
- </key>
63
- </component>
64
- <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
65
- <component name="TaskManager">
66
- <task active="true" id="Default" summary="Default task">
67
- <changelist id="3605d9a9-7b80-48c8-bc15-d5de0935c6ce" name="Changes" comment="" />
68
- <created>1676286735842</created>
69
- <option name="number" value="Default" />
70
- <option name="presentableId" value="Default" />
71
- <updated>1676286735842</updated>
72
- <workItem from="1676286736994" duration="5565000" />
73
- <workItem from="1676892739544" duration="6290000" />
74
- <workItem from="1676981354501" duration="2083000" />
75
- <workItem from="1677068928839" duration="1292000" />
76
- </task>
77
- <task id="LOCAL-00001" summary="first commit">
78
- <created>1676287572469</created>
79
- <option name="number" value="00001" />
80
- <option name="presentableId" value="LOCAL-00001" />
81
- <option name="project" value="LOCAL" />
82
- <updated>1676287572469</updated>
83
- </task>
84
- <task id="LOCAL-00002" summary="first commit">
85
- <created>1676287674738</created>
86
- <option name="number" value="00002" />
87
- <option name="presentableId" value="LOCAL-00002" />
88
- <option name="project" value="LOCAL" />
89
- <updated>1676287674738</updated>
90
- </task>
91
- <task id="LOCAL-00003" summary="first commit">
92
- <created>1676287722605</created>
93
- <option name="number" value="00003" />
94
- <option name="presentableId" value="LOCAL-00003" />
95
- <option name="project" value="LOCAL" />
96
- <updated>1676287722605</updated>
97
- </task>
98
- <task id="LOCAL-00004" summary="first commit">
99
- <created>1676287729453</created>
100
- <option name="number" value="00004" />
101
- <option name="presentableId" value="LOCAL-00004" />
102
- <option name="project" value="LOCAL" />
103
- <updated>1676287729453</updated>
104
- </task>
105
- <task id="LOCAL-00005" summary="first commit">
106
- <created>1676287780883</created>
107
- <option name="number" value="00005" />
108
- <option name="presentableId" value="LOCAL-00005" />
109
- <option name="project" value="LOCAL" />
110
- <updated>1676287780883</updated>
111
- </task>
112
- <task id="LOCAL-00006" summary="first commit">
113
- <created>1676287827422</created>
114
- <option name="number" value="00006" />
115
- <option name="presentableId" value="LOCAL-00006" />
116
- <option name="project" value="LOCAL" />
117
- <updated>1676287827422</updated>
118
- </task>
119
- <task id="LOCAL-00007" summary="first commit">
120
- <created>1676287929319</created>
121
- <option name="number" value="00007" />
122
- <option name="presentableId" value="LOCAL-00007" />
123
- <option name="project" value="LOCAL" />
124
- <updated>1676287929319</updated>
125
- </task>
126
- <task id="LOCAL-00008" summary="first commit">
127
- <created>1676287939101</created>
128
- <option name="number" value="00008" />
129
- <option name="presentableId" value="LOCAL-00008" />
130
- <option name="project" value="LOCAL" />
131
- <updated>1676287939101</updated>
132
- </task>
133
- <task id="LOCAL-00009" summary="first commit">
134
- <created>1676288083606</created>
135
- <option name="number" value="00009" />
136
- <option name="presentableId" value="LOCAL-00009" />
137
- <option name="project" value="LOCAL" />
138
- <updated>1676288083606</updated>
139
- </task>
140
- <task id="LOCAL-00010" summary="first commit">
141
- <created>1676291153824</created>
142
- <option name="number" value="00010" />
143
- <option name="presentableId" value="LOCAL-00010" />
144
- <option name="project" value="LOCAL" />
145
- <updated>1676291153824</updated>
146
- </task>
147
- <task id="LOCAL-00011" summary="first commit">
148
- <created>1676291289322</created>
149
- <option name="number" value="00011" />
150
- <option name="presentableId" value="LOCAL-00011" />
151
- <option name="project" value="LOCAL" />
152
- <updated>1676291289322</updated>
153
- </task>
154
- <task id="LOCAL-00012" summary="first commit">
155
- <created>1676291293921</created>
156
- <option name="number" value="00012" />
157
- <option name="presentableId" value="LOCAL-00012" />
158
- <option name="project" value="LOCAL" />
159
- <updated>1676291293921</updated>
160
- </task>
161
- <task id="LOCAL-00013" summary="first commit">
162
- <created>1676291321072</created>
163
- <option name="number" value="00013" />
164
- <option name="presentableId" value="LOCAL-00013" />
165
- <option name="project" value="LOCAL" />
166
- <updated>1676291321072</updated>
167
- </task>
168
- <task id="LOCAL-00014" summary="first commit">
169
- <created>1676291580912</created>
170
- <option name="number" value="00014" />
171
- <option name="presentableId" value="LOCAL-00014" />
172
- <option name="project" value="LOCAL" />
173
- <updated>1676291580912</updated>
174
- </task>
175
- <task id="LOCAL-00015" summary="first commit">
176
- <created>1676291604693</created>
177
- <option name="number" value="00015" />
178
- <option name="presentableId" value="LOCAL-00015" />
179
- <option name="project" value="LOCAL" />
180
- <updated>1676291604693</updated>
181
- </task>
182
- <task id="LOCAL-00016" summary="added user interfaces">
183
- <created>1676293664870</created>
184
- <option name="number" value="00016" />
185
- <option name="presentableId" value="LOCAL-00016" />
186
- <option name="project" value="LOCAL" />
187
- <updated>1676293664870</updated>
188
- </task>
189
- <task id="LOCAL-00017" summary="added user interfaces">
190
- <created>1676293686927</created>
191
- <option name="number" value="00017" />
192
- <option name="presentableId" value="LOCAL-00017" />
193
- <option name="project" value="LOCAL" />
194
- <updated>1676293686927</updated>
195
- </task>
196
- <task id="LOCAL-00018" summary="added user interfaces">
197
- <created>1676892949800</created>
198
- <option name="number" value="00018" />
199
- <option name="presentableId" value="LOCAL-00018" />
200
- <option name="project" value="LOCAL" />
201
- <updated>1676892949800</updated>
202
- </task>
203
- <task id="LOCAL-00019" summary="added user interfaces">
204
- <created>1676892960524</created>
205
- <option name="number" value="00019" />
206
- <option name="presentableId" value="LOCAL-00019" />
207
- <option name="project" value="LOCAL" />
208
- <updated>1676892960524</updated>
209
- </task>
210
- <task id="LOCAL-00020" summary="added types">
211
- <created>1676893165751</created>
212
- <option name="number" value="00020" />
213
- <option name="presentableId" value="LOCAL-00020" />
214
- <option name="project" value="LOCAL" />
215
- <updated>1676893165751</updated>
216
- </task>
217
- <task id="LOCAL-00021" summary="added types">
218
- <created>1676893740724</created>
219
- <option name="number" value="00021" />
220
- <option name="presentableId" value="LOCAL-00021" />
221
- <option name="project" value="LOCAL" />
222
- <updated>1676893740724</updated>
223
- </task>
224
- <task id="LOCAL-00022" summary="added types and updated files">
225
- <created>1676893870633</created>
226
- <option name="number" value="00022" />
227
- <option name="presentableId" value="LOCAL-00022" />
228
- <option name="project" value="LOCAL" />
229
- <updated>1676893870633</updated>
230
- </task>
231
- <task id="LOCAL-00023" summary="added user interfaces">
232
- <created>1676894429116</created>
233
- <option name="number" value="00023" />
234
- <option name="presentableId" value="LOCAL-00023" />
235
- <option name="project" value="LOCAL" />
236
- <updated>1676894429116</updated>
237
- </task>
238
- <task id="LOCAL-00024" summary="added user interfaces">
239
- <created>1676895137837</created>
240
- <option name="number" value="00024" />
241
- <option name="presentableId" value="LOCAL-00024" />
242
- <option name="project" value="LOCAL" />
243
- <updated>1676895137837</updated>
244
- </task>
245
- <task id="LOCAL-00025" summary="added user interfaces">
246
- <created>1676895678375</created>
247
- <option name="number" value="00025" />
248
- <option name="presentableId" value="LOCAL-00025" />
249
- <option name="project" value="LOCAL" />
250
- <updated>1676895678375</updated>
251
- </task>
252
- <task id="LOCAL-00026" summary="added user interfaces">
253
- <created>1676895763040</created>
254
- <option name="number" value="00026" />
255
- <option name="presentableId" value="LOCAL-00026" />
256
- <option name="project" value="LOCAL" />
257
- <updated>1676895763040</updated>
258
- </task>
259
- <task id="LOCAL-00027" summary="added user interfaces">
260
- <created>1676896037552</created>
261
- <option name="number" value="00027" />
262
- <option name="presentableId" value="LOCAL-00027" />
263
- <option name="project" value="LOCAL" />
264
- <updated>1676896037552</updated>
265
- </task>
266
- <task id="LOCAL-00028" summary="added user interfaces">
267
- <created>1676896046921</created>
268
- <option name="number" value="00028" />
269
- <option name="presentableId" value="LOCAL-00028" />
270
- <option name="project" value="LOCAL" />
271
- <updated>1676896046921</updated>
272
- </task>
273
- <task id="LOCAL-00029" summary="trying to fix">
274
- <created>1676896407562</created>
275
- <option name="number" value="00029" />
276
- <option name="presentableId" value="LOCAL-00029" />
277
- <option name="project" value="LOCAL" />
278
- <updated>1676896407562</updated>
279
- </task>
280
- <task id="LOCAL-00030" summary="trying to fix">
281
- <created>1676896420961</created>
282
- <option name="number" value="00030" />
283
- <option name="presentableId" value="LOCAL-00030" />
284
- <option name="project" value="LOCAL" />
285
- <updated>1676896420961</updated>
286
- </task>
287
- <task id="LOCAL-00031" summary="deleted belongsTo">
288
- <created>1676896550770</created>
289
- <option name="number" value="00031" />
290
- <option name="presentableId" value="LOCAL-00031" />
291
- <option name="project" value="LOCAL" />
292
- <updated>1676896550770</updated>
293
- </task>
294
- <task id="LOCAL-00032" summary="deleted belongsTo">
295
- <created>1676896764542</created>
296
- <option name="number" value="00032" />
297
- <option name="presentableId" value="LOCAL-00032" />
298
- <option name="project" value="LOCAL" />
299
- <updated>1676896764542</updated>
300
- </task>
301
- <task id="LOCAL-00033" summary="deleted db models">
302
- <created>1676981383549</created>
303
- <option name="number" value="00033" />
304
- <option name="presentableId" value="LOCAL-00033" />
305
- <option name="project" value="LOCAL" />
306
- <updated>1676981383549</updated>
307
- </task>
308
- <task id="LOCAL-00034" summary="deleted db models">
309
- <created>1676981433310</created>
310
- <option name="number" value="00034" />
311
- <option name="presentableId" value="LOCAL-00034" />
312
- <option name="project" value="LOCAL" />
313
- <updated>1676981433310</updated>
314
- </task>
315
- <task id="LOCAL-00035" summary="added blueprint interfaces">
316
- <created>1677069224162</created>
317
- <option name="number" value="00035" />
318
- <option name="presentableId" value="LOCAL-00035" />
319
- <option name="project" value="LOCAL" />
320
- <updated>1677069224162</updated>
321
- </task>
322
- <task id="LOCAL-00036" summary="added blueprint interfaces">
323
- <created>1677069235506</created>
324
- <option name="number" value="00036" />
325
- <option name="presentableId" value="LOCAL-00036" />
326
- <option name="project" value="LOCAL" />
327
- <updated>1677069235506</updated>
328
- </task>
329
- <task id="LOCAL-00037" summary="added blueprint interfaces">
330
- <created>1677069249640</created>
331
- <option name="number" value="00037" />
332
- <option name="presentableId" value="LOCAL-00037" />
333
- <option name="project" value="LOCAL" />
334
- <updated>1677069249640</updated>
335
- </task>
336
- <task id="LOCAL-00038" summary="added eslint">
337
- <created>1677069334617</created>
338
- <option name="number" value="00038" />
339
- <option name="presentableId" value="LOCAL-00038" />
340
- <option name="project" value="LOCAL" />
341
- <updated>1677069334617</updated>
342
- </task>
343
- <task id="LOCAL-00039" summary="added eslint">
344
- <created>1677069378570</created>
345
- <option name="number" value="00039" />
346
- <option name="presentableId" value="LOCAL-00039" />
347
- <option name="project" value="LOCAL" />
348
- <updated>1677069378570</updated>
349
- </task>
350
- <task id="LOCAL-00040" summary="added eslint">
351
- <created>1677069400058</created>
352
- <option name="number" value="00040" />
353
- <option name="presentableId" value="LOCAL-00040" />
354
- <option name="project" value="LOCAL" />
355
- <updated>1677069400058</updated>
356
- </task>
357
- <task id="LOCAL-00041" summary="added eslint">
358
- <created>1677069453948</created>
359
- <option name="number" value="00041" />
360
- <option name="presentableId" value="LOCAL-00041" />
361
- <option name="project" value="LOCAL" />
362
- <updated>1677069453948</updated>
363
- </task>
364
- <task id="LOCAL-00042" summary="added eslint">
365
- <created>1677069477083</created>
366
- <option name="number" value="00042" />
367
- <option name="presentableId" value="LOCAL-00042" />
368
- <option name="project" value="LOCAL" />
369
- <updated>1677069477083</updated>
370
- </task>
371
- <task id="LOCAL-00043" summary="added superset">
372
- <created>1677069637233</created>
373
- <option name="number" value="00043" />
374
- <option name="presentableId" value="LOCAL-00043" />
375
- <option name="project" value="LOCAL" />
376
- <updated>1677069637233</updated>
377
- </task>
378
- <task id="LOCAL-00044" summary="added superset">
379
- <created>1677069727942</created>
380
- <option name="number" value="00044" />
381
- <option name="presentableId" value="LOCAL-00044" />
382
- <option name="project" value="LOCAL" />
383
- <updated>1677069727942</updated>
384
- </task>
385
- <task id="LOCAL-00045" summary="added superset">
386
- <created>1677069738704</created>
387
- <option name="number" value="00045" />
388
- <option name="presentableId" value="LOCAL-00045" />
389
- <option name="project" value="LOCAL" />
390
- <updated>1677069738704</updated>
391
- </task>
392
- <task id="LOCAL-00046" summary="added superset">
393
- <created>1677069905073</created>
394
- <option name="number" value="00046" />
395
- <option name="presentableId" value="LOCAL-00046" />
396
- <option name="project" value="LOCAL" />
397
- <updated>1677069905073</updated>
398
- </task>
399
- <task id="LOCAL-00047" summary="added superset">
400
- <created>1677070126725</created>
401
- <option name="number" value="00047" />
402
- <option name="presentableId" value="LOCAL-00047" />
403
- <option name="project" value="LOCAL" />
404
- <updated>1677070126725</updated>
405
- </task>
406
- <task id="LOCAL-00048" summary="added superset">
407
- <created>1677070154603</created>
408
- <option name="number" value="00048" />
409
- <option name="presentableId" value="LOCAL-00048" />
410
- <option name="project" value="LOCAL" />
411
- <updated>1677070154603</updated>
412
- </task>
413
- <option name="localTasksCounter" value="49" />
414
- <servers />
415
- </component>
416
- <component name="TypeScriptGeneratedFilesManager">
417
- <option name="version" value="3" />
418
- </component>
419
- <component name="Vcs.Log.Tabs.Properties">
420
- <option name="TAB_STATES">
421
- <map>
422
- <entry key="MAIN">
423
- <value>
424
- <State />
425
- </value>
426
- </entry>
427
- </map>
428
- </option>
429
- </component>
430
- <component name="VcsManagerConfiguration">
431
- <MESSAGE value="first commit" />
432
- <MESSAGE value="added types" />
433
- <MESSAGE value="added types and updated files" />
434
- <MESSAGE value="added user interfaces" />
435
- <MESSAGE value="trying to fix" />
436
- <MESSAGE value="deleted belongsTo" />
437
- <MESSAGE value="deleted db models" />
438
- <MESSAGE value="added blueprint interfaces" />
439
- <MESSAGE value="added eslint" />
440
- <MESSAGE value="added superset" />
441
- <option name="LAST_COMMIT_MESSAGE" value="added superset" />
442
- </component>
443
- </project>