@futdevpro/nts-dynamo 1.5.30 → 1.5.31

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 (197) hide show
  1. package/lib/_constants/dynamo-nts-global.settings.d.ts +3 -0
  2. package/lib/_constants/dynamo-nts-global.settings.d.ts.map +1 -0
  3. package/lib/_constants/dynamo-nts-global.settings.js +13 -0
  4. package/lib/_constants/dynamo-nts-global.settings.js.map +1 -0
  5. package/lib/_constants/index.d.ts +1 -1
  6. package/lib/_constants/index.d.ts.map +1 -1
  7. package/lib/_constants/index.js +1 -1
  8. package/lib/_constants/index.js.map +1 -1
  9. package/lib/_enums/dynamo-nts-data-service-function.enum.d.ts +8 -0
  10. package/lib/_enums/dynamo-nts-data-service-function.enum.d.ts.map +1 -0
  11. package/lib/_enums/dynamo-nts-data-service-function.enum.js +15 -0
  12. package/lib/_enums/dynamo-nts-data-service-function.enum.js.map +1 -0
  13. package/lib/_enums/dynamo-nts-route-security.enum.d.ts +6 -0
  14. package/lib/_enums/dynamo-nts-route-security.enum.d.ts.map +1 -0
  15. package/lib/_enums/dynamo-nts-route-security.enum.js +10 -0
  16. package/lib/_enums/dynamo-nts-route-security.enum.js.map +1 -0
  17. package/lib/_enums/index.d.ts +2 -2
  18. package/lib/_enums/index.d.ts.map +1 -1
  19. package/lib/_enums/index.js +2 -2
  20. package/lib/_enums/index.js.map +1 -1
  21. package/lib/_models/dynamo-module-settings.d.ts +0 -6
  22. package/lib/_models/dynamo-module-settings.d.ts.map +1 -1
  23. package/lib/_models/dynamo-module-settings.js +9 -2
  24. package/lib/_models/dynamo-module-settings.js.map +1 -1
  25. package/lib/_models/dynamo-nts-api-call-params.d.ts +37 -0
  26. package/lib/_models/dynamo-nts-api-call-params.d.ts.map +1 -0
  27. package/lib/_models/dynamo-nts-api-call-params.js +29 -0
  28. package/lib/_models/dynamo-nts-api-call-params.js.map +1 -0
  29. package/lib/_models/dynamo-nts-app-params.d.ts +18 -0
  30. package/lib/_models/dynamo-nts-app-params.d.ts.map +1 -0
  31. package/lib/_models/dynamo-nts-app-params.js +17 -0
  32. package/lib/_models/dynamo-nts-app-params.js.map +1 -0
  33. package/lib/_models/dynamo-nts-endpoint-params.d.ts +46 -0
  34. package/lib/_models/dynamo-nts-endpoint-params.d.ts.map +1 -0
  35. package/lib/_models/dynamo-nts-endpoint-params.js +117 -0
  36. package/lib/_models/dynamo-nts-endpoint-params.js.map +1 -0
  37. package/lib/_models/dynamo-nts-global-settings.d.ts +13 -0
  38. package/lib/_models/dynamo-nts-global-settings.d.ts.map +1 -0
  39. package/lib/_models/dynamo-nts-global-settings.js +3 -0
  40. package/lib/_models/dynamo-nts-global-settings.js.map +1 -0
  41. package/lib/_models/index.d.ts +4 -4
  42. package/lib/_models/index.d.ts.map +1 -1
  43. package/lib/_models/index.js +4 -5
  44. package/lib/_models/index.js.map +1 -1
  45. package/lib/_modules/api-service.index.d.ts +3 -3
  46. package/lib/_modules/api-service.index.d.ts.map +1 -1
  47. package/lib/_modules/api-service.index.js +3 -3
  48. package/lib/_modules/api-service.index.js.map +1 -1
  49. package/lib/_modules/app.index.d.ts +9 -9
  50. package/lib/_modules/app.index.d.ts.map +1 -1
  51. package/lib/_modules/app.index.js +9 -9
  52. package/lib/_modules/app.index.js.map +1 -1
  53. package/lib/_modules/auth.index.d.ts +2 -2
  54. package/lib/_modules/auth.index.d.ts.map +1 -1
  55. package/lib/_modules/auth.index.js +2 -2
  56. package/lib/_modules/auth.index.js.map +1 -1
  57. package/lib/_modules/controller.index.d.ts +3 -3
  58. package/lib/_modules/controller.index.d.ts.map +1 -1
  59. package/lib/_modules/controller.index.js +3 -3
  60. package/lib/_modules/controller.index.js.map +1 -1
  61. package/lib/_modules/data-service.index.d.ts +4 -4
  62. package/lib/_modules/data-service.index.d.ts.map +1 -1
  63. package/lib/_modules/data-service.index.js +4 -4
  64. package/lib/_modules/data-service.index.js.map +1 -1
  65. package/lib/_modules/email.index.d.ts +2 -2
  66. package/lib/_modules/email.index.d.ts.map +1 -1
  67. package/lib/_modules/email.index.js +2 -2
  68. package/lib/_modules/email.index.js.map +1 -1
  69. package/lib/_modules/test/custom-data.service.d.ts +2 -2
  70. package/lib/_modules/test/custom-data.service.d.ts.map +1 -1
  71. package/lib/_modules/test/custom-data.service.js +2 -2
  72. package/lib/_modules/test/custom-data.service.js.map +1 -1
  73. package/lib/_modules/test/get-test-routing-module.d.ts +3 -3
  74. package/lib/_modules/test/get-test-routing-module.d.ts.map +1 -1
  75. package/lib/_modules/test/get-test-routing-module.js +2 -2
  76. package/lib/_modules/test/get-test-routing-module.js.map +1 -1
  77. package/lib/_modules/test/test-controller.d.ts +2 -2
  78. package/lib/_modules/test/test-controller.d.ts.map +1 -1
  79. package/lib/_modules/test/test-controller.js +10 -10
  80. package/lib/_modules/test/test-controller.js.map +1 -1
  81. package/lib/_modules/usage/get-usage-routing-module.d.ts +3 -3
  82. package/lib/_modules/usage/get-usage-routing-module.d.ts.map +1 -1
  83. package/lib/_modules/usage/get-usage-routing-module.js +2 -2
  84. package/lib/_modules/usage/get-usage-routing-module.js.map +1 -1
  85. package/lib/_modules/usage/usage-controller.d.ts +2 -2
  86. package/lib/_modules/usage/usage-controller.d.ts.map +1 -1
  87. package/lib/_modules/usage/usage-controller.js +10 -10
  88. package/lib/_modules/usage/usage-controller.js.map +1 -1
  89. package/lib/_modules/usage/usage.service.d.ts +2 -2
  90. package/lib/_modules/usage/usage.service.d.ts.map +1 -1
  91. package/lib/_modules/usage/usage.service.js +6 -6
  92. package/lib/_modules/usage/usage.service.js.map +1 -1
  93. package/lib/_services/dynamo-nts-api.service.d.ts +19 -0
  94. package/lib/_services/dynamo-nts-api.service.d.ts.map +1 -0
  95. package/lib/_services/dynamo-nts-api.service.js +167 -0
  96. package/lib/_services/dynamo-nts-api.service.js.map +1 -0
  97. package/lib/_services/dynamo-nts-app-extended.d.ts +23 -0
  98. package/lib/_services/dynamo-nts-app-extended.d.ts.map +1 -0
  99. package/lib/_services/dynamo-nts-app-extended.js +92 -0
  100. package/lib/_services/dynamo-nts-app-extended.js.map +1 -0
  101. package/lib/_services/dynamo-nts-app.d.ts +130 -0
  102. package/lib/_services/dynamo-nts-app.d.ts.map +1 -0
  103. package/lib/_services/dynamo-nts-app.js +238 -0
  104. package/lib/_services/dynamo-nts-app.js.map +1 -0
  105. package/lib/_services/dynamo-nts-auth.service.d.ts +54 -0
  106. package/lib/_services/dynamo-nts-auth.service.d.ts.map +1 -0
  107. package/lib/_services/dynamo-nts-auth.service.js +46 -0
  108. package/lib/_services/dynamo-nts-auth.service.js.map +1 -0
  109. package/lib/_services/dynamo-nts-controller.service.d.ts +14 -0
  110. package/lib/_services/dynamo-nts-controller.service.d.ts.map +1 -0
  111. package/lib/_services/dynamo-nts-controller.service.js +21 -0
  112. package/lib/_services/dynamo-nts-controller.service.js.map +1 -0
  113. package/lib/_services/dynamo-nts-data.service.d.ts +54 -0
  114. package/lib/_services/dynamo-nts-data.service.d.ts.map +1 -0
  115. package/lib/_services/dynamo-nts-data.service.js +301 -0
  116. package/lib/_services/dynamo-nts-data.service.js.map +1 -0
  117. package/lib/_services/dynamo-nts-db-service-collection.service.d.ts +9 -0
  118. package/lib/_services/dynamo-nts-db-service-collection.service.d.ts.map +1 -0
  119. package/lib/_services/dynamo-nts-db-service-collection.service.js +11 -0
  120. package/lib/_services/dynamo-nts-db-service-collection.service.js.map +1 -0
  121. package/lib/_services/dynamo-nts-db.service.d.ts +244 -0
  122. package/lib/_services/dynamo-nts-db.service.d.ts.map +1 -0
  123. package/lib/_services/dynamo-nts-db.service.js +759 -0
  124. package/lib/_services/dynamo-nts-db.service.js.map +1 -0
  125. package/lib/_services/dynamo-nts-email-service-collection.service.d.ts +19 -0
  126. package/lib/_services/dynamo-nts-email-service-collection.service.d.ts.map +1 -0
  127. package/lib/_services/dynamo-nts-email-service-collection.service.js +21 -0
  128. package/lib/_services/dynamo-nts-email-service-collection.service.js.map +1 -0
  129. package/lib/_services/dynamo-nts-email.service.d.ts +56 -0
  130. package/lib/_services/dynamo-nts-email.service.d.ts.map +1 -0
  131. package/lib/_services/dynamo-nts-email.service.js +194 -0
  132. package/lib/_services/dynamo-nts-email.service.js.map +1 -0
  133. package/lib/_services/dynamo-nts-global.service.d.ts +62 -0
  134. package/lib/_services/dynamo-nts-global.service.d.ts.map +1 -0
  135. package/lib/_services/dynamo-nts-global.service.js +107 -0
  136. package/lib/_services/dynamo-nts-global.service.js.map +1 -0
  137. package/lib/_services/dynamo-nts-routing-module.service.d.ts +42 -0
  138. package/lib/_services/dynamo-nts-routing-module.service.d.ts.map +1 -0
  139. package/lib/_services/dynamo-nts-routing-module.service.js +146 -0
  140. package/lib/_services/dynamo-nts-routing-module.service.js.map +1 -0
  141. package/lib/_services/dynamo-nts-shared.service.d.ts +26 -0
  142. package/lib/_services/dynamo-nts-shared.service.d.ts.map +1 -0
  143. package/lib/_services/dynamo-nts-shared.service.js +63 -0
  144. package/lib/_services/dynamo-nts-shared.service.js.map +1 -0
  145. package/lib/_services/dynamo-nts-singleton.service.d.ts +9 -0
  146. package/lib/_services/dynamo-nts-singleton.service.d.ts.map +1 -0
  147. package/lib/_services/dynamo-nts-singleton.service.js +19 -0
  148. package/lib/_services/dynamo-nts-singleton.service.js.map +1 -0
  149. package/lib/_services/dynamobe-email.service.js +1 -1
  150. package/lib/_services/index.d.ts +13 -13
  151. package/lib/_services/index.d.ts.map +1 -1
  152. package/lib/_services/index.js +13 -13
  153. package/lib/_services/index.js.map +1 -1
  154. package/lib/tsconfig.tsbuildinfo +995 -319
  155. package/package.json +2 -6
  156. package/src/_constants/dynamo-nts-global.settings.ts +12 -0
  157. package/src/_constants/index.ts +1 -1
  158. package/src/_enums/{dynamobe-data-service-function.enum.ts → dynamo-nts-data-service-function.enum.ts} +1 -1
  159. package/src/_enums/{dynamobe-route-security.enum.ts → dynamo-nts-route-security.enum.ts} +1 -1
  160. package/src/_enums/index.ts +2 -2
  161. package/src/_models/dynamo-module-settings.ts +2 -2
  162. package/src/_models/{dynamobe-api-call-params.ts → dynamo-nts-api-call-params.ts} +1 -1
  163. package/src/_models/{dynamobe-app-params.ts → dynamo-nts-app-params.ts} +1 -1
  164. package/src/_models/{dynamobe-endpoint-params.ts → dynamo-nts-endpoint-params.ts} +20 -20
  165. package/src/_models/dynamo-nts-global-settings.ts +13 -0
  166. package/src/_models/index.ts +4 -5
  167. package/src/_modules/api-service.index.ts +3 -3
  168. package/src/_modules/app.index.ts +9 -9
  169. package/src/_modules/auth.index.ts +2 -2
  170. package/src/_modules/controller.index.ts +3 -3
  171. package/src/_modules/data-service.index.ts +4 -4
  172. package/src/_modules/email.index.ts +2 -2
  173. package/src/_modules/test/custom-data.service.ts +2 -2
  174. package/src/_modules/test/get-test-routing-module.ts +5 -5
  175. package/src/_modules/test/test-controller.ts +10 -10
  176. package/src/_modules/usage/get-usage-routing-module.ts +5 -5
  177. package/src/_modules/usage/usage-controller.ts +12 -12
  178. package/src/_modules/usage/usage.service.ts +6 -6
  179. package/src/_services/{dynamobe-api.service.ts → dynamo-nts-api.service.ts} +12 -12
  180. package/src/_services/dynamo-nts-app-extended.ts +124 -0
  181. package/src/_services/{dynamobe-app.ts → dynamo-nts-app.ts} +49 -49
  182. package/src/_services/{dynamobe-auth.service.ts → dynamo-nts-auth.service.ts} +2 -2
  183. package/src/_services/dynamo-nts-controller.service.ts +28 -0
  184. package/src/_services/{dynamobe-data.service.ts → dynamo-nts-data.service.ts} +7 -7
  185. package/src/_services/dynamo-nts-db-service-collection.service.ts +12 -0
  186. package/src/_services/{dynamobe-db.service.ts → dynamo-nts-db.service.ts} +1 -1
  187. package/src/_services/{dynamobe-email-service-collection.service.ts → dynamo-nts-email-service-collection.service.ts} +4 -4
  188. package/src/_services/{dynamobe-email.service.ts → dynamo-nts-email.service.ts} +11 -11
  189. package/src/_services/{dynamobe-global.service.ts → dynamo-nts-global.service.ts} +24 -24
  190. package/src/_services/{dynamobe-routing-module.service.ts → dynamo-nts-routing-module.service.ts} +26 -26
  191. package/src/_services/{dynamobe-shared.service.ts → dynamo-nts-shared.service.ts} +1 -1
  192. package/src/_services/{dynamobe-singleton.service.ts → dynamo-nts-singleton.service.ts} +1 -1
  193. package/src/_services/index.ts +13 -13
  194. package/src/_constants/dynamobe-global.settings.ts +0 -12
  195. package/src/_models/dynamobe-global-settings.ts +0 -13
  196. package/src/_services/dynamobe-controller.service.ts +0 -28
  197. package/src/_services/dynamobe-db-service-collection.service.ts +0 -12
