@webex/internal-plugin-calendar 3.0.0-beta.13 → 3.0.0-beta.15
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 +1 -3
- package/dist/calendar.js +19 -19
- package/dist/calendar.js.map +1 -1
- package/dist/collection.js.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/util.js.map +1 -1
- package/package.json +10 -10
- package/src/calendar.js +47 -42
- package/src/collection.js +2 -4
- package/src/config.js +2 -2
- package/src/index.js +97 -40
- package/src/util.js +5 -3
- package/test/integration/spec/calendar.js +379 -271
- package/test/unit/spec/calendar.js +115 -74
- package/test/unit/spec/utils.js +4 -1
package/src/index.js
CHANGED
|
@@ -24,7 +24,7 @@ registerInternalPlugin('calendar', Calendar, {
|
|
|
24
24
|
},
|
|
25
25
|
extract(response) {
|
|
26
26
|
return Promise.resolve(response.body);
|
|
27
|
-
}
|
|
27
|
+
},
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
name: 'transformMeetingParticipants',
|
|
@@ -34,7 +34,7 @@ registerInternalPlugin('calendar', Calendar, {
|
|
|
34
34
|
},
|
|
35
35
|
extract(response) {
|
|
36
36
|
return Promise.resolve(response.body);
|
|
37
|
-
}
|
|
37
|
+
},
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
name: 'transformMeetingArray',
|
|
@@ -44,7 +44,7 @@ registerInternalPlugin('calendar', Calendar, {
|
|
|
44
44
|
},
|
|
45
45
|
extract(response) {
|
|
46
46
|
return Promise.resolve(response.body.items);
|
|
47
|
-
}
|
|
47
|
+
},
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
name: 'transformMeeting',
|
|
@@ -54,7 +54,7 @@ registerInternalPlugin('calendar', Calendar, {
|
|
|
54
54
|
},
|
|
55
55
|
extract(response) {
|
|
56
56
|
return Promise.resolve(response.body);
|
|
57
|
-
}
|
|
57
|
+
},
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
name: 'transformMeeting',
|
|
@@ -64,15 +64,15 @@ registerInternalPlugin('calendar', Calendar, {
|
|
|
64
64
|
},
|
|
65
65
|
extract(response) {
|
|
66
66
|
return Promise.resolve(response.calendarMeetingExternal);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
69
|
],
|
|
70
70
|
transforms: [
|
|
71
71
|
{
|
|
72
72
|
name: 'transformMeetingArray',
|
|
73
73
|
fn(ctx, array) {
|
|
74
74
|
return Promise.all(array.map((item) => ctx.transform('transformMeeting', item)));
|
|
75
|
-
}
|
|
75
|
+
},
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
name: 'transformMeeting',
|
|
@@ -87,33 +87,78 @@ registerInternalPlugin('calendar', Calendar, {
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
// Decrypt participant properties if meeting object contains participants
|
|
90
|
-
const decryptedParticipants = object.encryptedParticipants
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
const decryptedParticipants = object.encryptedParticipants
|
|
91
|
+
? object.encryptedParticipants.map((participant) =>
|
|
92
|
+
Promise.all([
|
|
93
|
+
ctx.transform(
|
|
94
|
+
'decryptTextProp',
|
|
95
|
+
'encryptedEmailAddress',
|
|
96
|
+
object.encryptionKeyUrl,
|
|
97
|
+
participant
|
|
98
|
+
),
|
|
99
|
+
ctx.transform(
|
|
100
|
+
'decryptTextProp',
|
|
101
|
+
'encryptedName',
|
|
102
|
+
object.encryptionKeyUrl,
|
|
103
|
+
participant
|
|
104
|
+
),
|
|
105
|
+
])
|
|
106
|
+
)
|
|
107
|
+
: [];
|
|
94
108
|
|
|
95
109
|
// Decrypt meetingJoinInfo properties if meeting object contains meetingJoinInfo
|
|
96
|
-
const decryptedMeetingJoinInfo = object.meetingJoinInfo
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
110
|
+
const decryptedMeetingJoinInfo = object.meetingJoinInfo
|
|
111
|
+
? Promise.all([
|
|
112
|
+
ctx.transform(
|
|
113
|
+
'decryptTextProp',
|
|
114
|
+
'meetingJoinURI',
|
|
115
|
+
object.encryptionKeyUrl,
|
|
116
|
+
object.meetingJoinInfo
|
|
117
|
+
),
|
|
118
|
+
ctx.transform(
|
|
119
|
+
'decryptTextProp',
|
|
120
|
+
'meetingJoinURL',
|
|
121
|
+
object.encryptionKeyUrl,
|
|
122
|
+
object.meetingJoinInfo
|
|
123
|
+
),
|
|
124
|
+
])
|
|
125
|
+
: [];
|
|
100
126
|
|
|
101
|
-
const decryptedOrganizer = object.encryptedOrganizer
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
127
|
+
const decryptedOrganizer = object.encryptedOrganizer
|
|
128
|
+
? Promise.all([
|
|
129
|
+
ctx.transform(
|
|
130
|
+
'decryptTextProp',
|
|
131
|
+
'encryptedEmailAddress',
|
|
132
|
+
object.encryptionKeyUrl,
|
|
133
|
+
object.encryptedOrganizer
|
|
134
|
+
),
|
|
135
|
+
ctx.transform(
|
|
136
|
+
'decryptTextProp',
|
|
137
|
+
'encryptedName',
|
|
138
|
+
object.encryptionKeyUrl,
|
|
139
|
+
object.encryptedOrganizer
|
|
140
|
+
),
|
|
141
|
+
])
|
|
142
|
+
: [];
|
|
105
143
|
|
|
106
|
-
return Promise.all(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
144
|
+
return Promise.all(
|
|
145
|
+
[
|
|
146
|
+
ctx.transform('decryptTextProp', 'encryptedSubject', object.encryptionKeyUrl, object),
|
|
147
|
+
ctx.transform(
|
|
148
|
+
'decryptTextProp',
|
|
149
|
+
'encryptedLocation',
|
|
150
|
+
object.encryptionKeyUrl,
|
|
151
|
+
object
|
|
152
|
+
),
|
|
153
|
+
ctx.transform('decryptTextProp', 'encryptedNotes', object.encryptionKeyUrl, object),
|
|
154
|
+
ctx.transform('decryptTextProp', 'webexURI', object.encryptionKeyUrl, object),
|
|
155
|
+
ctx.transform('decryptTextProp', 'webexURL', object.encryptionKeyUrl, object),
|
|
156
|
+
ctx.transform('decryptTextProp', 'spaceMeetURL', object.encryptionKeyUrl, object),
|
|
157
|
+
ctx.transform('decryptTextProp', 'spaceURI', object.encryptionKeyUrl, object),
|
|
158
|
+
ctx.transform('decryptTextProp', 'spaceURL', object.encryptionKeyUrl, object),
|
|
159
|
+
].concat(decryptedOrganizer, decryptedParticipants, decryptedMeetingJoinInfo)
|
|
160
|
+
);
|
|
161
|
+
},
|
|
117
162
|
},
|
|
118
163
|
{
|
|
119
164
|
name: 'transformMeetingNotes',
|
|
@@ -128,9 +173,9 @@ registerInternalPlugin('calendar', Calendar, {
|
|
|
128
173
|
}
|
|
129
174
|
|
|
130
175
|
return Promise.all([
|
|
131
|
-
ctx.transform('decryptTextProp', 'encryptedNotes', object.encryptionKeyUrl, object)
|
|
176
|
+
ctx.transform('decryptTextProp', 'encryptedNotes', object.encryptionKeyUrl, object),
|
|
132
177
|
]);
|
|
133
|
-
}
|
|
178
|
+
},
|
|
134
179
|
},
|
|
135
180
|
{
|
|
136
181
|
name: 'transformMeetingParticipants',
|
|
@@ -145,16 +190,28 @@ registerInternalPlugin('calendar', Calendar, {
|
|
|
145
190
|
}
|
|
146
191
|
|
|
147
192
|
// Decrypt participant properties
|
|
148
|
-
const decryptedParticipants = object.encryptedParticipants.map((participant) =>
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
193
|
+
const decryptedParticipants = object.encryptedParticipants.map((participant) =>
|
|
194
|
+
Promise.all([
|
|
195
|
+
ctx.transform(
|
|
196
|
+
'decryptTextProp',
|
|
197
|
+
'encryptedEmailAddress',
|
|
198
|
+
object.encryptionKeyUrl,
|
|
199
|
+
participant
|
|
200
|
+
),
|
|
201
|
+
ctx.transform(
|
|
202
|
+
'decryptTextProp',
|
|
203
|
+
'encryptedName',
|
|
204
|
+
object.encryptionKeyUrl,
|
|
205
|
+
participant
|
|
206
|
+
),
|
|
207
|
+
])
|
|
208
|
+
);
|
|
152
209
|
|
|
153
210
|
return Promise.all(decryptedParticipants);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
]
|
|
157
|
-
}
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
],
|
|
214
|
+
},
|
|
158
215
|
});
|
|
159
216
|
|
|
160
217
|
export {default} from './calendar';
|
package/src/util.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
const CalendarUtil = {
|
|
2
|
-
|
|
3
2
|
// calculate the end time for the meeting based on the duration so it's stored on
|
|
4
3
|
// the scheduled meeting item, that way client can display start and end without
|
|
5
4
|
// calculation on their side
|
|
@@ -13,8 +12,11 @@ const CalendarUtil = {
|
|
|
13
12
|
* @memberof CalendarUtil
|
|
14
13
|
*/
|
|
15
14
|
calculateEndTime(item) {
|
|
16
|
-
return {
|
|
17
|
-
|
|
15
|
+
return {
|
|
16
|
+
...item,
|
|
17
|
+
endTime: new Date(new Date(item.start).getTime() + item.durationMinutes * 60000),
|
|
18
|
+
};
|
|
19
|
+
},
|
|
18
20
|
};
|
|
19
21
|
|
|
20
22
|
export default CalendarUtil;
|