@aldb2b/common 1.0.333 → 1.0.334

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 (262) hide show
  1. package/build/events/publish-event-meeting-statistics.interface.d.ts +10 -0
  2. package/build/{types/analytic-group.interface.js → events/publish-event-meeting-statistics.interface.js} +1 -1
  3. package/build/events/publish-event-meeting-statistics.interface.js.map +1 -0
  4. package/build/events/queues.d.ts +2 -1
  5. package/build/events/queues.js +1 -0
  6. package/build/events/queues.js.map +1 -1
  7. package/build/events/subjects.d.ts +2 -1
  8. package/build/events/subjects.js +1 -0
  9. package/build/events/subjects.js.map +1 -1
  10. package/build/index.d.ts +1 -0
  11. package/build/index.js +1 -0
  12. package/build/index.js.map +1 -1
  13. package/build/tsconfig.tsbuildinfo +20 -6
  14. package/package.json +1 -1
  15. package/build/db/CustomModel.d.ts +0 -4
  16. package/build/db/CustomModel.js +0 -8
  17. package/build/db/CustomModel.js.map +0 -1
  18. package/build/db/MongooseBase.d.ts +0 -41
  19. package/build/db/MongooseBase.js +0 -346
  20. package/build/db/MongooseBase.js.map +0 -1
  21. package/build/db/aggregate/AggregateConvertor.d.ts +0 -23
  22. package/build/db/aggregate/AggregateConvertor.js +0 -212
  23. package/build/db/aggregate/AggregateConvertor.js.map +0 -1
  24. package/build/db/aggregate/createAggregateResponse.d.ts +0 -2
  25. package/build/db/aggregate/createAggregateResponse.js +0 -50
  26. package/build/db/aggregate/createAggregateResponse.js.map +0 -1
  27. package/build/db/mongoose-find-options.d.ts +0 -12
  28. package/build/db/mongoose-find-options.js +0 -68
  29. package/build/db/mongoose-find-options.js.map +0 -1
  30. package/build/decorators/get-event-id-decorator.d.ts +0 -1
  31. package/build/decorators/get-event-id-decorator.js +0 -13
  32. package/build/decorators/get-event-id-decorator.js.map +0 -1
  33. package/build/decorators/get-user-decorator.d.ts +0 -1
  34. package/build/decorators/get-user-decorator.js +0 -13
  35. package/build/decorators/get-user-decorator.js.map +0 -1
  36. package/build/events/exchanges.d.ts +0 -4
  37. package/build/events/exchanges.js +0 -9
  38. package/build/events/exchanges.js.map +0 -1
  39. package/build/interceptors/response-with-code.interceptor.d.ts +0 -6
  40. package/build/interceptors/response-with-code.interceptor.js +0 -32
  41. package/build/interceptors/response-with-code.interceptor.js.map +0 -1
  42. package/build/interceptors/response.interceptor.d.ts +0 -6
  43. package/build/interceptors/response.interceptor.js +0 -31
  44. package/build/interceptors/response.interceptor.js.map +0 -1
  45. package/build/interceptors/serialize.interceptor.d.ts +0 -12
  46. package/build/interceptors/serialize.interceptor.js +0 -25
  47. package/build/interceptors/serialize.interceptor.js.map +0 -1
  48. package/build/middlewares/app.middleware.d.ts +0 -6
  49. package/build/middlewares/app.middleware.js +0 -30
  50. package/build/middlewares/app.middleware.js.map +0 -1
  51. package/build/middlewares/event-status.middleware.d.ts +0 -6
  52. package/build/middlewares/event-status.middleware.js +0 -29
  53. package/build/middlewares/event-status.middleware.js.map +0 -1
  54. package/build/types/analytic-group.interface.d.ts +0 -12
  55. package/build/types/analytic-group.interface.js.map +0 -1
  56. package/build/types/bulk-users.enum.d.ts +0 -5
  57. package/build/types/bulk-users.enum.js +0 -10
  58. package/build/types/bulk-users.enum.js.map +0 -1
  59. package/build/types/calendar-source-type.enum.d.ts +0 -7
  60. package/build/types/calendar-source-type.enum.js +0 -12
  61. package/build/types/calendar-source-type.enum.js.map +0 -1
  62. package/build/types/chat-group.interface.d.ts +0 -4
  63. package/build/types/chat-group.interface.js +0 -3
  64. package/build/types/chat-group.interface.js.map +0 -1
  65. package/build/types/default-visibility.interface.d.ts +0 -13
  66. package/build/types/default-visibility.interface.js +0 -3
  67. package/build/types/default-visibility.interface.js.map +0 -1
  68. package/build/types/download-presigned-url.interface.d.ts +0 -4
  69. package/build/types/download-presigned-url.interface.js +0 -3
  70. package/build/types/download-presigned-url.interface.js.map +0 -1
  71. package/build/types/enddpoint.interface.d.ts +0 -10
  72. package/build/types/enddpoint.interface.js +0 -3
  73. package/build/types/enddpoint.interface.js.map +0 -1
  74. package/build/types/endpoint-type.enum.d.ts +0 -5
  75. package/build/types/endpoint-type.enum.js +0 -10
  76. package/build/types/endpoint-type.enum.js.map +0 -1
  77. package/build/types/event-status.enum.d.ts +0 -8
  78. package/build/types/event-status.enum.js +0 -13
  79. package/build/types/event-status.enum.js.map +0 -1
  80. package/build/types/feature-mappings.d.ts +0 -18
  81. package/build/types/feature-mappings.js +0 -29
  82. package/build/types/feature-mappings.js.map +0 -1
  83. package/build/types/feature-type.enum.d.ts +0 -20
  84. package/build/types/feature-type.enum.js +0 -25
  85. package/build/types/feature-type.enum.js.map +0 -1
  86. package/build/types/feature.interface.d.ts +0 -10
  87. package/build/types/feature.interface.js +0 -3
  88. package/build/types/feature.interface.js.map +0 -1
  89. package/build/types/group-visibility.interface.d.ts +0 -13
  90. package/build/types/group-visibility.interface.js +0 -3
  91. package/build/types/group-visibility.interface.js.map +0 -1
  92. package/build/types/header-user.interface.d.ts +0 -10
  93. package/build/types/header-user.interface.js +0 -3
  94. package/build/types/header-user.interface.js.map +0 -1
  95. package/build/types/match-group.interface.d.ts +0 -7
  96. package/build/types/match-group.interface.js +0 -3
  97. package/build/types/match-group.interface.js.map +0 -1
  98. package/build/types/match.interface.d.ts +0 -6
  99. package/build/types/match.interface.js +0 -3
  100. package/build/types/match.interface.js.map +0 -1
  101. package/build/types/meeting-request-token.interface.d.ts +0 -6
  102. package/build/types/meeting-request-token.interface.js +0 -3
  103. package/build/types/meeting-request-token.interface.js.map +0 -1
  104. package/build/types/meeting-type.enum.d.ts +0 -8
  105. package/build/types/meeting-type.enum.js +0 -13
  106. package/build/types/meeting-type.enum.js.map +0 -1
  107. package/build/types/notification-event.enum.d.ts +0 -25
  108. package/build/types/notification-event.enum.js +0 -30
  109. package/build/types/notification-event.enum.js.map +0 -1
  110. package/build/types/notification-type.enum.d.ts +0 -6
  111. package/build/types/notification-type.enum.js +0 -11
  112. package/build/types/notification-type.enum.js.map +0 -1
  113. package/build/types/onboarded-thru.enum.d.ts +0 -11
  114. package/build/types/onboarded-thru.enum.js +0 -16
  115. package/build/types/onboarded-thru.enum.js.map +0 -1
  116. package/build/types/operation-types.d.ts +0 -6
  117. package/build/types/operation-types.js +0 -11
  118. package/build/types/operation-types.js.map +0 -1
  119. package/build/types/payment-method.enum.d.ts +0 -5
  120. package/build/types/payment-method.enum.js +0 -10
  121. package/build/types/payment-method.enum.js.map +0 -1
  122. package/build/types/priority.enum.d.ts +0 -6
  123. package/build/types/priority.enum.js +0 -11
  124. package/build/types/priority.enum.js.map +0 -1
  125. package/build/types/read-result.interface.d.ts +0 -5
  126. package/build/types/read-result.interface.js +0 -3
  127. package/build/types/read-result.interface.js.map +0 -1
  128. package/build/types/record-type.enum.d.ts +0 -19
  129. package/build/types/record-type.enum.js +0 -24
  130. package/build/types/record-type.enum.js.map +0 -1
  131. package/build/types/subscription-model.enum.d.ts +0 -4
  132. package/build/types/subscription-model.enum.js +0 -9
  133. package/build/types/subscription-model.enum.js.map +0 -1
  134. package/build/types/update-input-data.interface.d.ts +0 -11
  135. package/build/types/update-input-data.interface.js +0 -3
  136. package/build/types/update-input-data.interface.js.map +0 -1
  137. package/build/types/upload-presigned-url.interface.d.ts +0 -4
  138. package/build/types/upload-presigned-url.interface.js +0 -3
  139. package/build/types/upload-presigned-url.interface.js.map +0 -1
  140. package/build/types/user-invitations.interface.d.ts +0 -6
  141. package/build/types/user-invitations.interface.js +0 -3
  142. package/build/types/user-invitations.interface.js.map +0 -1
  143. package/build/types/user-language.enum.d.ts +0 -5
  144. package/build/types/user-language.enum.js +0 -10
  145. package/build/types/user-language.enum.js.map +0 -1
  146. package/build/types/user-role.enum.d.ts +0 -8
  147. package/build/types/user-role.enum.js +0 -13
  148. package/build/types/user-role.enum.js.map +0 -1
  149. package/build/types/user-type.enum.d.ts +0 -5
  150. package/build/types/user-type.enum.js +0 -10
  151. package/build/types/user-type.enum.js.map +0 -1
  152. package/build/types/visibility-group.interface.d.ts +0 -6
  153. package/build/types/visibility-group.interface.js +0 -3
  154. package/build/types/visibility-group.interface.js.map +0 -1
  155. package/build/utils/addDaysToDate.d.ts +0 -1
  156. package/build/utils/addDaysToDate.js +0 -10
  157. package/build/utils/addDaysToDate.js.map +0 -1
  158. package/build/utils/addHours.d.ts +0 -1
  159. package/build/utils/addHours.js +0 -9
  160. package/build/utils/addHours.js.map +0 -1
  161. package/build/utils/adjustForTimezone.d.ts +0 -1
  162. package/build/utils/adjustForTimezone.js +0 -10
  163. package/build/utils/adjustForTimezone.js.map +0 -1
  164. package/build/utils/create-default-directories.d.ts +0 -1
  165. package/build/utils/create-default-directories.js +0 -24
  166. package/build/utils/create-default-directories.js.map +0 -1
  167. package/build/utils/equal-array-object.d.ts +0 -1
  168. package/build/utils/equal-array-object.js +0 -10
  169. package/build/utils/equal-array-object.js.map +0 -1
  170. package/build/utils/equal-object.d.ts +0 -1
  171. package/build/utils/equal-object.js +0 -9
  172. package/build/utils/equal-object.js.map +0 -1
  173. package/build/utils/get-parsed-query.d.ts +0 -1
  174. package/build/utils/get-parsed-query.js +0 -18
  175. package/build/utils/get-parsed-query.js.map +0 -1
  176. package/build/utils/getEndpoint.d.ts +0 -5
  177. package/build/utils/getEndpoint.js +0 -43
  178. package/build/utils/getEndpoint.js.map +0 -1
  179. package/build/utils/getHeaderParam.d.ts +0 -1
  180. package/build/utils/getHeaderParam.js +0 -8
  181. package/build/utils/getHeaderParam.js.map +0 -1
  182. package/build/utils/parse-query.d.ts +0 -1
  183. package/build/utils/parse-query.js +0 -31
  184. package/build/utils/parse-query.js.map +0 -1
  185. package/build/utils/projection.d.ts +0 -1
  186. package/build/utils/projection.js +0 -26
  187. package/build/utils/projection.js.map +0 -1
  188. package/build/utils/redis-client.d.ts +0 -9
  189. package/build/utils/redis-client.js +0 -55
  190. package/build/utils/redis-client.js.map +0 -1
  191. package/build/utils/rmq/client/rabbitmq.client.d.ts +0 -29
  192. package/build/utils/rmq/client/rabbitmq.client.js +0 -162
  193. package/build/utils/rmq/client/rabbitmq.client.js.map +0 -1
  194. package/build/utils/rmq/constants.d.ts +0 -9
  195. package/build/utils/rmq/constants.js +0 -13
  196. package/build/utils/rmq/constants.js.map +0 -1
  197. package/build/utils/rmq/ctx-host/rmq.context.d.ts +0 -9
  198. package/build/utils/rmq/ctx-host/rmq.context.js +0 -20
  199. package/build/utils/rmq/ctx-host/rmq.context.js.map +0 -1
  200. package/build/utils/rmq/index.d.ts +0 -4
  201. package/build/utils/rmq/index.js +0 -10
  202. package/build/utils/rmq/index.js.map +0 -1
  203. package/build/utils/rmq/interfaces/rmq-options.interfaces.d.ts +0 -79
  204. package/build/utils/rmq/interfaces/rmq-options.interfaces.js +0 -12
  205. package/build/utils/rmq/interfaces/rmq-options.interfaces.js.map +0 -1
  206. package/build/utils/rmq/server/rabbitmq.server.d.ts +0 -19
  207. package/build/utils/rmq/server/rabbitmq.server.js +0 -114
  208. package/build/utils/rmq/server/rabbitmq.server.js.map +0 -1
  209. package/build/utils/timezone.d.ts +0 -2
  210. package/build/utils/timezone.js +0 -15
  211. package/build/utils/timezone.js.map +0 -1
  212. package/build/validators/conditional-required.d.ts +0 -2
  213. package/build/validators/conditional-required.js +0 -24
  214. package/build/validators/conditional-required.js.map +0 -1
  215. package/build/validators/date-validator.d.ts +0 -2
  216. package/build/validators/date-validator.js +0 -21
  217. package/build/validators/date-validator.js.map +0 -1
  218. package/build/validators/responses/customizeArrayResponse.d.ts +0 -3
  219. package/build/validators/responses/customizeArrayResponse.js +0 -24
  220. package/build/validators/responses/customizeArrayResponse.js.map +0 -1
  221. package/build/validators/responses/error-with-code.d.ts +0 -2
  222. package/build/validators/responses/error-with-code.interface.d.ts +0 -5
  223. package/build/validators/responses/error-with-code.interface.js +0 -3
  224. package/build/validators/responses/error-with-code.interface.js.map +0 -1
  225. package/build/validators/responses/error-with-code.js +0 -30
  226. package/build/validators/responses/error-with-code.js.map +0 -1
  227. package/build/validators/responses/error.d.ts +0 -2
  228. package/build/validators/responses/error.interface.d.ts +0 -4
  229. package/build/validators/responses/error.interface.js +0 -3
  230. package/build/validators/responses/error.interface.js.map +0 -1
  231. package/build/validators/responses/error.js +0 -29
  232. package/build/validators/responses/error.js.map +0 -1
  233. package/build/validators/responses/response-option.interface.d.ts +0 -7
  234. package/build/validators/responses/response-option.interface.js +0 -3
  235. package/build/validators/responses/response-option.interface.js.map +0 -1
  236. package/build/validators/responses/succes-result.interface.d.ts +0 -10
  237. package/build/validators/responses/succes-result.interface.js +0 -3
  238. package/build/validators/responses/succes-result.interface.js.map +0 -1
  239. package/build/validators/responses/success-with-code.d.ts +0 -3
  240. package/build/validators/responses/success-with-code.interface.d.ts +0 -4
  241. package/build/validators/responses/success-with-code.interface.js +0 -3
  242. package/build/validators/responses/success-with-code.interface.js.map +0 -1
  243. package/build/validators/responses/success-with-code.js +0 -15
  244. package/build/validators/responses/success-with-code.js.map +0 -1
  245. package/build/validators/responses/success.d.ts +0 -3
  246. package/build/validators/responses/success.interface.d.ts +0 -4
  247. package/build/validators/responses/success.interface.js +0 -3
  248. package/build/validators/responses/success.interface.js.map +0 -1
  249. package/build/validators/responses/success.js +0 -15
  250. package/build/validators/responses/success.js.map +0 -1
  251. package/build/validators/validateNewItem.d.ts +0 -1
  252. package/build/validators/validateNewItem.js +0 -23
  253. package/build/validators/validateNewItem.js.map +0 -1
  254. package/build/validators/validateProjection.d.ts +0 -1
  255. package/build/validators/validateProjection.js +0 -33
  256. package/build/validators/validateProjection.js.map +0 -1
  257. package/build/validators/validateProjectionResult.d.ts +0 -1
  258. package/build/validators/validateProjectionResult.js +0 -37
  259. package/build/validators/validateProjectionResult.js.map +0 -1
  260. package/build/validators/validateUpdateItem.d.ts +0 -1
  261. package/build/validators/validateUpdateItem.js +0 -23
  262. package/build/validators/validateUpdateItem.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"conditional-required.js","sourceRoot":"","sources":["../../src/validators/conditional-required.ts"],"names":[],"mappings":";;;AAAA,qDAIyB;AAEzB,SAAgB,mBAAmB,CACjC,QAAgB,EAChB,iBAAqC;IAErC,OAAO,UAAU,MAAc,EAAE,YAAoB;QACnD,mCAAiB,CAAC;YAChB,IAAI,EAAE,qBAAqB;YAC3B,MAAM,EAAE,MAAM,CAAC,WAAW;YAC1B,YAAY,EAAE,YAAY;YAC1B,WAAW,EAAE,CAAC,QAAQ,CAAC;YACvB,OAAO,EAAE,iBAAiB;YAC1B,SAAS,EAAE;gBACT,QAAQ,CAAC,KAAU,EAAE,IAAyB;oBAC5C,MAAM,CAAC,mBAAmB,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC;oBAC/C,MAAM,YAAY,GAAI,IAAI,CAAC,MAAc,CAAC,mBAAmB,CAAC,CAAC;oBAC/D,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,YAAY,CAAC,CAAA;gBAClC,CAAC;aACF;SACF,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AApBD,kDAoBC"}
