@futdevpro/fsm-dynamo 0.0.1

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 (41) hide show
  1. package/README.md +24 -0
  2. package/esm2020/futdevpro-fsm-dynamo.mjs +5 -0
  3. package/esm2020/lib/_constants/module-settings/test-module-settings.mjs +13 -0
  4. package/esm2020/lib/_constants/module-settings/usage-module-settings.mjs +10 -0
  5. package/esm2020/lib/_constants/times.mjs +8 -0
  6. package/esm2020/lib/_models/control-models/daily-usage-data.mjs +18 -0
  7. package/esm2020/lib/_models/control-models/dynamo-module-settings.mjs +2 -0
  8. package/esm2020/lib/_models/control-models/dynamobe-data-params.mjs +8 -0
  9. package/esm2020/lib/_models/control-models/dynamobe-data-property-params.mjs +63 -0
  10. package/esm2020/lib/_models/control-models/dynamobe-error.mjs +183 -0
  11. package/esm2020/lib/_models/control-models/geo-ip-location.mjs +2 -0
  12. package/esm2020/lib/_models/control-models/location-coordinates.mjs +2 -0
  13. package/esm2020/lib/_models/control-models/usage-action.mjs +9 -0
  14. package/esm2020/lib/_models/control-models/usage-data.mjs +12 -0
  15. package/esm2020/lib/_models/data-models/custom-data.mjs +24 -0
  16. package/esm2020/lib/_models/data-models/metadata.mjs +13 -0
  17. package/esm2020/lib/_models/data-models/usage-session.mjs +49 -0
  18. package/esm2020/public-api.mjs +20 -0
  19. package/fesm2015/futdevpro-fsm-dynamo.mjs +415 -0
  20. package/fesm2015/futdevpro-fsm-dynamo.mjs.map +1 -0
  21. package/fesm2020/futdevpro-fsm-dynamo.mjs +413 -0
  22. package/fesm2020/futdevpro-fsm-dynamo.mjs.map +1 -0
  23. package/futdevpro-fsm-dynamo-0.0.1.tgz +0 -0
  24. package/index.d.ts +5 -0
  25. package/lib/_constants/module-settings/test-module-settings.d.ts +2 -0
  26. package/lib/_constants/module-settings/usage-module-settings.d.ts +2 -0
  27. package/lib/_constants/times.d.ts +7 -0
  28. package/lib/_models/control-models/daily-usage-data.d.ts +17 -0
  29. package/lib/_models/control-models/dynamo-module-settings.d.ts +6 -0
  30. package/lib/_models/control-models/dynamobe-data-params.d.ts +10 -0
  31. package/lib/_models/control-models/dynamobe-data-property-params.d.ts +27 -0
  32. package/lib/_models/control-models/dynamobe-error.d.ts +18 -0
  33. package/lib/_models/control-models/geo-ip-location.d.ts +25 -0
  34. package/lib/_models/control-models/location-coordinates.d.ts +4 -0
  35. package/lib/_models/control-models/usage-action.d.ts +8 -0
  36. package/lib/_models/control-models/usage-data.d.ts +13 -0
  37. package/lib/_models/data-models/custom-data.d.ts +15 -0
  38. package/lib/_models/data-models/metadata.d.ts +16 -0
  39. package/lib/_models/data-models/usage-session.d.ts +33 -0
  40. package/package.json +32 -0
  41. package/public-api.d.ts +14 -0
