ninchat-embed 1.0.2 → 1.0.4

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 (247) hide show
  1. package/README.md +394 -1
  2. package/dist/embed3.js +1 -1
  3. package/dist/embed3.js.map +1 -1
  4. package/dist/src/actions/modal/types/index.d.ts +3 -0
  5. package/dist/src/actions/modal/types/index.d.ts.map +1 -1
  6. package/dist/src/api/NinchatClient.d.ts +3 -0
  7. package/dist/src/api/NinchatClient.d.ts.map +1 -1
  8. package/dist/src/api/action/acceptAudience.d.ts +4 -5
  9. package/dist/src/api/action/acceptAudience.d.ts.map +1 -1
  10. package/dist/src/api/action/addMember.d.ts +16 -0
  11. package/dist/src/api/action/addMember.d.ts.map +1 -0
  12. package/dist/src/api/action/assignTranscript.d.ts +14 -0
  13. package/dist/src/api/action/assignTranscript.d.ts.map +1 -0
  14. package/dist/src/api/action/closeSession.d.ts +1 -1
  15. package/dist/src/api/action/createAccess.d.ts +2 -7
  16. package/dist/src/api/action/createAccess.d.ts.map +1 -1
  17. package/dist/src/api/action/createChannel.d.ts +14 -0
  18. package/dist/src/api/action/createChannel.d.ts.map +1 -0
  19. package/dist/src/api/action/createComment.d.ts +1 -1
  20. package/dist/src/api/action/createIdentity.d.ts +1 -1
  21. package/dist/src/api/action/createIdentityWithAuthResetAccess.d.ts +1 -1
  22. package/dist/src/api/action/createQueue.d.ts +14 -0
  23. package/dist/src/api/action/createQueue.d.ts.map +1 -0
  24. package/dist/src/api/action/createSession.d.ts.map +1 -1
  25. package/dist/src/api/action/createTag.d.ts +1 -1
  26. package/dist/src/api/action/deleteIdentity.d.ts +1 -1
  27. package/dist/src/api/action/deleteMessage.d.ts +1 -1
  28. package/dist/src/api/action/deleteTag.d.ts +1 -1
  29. package/dist/src/api/action/describeChannel.d.ts +2 -7
  30. package/dist/src/api/action/describeChannel.d.ts.map +1 -1
  31. package/dist/src/api/action/describeFile.d.ts +9 -2
  32. package/dist/src/api/action/describeFile.d.ts.map +1 -1
  33. package/dist/src/api/action/describeIdentity.d.ts +1 -1
  34. package/dist/src/api/action/describeQueue.d.ts +1 -1
  35. package/dist/src/api/action/describeQueueTranscripts.d.ts +14 -0
  36. package/dist/src/api/action/describeQueueTranscripts.d.ts.map +1 -0
  37. package/dist/src/api/action/describeRealm.d.ts +22 -10
  38. package/dist/src/api/action/describeRealm.d.ts.map +1 -1
  39. package/dist/src/api/action/describeTag.d.ts +1 -1
  40. package/dist/src/api/action/describeTags.d.ts +1 -1
  41. package/dist/src/api/action/describeTranscript.d.ts +14 -0
  42. package/dist/src/api/action/describeTranscript.d.ts.map +1 -0
  43. package/dist/src/api/action/describeUser.d.ts +1 -1
  44. package/dist/src/api/action/endAudience.d.ts +1 -1
  45. package/dist/src/api/action/getAudienceRangeComments.d.ts +1 -1
  46. package/dist/src/api/action/getQueueActivity.d.ts +1 -1
  47. package/dist/src/api/action/getQueueStats.d.ts +19 -0
  48. package/dist/src/api/action/getQueueStats.d.ts.map +1 -0
  49. package/dist/src/api/action/index.d.ts +1 -1
  50. package/dist/src/api/action/index.d.ts.map +1 -1
  51. package/dist/src/api/action/joinChannel.d.ts +9 -11
  52. package/dist/src/api/action/joinChannel.d.ts.map +1 -1
  53. package/dist/src/api/action/partChannel.d.ts +5 -5
  54. package/dist/src/api/action/partChannel.d.ts.map +1 -1
  55. package/dist/src/api/action/registerAudience.d.ts +1 -1
  56. package/dist/src/api/action/removeMember.d.ts +16 -0
  57. package/dist/src/api/action/removeMember.d.ts.map +1 -0
  58. package/dist/src/api/action/requestIdentityAuthResetAccess.d.ts +1 -7
  59. package/dist/src/api/action/requestIdentityAuthResetAccess.d.ts.map +1 -1
  60. package/dist/src/api/action/requestIdentityVerifyAccess.d.ts +1 -1
  61. package/dist/src/api/action/resetIdentityAuth.d.ts +1 -7
  62. package/dist/src/api/action/resetIdentityAuth.d.ts.map +1 -1
  63. package/dist/src/api/action/sendMessage.d.ts.map +1 -1
  64. package/dist/src/api/action/setTranscriptStatus.d.ts +14 -0
  65. package/dist/src/api/action/setTranscriptStatus.d.ts.map +1 -0
  66. package/dist/src/api/action/updateChannel.d.ts +1 -1
  67. package/dist/src/api/action/updateChannel.d.ts.map +1 -1
  68. package/dist/src/api/action/updateDialogue.d.ts +1 -1
  69. package/dist/src/api/action/updateIdentity.d.ts +1 -1
  70. package/dist/src/api/action/updateIdentityAuth.d.ts +1 -1
  71. package/dist/src/api/action/updateMessage.d.ts +1 -1
  72. package/dist/src/api/action/updateQueue.d.ts +1 -1
  73. package/dist/src/api/action/updateRealm.d.ts +19 -0
  74. package/dist/src/api/action/updateRealm.d.ts.map +1 -0
  75. package/dist/src/api/action/updateTag.d.ts +1 -1
  76. package/dist/src/api/action/updateUser.d.ts +1 -1
  77. package/dist/src/api/action/updateUserMessages.d.ts +1 -1
  78. package/dist/src/api/action/verifyIdentity.d.ts +1 -1
  79. package/dist/src/api/event/accessCreated.d.ts +1 -1
  80. package/dist/src/api/event/accessCreated.d.ts.map +1 -1
  81. package/dist/src/api/event/accessFound.d.ts +1 -1
  82. package/dist/src/api/event/accessFound.d.ts.map +1 -1
  83. package/dist/src/api/event/ack.d.ts +4 -0
  84. package/dist/src/api/event/ack.d.ts.map +1 -0
  85. package/dist/src/api/event/audienceRangeCommentContents.d.ts +1 -1
  86. package/dist/src/api/event/audienceRangeCommentContents.d.ts.map +1 -1
  87. package/dist/src/api/event/audienceRegistered.d.ts +1 -1
  88. package/dist/src/api/event/audienceRegistered.d.ts.map +1 -1
  89. package/dist/src/api/event/channelCreated.d.ts +4 -0
  90. package/dist/src/api/event/channelCreated.d.ts.map +1 -0
  91. package/dist/src/api/event/channelFound.d.ts +1 -1
  92. package/dist/src/api/event/channelFound.d.ts.map +1 -1
  93. package/dist/src/api/event/channelJoined.d.ts +1 -1
  94. package/dist/src/api/event/channelJoined.d.ts.map +1 -1
  95. package/dist/src/api/event/channelMemberJoined.d.ts +1 -1
  96. package/dist/src/api/event/channelMemberJoined.d.ts.map +1 -1
  97. package/dist/src/api/event/channelMemberParted.d.ts +1 -1
  98. package/dist/src/api/event/channelMemberParted.d.ts.map +1 -1
  99. package/dist/src/api/event/channelMemberUpdated.d.ts +1 -1
  100. package/dist/src/api/event/channelMemberUpdated.d.ts.map +1 -1
  101. package/dist/src/api/event/channelUpdated.d.ts +20 -3
  102. package/dist/src/api/event/channelUpdated.d.ts.map +1 -1
  103. package/dist/src/api/event/commentCreated.d.ts +1 -1
  104. package/dist/src/api/event/commentCreated.d.ts.map +1 -1
  105. package/dist/src/api/event/dialogueUpdated.d.ts +1 -1
  106. package/dist/src/api/event/dialogueUpdated.d.ts.map +1 -1
  107. package/dist/src/api/event/error.d.ts +1 -1
  108. package/dist/src/api/event/error.d.ts.map +1 -1
  109. package/dist/src/api/event/fileFound.d.ts +1 -1
  110. package/dist/src/api/event/fileFound.d.ts.map +1 -1
  111. package/dist/src/api/event/historyResults.d.ts +1 -1
  112. package/dist/src/api/event/historyResults.d.ts.map +1 -1
  113. package/dist/src/api/event/identityCreated.d.ts +1 -1
  114. package/dist/src/api/event/identityCreated.d.ts.map +1 -1
  115. package/dist/src/api/event/identityDeleted.d.ts +1 -1
  116. package/dist/src/api/event/identityDeleted.d.ts.map +1 -1
  117. package/dist/src/api/event/identityFound.d.ts +1 -1
  118. package/dist/src/api/event/identityFound.d.ts.map +1 -1
  119. package/dist/src/api/event/identityUpdated.d.ts +1 -1
  120. package/dist/src/api/event/identityUpdated.d.ts.map +1 -1
  121. package/dist/src/api/event/index.d.ts +150 -3
  122. package/dist/src/api/event/index.d.ts.map +1 -1
  123. package/dist/src/api/event/jitsiDiscovered.d.ts +1 -1
  124. package/dist/src/api/event/jitsiDiscovered.d.ts.map +1 -1
  125. package/dist/src/api/event/messageReceived.d.ts +3 -2
  126. package/dist/src/api/event/messageReceived.d.ts.map +1 -1
  127. package/dist/src/api/event/messageUpdated.d.ts +1 -1
  128. package/dist/src/api/event/messageUpdated.d.ts.map +1 -1
  129. package/dist/src/api/event/queueActivity.d.ts +1 -1
  130. package/dist/src/api/event/queueActivity.d.ts.map +1 -1
  131. package/dist/src/api/event/queueCreated.d.ts +4 -0
  132. package/dist/src/api/event/queueCreated.d.ts.map +1 -0
  133. package/dist/src/api/event/queueFound.d.ts +1 -1
  134. package/dist/src/api/event/queueFound.d.ts.map +1 -1
  135. package/dist/src/api/event/queueJoined.d.ts +4 -0
  136. package/dist/src/api/event/queueJoined.d.ts.map +1 -0
  137. package/dist/src/api/event/queueMemberJoined.d.ts +4 -0
  138. package/dist/src/api/event/queueMemberJoined.d.ts.map +1 -0
  139. package/dist/src/api/event/queueMemberParted.d.ts +4 -0
  140. package/dist/src/api/event/queueMemberParted.d.ts.map +1 -0
  141. package/dist/src/api/event/queueParted.d.ts +4 -0
  142. package/dist/src/api/event/queueParted.d.ts.map +1 -0
  143. package/dist/src/api/event/queueStatsContents.d.ts +4 -0
  144. package/dist/src/api/event/queueStatsContents.d.ts.map +1 -0
  145. package/dist/src/api/event/queueTranscriptsFound.d.ts +4 -0
  146. package/dist/src/api/event/queueTranscriptsFound.d.ts.map +1 -0
  147. package/dist/src/api/event/queueUpdated.d.ts +1 -1
  148. package/dist/src/api/event/queueUpdated.d.ts.map +1 -1
  149. package/dist/src/api/event/realmFound.d.ts +1 -1
  150. package/dist/src/api/event/realmFound.d.ts.map +1 -1
  151. package/dist/src/api/event/realmJoined.d.ts +4 -0
  152. package/dist/src/api/event/realmJoined.d.ts.map +1 -0
  153. package/dist/src/api/event/realmMemberParted.d.ts +4 -0
  154. package/dist/src/api/event/realmMemberParted.d.ts.map +1 -0
  155. package/dist/src/api/event/realmMemberUpdated.d.ts +1 -1
  156. package/dist/src/api/event/realmMemberUpdated.d.ts.map +1 -1
  157. package/dist/src/api/event/realmQueuesFound.d.ts +1 -1
  158. package/dist/src/api/event/realmQueuesFound.d.ts.map +1 -1
  159. package/dist/src/api/event/realmUpdated.d.ts +4 -0
  160. package/dist/src/api/event/realmUpdated.d.ts.map +1 -0
  161. package/dist/src/api/event/sessionCreated.d.ts.map +1 -1
  162. package/dist/src/api/event/sessionStatusUpdated.d.ts +1 -1
  163. package/dist/src/api/event/sessionStatusUpdated.d.ts.map +1 -1
  164. package/dist/src/api/event/ssoBegun.d.ts +1 -1
  165. package/dist/src/api/event/ssoBegun.d.ts.map +1 -1
  166. package/dist/src/api/event/tagCreated.d.ts +1 -1
  167. package/dist/src/api/event/tagCreated.d.ts.map +1 -1
  168. package/dist/src/api/event/tagDeleted.d.ts +1 -1
  169. package/dist/src/api/event/tagDeleted.d.ts.map +1 -1
  170. package/dist/src/api/event/tagFound.d.ts +1 -1
  171. package/dist/src/api/event/tagFound.d.ts.map +1 -1
  172. package/dist/src/api/event/tagUpdated.d.ts +1 -1
  173. package/dist/src/api/event/tagUpdated.d.ts.map +1 -1
  174. package/dist/src/api/event/tagsFound.d.ts +1 -1
  175. package/dist/src/api/event/tagsFound.d.ts.map +1 -1
  176. package/dist/src/api/event/transcriptContents.d.ts +1 -1
  177. package/dist/src/api/event/transcriptContents.d.ts.map +1 -1
  178. package/dist/src/api/event/transcriptFound.d.ts +4 -0
  179. package/dist/src/api/event/transcriptFound.d.ts.map +1 -0
  180. package/dist/src/api/event/transcriptUpdated.d.ts +22 -0
  181. package/dist/src/api/event/transcriptUpdated.d.ts.map +1 -0
  182. package/dist/src/api/event/userFound.d.ts +1 -1
  183. package/dist/src/api/event/userFound.d.ts.map +1 -1
  184. package/dist/src/api/event/userUpdated.d.ts +1 -1
  185. package/dist/src/api/event/userUpdated.d.ts.map +1 -1
  186. package/dist/src/api/{state.d.ts → slice.d.ts} +3 -3
  187. package/dist/src/api/slice.d.ts.map +1 -0
  188. package/dist/src/api/types/actions.d.ts +130 -3
  189. package/dist/src/api/types/actions.d.ts.map +1 -1
  190. package/dist/src/api/types/attributes.d.ts +5 -0
  191. package/dist/src/api/types/attributes.d.ts.map +1 -1
  192. package/dist/src/api/types/events.d.ts +85 -6
  193. package/dist/src/api/types/events.d.ts.map +1 -1
  194. package/dist/src/api/types/index.d.ts +2 -0
  195. package/dist/src/api/types/index.d.ts.map +1 -1
  196. package/dist/src/api/types/messages.d.ts +2 -0
  197. package/dist/src/api/types/messages.d.ts.map +1 -1
  198. package/dist/src/api/types/properties.d.ts +90 -9
  199. package/dist/src/api/types/properties.d.ts.map +1 -1
  200. package/dist/src/api/types/settings.d.ts +5 -0
  201. package/dist/src/api/types/settings.d.ts.map +1 -1
  202. package/dist/src/{reducers/ninchat/index.d.ts → api/types/state.d.ts} +8 -12
  203. package/dist/src/api/types/state.d.ts.map +1 -0
  204. package/dist/src/{store/types/ninchat.d.ts → api/types/store.d.ts} +26 -12
  205. package/dist/src/api/types/store.d.ts.map +1 -0
  206. package/dist/src/appconfig/index.d.ts +12 -2
  207. package/dist/src/appconfig/index.d.ts.map +1 -1
  208. package/dist/src/components/BrowserNotification/types.d.ts +1 -1
  209. package/dist/src/components/BrowserNotification/types.d.ts.map +1 -1
  210. package/dist/src/components/Send/types/index.d.ts +3 -0
  211. package/dist/src/components/Send/types/index.d.ts.map +1 -1
  212. package/dist/src/components/SendCannedMessages/types/index.d.ts +10 -0
  213. package/dist/src/components/SendCannedMessages/types/index.d.ts.map +1 -1
  214. package/dist/src/embed/schemas/index.d.ts +216 -16
  215. package/dist/src/embed/schemas/index.d.ts.map +1 -1
  216. package/dist/src/embed/types/events.d.ts +20 -3
  217. package/dist/src/embed/types/events.d.ts.map +1 -1
  218. package/dist/src/embed/types/routes.d.ts +10 -1
  219. package/dist/src/embed/types/routes.d.ts.map +1 -1
  220. package/dist/src/middlewares/listener.d.ts +8 -8
  221. package/dist/src/middlewares/ninchat/event.d.ts.map +1 -1
  222. package/dist/src/navigation/actions.d.ts +12 -3
  223. package/dist/src/navigation/actions.d.ts.map +1 -1
  224. package/dist/src/navigation/reducers.d.ts.map +1 -1
  225. package/dist/src/navigation/router.d.ts +7 -1
  226. package/dist/src/navigation/router.d.ts.map +1 -1
  227. package/dist/src/navigation/slice.d.ts.map +1 -1
  228. package/dist/src/navigation/types.d.ts +47 -14
  229. package/dist/src/navigation/types.d.ts.map +1 -1
  230. package/dist/src/reducers/modal/index.d.ts.map +1 -1
  231. package/dist/src/state/ui.d.ts +5 -1
  232. package/dist/src/state/ui.d.ts.map +1 -1
  233. package/dist/src/store/index.d.ts +2 -2
  234. package/dist/src/store/types/index.d.ts +0 -1
  235. package/dist/src/store/types/index.d.ts.map +1 -1
  236. package/dist/src/utils/HighlightRegExp.d.ts +1 -1
  237. package/dist/src/utils/HighlightRegExp.d.ts.map +1 -1
  238. package/dist/src/utils/channels/index.d.ts +9 -0
  239. package/dist/src/utils/channels/index.d.ts.map +1 -0
  240. package/package.json +1 -1
  241. package/dist/src/actions/ninchat/local/index.d.ts +0 -4
  242. package/dist/src/actions/ninchat/local/index.d.ts.map +0 -1
  243. package/dist/src/actions/ninchat/local/types/index.d.ts +0 -15
  244. package/dist/src/actions/ninchat/local/types/index.d.ts.map +0 -1
  245. package/dist/src/api/state.d.ts.map +0 -1
  246. package/dist/src/reducers/ninchat/index.d.ts.map +0 -1
  247. package/dist/src/store/types/ninchat.d.ts.map +0 -1
