@social.dev/server-sdk 0.0.1-alpha.25 → 0.0.1-alpha.27

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 (40) hide show
  1. package/dist/chat/chat.module.js +2 -2
  2. package/dist/chat/chat.module.js.map +1 -1
  3. package/dist/chat/chat.service.d.ts +2 -2
  4. package/dist/chat/chat.service.js +2 -2
  5. package/dist/chat/chat.service.js.map +1 -1
  6. package/dist/community/community.module.js +1 -0
  7. package/dist/community/community.module.js.map +1 -1
  8. package/dist/core/hook/hook.module.d.ts +4 -0
  9. package/dist/core/hook/hook.module.js +30 -0
  10. package/dist/core/hook/hook.module.js.map +1 -0
  11. package/dist/core/hook/hook.service.d.ts +7 -0
  12. package/dist/core/hook/hook.service.js +43 -0
  13. package/dist/core/hook/hook.service.js.map +1 -0
  14. package/dist/core/hook/plugin-hook.service.d.ts +7 -0
  15. package/dist/core/hook/plugin-hook.service.js +43 -0
  16. package/dist/core/hook/plugin-hook.service.js.map +1 -0
  17. package/dist/core/hook/plugin.module.d.ts +4 -0
  18. package/dist/core/hook/plugin.module.js +36 -0
  19. package/dist/core/hook/plugin.module.js.map +1 -0
  20. package/dist/core/plugin/plugin.module.js +5 -6
  21. package/dist/core/plugin/plugin.module.js.map +1 -1
  22. package/dist/index.d.ts +0 -1
  23. package/dist/index.js +1 -3
  24. package/dist/index.js.map +1 -1
  25. package/dist/notification/hook-listener.service.d.ts +13 -0
  26. package/dist/notification/hook-listener.service.js +58 -0
  27. package/dist/notification/hook-listener.service.js.map +1 -0
  28. package/dist/notification/notification.module.js +11 -2
  29. package/dist/notification/notification.module.js.map +1 -1
  30. package/dist/notification/push-notification.controller.d.ts +1 -1
  31. package/dist/notification/push-notification.service.d.ts +14 -2
  32. package/dist/notification/push-notification.service.js +37 -3
  33. package/dist/notification/push-notification.service.js.map +1 -1
  34. package/dist/post/post.module.js +2 -0
  35. package/dist/post/post.module.js.map +1 -1
  36. package/dist/post/post.service.d.ts +3 -1
  37. package/dist/post/post.service.js +10 -4
  38. package/dist/post/post.service.js.map +1 -1
  39. package/dist/tsconfig.build.tsbuildinfo +1 -1
  40. package/package.json +1 -1
@@ -14,7 +14,7 @@ const typeorm_1 = require("@nestjs/typeorm");
14
14
  const conversation_entity_1 = require("./entities/conversation.entity");
15
15
  const message_entity_1 = require("./entities/message.entity");
16
16
  const conversation_member_entity_1 = require("./entities/conversation-member.entity");
17
- const plugin_module_1 = require("../core/plugin/plugin.module");
17
+ const hook_module_1 = require("../core/hook/hook.module");
18
18
  let ChatModule = class ChatModule {
19
19
  };
20
20
  exports.ChatModule = ChatModule;
@@ -26,7 +26,7 @@ exports.ChatModule = ChatModule = __decorate([
26
26
  conversation_member_entity_1.ChatConversationMember,
27
27
  message_entity_1.ChatMessage,
28
28
  ]),
29
- plugin_module_1.PluginModule,
29
+ hook_module_1.HookModule,
30
30
  ],
31
31
  controllers: [chat_controller_1.ChatController],
32
32
  providers: [chat_service_1.ChatService],