@@ -0,0 +1,167 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DynamoNTS_ApiService = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const Axios = tslib_1.__importStar(require("axios"));
6
+ const fsm_dynamo_1 = require("@futdevpro/fsm-dynamo");
7
+ const http_call_type_enum_1 = require("../_enums/http/http-call-type.enum");
8
+ const http_response_type_enum_1 = require("../_enums/http/http-response-type.enum");
9
+ const dynamo_nts_shared_service_1 = require("./dynamo-nts-shared.service");
10
+ /**
11
+ *
12
+ */
13
+ class DynamoNTS_ApiService {
14
+ /**
15
+ *
16
+ * @param callParams
17
+ * @param inputParams
18
+ * @returns
19
+ */
20
+ static startApiCall(callParams, inputParams) {
21
+ var _a, _b, _c, _d;
22
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
23
+ try {
24
+ let a;
25
+ let url = callParams.baseUrl + callParams.endPoint;
26
+ const privateAxiosInstance = Axios.default.create();
27
+ if ((_a = callParams === null || callParams === void 0 ? void 0 : callParams.httpOptions) === null || _a === void 0 ? void 0 : _a.headers) {
28
+ for (const headerKey in callParams.httpOptions.headers) {
29
+ if (callParams.httpOptions.headers[headerKey]) {
30
+ privateAxiosInstance.defaults.headers.common[headerKey] = callParams.httpOptions.headers[headerKey];
31
+ }
32
+ else {
33
+ dynamo_nts_shared_service_1.DynamoNTS_Shared.logError('DYNAMOBE ERROR: \n missing header:', headerKey, '\n\n', new Error());
34
+ }
35
+ }
36
+ }
37
+ if (inputParams === null || inputParams === void 0 ? void 0 : inputParams.pathParams) {
38
+ for (const pathParamKey in inputParams.pathParams) {
39
+ if (inputParams.pathParams[pathParamKey]) {
40
+ const paramType = typeof inputParams.pathParams[pathParamKey];
41
+ switch (paramType) {
42
+ case 'number':
43
+ url = url.replace(`:${pathParamKey}`, inputParams.pathParams[pathParamKey].toString());
44
+ break;
45
+ case 'string':
46
+ url = url.replace(`:${pathParamKey}`, inputParams.pathParams[pathParamKey]);
47
+ break;
48
+ default:
49
+ dynamo_nts_shared_service_1.DynamoNTS_Shared.logError(`DYNAMOBE ERROR: \n wrong path param type: (${pathParamKey}): ${paramType} \n${inputParams.pathParams[pathParamKey]}\nMUST BE string or number\n\n`, new Error());
50
+ break;
51
+ }
52
+ }
53
+ else {
54
+ dynamo_nts_shared_service_1.DynamoNTS_Shared.logError('DYNAMOBE ERROR: \n missing pathParam:', pathParamKey, '\n\n', new Error());
55
+ }
56
+ }
57
+ }
58
+ /* if (inputParams?.queryParams) {
59
+ const httpParams = new HttpParams();
60
+ for (const queryParamKey in inputParams.queryParams) {
61
+ if (inputParams.queryParams[queryParamKey]) {
62
+ switch (typeof inputParams.queryParams[queryParamKey]) {
63
+ case 'number':
64
+ httpParams.set(queryParamKey, inputParams.queryParams[queryParamKey].toString());
65
+ break;
66
+ case 'string':
67
+ httpParams.set(queryParamKey, inputParams.queryParams[queryParamKey]);
68
+ break;
69
+ default:
70
+ console.error('DYNAMOBE ERROR: \n wrong query param type', '\n\n', new Error());
71
+ break;
72
+ }
73
+ }
74
+ }
75
+ callParams.httpOptions.params = httpParams;
76
+ } */
77
+ switch (callParams.type) {
78
+ case http_call_type_enum_1.HttpCallType.get:
79
+ if (inputParams === null || inputParams === void 0 ? void 0 : inputParams.body) {
80
+ console.log('WARNING you cant send body in get calls');
81
+ }
82
+ yield privateAxiosInstance.get(url, callParams.httpOptions).then((res) => {
83
+ if (callParams.getFullResponse) {
84
+ a = res;
85
+ }
86
+ else {
87
+ a = res.data;
88
+ }
89
+ console.log(`${callParams.name} was successful`, res.data);
90
+ });
91
+ break;
92
+ case http_call_type_enum_1.HttpCallType.delete:
93
+ if (inputParams === null || inputParams === void 0 ? void 0 : inputParams.body) {
94
+ console.log('WARNING you cant send body in delete calls');
95
+ }
96
+ yield privateAxiosInstance.delete(url, callParams.httpOptions).then((res) => {
97
+ if (callParams.getFullResponse) {
98
+ a = res;
99
+ }
100
+ console.log(`${callParams.name} was successful`, res.data);
101
+ });
102
+ break;
103
+ case http_call_type_enum_1.HttpCallType.post:
104
+ case http_call_type_enum_1.HttpCallType.put:
105
+ case http_call_type_enum_1.HttpCallType.patch:
106
+ if (!(inputParams === null || inputParams === void 0 ? void 0 : inputParams.body)) {
107
+ if (!inputParams) {
108
+ inputParams = {};
109
+ }
110
+ inputParams.body = {};
111
+ }
112
+ yield privateAxiosInstance[callParams.type](url, inputParams.body, callParams.httpOptions).then((res) => {
113
+ if (callParams.getFullResponse) {
114
+ a = res;
115
+ }
116
+ else {
117
+ a = res.data;
118
+ }
119
+ console.log(`${callParams.name} api call was successful`, res.data);
120
+ });
121
+ break;
122
+ default:
123
+ dynamo_nts_shared_service_1.DynamoNTS_Shared.logError('DYNAMOBE ERROR: \n wrong api call type', '\n\n', new Error());
124
+ break;
125
+ }
126
+ if (callParams.getFullResponse) {
127
+ return a;
128
+ }
129
+ else {
130
+ return a;
131
+ }
132
+ }
133
+ catch (error) {
134
+ dynamo_nts_shared_service_1.DynamoNTS_Shared.logError(`\nAPI ERRROR: ${callParams === null || callParams === void 0 ? void 0 : callParams.name} failed...` +
135
+ `\n${callParams === null || callParams === void 0 ? void 0 : callParams.baseUrl}${callParams === null || callParams === void 0 ? void 0 : callParams.endPoint}`);
136
+ if (((_b = callParams === null || callParams === void 0 ? void 0 : callParams.httpOptions) === null || _b === void 0 ? void 0 : _b.responseType) === http_response_type_enum_1.HttpResponseType.text) {
137
+ error.error = JSON.parse(error.error);
138
+ }
139
+ if (((_d = (_c = error === null || error === void 0 ? void 0 : error.response) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.flag) === 'DYNAMO-BE ERROR OBJECT') {
140
+ dynamo_nts_shared_service_1.DynamoNTS_Shared.logError(`\n${callParams.name} was UNSUCCESSFUL\n\n`, new Error());
141
+ throw new fsm_dynamo_1.DynamoBEError(error.response.data);
142
+ }
143
+ else if (error.code === 'ENOTFOUND') {
144
+ dynamo_nts_shared_service_1.DynamoNTS_Shared.logError(`\n${callParams.name} was UNSUCCESSFUL\n\n`, new Error());
145
+ throw new fsm_dynamo_1.DynamoBEError({
146
+ status: 404, message: 'DNS error; address cannot be resolved!',
147
+ userMessage: `We encountered a BackEnd API Error, please contact the responsible development team. errorcode: 965-453-300`,
148
+ error: error
149
+ });
150
+ }
151
+ else if (error.config && error.message) {
152
+ throw new fsm_dynamo_1.DynamoBEError({
153
+ status: +error.message.substring(error.message.length - 4, 3),
154
+ userMessage: `We encountered a BackEnd API Error, please contact the responsible development team. errorcode: 965-453-303`,
155
+ error: error
156
+ });
157
+ }
158
+ else {
159
+ dynamo_nts_shared_service_1.DynamoNTS_Shared.logError(`\n${callParams.name} was UNSUCCESSFUL`, error, '\n\n', new Error());
160
+ throw error;
161
+ }
162
+ }
163
+ });
164
+ }
165
+ }
166
+ exports.DynamoNTS_ApiService = DynamoNTS_ApiService;
167
+ //# sourceMappingURL=dynamo-nts-api.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynamo-nts-api.service.js","sourceRoot":"","sources":["../../src/_services/dynamo-nts-api.service.ts"],"names":[],"mappings":";;;;AACA,qDAA+B;AAC/B,sDAAsD;AAEtD,4EAAkE;AAClE,oFAA0E;AAE1E,2EAA+D;AAE/D;;GAEG;AACH,MAAa,oBAAoB;IAE7B;;;;;OAKG;IACE,MAAM,CAAO,YAAY,CAC9B,UAAmC,EACnC,WAMC;;;YAED,IAAI;gBACA,IAAI,CAAM,CAAC;gBACX,IAAI,GAAG,GAAW,UAAU,CAAC,OAAO,GAAG,U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,CAAC,KAAK,UAAU,CAAC,IAAI,mBAAmB,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,KAAK,EAAE,CAAC,CAAC;oBAC/F,MAAM,KAAK,CAAC;iBACf;aACJ;;KACF;CACF;AA3JD,oDA2JC"}
@@ -0,0 +1,23 @@
1
+ import { DynamoNTS_RouteSecurity } from '../_enums/dynamo-nts-route-security.enum';
2
+ import { DynamoNTS_App } from './dynamo-nts-app';
3
+ export declare class DynamoBESocketModule {
4
+ security: DynamoNTS_RouteSecurity;
5
+ port: number;
6
+ }
7
+ /**
8
+ * This will be the main service of our server project,
9
+ * follow the types and type instructions while setting up your project
10
+ *
11
+ * In this service, there are abstract functions that you will need to implement,
12
+ * where you need to set up the main params for your application.
13
+ */
14
+ export declare abstract class DynamoNTS_AppExtended extends DynamoNTS_App {
15
+ private openSocketServer;
16
+ protected socketModules: DynamoBESocketModule[];
17
+ constructor();
18
+ /**
19
+ *
20
+ */
21
+ private initOpenSocketPorts;
22
+ }
23
+ //# sourceMappingURL=dynamo-nts-app-extended.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynamo-nts-app-extended.d.ts","sourceRoot":"","sources":["../../src/_services/dynamo-nts-app-extended.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,qBAAa,oBAAoB;IAC/B,QAAQ,EAAC,uBAAuB,CAAC;IACjC,IAAI,EAAC,MAAM,CAAA;CACZ;AAED;;;;;;GAMG;AACH,8BAAsB,qBAAsB,SAAQ,aAAa;IAE/D,OAAO,CAAC,gBAAgB,CAAkB;IAG1C,SAAS,CAAC,aAAa,EAAE,oBAAoB,EAAE,CAAC;;IAiBhD;;OAEG;IACH,OAAO,CAAC,mBAAmB;CA8E5B"}
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DynamoNTS_AppExtended = exports.DynamoBESocketModule = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const SocketIO = tslib_1.__importStar(require("socket.io"));
6
+ const Http = tslib_1.__importStar(require("http"));
7
+ const dynamo_nts_shared_service_1 = require("./dynamo-nts-shared.service");
8
+ const dynamo_nts_route_security_enum_1 = require("../_enums/dynamo-nts-route-security.enum");
9
+ const dynamo_nts_app_1 = require("./dynamo-nts-app");
10
+ class DynamoBESocketModule {
11
+ }
12
+ exports.DynamoBESocketModule = DynamoBESocketModule;
13
+ /**
14
+ * This will be the main service of our server project,
15
+ * follow the types and type instructions while setting up your project
16
+ *
17
+ * In this service, there are abstract functions that you will need to implement,
18
+ * where you need to set up the main params for your application.
19
+ */
20
+ class DynamoNTS_AppExtended extends dynamo_nts_app_1.DynamoNTS_App {
21
+ constructor() {
22
+ super();
23
+ try {
24
+ if (0 < this.socketModules.length) { // NEW
25
+ if (this.security !== dynamo_nts_route_security_enum_1.DynamoNTS_RouteSecurity.secure) {
26
+ this.initOpenSocketPorts();
27
+ }
28
+ }
29
+ }
30
+ catch (error) {
31
+ dynamo_nts_shared_service_1.DynamoNTS_Shared.logError('\nExtended Application start failed.\n', error);
32
+ }
33
+ }
34
+ /**
35
+ *
36
+ */
37
+ initOpenSocketPorts() {
38
+ const httpSocketServer = Http.createServer(this.openExpress);
39
+ this.openSocketServer = new SocketIO.Server(httpSocketServer);
40
+ this.socketModules.forEach((module) => {
41
+ if (module.security !== dynamo_nts_route_security_enum_1.DynamoNTS_RouteSecurity.secure) {
42
+ if (this.log)
43
+ console.log(`socket mount (open): ${module.port}`);
44
+ const existingPorts = this.socketModules.filter((mod) => mod.port === module.port);
45
+ if (1 < existingPorts.length || this.httpPort === module.port || this.httpsPort === module.port) {
46
+ let error = new Error(`PORT DUPLICATION: ${module.port}`);
47
+ let errorStack = error.stack.split('\n');
48
+ errorStack.splice(1, 4);
49
+ error.stack = errorStack.join('\n');
50
+ throw error;
51
+ }
52
+ const highlight = '\n\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' +
53
+ '\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' +
54
+ '\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' +
55
+ '\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!';
56
+ this.openSocketServer.on('disconnect', (socket) => {
57
+ console.log(highlight, `\nnew DISCONNECT ALFA: \n\n`, socket);
58
+ });
59
+ this.openSocketServer.on('new message', (msg) => {
60
+ console.log(highlight, `\nnew MESSAGE ALFA: \n\n`, msg);
61
+ });
62
+ this.openSocketServer.on('connection', (socket) => {
63
+ console.log(highlight, `\nnew CONNECTION: \n\n`, socket);
64
+ socket.on('disconnect', (socket) => {
65
+ console.log(highlight, `\nnew DISCONNECT BETA: \n\n`, socket);
66
+ });
67
+ socket.on('new message', (msg) => {
68
+ console.log(highlight, `\nnew MESSAGE BETA: \n\n`, msg);
69
+ });
70
+ });
71
+ this.openSocketServer.listen(module.port);
72
+ this.openSocketServer.on('disconnect', (socket) => {
73
+ console.log(highlight, `\nnew DISCONNECT ALFA: \n\n`, socket);
74
+ });
75
+ this.openSocketServer.on('new message', (msg) => {
76
+ console.log(highlight, `\nnew MESSAGE ALFA: \n\n`, msg);
77
+ });
78
+ this.openSocketServer.on('connection', (socket) => {
79
+ console.log(highlight, `\nnew CONNECTION: \n\n`, socket);
80
+ socket.on('disconnect', (socket) => {
81
+ console.log(highlight, `\nnew DISCONNECT BETA: \n\n`, socket);
82
+ });
83
+ socket.on('new message', (msg) => {
84
+ console.log(highlight, `\nnew MESSAGE BETA: \n\n`, msg);
85
+ });
86
+ });
87
+ }
88
+ });
89
+ }
90
+ }
91
+ exports.DynamoNTS_AppExtended = DynamoNTS_AppExtended;
92
+ //# sourceMappingURL=dynamo-nts-app-extended.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynamo-nts-app-extended.js","sourceRoot":"","sources":["../../src/_services/dynamo-nts-app-extended.ts"],"names":[],"mappings":";;;;AACA,4DAAsC;AACtC,mDAA6B;AAE7B,2EAA+D;AAC/D,6FAAmF;AACnF,qDAAiD;AAEjD,MAAa,oBAAoB;CAGhC;AAHD,oDAGC;AAED;;;;;;GAMG;AACH,MAAsB,qBAAsB,SAAQ,8BAAa;IAO/D;QACE,KAAK,EAAE,CAAC;QAER,IAAI;YAEF,IAAI,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,EAAE,MAAM;gBACzC,IAAI,IAAI,CAAC,QAAQ,KAAK,wDAAuB,CAAC,MAAM,EAAE;oBACpD,IAAI,CAAC,mBAAmB,EAAE,CAAC;iBAC5B;aACF;SACF;QAAC,OAAO,KAAK,EAAE;YACd,4CAAgB,CAAC,QAAQ,CAAC,wCAAwC,EAAE,KAAK,CAAC,CAAC;SAC5E;IACH,CAAC;IAED;;OAEG;IACK,mBAAmB;QACzB,MAAM,gBAAgB,GAAgB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC1E,IAAI,CAAC,gBAAgB,GAAG,IAAI,QAAQ,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;QAE9D,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,MAA4B,EAAE,EAAE;YAC1D,IAAI,MAAM,CAAC,QAAQ,KAAK,wDAAuB,CAAC,MAAM,EAAE;gBACtD,IAAI,IAAI,CAAC,GAAG;oBAAE,OAAO,CAAC,GAAG,CAAC,wBAAwB,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;gBAKjE,MAAM,aAAa,GAA2B,IAAI,CAAC,aAAa,CAAC,MAAM,CACnE,CAAC,GAAyB,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC;gB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CAAC;CACF;AAvGD,sDAuGC"}
@@ -0,0 +1,130 @@
1
+ /// <reference types="node" />
2
+ import { DynamoNTS_AppParams } from '../_models/dynamo-nts-app-params';
3
+ import Mongoose = require("mongoose");
4
+ import Express = require("express");
5
+ import * as FileSystem from 'fs';
6
+ import { DynamoNTS_SingletonService } from './dynamo-nts-singleton.service';
7
+ import { DynamoNTS_RouteSecurity } from '../_enums/dynamo-nts-route-security.enum';
8
+ import { DynamoNTS_RoutingModule } from './dynamo-nts-routing-module.service';
9
+ /**
10
+ * This will be the main service of our server project,
11
+ * follow the types and type instructions while setting up your project
12
+ *
13
+ * In this service, there are abstract functions that you will need to implement,
14
+ * where you need to set up the main params for your application.
15
+ */
16
+ export declare abstract class DynamoNTS_App extends DynamoNTS_SingletonService {
17
+ protected params: DynamoNTS_AppParams;
18
+ protected mongoose: typeof Mongoose;
19
+ protected security: DynamoNTS_RouteSecurity;
20
+ protected httpPort?: number;
21
+ protected httpsPort?: number;
22
+ protected cert?: {
23
+ keyPath: FileSystem.PathLike;
24
+ certPath: FileSystem.PathLike;
25
+ };
26
+ private secureExpress;
27
+ private httpsServer;
28
+ protected openExpress: Express.Application;
29
+ protected routingModules: DynamoNTS_RoutingModule[];
30
+ protected log: boolean;
31
+ constructor();
32
+ /**
33
+ *
34
+ */
35
+ private startDB;
36
+ /**
37
+ *
38
+ */
39
+ private initExpresses;
40
+ /**
41
+ *
42
+ */
43
+ private initOpenExpress;
44
+ /**
45
+ *
46
+ */
47
+ private initSecureExpress;
48
+ /**
49
+ *
50
+ */
51
+ private startExpresses;
52
+ /**
53
+ *
54
+ */
55
+ private mountSecureRoutes;
56
+ /**
57
+ *
58
+ */
59
+ private mountOpenRoutes;
60
+ /**
61
+ *
62
+ */
63
+ private setSecurity;
64
+ /**
65
+ * You must setup app params in this function like this:
66
+ *
67
+ * @example
68
+ * this.params = new DynamoBEAppParams({
69
+ * name: 'Sample Server',
70
+ * title: 'A BIG nice header that will be logged on start',
71
+ * version: version,
72
+ * dbName: 'sampleapp',
73
+ * });
74
+ */
75
+ abstract setupAppParams(): void;
76
+ /**
77
+ * You must setup globalServiceCollection and dbServices in this function
78
+ *
79
+ * @example
80
+ * DBE_Global_S.setServices({
81
+ * authService: AuthService.getInstance(),
82
+ * emailServiceCollection: EmailServiceCollectionService.getInstance(),
83
+ * dbModels: [
84
+ * accountModelParams,
85
+ * projectModelParams,
86
+ * ...
87
+ * ]
88
+ * });
89
+ *
90
+ * DBE_Global_S.setGlobalSettings({
91
+ * defaultRouteSecurity: DynamoBERouteSecurity.secure,
92
+ * logSetup: true,
93
+ * });
94
+ *
95
+ */
96
+ abstract setGlobalServiceCollection(): void;
97
+ /**
98
+ * You must setup endpoints and required services in this function
99
+ *
100
+ * @example
101
+ * this.httpPort = env.httpPort;
102
+ * this.httpsPort = env.httpsPort;
103
+
104
+ * this.cert = {
105
+ * keyPath: Path.join(__dirname, './_assets/cert/ucc.key'),
106
+ * certPath: Path.join(__dirname, './_assets/cert/ucc.crt'),
107
+ * };
108
+
109
+ * this.routingModules = [
110
+ * new DynamoBERountingModule({
111
+ * route: '/api/account',
112
+ * controllers: [
113
+ * AccountController.getInstance(),
114
+ * PersonalInformationController.getInstance(),
115
+ * ...
116
+ * ]
117
+ * }),
118
+ * new DynamoBERountingModule({
119
+ * route: '/api/project',
120
+ * controllers: [
121
+ * ProjectController.getInstance(),
122
+ * ProjectExtensionController.getInstance(),
123
+ * ]
124
+ * }),
125
+ * ...
126
+ * ];
127
+ */
128
+ abstract setupRoutingModules(): void;
129
+ }
130
+ //# sourceMappingURL=dynamo-nts-app.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynamo-nts-app.d.ts","sourceRoot":"","sources":["../../src/_services/dynamo-nts-app.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,QAAQ,GAAG,QAAQ,UAAU,CAAC,CAAC;AACtC,OAAO,OAAO,GAAG,QAAQ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