@bestapps/education.events.module 1.0.2

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 (80) hide show
  1. package/.claude/settings.local.json +10 -0
  2. package/.editorconfig +9 -0
  3. package/dist/events/GlobalEdrpouEvent.d.ts +2 -0
  4. package/dist/events/GlobalEdrpouEvent.d.ts.map +1 -0
  5. package/dist/events/GlobalEdrpouEvent.js +5 -0
  6. package/dist/events/GlobalEdrpouEvent.js.map +1 -0
  7. package/dist/events/GlobalPersonEvent.d.ts +2 -0
  8. package/dist/events/GlobalPersonEvent.d.ts.map +1 -0
  9. package/dist/events/GlobalPersonEvent.js +5 -0
  10. package/dist/events/GlobalPersonEvent.js.map +1 -0
  11. package/dist/events/index.d.ts +3 -0
  12. package/dist/events/index.d.ts.map +1 -0
  13. package/dist/events/index.js +8 -0
  14. package/dist/events/index.js.map +1 -0
  15. package/dist/index.d.ts +4 -0
  16. package/dist/index.d.ts.map +1 -0
  17. package/dist/index.js +20 -0
  18. package/dist/index.js.map +1 -0
  19. package/dist/interfaces/ICategory.d.ts +6 -0
  20. package/dist/interfaces/ICategory.d.ts.map +1 -0
  21. package/dist/interfaces/ICategory.js +3 -0
  22. package/dist/interfaces/ICategory.js.map +1 -0
  23. package/dist/interfaces/IGlobalEdrpouEventPayload.d.ts +12 -0
  24. package/dist/interfaces/IGlobalEdrpouEventPayload.d.ts.map +1 -0
  25. package/dist/interfaces/IGlobalEdrpouEventPayload.js +3 -0
  26. package/dist/interfaces/IGlobalEdrpouEventPayload.js.map +1 -0
  27. package/dist/interfaces/IGlobalPersonEventPayload.d.ts +10 -0
  28. package/dist/interfaces/IGlobalPersonEventPayload.d.ts.map +1 -0
  29. package/dist/interfaces/IGlobalPersonEventPayload.js +3 -0
  30. package/dist/interfaces/IGlobalPersonEventPayload.js.map +1 -0
  31. package/dist/interfaces/IPerson.d.ts +7 -0
  32. package/dist/interfaces/IPerson.d.ts.map +1 -0
  33. package/dist/interfaces/IPerson.js +3 -0
  34. package/dist/interfaces/IPerson.js.map +1 -0
  35. package/dist/interfaces/IProperty.d.ts +6 -0
  36. package/dist/interfaces/IProperty.d.ts.map +1 -0
  37. package/dist/interfaces/IProperty.js +3 -0
  38. package/dist/interfaces/IProperty.js.map +1 -0
  39. package/dist/interfaces/index.d.ts +6 -0
  40. package/dist/interfaces/index.d.ts.map +1 -0
  41. package/dist/interfaces/index.js +3 -0
  42. package/dist/interfaces/index.js.map +1 -0
  43. package/dist/modules/GlobalEdrpouEmitterMixin.d.ts +4 -0
  44. package/dist/modules/GlobalEdrpouEmitterMixin.d.ts.map +1 -0
  45. package/dist/modules/GlobalEdrpouEmitterMixin.js +23 -0
  46. package/dist/modules/GlobalEdrpouEmitterMixin.js.map +1 -0
  47. package/dist/modules/GlobalEdrpouReceiverMixin.d.ts +4 -0
  48. package/dist/modules/GlobalEdrpouReceiverMixin.d.ts.map +1 -0
  49. package/dist/modules/GlobalEdrpouReceiverMixin.js +32 -0
  50. package/dist/modules/GlobalEdrpouReceiverMixin.js.map +1 -0
  51. package/dist/modules/GlobalPersonEmitterMixin.d.ts +4 -0
  52. package/dist/modules/GlobalPersonEmitterMixin.d.ts.map +1 -0
  53. package/dist/modules/GlobalPersonEmitterMixin.js +23 -0
  54. package/dist/modules/GlobalPersonEmitterMixin.js.map +1 -0
  55. package/dist/modules/GlobalPersonReceiverMixin.d.ts +4 -0
  56. package/dist/modules/GlobalPersonReceiverMixin.d.ts.map +1 -0
  57. package/dist/modules/GlobalPersonReceiverMixin.js +32 -0
  58. package/dist/modules/GlobalPersonReceiverMixin.js.map +1 -0
  59. package/dist/modules/index.d.ts +5 -0
  60. package/dist/modules/index.d.ts.map +1 -0
  61. package/dist/modules/index.js +15 -0
  62. package/dist/modules/index.js.map +1 -0
  63. package/package.json +23 -0
  64. package/push.sh +23 -0
  65. package/src/events/GlobalEdrpouEvent.ts +1 -0
  66. package/src/events/GlobalPersonEvent.ts +1 -0
  67. package/src/events/index.ts +2 -0
  68. package/src/index.ts +3 -0
  69. package/src/interfaces/ICategory.ts +5 -0
  70. package/src/interfaces/IGlobalEdrpouEventPayload.ts +10 -0
  71. package/src/interfaces/IGlobalPersonEventPayload.ts +10 -0
  72. package/src/interfaces/IPerson.ts +6 -0
  73. package/src/interfaces/IProperty.ts +5 -0
  74. package/src/interfaces/index.ts +5 -0
  75. package/src/modules/GlobalEdrpouEmitterMixin.ts +13 -0
  76. package/src/modules/GlobalEdrpouReceiverMixin.ts +22 -0
  77. package/src/modules/GlobalPersonEmitterMixin.ts +13 -0
  78. package/src/modules/GlobalPersonReceiverMixin.ts +22 -0
  79. package/src/modules/index.ts +4 -0
  80. package/tsconfig.json +17 -0
