@things-factory/notification 9.0.0-beta.8 → 9.0.0

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 (39) hide show
  1. package/dist-client/actions/notification-fcm.js +1 -2
  2. package/dist-client/actions/notification-fcm.js.map +1 -1
  3. package/dist-client/bootstrap.js +4 -1
  4. package/dist-client/bootstrap.js.map +1 -1
  5. package/dist-client/pages/notification/notification-list-page.js +35 -28
  6. package/dist-client/pages/notification/notification-list-page.js.map +1 -1
  7. package/dist-client/pages/notification-rule/notification-rule-importer.js +16 -17
  8. package/dist-client/pages/notification-rule/notification-rule-importer.js.map +1 -1
  9. package/dist-client/pages/notification-rule/notification-rule-list-page.js +35 -28
  10. package/dist-client/pages/notification-rule/notification-rule-list-page.js.map +1 -1
  11. package/dist-client/tsconfig.tsbuildinfo +1 -1
  12. package/dist-client/viewparts/notification-badge.js +10 -10
  13. package/dist-client/viewparts/notification-badge.js.map +1 -1
  14. package/dist-client/viewparts/notification-item.js +78 -79
  15. package/dist-client/viewparts/notification-item.js.map +1 -1
  16. package/dist-client/viewparts/notification-list.js +57 -54
  17. package/dist-client/viewparts/notification-list.js.map +1 -1
  18. package/dist-client/viewparts/notification-sender.js +55 -56
  19. package/dist-client/viewparts/notification-sender.js.map +1 -1
  20. package/dist-client/viewparts/notification-setting-let.js +53 -53
  21. package/dist-client/viewparts/notification-setting-let.js.map +1 -1
  22. package/dist-server/controllers/fcm.js +4 -1
  23. package/dist-server/controllers/fcm.js.map +1 -1
  24. package/dist-server/routers/notification-router.js +5 -2
  25. package/dist-server/routers/notification-router.js.map +1 -1
  26. package/dist-server/service/index.js +6 -2
  27. package/dist-server/service/index.js.map +1 -1
  28. package/dist-server/service/notification/directive-notification.js +1 -2
  29. package/dist-server/service/notification/directive-notification.js.map +1 -1
  30. package/dist-server/service/notification/notification-mutation.js +24 -6
  31. package/dist-server/service/notification/notification-mutation.js.map +1 -1
  32. package/dist-server/service/notification/notification-subscription.js +2 -2
  33. package/dist-server/service/notification/notification-subscription.js.map +1 -1
  34. package/dist-server/service/notification-rule/notification-rule-mutation.js +25 -7
  35. package/dist-server/service/notification-rule/notification-rule-mutation.js.map +1 -1
  36. package/dist-server/service/notification-rule/notification-rule-query.js +1 -1
  37. package/dist-server/service/notification-rule/notification-rule-query.js.map +1 -1
  38. package/dist-server/tsconfig.tsbuildinfo +1 -1
  39. package/package.json +9 -9
@@ -34,7 +34,7 @@ let NotificationRuleQuery = class NotificationRuleQuery {
34
34
  refBy: notificationRule.id
35
35
  }
36
36
  });
37
- return attachment === null || attachment === void 0 ? void 0 : attachment.fullpath;
37
+ return attachment?.fullpath;
38
38
  }
39
39
  async domain(notificationRule) {
40
40
  return notificationRule.domainId && (await (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: notificationRule.domainId }));