@@ -1,2 +0,0 @@
1
- import { ValidationOptions } from 'class-validator';
2
- export declare function DateValidator(validationOptions?: ValidationOptions): (object: Object, propertyName: string) => void;
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DateValidator = void 0;
4
- const class_validator_1 = require("class-validator");
5
- function DateValidator(validationOptions) {
6
- return function (object, propertyName) {
7
- class_validator_1.registerDecorator({
8
- name: 'dateValidator',
9
- target: object.constructor,
10
- propertyName: propertyName,
11
- options: validationOptions,
12
- validator: {
13
- validate(value) {
14
- return new Date(value) > new Date();
15
- },
16
- },
17
- });
18
- };
19
- }
20
- exports.DateValidator = DateValidator;
21
- //# sourceMappingURL=date-validator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"date-validator.js","sourceRoot":"","sources":["../../src/validators/date-validator.ts"],"names":[],"mappings":";;;AAAA,qDAGyB;AAEzB,SAAgB,aAAa,CAC3B,iBAAqC;IAErC,OAAO,UAAU,MAAc,EAAE,YAAoB;QACnD,mCAAiB,CAAC;YAChB,IAAI,EAAE,eAAe;YACrB,MAAM,EAAE,MAAM,CAAC,WAAW;YAC1B,YAAY,EAAE,YAAY;YAC1B,OAAO,EAAE,iBAAiB;YAC1B,SAAS,EAAE;gBACT,QAAQ,CAAC,KAAU;oBACjB,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,EAAE,CAAA;gBACrC,CAAC;aACF;SACF,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAhBD,sCAgBC"}
@@ -1,3 +0,0 @@
1
- import { ResponseOption } from './response-option.interface';
2
- import { SuccessResult } from './succes-result.interface';
3
- export declare const customizeArrayResponse: (data?: unknown[], { hasTotal, total, skip, limit, sort, }?: ResponseOption) => SuccessResult;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.customizeArrayResponse = void 0;
4
- const customizeArrayResponse = (data = [], { hasTotal = false, total = 0, skip = null, limit = null, sort = null, } = {}) => {
5
- const result = {
6
- data: data,
7
- count: data.length ? data.length : 0,
8
- };
9
- if (hasTotal) {
10
- result.total = total >= data.length ? total : data.length;
11
- }
12
- if (skip || limit) {
13
- result.hasStaticRange = true;
14
- result.skip = skip;
15
- result.limit = limit;
16
- }
17
- if (sort) {
18
- result.customSort = true;
19
- result.sort = sort;
20
- }
21
- return result;
22
- };
23
- exports.customizeArrayResponse = customizeArrayResponse;
24
- //# sourceMappingURL=customizeArrayResponse.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"customizeArrayResponse.js","sourceRoot":"","sources":["../../../src/validators/responses/customizeArrayResponse.ts"],"names":[],"mappings":";;;AAGO,MAAM,sBAAsB,GAAG,CACpC,OAAkB,EAAE,EACpB,EACE,QAAQ,GAAG,KAAK,EAChB,KAAK,GAAG,CAAC,EACT,IAAI,GAAG,IAAI,EACX,KAAK,GAAG,IAAI,EACZ,IAAI,GAAG,IAAI,MACO,EAAE,EACP,EAAE;IACjB,MAAM,MAAM,GAAkB;QAC5B,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;KACrC,CAAC;IAEF,IAAI,QAAQ,EAAE;QACZ,MAAM,CAAC,KAAK,GAAG,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;KAC3D;IAED,IAAI,IAAI,IAAI,KAAK,EAAE;QACjB,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC;QAC7B,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;QACnB,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;KACtB;IAED,IAAI,IAAI,EAAE;QACR,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC;QACzB,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;KACpB;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AA/BW,QAAA,sBAAsB,0BA+BjC"}
@@ -1,2 +0,0 @@
1
- import { ErrorWithCodeInterface } from './error-with-code.interface';
2
- export declare function errorWithCode(err: any): ErrorWithCodeInterface;
@@ -1,5 +0,0 @@
1
- export interface ErrorWithCodeInterface {
2
- success: boolean;
3
- error: object;
4
- statusCode: number;
5
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=error-with-code.interface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"error-with-code.interface.js","sourceRoot":"","sources":["../../../src/validators/responses/error-with-code.interface.ts"],"names":[],"mappings":""}
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.errorWithCode = void 0;
4
- function errorWithCode(err) {
5
- var _a;
6
- const error = ((_a = err === null || err === void 0 ? void 0 : err.response) === null || _a === void 0 ? void 0 : _a.message)
7
- ? err.response.message
8
- : err.stack
9
- ? err.stack
10
- : extractError(err) || err;
11
- return {
12
- success: false,
13
- error: error,
14
- statusCode: err.status,
15
- };
16
- }
17
- exports.errorWithCode = errorWithCode;
18
- const extractError = err => {
19
- if (err.errors) {
20
- for (const errorKey in err.errors) {
21
- if (err.errors[errorKey].message) {
22
- return err.errors[errorKey].message;
23
- }
24
- }
25
- }
26
- else {
27
- return false;
28
- }
29
- };
30
- //# sourceMappingURL=error-with-code.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"error-with-code.js","sourceRoot":"","sources":["../../../src/validators/responses/error-with-code.ts"],"names":[],"mappings":";;;AAEA,SAAgB,aAAa,CAAC,GAAG;;IAC/B,MAAM,KAAK,GAAG,CAAA,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,QAAQ,0CAAE,OAAO;QAClC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO;QACtB,CAAC,CAAC,GAAG,CAAC,KAAK;YACX,CAAC,CAAC,GAAG,CAAC,KAAK;YACX,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,GAAG,CAAA;IAC5B,OAAO;QACL,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,KAAK;QACZ,UAAU,EAAE,GAAG,CAAC,MAAM;KACvB,CAAA;AACH,CAAC;AAXD,sCAWC;AAED,MAAM,YAAY,GAAG,GAAG,CAAC,EAAE;IACzB,IAAI,GAAG,CAAC,MAAM,EAAE;QACd,KAAK,MAAM,QAAQ,IAAI,GAAG,CAAC,MAAM,EAAE;YACjC,IAAI,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE;gBAChC,OAAO,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAA;aACpC;SACF;KACF;SAAM;QACL,OAAO,KAAK,CAAA;KACb;AACH,CAAC,CAAA"}
@@ -1,2 +0,0 @@
1
- import { ErrorResponse } from './error.interface';
2
- export declare function error(err: any): ErrorResponse;
@@ -1,4 +0,0 @@
1
- export interface ErrorResponse {
2
- success: boolean;
3
- error: object;
4
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=error.interface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"error.interface.js","sourceRoot":"","sources":["../../../src/validators/responses/error.interface.ts"],"names":[],"mappings":""}
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.error = void 0;
4
- function error(err) {
5
- var _a;
6
- const error = ((_a = err === null || err === void 0 ? void 0 : err.response) === null || _a === void 0 ? void 0 : _a.message)
7
- ? err.response.message
8
- : err.stack
9
- ? err.stack
10
- : extractError(err) || err;
11
- return {
12
- success: false,
13
- error: error,
14
- };
15
- }
16
- exports.error = error;
17
- const extractError = err => {
18
- if (err.errors) {
19
- for (const errorKey in err.errors) {
20
- if (err.errors[errorKey].message) {
21
- return err.errors[errorKey].message;
22
- }
23
- }
24
- }
25
- else {
26
- return false;
27
- }
28
- };
29
- //# sourceMappingURL=error.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"error.js","sourceRoot":"","sources":["../../../src/validators/responses/error.ts"],"names":[],"mappings":";;;AAEA,SAAgB,KAAK,CAAC,GAAG;;IACvB,MAAM,KAAK,GAAG,CAAA,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,QAAQ,0CAAE,OAAO;QAClC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO;QACtB,CAAC,CAAC,GAAG,CAAC,KAAK;YACX,CAAC,CAAC,GAAG,CAAC,KAAK;YACX,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,GAAG,CAAA;IAC5B,OAAO;QACL,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,KAAK;KACb,CAAA;AACH,CAAC;AAVD,sBAUC;AAED,MAAM,YAAY,GAAG,GAAG,CAAC,EAAE;IACzB,IAAI,GAAG,CAAC,MAAM,EAAE;QACd,KAAK,MAAM,QAAQ,IAAI,GAAG,CAAC,MAAM,EAAE;YACjC,IAAI,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE;gBAChC,OAAO,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAA;aACpC;SACF;KACF;SAAM;QACL,OAAO,KAAK,CAAA;KACb;AACH,CAAC,CAAA"}
@@ -1,7 +0,0 @@
1
- export interface ResponseOption {
2
- hasTotal?: boolean;
3
- total?: number;
4
- skip?: number;
5
- limit?: number;
6
- sort?: object | string;
7
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=response-option.interface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"response-option.interface.js","sourceRoot":"","sources":["../../../src/validators/responses/response-option.interface.ts"],"names":[],"mappings":""}
@@ -1,10 +0,0 @@
1
- export interface SuccessResult {
2
- data: object | object[];
3
- count?: number;
4
- total?: number;
5
- hasStaticRange?: boolean;
6
- skip?: number;
7
- limit?: number;
8
- sort?: object | string;
9
- customSort?: boolean;
10
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=succes-result.interface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"succes-result.interface.js","sourceRoot":"","sources":["../../../src/validators/responses/succes-result.interface.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- import { ResponseOption } from './response-option.interface';
2
- import { SuccessResponseWithCode } from './success-with-code.interface';
3
- export declare function successWithCode(result: object | object[], options?: ResponseOption): SuccessResponseWithCode;
@@ -1,4 +0,0 @@
1
- export interface SuccessResponseWithCode {
2
- success: boolean;
3
- [key: string]: object | boolean | number;
4
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=success-with-code.interface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"success-with-code.interface.js","sourceRoot":"","sources":["../../../src/validators/responses/success-with-code.interface.ts"],"names":[],"mappings":""}
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.successWithCode = void 0;
4
- const customizeArrayResponse_1 = require("./customizeArrayResponse");
5
- function successWithCode(result, options) {
6
- return {
7
- success: true,
8
- statusCode: 200,
9
- result: Array.isArray(result)
10
- ? customizeArrayResponse_1.customizeArrayResponse(result, options)
11
- : result,
12
- };
13
- }
14
- exports.successWithCode = successWithCode;
15
- //# sourceMappingURL=success-with-code.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"success-with-code.js","sourceRoot":"","sources":["../../../src/validators/responses/success-with-code.ts"],"names":[],"mappings":";;;AAAA,qEAAgE;AAIhE,SAAgB,eAAe,CAC7B,MAAyB,EACzB,OAAwB;IAExB,OAAO;QACL,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,GAAG;QACf,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;YACzB,CAAC,CAAC,+CAAsB,CAAC,MAAM,EAAE,OAAO,CAAC;YACzC,CAAC,CAAC,MAAM;KACb,CAAC;AACJ,CAAC;AAXD,0CAWC"}
@@ -1,3 +0,0 @@
1
- import { ResponseOption } from './response-option.interface';
2
- import { SuccessResponse } from './success.interface';
3
- export declare function success(result: object | object[], options?: ResponseOption): SuccessResponse;
@@ -1,4 +0,0 @@
1
- export interface SuccessResponse {
2
- success: boolean;
3
- [key: string]: object | boolean;
4
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=success.interface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"success.interface.js","sourceRoot":"","sources":["../../../src/validators/responses/success.interface.ts"],"names":[],"mappings":""}
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.success = void 0;
4
- const customizeArrayResponse_1 = require("./customizeArrayResponse");
5
- function success(result, options) {
6
- const response = {
7
- success: true,
8
- result: Array.isArray(result)
9
- ? customizeArrayResponse_1.customizeArrayResponse(result, options)
10
- : result,
11
- };
12
- return response;
13
- }
14
- exports.success = success;
15
- //# sourceMappingURL=success.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"success.js","sourceRoot":"","sources":["../../../src/validators/responses/success.ts"],"names":[],"mappings":";;;AAAA,qEAAkE;AAIlE,SAAgB,OAAO,CACrB,MAAyB,EACzB,OAAwB;IAExB,MAAM,QAAQ,GAAoB;QAChC,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;YAC3B,CAAC,CAAC,+CAAsB,CAAC,MAAM,EAAE,OAAO,CAAC;YACzC,CAAC,CAAC,MAAM;KACX,CAAC;IACF,OAAO,QAAQ,CAAC;AAClB,CAAC;AAXD,0BAWC"}
@@ -1 +0,0 @@
1
- export declare function validateNewItem(allValidateNewItemFieldArray: string[], newItemObj: object): object;
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateNewItem = void 0;
4
- function validateNewItem(allValidateNewItemFieldArray, newItemObj) {
5
- const validatedNewItem = {};
6
- try {
7
- if (Array.isArray(allValidateNewItemFieldArray) &&
8
- allValidateNewItemFieldArray.length) {
9
- for (const fieldName in newItemObj) {
10
- if (newItemObj[fieldName] !== undefined &&
11
- allValidateNewItemFieldArray.includes(fieldName)) {
12
- validatedNewItem[fieldName] = newItemObj[fieldName];
13
- }
14
- }
15
- }
16
- return validatedNewItem;
17
- }
18
- catch (err) {
19
- throw err;
20
- }
21
- }
22
- exports.validateNewItem = validateNewItem;
23
- //# sourceMappingURL=validateNewItem.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validateNewItem.js","sourceRoot":"","sources":["../../src/validators/validateNewItem.ts"],"names":[],"mappings":";;;AAAA,SAAgB,eAAe,CAC7B,4BAAsC,EACtC,UAAkB;IAElB,MAAM,gBAAgB,GAAG,EAAE,CAAC;IAC5B,IAAI;QACF,IACE,KAAK,CAAC,OAAO,CAAC,4BAA4B,CAAC;YAC3C,4BAA4B,CAAC,MAAM,EACnC;YACA,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;gBAClC,IACE,UAAU,CAAC,SAAS,CAAC,KAAK,SAAS;oBACnC,4BAA4B,CAAC,QAAQ,CAAC,SAAS,CAAC,EAChD;oBACA,gBAAgB,CAAC,SAAS,CAAC,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;iBACrD;aACF;SACF;QAED,OAAO,gBAAgB,CAAC;KACzB;IAAC,OAAO,GAAG,EAAE;QACZ,MAAM,GAAG,CAAC;KACX;AACH,CAAC;AAxBD,0CAwBC"}
@@ -1 +0,0 @@
1
- export declare function validateProjection(allProjectionFieldArray: string[], necessaryProjectionArray: string[]): object;
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateProjection = void 0;
4
- function validateProjection(allProjectionFieldArray, necessaryProjectionArray) {
5
- const validatedProjection = {};
6
- try {
7
- let returnAll = true;
8
- Array.isArray(necessaryProjectionArray) &&
9
- necessaryProjectionArray.length &&
10
- necessaryProjectionArray.map((key) => {
11
- if (allProjectionFieldArray.length) {
12
- if (allProjectionFieldArray.includes(key)) {
13
- returnAll = false;
14
- validatedProjection[key] = true;
15
- }
16
- }
17
- else {
18
- returnAll = false;
19
- validatedProjection[key] = true;
20
- }
21
- });
22
- if (returnAll) {
23
- allProjectionFieldArray.map((key) => (validatedProjection[key] = true));
24
- }
25
- }
26
- catch (err) {
27
- }
28
- finally {
29
- return validatedProjection;
30
- }
31
- }
32
- exports.validateProjection = validateProjection;
33
- //# sourceMappingURL=validateProjection.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validateProjection.js","sourceRoot":"","sources":["../../src/validators/validateProjection.ts"],"names":[],"mappings":";;;AAAA,SAAgB,kBAAkB,CAChC,uBAAiC,EACjC,wBAAkC;IAElC,MAAM,mBAAmB,GAAG,EAAE,CAAC;IAC/B,IAAI;QACF,IAAI,SAAS,GAAG,IAAI,CAAC;QAErB,KAAK,CAAC,OAAO,CAAC,wBAAwB,CAAC;YACrC,wBAAwB,CAAC,MAAM;YAC/B,wBAAwB,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;gBACnC,IAAI,uBAAuB,CAAC,MAAM,EAAE;oBAClC,IAAI,uBAAuB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;wBACzC,SAAS,GAAG,KAAK,CAAC;wBAClB,mBAAmB,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;qBACjC;iBACF;qBAAM;oBACL,SAAS,GAAG,KAAK,CAAC;oBAClB,mBAAmB,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;iBACjC;YACH,CAAC,CAAC,CAAC;QAEL,IAAI,SAAS,EAAE;YACb,uBAAuB,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,mBAAmB,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;SACzE;KACF;IAAC,OAAO,GAAG,EAAE;KACb;YAAS;QACR,OAAO,mBAAmB,CAAC;KAC5B;AACH,CAAC;AA7BD,gDA6BC"}
@@ -1 +0,0 @@
1
- export declare function validateProjectionResult(allProjectionFieldArray: string[], necessaryProjectionObj: any): object;
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateProjectionResult = void 0;
4
- function validateProjectionResult(allProjectionFieldArray, necessaryProjectionObj) {
5
- const returnProjectedResult = {};
6
- try {
7
- let returnAll = true;
8
- if (typeof necessaryProjectionObj === 'object' &&
9
- necessaryProjectionObj !== null &&
10
- Object.keys(necessaryProjectionObj).length) {
11
- for (const key in necessaryProjectionObj) {
12
- if (necessaryProjectionObj.hasOwnProperty(key)) {
13
- if (allProjectionFieldArray.length) {
14
- if (allProjectionFieldArray.includes(key)) {
15
- returnAll = false;
16
- returnProjectedResult[key] = necessaryProjectionObj[key];
17
- }
18
- }
19
- else {
20
- returnAll = false;
21
- returnProjectedResult[key] = necessaryProjectionObj[key];
22
- }
23
- }
24
- }
25
- }
26
- if (returnAll) {
27
- allProjectionFieldArray.map((key) => (returnProjectedResult[key] = necessaryProjectionObj[key]));
28
- }
29
- }
30
- catch (err) {
31
- }
32
- finally {
33
- return returnProjectedResult;
34
- }
35
- }
36
- exports.validateProjectionResult = validateProjectionResult;
37
- //# sourceMappingURL=validateProjectionResult.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validateProjectionResult.js","sourceRoot":"","sources":["../../src/validators/validateProjectionResult.ts"],"names":[],"mappings":";;;AAAA,SAAgB,wBAAwB,CACtC,uBAAiC,EACjC,sBAAsB;IAEtB,MAAM,qBAAqB,GAAG,EAAE,CAAC;IACjC,IAAI;QACF,IAAI,SAAS,GAAG,IAAI,CAAC;QAErB,IACE,OAAO,sBAAsB,KAAK,QAAQ;YAC1C,sBAAsB,KAAK,IAAI;YAC/B,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,MAAM,EAC1C;YACA,KAAK,MAAM,GAAG,IAAI,sBAAsB,EAAE;gBACxC,IAAI,sBAAsB,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;oBAC9C,IAAI,uBAAuB,CAAC,MAAM,EAAE;wBAClC,IAAI,uBAAuB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;4BACzC,SAAS,GAAG,KAAK,CAAC;4BAClB,qBAAqB,CAAC,GAAG,CAAC,GAAG,sBAAsB,CAAC,GAAG,CAAC,CAAC;yBAC1D;qBACF;yBAAM;wBACL,SAAS,GAAG,KAAK,CAAC;wBAClB,qBAAqB,CAAC,GAAG,CAAC,GAAG,sBAAsB,CAAC,GAAG,CAAC,CAAC;qBAC1D;iBACF;aACF;SACF;QAED,IAAI,SAAS,EAAE;YACb,uBAAuB,CAAC,GAAG,CACzB,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,qBAAqB,CAAC,GAAG,CAAC,GAAG,sBAAsB,CAAC,GAAG,CAAC,CAAC,CACpE,CAAC;SACH;KACF;IAAC,OAAO,GAAG,EAAE;KACb;YAAS;QACR,OAAO,qBAAqB,CAAC;KAC9B;AACH,CAAC;AArCD,4DAqCC"}
@@ -1 +0,0 @@
1
- export declare function validateUpdateItem(allValidateUpdateItemFieldArray: string[], updateItemObj: any): object;
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateUpdateItem = void 0;
4
- function validateUpdateItem(allValidateUpdateItemFieldArray, updateItemObj) {
5
- try {
6
- const validatedUpdateItem = {};
7
- if (Array.isArray(allValidateUpdateItemFieldArray) &&
8
- allValidateUpdateItemFieldArray.length) {
9
- for (const fieldName in updateItemObj) {
10
- if (updateItemObj[fieldName] !== undefined &&
11
- allValidateUpdateItemFieldArray.includes(fieldName)) {
12
- validatedUpdateItem[fieldName] = updateItemObj[fieldName];
13
- }
14
- }
15
- }
16
- return validatedUpdateItem;
17
- }
18
- catch (err) {
19
- throw err;
20
- }
21
- }
22
- exports.validateUpdateItem = validateUpdateItem;
23
- //# sourceMappingURL=validateUpdateItem.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validateUpdateItem.js","sourceRoot":"","sources":["../../src/validators/validateUpdateItem.ts"],"names":[],"mappings":";;;AAAA,SAAgB,kBAAkB,CAChC,+BAAyC,EACzC,aAAa;IAEb,IAAI;QACF,MAAM,mBAAmB,GAAG,EAAE,CAAC;QAC/B,IACE,KAAK,CAAC,OAAO,CAAC,+BAA+B,CAAC;YAC9C,+BAA+B,CAAC,MAAM,EACtC;YACA,KAAK,MAAM,SAAS,IAAI,aAAa,EAAE;gBACrC,IACE,aAAa,CAAC,SAAS,CAAC,KAAK,SAAS;oBACtC,+BAA+B,CAAC,QAAQ,CAAC,SAAS,CAAC,EACnD;oBACA,mBAAmB,CAAC,SAAS,CAAC,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC;iBAC3D;aACF;SACF;QAED,OAAO,mBAAmB,CAAC;KAC5B;IAAC,OAAO,GAAG,EAAE;QACZ,MAAM,GAAG,CAAC;KACX;AACH,CAAC;AAxBD,gDAwBC"}