@@ -0,0 +1,10 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(tree:*)",
5
+ "Bash(ls \"E:\\\\projects\\\\osvita.isuo\\\\src\\\\console\\\\commands\"\" | grep -i \"emit|queue \")",
6
+ "Bash(npm install)",
7
+ "Bash(npm run build:*)"
8
+ ]
9
+ }
10
+ }
package/.editorconfig ADDED
@@ -0,0 +1,9 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ indent_style = space
6
+ indent_size = 4
7
+ end_of_line = lf
8
+ insert_final_newline = true
9
+ trim_trailing_whitespace = true
@@ -0,0 +1,2 @@
1
+ export declare const GLOBAL_EDRPOU = "GLOBAL_EDRPOU";
2
+ //# sourceMappingURL=GlobalEdrpouEvent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GlobalEdrpouEvent.d.ts","sourceRoot":"","sources":["../../src/events/GlobalEdrpouEvent.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,kBAAkB,CAAC"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GLOBAL_EDRPOU = void 0;
4
+ exports.GLOBAL_EDRPOU = 'GLOBAL_EDRPOU';
5
+ //# sourceMappingURL=GlobalEdrpouEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GlobalEdrpouEvent.js","sourceRoot":"","sources":["../../src/events/GlobalEdrpouEvent.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG,eAAe,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const GLOBAL_PERSON = "GLOBAL_PERSON";
2
+ //# sourceMappingURL=GlobalPersonEvent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GlobalPersonEvent.d.ts","sourceRoot":"","sources":["../../src/events/GlobalPersonEvent.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,kBAAkB,CAAC"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GLOBAL_PERSON = void 0;
4
+ exports.GLOBAL_PERSON = 'GLOBAL_PERSON';
5
+ //# sourceMappingURL=GlobalPersonEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GlobalPersonEvent.js","sourceRoot":"","sources":["../../src/events/GlobalPersonEvent.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG,eAAe,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { GLOBAL_EDRPOU } from './GlobalEdrpouEvent';
2
+ export { GLOBAL_PERSON } from './GlobalPersonEvent';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GLOBAL_PERSON = exports.GLOBAL_EDRPOU = void 0;
4
+ var GlobalEdrpouEvent_1 = require("./GlobalEdrpouEvent");
5
+ Object.defineProperty(exports, "GLOBAL_EDRPOU", { enumerable: true, get: function () { return GlobalEdrpouEvent_1.GLOBAL_EDRPOU; } });
6
+ var GlobalPersonEvent_1 = require("./GlobalPersonEvent");
7
+ Object.defineProperty(exports, "GLOBAL_PERSON", { enumerable: true, get: function () { return GlobalPersonEvent_1.GLOBAL_PERSON; } });
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":";;;AAAA,yDAAoD;AAA3C,kHAAA,aAAa,OAAA;AACtB,yDAAoD;AAA3C,kHAAA,aAAa,OAAA"}
@@ -0,0 +1,4 @@
1
+ export * from './interfaces';
2
+ export * from './events';
3
+ export * from './modules';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./interfaces"), exports);
18
+ __exportStar(require("./events"), exports);
19
+ __exportStar(require("./modules"), exports);
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,2CAAyB;AACzB,4CAA0B"}
@@ -0,0 +1,6 @@
1
+ export default interface ICategory {
2
+ uid: string;
3
+ name: string;
4
+ slug: string;
5
+ }
6
+ //# sourceMappingURL=ICategory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ICategory.d.ts","sourceRoot":"","sources":["../../src/interfaces/ICategory.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,WAAW,SAAS;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CAChB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ICategory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ICategory.js","sourceRoot":"","sources":["../../src/interfaces/ICategory.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ import ICategory from './ICategory';
2
+ import IProperty from './IProperty';
3
+ export default interface IGlobalEdrpouEventPayload {
4
+ uid: string;
5
+ edrpou: number;
6
+ name: string;
7
+ category: ICategory;
8
+ properties: {
9
+ [key: string]: IProperty;
10
+ };
11
+ }
12
+ //# sourceMappingURL=IGlobalEdrpouEventPayload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IGlobalEdrpouEventPayload.d.ts","sourceRoot":"","sources":["../../src/interfaces/IGlobalEdrpouEventPayload.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,MAAM,CAAC,OAAO,WAAW,yBAAyB;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,SAAS,CAAC;IACpB,UAAU,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC;CAC5C"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IGlobalEdrpouEventPayload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IGlobalEdrpouEventPayload.js","sourceRoot":"","sources":["../../src/interfaces/IGlobalEdrpouEventPayload.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import ICategory from './ICategory';
2
+ import IPerson from './IPerson';
3
+ export default interface IGlobalPersonEventPayload {
4
+ organizationUid: string;
5
+ organizationName: string;
6
+ propertyType: string;
7
+ person: IPerson;
8
+ category: ICategory | null;
9
+ }
10
+ //# sourceMappingURL=IGlobalPersonEventPayload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IGlobalPersonEventPayload.d.ts","sourceRoot":"","sources":["../../src/interfaces/IGlobalPersonEventPayload.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,OAAO,MAAM,WAAW,CAAC;AAEhC,MAAM,CAAC,OAAO,WAAW,yBAAyB;IAC9C,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,SAAS,GAAG,IAAI,CAAC;CAC9B"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IGlobalPersonEventPayload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IGlobalPersonEventPayload.js","sourceRoot":"","sources":["../../src/interfaces/IGlobalPersonEventPayload.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ export default interface IPerson {
2
+ first: string;
3
+ middle: string;
4
+ last: string;
5
+ fullName: string;
6
+ }
7
+ //# sourceMappingURL=IPerson.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IPerson.d.ts","sourceRoot":"","sources":["../../src/interfaces/IPerson.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,WAAW,OAAO;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IPerson.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IPerson.js","sourceRoot":"","sources":["../../src/interfaces/IPerson.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ export default interface IProperty {
2
+ type: string;
3
+ value: any;
4
+ version: string;
5
+ }
6
+ //# sourceMappingURL=IProperty.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IProperty.d.ts","sourceRoot":"","sources":["../../src/interfaces/IProperty.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,WAAW,SAAS;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,GAAG,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IProperty.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IProperty.js","sourceRoot":"","sources":["../../src/interfaces/IProperty.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ export { default as ICategory } from './ICategory';
2
+ export { default as IProperty } from './IProperty';
3
+ export { default as IPerson } from './IPerson';
4
+ export { default as IGlobalEdrpouEventPayload } from './IGlobalEdrpouEventPayload';
5
+ export { default as IGlobalPersonEventPayload } from './IGlobalPersonEventPayload';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACnF,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import { ServiceSchema } from 'moleculer';
2
+ declare const GlobalEdrpouEmitterMixin: Partial<ServiceSchema>;
3
+ export default GlobalEdrpouEmitterMixin;
4
+ //# sourceMappingURL=GlobalEdrpouEmitterMixin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GlobalEdrpouEmitterMixin.d.ts","sourceRoot":"","sources":["../../src/modules/GlobalEdrpouEmitterMixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAI1C,QAAA,MAAM,wBAAwB,EAAE,OAAO,CAAC,aAAa,CAMpD,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const GlobalEdrpouEvent_1 = require("../events/GlobalEdrpouEvent");
13
+ const GlobalEdrpouEmitterMixin = {
14
+ methods: {
15
+ emitGlobalEdrpou(payload) {
16
+ return __awaiter(this, void 0, void 0, function* () {
17
+ yield this.broker.emit(GlobalEdrpouEvent_1.GLOBAL_EDRPOU, payload);
18
+ });
19
+ },
20
+ },
21
+ };
22
+ exports.default = GlobalEdrpouEmitterMixin;
23
+ //# sourceMappingURL=GlobalEdrpouEmitterMixin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GlobalEdrpouEmitterMixin.js","sourceRoot":"","sources":["../../src/modules/GlobalEdrpouEmitterMixin.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,mEAA4D;AAG5D,MAAM,wBAAwB,GAA2B;IACrD,OAAO,EAAE;QACC,gBAAgB,CAAC,OAAkC;;gBACrD,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,iCAAa,EAAE,OAAO,CAAC,CAAC;YACnD,CAAC;SAAA;KACJ;CACJ,CAAC;AAEF,kBAAe,wBAAwB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { ServiceSchema } from 'moleculer';
2
+ declare const GlobalEdrpouReceiverMixin: Partial<ServiceSchema>;
3
+ export default GlobalEdrpouReceiverMixin;
4
+ //# sourceMappingURL=GlobalEdrpouReceiverMixin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GlobalEdrpouReceiverMixin.d.ts","sourceRoot":"","sources":["../../src/modules/GlobalEdrpouReceiverMixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,aAAa,EAAE,MAAM,WAAW,CAAC;AAInD,QAAA,MAAM,yBAAyB,EAAE,OAAO,CAAC,aAAa,CAerD,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const GlobalEdrpouEvent_1 = require("../events/GlobalEdrpouEvent");
13
+ const GlobalEdrpouReceiverMixin = {
14
+ events: {
15
+ [GlobalEdrpouEvent_1.GLOBAL_EDRPOU]: {
16
+ handler(ctx) {
17
+ return __awaiter(this, void 0, void 0, function* () {
18
+ yield this.onGlobalEdrpou(ctx);
19
+ });
20
+ },
21
+ },
22
+ },
23
+ methods: {
24
+ onGlobalEdrpou(ctx) {
25
+ return __awaiter(this, void 0, void 0, function* () {
26
+ this.logger.warn(`${this.name}: received ${GlobalEdrpouEvent_1.GLOBAL_EDRPOU} event but onGlobalEdrpou() is not overridden.`);
27
+ });
28
+ },
29
+ },
30
+ };
31
+ exports.default = GlobalEdrpouReceiverMixin;
32
+ //# sourceMappingURL=GlobalEdrpouReceiverMixin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GlobalEdrpouReceiverMixin.js","sourceRoot":"","sources":["../../src/modules/GlobalEdrpouReceiverMixin.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,mEAA4D;AAG5D,MAAM,yBAAyB,GAA2B;IACtD,MAAM,EAAE;QACJ,CAAC,iCAAa,CAAC,EAAE;YACP,OAAO,CAAC,GAAuC;;oBACjD,MAAO,IAAY,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;gBAC5C,CAAC;aAAA;SACJ;KACJ;IACD,OAAO,EAAE;QACC,cAAc,CAAC,GAAuC;;gBACxD,IAAI,CAAC,MAAM,CAAC,IAAI,CACZ,GAAG,IAAI,CAAC,IAAI,cAAc,iCAAa,gDAAgD,CAC1F,CAAC;YACN,CAAC;SAAA;KACJ;CACJ,CAAC;AAEF,kBAAe,yBAAyB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { ServiceSchema } from 'moleculer';
2
+ declare const GlobalPersonEmitterMixin: Partial<ServiceSchema>;
3
+ export default GlobalPersonEmitterMixin;
4
+ //# sourceMappingURL=GlobalPersonEmitterMixin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GlobalPersonEmitterMixin.d.ts","sourceRoot":"","sources":["../../src/modules/GlobalPersonEmitterMixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAI1C,QAAA,MAAM,wBAAwB,EAAE,OAAO,CAAC,aAAa,CAMpD,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const GlobalPersonEvent_1 = require("../events/GlobalPersonEvent");
13
+ const GlobalPersonEmitterMixin = {
14
+ methods: {
15
+ emitGlobalPerson(payload) {
16
+ return __awaiter(this, void 0, void 0, function* () {
17
+ yield this.broker.emit(GlobalPersonEvent_1.GLOBAL_PERSON, payload);
18
+ });
19
+ },
20
+ },
21
+ };
22
+ exports.default = GlobalPersonEmitterMixin;
23
+ //# sourceMappingURL=GlobalPersonEmitterMixin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GlobalPersonEmitterMixin.js","sourceRoot":"","sources":["../../src/modules/GlobalPersonEmitterMixin.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,mEAA4D;AAG5D,MAAM,wBAAwB,GAA2B;IACrD,OAAO,EAAE;QACC,gBAAgB,CAAC,OAAkC;;gBACrD,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,iCAAa,EAAE,OAAO,CAAC,CAAC;YACnD,CAAC;SAAA;KACJ;CACJ,CAAC;AAEF,kBAAe,wBAAwB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { ServiceSchema } from 'moleculer';
2
+ declare const GlobalPersonReceiverMixin: Partial<ServiceSchema>;
3
+ export default GlobalPersonReceiverMixin;
4
+ //# sourceMappingURL=GlobalPersonReceiverMixin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GlobalPersonReceiverMixin.d.ts","sourceRoot":"","sources":["../../src/modules/GlobalPersonReceiverMixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,aAAa,EAAE,MAAM,WAAW,CAAC;AAInD,QAAA,MAAM,yBAAyB,EAAE,OAAO,CAAC,aAAa,CAerD,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const GlobalPersonEvent_1 = require("../events/GlobalPersonEvent");
13
+ const GlobalPersonReceiverMixin = {
14
+ events: {
15
+ [GlobalPersonEvent_1.GLOBAL_PERSON]: {
16
+ handler(ctx) {
17
+ return __awaiter(this, void 0, void 0, function* () {
18
+ yield this.onGlobalPerson(ctx);
19
+ });
20
+ },
21
+ },
22
+ },
23
+ methods: {
24
+ onGlobalPerson(ctx) {
25
+ return __awaiter(this, void 0, void 0, function* () {
26
+ this.logger.warn(`${this.name}: received ${GlobalPersonEvent_1.GLOBAL_PERSON} event but onGlobalPerson() is not overridden.`);
27
+ });
28
+ },
29
+ },
30
+ };
31
+ exports.default = GlobalPersonReceiverMixin;
32
+ //# sourceMappingURL=GlobalPersonReceiverMixin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GlobalPersonReceiverMixin.js","sourceRoot":"","sources":["../../src/modules/GlobalPersonReceiverMixin.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,mEAA4D;AAG5D,MAAM,yBAAyB,GAA2B;IACtD,MAAM,EAAE;QACJ,CAAC,iCAAa,CAAC,EAAE;YACP,OAAO,CAAC,GAAuC;;oBACjD,MAAO,IAAY,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;gBAC5C,CAAC;aAAA;SACJ;KACJ;IACD,OAAO,EAAE;QACC,cAAc,CAAC,GAAuC;;gBACxD,IAAI,CAAC,MAAM,CAAC,IAAI,CACZ,GAAG,IAAI,CAAC,IAAI,cAAc,iCAAa,gDAAgD,CAC1F,CAAC;YACN,CAAC;SAAA;KACJ;CACJ,CAAC;AAEF,kBAAe,yBAAyB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { default as GlobalEdrpouEmitterMixin } from './GlobalEdrpouEmitterMixin';
2
+ export { default as GlobalEdrpouReceiverMixin } from './GlobalEdrpouReceiverMixin';
3
+ export { default as GlobalPersonEmitterMixin } from './GlobalPersonEmitterMixin';
4
+ export { default as GlobalPersonReceiverMixin } from './GlobalPersonReceiverMixin';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/modules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACnF,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.GlobalPersonReceiverMixin = exports.GlobalPersonEmitterMixin = exports.GlobalEdrpouReceiverMixin = exports.GlobalEdrpouEmitterMixin = void 0;
7
+ var GlobalEdrpouEmitterMixin_1 = require("./GlobalEdrpouEmitterMixin");
8
+ Object.defineProperty(exports, "GlobalEdrpouEmitterMixin", { enumerable: true, get: function () { return __importDefault(GlobalEdrpouEmitterMixin_1).default; } });
9
+ var GlobalEdrpouReceiverMixin_1 = require("./GlobalEdrpouReceiverMixin");
10
+ Object.defineProperty(exports, "GlobalEdrpouReceiverMixin", { enumerable: true, get: function () { return __importDefault(GlobalEdrpouReceiverMixin_1).default; } });
11
+ var GlobalPersonEmitterMixin_1 = require("./GlobalPersonEmitterMixin");
12
+ Object.defineProperty(exports, "GlobalPersonEmitterMixin", { enumerable: true, get: function () { return __importDefault(GlobalPersonEmitterMixin_1).default; } });
13
+ var GlobalPersonReceiverMixin_1 = require("./GlobalPersonReceiverMixin");
14
+ Object.defineProperty(exports, "GlobalPersonReceiverMixin", { enumerable: true, get: function () { return __importDefault(GlobalPersonReceiverMixin_1).default; } });
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/modules/index.ts"],"names":[],"mappings":";;;;;;AAAA,uEAAiF;AAAxE,qJAAA,OAAO,OAA4B;AAC5C,yEAAmF;AAA1E,uJAAA,OAAO,OAA6B;AAC7C,uEAAiF;AAAxE,qJAAA,OAAO,OAA4B;AAC5C,yEAAmF;AAA1E,uJAAA,OAAO,OAA6B"}
package/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "@bestapps/education.events.module",
3
+ "homepage": "https://github.com/bestapps-ua/education.events.module",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "git+https://github.com/bestapps-ua/education.events.module.git"
7
+ },
8
+ "license": "ISC",
9
+ "bugs": {
10
+ "url": "https://github.com/bestapps-ua/education.events.module/issues"
11
+ },
12
+ "version": "1.0.2",
13
+ "main": "dist/index.js",
14
+ "typings": "dist/index.d.ts",
15
+ "scripts": {
16
+ "build": "tsc",
17
+ "tsc": "tsc"
18
+ },
19
+ "dependencies": {
20
+ "moleculer": "^0.14.21",
21
+ "typescript": "^4.5.4"
22
+ }
23
+ }
package/push.sh ADDED
@@ -0,0 +1,23 @@
1
+ #!/bin/bash
2
+
3
+ # Bump patch version
4
+ CURRENT=$(cat package.json | grep '"version"' | head -1 | awk -F'"' '{print $4}')
5
+ IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT"
6
+ PATCH=$((PATCH + 1))
7
+ NEW_VERSION="$MAJOR.$MINOR.$PATCH"
8
+ sed -i "s/\"version\": \"$CURRENT\"/\"version\": \"$NEW_VERSION\"/" package.json
9
+ echo "Bumped version: $CURRENT -> $NEW_VERSION"
10
+
11
+ VERSION=$(cat package.json \
12
+ | grep version \
13
+ | head -1 \
14
+ | awk -F: '{ print $2 }' \
15
+ | sed 's/[",]//g')
16
+
17
+ npm run build
18
+ git add dist/*
19
+ git commit -m "$VERSION" package.json package-lock.json dist/ src/ push.sh;
20
+ git push origin main;
21
+ git tag $VERSION;
22
+ git push origin $VERSION;
23
+ npm publish --access=public
@@ -0,0 +1 @@
1
+ export const GLOBAL_EDRPOU = 'GLOBAL_EDRPOU';
@@ -0,0 +1 @@
1
+ export const GLOBAL_PERSON = 'GLOBAL_PERSON';
@@ -0,0 +1,2 @@
1
+ export { GLOBAL_EDRPOU } from './GlobalEdrpouEvent';
2
+ export { GLOBAL_PERSON } from './GlobalPersonEvent';
package/src/index.ts ADDED
@@ -0,0 +1,3 @@
1
+ export * from './interfaces';
2
+ export * from './events';
3
+ export * from './modules';
@@ -0,0 +1,5 @@
1
+ export default interface ICategory {
2
+ uid: string;
3
+ name: string;
4
+ slug: string;
5
+ }
@@ -0,0 +1,10 @@
1
+ import ICategory from './ICategory';
2
+ import IProperty from './IProperty';
3
+
4
+ export default interface IGlobalEdrpouEventPayload {
5
+ uid: string;
6
+ edrpou: number;
7
+ name: string;
8
+ category: ICategory;
9
+ properties: { [key: string]: IProperty };
10
+ }
@@ -0,0 +1,10 @@
1
+ import ICategory from './ICategory';
2
+ import IPerson from './IPerson';
3
+
4
+ export default interface IGlobalPersonEventPayload {
5
+ organizationUid: string;
6
+ organizationName: string;
7
+ propertyType: string;
8
+ person: IPerson;
9
+ category: ICategory | null;
10
+ }
@@ -0,0 +1,6 @@
1
+ export default interface IPerson {
2
+ first: string;
3
+ middle: string;
4
+ last: string;
5
+ fullName: string;
6
+ }
@@ -0,0 +1,5 @@
1
+ export default interface IProperty {
2
+ type: string;
3
+ value: any;
4
+ version: string;
5
+ }
@@ -0,0 +1,5 @@
1
+ export { default as ICategory } from './ICategory';
2
+ export { default as IProperty } from './IProperty';
3
+ export { default as IPerson } from './IPerson';
4
+ export { default as IGlobalEdrpouEventPayload } from './IGlobalEdrpouEventPayload';
5
+ export { default as IGlobalPersonEventPayload } from './IGlobalPersonEventPayload';
@@ -0,0 +1,13 @@
1
+ import { ServiceSchema } from 'moleculer';
2
+ import { GLOBAL_EDRPOU } from '../events/GlobalEdrpouEvent';
3
+ import IGlobalEdrpouEventPayload from '../interfaces/IGlobalEdrpouEventPayload';
4
+
5
+ const GlobalEdrpouEmitterMixin: Partial<ServiceSchema> = {
6
+ methods: {
7
+ async emitGlobalEdrpou(payload: IGlobalEdrpouEventPayload): Promise<void> {
8
+ await this.broker.emit(GLOBAL_EDRPOU, payload);
9
+ },
10
+ },
11
+ };
12
+
13
+ export default GlobalEdrpouEmitterMixin;
@@ -0,0 +1,22 @@
1
+ import { Context, ServiceSchema } from 'moleculer';
2
+ import { GLOBAL_EDRPOU } from '../events/GlobalEdrpouEvent';
3
+ import IGlobalEdrpouEventPayload from '../interfaces/IGlobalEdrpouEventPayload';
4
+
5
+ const GlobalEdrpouReceiverMixin: Partial<ServiceSchema> = {
6
+ events: {
7
+ [GLOBAL_EDRPOU]: {
8
+ async handler(ctx: Context<IGlobalEdrpouEventPayload>): Promise<void> {
9
+ await (this as any).onGlobalEdrpou(ctx);
10
+ },
11
+ },
12
+ },
13
+ methods: {
14
+ async onGlobalEdrpou(ctx: Context<IGlobalEdrpouEventPayload>): Promise<void> {
15
+ this.logger.warn(
16
+ `${this.name}: received ${GLOBAL_EDRPOU} event but onGlobalEdrpou() is not overridden.`
17
+ );
18
+ },
19
+ },
20
+ };
21
+
22
+ export default GlobalEdrpouReceiverMixin;
@@ -0,0 +1,13 @@
1
+ import { ServiceSchema } from 'moleculer';
2
+ import { GLOBAL_PERSON } from '../events/GlobalPersonEvent';
3
+ import IGlobalPersonEventPayload from '../interfaces/IGlobalPersonEventPayload';
4
+
5
+ const GlobalPersonEmitterMixin: Partial<ServiceSchema> = {
6
+ methods: {
7
+ async emitGlobalPerson(payload: IGlobalPersonEventPayload): Promise<void> {
8
+ await this.broker.emit(GLOBAL_PERSON, payload);
9
+ },
10
+ },
11
+ };
12
+
13
+ export default GlobalPersonEmitterMixin;
@@ -0,0 +1,22 @@
1
+ import { Context, ServiceSchema } from 'moleculer';
2
+ import { GLOBAL_PERSON } from '../events/GlobalPersonEvent';
3
+ import IGlobalPersonEventPayload from '../interfaces/IGlobalPersonEventPayload';
4
+
5
+ const GlobalPersonReceiverMixin: Partial<ServiceSchema> = {
6
+ events: {
7
+ [GLOBAL_PERSON]: {
8
+ async handler(ctx: Context<IGlobalPersonEventPayload>): Promise<void> {
9
+ await (this as any).onGlobalPerson(ctx);
10
+ },
11
+ },
12
+ },
13
+ methods: {
14
+ async onGlobalPerson(ctx: Context<IGlobalPersonEventPayload>): Promise<void> {
15
+ this.logger.warn(
16
+ `${this.name}: received ${GLOBAL_PERSON} event but onGlobalPerson() is not overridden.`
17
+ );
18
+ },
19
+ },
20
+ };
21
+
22
+ export default GlobalPersonReceiverMixin;
@@ -0,0 +1,4 @@
1
+ export { default as GlobalEdrpouEmitterMixin } from './GlobalEdrpouEmitterMixin';
2
+ export { default as GlobalEdrpouReceiverMixin } from './GlobalEdrpouReceiverMixin';
3
+ export { default as GlobalPersonEmitterMixin } from './GlobalPersonEmitterMixin';
4
+ export { default as GlobalPersonReceiverMixin } from './GlobalPersonReceiverMixin';
package/tsconfig.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES6",
4
+ "module": "CommonJS",
5
+ "declaration": true,
6
+ "declarationMap": true,
7
+ "sourceMap": true,
8
+ "outDir": "dist",
9
+ "strict": true,
10
+ "esModuleInterop": true,
11
+ "skipLibCheck": true,
12
+ "forceConsistentCasingInFileNames": true
13
+ },
14
+ "include": [
15
+ "src/**/*"
16
+ ]
17
+ }