@things-factory/notification 6.1.17 → 6.1.22

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 (108) hide show
  1. package/client/{bootstrap.js → bootstrap.ts} +13 -9
  2. package/client/pages/notification/notification-list-page.ts +267 -0
  3. package/client/pages/notification-rule/notification-rule-importer.ts +93 -0
  4. package/client/pages/notification-rule/notification-rule-list-page.ts +395 -0
  5. package/client/route.ts +10 -0
  6. package/client/tsconfig.json +13 -0
  7. package/client/viewparts/notification-badge.ts +58 -0
  8. package/client/viewparts/notification-item.ts +242 -0
  9. package/client/viewparts/notification-list.ts +171 -0
  10. package/client/viewparts/notification-sender.ts +126 -0
  11. package/client/viewparts/{notification-setting-let.js → notification-setting-let.ts} +48 -52
  12. package/dist-client/actions/notification-fcm.d.ts +7 -0
  13. package/dist-client/actions/notification-fcm.js +125 -0
  14. package/dist-client/actions/notification-fcm.js.map +1 -0
  15. package/dist-client/bootstrap.d.ts +1 -0
  16. package/dist-client/bootstrap.js +112 -0
  17. package/dist-client/bootstrap.js.map +1 -0
  18. package/dist-client/index.d.ts +5 -0
  19. package/dist-client/index.js +6 -0
  20. package/dist-client/index.js.map +1 -0
  21. package/dist-client/pages/notification/notification-list-page.d.ts +49 -0
  22. package/dist-client/pages/notification/notification-list-page.js +262 -0
  23. package/dist-client/pages/notification/notification-list-page.js.map +1 -0
  24. package/dist-client/pages/notification-rule/notification-rule-importer.d.ts +22 -0
  25. package/dist-client/pages/notification-rule/notification-rule-importer.js +100 -0
  26. package/dist-client/pages/notification-rule/notification-rule-importer.js.map +1 -0
  27. package/dist-client/pages/notification-rule/notification-rule-list-page.d.ts +62 -0
  28. package/dist-client/pages/notification-rule/notification-rule-list-page.js +380 -0
  29. package/dist-client/pages/notification-rule/notification-rule-list-page.js.map +1 -0
  30. package/dist-client/reducers/notification.d.ts +8 -0
  31. package/dist-client/reducers/notification.js +22 -0
  32. package/dist-client/reducers/notification.js.map +1 -0
  33. package/dist-client/route.d.ts +1 -0
  34. package/dist-client/route.js +11 -0
  35. package/dist-client/route.js.map +1 -0
  36. package/dist-client/tsconfig.tsbuildinfo +1 -0
  37. package/dist-client/viewparts/notification-badge.d.ts +15 -0
  38. package/dist-client/viewparts/notification-badge.js +61 -0
  39. package/dist-client/viewparts/notification-badge.js.map +1 -0
  40. package/dist-client/viewparts/notification-item.d.ts +16 -0
  41. package/dist-client/viewparts/notification-item.js +249 -0
  42. package/dist-client/viewparts/notification-item.js.map +1 -0
  43. package/dist-client/viewparts/notification-list.d.ts +20 -0
  44. package/dist-client/viewparts/notification-list.js +160 -0
  45. package/dist-client/viewparts/notification-list.js.map +1 -0
  46. package/dist-client/viewparts/notification-sender.d.ts +13 -0
  47. package/dist-client/viewparts/notification-sender.js +122 -0
  48. package/dist-client/viewparts/notification-sender.js.map +1 -0
  49. package/dist-client/viewparts/notification-setting-let.d.ts +20 -0
  50. package/dist-client/viewparts/notification-setting-let.js +193 -0
  51. package/dist-client/viewparts/notification-setting-let.js.map +1 -0
  52. package/dist-server/service/index.js +10 -1
  53. package/dist-server/service/index.js.map +1 -1
  54. package/dist-server/service/notification/index.js +6 -3
  55. package/dist-server/service/notification/index.js.map +1 -1
  56. package/dist-server/service/notification/notification-mutation.js +110 -0
  57. package/dist-server/service/notification/notification-mutation.js.map +1 -0
  58. package/dist-server/service/notification/notification-query.js +109 -0
  59. package/dist-server/service/notification/notification-query.js.map +1 -0
  60. package/dist-server/service/notification/notification-subscription.js +45 -0
  61. package/dist-server/service/notification/notification-subscription.js.map +1 -0
  62. package/dist-server/service/notification/notification-type.js +82 -0
  63. package/dist-server/service/notification/notification-type.js.map +1 -0
  64. package/dist-server/service/notification/notification.js +81 -8
  65. package/dist-server/service/notification/notification.js.map +1 -1
  66. package/dist-server/service/notification-rule/event-subscriber.js +21 -0
  67. package/dist-server/service/notification-rule/event-subscriber.js.map +1 -0
  68. package/dist-server/service/notification-rule/index.js +12 -0
  69. package/dist-server/service/notification-rule/index.js.map +1 -0
  70. package/dist-server/service/notification-rule/notification-rule-history.js +146 -0
  71. package/dist-server/service/notification-rule/notification-rule-history.js.map +1 -0
  72. package/dist-server/service/notification-rule/notification-rule-mutation.js +170 -0
  73. package/dist-server/service/notification-rule/notification-rule-mutation.js.map +1 -0
  74. package/dist-server/service/notification-rule/notification-rule-query.js +97 -0
  75. package/dist-server/service/notification-rule/notification-rule-query.js.map +1 -0
  76. package/dist-server/service/notification-rule/notification-rule-type.js +102 -0
  77. package/dist-server/service/notification-rule/notification-rule-type.js.map +1 -0
  78. package/dist-server/service/notification-rule/notification-rule.js +146 -0
  79. package/dist-server/service/notification-rule/notification-rule.js.map +1 -0
  80. package/dist-server/tsconfig.tsbuildinfo +1 -1
  81. package/helps/notification/noti-box.md +160 -0
  82. package/helps/notification/noti-rule.md +160 -0
  83. package/helps/notification/notibox.md +160 -0
  84. package/package.json +15 -12
  85. package/server/service/index.ts +14 -0
  86. package/server/service/notification/index.ts +6 -3
  87. package/server/service/notification/notification-mutation.ts +119 -0
  88. package/server/service/notification/notification-query.ts +70 -0
  89. package/server/service/notification/{notification-resolver.ts → notification-subscription.ts} +4 -4
  90. package/server/service/notification/notification-type.ts +55 -0
  91. package/server/service/notification/notification.ts +87 -14
  92. package/server/service/notification-rule/event-subscriber.ts +20 -0
  93. package/server/service/notification-rule/index.ts +9 -0
  94. package/server/service/notification-rule/notification-rule-history.ts +130 -0
  95. package/server/service/notification-rule/notification-rule-mutation.ts +203 -0
  96. package/server/service/notification-rule/notification-rule-query.ts +62 -0
  97. package/server/service/notification-rule/notification-rule-type.ts +71 -0
  98. package/server/service/notification-rule/notification-rule.ts +125 -0
  99. package/server/tsconfig.json +9 -0
  100. package/things-factory.config.js +7 -1
  101. package/client/viewparts/notification-badge.js +0 -63
  102. package/client/viewparts/notification-item.js +0 -250
  103. package/client/viewparts/notification-list.js +0 -177
  104. package/client/viewparts/notification-sender.js +0 -128
  105. package/tsconfig.json +0 -9
  106. /package/client/actions/{notification-fcm.js → notification-fcm.ts} +0 -0
  107. /package/client/{index.js → index.ts} +0 -0
  108. /package/client/reducers/{notification.js → notification.ts} +0 -0
