@futdevpro/nts-dynamo 1.9.15 → 1.9.17

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 (132) hide show
  1. package/.copilot/patterns.json +7 -7
  2. package/.github/workflows/main.yml +221 -0
  3. package/HOWTO.md +15 -15
  4. package/README.md +140 -140
  5. package/build/_constants/mocks/auth-service.mock.d.ts.map +1 -1
  6. package/build/_models/control-models/app-params.control-model.d.ts +1 -0
  7. package/build/_models/control-models/app-params.control-model.d.ts.map +1 -1
  8. package/build/_models/control-models/app-params.control-model.js.map +1 -1
  9. package/build/_models/control-models/endpoint-params.control-model.d.ts.map +1 -1
  10. package/build/_models/control-models/endpoint-params.control-model.js +2 -0
  11. package/build/_models/control-models/endpoint-params.control-model.js.map +1 -1
  12. package/build/_models/control-models/socket-event.control-model.js +1 -1
  13. package/build/_models/interfaces/certification-settings.interface.d.ts +0 -1
  14. package/build/_models/interfaces/certification-settings.interface.d.ts.map +1 -1
  15. package/build/_models/interfaces/global-service-settings.interface.d.ts +1 -1
  16. package/build/_models/interfaces/global-service-settings.interface.d.ts.map +1 -1
  17. package/build/_modules/custom-data/get-custom-data-routing-module.util.js +1 -2
  18. package/build/_modules/custom-data/get-custom-data-routing-module.util.js.map +1 -1
  19. package/build/_modules/test/get-test-routing-module.util.js +1 -2
  20. package/build/_modules/test/get-test-routing-module.util.js.map +1 -1
  21. package/build/_modules/usage/get-usage-routing-module.util.js +1 -2
  22. package/build/_modules/usage/get-usage-routing-module.util.js.map +1 -1
  23. package/build/_services/core/global.service.d.ts.map +1 -1
  24. package/build/_services/core/global.service.js +14 -6
  25. package/build/_services/core/global.service.js.map +1 -1
  26. package/build/_services/route/routing-module.service.d.ts +1 -1
  27. package/build/_services/route/routing-module.service.d.ts.map +1 -1
  28. package/build/_services/route/routing-module.service.js +19 -25
  29. package/build/_services/route/routing-module.service.js.map +1 -1
  30. package/build/_services/server/app.server.d.ts +0 -2
  31. package/build/_services/server/app.server.d.ts.map +1 -1
  32. package/build/_services/server/app.server.js +4 -1
  33. package/build/_services/server/app.server.js.map +1 -1
  34. package/build/_services/socket/socket-client.service.d.ts.map +1 -1
  35. package/build/_services/socket/socket-client.service.js +1 -0
  36. package/build/_services/socket/socket-client.service.js.map +1 -1
  37. package/nodemon.json +17 -15
  38. package/package.json +5 -5
  39. package/src/_constants/global-settings.const.ts +27 -27
  40. package/src/_constants/index.ts +2 -2
  41. package/src/_constants/mocks/app-extended-server.mock.ts +198 -198
  42. package/src/_constants/mocks/app-params.mock.ts +9 -9
  43. package/src/_constants/mocks/app-server.mock.ts +185 -185
  44. package/src/_constants/mocks/auth-service.mock.ts +28 -28
  45. package/src/_constants/mocks/controller.mock.ts +16 -16
  46. package/src/_constants/mocks/data-model.mock.ts +83 -83
  47. package/src/_constants/mocks/email-service-collection.mock.ts +13 -13
  48. package/src/_constants/mocks/email-service.mock.ts +19 -19
  49. package/src/_constants/mocks/email-template.mock.html +14 -14
  50. package/src/_constants/mocks/endpoint.mock.ts +90 -90
  51. package/src/_constants/mocks/socket-client.mock.ts +43 -43
  52. package/src/_constants/mocks/socket-server.mock.ts +43 -43
  53. package/src/_enums/data-model-type.enum.ts +14 -14
  54. package/src/_enums/data-service-function.enum.ts +15 -15
  55. package/src/_enums/http/http-call-type.enum.ts +12 -12
  56. package/src/_enums/http/http-response-type.enum.ts +7 -7
  57. package/src/_enums/http/socket-event-type.enum.ts +18 -18
  58. package/src/_enums/index.ts +13 -13
  59. package/src/_enums/predefined-data-types.enum.ts +27 -27
  60. package/src/_enums/route-security.enum.ts +12 -12
  61. package/src/_enums/socket-security.enum.ts +11 -11
  62. package/src/_models/control-models/api-call-params.control-model.ts +126 -126
  63. package/src/_models/control-models/app-ext-system-controls.control-model.ts +9 -9
  64. package/src/_models/control-models/app-params.control-model.ts +46 -45
  65. package/src/_models/control-models/app-system-controls.control-model.ts +9 -9
  66. package/src/_models/control-models/endpoint-params.control-model.ts +309 -307
  67. package/src/_models/control-models/http-settings.control-model.ts +29 -29
  68. package/src/_models/control-models/index.ts +13 -13
  69. package/src/_models/control-models/socket-client-service-params.control-model.ts +28 -28
  70. package/src/_models/control-models/socket-event.control-model.ts +150 -150
  71. package/src/_models/control-models/socket-presence.control-model.ts +207 -207
  72. package/src/_models/control-models/socket-server-service-params.control-model.ts +20 -20
  73. package/src/_models/control-models/system-control.control-model.ts +12 -12
  74. package/src/_models/index.ts +9 -9
  75. package/src/_models/interfaces/certification-settings.interface.ts +7 -7
  76. package/src/_models/interfaces/global-service-settings.interface.ts +45 -45
  77. package/src/_models/interfaces/global-settings.interface.ts +83 -83
  78. package/src/_models/interfaces/index.ts +7 -7
  79. package/src/_models/interfaces/routing-module-settings.interface.ts +20 -20
  80. package/src/_models/types/db-filter.type.ts +108 -108
  81. package/src/_models/types/db-update.type.ts +100 -100
  82. package/src/_models/types/index.ts +5 -5
  83. package/src/_modules/api-service.index.ts +12 -12
  84. package/src/_modules/app-extended.index.ts +28 -28
  85. package/src/_modules/app.index.ts +24 -24
  86. package/src/_modules/auth.index.ts +7 -7
  87. package/src/_modules/constants.index.ts +2 -2
  88. package/src/_modules/controller.index.ts +10 -10
  89. package/src/_modules/custom-data/custom-data.controller.ts +69 -69
  90. package/src/_modules/custom-data/custom-data.data-service.ts +20 -20
  91. package/src/_modules/custom-data/get-custom-data-routing-module.util.ts +23 -23
  92. package/src/_modules/custom-data/index.ts +6 -6
  93. package/src/_modules/custom-data-module.index.ts +2 -2
  94. package/src/_modules/data-service.index.ts +9 -9
  95. package/src/_modules/email.index.ts +8 -8
  96. package/src/_modules/enums.index.ts +2 -2
  97. package/src/_modules/extended.index.ts +8 -8
  98. package/src/_modules/models.index.ts +2 -2
  99. package/src/_modules/services.index.ts +2 -2
  100. package/src/_modules/test/get-test-routing-module.util.ts +23 -23
  101. package/src/_modules/test/index.ts +5 -5
  102. package/src/_modules/test/test.controller.ts +115 -115
  103. package/src/_modules/test-module.index.ts +2 -2
  104. package/src/_modules/usage/get-usage-routing-module.util.ts +22 -22
  105. package/src/_modules/usage/index.ts +7 -7
  106. package/src/_modules/usage/usage.controller.ts +120 -120
  107. package/src/_modules/usage/usage.data-service.ts +172 -172
  108. package/src/_modules/usage-module.index.ts +2 -2
  109. package/src/_services/base/data.service.ts +921 -921
  110. package/src/_services/base/db.service.spec.ts +32 -32
  111. package/src/_services/base/db.service.ts +1063 -1063
  112. package/src/_services/base/singleton.service.ts +21 -21
  113. package/src/_services/core/api.service.ts +453 -453
  114. package/src/_services/core/auth.service.ts +172 -172
  115. package/src/_services/core/email.service.ts +678 -678
  116. package/src/_services/core/global.service.ts +275 -269
  117. package/src/_services/core/service-collection.service.ts +5 -5
  118. package/src/_services/index.ts +23 -23
  119. package/src/_services/route/controller.service.ts +129 -129
  120. package/src/_services/route/routing-module.service.ts +293 -273
  121. package/src/_services/server/app-extended.server.spec.ts +76 -76
  122. package/src/_services/server/app-extended.server.ts +520 -520
  123. package/src/_services/server/app.server.spec.ts +67 -67
  124. package/src/_services/server/app.server.ts +1181 -1179
  125. package/src/_services/shared.service.spec.ts +19 -19
  126. package/src/_services/shared.static-service.ts +73 -73
  127. package/src/_services/socket/socket-client.service.ts +236 -235
  128. package/src/_services/socket/socket-server.service.spec.ts +11 -11
  129. package/src/_services/socket/socket-server.service.ts +761 -761
  130. package/src/index.ts +18 -18
  131. package/tsconfig.json +41 -41
  132. package/build/tsconfig.tsbuildinfo +0 -1