package/README.md CHANGED
@@ -1 +1,394 @@
1
- TO BE DONE...
1
+ ## Warning: embed3 is a work in progress
2
+
3
+ install using `npm i ninchat-embed` or link main directly from ninchat.com:
4
+
5
+ ```html
6
+ <!DOCTYPE html>
7
+ <html>
8
+ <head>
9
+ <script src="https://ninchat.com/app/embed3.js"></script>
10
+ </head>
11
+ <body>
12
+ <div id="ninchat-container"></div>
13
+ <script>
14
+ const Ninchat = new NinchatEmbed()
15
+
16
+ const options = {
17
+ configKey: SITE_CONFIG_KEY,
18
+ containerId: 'ninchat-container',
19
+ }
20
+
21
+ Ninchat.on(Ninchat.Event.ActivityCount, (data) => {console.info('Activity from Ninchat', data)})
22
+ Ninchat.on(Ninchat.Event.AudienceAccepted, (data) => {console.info('Audience accepted from Ninchat', data)})
23
+ Ninchat.on(Ninchat.Event.AudienceClosed, (data) => {console.info('Audience closed from Ninchat', data)})
24
+ Ninchat.on(Ninchat.Event.AudienceEnded, (data) => {console.info('Audience ended from Ninchat', data)})
25
+ Ninchat.on(Ninchat.Event.Route, (data) => {console.info('Route change from Ninchat', data)})
26
+ Ninchat.on(Ninchat.Event.Notification, (data) => {
27
+ switch (data.type) {
28
+ case Ninchat.NotificationType.MessageReceivedChannel:
29
+ console.info('Channel message was received', data)
30
+ break
31
+ default:
32
+ console.info('Notification from Ninchat', data)
33
+ }
34
+ })
35
+ Ninchat.on(Ninchat.Event.Error, (data) => {console.error('Error from Ninchat', data)})
36
+
37
+ Ninchat.init(options)
38
+ </script>
39
+ </body>
40
+ </html>
41
+ ```
42
+
43
+ ### Site config JSON
44
+
45
+ ```json
46
+ {
47
+ "description": "Site config",
48
+ "default": {
49
+ "variant": "app"
50
+ }
51
+ }
52
+ ```
53
+
54
+ ## Init options
55
+
56
+ | Key | Type | Description |
57
+ | :----------------- | :---------------- | :----------------------------------------------------------------------------------- |
58
+ | `audienceMetadata` | object (optional) | Audience metadata passed to the expert. |
59
+ | `config` | object (optional) | Config used to override subset of the keys obtained via configKey and others. |
60
+ | `configKey` | string | Site config key to be used for initializing. |
61
+ | `configUrls` | array (optional) | List of URL addresses for self-hosted configs. |
62
+ | `containerId` | string | DOM element id for where the chat container is placed. |
63
+ | `postConfigUrls` | array (optional) | List of URL addresses for self-hosted configs loaded via POST request. |
64
+ | `environment` | array (optional) | List of environment keys. 'default' is always used, and can be omited. |
65
+
66
+ ## Functions
67
+
68
+ #### Ninchat.destruct
69
+
70
+ Removes all event listeners and de-initialized Ninchat.
71
+
72
+ ```es6
73
+ const onRemoveNinchat = () => {
74
+ Ninchat.destruct()
75
+ }
76
+ ```
77
+
78
+ #### Ninchat.init
79
+
80
+ Initializes Ninchat, and loads it in an iframe, which is placed inside container.
81
+
82
+ ```es6
83
+ const options = {
84
+ configKey: SITE_CONFIG_KEY,
85
+ containerId: 'ninchat-container',
86
+ }
87
+
88
+ Ninchat.init(options)
89
+ ```
90
+
91
+ #### Ninchat.off
92
+
93
+ Removes a NinchatEvent listener and its callback function.
94
+
95
+ ```es6
96
+ const onNinchatErrorEvent = (data) => {
97
+ console.error('Error from Ninchat', data)
98
+ }
99
+
100
+ Ninchat.off(Ninchat.Event.Error, onNinchatErrorEvent)
101
+ ```
102
+
103
+ #### Ninchat.on
104
+
105
+ Adds a NinchatEvent listener and a callback function.
106
+
107
+ ```es6
108
+ const onNinchatErrorEvent = (data) => {
109
+ console.error('Error from Ninchat', data)
110
+ }
111
+
112
+ Ninchat.on(Ninchat.Event.Error, onNinchatErrorEvent)
113
+ ```
114
+
115
+ ## Enums
116
+
117
+ #### [Ninchat.Event](#events)
118
+
119
+ | Enum value |
120
+ | ----------------------------------------------------------- |
121
+ | [`ActivityCount`](#ninchateventactivitycount) |
122
+ | [`AudienceAccepted`](#ninchateventaudienceaccepted) |
123
+ | [`AudienceClosed`](#ninchateventaudienceclosed) |
124
+ | [`AudienceEnded`](#ninchateventaudienceended) |
125
+ | [`ContainerInitialized`](#ninchateventcontainerinitialized) |
126
+ | [`Error`](#ninchateventerror) |
127
+ | [`Notification`](#ninchateventnotification) |
128
+ | [`Route`](#ninchateventroute) |
129
+
130
+ #### Ninchat.ErrorType
131
+
132
+ When received event is [`Ninchat.Event.Error`](#ninchateventerror),
133
+ the `error_type` property is one of the following:
134
+
135
+ | Enum value |
136
+ | ------------------------ |
137
+ | `ContainerNotFoundError` |
138
+ | `SiteConfigFetchError` |
139
+ | `InvalidConfigKeyError` |
140
+ | `InvalidSiteConfigError` |
141
+
142
+ #### Ninchat.NotificationType
143
+
144
+ When received event is [`Ninchat.Event.Notification`](#ninchateventnotification),
145
+ the `type` property is one of the following:
146
+
147
+ | Enum value |
148
+ | -------------------------------- |
149
+ | `AudienceRegistered` |
150
+ | `MessageReceivedChannel` |
151
+ | `MessageReceivedChannelAudience` |
152
+ | `MessageReceivedChannelJoin` |
153
+ | `MessageReceivedDialogue` |
154
+ | `QueueUpdatedAudienceAcceptPeer` |
155
+ | `QueueUpdatedAudienceRequest` |
156
+
157
+ #### Ninchat.RouteName
158
+
159
+ When received event is [`Ninchat.Event.Route`](#ninchateventroute),
160
+ the `route.name` property is one of the following:
161
+
162
+ | Enum value |
163
+ | ------------------- |
164
+ | `Channel` |
165
+ | `Else` |
166
+ | `Transcript` |
167
+
168
+ ## Events
169
+
170
+ Currently, the following events are supported:
171
+
172
+ #### Ninchat.Event.ActivityCount
173
+
174
+ ```typescript
175
+ {
176
+ event: Ninchat.Event.ActivityCount
177
+ activity: number
178
+ highlights: number
179
+ }
180
+ ```
181
+
182
+ Typical use case for `ActivityCount` is to display activity as a number in host sites favicon.
183
+ `activity` property contains the total activity including `highlights`.
184
+
185
+ `highlights` are activity which has importance based on users settings or their role.
186
+ Eg. highlight can be a name mention or a visitor requesting an audience.
187
+
188
+ #### Ninchat.Event.AudienceAccepted
189
+
190
+ ```typescript
191
+ {
192
+ audience_id: string
193
+ event: Ninchat.Event.AudienceAccepted
194
+ metadata?: []
195
+ }
196
+ ```
197
+
198
+ `AudienceAccepted` event is emitted when a new chat session is started by interaction in current user interface.
199
+
200
+ `metadata` array follows specifications described at [`AudienceRoute`](#audienceroute),
201
+
202
+ #### Ninchat.Event.AudienceClosed
203
+
204
+ ```typescript
205
+ {
206
+ audience_id: string
207
+ event: Ninchat.Event.AudienceClosed
208
+ }
209
+ ```
210
+
211
+ `AudienceClosed` event is emitted when the chat is closed.
212
+
213
+ #### Ninchat.Event.AudienceEnded
214
+
215
+ ```typescript
216
+ {
217
+ audience_id: string
218
+ event: Ninchat.Event.AudienceEnded
219
+ }
220
+ ```
221
+
222
+ `AudienceEnded` event is emitted when the chat session is ended.
223
+
224
+ #### Ninchat.Event.ContainerInitialized
225
+
226
+ ```typescript
227
+ {
228
+ event: Ninchat.Event.ContainerInitialized
229
+ }
230
+ ```
231
+
232
+ #### Ninchat.Event.Error
233
+
234
+ ```typescript
235
+ {
236
+ error_type: string
237
+ event: Ninchat.Event.Error
238
+ }
239
+ ```
240
+
241
+ #### Ninchat.Event.Notification
242
+
243
+ ```typescript
244
+ {
245
+ audio?: boolean
246
+ channel_name?: string
247
+ desktop?: boolean
248
+ event: Ninchat.Event.Notification
249
+ queue_name?: string
250
+ realm_name?: string
251
+ type: Ninchat.NotificationType
252
+ user_name?: string
253
+ }
254
+ ```
255
+
256
+ `Notification` event is emited whenever user would receive either a desktop or an audio notification
257
+ based on users preferences. When Ninchat is embedded, instead of firing a desktop or audio notification,
258
+ a `Notification` event is emited instead.
259
+
260
+ #### Ninchat.Event.Route
261
+
262
+ ```typescript
263
+ {
264
+ event: Ninchat.Event.Route
265
+ route: AudienceRoute | ChannelRoute | ElseRoute | TranscriptRoute
266
+ }
267
+ ```
268
+
269
+ `Route` event is emited whenever users route in Ninchat is changed. Host site can distinquish between different routes based on
270
+ the passed properties. `metadata` in `AudienceRoute` and `TranscriptRoute` contains pre-whitelisted subset of audience customers metadata.
271
+
272
+ ##### AudienceRoute
273
+
274
+ ```typescript
275
+ {
276
+ audience_id: string
277
+ name: Ninchat.RouteName.Channel
278
+ metadata?: []
279
+ params: {
280
+ channel_id: string
281
+ }
282
+ }
283
+ ```
284
+
285
+ `metadata` array contains secure metadata which is exposed to the parent on purpose. Array is used here, since in conversation can be multiple users with metadata.
286
+
287
+ ⚠️ The array is shuffled to prevent misconceptions that index 0 would contain specific users metadata. Since the array is in random order, if there is a need to distinguish between users, an identifying field needs to be added while generating secure metadata.
288
+
289
+ Example: secure metadata containing following `shared` field..
290
+
291
+ ```typescript
292
+ {
293
+ shared: {
294
+ data: {
295
+ CustomerID: 123,
296
+ CustomerName: 'Kathryn Janeway'
297
+ },
298
+ parent: [HOST_SITE_ORIGIN],
299
+ }
300
+ }
301
+ ```
302
+
303
+ ..would lead to a following AudienceRoute event:
304
+
305
+ ```typescript
306
+ {
307
+ audience_id: string
308
+ name: Ninchat.RouteName.Channel
309
+ metadata?: [
310
+ {
311
+ CustomerID: 123,
312
+ CustomerName: 'Kathryn Janeway'
313
+ }
314
+ ],
315
+ params: {
316
+ channel_id: string
317
+ }
318
+ }
319
+ ```
320
+
321
+ ##### ChannelRoute
322
+
323
+ ```typescript
324
+ {
325
+ name: Ninchat.RouteName.Channel
326
+ params: {
327
+ channel_id: string
328
+ }
329
+ }
330
+ ```
331
+
332
+ ##### ElseRoute
333
+
334
+ ```typescript
335
+ {
336
+ name: Ninchat.RouteName.Else
337
+ }
338
+ ```
339
+
340
+ ##### TranscriptRoute
341
+
342
+ ```typescript
343
+ {
344
+ audience_id: string
345
+ name: Ninchat.RouteName.Transcript
346
+ metadata?: []
347
+ params: {
348
+ audience_id: string
349
+ }
350
+ }
351
+ ```
352
+
353
+ `metadata` array follows specifications described at [`AudienceRoute`](#audienceroute),
354
+
355
+ ## Examples
356
+
357
+ ### SSO
358
+
359
+ SSO using email address:
360
+
361
+ ```es6
362
+ const options = {
363
+ config: {
364
+ default: {
365
+ sso: {
366
+ email: EMAIL_ADDRESS,
367
+ type: 'email',
368
+ }
369
+ },
370
+ },
371
+ configKey: SITE_CONFIG_KEY,
372
+ containerId: 'ninchat-container',
373
+ }
374
+
375
+ Ninchat.init(options)
376
+ ```
377
+
378
+ SSO using provider name:
379
+
380
+ ```es6
381
+ const options = {
382
+ config: {
383
+ default: {
384
+ sso: {
385
+ name: PROVIDER_NAME,
386
+ }
387
+ },
388
+ },
389
+ configKey: SITE_CONFIG_KEY,
390
+ containerId: 'ninchat-container',
391
+ }
392
+
393
+ Ninchat.init(options)
394
+ ```
package/dist/embed3.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(self,(function(){return function(){var e={435:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.getEnvironment=void 0;var i,o=n(491),r="production",a=null!=(i=o.environments[r])?i:{},s=a.apiHost,c=a.apiVersion;t.getEnvironment=function(){return Object.assign({apiHost:s,apiMode:r,apiVersion:c,devServerIp:""},"",{staticEmbedURL:"https://ninchat.com/app",staticLocaleURL:"https://ninchat.com/new",staticSiteURL:"https://ninchat.com/new",target:"embed"})}},546:function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationType=void 0,t.NotificationType=n,function(e){e.AudienceRegistered="audience_registered",e.MessageReceivedChannel="message_received/channel",e.MessageReceivedChannelAudience="message_received/channel/audience",e.MessageReceivedChannelJoin="message_received/channel/join",e.MessageReceivedDialogue="message_received/dialogue",e.QueueUpdatedAudienceAcceptPeer="queue_updated/audience_accept_peer",e.QueueUpdatedAudienceRequest="queue_updated/audience_request"}(n||(t.NotificationType=n={}))},275:function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.EmbedErrorType=void 0,t.EmbedErrorType=n,function(e){e.ContainerNotFoundError="container_not_found",e.SiteConfigFetchError="site_config_fetch_error",e.InvalidConfigKeyError="invalid_config_key",e.InvalidSiteConfigError="invalid_site_config"}(n||(t.EmbedErrorType=n={}))},79:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.EmbedEvent=void 0,Object.defineProperty(t,"EmbedNotificationType",{enumerable:!0,get:function(){return o.NotificationType}});var i,o=n(546);t.EmbedEvent=i,function(e){e.ActivityCount="activity_count",e.ContainerInitialized="container_initialized",e.Error="error",e.Notification="notification",e.Route="route"}(i||(t.EmbedEvent=i={}))},582:function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.RouteName=void 0,t.RouteName=n,function(e){e.Channel="Channel",e.Else="Else"}(n||(t.RouteName=n={}))},100:function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},870:function(e,t,n){var i=n(739);function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,i(o.key),o)}}e.exports=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},600:function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},64:function(e,t,n){var i=n(425).default;e.exports=function(e,t){if("object"!==i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!==i(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},739:function(e,t,n){var i=n(425).default,o=n(64);e.exports=function(e){var t=o(e,"string");return"symbol"===i(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},425:function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},491:function(e){"use strict";e.exports=JSON.parse('{"name":"NinchatApp","displayName":"NinchatApp","environments":{"development":{"apiHost":"api.luupi.net","apiVersion":"v2"},"production":{"apiHost":"api.ninchat.com","apiVersion":"v2"}},"routes":{"public":{"ForgotPassword":"/x/forgot-password","Login":"/x/login","Register":"/x/register","ResetPassword":"/x/reset/:token","SSOBegin":"/x/sso/:name","SSOLogin":"/x/sso/:type/:name/:access_key"},"private":{"Channel":"/c/:channel_id","ChannelInvite":"/c/:channel_id/invite","ChannelSettings":"/c/:channel_id/settings(/:tab)","Dialogue":"/p/:dialogue_id","File":"/x/file/:file_id","Home":"/x/home","Playground":"/playground/:component","Queue":"/q/:queue_id","QueueSettings":"/q/:queue_id/settings(/:tab)","Realm":"/r/:realm_id(/:tab)","ScheduledAppointments":"/x/scheduled-appointments","Settings":"/x/settings(/:tab)","Transcript":"/t/audience/:audience_id"},"modal":{"ChannelInviteModal":"/i/:access_key"}}}')}},t={};function n(i){var o=t[i];if(void 0!==o)return o.exports;var r=t[i]={exports:{}};return e[i](r,r.exports,n),r.exports}var i={};return function(){var e=i,t=n(600);Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.NinchatEmbed=void 0;var o=t(n(100)),r=t(n(870)),a=n(79),s=n(275),c=n(582),u=n(435),l=function(){function e(){var t,n=this;(0,o.default)(this,e),this.ENVIRONMENT=(0,u.getEnvironment)(),this.EMBED_HOST=this.ENVIRONMENT.staticEmbedURL,this.EMBED_ORIGIN=this.EMBED_HOST&&new URL(this.EMBED_HOST).origin,this.ENTRY_POINT=null!=(t=this.EMBED_HOST)&&t.includes("localhost")?"embed3.html":"embed3",this.Event=a.EmbedEvent,this.ErrorType=s.EmbedErrorType,this.NotificationType=a.EmbedNotificationType,this.RouteName=c.RouteName,this.callbacks={},this.onMessage=function(e){e.origin===n.EMBED_ORIGIN&&n.emit(JSON.parse(e.data))},window.addEventListener("message",this.onMessage,!1)}return(0,r.default)(e,[{key:"emit",value:function(e){this.callbacks[e.event]&&this.callbacks[e.event].forEach((function(t){t(e)}))}},{key:"destruct",value:function(){window.removeEventListener("message",this.onMessage),this.callbacks={}}},{key:"off",value:function(e,t){if(this.callbacks[e])for(var n=0;n<this.callbacks[e].length;n+=1)if(this.callbacks[e][n]===t){this.callbacks[e].splice(n,1);break}}},{key:"on",value:function(e,t){this.callbacks[e]||=[],this.callbacks[e].push(t)}},{key:"init",value:function(e){var t=e.audienceMetadata,n=e.config,i=e.configKey,o=e.configUrls,r=e.containerId,c=e.environment,u=e.postConfigUrls,l=window.location.origin,d=document.querySelector("#"+r),f=new URLSearchParams;t&&f.set("audienceMetadata",JSON.stringify(t)),n&&f.set("config",JSON.stringify(n)),i&&f.set("configKey",JSON.stringify(i)),o&&f.set("configUrls",JSON.stringify(o)),c&&f.set("environment",JSON.stringify(c)),u&&f.set("postConfigUrls",JSON.stringify(u));var p=new URL(this.EMBED_HOST+"/"+this.ENTRY_POINT);if(p.searchParams.set("targetOrigin",l),d){var v=document.createElement("iframe");v.name="ninchat?"+f.toString(),v.allow="camera;microphone",v.src=p.toString(),v.style.border="0",v.style.height="100%",v.style.width="100%",d.appendChild(v)}else{var m={container_id:r,error_type:s.EmbedErrorType.ContainerNotFoundError,event:a.EmbedEvent.Error,targetOrigin:l};this.emit(m)}}}]),e}();e.NinchatEmbed=l;var d=l;e.default=d}(),i}()}));
1
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var i=t();for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}(self,(function(){return function(){var e={435:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.setEnvironment=t.getEnvironment=void 0;var n,o=i(491),r="production",a=null!=(n=o.environments[r])?n:{},s=a.apiHost,c=a.apiVersion,u=Object.assign({apiHost:s,apiMode:r,apiVersion:c,devServerIp:""},{},{staticEmbedURL:"https://ninchat.com/app",staticLocaleURL:"https://ninchat.com/new",staticSiteURL:"https://ninchat.com/new",target:"embed",variant:""});t.setEnvironment=function(e){var t,i;u.apiHost=null==(t=o.environments[e.apiMode])?void 0:t.apiHost,u.apiMode=e.apiMode,u.apiVersion=null==(i=o.environments[e.apiMode])?void 0:i.apiVersion,u.staticLocaleURL="https://ninchat.com/new",u.staticSiteURL="https://ninchat.com/new",u.target="embed"},t.getEnvironment=function(){return u}},546:function(e,t){var i;Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationType=void 0,t.NotificationType=i,function(e){e.MessageReceivedChannel="message_received/channel",e.MessageReceivedChannelAudience="message_received/channel/audience",e.MessageReceivedChannelJoin="message_received/channel/join",e.MessageReceivedDialogue="message_received/dialogue",e.QueueActivity="queue_activity",e.QueueUpdatedAudienceAcceptPeer="queue_updated/audience_accept_peer",e.QueueUpdatedAudienceRequest="queue_updated/audience_request"}(i||(t.NotificationType=i={}))},275:function(e,t){var i;Object.defineProperty(t,"__esModule",{value:!0}),t.EmbedErrorType=void 0,t.EmbedErrorType=i,function(e){e.ContainerNotFoundError="container_not_found",e.SiteConfigFetchError="site_config_fetch_error",e.InvalidConfigKeyError="invalid_config_key",e.InvalidSiteConfigError="invalid_site_config"}(i||(t.EmbedErrorType=i={}))},79:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.EmbedEvent=void 0,Object.defineProperty(t,"EmbedNotificationType",{enumerable:!0,get:function(){return o.NotificationType}});var n,o=i(546);t.EmbedEvent=n,function(e){e.ActivityCount="activity_count",e.AudienceAccepted="audience_accepted",e.AudienceClosed="audience_closed",e.AudienceEnded="audience_ended",e.ContainerInitialized="container_initialized",e.Error="error",e.Notification="notification",e.Route="route"}(n||(t.EmbedEvent=n={}))},582:function(e,t){var i;Object.defineProperty(t,"__esModule",{value:!0}),t.RouteName=void 0,t.RouteName=i,function(e){e.Channel="Channel",e.Else="Else",e.Transcript="Transcript"}(i||(t.RouteName=i={}))},100:function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},870:function(e,t,i){var n=i(739);function o(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,n(o.key),o)}}e.exports=function(e,t,i){return t&&o(e.prototype,t),i&&o(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},600:function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},64:function(e,t,i){var n=i(425).default;e.exports=function(e,t){if("object"!==n(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var o=i.call(e,t||"default");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},739:function(e,t,i){var n=i(425).default,o=i(64);e.exports=function(e){var t=o(e,"string");return"symbol"===n(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},425:function(e){function t(i){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(i)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},491:function(e){"use strict";e.exports=JSON.parse('{"name":"NinchatApp","displayName":"NinchatApp","environments":{"development":{"apiHost":"api.luupi.net","apiVersion":"v2"},"production":{"apiHost":"api.ninchat.com","apiVersion":"v2"}},"routes":{"public":{"ForgotPassword":"/x/forgot-password","Login":"/x/login","LoginSign":"/x/login-sign/(:user_id)/:master_key_type/:master_sign","Register":"/x/register","ResetPassword":"/x/reset/:token","SSOBegin":"/x/sso/:name(/?/*access_url)","SSOLogin":"/x/sso/:type/:name/:access_key(/*access_url)"},"private":{"Channel":"/c/:channel_id","ChannelSettings":"/c/:channel_id/settings(/:tab)","Dialogue":"/p/:dialogue_id","File":"/x/file/:file_id","Home":"/x/home","Playground":"/playground/:component","Queue":"/q/:queue_id","QueueSettings":"/q/:queue_id/settings(/:tab)","QueueStatistics":"/q/:queue_id/statistics(/:tab)(/:start)(/:end)(/:group)(/:timezone_a)(/:timezone_b)(/:timezone_c)","Realm":"/r/:realm_id(/:tab)","RegisteredAudience":"/t/registered/:queue_id/:audience_id","ScheduledAppointments":"/x/scheduled-appointments","Settings":"/x/settings(/:tab)","Transcript":"/t/audience/:audience_id"},"modal":{"ChannelInviteModal":"/i/:access_key"}}}')}},t={};function i(n){var o=t[n];if(void 0!==o)return o.exports;var r=t[n]={exports:{}};return e[n](r,r.exports,i),r.exports}var n={};return function(){var e=n,t=i(600);Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.NinchatEmbed=void 0;var o=t(i(100)),r=t(i(870)),a=i(79),s=i(275),c=i(582),u=i(435),d=function(){function e(){var t,i=this;(0,o.default)(this,e),this.ENVIRONMENT=(0,u.getEnvironment)(),this.EMBED_HOST=this.ENVIRONMENT.staticEmbedURL,this.EMBED_ORIGIN=this.EMBED_HOST&&new URL(this.EMBED_HOST).origin,this.ENTRY_POINT=null!=(t=this.EMBED_HOST)&&t.includes("localhost")?"embed3.html":"embed3",this.Event=a.EmbedEvent,this.ErrorType=s.EmbedErrorType,this.NotificationType=a.EmbedNotificationType,this.RouteName=c.RouteName,this.callbacks={},this.onMessage=function(e){e.origin===i.EMBED_ORIGIN&&i.emit(JSON.parse(e.data))},window.addEventListener("message",this.onMessage,!1)}return(0,r.default)(e,[{key:"emit",value:function(e){this.callbacks[e.event]&&this.callbacks[e.event].forEach((function(t){t(e)}))}},{key:"destruct",value:function(){window.removeEventListener("message",this.onMessage),this.callbacks={}}},{key:"off",value:function(e,t){if(this.callbacks[e])for(var i=0;i<this.callbacks[e].length;i+=1)if(this.callbacks[e][i]===t){this.callbacks[e].splice(i,1);break}}},{key:"on",value:function(e,t){this.callbacks[e]||=[],this.callbacks[e].push(t)}},{key:"init",value:function(e){var t=e.audienceMetadata,i=e.config,n=e.configKey,o=e.configUrls,r=e.containerId,c=e.environment,u=e.postConfigUrls,d=window.location.origin,l=document.querySelector("#"+r),p=new URLSearchParams;t&&p.set("audienceMetadata",JSON.stringify(t)),i&&p.set("config",JSON.stringify(i)),n&&p.set("configKey",JSON.stringify(n)),o&&p.set("configUrls",JSON.stringify(o)),c&&p.set("environment",JSON.stringify(c)),u&&p.set("postConfigUrls",JSON.stringify(u));var f=new URL(this.EMBED_HOST+"/"+this.ENTRY_POINT);if(f.searchParams.set("targetOrigin",d),l){var v=document.createElement("iframe");v.name="ninchat?"+p.toString(),v.allow="camera;microphone;clipboard-write",v.src=f.toString(),v.style.border="0",v.style.height="100%",v.style.width="100%",l.appendChild(v)}else{var m={container_id:r,error_type:s.EmbedErrorType.ContainerNotFoundError,event:a.EmbedEvent.Error,targetOrigin:d};this.emit(m)}}}]),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AAKyB,UAAUb,IAG1CC,GACAS,EAAaE,IAAI,YAAaxB,KAAKyB,UAAUZ,IAG7CC,GACAQ,EAAaE,IAAI,aAAcxB,KAAKyB,UAAUX,IAG9CE,GACAM,EAAaE,IAAI,cAAexB,KAAKyB,UAAUT,IAG/CC,GACAK,EAAaE,IAAI,iBAAkBxB,KAAKyB,UAAUR,IAGtD,IAAMS,EAAY,IAAIrC,IAAOF,KAAKD,WAAU,IAAIC,KAAKI,aAKrD,GAFAmC,EAAUJ,aAAaE,IAAI,eAAgBlC,GAEvC6B,EAAW,CACX,IAAMQ,EAASP,SAASQ,cAAc,UACtCD,EAAOE,KAAI,WAAcP,EAAaQ,WACtCH,EAAOI,MAAQ,oBACfJ,EAAOK,IAAMN,EAAUI,WACvBH,EAAOM,MAAMC,OAAS,IACtBP,EAAOM,MAAME,OAAS,OACtBR,EAAOM,MAAMG,MAAQ,OACrBjB,EAAUkB,YAAYV,EAC1B,KAAO,CACH,IAAMW,EAA0C,CAC5CC,aAAcxB,EACdyB,WAAYlG,EAAAA,eAAemG,uBAC3B3C,MAAOvD,EAAAA,WAAWmG,MAClBC,aAAcrD,GAGlBH,KAAKY,KAAKuC,EACd,CACJ,KAAC,EAzHoB,GAyHpB,uBAOUvD,EAAY,W","sources":["webpack://ninchat-embed/webpack/universalModuleDefinition","webpack://ninchat-embed/../../src/appconfig/index.ts","webpack://ninchat-embed/../../src/components/BrowserNotification/types.ts","webpack://ninchat-embed/../../src/embed/types/errorTypes.ts","webpack://ninchat-embed/../../src/embed/types/events.ts","webpack://ninchat-embed/../../src/embed/types/routes.ts","webpack://ninchat-embed/../../node_modules/@babel/runtime/helpers/classCallCheck.js","webpack://ninchat-embed/../../node_modules/@babel/runtime/helpers/createClass.js","webpack://ninchat-embed/../../node_modules/@babel/runtime/helpers/interopRequireDefault.js","webpack://ninchat-embed/../../node_modules/@babel/runtime/helpers/toPrimitive.js","webpack://ninchat-embed/../../node_modules/@babel/runtime/helpers/toPropertyKey.js","webpack://ninchat-embed/../../node_modules/@babel/runtime/helpers/typeof.js","webpack://ninchat-embed/webpack/bootstrap","webpack://ninchat-embed/../../src/embed/index.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse {\n\t\tvar a = factory();\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(self, function() {\nreturn ","import {environments} from '../../app.json'\n\ntype Environment = 'development' | 'production'\ntype Target = 'app' | 'embed' | 'sdk'\ntype Variant = 'live' | 'stage'\n\nexport interface AppEnvironment {\n apiHost: string\n apiMode: Environment\n apiVersion: string\n devServerIp?: string\n target: Target\n staticEmbedURL: string | null\n staticLocaleURL: string | null\n staticSiteURL: string | null\n siteSecret?: string\n}\n\nconst mode: Environment = process.env.MODE as Environment\nconst apiMode: Environment = (process.env.API || mode) as Environment\nconst devServerIp: string = process.env.DEV_SERVER_IP as string\nconst siteSecret: string = process.env.SITE_SECRET as string\nconst target: Target = process.env.TARGET as Target\nconst variant: Variant = process.env.VARIANT as Variant\n\nconst isNative = process.env.PLATFORM === 'native'\nconst isProduction = mode === 'production'\nconst isWeb = process.env.PLATFORM === 'web'\n\nconst dir = variant === 'stage' ? 'stage/new' : 'new'\nconst embedDir = variant === 'stage' ? 'stage/app' : 'app'\n\nconst {\n apiHost,\n apiVersion,\n} = environments[apiMode] ?? {}\n\n/* eslint-disable indent */\nconst staticLocaleURL =\n isWeb ?\n isProduction ? `https://ninchat.com/${dir}` : 'http://localhost:8080'\n :\n isNative ?\n isProduction ? `https://ninchat.com/${dir}` : `http://${devServerIp}:8082`\n :\n null\n\nconst staticSiteURL =\n isNative ?\n isProduction ? 'https://ninchat.com' : `http://${devServerIp}:8082`\n :\n isProduction ? `https://ninchat.com/${dir}` : 'http://localhost:8082'\n\nconst staticEmbedURL =\n isNative ?\n isProduction ? 'https://ninchat.com' : `http://${devServerIp}:8082`\n :\n isProduction ? `https://ninchat.com/${embedDir}` : 'http://localhost:8082'\n/* eslint-enable indent */\n\nexport const getEnvironment = (): AppEnvironment => ({\n apiHost,\n apiMode,\n apiVersion,\n devServerIp,\n ...siteSecret && {siteSecret},\n staticEmbedURL,\n staticLocaleURL,\n staticSiteURL,\n target,\n})\n","import {\n AnyAction,\n ListenerEffectAPI,\n UnsubscribeListener,\n} from '@reduxjs/toolkit'\nimport {\n AppDispatch,\n RootState,\n} from '../../store'\nimport {NinchatClientPromiseValue} from '../../api/NinchatClient'\n\nexport type EffectArgs = {\n action: AnyAction\n listenerApi: ListenerEffectAPI<RootState, AppDispatch>\n}\n\nexport type EffectProcessArgs = {\n flushNotificationQueue: () => void\n ignoreIdle?: boolean\n listener?: Listener\n notificationQueue: NotificationQueueEntry[]\n} & EffectArgs\n\nexport type EffectRetval = [NotificationType, NinchatClientPromiseValue]\n\nexport type Listener = {\n effects: Map<NotificationKey, (args: EffectArgs) => EffectRetval>\n unsubscribe: UnsubscribeListener\n}\n\nexport type NotificationEvent = {\n audio?: boolean\n channel_name?: string\n desktop?: boolean\n message?: string\n queue_name?: string\n realm_name?: string\n type: NotificationType\n user_name?: string\n}\n\nexport type NotificationKey =\n 'ignore_idle' | 'require_interaction' |\n 'private' | 'highlight' | 'channel_join' | 'channel' | 'audience_queue' | 'audience_queue_picked' | 'audience' | 'audience_register' |\n 'private_audio' | 'highlight_audio' | 'channel_join_audio' | 'channel_audio' | 'audience_queue_audio' | 'audience_queue_picked_audio' | 'audience_audio' | 'audience_register_audio'\n\nexport type NotificationQueueEntry = {\n audio: boolean\n desktop: boolean\n payload: NinchatClientPromiseValue\n type: NotificationType\n}\n\nexport enum NotificationType {\n AudienceRegistered = 'audience_registered',\n MessageReceivedChannel = 'message_received/channel',\n MessageReceivedChannelAudience = 'message_received/channel/audience',\n MessageReceivedChannelJoin = 'message_received/channel/join',\n MessageReceivedDialogue = 'message_received/dialogue',\n QueueUpdatedAudienceAcceptPeer = 'queue_updated/audience_accept_peer',\n QueueUpdatedAudienceRequest = 'queue_updated/audience_request',\n}\n","export enum EmbedErrorType {\n ContainerNotFoundError = 'container_not_found',\n SiteConfigFetchError = 'site_config_fetch_error',\n InvalidConfigKeyError = 'invalid_config_key',\n InvalidSiteConfigError = 'invalid_site_config'\n}\n","import {\n AudienceRoute,\n ChannelRoute,\n ElseRoute,\n} from './routes'\nimport {\n NotificationEvent as BrowserNotificationEvent,\n NotificationType,\n} from 'components/BrowserNotification/types'\nimport {EmbedErrorEvents} from './errorEvents'\nimport {NinchatEmbedConfig} from './'\n\nexport enum EmbedEvent {\n ActivityCount = 'activity_count',\n ContainerInitialized = 'container_initialized',\n Error = 'error',\n Notification = 'notification',\n Route = 'route'\n}\n\nexport {NotificationType as EmbedNotificationType}\n\nexport type BaseEvent = NinchatEmbedConfig\n\nexport interface ActivityCountEvent extends BaseEvent {\n event: EmbedEvent.ActivityCount\n activity: number\n highlights: number\n}\n\nexport interface ContainerInitializedEvent extends BaseEvent {\n event: EmbedEvent.ContainerInitialized\n}\n\nexport interface NotificationEvent extends BaseEvent, BrowserNotificationEvent {\n event: EmbedEvent.Notification\n}\n\nexport interface RouteEvent extends BaseEvent {\n event: EmbedEvent.Route\n route: AudienceRoute | ChannelRoute | ElseRoute\n}\n\nexport type EmbedEvents =\n ActivityCountEvent |\n ContainerInitializedEvent |\n EmbedErrorEvents |\n NotificationEvent |\n RouteEvent\n","import {\n AudienceID,\n ChannelID,\n} from 'api/types/properties'\n\nexport enum RouteName {\n Channel = 'Channel',\n Else = 'Else',\n}\n\nexport type ChannelRoute = {\n name: RouteName.Channel\n params: {\n channel_id: ChannelID\n }\n}\n\nexport type AudienceRoute = {\n audience_id: AudienceID\n name: RouteName.Channel\n metadata?: Record<string, unknown>[]\n params: {\n channel_id: ChannelID\n }\n}\n\nexport type ElseRoute = {\n name: RouteName.Else\n}\n","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\nmodule.exports = _classCallCheck, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var toPropertyKey = require(\"./toPropertyKey.js\");\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nmodule.exports = _createClass, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\nmodule.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nmodule.exports = _toPrimitive, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nvar toPrimitive = require(\"./toPrimitive.js\");\nfunction _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}\nmodule.exports = _toPropertyKey, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(obj);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","import {\n EmbedEvent,\n EmbedEvents,\n EmbedNotificationType,\n} from './types/events'\nimport {\n NinchatCallbacks,\n NinchatEventCallback,\n NinchatOptions,\n} from './types'\nimport {ContainerNotFoundErrorEvent} from './types/errorEvents'\nimport {EmbedErrorType} from './types/errorTypes'\nimport {RouteName} from './types/routes'\nimport {getEnvironment} from 'appconfig'\n\nexport class NinchatEmbed {\n readonly ENVIRONMENT = getEnvironment()\n\n readonly EMBED_HOST = this.ENVIRONMENT.staticEmbedURL\n\n readonly EMBED_ORIGIN = this.EMBED_HOST && new URL(this.EMBED_HOST).origin\n\n readonly ENTRY_POINT = this.EMBED_HOST?.includes('localhost') ? 'embed3.html' : 'embed3'\n\n public readonly Event = EmbedEvent\n\n public readonly ErrorType = EmbedErrorType\n\n public readonly NotificationType = EmbedNotificationType\n\n public readonly RouteName = RouteName\n\n private callbacks = <NinchatCallbacks>{}\n\n private emit(event: EmbedEvents) {\n if (this.callbacks[event.event]) {\n this.callbacks[event.event].forEach((callback) => {\n callback(event)\n })\n }\n }\n\n private onMessage = (event: MessageEvent) => {\n if (event.origin === this.EMBED_ORIGIN) {\n this.emit(JSON.parse(event.data))\n }\n }\n\n public destruct() {\n window.removeEventListener('message', this.onMessage)\n this.callbacks = <NinchatCallbacks>{}\n }\n\n public off(event: EmbedEvent, callback: NinchatEventCallback) {\n if (this.callbacks[event]) {\n for (let i = 0; i < this.callbacks[event].length; i += 1) {\n if (this.callbacks[event][i] === callback) {\n this.callbacks[event].splice(i, 1)\n break\n }\n }\n }\n }\n\n public on(event: EmbedEvent, callback: NinchatEventCallback) {\n this.callbacks[event] ||= []\n this.callbacks[event].push(callback)\n }\n\n public init(options: NinchatOptions) {\n const {\n audienceMetadata,\n config,\n configKey,\n configUrls,\n containerId,\n environment,\n postConfigUrls,\n } = options\n\n const {origin} = window.location\n\n const container = document.querySelector(`#${containerId}`)\n\n // Params that are NOT sent to server via query (placed after #)\n // TODO: validate via Zod\n const searchParams = new URLSearchParams()\n\n if (audienceMetadata) {\n searchParams.set('audienceMetadata', JSON.stringify(audienceMetadata))\n }\n\n if (config) {\n searchParams.set('config', JSON.stringify(config))\n }\n\n if (configKey) {\n searchParams.set('configKey', JSON.stringify(configKey))\n }\n\n if (configUrls) {\n searchParams.set('configUrls', JSON.stringify(configUrls))\n }\n\n if (environment) {\n searchParams.set('environment', JSON.stringify(environment))\n }\n\n if (postConfigUrls) {\n searchParams.set('postConfigUrls', JSON.stringify(postConfigUrls))\n }\n\n const iframeUrl = new URL(`${this.EMBED_HOST}/${this.ENTRY_POINT}`)\n\n // Params that ARE sent to server via query\n iframeUrl.searchParams.set('targetOrigin', origin)\n\n if (container) {\n const iframe = document.createElement('iframe')\n iframe.name = `ninchat?${searchParams.toString()}`\n iframe.allow = 'camera;microphone'\n iframe.src = iframeUrl.toString()\n iframe.style.border = '0'\n iframe.style.height = '100%'\n iframe.style.width = '100%'\n container.appendChild(iframe)\n } else {\n const errorEvent: ContainerNotFoundErrorEvent = {\n container_id: containerId,\n error_type: EmbedErrorType.ContainerNotFoundError,\n event: EmbedEvent.Error,\n targetOrigin: origin,\n }\n\n this.emit(errorEvent)\n }\n }\n\n constructor() {\n window.addEventListener('message', this.onMessage, false)\n }\n}\n\nexport default NinchatEmbed\n\n"],"names":["root","factory","exports","module","define","amd","a","i","self","apiMode","process","environments","apiHost","apiVersion","devServerIp","staticEmbedURL","staticLocaleURL","staticSiteURL","target","NotificationType","EmbedErrorType","EmbedEvent","RouteName","instance","Constructor","TypeError","__esModule","toPropertyKey","_defineProperties","props","length","descriptor","enumerable","configurable","writable","Object","defineProperty","key","protoProps","staticProps","prototype","obj","_typeof","input","hint","prim","Symbol","toPrimitive","undefined","res","call","String","Number","arg","iterator","constructor","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","NinchatEmbed","ENVIRONMENT","getEnvironment","EMBED_HOST","this","EMBED_ORIGIN","URL","origin","ENTRY_POINT","includes","Event","ErrorType","EmbedNotificationType","callbacks","onMessage","event","emit","JSON","parse","data","window","addEventListener","forEach","callback","removeEventListener","splice","push","options","audienceMetadata","config","configKey","configUrls","containerId","environment","postConfigUrls","location","container","document","querySelector","searchParams","URLSearchParams","set","stringify","iframeUrl","iframe","createElement","name","toString","allow","src","style","border","height","width","appendChild","errorEvent","container_id","error_type","ContainerNotFoundError","Error","targetOrigin"],"sourceRoot":""}
1
+ {"version":3,"file":"embed3.js","mappings":"CAAA,SAA2CA,EAAMC,GAChD,GAAsB,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,SACb,GAAqB,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,OACP,CACJ,IAAIK,EAAIL,IACR,IAAI,IAAIM,KAAKD,GAAuB,iBAAZJ,QAAuBA,QAAUF,GAAMO,GAAKD,EAAEC,EACvE,CACA,CATD,CASGC,MAAM,WACT,O,gICVA,IAA2C,EAA3C,SAoBMC,EAAwBC,aAa9B,EAGyB,OAHzB,EAGIC,EAAAA,aAAaF,IAAQ,EAAI,CAAC,EAF1BG,EAAO,EAAPA,QACAC,EAAU,E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aAAcvB,KAAKwB,UAAUV,IAG9CjF,GACAwF,EAAaE,IAAI,cAAevB,KAAKwB,UAAU3F,IAG/CmF,GACAK,EAAaE,IAAI,iBAAkBvB,KAAKwB,UAAUR,IAGtD,IAAMS,EAAY,IAAIpC,IAAOF,KAAKD,WAAU,IAAIC,KAAKI,aAKrD,GAFAkC,EAAUJ,aAAaE,IAAI,eAAgBjC,GAEvC4B,EAAW,CACX,IAAMQ,EAASP,SAASQ,cAAc,UACtCD,EAAOE,KAAI,WAAcP,EAAaQ,WACtCH,EAAOI,MAAQ,oCACfJ,EAAOK,IAAMN,EAAUI,WACvBH,EAAOM,MAAMC,OAAS,IACtBP,EAAOM,MAAME,OAAS,OACtBR,EAAOM,MAAMG,MAAQ,OACrBjB,EAAUkB,YAAYV,EAC1B,KAAO,CACH,IAAMW,EAA0C,CAC5CC,aAAcvB,EACdwB,WAAYjG,EAAAA,eAAekG,uBAC3B1C,MAAOvD,EAAAA,WAAWkG,MAClBC,aAAcpD,GAGlBH,KAAKY,KAAKsC,EACd,CACJ,KAAC,EAzHoB,GAyHpB,uBAOUtD,EAAY,W","sources":["webpack://ninchat-embed/webpack/universalModuleDefinition","webpack://ninchat-embed/../../src/appconfig/index.ts","webpack://ninchat-embed/../../src/components/BrowserNotification/types.ts","webpack://ninchat-embed/../../src/embed/types/errorTypes.ts","webpack://ninchat-embed/../../src/embed/types/events.ts","webpack://ninchat-embed/../../src/embed/types/routes.ts","webpack://ninchat-embed/../../node_modules/@babel/runtime/helpers/classCallCheck.js","webpack://ninchat-embed/../../node_modules/@babel/runtime/helpers/createClass.js","webpack://ninchat-embed/../../node_modules/@babel/runtime/helpers/interopRequireDefault.js","webpack://ninchat-embed/../../node_modules/@babel/runtime/helpers/toPrimitive.js","webpack://ninchat-embed/../../node_modules/@babel/runtime/helpers/toPropertyKey.js","webpack://ninchat-embed/../../node_modules/@babel/runtime/helpers/typeof.js","webpack://ninchat-embed/webpack/bootstrap","webpack://ninchat-embed/../../src/embed/index.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse {\n\t\tvar a = factory();\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(self, function() {\nreturn ","import {environments} from '../../app.json'\n\nexport type Environment = 'development' | 'production'\ntype Target = 'app' | 'embed'\nexport type Variant = 'live' | 'stage'\n\nexport interface AppEnvironment {\n apiHost: string\n apiMode: Environment\n apiVersion: string\n devServerIp?: string\n target: Target\n staticEmbedURL: string | null\n staticLocaleURL: string | null\n staticSiteURL: string | null\n siteSecret?: string\n variant?: Variant\n}\n\nconst mode: Environment = process.env.MODE as Environment\nconst apiMode: Environment = (process.env.API || mode) as Environment\nconst devServerIp: string = process.env.DEV_SERVER_IP as string\nconst siteSecret: string = process.env.SITE_SECRET as string\nconst target: Target = process.env.TARGET as Target\nconst variant: Variant = process.env.VARIANT as Variant\n\nconst isNative = process.env.PLATFORM === 'native'\nconst isProduction = mode === 'production'\nconst isWeb = process.env.PLATFORM === 'web'\n\nconst dir = variant === 'stage' ? 'stage/new' : 'new'\nconst embedDir = variant === 'stage' ? 'stage/app' : 'app'\n\nconst {\n apiHost,\n apiVersion,\n} = environments[apiMode] ?? {}\n\n/* eslint-disable indent */\nconst staticLocaleURL =\n isWeb ?\n isProduction ? `https://ninchat.com/${dir}` : 'http://localhost:8080'\n :\n isNative ?\n isProduction ? `https://ninchat.com/${dir}` : `http://${devServerIp}:8082`\n :\n null\n\nconst staticSiteURL =\n isNative ?\n isProduction ? 'https://ninchat.com' : `http://${devServerIp}:8082`\n :\n isProduction ? `https://ninchat.com/${dir}` : 'http://localhost:8082'\n\nconst staticEmbedURL =\n isNative ?\n isProduction ? 'https://ninchat.com' : `http://${devServerIp}:8082`\n :\n isProduction ? `https://ninchat.com/${embedDir}` : 'http://localhost:8082'\n/* eslint-enable indent */\n\nconst environment: AppEnvironment = {\n apiHost,\n apiMode,\n apiVersion,\n devServerIp,\n ...siteSecret && apiMode !== 'production' ? {siteSecret} : {},\n staticEmbedURL,\n staticLocaleURL,\n staticSiteURL,\n target,\n variant,\n}\nexport const setEnvironment = (env: {\n apiMode: Environment\n siteSecret?: string\n variant: Variant\n}) => {\n const _dir = variant === 'stage' ? 'stage/new' : 'new'\n environment.apiHost = environments[env.apiMode]?.apiHost\n environment.apiMode = env.apiMode\n environment.apiVersion = environments[env.apiMode]?.apiVersion\n if (siteSecret && env.apiMode !== 'production') {\n environment.siteSecret = siteSecret\n }\n environment.staticLocaleURL = `https://ninchat.com/${_dir}`\n environment.staticSiteURL = `https://ninchat.com/${_dir}`\n environment.target = 'embed'\n}\nexport const getEnvironment = (): AppEnvironment => environment\n","import {\n AnyAction,\n ListenerEffectAPI,\n UnsubscribeListener,\n} from '@reduxjs/toolkit'\nimport {\n AppDispatch,\n RootState,\n} from '../../store'\nimport {NinchatClientPromiseValue} from '../../api/NinchatClient'\n\nexport type EffectArgs = {\n action: AnyAction\n listenerApi: ListenerEffectAPI<RootState, AppDispatch>\n}\n\nexport type EffectProcessArgs = {\n flushNotificationQueue: () => void\n ignoreIdle?: boolean\n listener?: Listener\n notificationQueue: NotificationQueueEntry[]\n} & EffectArgs\n\nexport type EffectRetval = [NotificationType, NinchatClientPromiseValue]\n\nexport type Listener = {\n effects: Map<NotificationKey, (args: EffectArgs) => EffectRetval>\n unsubscribe: UnsubscribeListener\n}\n\nexport type NotificationEvent = {\n audio?: boolean\n channel_name?: string\n desktop?: boolean\n message?: string\n queue_name?: string\n realm_name?: string\n type: NotificationType\n user_name?: string\n}\n\nexport type NotificationKey =\n 'ignore_idle' | 'require_interaction' |\n 'private' | 'highlight' | 'channel_join' | 'channel' | 'audience_queue' | 'audience_queue_picked' | 'audience' | 'audience_register' |\n 'private_audio' | 'highlight_audio' | 'channel_join_audio' | 'channel_audio' | 'audience_queue_audio' | 'audience_queue_picked_audio' | 'audience_audio' | 'audience_register_audio'\n\nexport type NotificationQueueEntry = {\n audio: boolean\n desktop: boolean\n payload: NinchatClientPromiseValue\n type: NotificationType\n}\n\nexport enum NotificationType {\n MessageReceivedChannel = 'message_received/channel',\n MessageReceivedChannelAudience = 'message_received/channel/audience',\n MessageReceivedChannelJoin = 'message_received/channel/join',\n MessageReceivedDialogue = 'message_received/dialogue',\n QueueActivity = 'queue_activity',\n QueueUpdatedAudienceAcceptPeer = 'queue_updated/audience_accept_peer',\n QueueUpdatedAudienceRequest = 'queue_updated/audience_request',\n}\n","export enum EmbedErrorType {\n ContainerNotFoundError = 'container_not_found',\n SiteConfigFetchError = 'site_config_fetch_error',\n InvalidConfigKeyError = 'invalid_config_key',\n InvalidSiteConfigError = 'invalid_site_config'\n}\n","import {\n AudienceRoute,\n ChannelRoute,\n ElseRoute,\n TranscriptRoute,\n} from './routes'\nimport {\n NotificationEvent as BrowserNotificationEvent,\n NotificationType,\n} from 'components/BrowserNotification/types'\nimport {AudienceID} from 'api/types/properties'\nimport {EmbedErrorEvents} from './errorEvents'\nimport {NinchatEmbedConfig} from './'\n\nexport enum EmbedEvent {\n ActivityCount = 'activity_count',\n AudienceAccepted = 'audience_accepted',\n AudienceClosed = 'audience_closed',\n AudienceEnded = 'audience_ended',\n ContainerInitialized = 'container_initialized',\n Error = 'error',\n Notification = 'notification',\n Route = 'route'\n}\n\nexport {NotificationType as EmbedNotificationType}\n\nexport type BaseEvent = NinchatEmbedConfig\n\nexport interface ActivityCountEvent extends BaseEvent {\n event: EmbedEvent.ActivityCount\n activity: number\n highlights: number\n}\n\nexport interface AudienceAcceptedEvent extends BaseEvent {\n event: EmbedEvent.AudienceAccepted\n audience_id: AudienceID\n metadata?: Record<string, unknown>[]\n}\n\nexport interface AudienceClosedEvent extends BaseEvent {\n event: EmbedEvent.AudienceClosed\n audience_id: AudienceID\n}\n\nexport interface AudienceEndedEvent extends BaseEvent {\n event: EmbedEvent.AudienceEnded\n audience_id: AudienceID\n}\n\nexport interface ContainerInitializedEvent extends BaseEvent {\n event: EmbedEvent.ContainerInitialized\n}\n\nexport interface NotificationEvent extends BaseEvent, BrowserNotificationEvent {\n event: EmbedEvent.Notification\n}\n\nexport interface RouteEvent extends BaseEvent {\n event: EmbedEvent.Route\n route: AudienceRoute | ChannelRoute | ElseRoute | TranscriptRoute\n}\n\nexport type EmbedEvents =\n ActivityCountEvent |\n AudienceAcceptedEvent |\n AudienceClosedEvent |\n AudienceEndedEvent |\n ContainerInitializedEvent |\n EmbedErrorEvents |\n NotificationEvent |\n RouteEvent\n","import {\n AudienceID,\n ChannelID,\n} from 'api/types/properties'\n\nexport enum RouteName {\n Channel = 'Channel',\n Else = 'Else',\n Transcript = 'Transcript',\n}\n\nexport type ChannelRoute = {\n name: RouteName.Channel\n params: {\n channel_id: ChannelID\n }\n}\n\nexport type AudienceRoute = {\n audience_id: AudienceID\n name: RouteName.Channel\n metadata?: Record<string, unknown>[]\n params: {\n channel_id: ChannelID\n }\n}\n\nexport type ElseRoute = {\n name: RouteName.Else\n}\n\nexport type TranscriptRoute = {\n audience_id: AudienceID\n name: RouteName.Transcript\n metadata?: Record<string, unknown>[]\n params: {\n audience_id: AudienceID\n }\n}\n","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\nmodule.exports = _classCallCheck, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var toPropertyKey = require(\"./toPropertyKey.js\");\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nmodule.exports = _createClass, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\nmodule.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nmodule.exports = _toPrimitive, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nvar toPrimitive = require(\"./toPrimitive.js\");\nfunction _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}\nmodule.exports = _toPropertyKey, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(obj);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","import {\n EmbedEvent,\n EmbedEvents,\n EmbedNotificationType,\n} from './types/events'\nimport {\n NinchatCallbacks,\n NinchatEventCallback,\n NinchatOptions,\n} from './types'\nimport {ContainerNotFoundErrorEvent} from './types/errorEvents'\nimport {EmbedErrorType} from './types/errorTypes'\nimport {RouteName} from './types/routes'\nimport {getEnvironment} from 'appconfig'\n\nexport class NinchatEmbed {\n readonly ENVIRONMENT = getEnvironment()\n\n readonly EMBED_HOST = this.ENVIRONMENT.staticEmbedURL\n\n readonly EMBED_ORIGIN = this.EMBED_HOST && new URL(this.EMBED_HOST).origin\n\n readonly ENTRY_POINT = this.EMBED_HOST?.includes('localhost') ? 'embed3.html' : 'embed3'\n\n public readonly Event = EmbedEvent\n\n public readonly ErrorType = EmbedErrorType\n\n public readonly NotificationType = EmbedNotificationType\n\n public readonly RouteName = RouteName\n\n private callbacks = <NinchatCallbacks>{}\n\n private emit(event: EmbedEvents) {\n if (this.callbacks[event.event]) {\n this.callbacks[event.event].forEach((callback) => {\n callback(event)\n })\n }\n }\n\n private onMessage = (event: MessageEvent) => {\n if (event.origin === this.EMBED_ORIGIN) {\n this.emit(JSON.parse(event.data))\n }\n }\n\n public destruct() {\n window.removeEventListener('message', this.onMessage)\n this.callbacks = <NinchatCallbacks>{}\n }\n\n public off(event: EmbedEvent, callback: NinchatEventCallback) {\n if (this.callbacks[event]) {\n for (let i = 0; i < this.callbacks[event].length; i += 1) {\n if (this.callbacks[event][i] === callback) {\n this.callbacks[event].splice(i, 1)\n break\n }\n }\n }\n }\n\n public on(event: EmbedEvent, callback: NinchatEventCallback) {\n this.callbacks[event] ||= []\n this.callbacks[event].push(callback)\n }\n\n public init(options: NinchatOptions) {\n const {\n audienceMetadata,\n config,\n configKey,\n configUrls,\n containerId,\n environment,\n postConfigUrls,\n } = options\n\n const {origin} = window.location\n\n const container = document.querySelector(`#${containerId}`)\n\n // Params that are NOT sent to server via query (placed after #)\n // TODO: validate via Zod\n const searchParams = new URLSearchParams()\n\n if (audienceMetadata) {\n searchParams.set('audienceMetadata', JSON.stringify(audienceMetadata))\n }\n\n if (config) {\n searchParams.set('config', JSON.stringify(config))\n }\n\n if (configKey) {\n searchParams.set('configKey', JSON.stringify(configKey))\n }\n\n if (configUrls) {\n searchParams.set('configUrls', JSON.stringify(configUrls))\n }\n\n if (environment) {\n searchParams.set('environment', JSON.stringify(environment))\n }\n\n if (postConfigUrls) {\n searchParams.set('postConfigUrls', JSON.stringify(postConfigUrls))\n }\n\n const iframeUrl = new URL(`${this.EMBED_HOST}/${this.ENTRY_POINT}`)\n\n // Params that ARE sent to server via query\n iframeUrl.searchParams.set('targetOrigin', origin)\n\n if (container) {\n const iframe = document.createElement('iframe')\n iframe.name = `ninchat?${searchParams.toString()}`\n iframe.allow = 'camera;microphone;clipboard-write'\n iframe.src = iframeUrl.toString()\n iframe.style.border = '0'\n iframe.style.height = '100%'\n iframe.style.width = '100%'\n container.appendChild(iframe)\n } else {\n const errorEvent: ContainerNotFoundErrorEvent = {\n container_id: containerId,\n error_type: EmbedErrorType.ContainerNotFoundError,\n event: EmbedEvent.Error,\n targetOrigin: origin,\n }\n\n this.emit(errorEvent)\n }\n }\n\n constructor() {\n window.addEventListener('message', this.onMessage, false)\n }\n}\n\nexport default NinchatEmbed\n\n"],"names":["root","factory","exports","module","define","amd","a","i","self","apiMode","process","environments","apiHost","apiVersion","environment","devServerIp","staticEmbedURL","staticLocaleURL","staticSiteURL","target","variant","env","NotificationType","EmbedErrorType","EmbedEvent","RouteName","instance","Constructor","TypeError","__esModule","toPropertyKey","_defineProperties","props","length","descriptor","enumerable","configurable","writable","Object","defineProperty","key","protoProps","staticProps","prototype","obj","_typeof","input","hint","prim","Symbol","toPrimitive","undefined","res","call","String","Number","arg","iterator","constructor","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","NinchatEmbed","ENVIRONMENT","getEnvironment","EMBED_HOST","this","EMBED_ORIGIN","URL","origin","ENTRY_POINT","includes","Event","ErrorType","EmbedNotificationType","callbacks","onMessage","event","emit","JSON","parse","data","window","addEventListener","forEach","callback","removeEventListener","splice","push","options","audienceMetadata","config","configKey","configUrls","containerId","postConfigUrls","location","container","document","querySelector","searchParams","URLSearchParams","set","stringify","iframeUrl","iframe","createElement","name","toString","allow","src","style","border","height","width","appendChild","errorEvent","container_id","error_type","ContainerNotFoundError","Error","targetOrigin"],"sourceRoot":""}
@@ -1,4 +1,5 @@
1
1
  import { Identity } from 'api/types/properties';
2
+ import { NinchatProperties } from 'api/types';
2
3
  export declare enum ModalActionType {
3
4
  END_CONVERSATION = "MODAL/EndConversation",
4
5
  CHANNEL_INVITE_MODAL = "MODAL/ChannelInviteModal",
@@ -23,6 +24,7 @@ export interface ChannelInviteModal {
23
24
  };
24
25
  payload: {
25
26
  accessKey?: string;
27
+ noRedirectOnCancel?: boolean;
26
28
  };
27
29
  type: typeof ModalActionType.CHANNEL_INVITE_MODAL;
28
30
  }
@@ -53,6 +55,7 @@ export interface EditCannedMessage {
53
55
  payload: {
54
56
  keyword?: string;
55
57
  message?: string;
58
+ realmId?: NinchatProperties.RealmID;
56
59
  };
57
60
  type: typeof ModalActionType.EDIT_CANNED_MESSAGE;
58
61
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/actions/modal/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAA;AAE7C,oBAAY,eAAe;IACvB,gBAAgB,0BAA0B;IAC1C,oBAAoB,6BAA6B;IACjD,kBAAkB,4BAA4B;IAC9C,kBAAkB,4BAA4B;IAC9C,mBAAmB,4BAA4B;IAC/C,qBAAqB,+BAA+B;IACpD,QAAQ,mBAAmB;CAC9B;AAED,MAAM,WAAW,qBAAqB;I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IAC1B,MAAM,WAAW;IACjB,GAAG,QAAQ;IACX,cAAc,mBAAmB;CACpC;AAED,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE;QAAC,IAAI,EAAE,OAAO,CAAA;KAAC,CAAC;IACtB,OAAO,EAAE;QAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC;QAAC,YAAY,CAAC,EAAE,kBAAkB,CAAA;KAAC,CAAC;IAClE,IAAI,EAAE,OAAO,eAAe,CAAC,QAAQ,CAAA;CACxC;AAED,MAAM,MAAM,YAAY,GAAG,iBAAiB,GACxC,qBAAqB,GACrB,kBAAkB,GAClB,iBAAiB,GACjB,iBAAiB,GACjB,0BAA0B,CAAA"}
@@ -24,6 +24,9 @@ declare class NinchatClient {
24
24
  private connState;
25
25
  private sessionPromiseCallbacks;
26
26
  private siteSecret;
27
+ private customHandledActions;
28
+ private customHandledStack;
29
+ private CUSTOM_HANDLED_TIMEOUT_IN_MS;
27
30
  closeAction: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<`${string}/close`>;
28
31
  connStateAction: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<NinchatProperties.ConnState, string>;
29
32
  logAction: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string, string>;
@@ -1 +1 @@
1
- {"version":3,"file":"NinchatClient.d.ts","sourceRoot":"","sources":["../../../../../src/api/NinchatClient.ts"],"names":[],"mappings":"AAEA,OAAO,EAGH,QAAQ,EAGX,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACH,cAAc,EACd,aAAa,EACb,eAAe,EACf,iBAAiB,EACpB,MAAM,SAAS,CAAA;AAKhB,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;AACjF,MAAM,MAAM,oBAAoB,GAAG;IAAC,OAAO,CAAC,EAAE,iBAAiB,CAAC,gBAAgB,EAAE,CAAA;CAAC,CA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AAC,aAAa,CAAC,EAAE,OAAO,CAAC,EAAE,iBAAiB,CAAC,gBAAgB,EAAE,GAAG,oBAAoB,CAAC,yBAAyB,CAAC;CAkE1K;;AAED,wBAAkC"}
@@ -1,9 +1,8 @@
1
- import { NinchatAcceptAudienceAction } from '../types/actions';
2
- import { NinchatActionParams } from '../NinchatClient';
3
- import { NinchatChannelJoinedEvent } from '../types/events';
4
- import { RootState } from '../../store';
1
+ import { NinchatAcceptAudienceAction } from 'api/types/actions';
2
+ import { NinchatActionParams } from 'api/NinchatClient';
3
+ import { NinchatChannelJoinedEvent } from 'api/types/events';
5
4
  export declare const acceptAudience: import("@reduxjs/toolkit").AsyncThunk<NinchatChannelJoinedEvent, NinchatActionParams<NinchatAcceptAudienceAction>, {
6
- state: RootState;
5
+ state?: unknown;
7
6
  dispatch?: import("redux").Dispatch<import("redux").AnyAction>;
8
7
  extra?: unknown;
9
8
  rejectValue?: unknown;
@@ -1 +1 @@
1
- {"version":3,"file":"acceptAudience.d.ts","sourceRoot":"","sources":["../../../../../../src/api/action/acceptAudience.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,2BAA2B,EAE9B,MAAM,kBAAkB,CAAA;AACzB,OAAsB,EAClB,mBAAmB,EACtB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAC,yBAAyB,EAAC,MAAM,iBAAiB,CAAA;AACzD,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAA;AAUrC,eAAO,MAAM,cAAc;WAHhB,SAAS;;;;;;;;EA2BnB,CAAA"}
1
+ {"version":3,"file":"acceptAudience.d.ts","sourceRoot":"","sources":["../../../../../../src/api/action/acceptAudience.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,2BAA2B,EAE9B,MAAM,mBAAmB,CAAA;AAC1B,OAAsB,EAClB,mBAAmB,EACtB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAC,yBAAyB,EAAC,MAAM,kBAAkB,CAAA;AAO1D,eAAO,MAAM,cAAc;;;;;;;;;EAa1B,CAAA"}