@@ -1 +1 @@
1
- {"version":3,"file":"notification-rule-query.js","sourceRoot":"","sources":["../../../server/service/notification-rule/notification-rule-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AACnF,qEAA4D;AAC5D,iDAAuG;AACvG,yDAAgD;AAChD,2DAAsD;AACtD,qEAA+D;AAGxD,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAE1B,AAAN,KAAK,CAAC,gBAAgB,CAAY,EAAU,EAAS,OAAwB;QAC3E,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,oCAAgB,CAAC,CAAC,OAAO,CAAC;YACnD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,iBAAiB,CACI,MAAiB,EACnC,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,YAAY,GAAG,IAAA,qCAA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DjC","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx } from 'type-graphql'\nimport { Attachment } from '@things-factory/attachment-base'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { NotificationRule } from './notification-rule'\nimport { NotificationRuleList } from './notification-rule-type'\n\n@Resolver(NotificationRule)\nexport class NotificationRuleQuery {\n @Query(returns => NotificationRule!, { nullable: true, description: 'To fetch a NotificationRule' })\n async notificationRule(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<NotificationRule> {\n const { domain } = context.state\n\n return await getRepository(NotificationRule).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => NotificationRuleList, { description: 'To fetch multiple NotificationRules' })\n async notificationRules(\n @Args(type => ListParam) params: ListParam,\n @Ctx() context: ResolverContext\n ): Promise<NotificationRuleList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(NotificationRule),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => String)\n async thumbnail(@Root() notificationRule: NotificationRule): Promise<string | undefined> {\n const attachment: Attachment = await getRepository(Attachment).findOne({\n where: {\n domain: { id: notificationRule.domainId },\n refType: NotificationRule.name,\n refBy: notificationRule.id\n }\n })\n\n return attachment?.fullpath\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() notificationRule: NotificationRule): Promise<Domain> {\n return notificationRule.domainId && (await getRepository(Domain).findOneBy({ id: notificationRule.domainId }))\n }\n\n @FieldResolver(type => User)\n async updater(@Root() notificationRule: NotificationRule): Promise<User> {\n return notificationRule.updaterId && (await getRepository(User).findOneBy({ id: notificationRule.updaterId }))\n }\n\n @FieldResolver(type => User)\n async creator(@Root() notificationRule: NotificationRule): Promise<User> {\n return notificationRule.creatorId && (await getRepository(User).findOneBy({ id: notificationRule.creatorId }))\n }\n}\n"]}
1
+ {"version":3,"file":"notification-rule-query.js","sourceRoot":"","sources":["../../../server/service/notification-rule/notification-rule-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AACnF,qEAA4D;AAC5D,iDAAuG;AACvG,yDAAgD;AAChD,2DAAsD;AACtD,qEAA+D;AAGxD,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAE1B,AAAN,KAAK,CAAC,gBAAgB,CAAY,EAAU,EAAS,OAAwB;QAC3E,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,oCAAgB,CAAC,CAAC,OAAO,CAAC;YACnD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,iBAAiB,CACI,MAAiB,EACnC,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,YAAY,GAAG,IAAA,qCAA6B,EAAC;YACjD,MAAM;YACN,MAAM;YACN,UAAU,EAAE,MAAM,IAAA,qBAAa,EAAC,oCAAgB,CAAC;YACjD,WAAW,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC;SACrC,CAAC,CAAA;QAEF,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,YAAY,CAAC,eAAe,EAAE,CAAA;QAE3D,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;IAGK,AAAN,KAAK,CAAC,SAAS,CAAS,gBAAkC;QACxD,MAAM,UAAU,GAAe,MAAM,IAAA,qBAAa,EAAC,4BAAU,CAAC,CAAC,OAAO,CAAC;YACrE,KAAK,EAAE;gBACL,MAAM,EAAE,EAAE,EAAE,EAAE,gBAAgB,CAAC,QAAQ,EAAE;gBACzC,OAAO,EAAE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,CAAC,CAAA;IACvB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAD2B,iBAAS;;8DAe3C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAmB,oCAAgB;;sDAUzD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAmB,oCAAgB;;mDAEtD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAmB,oCAAgB;;oDAEvD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAmB,oCAAgB;;oDAEvD;gCAvDU,qBAAqB;IADjC,IAAA,uBAAQ,EAAC,oCAAgB,CAAC;GACd,qBAAqB,CAwDjC","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx } from 'type-graphql'\nimport { Attachment } from '@things-factory/attachment-base'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { NotificationRule } from './notification-rule'\nimport { NotificationRuleList } from './notification-rule-type'\n\n@Resolver(NotificationRule)\nexport class NotificationRuleQuery {\n @Query(returns => NotificationRule!, { nullable: true, description: 'To fetch a NotificationRule' })\n async notificationRule(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<NotificationRule> {\n const { domain } = context.state\n\n return await getRepository(NotificationRule).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => NotificationRuleList, { description: 'To fetch multiple NotificationRules' })\n async notificationRules(\n @Args(type => ListParam) params: ListParam,\n @Ctx() context: ResolverContext\n ): Promise<NotificationRuleList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(NotificationRule),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => String)\n async thumbnail(@Root() notificationRule: NotificationRule): Promise<string | undefined> {\n const attachment: Attachment = await getRepository(Attachment).findOne({\n where: {\n domain: { id: notificationRule.domainId },\n refType: NotificationRule.name,\n refBy: notificationRule.id\n }\n })\n\n return attachment?.fullpath\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() notificationRule: NotificationRule): Promise<Domain> {\n return notificationRule.domainId && (await getRepository(Domain).findOneBy({ id: notificationRule.domainId }))\n }\n\n @FieldResolver(type => User)\n async updater(@Root() notificationRule: NotificationRule): Promise<User> {\n return notificationRule.updaterId && (await getRepository(User).findOneBy({ id: notificationRule.updaterId }))\n }\n\n @FieldResolver(type => User)\n async creator(@Root() notificationRule: NotificationRule): Promise<User> {\n return notificationRule.creatorId && (await getRepository(User).findOneBy({ id: notificationRule.creatorId }))\n }\n}\n"]}