@futdevpro/nts-dynamo 1.9.15 → 1.9.16

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 (117) hide show
  1. package/.copilot/patterns.json +7 -7
  2. package/.github/workflows/main.yml +206 -0
  3. package/HOWTO.md +15 -15
  4. package/README.md +140 -140
  5. package/build/_models/control-models/endpoint-params.control-model.d.ts.map +1 -1
  6. package/build/_models/control-models/endpoint-params.control-model.js +2 -0
  7. package/build/_models/control-models/endpoint-params.control-model.js.map +1 -1
  8. package/build/_models/control-models/socket-event.control-model.js +1 -1
  9. package/build/_services/core/global.service.d.ts.map +1 -1
  10. package/build/_services/core/global.service.js +1 -0
  11. package/build/_services/core/global.service.js.map +1 -1
  12. package/build/_services/route/routing-module.service.d.ts +1 -0
  13. package/build/_services/route/routing-module.service.d.ts.map +1 -1
  14. package/build/_services/route/routing-module.service.js +17 -23
  15. package/build/_services/route/routing-module.service.js.map +1 -1
  16. package/build/_services/server/app.server.d.ts.map +1 -1
  17. package/build/_services/server/app.server.js +4 -1
  18. package/build/_services/server/app.server.js.map +1 -1
  19. package/build/_services/socket/socket-client.service.d.ts.map +1 -1
  20. package/build/_services/socket/socket-client.service.js +1 -0
  21. package/build/_services/socket/socket-client.service.js.map +1 -1
  22. package/nodemon.json +17 -15
  23. package/package.json +5 -5
  24. package/src/_constants/global-settings.const.ts +27 -27
  25. package/src/_constants/index.ts +2 -2
  26. package/src/_constants/mocks/app-extended-server.mock.ts +198 -198
  27. package/src/_constants/mocks/app-params.mock.ts +9 -9
  28. package/src/_constants/mocks/app-server.mock.ts +185 -185
  29. package/src/_constants/mocks/auth-service.mock.ts +28 -28
  30. package/src/_constants/mocks/controller.mock.ts +16 -16
  31. package/src/_constants/mocks/data-model.mock.ts +83 -83
  32. package/src/_constants/mocks/email-service-collection.mock.ts +13 -13
  33. package/src/_constants/mocks/email-service.mock.ts +19 -19
  34. package/src/_constants/mocks/email-template.mock.html +14 -14
  35. package/src/_constants/mocks/endpoint.mock.ts +90 -90
  36. package/src/_constants/mocks/socket-client.mock.ts +43 -43
  37. package/src/_constants/mocks/socket-server.mock.ts +43 -43
  38. package/src/_enums/data-model-type.enum.ts +14 -14
  39. package/src/_enums/data-service-function.enum.ts +15 -15
  40. package/src/_enums/http/http-call-type.enum.ts +12 -12
  41. package/src/_enums/http/http-response-type.enum.ts +7 -7
  42. package/src/_enums/http/socket-event-type.enum.ts +18 -18
  43. package/src/_enums/index.ts +13 -13
  44. package/src/_enums/predefined-data-types.enum.ts +27 -27
  45. package/src/_enums/route-security.enum.ts +12 -12
  46. package/src/_enums/socket-security.enum.ts +11 -11
  47. package/src/_models/control-models/api-call-params.control-model.ts +126 -126
  48. package/src/_models/control-models/app-ext-system-controls.control-model.ts +9 -9
  49. package/src/_models/control-models/app-params.control-model.ts +45 -45
  50. package/src/_models/control-models/app-system-controls.control-model.ts +9 -9
  51. package/src/_models/control-models/endpoint-params.control-model.ts +309 -307
  52. package/src/_models/control-models/http-settings.control-model.ts +29 -29
  53. package/src/_models/control-models/index.ts +13 -13
  54. package/src/_models/control-models/socket-client-service-params.control-model.ts +28 -28
  55. package/src/_models/control-models/socket-event.control-model.ts +150 -150
  56. package/src/_models/control-models/socket-presence.control-model.ts +207 -207
  57. package/src/_models/control-models/socket-server-service-params.control-model.ts +20 -20
  58. package/src/_models/control-models/system-control.control-model.ts +12 -12
  59. package/src/_models/index.ts +9 -9
  60. package/src/_models/interfaces/certification-settings.interface.ts +7 -7
  61. package/src/_models/interfaces/global-service-settings.interface.ts +45 -45
  62. package/src/_models/interfaces/global-settings.interface.ts +83 -83
  63. package/src/_models/interfaces/index.ts +7 -7
  64. package/src/_models/interfaces/routing-module-settings.interface.ts +20 -20
  65. package/src/_models/types/db-filter.type.ts +108 -108
  66. package/src/_models/types/db-update.type.ts +100 -100
  67. package/src/_models/types/index.ts +5 -5
  68. package/src/_modules/api-service.index.ts +12 -12
  69. package/src/_modules/app-extended.index.ts +28 -28
  70. package/src/_modules/app.index.ts +24 -24
  71. package/src/_modules/auth.index.ts +7 -7
  72. package/src/_modules/constants.index.ts +2 -2
  73. package/src/_modules/controller.index.ts +10 -10
  74. package/src/_modules/custom-data/custom-data.controller.ts +69 -69
  75. package/src/_modules/custom-data/custom-data.data-service.ts +20 -20
  76. package/src/_modules/custom-data/get-custom-data-routing-module.util.ts +23 -23
  77. package/src/_modules/custom-data/index.ts +6 -6
  78. package/src/_modules/custom-data-module.index.ts +2 -2
  79. package/src/_modules/data-service.index.ts +9 -9
  80. package/src/_modules/email.index.ts +8 -8
  81. package/src/_modules/enums.index.ts +2 -2
  82. package/src/_modules/extended.index.ts +8 -8
  83. package/src/_modules/models.index.ts +2 -2
  84. package/src/_modules/services.index.ts +2 -2
  85. package/src/_modules/test/get-test-routing-module.util.ts +23 -23
  86. package/src/_modules/test/index.ts +5 -5
  87. package/src/_modules/test/test.controller.ts +115 -115
  88. package/src/_modules/test-module.index.ts +2 -2
  89. package/src/_modules/usage/get-usage-routing-module.util.ts +22 -22
  90. package/src/_modules/usage/index.ts +7 -7
  91. package/src/_modules/usage/usage.controller.ts +120 -120
  92. package/src/_modules/usage/usage.data-service.ts +172 -172
  93. package/src/_modules/usage-module.index.ts +2 -2
  94. package/src/_services/base/data.service.ts +921 -921
  95. package/src/_services/base/db.service.spec.ts +32 -32
  96. package/src/_services/base/db.service.ts +1063 -1063
  97. package/src/_services/base/singleton.service.ts +21 -21
  98. package/src/_services/core/api.service.ts +453 -453
  99. package/src/_services/core/auth.service.ts +172 -172
  100. package/src/_services/core/email.service.ts +678 -678
  101. package/src/_services/core/global.service.ts +270 -269
  102. package/src/_services/core/service-collection.service.ts +5 -5
  103. package/src/_services/index.ts +23 -23
  104. package/src/_services/route/controller.service.ts +129 -129
  105. package/src/_services/route/routing-module.service.ts +293 -273
  106. package/src/_services/server/app-extended.server.spec.ts +76 -76
  107. package/src/_services/server/app-extended.server.ts +520 -520
  108. package/src/_services/server/app.server.spec.ts +67 -67
  109. package/src/_services/server/app.server.ts +1181 -1179
  110. package/src/_services/shared.service.spec.ts +19 -19
  111. package/src/_services/shared.static-service.ts +73 -73
  112. package/src/_services/socket/socket-client.service.ts +236 -235
  113. package/src/_services/socket/socket-server.service.spec.ts +11 -11
  114. package/src/_services/socket/socket-server.service.ts +761 -761
  115. package/src/index.ts +18 -18
  116. package/tsconfig.json +41 -41
  117. 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,45 @@
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
+ /**
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,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
+ }