@@ -1 +1 @@
1
- {"version":3,"file":"chat.module.js","sourceRoot":"","sources":["../../src/chat/chat.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,uDAAmD;AACnD,iDAA6C;AAC7C,6CAAgD;AAChD,wEAAkE;AAClE,8DAAwD;AACxD,sFAA+E;AAC/E,gEAA2D;AAepD,IAAM,UAAU,GAAhB,MAAM,UAAU;CAAG,CAAA;AAAb,gCAAU;qBAAV,UAAU;IAbtB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,UAAU,CAAC;gBACvB,sCAAgB;gBAChB,mDAAsB;gBACtB,4BAAW;aACZ,CAAC;YACF,4BAAY;SACb;QACD,WAAW,EAAE,CAAC,gCAAc,CAAC;QAC7B,SAAS,EAAE,CAAC,0BAAW,CAAC;QACxB,OAAO,EAAE,CAAC,0BAAW,CAAC;KACvB,CAAC;GACW,UAAU,CAAG"}
1
+ {"version":3,"file":"chat.module.js","sourceRoot":"","sources":["../../src/chat/chat.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,uDAAmD;AACnD,iDAA6C;AAC7C,6CAAgD;AAChD,wEAAkE;AAClE,8DAAwD;AACxD,sFAA+E;AAE/E,0DAAqD;AAe9C,IAAM,UAAU,GAAhB,MAAM,UAAU;CAAG,CAAA;AAAb,gCAAU;qBAAV,UAAU;IAbtB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,UAAU,CAAC;gBACvB,sCAAgB;gBAChB,mDAAsB;gBACtB,4BAAW;aACZ,CAAC;YACF,wBAAU;SACX;QACD,WAAW,EAAE,CAAC,gCAAc,CAAC;QAC7B,SAAS,EAAE,CAAC,0BAAW,CAAC;QACxB,OAAO,EAAE,CAAC,0BAAW,CAAC;KACvB,CAAC;GACW,UAAU,CAAG"}
@@ -3,14 +3,14 @@ import { DataSource, Repository } from 'typeorm';
3
3
  import { ChatMessage } from './entities/message.entity';
4
4
  import { CreateConversationDto } from './dto/create-conversation.dto';
5
5
  import { ChatConversationMember } from './entities/conversation-member.entity';
6
- import { PluginHookService } from '~/core/plugin/plugin-hook.service';
6
+ import { HookService } from '~/core/hook/hook.service';
7
7
  export declare class ChatService {
8
8
  private conversationRepositoy;
9
9
  private memberRepositoy;
10
10
  private messageRepositoy;
11
11
  private dataSource;
12
12
  private hookService;
13
- constructor(conversationRepositoy: Repository<ChatConversation>, memberRepositoy: Repository<ChatConversationMember>, messageRepositoy: Repository<ChatMessage>, dataSource: DataSource, hookService: PluginHookService);
13
+ constructor(conversationRepositoy: Repository<ChatConversation>, memberRepositoy: Repository<ChatConversationMember>, messageRepositoy: Repository<ChatMessage>, dataSource: DataSource, hookService: HookService);
14
14
  createConversation(dto: CreateConversationDto): Promise<ChatConversation>;
15
15
  getConversation(id: number): Promise<ChatConversation | null>;
16
16
  listConversations({ limit, offset, }: {
@@ -21,7 +21,7 @@ const message_entity_1 = require("./entities/message.entity");
21
21
  const conversation_member_entity_1 = require("./entities/conversation-member.entity");
22
22
  const context_1 = require("../core/context/context");
23
23
  const user_entity_1 = require("../user/entities/user.entity");
24
- const plugin_hook_service_1 = require("../core/plugin/plugin-hook.service");
24
+ const hook_service_1 = require("../core/hook/hook.service");
25
25
  let ChatService = class ChatService {
26
26
  conversationRepositoy;
27
27
  memberRepositoy;
@@ -108,6 +108,6 @@ exports.ChatService = ChatService = __decorate([
108
108
  typeorm_2.Repository,
109
109
  typeorm_2.Repository,
110
110
  typeorm_2.DataSource,
111
- plugin_hook_service_1.PluginHookService])
111
+ hook_service_1.HookService])
112
112
  ], ChatService);
113
113
  //# sourceMappingURL=chat.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chat.service.js","sourceRoot":"","sources":["../../src/chat/chat.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAAmD;AACnD,wEAAkE;AAClE,qCAAiD;AACjD,8DAAwD;AAGxD,sFAA+E;AAC/E,qDAAiD;AACjD,8DAAmD;AACnD,4EAAsE;AAG/D,IAAM,WAAW,GAAjB,MAAM,WAAW;IAGZ;IAEA;IAEA;IACA;IACA;IARV,YAEU,qBAAmD,EAEnD,eAAmD,EAEnD,gBAAyC,EACzC,UAAsB,EACtB,WAA8B;QAN9B,0BAAqB,GAArB,qBAAqB,CAA8B;QAEnD,oBAAe,GAAf,eAAe,CAAoC;QAEnD,qBAAgB,GAAhB,gBAAgB,CAAyB;QACzC,eAAU,GAAV,UAAU,CAAY;QACtB,gBAAW,GAAX,WAAW,CAAmB;IACrC,CAAC;IAKJ,KAAK,CAAC,kBAAkB,CACtB,GAA0B;QAE1B,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,WAAW,CACtC,cAAc,EACd,KAAK,EAAE,OAAO,EAAE,EAAE;YAEhB,IAAI,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,sCAAgB,EAAE,EAAE,CAAC,CAAC;YACxD,YAAY,GAAG,MAAM,OAAO,CA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;aACA,SAAS,CACR,CAAC,QAAoD,EAAE,EAAE,CACvD,QAAQ;aACL,MAAM,CAAC,gDAAgD,CAAC;aACxD,IAAI,CAAC,mDAAsB,EAAE,YAAY,CAAC;aAC1C,SAAS,CAAC,kBAAI,EAAE,MAAM,EAAE,6BAA6B,CAAC;aACtD,KAAK,CAAC,kCAAkC,CAAC;aACzC,QAAQ,CAAC,8BAA8B,EAAE;YACxC,MAAM,EAAE,iBAAO,CAAC,OAAO,EAAE,EAAE,EAAE;SAC9B,CAAC;aACD,KAAK,CAAC,CAAC,CAAC,EACb,QAAQ,CACT,CACJ,CAAC;IACJ,CAAC;CACF,CAAA;AAtJY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,sCAAgB,CAAC,CAAA;IAElC,WAAA,IAAA,0BAAgB,EAAC,mDAAsB,CAAC,CAAA;IAExC,WAAA,IAAA,0BAAgB,EAAC,4BAAW,CAAC,CAAA;qCAHC,oBAAU;QAEhB,oBAAU;QAET,oBAAU;QAChB,oBAAU;QACT,0BAAW;GATvB,WAAW,CAsJvB"}
@@ -34,6 +34,7 @@ exports.CommunityModule = CommunityModule = __decorate([
34
34
  ],
35
35
  controllers: [community_controller_1.CommunityController],
36
36
  providers: [community_service_1.CommunityService],
37
+ exports: [community_service_1.CommunityService],
37
38
  })
38
39
  ], CommunityModule);
39
40
  //# sourceMappingURL=community.module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"community.module.js","sourceRoot":"","sources":["../../src/community/community.module.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAwC;AACxC,2DAAuD;AACvD,iEAA6D;AAC7D,6CAAgD;AAChD,kEAAwD;AACxD,qDAAgD;AAChD,8DAAmD;AACnD,qDAAgD;AAChD,gFAAqE;AACrE,uDAAkD;AAClD,oEAAgD;AAYzC,IAAM,eAAe,GAArB,MAAM,eAAe;CAAG,CAAA;AAAlB,0CAAe;0BAAf,eAAe;IAV3B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,UAAU,CAAC,CAAC,4BAAS,EAAE,yCAAe,EAAE,kBAAI,CAAC,CAAC;YAC5D,wBAAU;YACV,wBAAU;YACV,sBAAS,CAAC,QAAQ,CAAC,uBAAiB,CAAC;SACtC;QACD,WAAW,EAAE,CAAC,0CAAmB,CAAC;QAClC,SAAS,EAAE,CAAC,oCAAgB,CAAC;KAC9B,CAAC;GACW,eAAe,CAAG"}