@@ -1,128 +0,0 @@
1
- import '@material/mwc-formfield'
2
- import '@material/mwc-button'
3
- import '@material/mwc-checkbox'
4
- import '@operato/i18n/ox-i18n.js'
5
-
6
- import { css, html, LitElement } from 'lit'
7
-
8
- import { auth } from '@things-factory/auth-base'
9
- import { i18next, localize } from '@things-factory/i18n-base'
10
- import { ScrollbarStyles } from '@things-factory/styles'
11
-
12
- import { notify as webpushNotify } from '../actions/notification-fcm'
13
-
14
- export class NotificationSender extends localize(i18next)(LitElement) {
15
- static get styles() {
16
- return [
17
- ScrollbarStyles,
18
- css`
19
- :host {
20
- display: flex;
21
- background-color: var(--main-section-background-color);
22
- padding: var(--padding-wide);
23
- }
24
-
25
- form {
26
- flex: 1;
27
- display: flex;
28
- flex-direction: column;
29
- }
30
- [content] > * {
31
- margin: var(--margin-default);
32
- }
33
-
34
- [content] {
35
- flex: 1;
36
- flex-direction: column;
37
- display: flex;
38
- overflow: auto;
39
- }
40
-
41
- [buttons] {
42
- margin-top: auto;
43
- display: flex;
44
- flex-direction: row-reverse;
45
- }
46
- mwc-button {
47
- margin-left: var(--padding-default);
48
- }
49
-
50
- @media screen and (max-width: 480px) {
51
- :host {
52
- padding: var(--padding-default);
53
- }
54
- }
55
- `
56
- ]
57
- }
58
-
59
- static get properties() {
60
- return {}
61
- }
62
-
63
- render() {
64
- return html`
65
- <form>
66
- <div content>
67
- <mwc-textfield
68
- type="text"
69
- name="receivers"
70
- label=${i18next.t('field.receivers')}
71
- placeholder=${auth.credential?.email}
72
- required
73
- icon="account_circle"
74
- ></mwc-textfield>
75
- <mwc-textfield
76
- type="text"
77
- name="title"
78
- label=${i18next.t('field.title')}
79
- required
80
- icon="notifications_none"
81
- ></mwc-textfield>
82
-
83
- <mwc-textfield type="text" name="image" label=${i18next.t('field.image')} icon="insert_photo"></mwc-textfield>
84
- <mwc-textfield type="text" name="url" label=${i18next.t('field.url')} icon="link"></mwc-textfield>
85
- <mwc-textarea type="text" name="body" label=${i18next.t('field.body')} required rows="5"></mwc-textarea>
86
- <mwc-formfield label="In-App Message">
87
- <mwc-checkbox name="inappmsg"></mwc-checkbox>
88
- </mwc-formfield>
89
- </div>
90
-
91
- <div buttons>
92
- <mwc-button raised icon="send" @click=${e => this.ontest()}>
93
- <ox-i18n msgid="button.notification-send"> </ox-i18n>
94
- </mwc-button>
95
-
96
- <mwc-button type="reset" outlined @click=${e => this.onreset()}>
97
- <ox-i18n msgid="button.reset"> </ox-i18n>
98
- </mwc-button>
99
- </div>
100
- </form>
101
- `
102
- }
103
-
104
- ontest() {
105
- const [receivers, title, body, image, url] = ['receivers', 'title', 'body', 'image', 'url'].map(
106
- key => this.renderRoot.querySelector(`[name="${key}"]`).value
107
- )
108
- const mode = this.renderRoot.querySelector(`[name="inappmsg"]`).checked ? 'inapp' : 'background'
109
-
110
- webpushNotify({
111
- receivers,
112
- title,
113
- body,
114
- image,
115
- mode,
116
- url
117
- })
118
- }
119
-
120
- onreset() {
121
- ;['receivers', 'title', 'body', 'image', 'url'].map(
122
- key => (this.renderRoot.querySelector(`[name="${key}"]`).value = '')
123
- )
124
- this.renderRoot.querySelector(`[name="inappmsg"]`).checked = false
125
- }
126
- }
127
-
128
- customElements.define('notification-sender', NotificationSender)
package/tsconfig.json DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "../tsconfig-base.json",
3
- "compilerOptions": {
4
- "outDir": "./dist-server",
5
- "baseUrl": "./"
6
- },
7
- "include": ["./server/**/*"],
8
- "exclude": ["**/*.spec.ts"]
9
- }
File without changes