ninchat-embed 1.0.2 → 1.0.3
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.
- package/README.md +374 -1
- package/dist/embed3.js +1 -1
- package/dist/embed3.js.map +1 -1
- package/dist/src/actions/modal/types/index.d.ts +1 -0
- package/dist/src/actions/modal/types/index.d.ts.map +1 -1
- package/dist/src/api/NinchatClient.d.ts +3 -0
- package/dist/src/api/NinchatClient.d.ts.map +1 -1
- package/dist/src/api/action/acceptAudience.d.ts +4 -5
- package/dist/src/api/action/acceptAudience.d.ts.map +1 -1
- package/dist/src/api/action/addMember.d.ts +16 -0
- package/dist/src/api/action/addMember.d.ts.map +1 -0
- package/dist/src/api/action/assignTranscript.d.ts +14 -0
- package/dist/src/api/action/assignTranscript.d.ts.map +1 -0
- package/dist/src/api/action/createAccess.d.ts +2 -7
- package/dist/src/api/action/createAccess.d.ts.map +1 -1
- package/dist/src/api/action/createComment.d.ts +1 -1
- package/dist/src/api/action/createIdentity.d.ts +1 -1
- package/dist/src/api/action/createIdentityWithAuthResetAccess.d.ts +1 -1
- package/dist/src/api/action/createQueue.d.ts +14 -0
- package/dist/src/api/action/createQueue.d.ts.map +1 -0
- package/dist/src/api/action/createTag.d.ts +1 -1
- package/dist/src/api/action/deleteIdentity.d.ts +1 -1
- package/dist/src/api/action/deleteMessage.d.ts +1 -1
- package/dist/src/api/action/deleteTag.d.ts +1 -1
- package/dist/src/api/action/describeChannel.d.ts +2 -7
- package/dist/src/api/action/describeChannel.d.ts.map +1 -1
- package/dist/src/api/action/describeIdentity.d.ts +1 -1
- package/dist/src/api/action/describeQueue.d.ts +1 -1
- package/dist/src/api/action/describeQueueTranscripts.d.ts +14 -0
- package/dist/src/api/action/describeQueueTranscripts.d.ts.map +1 -0
- package/dist/src/api/action/describeRealm.d.ts +1 -1
- package/dist/src/api/action/describeTag.d.ts +1 -1
- package/dist/src/api/action/describeTags.d.ts +1 -1
- package/dist/src/api/action/describeTranscript.d.ts +14 -0
- package/dist/src/api/action/describeTranscript.d.ts.map +1 -0
- package/dist/src/api/action/describeUser.d.ts +1 -1
- package/dist/src/api/action/endAudience.d.ts +1 -1
- package/dist/src/api/action/getAudienceRangeComments.d.ts +1 -1
- package/dist/src/api/action/getQueueActivity.d.ts +1 -1
- package/dist/src/api/action/getQueueStats.d.ts +19 -0
- package/dist/src/api/action/getQueueStats.d.ts.map +1 -0
- package/dist/src/api/action/index.d.ts.map +1 -1
- package/dist/src/api/action/joinChannel.d.ts +9 -11
- package/dist/src/api/action/joinChannel.d.ts.map +1 -1
- package/dist/src/api/action/partChannel.d.ts +5 -5
- package/dist/src/api/action/partChannel.d.ts.map +1 -1
- package/dist/src/api/action/registerAudience.d.ts +1 -1
- package/dist/src/api/action/removeMember.d.ts +16 -0
- package/dist/src/api/action/removeMember.d.ts.map +1 -0
- package/dist/src/api/action/requestIdentityAuthResetAccess.d.ts +1 -7
- package/dist/src/api/action/requestIdentityAuthResetAccess.d.ts.map +1 -1
- package/dist/src/api/action/requestIdentityVerifyAccess.d.ts +1 -1
- package/dist/src/api/action/resetIdentityAuth.d.ts +1 -7
- package/dist/src/api/action/resetIdentityAuth.d.ts.map +1 -1
- package/dist/src/api/action/setTranscriptStatus.d.ts +14 -0
- package/dist/src/api/action/setTranscriptStatus.d.ts.map +1 -0
- package/dist/src/api/action/updateChannel.d.ts +1 -1
- package/dist/src/api/action/updateChannel.d.ts.map +1 -1
- package/dist/src/api/action/updateDialogue.d.ts +1 -1
- package/dist/src/api/action/updateIdentity.d.ts +1 -1
- package/dist/src/api/action/updateIdentityAuth.d.ts +1 -1
- package/dist/src/api/action/updateMessage.d.ts +1 -1
- package/dist/src/api/action/updateQueue.d.ts +1 -1
- package/dist/src/api/action/updateRealm.d.ts +19 -0
- package/dist/src/api/action/updateRealm.d.ts.map +1 -0
- package/dist/src/api/action/updateTag.d.ts +1 -1
- package/dist/src/api/action/updateUser.d.ts +1 -1
- package/dist/src/api/action/updateUserMessages.d.ts +1 -1
- package/dist/src/api/action/verifyIdentity.d.ts +1 -1
- package/dist/src/api/event/ack.d.ts +4 -0
- package/dist/src/api/event/ack.d.ts.map +1 -0
- package/dist/src/api/event/audienceRangeCommentContents.d.ts.map +1 -1
- package/dist/src/api/event/channelJoined.d.ts.map +1 -1
- package/dist/src/api/event/channelMemberJoined.d.ts.map +1 -1
- package/dist/src/api/event/channelMemberParted.d.ts.map +1 -1
- package/dist/src/api/event/channelUpdated.d.ts +20 -3
- package/dist/src/api/event/channelUpdated.d.ts.map +1 -1
- package/dist/src/api/event/commentCreated.d.ts.map +1 -1
- package/dist/src/api/event/index.d.ts +147 -2
- package/dist/src/api/event/index.d.ts.map +1 -1
- package/dist/src/api/event/messageReceived.d.ts +2 -1
- package/dist/src/api/event/messageReceived.d.ts.map +1 -1
- package/dist/src/api/event/queueCreated.d.ts +4 -0
- package/dist/src/api/event/queueCreated.d.ts.map +1 -0
- package/dist/src/api/event/queueJoined.d.ts +4 -0
- package/dist/src/api/event/queueJoined.d.ts.map +1 -0
- package/dist/src/api/event/queueMemberJoined.d.ts +4 -0
- package/dist/src/api/event/queueMemberJoined.d.ts.map +1 -0
- package/dist/src/api/event/queueMemberParted.d.ts +4 -0
- package/dist/src/api/event/queueMemberParted.d.ts.map +1 -0
- package/dist/src/api/event/queueParted.d.ts +4 -0
- package/dist/src/api/event/queueParted.d.ts.map +1 -0
- package/dist/src/api/event/queueStatsContents.d.ts +4 -0
- package/dist/src/api/event/queueStatsContents.d.ts.map +1 -0
- package/dist/src/api/event/queueTranscriptsFound.d.ts +4 -0
- package/dist/src/api/event/queueTranscriptsFound.d.ts.map +1 -0
- package/dist/src/api/event/realmJoined.d.ts +4 -0
- package/dist/src/api/event/realmJoined.d.ts.map +1 -0
- package/dist/src/api/event/realmMemberParted.d.ts +4 -0
- package/dist/src/api/event/realmMemberParted.d.ts.map +1 -0
- package/dist/src/api/event/realmUpdated.d.ts +4 -0
- package/dist/src/api/event/realmUpdated.d.ts.map +1 -0
- package/dist/src/api/event/transcriptFound.d.ts +4 -0
- package/dist/src/api/event/transcriptFound.d.ts.map +1 -0
- package/dist/src/api/event/transcriptUpdated.d.ts +22 -0
- package/dist/src/api/event/transcriptUpdated.d.ts.map +1 -0
- package/dist/src/api/types/actions.d.ts +114 -3
- package/dist/src/api/types/actions.d.ts.map +1 -1
- package/dist/src/api/types/attributes.d.ts +5 -0
- package/dist/src/api/types/attributes.d.ts.map +1 -1
- package/dist/src/api/types/events.d.ts +63 -3
- package/dist/src/api/types/events.d.ts.map +1 -1
- package/dist/src/api/types/properties.d.ts +79 -5
- package/dist/src/api/types/properties.d.ts.map +1 -1
- package/dist/src/api/types/settings.d.ts +2 -0
- package/dist/src/api/types/settings.d.ts.map +1 -1
- package/dist/src/appconfig/index.d.ts +11 -2
- package/dist/src/appconfig/index.d.ts.map +1 -1
- package/dist/src/components/BrowserNotification/types.d.ts +1 -1
- package/dist/src/components/BrowserNotification/types.d.ts.map +1 -1
- package/dist/src/components/Send/types/index.d.ts +1 -0
- package/dist/src/components/Send/types/index.d.ts.map +1 -1
- package/dist/src/embed/types/events.d.ts +20 -3
- package/dist/src/embed/types/events.d.ts.map +1 -1
- package/dist/src/embed/types/routes.d.ts +10 -1
- package/dist/src/embed/types/routes.d.ts.map +1 -1
- package/dist/src/navigation/actions.d.ts +12 -3
- package/dist/src/navigation/actions.d.ts.map +1 -1
- package/dist/src/navigation/router.d.ts +6 -1
- package/dist/src/navigation/router.d.ts.map +1 -1
- package/dist/src/navigation/slice.d.ts.map +1 -1
- package/dist/src/navigation/types.d.ts +41 -14
- package/dist/src/navigation/types.d.ts.map +1 -1
- package/dist/src/reducers/modal/index.d.ts.map +1 -1
- package/dist/src/reducers/ninchat/index.d.ts +4 -0
- package/dist/src/reducers/ninchat/index.d.ts.map +1 -1
- package/dist/src/store/types/ninchat.d.ts +18 -1
- package/dist/src/store/types/ninchat.d.ts.map +1 -1
- package/dist/src/utils/channels/index.d.ts +9 -0
- package/dist/src/utils/channels/index.d.ts.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1 +1,374 @@
|
|
|
1
|
-
|
|
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
|
+
```es6
|
|
360
|
+
const options = {
|
|
361
|
+
config: {
|
|
362
|
+
default: {
|
|
363
|
+
sso: {
|
|
364
|
+
email: EMAIL_ADDRESS,
|
|
365
|
+
type: 'email',
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
},
|
|
369
|
+
configKey: SITE_CONFIG_KEY,
|
|
370
|
+
containerId: 'ninchat-container',
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
Ninchat.init(options)
|
|
374
|
+
```
|
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
|
|
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.setEnvironment=t.getEnvironment=void 0;var i,o=n(491),r="production",a=null!=(i=o.environments[r])?i:{},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"});t.setEnvironment=function(e){var t,n;u.apiHost=null==(t=o.environments[e.apiMode])?void 0:t.apiHost,u.apiMode=e.apiMode,u.apiVersion=null==(n=o.environments[e.apiMode])?void 0:n.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 n;Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationType=void 0,t.NotificationType=n,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"}(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.AudienceAccepted="audience_accepted",e.AudienceClosed="audience_closed",e.AudienceEnded="audience_ended",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",e.Transcript="Transcript"}(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(/?/*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(/: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 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),d=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,d=window.location.origin,l=document.querySelector("#"+r),p=new URLSearchParams;t&&p.set("audienceMetadata",JSON.stringify(t)),n&&p.set("config",JSON.stringify(n)),i&&p.set("configKey",JSON.stringify(i)),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)}}}]),e}();e.NinchatEmbed=d;var l=d;e.default=l}(),i}()}));
|
|
2
2
|
//# sourceMappingURL=embed3.js.map
|
package/dist/embed3.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,+GCVA,IAA2C,EAA3C,SAmBMC,EAAwBC,aAa9B,EAGyB,OAHzB,EAGIC,EAAAA,aAAaF,IAAQ,EAAI,CAAC,EAF1BG,EAAO,EAAPA,QACAC,EAAU,EAAVA,WAoCF,iBAV4B,WAAH,sBACvBD,QAAAA,EACAH,QAAAA,EACAI,WAAAA,EACAC,YA5CwBJ,IACDA,GA4CO,CAC9BK,eATgB,0BAUhBC,gBA3BgB,0BA4BhBC,cAjBgB,0BAkBhBC,OA/CmBR,SA+Cb,C,wBChBES,E,2EAAgB,8BAAhBA,GAAAA,EAAgB,yCAAhBA,EAAgB,kDAAhBA,EAAgB,mEAAhBA,EAAgB,2DAAhBA,EAAgB,oDAAhBA,EAAgB,oEAAhBA,EAAgB,8DAAhBA,IAAgB,mBAAhBA,EAAgB,I,wBCrDhBC,E,yEAAc,4BAAdA,GAAAA,EAAc,6CAAdA,EAAc,+CAAdA,EAAc,2CAAdA,EAAc,8CAAdA,IAA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AI,WACAC,EAGAL,EAHAK,YACAC,EAEAN,EAFAM,YACAC,EACAP,EADAO,eAGG3B,EAAUa,OAAOe,SAAjB5B,OAED6B,EAAYC,SAASC,cAAc,IAAIN,GAIvCO,EAAe,IAAIC,gBAErBZ,GACAW,EAAaE,IAAI,mBAAoBxB,KAAKyB,UAAUd,IAGpDC,GACAU,EAAaE,IAAI,SAAUxB,KAAKyB,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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IAAIL,GAIvCM,EAAe,IAAIC,gBAErBX,GACAU,EAAaE,IAAI,mBAAoBvB,KAAKwB,UAAUb,IAGpDC,GACAS,EAAaE,IAAI,SAAUvB,KAAKwB,UAAUZ,IAG1CC,GACAQ,EAAaE,IAAI,YAAavB,KAAKwB,UAAUX,IAG7CC,GACAO,EAAaE,IAAI,aAAcvB,KAAKwB,UAAUV,IAG9ChF,GACAuF,EAAaE,IAAI,cAAevB,KAAKwB,UAAU1F,IAG/CkF,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}\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 && {siteSecret},\n staticEmbedURL,\n staticLocaleURL,\n staticSiteURL,\n target,\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) {\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","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 +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;IAClC,IAAI,EAAE;QAAC,IAAI,EAAE,OAAO,CAAA;KAAC,CAAC;IACtB,OAAO,EAAE;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC;IAC9B,IAAI,EAAE,OAAO,eAAe,CAAC,gBAAgB,CAAA;CAChD;AAED,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE;QAAC,IAAI,EAAE,OAAO,CAAA;KAAC,CAAC;IACtB,OAAO,EAAE;QAAC,SAAS,CAAC,EAAE,MAAM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KACjB,CAAC;IACF,IAAI,EAAE,OAAO,eAAe,CAAC,kBAAkB,CAAA;CAClD;AAED,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE;QAAC,IAAI,EAAE,OAAO,CAAA;KAAC,CAAC;IACtB,OAAO,EAAE;QACL,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,OAAO,CAAC,EAAE,MAAM,CAAA;KACnB,CAAC;IACF,IAAI,EAAE,OAAO,eAAe,CAAC,mBAAmB,CAAA;CACnD;AAED,MAAM,WAAW,0BAA0B;IACvC,IAAI,EAAE;QAAC,IAAI,EAAE,OAAO,CAAA;KAAC,CAAC;IACtB,OAAO,EAAE;QACL,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,SAAS,CAAC,EAAE,MAAM,CAAA;KACrB,CAAC;IACF,IAAI,EAAE,OAAO,eAAe,CAAC,qBAAqB,CAAA;CACrD;AAED,oBAAY,kBAAkB;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;
|
|
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;AAMhB,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,CAAA;AACnF,MAAM,MAAM,yBAAyB,CAAC,CAAC,IAAI;IAAC,KAAK,EAAE,CAAC,CAAC;IAAC,OAAO,EAAE,eAAe,CAAC,wBAAwB,CAAA;CAAC,CAAA;AAkBxG,UAAU,oBAAoB,CAAC,CAAC,CAAE,SAAQ,OAAO,CAAC,CAAC,CAAC;IAChD,QAAQ,CAAC,EAAE,iBAAiB,CAAC,QAAQ,CAAA;IACrC,IAAI,EAAE,CAAC,QAAQ,GAAG,CAAC,EAAE,QAAQ,GAAG,KAAK,EAAE,CAAC,GAAG,WAAW,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pG,OAAO,KAAK,OAAO,GAiBlB;IAED,OAAO,KAAK,OAAO,QAElB;IAED,IAAW,SAAS,YAEnB;IAED,IAAW,QAAQ,wCAMlB;IAED,IAAW,QAAQ,CAAC,QAAQ,qCAAA,EAE3B;IAED,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,WAAW;YAKL,OAAO;IA2CrB,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,cAAc;IAetB,OAAO,CAAC,eAAe;WAYT,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM;IAItD,IAAI,CAAC,MAAM,EAAE,mBAAmB,CAAC,cAAc,CAAC,aAAa,CAAC;IAepE,KAAK;IAUL,IAAI,CAAC,MAAM,EAAE,mBAAmB,CAAC,cAAc,CAAC,0BAA0B,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC,0BAA0B,CAAC;IAwB/H,IAAI,CAAC,MAAM,EAAE,mBAAmB,CAAC,cAAc,CAAC,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 '
|
|
2
|
-
import { NinchatActionParams } from '
|
|
3
|
-
import { NinchatChannelJoinedEvent } from '
|
|
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
|
|
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,
|
|
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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AnyAction, CaseReducer } from '@reduxjs/toolkit';
|
|
2
|
+
import { NinchatAddMemberAction } from 'api/types/actions';
|
|
3
|
+
import { NinchatActionParams, NinchatClientPromiseValue } from 'api/NinchatClient';
|
|
4
|
+
export declare const addMember: import("@reduxjs/toolkit").AsyncThunk<NinchatClientPromiseValue, NinchatActionParams<NinchatAddMemberAction>, {
|
|
5
|
+
fulfilledMeta: {
|
|
6
|
+
reducer: CaseReducer;
|
|
7
|
+
};
|
|
8
|
+
state?: unknown;
|
|
9
|
+
dispatch?: import("redux").Dispatch<AnyAction>;
|
|
10
|
+
extra?: unknown;
|
|
11
|
+
rejectValue?: unknown;
|
|
12
|
+
serializedErrorType?: unknown;
|
|
13
|
+
pendingMeta?: unknown;
|
|
14
|
+
rejectedMeta?: unknown;
|
|
15
|
+
}>;
|
|
16
|
+
//# sourceMappingURL=addMember.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addMember.d.ts","sourceRoot":"","sources":["../../../../../../src/api/action/addMember.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,WAAW,EAEd,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAEH,sBAAsB,EACzB,MAAM,mBAAmB,CAAA;AAE1B,OAAsB,EAClB,mBAAmB,EACnB,yBAAyB,EAC5B,MAAM,mBAAmB,CAAA;AAU1B,eAAO,MAAM,SAAS;mBAF6B;QAAC,OAAO,EAAE,WAAW,CAAA;KAAC;;;;;;;;EA0BxE,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NinchatAssignTranscriptAction } from '../types/actions';
|
|
2
|
+
import { NinchatActionParams } from '../NinchatClient';
|
|
3
|
+
import { NinchatAckEvent } from 'api/types/events';
|
|
4
|
+
export declare const assignTranscript: import("@reduxjs/toolkit").AsyncThunk<NinchatAckEvent, NinchatActionParams<NinchatAssignTranscriptAction>, {
|
|
5
|
+
state?: unknown;
|
|
6
|
+
dispatch?: import("redux").Dispatch<import("redux").AnyAction>;
|
|
7
|
+
extra?: unknown;
|
|
8
|
+
rejectValue?: unknown;
|
|
9
|
+
serializedErrorType?: unknown;
|
|
10
|
+
pendingMeta?: unknown;
|
|
11
|
+
fulfilledMeta?: unknown;
|
|
12
|
+
rejectedMeta?: unknown;
|
|
13
|
+
}>;
|
|
14
|
+
//# sourceMappingURL=assignTranscript.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assignTranscript.d.ts","sourceRoot":"","sources":["../../../../../../src/api/action/assignTranscript.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,6BAA6B,EAChC,MAAM,kBAAkB,CAAA;AACzB,OAAsB,EAClB,mBAAmB,EACtB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAA;AAMhD,eAAO,MAAM,gBAAgB;;;;;;;;;EAa5B,CAAA"}
|