@@ -1,12 +1,12 @@
1
-
2
- /**
3
- * security settings for API,
4
- * different security paths will need different handlers
5
- *
6
- * open; http, secure; https or both,
7
- */
8
- export enum DynamoNTS_RouteSecurity {
9
- open = 'open',
10
- secure = 'secure',
11
- both = 'both',
12
- }
1
+
2
+ /**
3
+ * security settings for API,
4
+ * different security paths will need different handlers
5
+ *
6
+ * open; http, secure; https or both,
7
+ */
8
+ export enum DynamoNTS_RouteSecurity {
9
+ open = 'open',
10
+ secure = 'secure',
11
+ both = 'both',
12
+ }
@@ -1,11 +1,11 @@
1
-
2
- /**
3
- * security settings for API,
4
- * different security paths will need different handlers
5
- *
6
- * open; http or secure; https
7
- */
8
- export enum DynamoNTS_SocketSecurity {
9
- open = 'open',
10
- secure = 'secure',
11
- }
1
+
2
+ /**
3
+ * security settings for API,
4
+ * different security paths will need different handlers
5
+ *
6
+ * open; http or secure; https
7
+ */
8
+ export enum DynamoNTS_SocketSecurity {
9
+ open = 'open',
10
+ secure = 'secure',
11
+ }
@@ -1,126 +1,126 @@
1
-
2
- import { DynamoFM_Log } from '@futdevpro/fsm-dynamo';
3
- import { DynamoNTS_HttpCallType } from '../../_enums/http/http-call-type.enum';
4
- import { DynamoNTS_HttpResponseType } from '../../_enums/http/http-response-type.enum';
5
-
6
- /**
7
- * API call params,
8
- * such as
9
- * type (HttpCallType),
10
- * endpoint,
11
- * and other options as httpOptions
12
- */
13
- export class DynamoNTS_ApiCall_Params {
14
- /**
15
- * name the call to be able to identify it when debugging
16
- */
17
- name: string;
18
- /**
19
- * type of the call as; HttpCallType .get, .post, ...ect
20
- */
21
- type: DynamoNTS_HttpCallType;
22
- /**
23
- * the endpoint of the API, without the baseUrl:
24
- * '/user/get/:userId',
25
- * where the parts starting with ':', will be used as pathParam
26
- */
27
- baseUrl: string;
28
- /**
29
- * baseUrl of the API;
30
- * 'https://futdevpro.hu/api'
31
- */
32
- endPoint: string;
33
-
34
- /**
35
- * if this value is true, the call will return the full HTTP call response in raw
36
- */
37
- getFullResponse: boolean;
38
- /**
39
- * this setting will be passed to the axios http call
40
- */
41
- httpOptions: any;
42
-
43
- constructor(
44
- /**
45
- * set of options necessary for setting up an API call
46
- */
47
- set: {
48
- /**
49
- * name the call to be able to identify it when debugging
50
- */
51
- name: string,
52
- /**
53
- * set type as; HttpCallType .get, .post, ...ect
54
- */
55
- type: DynamoNTS_HttpCallType,
56
- /**
57
- * the endpoint of the API, without the baseUrl:
58
- * '/user/get/:userId',
59
- * where the parts starting with ':', will be used as pathParam
60
- */
61
- endPoint: string,
62
- /**
63
- * baseUrl of the API;
64
- * 'https://futdevpro.hu/api'
65
- */
66
- baseUrl: string,
67
- /**
68
- * setting this value to true, will return the full HTTP call response in raw
69
- */
70
- getFullResponse?: boolean,
71
- /**
72
- * this setting will pass any kind of http setting used by the axios http messaging package
73
- */
74
- httpOptions?: DynamoNTS_HttpOptions,
75
- }
76
- ) {
77
- this.name = set.name;
78
- this.type = set.type;
79
-
80
- if (set.endPoint.includes('{')) {
81
- DynamoFM_Log.warn(
82
- `using {param} bracets in endpoint definitions will be deprecated... (${set.endPoint})` +
83
- 'use :param instead ({pathparam} --> :pathparam)'
84
- );
85
- set.endPoint.replace(/{/g, ':').replace(/}/g, '');
86
- }
87
- this.endPoint = set.endPoint;
88
- this.baseUrl = set.baseUrl;
89
- this.getFullResponse = !!set.getFullResponse;
90
- this.httpOptions = set.httpOptions ? set.httpOptions : {};
91
- }
92
- }
93
-
94
- /**
95
- * basic axios HttpsOptions,
96
- *
97
- * learn more on axios package....
98
- * TOD: link package documentations
99
- */
100
- export class DynamoNTS_HttpOptions {
101
- responseType?: DynamoNTS_HttpResponseType;
102
- headers?: {
103
- [header: string]: string | string[];
104
- };
105
- observe?: 'body';
106
- reportProgress?: boolean;
107
- withCredentials?: boolean;
108
-
109
- constructor(
110
- set: {
111
- responseType?: DynamoNTS_HttpResponseType,
112
- headers?: {
113
- [header: string]: string | string[];
114
- },
115
- observe?: 'body',
116
- reportProgress?: boolean,
117
- withCredentials?: boolean
118
- }
119
- ) {
120
- this.responseType = set.responseType;
121
- this.headers = set.headers;
122
- this.observe = set.observe;
123
- this.reportProgress = set.reportProgress;
124
- this.withCredentials = set.withCredentials;
125
- }
126
- }
1
+
2
+ import { DynamoFM_Log } from '@futdevpro/fsm-dynamo';
3
+ import { DynamoNTS_HttpCallType } from '../../_enums/http/http-call-type.enum';
4
+ import { DynamoNTS_HttpResponseType } from '../../_enums/http/http-response-type.enum';
5
+
6
+ /**
7
+ * API call params,
8
+ * such as
9
+ * type (HttpCallType),
10
+ * endpoint,
11
+ * and other options as httpOptions
12
+ */
13
+ export class DynamoNTS_ApiCall_Params {
14
+ /**
15
+ * name the call to be able to identify it when debugging
16
+ */
17
+ name: string;
18
+ /**
19
+ * type of the call as; HttpCallType .get, .post, ...ect
20
+ */
21
+ type: DynamoNTS_HttpCallType;
22
+ /**
23
+ * the endpoint of the API, without the baseUrl:
24
+ * '/user/get/:userId',
25
+ * where the parts starting with ':', will be used as pathParam
26
+ */
27
+ baseUrl: string;
28
+ /**
29
+ * baseUrl of the API;
30
+ * 'https://futdevpro.hu/api'
31
+ */
32
+ endPoint: string;
33
+
34
+ /**
35
+ * if this value is true, the call will return the full HTTP call response in raw
36
+ */
37
+ getFullResponse: boolean;
38
+ /**
39
+ * this setting will be passed to the axios http call
40
+ */
41
+ httpOptions: any;
42
+
43
+ constructor(
44
+ /**
45
+ * set of options necessary for setting up an API call
46
+ */
47
+ set: {
48
+ /**
49
+ * name the call to be able to identify it when debugging
50
+ */
51
+ name: string,
52
+ /**
53
+ * set type as; HttpCallType .get, .post, ...ect
54
+ */
55
+ type: DynamoNTS_HttpCallType,
56
+ /**
57
+ * the endpoint of the API, without the baseUrl:
58
+ * '/user/get/:userId',
59
+ * where the parts starting with ':', will be used as pathParam
60
+ */
61
+ endPoint: string,
62
+ /**
63
+ * baseUrl of the API;
64
+ * 'https://futdevpro.hu/api'
65
+ */
66
+ baseUrl: string,
67
+ /**
68
+ * setting this value to true, will return the full HTTP call response in raw
69
+ */
70
+ getFullResponse?: boolean,
71
+ /**
72
+ * this setting will pass any kind of http setting used by the axios http messaging package
73
+ */
74
+ httpOptions?: DynamoNTS_HttpOptions,
75
+ }
76
+ ) {
77
+ this.name = set.name;
78
+ this.type = set.type;
79
+
80
+ if (set.endPoint.includes('{')) {
81
+ DynamoFM_Log.warn(
82
+ `using {param} bracets in endpoint definitions will be deprecated... (${set.endPoint})` +
83
+ 'use :param instead ({pathparam} --> :pathparam)'
84
+ );
85
+ set.endPoint.replace(/{/g, ':').replace(/}/g, '');
86
+ }
87
+ this.endPoint = set.endPoint;
88
+ this.baseUrl = set.baseUrl;
89
+ this.getFullResponse = !!set.getFullResponse;
90
+ this.httpOptions = set.httpOptions ? set.httpOptions : {};
91
+ }
92
+ }
93
+
94
+ /**
95
+ * basic axios HttpsOptions,
96
+ *
97
+ * learn more on axios package....
98
+ * TOD: link package documentations
99
+ */
100
+ export class DynamoNTS_HttpOptions {
101
+ responseType?: DynamoNTS_HttpResponseType;
102
+ headers?: {
103
+ [header: string]: string | string[];
104
+ };
105
+ observe?: 'body';
106
+ reportProgress?: boolean;
107
+ withCredentials?: boolean;
108
+
109
+ constructor(
110
+ set: {
111
+ responseType?: DynamoNTS_HttpResponseType,
112
+ headers?: {
113
+ [header: string]: string | string[];
114
+ },
115
+ observe?: 'body',
116
+ reportProgress?: boolean,
117
+ withCredentials?: boolean
118
+ }
119
+ ) {
120
+ this.responseType = set.responseType;
121
+ this.headers = set.headers;
122
+ this.observe = set.observe;
123
+ this.reportProgress = set.reportProgress;
124
+ this.withCredentials = set.withCredentials;
125
+ }
126
+ }
@@ -1,9 +1,9 @@
1
-
2
-
3
- import { DynamoNTS_SystemControl } from './system-control.control-model';
4
-
5
- export class DynamoNTS_AppExtSysControls {
6
- appExtended: DynamoNTS_SystemControl = new DynamoNTS_SystemControl();
7
- httpSocketServer: DynamoNTS_SystemControl = new DynamoNTS_SystemControl();
8
- httpsSocketServer: DynamoNTS_SystemControl = new DynamoNTS_SystemControl();
9
- }
1
+
2
+
3
+ import { DynamoNTS_SystemControl } from './system-control.control-model';
4
+
5
+ export class DynamoNTS_AppExtSysControls {
6
+ appExtended: DynamoNTS_SystemControl = new DynamoNTS_SystemControl();
7
+ httpSocketServer: DynamoNTS_SystemControl = new DynamoNTS_SystemControl();
8
+ httpsSocketServer: DynamoNTS_SystemControl = new DynamoNTS_SystemControl();
9
+ }
@@ -1,45 +1,46 @@
1
-
2
- /**
3
- * This will hold and set the basic settings of an application
4
- */
5
- export class DynamoNTS_App_Params {
6
- /**
7
- * name of the application
8
- */
9
- name: string;
10
- /**
11
- * title will be shown on the start of the application
12
- */
13
- title?: string;
14
- /**
15
- * version of the application
16
- * you should set the version,
17
- * probably, you should set from the package.json as follows:
18
- * import { version } from '../package.json';
19
- */
20
- version: string;
21
- /**
22
- * name of your MongoDB table
23
- * by default, its: `mongodb://localhost:27017/${this.dbName}`
24
- */
25
- dbUri?: string;
26
- /**
27
- * name of your MongoDB table
28
- */
29
- dbName: string;
30
- /**
31
- * name of the system, by default, its: this.name.replace(' ', '-')
32
- */
33
- systemName?: string;
34
-
35
- constructor(
36
- set: DynamoNTS_App_Params
37
- ) {
38
- this.name = set.name;
39
- this.title = set.title ?? '';
40
- this.version = set.version;
41
- this.dbName = set.dbName;
42
- this.dbUri = set.dbUri ?? `mongodb://localhost:27017/${this.dbName}`;
43
- this.systemName = set.systemName ?? this.name.replace(' ', '-');
44
- }
45
- }
1
+
2
+ export type DyNTS_App_Params = DynamoNTS_App_Params;
3
+ /**
4
+ * This will hold and set the basic settings of an application
5
+ */
6
+ export class DynamoNTS_App_Params {
7
+ /**
8
+ * name of the application
9
+ */
10
+ name: string;
11
+ /**
12
+ * title will be shown on the start of the application
13
+ */
14
+ title?: string;
15
+ /**
16
+ * version of the application
17
+ * you should set the version,
18
+ * probably, you should set from the package.json as follows:
19
+ * import { version } from '../package.json';
20
+ */
21
+ version: string;
22
+ /**
23
+ * name of your MongoDB table
24
+ * by default, its: `mongodb://localhost:27017/${this.dbName}`
25
+ */
26
+ dbUri?: string;
27
+ /**
28
+ * name of your MongoDB table
29
+ */
30
+ dbName: string;
31
+ /**
32
+ * name of the system, by default, its: this.name.replace(' ', '-')
33
+ */
34
+ systemName?: string;
35
+
36
+ constructor(
37
+ set: DynamoNTS_App_Params
38
+ ) {
39
+ this.name = set.name;
40
+ this.title = set.title ?? '';
41
+ this.version = set.version;
42
+ this.dbName = set.dbName;
43
+ this.dbUri = set.dbUri ?? `mongodb://localhost:27017/${this.dbName}`;
44
+ this.systemName = set.systemName ?? this.name.replace(' ', '-');
45
+ }
46
+ }
@@ -1,9 +1,9 @@
1
-
2
- import { DynamoNTS_SystemControl } from './system-control.control-model';
3
-
4
- export class DynamoNTS_AppSystemControls {
5
- app: DynamoNTS_SystemControl = new DynamoNTS_SystemControl();
6
- mongoose: DynamoNTS_SystemControl = new DynamoNTS_SystemControl();
7
- httpServer: DynamoNTS_SystemControl = new DynamoNTS_SystemControl();
8
- httpsServer: DynamoNTS_SystemControl = new DynamoNTS_SystemControl();
9
- }
1
+
2
+ import { DynamoNTS_SystemControl } from './system-control.control-model';
3
+
4
+ export class DynamoNTS_AppSystemControls {
5
+ app: DynamoNTS_SystemControl = new DynamoNTS_SystemControl();
6
+ mongoose: DynamoNTS_SystemControl = new DynamoNTS_SystemControl();
7
+ httpServer: DynamoNTS_SystemControl = new DynamoNTS_SystemControl();
8
+ httpsServer: DynamoNTS_SystemControl = new DynamoNTS_SystemControl();
9
+ }