@@ -0,0 +1,413 @@
1
+ const second = 1000;
2
+ const minute = second * 60;
3
+ const hour = minute * 60;
4
+ const day = hour * 24;
5
+ const week = day * 7;
6
+ const month = day * 30.4368499;
7
+ const year = day * 365.242199;
8
+
9
+ const testModuleSettings = {
10
+ mainRoute: '/test',
11
+ endPoints: {
12
+ testGet: '/test-get',
13
+ testPost: '/test-post',
14
+ testPut: '/test-put',
15
+ testPatch: '/test-patch',
16
+ testDelete: '/test-delete',
17
+ getCustomData: '/custom/get/:customId',
18
+ modifyCustomData: '/custom/post'
19
+ }
20
+ };
21
+
22
+ const usageModuleSettings = {
23
+ mainRoute: '/usage',
24
+ endPoints: {
25
+ newSession: '/new-session',
26
+ closeSession: '/close-session/:sessionId',
27
+ updateUsage: '/update/:sessionId',
28
+ getAllUsageData: '/get/all',
29
+ }
30
+ };
31
+
32
+ class DailyUsageData {
33
+ constructor(set) {
34
+ this.totalVisitTime = 0;
35
+ this.averageVisitTime = 0;
36
+ this.visitorsHun = 0;
37
+ this.visitorsElse = 0;
38
+ this.visitations = [];
39
+ if (set) {
40
+ this.date = set.date;
41
+ this.totalVisitTime = set.totalVisitTime ? set.totalVisitTime : 0;
42
+ this.averageVisitTime = set.averageVisitTime ? set.averageVisitTime : 0;
43
+ this.visitorsHun = set.visitorsHun ? set.visitorsHun : 0;
44
+ this.visitorsElse = set.visitorsElse ? set.visitorsElse : 0;
45
+ this.visitations = set.visitations ? set.visitations : [];
46
+ }
47
+ }
48
+ }
49
+
50
+ class DynamoBEDataParams {
51
+ constructor(set) {
52
+ this.dataName = set.dataName;
53
+ this.dbName = set.dataName.charAt(0).toUpperCase() + set.dataName.slice(1);
54
+ this.modelParams = set.modelParams ? set.modelParams : [];
55
+ }
56
+ }
57
+
58
+ class DynamoBEError {
59
+ constructor(set) {
60
+ this.flag = 'DYNAMO-BE ERROR OBJECT';
61
+ this.errors = [];
62
+ this.messages = [];
63
+ this.userMessages = [];
64
+ this.handled = !!set.handled;
65
+ if (set.status) {
66
+ this.status = set.status;
67
+ }
68
+ this.status = set?.error?.status ? set.error.status : set.status;
69
+ if (set?.error?.errors) {
70
+ this.errors = this.errors.concat(set?.error?.errors);
71
+ }
72
+ if (set?.error?.messages) {
73
+ this.messages = this.messages.concat(set?.error?.messages);
74
+ }
75
+ if (set?.error?.userMessages) {
76
+ this.userMessages = this.userMessages.concat(set?.error?.userMessages);
77
+ }
78
+ if (set.error) {
79
+ if (set.error instanceof DynamoBEError) {
80
+ this.errors.push(set.error.error);
81
+ }
82
+ else {
83
+ if (set.error.error) {
84
+ this.errors.push(set.error.error);
85
+ }
86
+ this.errors.push(set.error);
87
+ }
88
+ if (set.error.message) {
89
+ this.messages.push(set.error.message);
90
+ }
91
+ if (set.error.status) {
92
+ this.status = set.error.status;
93
+ }
94
+ }
95
+ if (set.message) {
96
+ this.messages.push(set.message);
97
+ }
98
+ if (set.messages) {
99
+ this.messages.push(...set.messages);
100
+ }
101
+ if (set.userMessage) {
102
+ this.userMessages.push(set.userMessage);
103
+ }
104
+ if (set.consoleLog) {
105
+ console.log(this);
106
+ }
107
+ }
108
+ }
109
+ /*
110
+
111
+ // //
112
+ // RESPONSE STATUS //
113
+ // //
114
+
115
+ 1XX informational response
116
+
117
+ 100 Continue
118
+ 101 Switching Protocols
119
+ 102 Processing
120
+ 103 Early Hints
121
+
122
+
123
+ 2XX success
124
+
125
+ 200 OK
126
+ 201 Created
127
+ 202 Accepted
128
+ 203 Non-Authoritative Information
129
+ 204 No Content
130
+ 205 Reset Content
131
+ 206 Partial Content
132
+ 207 Multi-Status
133
+ 208 Already Reported
134
+ 226 IM Used
135
+
136
+
137
+ 3XX redirection
138
+
139
+ 300 Multiple Choices
140
+ 301 Moved Permanently
141
+ 302 Found
142
+ 303 See Other
143
+ 304 Not Modified
144
+ 305 Use Proxy
145
+ 306 Switch Proxy
146
+ 307 Temporary Redirect
147
+ 308 Permanent Redirect
148
+
149
+
150
+ 4XX client errors
151
+
152
+ 400 Bad Request
153
+ 401 Unauthorized
154
+ 402 Payment Required
155
+ 403 Forbidden
156
+ 404 Not Found
157
+ 405 Method Not Allowed
158
+ 406 Not Acceptable
159
+ 407 Proxy Authentication Required
160
+ 408 Request Timeout
161
+ 409 Conflict
162
+ 410 Gone
163
+ 411 Length Required
164
+ 412 Precondition Failed
165
+ 413 Payload Too Large
166
+ 414 URI Too Long
167
+ 415 Unsupported Media Type
168
+ 416 Range Not Satisfiable
169
+ 417 Expectation Failed
170
+ 418 I'm a teapot
171
+ 421 Misdirected Request
172
+ 422 Unprocessable Entity
173
+ 423 Locked
174
+ 424 Failed Dependency
175
+ 425 Too Early
176
+ 426 Upgrade Required
177
+ 428 Precondition Required
178
+ 429 Too Many Requests
179
+ 431 Request Header Fields Too Large
180
+ 451 Unavailable For Legal Reasons
181
+
182
+
183
+ 5XX server errors
184
+
185
+ 500 Internal Server Error
186
+ 501 Not Implemented
187
+ 502 Bad Gateway
188
+ 503 Service Unavailable
189
+ 504 Gateway Timeout
190
+ 505 HTTP Version Not Supported
191
+ 506 Variant Also Negotiates
192
+ 507 Insufficient Storage
193
+ 508 Loop Detected
194
+ 510 Not Extended
195
+ 511 Network Authentication Required
196
+
197
+
198
+ Unofficial codes
199
+
200
+ 103 Checkpoint
201
+ 218 This is fine (Apache Web Server)
202
+ 419 Page Expired (Laravel Framework)
203
+ 420 Enhance Your Calm (Twitter)
204
+ 430 Request Header Fields Too Large (Shopify)
205
+ 450 Blocked by Windows Parental Controls (Microsoft)
206
+ 498 Invalid Token (Esri)
207
+ 499 Token Required (Esri)
208
+ 509 Bandwidth Limit Exceeded (Apache Web Server/cPanel)
209
+ 526 Invalid SSL Certificate
210
+ 529 Site is overloaded
211
+ 530 Site is frozen
212
+ 598 (Informal convention) Network read timeout error
213
+
214
+ 440 Login Time-out
215
+ 449 Retry With
216
+ 451 Redirect
217
+
218
+ 444 No Response
219
+ 494 Request header too large
220
+ 495 SSL Certificate Error
221
+ 496 SSL Certificate Required
222
+ 497 HTTP Request Sent to HTTPS Port
223
+ 499 Client Closed Request
224
+
225
+ 520 Web Server Returned an Unknown Error
226
+ 521 Web Server Is Down
227
+ 522 Connection Timed Out
228
+ 523 Origin Is Unreachable
229
+ 524 A Timeout Occurred
230
+ 525 SSL Handshake Failed
231
+ 526 Invalid SSL Certificate
232
+ 527 Railgun Error
233
+
234
+ 530
235
+
236
+ 460
237
+ 463
238
+
239
+ */
240
+
241
+ class DynamoBEDataPropertyParams {
242
+ constructor(set) {
243
+ this.subObjectParams = [];
244
+ if (set) {
245
+ this.key = set.key;
246
+ this.type = set.type;
247
+ if (this.getBEType) {
248
+ if (set?.subObjectParams) {
249
+ this.subObjectParams = set.subObjectParams;
250
+ }
251
+ else {
252
+ console.log('DYNAMO ERROR: \n subObjectParams missing', '\n\n', new Error());
253
+ throw new DynamoBEError({ message: 'subObjectParams missing' });
254
+ }
255
+ }
256
+ if (set.isDependencyHook) {
257
+ if (set.dependencyDBServiceName) {
258
+ this.isDependencyHook = set.isDependencyHook;
259
+ this.dependencyName = set.dependencyDBServiceName;
260
+ }
261
+ else {
262
+ this.isDependencyHook = set.isDependencyHook;
263
+ console.log('DYNAMO ERROR: \n dependencyDBServiceName missing for dependencyHook', '\n\n', new Error());
264
+ }
265
+ }
266
+ this.unique = set.unique;
267
+ this.required = set.required;
268
+ this.index = set.index;
269
+ this.minlength = set.minlength;
270
+ this.maxlength = set.maxlength;
271
+ this.additionalValidators = set.additionalValidators;
272
+ }
273
+ else {
274
+ console.log('DYNAMO ERROR: \nMISSING DynamoBEDataPropertyParams constructor input', '\n\n', new Error());
275
+ }
276
+ }
277
+ // tslint:disable-next-line: ban-types
278
+ getBEType() {
279
+ switch (this.type) {
280
+ case 'string':
281
+ return String;
282
+ case 'number':
283
+ return Number;
284
+ case 'boolean':
285
+ return Boolean;
286
+ case 'Date':
287
+ return Date;
288
+ case 'object':
289
+ default:
290
+ if (this.type?.includes('[]')) {
291
+ return Array;
292
+ }
293
+ else if (this.type?.includes('=>') || this.type?.includes('function')) {
294
+ return Function;
295
+ }
296
+ else {
297
+ return Object;
298
+ }
299
+ }
300
+ }
301
+ }
302
+
303
+ class DynamoUsageAction {
304
+ constructor(set) {
305
+ if (set) {
306
+ this.action = set.action;
307
+ this.time = set.time;
308
+ }
309
+ }
310
+ }
311
+
312
+ class DynamoUsageData {
313
+ constructor(set) {
314
+ this.actions = [];
315
+ if (set) {
316
+ this.page = set.page;
317
+ this.opened = set.opened;
318
+ this.timeSpentOnPage = set.timeSpentOnPage;
319
+ this.actions = set.actions ? set.actions : [];
320
+ }
321
+ }
322
+ }
323
+
324
+ class Metadata {
325
+ constructor(set) {
326
+ if (set) {
327
+ this._id = set._id;
328
+ this.__created = set.__created;
329
+ this.__createdBy = set.__createdBy;
330
+ this.__lastModified = set.__lastModified;
331
+ this.__lastModifiedBy = set.__lastModifiedBy;
332
+ this.__v = set.__v;
333
+ }
334
+ }
335
+ }
336
+
337
+ class CustomData extends Metadata {
338
+ constructor(set) {
339
+ super({
340
+ _id: set?._id,
341
+ __v: set?.__v,
342
+ __created: set?.__created,
343
+ __createdBy: set?.__createdBy,
344
+ __lastModified: set?.__lastModified,
345
+ __lastModifiedBy: set?.__lastModifiedBy,
346
+ });
347
+ if (set) {
348
+ this.data = set.data;
349
+ }
350
+ }
351
+ }
352
+ const customDataModelParams = new DynamoBEDataParams({
353
+ dataName: 'customData',
354
+ modelParams: [
355
+ { key: 'data', type: 'string', required: true },
356
+ ]
357
+ });
358
+
359
+ class DynamoUsageSession extends Metadata {
360
+ constructor(set) {
361
+ super({
362
+ _id: set?._id,
363
+ __created: set?.__created,
364
+ __createdBy: set?.__createdBy,
365
+ __lastModified: set?.__lastModified,
366
+ __lastModifiedBy: set?.__lastModifiedBy,
367
+ __v: set?.__v,
368
+ });
369
+ if (set) {
370
+ if (set.date) {
371
+ this.date = set.date;
372
+ }
373
+ else if (set.sessionStart) {
374
+ this.date = set.sessionStart.toISOString().substring(0, 10);
375
+ }
376
+ this.sessionStart = set.sessionStart;
377
+ this.sessionEnd = set.sessionEnd;
378
+ this.address = set.address;
379
+ this.issuer = set.issuer;
380
+ this.locationData = set.locationData;
381
+ this.usageData = set.usageData ? set.usageData : [];
382
+ this.totalSessionTime = set.totalSessionTime;
383
+ this.loggedInAs = set.loggedInAs;
384
+ }
385
+ }
386
+ }
387
+ const usageSessionModelParams = new DynamoBEDataParams({
388
+ dataName: 'usageSession',
389
+ modelParams: [
390
+ { key: 'date', type: 'string',
391
+ required: true, index: true
392
+ },
393
+ { key: 'sessionStart', type: 'Date',
394
+ required: true, index: true
395
+ },
396
+ { key: 'sessionEnd', type: 'Date' },
397
+ { key: 'address', type: 'string' },
398
+ { key: 'issuer', type: 'string' },
399
+ { key: 'locationData', type: 'IpApiLocation' },
400
+ { key: 'usageData', type: 'UsageData[]' },
401
+ { key: 'totalSessionTime', type: 'number' },
402
+ { key: 'loggedInAs', type: 'string' },
403
+ ]
404
+ });
405
+
406
+ // CONSTANTS
407
+
408
+ /**
409
+ * Generated bundle index. Do not edit.
410
+ */
411
+
412
+ export { CustomData, DailyUsageData, DynamoBEDataParams, DynamoBEDataPropertyParams, DynamoBEError, DynamoUsageAction, DynamoUsageData, DynamoUsageSession, Metadata, customDataModelParams, day, hour, minute, month, second, testModuleSettings, usageModuleSettings, usageSessionModelParams, week, year };
413
+ //# sourceMappingURL=futdevpro-fsm-dynamo.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"futdevpro-fsm-dynamo.mjs","sources":["../../../../projects/futdevpro/fsm-dynamo/src/lib/_constants/times.ts","../../../../projects/futdevpro/fsm-dynamo/src/lib/_constants/module-settings/test-module-settings.ts","../../../../projects/futdevpro/fsm-dynamo/src/lib/_constants/module-settings/usage-module-settings.ts","../../../../projects/futdevpro/fsm-dynamo/src/lib/_models/control-models/daily-usage-data.ts","../../../../projects/futdevpro/fsm-dynamo/src/lib/_models/control-models/dynamobe-data-params.ts","../../../../projects/futdevpro/fsm-dynamo/src/lib/_models/control-models/dynamobe-error.ts","../../../../projects/futdevpro/fsm-dynamo/src/lib/_models/control-models/dynamobe-data-property-params.ts","../../../../projects/futdevpro/fsm-dynamo/src/lib/_models/control-models/usage-action.ts","../../../../projects/futdevpro/fsm-dynamo/src/lib/_models/control-models/usage-data.ts","../../../../projects/futdevpro/fsm-dynamo/src/lib/_models/data-models/metadata.ts","../../../../projects/futdevpro/fsm-dynamo/src/lib/_models/data-models/custom-data.ts","../../../../projects/futdevpro/fsm-dynamo/src/lib/_models/data-models/usage-session.ts","../../../../projects/futdevpro/fsm-dynamo/src/public-api.ts","../../../../projects/futdevpro/fsm-dynamo/src/futdevpro-fsm-dynamo.ts"],"sourcesContent":["\r\nexport const second = 1000;\r\nexport const minute = second * 60;\r\nexport const hour = minute * 60;\r\nexport const day = hour * 24;\r\nexport const week = day * 7;\r\nexport const month = day * 30.4368499;\r\nexport const year = day * 365.242199;\r\n","\r\nimport { DynamoModuleSettings } from '../../_models/control-models/dynamo-module-settings';\r\n\r\nexport const testModuleSettings: DynamoModuleSettings = {\r\n mainRoute: '/test',\r\n endPoints: {\r\n testGet: '/test-get',\r\n testPost: '/test-post',\r\n testPut: '/test-put',\r\n testPatch: '/test-patch',\r\n testDelete: '/test-delete',\r\n getCustomData: '/custom/get/:customId',\r\n modifyCustomData: '/custom/post'\r\n }\r\n};\r\n","\r\nimport { DynamoModuleSettings } from '../../_models/control-models/dynamo-module-settings';\r\n\r\nexport const usageModuleSettings: DynamoModuleSettings = {\r\n mainRoute: '/usage',\r\n endPoints: {\r\n newSession: '/new-session',\r\n closeSession: '/close-session/:sessionId',\r\n updateUsage: '/update/:sessionId',\r\n getAllUsageData: '/get/all',\r\n }\r\n};\r\n","\r\nimport { DynamoUsageSession } from \"../data-models/usage-session\";\r\n\r\nexport class DailyUsageData {\r\n date?: string;\r\n totalVisitTime?: number = 0;\r\n averageVisitTime?: number = 0;\r\n visitorsHun?: number = 0;\r\n visitorsElse?: number = 0;\r\n\r\n visitations?: DynamoUsageSession[] = [];\r\n\r\n constructor(\r\n set?: {\r\n date?: string,\r\n totalVisitTime?: number,\r\n averageVisitTime?: number,\r\n visitorsHun?: number,\r\n visitorsElse?: number,\r\n\r\n visitations?: DynamoUsageSession[],\r\n }\r\n ) {\r\n if (set) {\r\n this.date = set.date;\r\n this.totalVisitTime = set.totalVisitTime ? set.totalVisitTime : 0;\r\n this.averageVisitTime = set.averageVisitTime ? set.averageVisitTime : 0;\r\n this.visitorsHun = set.visitorsHun ? set.visitorsHun : 0;\r\n this.visitorsElse = set.visitorsElse ? set.visitorsElse : 0;\r\n\r\n this.visitations = set.visitations ? set.visitations : [];\r\n }\r\n }\r\n}\r\n","\r\nimport { DynamoBEDataPropertyParams } from './dynamobe-data-property-params';\r\n\r\nexport class DynamoBEDataParams {\r\n dataName: string;\r\n dbName: string;\r\n modelParams: DynamoBEDataPropertyParams[];\r\n\r\n constructor(\r\n set: {\r\n dataName: string,\r\n modelParams: DynamoBEDataPropertyParams[],\r\n }\r\n ) {\r\n this.dataName = set.dataName;\r\n this.dbName = set.dataName.charAt(0).toUpperCase() + set.dataName.slice(1);\r\n this.modelParams = set.modelParams ? set.modelParams : [];\r\n }\r\n}\r\n","\r\n\r\nexport class DynamoBEError {\r\n flag = 'DYNAMO-BE ERROR OBJECT';\r\n handled: boolean;\r\n status: number;\r\n errors: any[] = [];\r\n error: any;\r\n messages: string[] = [];\r\n userMessages: string[] = [];\r\n\r\n constructor(\r\n set: {\r\n handled?: boolean;\r\n status?: number,\r\n message?: string,\r\n messages?: string[],\r\n userMessage?: string,\r\n error?: any,\r\n consoleLog?: boolean,\r\n }\r\n ) {\r\n this.handled = !!set.handled;\r\n if (set.status) {\r\n this.status = set.status;\r\n }\r\n this.status = set?.error?.status ? set.error.status : set.status;\r\n\r\n if (set?.error?.errors) {\r\n this.errors = this.errors.concat(set?.error?.errors);\r\n }\r\n if (set?.error?.messages) {\r\n this.messages = this.messages.concat(set?.error?.messages);\r\n }\r\n if (set?.error?.userMessages) {\r\n this.userMessages = this.userMessages.concat(set?.error?.userMessages);\r\n }\r\n\r\n if (set.error) {\r\n if (set.error instanceof DynamoBEError) {\r\n this.errors.push(set.error.error);\r\n } else {\r\n if (set.error.error) {\r\n this.errors.push(set.error.error);\r\n }\r\n this.errors.push(set.error);\r\n }\r\n if (set.error.message) {\r\n this.messages.push(set.error.message);\r\n }\r\n if (set.error.status) {\r\n this.status = set.error.status;\r\n }\r\n }\r\n if (set.message) {\r\n this.messages.push(set.message)\r\n }\r\n if (set.messages) {\r\n this.messages.push(...set.messages)\r\n }\r\n if (set.userMessage) {\r\n this.userMessages.push(set.userMessage)\r\n }\r\n if (set.consoleLog) {\r\n console.log(this);\r\n }\r\n }\r\n}\r\n\r\n/*\r\n\r\n// //\r\n// RESPONSE STATUS //\r\n// //\r\n\r\n1XX informational response\r\n\r\n 100 Continue\r\n 101 Switching Protocols\r\n 102 Processing\r\n 103 Early Hints\r\n\r\n\r\n2XX success\r\n\r\n 200 OK\r\n 201 Created\r\n 202 Accepted\r\n 203 Non-Authoritative Information\r\n 204 No Content\r\n 205 Reset Content\r\n 206 Partial Content \r\n 207 Multi-Status\r\n 208 Already Reported\r\n 226 IM Used\r\n\r\n \r\n3XX redirection\r\n\r\n 300 Multiple Choices\r\n 301 Moved Permanently\r\n 302 Found\r\n 303 See Other\r\n 304 Not Modified\r\n 305 Use Proxy\r\n 306 Switch Proxy\r\n 307 Temporary Redirect\r\n 308 Permanent Redirect\r\n\r\n\r\n4XX client errors\r\n\r\n 400 Bad Request\r\n 401 Unauthorized\r\n 402 Payment Required\r\n 403 Forbidden\r\n 404 Not Found\r\n 405 Method Not Allowed\r\n 406 Not Acceptable\r\n 407 Proxy Authentication Required\r\n 408 Request Timeout\r\n 409 Conflict\r\n 410 Gone\r\n 411 Length Required\r\n 412 Precondition Failed\r\n 413 Payload Too Large \r\n 414 URI Too Long\r\n 415 Unsupported Media Type\r\n 416 Range Not Satisfiable\r\n 417 Expectation Failed\r\n 418 I'm a teapot\r\n 421 Misdirected Request\r\n 422 Unprocessable Entity\r\n 423 Locked\r\n 424 Failed Dependency\r\n 425 Too Early\r\n 426 Upgrade Required\r\n 428 Precondition Required\r\n 429 Too Many Requests\r\n 431 Request Header Fields Too Large\r\n 451 Unavailable For Legal Reasons\r\n\r\n\r\n5XX server errors\r\n\r\n 500 Internal Server Error\r\n 501 Not Implemented\r\n 502 Bad Gateway\r\n 503 Service Unavailable\r\n 504 Gateway Timeout\r\n 505 HTTP Version Not Supported\r\n 506 Variant Also Negotiates\r\n 507 Insufficient Storage\r\n 508 Loop Detected \r\n 510 Not Extended\r\n 511 Network Authentication Required\r\n\r\n\r\nUnofficial codes\r\n\r\n 103 Checkpoint\r\n 218 This is fine (Apache Web Server)\r\n 419 Page Expired (Laravel Framework)\r\n 420 Enhance Your Calm (Twitter)\r\n 430 Request Header Fields Too Large (Shopify)\r\n 450 Blocked by Windows Parental Controls (Microsoft)\r\n 498 Invalid Token (Esri)\r\n 499 Token Required (Esri)\r\n 509 Bandwidth Limit Exceeded (Apache Web Server/cPanel)\r\n 526 Invalid SSL Certificate\r\n 529 Site is overloaded\r\n 530 Site is frozen\r\n 598 (Informal convention) Network read timeout error\r\n\r\n 440 Login Time-out\r\n 449 Retry With\r\n 451 Redirect\r\n\r\n 444 No Response\r\n 494 Request header too large\r\n 495 SSL Certificate Error\r\n 496 SSL Certificate Required\r\n 497 HTTP Request Sent to HTTPS Port\r\n 499 Client Closed Request\r\n\r\n 520 Web Server Returned an Unknown Error\r\n 521 Web Server Is Down\r\n 522 Connection Timed Out\r\n 523 Origin Is Unreachable\r\n 524 A Timeout Occurred\r\n 525 SSL Handshake Failed\r\n 526 Invalid SSL Certificate\r\n 527 Railgun Error\r\n\r\n 530\r\n\r\n 460\r\n 463\r\n\r\n*/","\r\nimport { DynamoBEError } from './dynamobe-error';\r\n\r\nexport class DynamoBEDataPropertyParams {\r\n key?: string;\r\n type?: 'string' | 'number' | 'boolean' | 'Date' | 'object' | string;\r\n\r\n unique?: boolean;\r\n required?: boolean;\r\n index?: boolean;\r\n\r\n isDependencyHook?: boolean;\r\n dependencyName?: string;\r\n\r\n minlength?: number;\r\n maxlength?: number;\r\n\r\n subObjectParams?: DynamoBEDataPropertyParams[] = [];\r\n\r\n additionalValidators?: ((data: any) => void)[];\r\n\r\n constructor(\r\n set: {\r\n key: string,\r\n type: 'string' | 'number' | 'boolean' | 'Date' | 'object' | string,\r\n\r\n unique?: boolean,\r\n required?: boolean,\r\n index?: boolean,\r\n\r\n isDependencyHook?: boolean,\r\n dependencyDBServiceName?: string,\r\n\r\n minlength?: number,\r\n maxlength?: number,\r\n\r\n subObjectParams?: DynamoBEDataPropertyParams[],\r\n\r\n additionalValidators?: ((data: any) => void)[],\r\n }\r\n ) {\r\n\r\n if (set) {\r\n this.key = set.key;\r\n this.type = set.type;\r\n\r\n if (this.getBEType) {\r\n if (set?.subObjectParams) {\r\n this.subObjectParams = set.subObjectParams;\r\n } else {\r\n console.log('DYNAMO ERROR: \\n subObjectParams missing', '\\n\\n', new Error());\r\n throw new DynamoBEError({ message: 'subObjectParams missing' });\r\n }\r\n }\r\n\r\n if (set.isDependencyHook) {\r\n if (set.dependencyDBServiceName) {\r\n this.isDependencyHook = set.isDependencyHook;\r\n this.dependencyName = set.dependencyDBServiceName;\r\n } else {\r\n this.isDependencyHook = set.isDependencyHook;\r\n console.log('DYNAMO ERROR: \\n dependencyDBServiceName missing for dependencyHook', '\\n\\n', new Error());\r\n }\r\n }\r\n this.unique = set.unique;\r\n this.required = set.required;\r\n this.index = set.index;\r\n this.minlength = set.minlength;\r\n this.maxlength = set.maxlength;\r\n this.additionalValidators = set.additionalValidators;\r\n } else {\r\n console.log('DYNAMO ERROR: \\nMISSING DynamoBEDataPropertyParams constructor input', '\\n\\n', new Error());\r\n }\r\n }\r\n\r\n // tslint:disable-next-line: ban-types\r\n getBEType?(): String | Number | Boolean | Object | Function | Array<any> | Date {\r\n switch (this.type) {\r\n case 'string':\r\n return String;\r\n case 'number':\r\n return Number;\r\n case 'boolean':\r\n return Boolean;\r\n case 'Date':\r\n return Date;\r\n case 'object':\r\n default:\r\n if (this.type?.includes('[]')) {\r\n return Array;\r\n } else if (this.type?.includes('=>') || this.type?.includes('function')) {\r\n return Function;\r\n } else {\r\n return Object;\r\n }\r\n }\r\n }\r\n}\r\n","\r\nexport class DynamoUsageAction {\r\n action?: string;\r\n time?: Date;\r\n\r\n constructor(\r\n set?: {\r\n action?: string,\r\n time?: Date,\r\n }\r\n ) {\r\n if (set) {\r\n this.action = set.action;\r\n this.time = set.time;\r\n }\r\n }\r\n}\r\n\r\n","\r\nimport { DynamoUsageAction } from './usage-action';\r\n\r\nexport class DynamoUsageData {\r\n page?: string;\r\n opened?: Date;\r\n timeSpentOnPage?: number;\r\n actions?: DynamoUsageAction[] = [];\r\n\r\n constructor(\r\n set?: {\r\n page?: string,\r\n opened?: Date;\r\n timeSpentOnPage?: number,\r\n actions?: DynamoUsageAction[],\r\n }\r\n ) {\r\n if (set) {\r\n this.page = set.page;\r\n this.opened = set.opened;\r\n this.timeSpentOnPage = set.timeSpentOnPage;\r\n this.actions = set.actions ? set.actions : [];\r\n }\r\n }\r\n}\r\n\r\n","\r\n\r\nexport class Metadata {\r\n _id?: string;\r\n __created?: Date;\r\n __createdBy?: string;\r\n __lastModified?: Date;\r\n __lastModifiedBy?: string;\r\n __v?: number;\r\n\r\n constructor(\r\n set?: {\r\n _id?: string,\r\n __created?: Date,\r\n __createdBy?: string,\r\n __lastModified?: Date,\r\n __lastModifiedBy?: string,\r\n __v?: number;\r\n } | Metadata\r\n ){\r\n if (set) {\r\n this._id = set._id;\r\n this.__created = set.__created;\r\n this.__createdBy = set.__createdBy;\r\n this.__lastModified = set.__lastModified;\r\n this.__lastModifiedBy = set.__lastModifiedBy;\r\n this.__v = set.__v;\r\n }\r\n }\r\n}\r\n","\r\nimport { DynamoBEDataParams } from '../control-models/dynamobe-data-params';\r\nimport { Metadata } from './metadata';\r\n\r\nexport class CustomData extends Metadata {\r\n data?: string;\r\n\r\n constructor(\r\n set?: {\r\n _id?: string,\r\n\r\n data?: string,\r\n \r\n __v?: number,\r\n __created?: Date,\r\n __createdBy?: string,\r\n __lastModified?: Date,\r\n __lastModifiedBy?: string,\r\n }\r\n ) {\r\n super({\r\n _id: set?._id,\r\n __v: set?.__v,\r\n __created: set?.__created,\r\n __createdBy: set?.__createdBy,\r\n __lastModified: set?.__lastModified,\r\n __lastModifiedBy: set?.__lastModifiedBy,\r\n })\r\n if (set) {\r\n this.data = set.data;\r\n }\r\n }\r\n}\r\n\r\nexport const customDataModelParams = new DynamoBEDataParams({\r\n dataName: 'customData',\r\n modelParams: [\r\n { key: 'data', type: 'string', required: true },\r\n ]\r\n})\r\n\r\n","\r\nimport { GeoIpLocation } from '../control-models/geo-ip-location';\r\nimport { Metadata } from './metadata';\r\nimport { DynamoUsageData } from '../control-models/usage-data';\r\nimport { DynamoBEDataParams } from '../control-models/dynamobe-data-params';\r\n\r\nexport class DynamoUsageSession extends Metadata {\r\n date?: string;\r\n sessionStart?: Date;\r\n sessionEnd?: Date;\r\n address?: string;\r\n issuer?: string;\r\n locationData?: GeoIpLocation;\r\n\r\n usageData?: DynamoUsageData[];\r\n totalSessionTime?: number;\r\n loggedInAs?: string;\r\n\r\n constructor(\r\n set?: {\r\n _id?: string,\r\n\r\n date?: string;\r\n sessionStart?: Date,\r\n sessionEnd?: Date,\r\n address?: string,\r\n issuer?: string,\r\n locationData?: GeoIpLocation,\r\n\r\n usageData?: DynamoUsageData[],\r\n totalSessionTime?: number,\r\n loggedInAs?: string,\r\n\r\n __created?: Date,\r\n __createdBy?: string,\r\n __lastModified?: Date,\r\n __lastModifiedBy?: string,\r\n __v?: number\r\n }\r\n ) {\r\n super({\r\n _id: set?._id,\r\n __created: set?.__created,\r\n __createdBy: set?.__createdBy,\r\n __lastModified: set?.__lastModified,\r\n __lastModifiedBy: set?.__lastModifiedBy,\r\n __v: set?.__v,\r\n });\r\n if (set) {\r\n if (set.date) {\r\n this.date = set.date;\r\n } else if (set.sessionStart) {\r\n this.date = set.sessionStart.toISOString().substring(0, 10);\r\n }\r\n this.sessionStart = set.sessionStart;\r\n this.sessionEnd = set.sessionEnd;\r\n this.address = set.address;\r\n this.issuer = set.issuer;\r\n this.locationData = set.locationData;\r\n\r\n this.usageData = set.usageData ? set.usageData : [];\r\n this.totalSessionTime = set.totalSessionTime;\r\n this.loggedInAs = set.loggedInAs;\r\n }\r\n }\r\n}\r\n\r\nexport const usageSessionModelParams = new DynamoBEDataParams({\r\n dataName: 'usageSession',\r\n modelParams: [\r\n { key: 'date', type: 'string',\r\n required: true, index: true\r\n },\r\n { key: 'sessionStart', type: 'Date',\r\n required: true, index: true\r\n },\r\n { key: 'sessionEnd', type: 'Date' },\r\n { key: 'address', type: 'string' },\r\n { key: 'issuer', type: 'string' },\r\n { key: 'locationData', type: 'IpApiLocation' },\r\n { key: 'usageData', type: 'UsageData[]' },\r\n { key: 'totalSessionTime', type: 'number' },\r\n { key: 'loggedInAs', type: 'string' },\r\n ]\r\n})\r\n","\n\n// CONSTANTS\nexport * from './lib/_constants/times'\n // Module Settings\nexport * from './lib/_constants/module-settings/test-module-settings';\nexport * from './lib/_constants/module-settings/usage-module-settings';\n\n// MODELS\n // Control models\nexport * from './lib/_models/control-models/daily-usage-data';\nexport * from './lib/_models/control-models/dynamobe-data-params';\nexport * from './lib/_models/control-models/dynamobe-data-property-params';\nexport * from './lib/_models/control-models/dynamobe-error';\nexport * from './lib/_models/control-models/geo-ip-location';\nexport * from './lib/_models/control-models/location-coordinates';\nexport * from './lib/_models/control-models/usage-action';\nexport * from './lib/_models/control-models/usage-data';\n // Data models\nexport * from './lib/_models/data-models/custom-data';\nexport * from './lib/_models/data-models/metadata';\nexport * from './lib/_models/data-models/usage-session';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AACO,MAAM,MAAM,GAAG,KAAK;AACd,MAAA,MAAM,GAAG,MAAM,GAAG,GAAG;AACrB,MAAA,IAAI,GAAG,MAAM,GAAG,GAAG;AACnB,MAAA,GAAG,GAAG,IAAI,GAAG,GAAG;AAChB,MAAA,IAAI,GAAG,GAAG,GAAG,EAAE;AACf,MAAA,KAAK,GAAG,GAAG,GAAG,WAAW;AACzB,MAAA,IAAI,GAAG,GAAG,GAAG;;ACJb,MAAA,kBAAkB,GAAyB;AACtD,IAAA,SAAS,EAAE,OAAO;AAClB,IAAA,SAAS,EAAE;AACT,QAAA,OAAO,EAAE,WAAW;AACpB,QAAA,QAAQ,EAAE,YAAY;AACtB,QAAA,OAAO,EAAE,WAAW;AACpB,QAAA,SAAS,EAAE,aAAa;AACxB,QAAA,UAAU,EAAE,cAAc;AAC1B,QAAA,aAAa,EAAE,uBAAuB;AACtC,QAAA,gBAAgB,EAAE,cAAc;AACjC,KAAA;;;ACVU,MAAA,mBAAmB,GAAyB;AACvD,IAAA,SAAS,EAAE,QAAQ;AACnB,IAAA,SAAS,EAAE;AACT,QAAA,UAAU,EAAE,cAAc;AAC1B,QAAA,YAAY,EAAE,2BAA2B;AACzC,QAAA,WAAW,EAAG,oBAAoB;AAClC,QAAA,eAAe,EAAE,UAAU;AAC5B,KAAA;;;MCPU,cAAc,CAAA;AASzB,IAAA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not edit.
3
+ */
4
+ /// <amd-module name="@futdevpro/fsm-dynamo" />
5
+ export * from './public-api';
@@ -0,0 +1,2 @@
1
+ import { DynamoModuleSettings } from '../../_models/control-models/dynamo-module-settings';
2
+ export declare const testModuleSettings: DynamoModuleSettings;
@@ -0,0 +1,2 @@
1
+ import { DynamoModuleSettings } from '../../_models/control-models/dynamo-module-settings';
2
+ export declare const usageModuleSettings: DynamoModuleSettings;
@@ -0,0 +1,7 @@
1
+ export declare const second = 1000;
2
+ export declare const minute: number;
3
+ export declare const hour: number;
4
+ export declare const day: number;
5
+ export declare const week: number;
6
+ export declare const month: number;
7
+ export declare const year: number;
@@ -0,0 +1,17 @@
1
+ import { DynamoUsageSession } from "../data-models/usage-session";
2
+ export declare class DailyUsageData {
3
+ date?: string;
4
+ totalVisitTime?: number;
5
+ averageVisitTime?: number;
6
+ visitorsHun?: number;
7
+ visitorsElse?: number;
8
+ visitations?: DynamoUsageSession[];
9
+ constructor(set?: {
10
+ date?: string;
11
+ totalVisitTime?: number;
12
+ averageVisitTime?: number;
13
+ visitorsHun?: number;
14
+ visitorsElse?: number;
15
+ visitations?: DynamoUsageSession[];
16
+ });
17
+ }
@@ -0,0 +1,6 @@
1
+ export interface DynamoModuleSettings {
2
+ mainRoute: string;
3
+ endPoints: {
4
+ [endpoint: string]: string;
5
+ };
6
+ }
@@ -0,0 +1,10 @@
1
+ import { DynamoBEDataPropertyParams } from './dynamobe-data-property-params';
2
+ export declare class DynamoBEDataParams {
3
+ dataName: string;
4
+ dbName: string;
5
+ modelParams: DynamoBEDataPropertyParams[];
6
+ constructor(set: {
7
+ dataName: string;
8
+ modelParams: DynamoBEDataPropertyParams[];
9
+ });
10
+ }
@@ -0,0 +1,27 @@
1
+ export declare class DynamoBEDataPropertyParams {
2
+ key?: string;
3
+ type?: 'string' | 'number' | 'boolean' | 'Date' | 'object' | string;
4
+ unique?: boolean;
5
+ required?: boolean;
6
+ index?: boolean;
7
+ isDependencyHook?: boolean;
8
+ dependencyName?: string;
9
+ minlength?: number;
10
+ maxlength?: number;
11
+ subObjectParams?: DynamoBEDataPropertyParams[];
12
+ additionalValidators?: ((data: any) => void)[];
13
+ constructor(set: {
14
+ key: string;
15
+ type: 'string' | 'number' | 'boolean' | 'Date' | 'object' | string;
16
+ unique?: boolean;
17
+ required?: boolean;
18
+ index?: boolean;
19
+ isDependencyHook?: boolean;
20
+ dependencyDBServiceName?: string;
21
+ minlength?: number;
22
+ maxlength?: number;
23
+ subObjectParams?: DynamoBEDataPropertyParams[];
24
+ additionalValidators?: ((data: any) => void)[];
25
+ });
26
+ getBEType?(): String | Number | Boolean | Object | Function | Array<any> | Date;
27
+ }
@@ -0,0 +1,18 @@
1
+ export declare class DynamoBEError {
2
+ flag: string;
3
+ handled: boolean;
4
+ status: number;
5
+ errors: any[];
6
+ error: any;
7
+ messages: string[];
8
+ userMessages: string[];
9
+ constructor(set: {
10
+ handled?: boolean;
11
+ status?: number;
12
+ message?: string;
13
+ messages?: string[];
14
+ userMessage?: string;
15
+ error?: any;
16
+ consoleLog?: boolean;
17
+ });
18
+ }
@@ -0,0 +1,25 @@
1
+ export interface GeoIpLocation {
2
+ /** [ <low bound of IP block>, <high bound of IP block> ] */
3
+ range: [number, number];
4
+ /** 2 letter ISO-3166-1 country code https://www.iban.com/country-codes */
5
+ country: string;
6
+ /**
7
+ * Up to 3 alphanumeric variable length characters as ISO 3166-2 code
8
+ * For US states this is the 2 letter state
9
+ * For the United Kingdom this could be ENG as a country like “England
10
+ * FIPS 10-4 subcountry code
11
+ */
12
+ region: string;
13
+ /** 1 if the country is a member state of the European Union, 0 otherwise. */
14
+ eu: '1' | '0';
15
+ /** "Country/Zone" Timezone from IANA Time Zone Database */
16
+ timezone: string;
17
+ /** This is the full city name */
18
+ city: string;
19
+ /** The latitude and longitude of the city */
20
+ ll: [number, number];
21
+ /** Metro code */
22
+ metro: number;
23
+ /** The approximate accuracy radius (km), around the latitude and longitude */
24
+ area: number;
25
+ }
@@ -0,0 +1,4 @@
1
+ export interface LocationCoordinates {
2
+ longitude: number;
3
+ latitude: number;
4
+ }
@@ -0,0 +1,8 @@
1
+ export declare class DynamoUsageAction {
2
+ action?: string;
3
+ time?: Date;
4
+ constructor(set?: {
5
+ action?: string;
6
+ time?: Date;
7
+ });
8
+ }
@@ -0,0 +1,13 @@
1
+ import { DynamoUsageAction } from './usage-action';
2
+ export declare class DynamoUsageData {
3
+ page?: string;
4
+ opened?: Date;
5
+ timeSpentOnPage?: number;
6
+ actions?: DynamoUsageAction[];
7
+ constructor(set?: {
8
+ page?: string;
9
+ opened?: Date;
10
+ timeSpentOnPage?: number;
11
+ actions?: DynamoUsageAction[];
12
+ });
13
+ }
@@ -0,0 +1,15 @@
1
+ import { DynamoBEDataParams } from '../control-models/dynamobe-data-params';
2
+ import { Metadata } from './metadata';
3
+ export declare class CustomData extends Metadata {
4
+ data?: string;
5
+ constructor(set?: {
6
+ _id?: string;
7
+ data?: string;
8
+ __v?: number;
9
+ __created?: Date;
10
+ __createdBy?: string;
11
+ __lastModified?: Date;
12
+ __lastModifiedBy?: string;
13
+ });
14
+ }
15
+ export declare const customDataModelParams: DynamoBEDataParams;
@@ -0,0 +1,16 @@
1
+ export declare class Metadata {
2
+ _id?: string;
3
+ __created?: Date;
4
+ __createdBy?: string;
5
+ __lastModified?: Date;
6
+ __lastModifiedBy?: string;
7
+ __v?: number;
8
+ constructor(set?: {
9
+ _id?: string;
10
+ __created?: Date;
11
+ __createdBy?: string;
12
+ __lastModified?: Date;
13
+ __lastModifiedBy?: string;
14
+ __v?: number;
15
+ } | Metadata);
16
+ }