1
+ {"version":3,"file":"community.module.js","sourceRoot":"","sources":["../../src/community/community.module.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAwC;AACxC,2DAAuD;AACvD,iEAA6D;AAC7D,6CAAgD;AAChD,kEAAwD;AACxD,qDAAgD;AAChD,8DAAmD;AACnD,qDAAgD;AAChD,gFAAqE;AACrE,uDAAkD;AAClD,oEAAgD;AAazC,IAAM,eAAe,GAArB,MAAM,eAAe;CAAG,CAAA;AAAlB,0CAAe;0BAAf,eAAe;IAX3B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,UAAU,CAAC,CAAC,4BAAS,EAAE,yCAAe,EAAE,kBAAI,CAAC,CAAC;YAC5D,wBAAU;YACV,wBAAU;YACV,sBAAS,CAAC,QAAQ,CAAC,uBAAiB,CAAC;SACtC;QACD,WAAW,EAAE,CAAC,0CAAmB,CAAC;QAClC,SAAS,EAAE,CAAC,oCAAgB,CAAC;QAC7B,OAAO,EAAE,CAAC,oCAAgB,CAAC;KAC5B,CAAC;GACW,eAAe,CAAG"}
@@ -0,0 +1,4 @@
1
+ import { DynamicModule } from '@nestjs/common';
2
+ export declare class HookModule {
3
+ static forRoot(): DynamicModule;
4
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var HookModule_1;
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.HookModule = void 0;
11
+ const common_1 = require("@nestjs/common");
12
+ const hook_service_1 = require("./hook.service");
13
+ let HookModule = HookModule_1 = class HookModule {
14
+ static forRoot() {
15
+ return {
16
+ global: true,
17
+ module: HookModule_1,
18
+ providers: [hook_service_1.HookService],
19
+ exports: [hook_service_1.HookService],
20
+ };
21
+ }
22
+ };
23
+ exports.HookModule = HookModule;
24
+ exports.HookModule = HookModule = HookModule_1 = __decorate([
25
+ (0, common_1.Module)({
26
+ providers: [hook_service_1.HookService],
27
+ exports: [hook_service_1.HookService],
28
+ })
29
+ ], HookModule);
30
+ //# sourceMappingURL=hook.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hook.module.js","sourceRoot":"","sources":["../../../src/core/hook/hook.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAuD;AACvD,iDAA6C;AAMtC,IAAM,UAAU,kBAAhB,MAAM,UAAU;IACrB,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,MAAM,EAAE,IAAI;YACZ,MAAM,EAAE,YAAU;YAClB,SAAS,EAAE,CAAC,0BAAW,CAAC;YACxB,OAAO,EAAE,CAAC,0BAAW,CAAC;SACvB,CAAC;IACJ,CAAC;CACF,CAAA;AATY,gCAAU;qBAAV,UAAU;IAJtB,IAAA,eAAM,EAAC;QACN,SAAS,EAAE,CAAC,0BAAW,CAAC;QACxB,OAAO,EAAE,CAAC,0BAAW,CAAC;KACvB,CAAC;GACW,UAAU,CAStB"}
@@ -0,0 +1,7 @@
1
+ type HookCallback = (data: Object) => any;
2
+ export declare class HookService {
3
+ private static listeners;
4
+ listen(event: string, callback: HookCallback): HookService;
5
+ emit(event: string, data: any): any;
6
+ }
7
+ export {};
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HookService = void 0;
4
+ class HookListener {
5
+ callbacks;
6
+ constructor(callbacks) {
7
+ this.callbacks = callbacks;
8
+ }
9
+ addCallback(callback) {
10
+ this.callbacks.push(callback);
11
+ return this;
12
+ }
13
+ getCallbacks() {
14
+ return this.callbacks;
15
+ }
16
+ }
17
+ class HookService {
18
+ static listeners = new Map();
19
+ listen(event, callback) {
20
+ let listener;
21
+ if (!HookService.listeners.has(event)) {
22
+ listener = new HookListener([]);
23
+ HookService.listeners.set(event, listener);
24
+ }
25
+ else {
26
+ listener = HookService.listeners.get(event);
27
+ }
28
+ listener.addCallback(callback);
29
+ return this;
30
+ }
31
+ emit(event, data) {
32
+ const listener = HookService.listeners.get(event);
33
+ if (!listener) {
34
+ return;
35
+ }
36
+ const callbacks = listener.getCallbacks();
37
+ for (let callback of callbacks) {
38
+ callback(data);
39
+ }
40
+ }
41
+ }
42
+ exports.HookService = HookService;
43
+ //# sourceMappingURL=hook.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hook.service.js","sourceRoot":"","sources":["../../../src/core/hook/hook.service.ts"],"names":[],"mappings":";;;AAEA,MAAM,YAAY;IACI;IAApB,YAAoB,SAAyB;QAAzB,cAAS,GAAT,SAAS,CAAgB;IAAG,CAAC;IAEjD,WAAW,CAAC,QAAsB;QAChC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;CACF;AAED,MAAa,WAAW;IACd,MAAM,CAAC,SAAS,GAA8B,IAAI,GAAG,EAAE,CAAC;IAKhE,MAAM,CAAC,KAAa,EAAE,QAAsB;QAC1C,IAAI,QAAsB,CAAC;QAE3B,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;YACtC,QAAQ,GAAG,IAAI,YAAY,CAAC,EAAE,CAAC,CAAC;YAChC,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAC7C,CAAC;aAAM,CAAC;YACN,QAAQ,GAAG,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAiB,CAAC;QAC9D,CAAC;QAED,QAAQ,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAE/B,OAAO,IAAI,CAAC;IACd,CAAC;IAKD,IAAI,CAAC,KAAa,EAAE,IAAS;QAC3B,MAAM,QAAQ,GAAG,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAElD,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,OAAO;QACT,CAAC;QAED,MAAM,SAAS,GAAG,QAAQ,CAAC,YAAY,EAAE,CAAC;QAE1C,KAAK,IAAI,QAAQ,IAAI,SAAS,EAAE,CAAC;YAC/B,QAAQ,CAAC,IAAI,CAAC,CAAC;QACjB,CAAC;IACH,CAAC;;AApCH,kCAqCC"}
@@ -0,0 +1,7 @@
1
+ type PluginHookCallback = (data: Object) => any;
2
+ export declare class PluginHookService {
3
+ private static listeners;
4
+ listen(event: string, callback: PluginHookCallback): PluginHookService;
5
+ emit(event: string, data: any): any;
6
+ }
7
+ export {};
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PluginHookService = void 0;
4
+ class PluginHookListener {
5
+ callbacks;
6
+ constructor(callbacks) {
7
+ this.callbacks = callbacks;
8
+ }
9
+ addCallback(callback) {
10
+ this.callbacks.push(callback);
11
+ return this;
12
+ }
13
+ getCallbacks() {
14
+ return this.callbacks;
15
+ }
16
+ }
17
+ class PluginHookService {
18
+ static listeners = new Map();
19
+ listen(event, callback) {
20
+ let listener;
21
+ if (!PluginHookService.listeners.has(event)) {
22
+ listener = new PluginHookListener([]);
23
+ PluginHookService.listeners.set(event, listener);
24
+ }
25
+ else {
26
+ listener = PluginHookService.listeners.get(event);
27
+ }
28
+ listener.addCallback(callback);
29
+ return this;
30
+ }
31
+ emit(event, data) {
32
+ const listener = PluginHookService.listeners.get(event);
33
+ if (!listener) {
34
+ return;
35
+ }
36
+ const callbacks = listener.getCallbacks();
37
+ for (let callback of callbacks) {
38
+ callback(data);
39
+ }
40
+ }
41
+ }
42
+ exports.PluginHookService = PluginHookService;
43
+ //# sourceMappingURL=plugin-hook.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-hook.service.js","sourceRoot":"","sources":["../../../src/core/hook/plugin-hook.service.ts"],"names":[],"mappings":";;;AAEA,MAAM,kBAAkB;IACF;IAApB,YAAoB,SAA+B;QAA/B,cAAS,GAAT,SAAS,CAAsB;IAAG,CAAC;IAEvD,WAAW,CAAC,QAA4B;QACtC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;CACF;AAED,MAAa,iBAAiB;IACpB,MAAM,CAAC,SAAS,GAAoC,IAAI,GAAG,EAAE,CAAC;IAKtE,MAAM,CAAC,KAAa,EAAE,QAA4B;QAChD,IAAI,QAA4B,CAAC;QAEjC,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5C,QAAQ,GAAG,IAAI,kBAAkB,CAAC,EAAE,CAAC,CAAC;YACtC,iBAAiB,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QACnD,CAAC;aAAM,CAAC;YACN,QAAQ,GAAG,iBAAiB,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAuB,CAAC;QAC1E,CAAC;QAED,QAAQ,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAE/B,OAAO,IAAI,CAAC;IACd,CAAC;IAKD,IAAI,CAAC,KAAa,EAAE,IAAS;QAC3B,MAAM,QAAQ,GAAG,iBAAiB,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAExD,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,OAAO;QACT,CAAC;QAED,MAAM,SAAS,GAAG,QAAQ,CAAC,YAAY,EAAE,CAAC;QAE1C,KAAK,IAAI,QAAQ,IAAI,SAAS,EAAE,CAAC;YAC/B,QAAQ,CAAC,IAAI,CAAC,CAAC;QACjB,CAAC;IACH,CAAC;;AApCH,8CAqCC"}
@@ -0,0 +1,4 @@
1
+ import { DynamicModule } from '@nestjs/common';
2
+ export declare class PluginModule {
3
+ static forRoot(): DynamicModule;
4
+ }
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __importDefault = (this && this.__importDefault) || function (mod) {
9
+ return (mod && mod.__esModule) ? mod : { "default": mod };
10
+ };
11
+ var PluginModule_1;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.PluginModule = void 0;
14
+ const common_1 = require("@nestjs/common");
15
+ const plugin_factory_1 = __importDefault(require("./plugin.factory"));
16
+ const plugin_hook_service_1 = require("./plugin-hook.service");
17
+ let PluginModule = PluginModule_1 = class PluginModule {
18
+ static forRoot() {
19
+ console.log('Loading plugins', plugin_factory_1.default.plugins);
20
+ return {
21
+ global: true,
22
+ module: PluginModule_1,
23
+ imports: [...plugin_factory_1.default.plugins],
24
+ providers: [plugin_factory_1.default, plugin_hook_service_1.PluginHookService],
25
+ exports: [plugin_factory_1.default, plugin_hook_service_1.PluginHookService],
26
+ };
27
+ }
28
+ };
29
+ exports.PluginModule = PluginModule;
30
+ exports.PluginModule = PluginModule = PluginModule_1 = __decorate([
31
+ (0, common_1.Module)({
32
+ providers: [plugin_hook_service_1.PluginHookService],
33
+ exports: [plugin_hook_service_1.PluginHookService],
34
+ })
35
+ ], PluginModule);
36
+ //# sourceMappingURL=plugin.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.module.js","sourceRoot":"","sources":["../../../src/core/hook/plugin.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAuD;AACvD,sEAA6C;AAC7C,+DAA0D;AAMnD,IAAM,YAAY,oBAAlB,MAAM,YAAY;IACvB,MAAM,CAAC,OAAO;QACZ,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,wBAAa,CAAC,OAAO,CAAC,CAAC;QAEtD,OAAO;YACL,MAAM,EAAE,IAAI;YACZ,MAAM,EAAE,cAAY;YACpB,OAAO,EAAE,CAAC,GAAG,wBAAa,CAAC,OAAO,CAAC;YACnC,SAAS,EAAE,CAAC,wBAAa,EAAE,uCAAiB,CAAC;YAC7C,OAAO,EAAE,CAAC,wBAAa,EAAE,uCAAiB,CAAC;SAC5C,CAAC;IACJ,CAAC;CACF,CAAA;AAZY,oCAAY;uBAAZ,YAAY;IAJxB,IAAA,eAAM,EAAC;QACN,SAAS,EAAE,CAAC,uCAAiB,CAAC;QAC9B,OAAO,EAAE,CAAC,uCAAiB,CAAC;KAC7B,CAAC;GACW,YAAY,CAYxB"}
@@ -13,24 +13,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports.PluginModule = void 0;
14
14
  const common_1 = require("@nestjs/common");
15
15
  const plugin_factory_1 = __importDefault(require("./plugin.factory"));
16
- const plugin_hook_service_1 = require("./plugin-hook.service");
16
+ const hook_module_1 = require("../hook/hook.module");
17
17
  let PluginModule = PluginModule_1 = class PluginModule {
18
18
  static forRoot() {
19
19
  console.log('Loading plugins', plugin_factory_1.default.plugins);
20
20
  return {
21
21
  global: true,
22
22
  module: PluginModule_1,
23
- imports: [...plugin_factory_1.default.plugins],
24
- providers: [plugin_factory_1.default, plugin_hook_service_1.PluginHookService],
25
- exports: [plugin_factory_1.default, plugin_hook_service_1.PluginHookService],
23
+ imports: [...plugin_factory_1.default.plugins, hook_module_1.HookModule],
24
+ providers: [plugin_factory_1.default],
25
+ exports: [plugin_factory_1.default],
26
26
  };
27
27
  }
28
28
  };
29
29
  exports.PluginModule = PluginModule;
30
30
  exports.PluginModule = PluginModule = PluginModule_1 = __decorate([
31
31
  (0, common_1.Module)({
32
- providers: [plugin_hook_service_1.PluginHookService],
33
- exports: [plugin_hook_service_1.PluginHookService],
32
+ imports: [hook_module_1.HookModule],
34
33
  })
35
34
  ], PluginModule);
36
35
  //# sourceMappingURL=plugin.module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.module.js","sourceRoot":"","sources":["../../../src/core/plugin/plugin.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAuD;AACvD,sEAA6C;AAC7C,+DAA0D;AAMnD,IAAM,YAAY,oBAAlB,MAAM,YAAY;IACvB,MAAM,CAAC,OAAO;QACZ,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,wBAAa,CAAC,OAAO,CAAC,CAAC;QAEtD,OAAO;YACL,MAAM,EAAE,IAAI;YACZ,MAAM,EAAE,cAAY;YACpB,OAAO,EAAE,CAAC,GAAG,wBAAa,CAAC,OAAO,CAAC;YACnC,SAAS,EAAE,CAAC,wBAAa,EAAE,uCAAiB,CAAC;YAC7C,OAAO,EAAE,CAAC,wBAAa,EAAE,uCAAiB,CAAC;SAC5C,CAAC;IACJ,CAAC;CACF,CAAA;AAZY,oCAAY;uBAAZ,YAAY;IAJxB,IAAA,eAAM,EAAC;QACN,SAAS,EAAE,CAAC,uCAAiB,CAAC;QAC9B,OAAO,EAAE,CAAC,uCAAiB,CAAC;KAC7B,CAAC;GACW,YAAY,CAYxB"}
1
+ {"version":3,"file":"plugin.module.js","sourceRoot":"","sources":["../../../src/core/plugin/plugin.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAuD;AACvD,sEAA6C;AAC7C,qDAAiD;AAK1C,IAAM,YAAY,oBAAlB,MAAM,YAAY;IACvB,MAAM,CAAC,OAAO;QACZ,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,wBAAa,CAAC,OAAO,CAAC,CAAC;QAEtD,OAAO;YACL,MAAM,EAAE,IAAI;YACZ,MAAM,EAAE,cAAY;YACpB,OAAO,EAAE,CAAC,GAAG,wBAAa,CAAC,OAAO,EAAE,wBAAU,CAAC;YAC/C,SAAS,EAAE,CAAC,wBAAa,CAAC;YAC1B,OAAO,EAAE,CAAC,wBAAa,CAAC;SACzB,CAAC;IACJ,CAAC;CACF,CAAA;AAZY,oCAAY;uBAAZ,YAAY;IAHxB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,wBAAU,CAAC;KACtB,CAAC;GACW,YAAY,CAYxB"}
package/dist/index.d.ts CHANGED
@@ -2,5 +2,4 @@ export * as TypeOrm from '@nestjs/typeorm';
2
2
  export * from '~/core/acl/acl.module';
3
3
  export * from '~/community/community.module';
4
4
  export * from '~/user/user.module';
5
- export { PluginHookService } from '~/core/plugin/plugin-hook.service';
6
5
  export * as Common from '@nestjs/common';
package/dist/index.js CHANGED
@@ -36,12 +36,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
36
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.Common = exports.PluginHookService = exports.TypeOrm = void 0;
39
+ exports.Common = exports.TypeOrm = void 0;
40
40
  exports.TypeOrm = __importStar(require("@nestjs/typeorm"));
41
41
  __exportStar(require("./core/acl/acl.module"), exports);
42
42
  __exportStar(require("./community/community.module"), exports);
43
43
  __exportStar(require("./user/user.module"), exports);
44
- var plugin_hook_service_1 = require("./core/plugin/plugin-hook.service");
45
- Object.defineProperty(exports, "PluginHookService", { enumerable: true, get: function () { return plugin_hook_service_1.PluginHookService; } });
46
44
  exports.Common = __importStar(require("@nestjs/common"));
47
45
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2DAA2C;AAE3C,wDAAsC;AACtC,+DAA6C;AAC7C,qDAAmC;AAEnC,yEAAsE;AAA7D,wHAAA,iBAAiB,OAAA;AAE1B,yDAAyC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2DAA2C;AAE3C,wDAAsC;AACtC,+DAA6C;AAC7C,qDAAmC;AAEnC,yDAAyC"}
@@ -0,0 +1,13 @@
1
+ import { HookService } from '~/core/hook/hook.service';
2
+ import { PushNotificationService } from './push-notification.service';
3
+ import { Post } from '~/post/entities/post.entity';
4
+ import { CommunityService } from '~/community/community.service';
5
+ export declare class NotificationHookListener {
6
+ private hookService;
7
+ private pushService;
8
+ private commuityService;
9
+ constructor(hookService: HookService, pushService: PushNotificationService, commuityService: CommunityService);
10
+ sendToCommunityMembers({ post }: {
11
+ post: Post;
12
+ }): Promise<void>;
13
+ }
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.NotificationHookListener = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const hook_service_1 = require("../core/hook/hook.service");
15
+ const push_notification_service_1 = require("./push-notification.service");
16
+ const community_service_1 = require("../community/community.service");
17
+ let NotificationHookListener = class NotificationHookListener {
18
+ hookService;
19
+ pushService;
20
+ commuityService;
21
+ constructor(hookService, pushService, commuityService) {
22
+ this.hookService = hookService;
23
+ this.pushService = pushService;
24
+ this.commuityService = commuityService;
25
+ this.hookService.listen('POST_SAVED', this.sendToCommunityMembers.bind(this));
26
+ }
27
+ async sendToCommunityMembers({ post }) {
28
+ if (post.community) {
29
+ const community = await this.commuityService.findOne(post.community.id);
30
+ if (!community) {
31
+ return;
32
+ }
33
+ const [members] = await this.commuityService.findMembers({
34
+ community,
35
+ limit: 100,
36
+ offset: 0,
37
+ });
38
+ for (const member of members) {
39
+ const tokens = await this.pushService.getTokensByUser(member.user.id);
40
+ if (tokens) {
41
+ await this.pushService.sendPush({
42
+ title: community?.name,
43
+ body: post.owner.name + ': ' + post.message,
44
+ }, tokens);
45
+ console.log('Sent push to ' + member.user.id);
46
+ }
47
+ }
48
+ }
49
+ }
50
+ };
51
+ exports.NotificationHookListener = NotificationHookListener;
52
+ exports.NotificationHookListener = NotificationHookListener = __decorate([
53
+ (0, common_1.Injectable)(),
54
+ __metadata("design:paramtypes", [hook_service_1.HookService,
55
+ push_notification_service_1.PushNotificationService,
56
+ community_service_1.CommunityService])
57
+ ], NotificationHookListener);
58
+ //# sourceMappingURL=hook-listener.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hook-listener.service.js","sourceRoot":"","sources":["../../src/notification/hook-listener.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,4DAAuD;AACvD,2EAAsE;AAEtE,sEAAiE;AAG1D,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAEzB;IACA;IACA;IAHV,YACU,WAAwB,EACxB,WAAoC,EACpC,eAAiC;QAFjC,gBAAW,GAAX,WAAW,CAAa;QACxB,gBAAW,GAAX,WAAW,CAAyB;QACpC,oBAAe,GAAf,eAAe,CAAkB;QAEzC,IAAI,CAAC,WAAW,CAAC,MAAM,CACrB,YAAY,EACZ,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,CACvC,CAAC;IACJ,CAAC;IAKD,KAAK,CAAC,sBAAsB,CAAC,EAAE,IAAI,EAAkB;QACnD,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YAEnB,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;YACxE,IAAI,CAAC,SAAS,EAAE,CAAC;gBACf,OAAO;YACT,CAAC;YAED,MAAM,CAAC,OAAO,CAAC,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC;gBACvD,SAAS;gBACT,KAAK,EAAE,GAAG;gBACV,MAAM,EAAE,CAAC;aACV,CAAC,CAAC;YAEH,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;gBAC7B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBACtE,IAAI,MAAM,EAAE,CAAC;oBACX,MAAM,IAAI,CAAC,WAAW,CAAC,QAAQ,CAC7B;wBACE,KAAK,EAAE,SAAS,EAAE,IAAI;wBACtB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,OAAO;qBAC5C,EACD,MAAM,CACP,CAAC;oBACF,OAAO,CAAC,GAAG,CAAC,eAAe,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBAChD,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAA;AA5CY,4DAAwB;mCAAxB,wBAAwB;IADpC,IAAA,mBAAU,GAAE;qCAGY,0BAAW;QACX,mDAAuB;QACnB,oCAAgB;GAJhC,wBAAwB,CA4CpC"}
@@ -12,14 +12,23 @@ const typeorm_1 = require("@nestjs/typeorm");
12
12
  const push_token_entity_1 = require("./entities/push-token.entity");
13
13
  const push_notification_controller_1 = require("./push-notification.controller");
14
14
  const push_notification_service_1 = require("./push-notification.service");
15
+ const axios_1 = require("@nestjs/axios");
16
+ const hook_listener_service_1 = require("./hook-listener.service");
17
+ const hook_module_1 = require("../core/hook/hook.module");
18
+ const community_module_1 = require("../community/community.module");
15
19
  let NotificationModule = class NotificationModule {
16
20
  };
17
21
  exports.NotificationModule = NotificationModule;
18
22
  exports.NotificationModule = NotificationModule = __decorate([
19
23
  (0, common_1.Module)({
20
- imports: [typeorm_1.TypeOrmModule.forFeature([push_token_entity_1.PushNotificationToken])],
24
+ imports: [
25
+ typeorm_1.TypeOrmModule.forFeature([push_token_entity_1.PushNotificationToken]),
26
+ axios_1.HttpModule,
27
+ hook_module_1.HookModule,
28
+ community_module_1.CommunityModule,
29
+ ],
21
30
  controllers: [push_notification_controller_1.PushNotificationController],
22
- providers: [push_notification_service_1.PushNotificationService],
31
+ providers: [push_notification_service_1.PushNotificationService, hook_listener_service_1.NotificationHookListener],
23
32
  })
24
33
  ], NotificationModule);
25
34
  //# sourceMappingURL=notification.module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"notification.module.js","sourceRoot":"","sources":["../../src/notification/notification.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,oEAAqE;AACrE,iFAA4E;AAC5E,2EAAsE;AAO/D,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CAAG,CAAA;AAArB,gDAAkB;6BAAlB,kBAAkB;IAL9B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,uBAAa,CAAC,UAAU,CAAC,CAAC,yCAAqB,CAAC,CAAC,CAAC;QAC5D,WAAW,EAAE,CAAC,yDAA0B,CAAC;QACzC,SAAS,EAAE,CAAC,mDAAuB,CAAC;KACrC,CAAC;GACW,kBAAkB,CAAG"}
1
+ {"version":3,"file":"notification.module.js","sourceRoot":"","sources":["../../src/notification/notification.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,oEAAqE;AACrE,iFAA4E;AAC5E,2EAAsE;AACtE,yCAA2C;AAC3C,mEAAmE;AACnE,0DAAqD;AACrD,oEAA+D;AAYxD,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CAAG,CAAA;AAArB,gDAAkB;6BAAlB,kBAAkB;IAV9B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,UAAU,CAAC,CAAC,yCAAqB,CAAC,CAAC;YACjD,kBAAU;YACV,wBAAU;YACV,kCAAe;SAChB;QACD,WAAW,EAAE,CAAC,yDAA0B,CAAC;QACzC,SAAS,EAAE,CAAC,mDAAuB,EAAE,gDAAwB,CAAC;KAC/D,CAAC;GACW,kBAAkB,CAAG"}
@@ -5,5 +5,5 @@ export declare class PushNotificationController {
5
5
  private service;
6
6
  constructor(service: PushNotificationService);
7
7
  registerToken(dto: RegisterPushNotificationTokenDto): Promise<import("typeorm").InsertResult>;
8
- deleteToken(dto: DeletePushNotificationTokenDto): Promise<void>;
8
+ deleteToken(dto: DeletePushNotificationTokenDto): Promise<import("typeorm").DeleteResult>;
9
9
  }
@@ -2,9 +2,21 @@ import { RegisterPushNotificationTokenDto } from './dto/register-push-token.dto'
2
2
  import { DeletePushNotificationTokenDto } from './dto/delete-push-token.dto';
3
3
  import { PushNotificationToken } from './entities/push-token.entity';
4
4
  import { Repository } from 'typeorm';
5
+ import { User } from '~/user/entities/user.entity';
6
+ import { HttpService } from '@nestjs/axios';
7
+ type PushNotification = {
8
+ data?: Record<string, unknown>;
9
+ title?: string;
10
+ subtitle?: string;
11
+ body?: string;
12
+ };
5
13
  export declare class PushNotificationService {
6
14
  private repository;
7
- constructor(repository: Repository<PushNotificationToken>);
15
+ private http;
16
+ constructor(repository: Repository<PushNotificationToken>, http: HttpService);
8
17
  registerToken({ token, service }: RegisterPushNotificationTokenDto): Promise<import("typeorm").InsertResult>;
9
- deleteToken({ token }: DeletePushNotificationTokenDto): Promise<void>;
18
+ deleteToken({ token }: DeletePushNotificationTokenDto): Promise<import("typeorm").DeleteResult>;
19
+ getTokensByUser(userId: User['id']): Promise<PushNotificationToken[]>;
20
+ sendPush(notification: PushNotification, tokens: PushNotificationToken[]): Promise<void>;
10
21
  }
22
+ export {};
@@ -18,10 +18,14 @@ const typeorm_1 = require("@nestjs/typeorm");
18
18
  const push_token_entity_1 = require("./entities/push-token.entity");
19
19
  const typeorm_2 = require("typeorm");
20
20
  const context_1 = require("../core/context/context");
21
+ const axios_1 = require("@nestjs/axios");
22
+ const rxjs_1 = require("rxjs");
21
23
  let PushNotificationService = class PushNotificationService {
22
24
  repository;
23
- constructor(repository) {
25
+ http;
26
+ constructor(repository, http) {
24
27
  this.repository = repository;
28
+ this.http = http;
25
29
  }
26
30
  async registerToken({ token, service }) {
27
31
  const entity = this.repository.create({
@@ -35,16 +39,46 @@ let PushNotificationService = class PushNotificationService {
35
39
  .insert()
36
40
  .into(push_token_entity_1.PushNotificationToken)
37
41
  .values(entity)
38
- .orUpdate(['updated_at'])
42
+ .orUpdate(['updatedAt'], ['token'])
39
43
  .execute();
40
44
  }
41
45
  async deleteToken({ token }) {
46
+ return this.repository.delete({
47
+ token,
48
+ network: { id: context_1.Context.getNetwork().id },
49
+ });
50
+ }
51
+ async getTokensByUser(userId) {
52
+ return await this.repository.findBy({
53
+ user: { id: userId },
54
+ });
55
+ }
56
+ async sendPush(notification, tokens) {
57
+ try {
58
+ const res = await (0, rxjs_1.firstValueFrom)(this.http.post('https://exp.host/--/api/v2/push/send', {
59
+ ...notification,
60
+ to: tokens.map((token) => token.token),
61
+ }));
62
+ for (const r of res.data.data) {
63
+ if (r.status === 'error') {
64
+ console.error(r, r.details);
65
+ if (r.details.error === 'DeviceNotRegistered') {
66
+ console.log('Removing push notification', r.details);
67
+ this.deleteToken({ token: r.details.expoPushToken });
68
+ }
69
+ }
70
+ }
71
+ }
72
+ catch (err) {
73
+ console.error(err);
74
+ }
42
75
  }
43
76
  };
44
77
  exports.PushNotificationService = PushNotificationService;
45
78
  exports.PushNotificationService = PushNotificationService = __decorate([
46
79
  (0, common_1.Injectable)(),
47
80
  __param(0, (0, typeorm_1.InjectRepository)(push_token_entity_1.PushNotificationToken)),
48
- __metadata("design:paramtypes", [typeorm_2.Repository])
81
+ __metadata("design:paramtypes", [typeorm_2.Repository,
82
+ axios_1.HttpService])
49
83
  ], PushNotificationService);
50
84
  //# sourceMappingURL=push-notification.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"push-notification.service.js","sourceRoot":"","sources":["../../src/notification/push-notification.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAG5C,6CAAmD;AACnD,oEAAqE;AACrE,qCAAqC;AACrC,qDAAiD;AAG1C,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAGxB;IAFV,YAEU,UAA6C;QAA7C,eAAU,GAAV,UAAU,CAAmC;IACpD,CAAC;IAKJ,KAAK,CAAC,aAAa,CAAC,EAAE,KAAK,EAAE,OAAO,EAAoC;QACtE,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;YACpC,KAAK;YACL,OAAO;YACP,OAAO,EAAE,iBAAO,CAAC,UAAU,EAAE;YAC7B,IAAI,EAAE,iBAAO,CAAC,OAAO,EAAE;SACxB,CAAC,CAAC;QAEH,OAAO,MAAM,IAAI,CAAC,UAAU;aACzB,kBAAkB,EAAE;aACpB,MAAM,EAAE;aACR,IAAI,CAAC,yCAAqB,CAAC;aAC3B,MAAM,CAAC,MAAM,CAAC;aACd,QAAQ,CAAC,CAAC,YAAY,CAAC,CAAC;aACxB,OAAO,EAAE,CAAC;IACf,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,EAAE,KAAK,EAAkC;IAE3D,CAAC;CACF,CAAA;AA7BY,0DAAuB;kCAAvB,uBAAuB;IADnC,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,yCAAqB,CAAC,CAAA;qCACpB,oBAAU;GAHrB,uBAAuB,CA6BnC"}
1
+ {"version":3,"file":"push-notification.service.js","sourceRoot":"","sources":["../../src/notification/push-notification.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAG5C,6CAAmD;AACnD,oEAAqE;AACrE,qCAAqC;AACrC,qDAAiD;AAEjD,yCAA4C;AAC5C,+BAAsC;AAU/B,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAGxB;IACA;IAHV,YAEU,UAA6C,EAC7C,IAAiB;QADjB,eAAU,GAAV,UAAU,CAAmC;QAC7C,SAAI,GAAJ,IAAI,CAAa;IACxB,CAAC;IAKJ,KAAK,CAAC,aAAa,CAAC,EAAE,KAAK,EAAE,OAAO,EAAoC;QACtE,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;YACpC,KAAK;YACL,OAAO;YACP,OAAO,EAAE,iBAAO,CAAC,UAAU,EAAE;YAC7B,IAAI,EAAE,iBAAO,CAAC,OAAO,EAAE;SACxB,CAAC,CAAC;QAEH,OAAO,MAAM,IAAI,CAAC,UAAU;aACzB,kBAAkB,EAAE;aACpB,M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I,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;oBACvD,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC;IACH,CAAC;CACF,CAAA;AA3EY,0DAAuB;kCAAvB,uBAAuB;IADnC,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,yCAAqB,CAAC,CAAA;qCACpB,oBAAU;QAChB,mBAAW;GAJhB,uBAAuB,CA2EnC"}
@@ -20,6 +20,7 @@ const media_module_1 = require("../media/media.module");
20
20
  const acl_module_1 = require("../core/acl/acl.module");
21
21
  const post_acl_1 = __importDefault(require("./post.acl"));
22
22
  const reaction_module_1 = require("./reaction/reaction.module");
23
+ const hook_module_1 = require("../core/hook/hook.module");
23
24
  let PostModule = class PostModule {
24
25
  };
25
26
  exports.PostModule = PostModule;
@@ -31,6 +32,7 @@ exports.PostModule = PostModule = __decorate([
31
32
  auth_module_1.AuthModule,
32
33
  media_module_1.MediaModule,
33
34
  reaction_module_1.PostReactionModule,
35
+ hook_module_1.HookModule,
34
36
  ],
35
37
  controllers: [post_controller_1.PostController],
36
38
  providers: [post_service_1.PostService],
@@ -1 +1 @@
1
- {"version":3,"file":"post.module.js","sourceRoot":"","sources":["../../src/post/post.module.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,iDAA6C;AAC7C,uDAAmD;AACnD,wDAA8C;AAC9C,qDAAiD;AACjD,wDAAmD;AACnD,uDAAkD;AAClD,0DAAsC;AACtC,gEAAgE;AAczD,IAAM,UAAU,GAAhB,MAAM,UAAU;CAAG,CAAA;AAAb,gCAAU;qBAAV,UAAU;IAZtB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,UAAU,CAAC,CAAC,kBAAI,CAAC,CAAC;YAChC,sBAAS,CAAC,QAAQ,CAAC,kBAAY,CAAC;YAChC,wBAAU;YACV,0BAAW;YACX,oCAAkB;SACnB;QACD,WAAW,EAAE,CAAC,gCAAc,CAAC;QAC7B,SAAS,EAAE,CAAC,0BAAW,CAAC;QACxB,OAAO,EAAE,CAAC,0BAAW,CAAC;KACvB,CAAC;GACW,UAAU,CAAG"}
1
+ {"version":3,"file":"post.module.js","sourceRoot":"","sources":["../../src/post/post.module.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,iDAA6C;AAC7C,uDAAmD;AACnD,wDAA8C;AAC9C,qDAAiD;AACjD,wDAAmD;AACnD,uDAAkD;AAClD,0DAAsC;AACtC,gEAAgE;AAChE,0DAAqD;AAe9C,IAAM,UAAU,GAAhB,MAAM,UAAU;CAAG,CAAA;AAAb,gCAAU;qBAAV,UAAU;IAbtB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,UAAU,CAAC,CAAC,kBAAI,CAAC,CAAC;YAChC,sBAAS,CAAC,QAAQ,CAAC,kBAAY,CAAC;YAChC,wBAAU;YACV,0BAAW;YACX,oCAAkB;YAClB,wBAAU;SACX;QACD,WAAW,EAAE,CAAC,gCAAc,CAAC;QAC7B,SAAS,EAAE,CAAC,0BAAW,CAAC;QACxB,OAAO,EAAE,CAAC,0BAAW,CAAC;KACvB,CAAC;GACW,UAAU,CAAG"}
@@ -4,11 +4,13 @@ import { CreatePostDto } from './dto/create-post.dto';
4
4
  import { UpdatePostDto } from './dto/update-post.dto';
5
5
  import { MediaService } from '~/media/media.service';
6
6
  import { AclFactory } from '~/core/acl/acl.factory';
7
+ import { HookService } from '~/core/hook/hook.service';
7
8
  export declare class PostService {
8
9
  private postRepository;
9
10
  private mediaService;
10
11
  private aclFactory;
11
- constructor(postRepository: Repository<Post>, mediaService: MediaService, aclFactory: AclFactory);
12
+ private hookService;
13
+ constructor(postRepository: Repository<Post>, mediaService: MediaService, aclFactory: AclFactory, hookService: HookService);
12
14
  create(createPostDto: CreatePostDto): Promise<Post>;
13
15
  findAll({ communityId, ownerId, limit, untilId, }: {
14
16
  communityId?: number;