@webex/internal-plugin-calendar 2.59.1 → 2.59.3-next.1
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/.eslintrc.js +6 -6
- package/README.md +42 -42
- package/babel.config.js +3 -3
- package/dist/calendar.decrypt.helper.js +10 -10
- package/dist/calendar.decrypt.helper.js.map +1 -1
- package/dist/calendar.encrypt.helper.js +11 -11
- package/dist/calendar.encrypt.helper.js.map +1 -1
- package/dist/calendar.js +131 -131
- package/dist/calendar.js.map +1 -1
- package/dist/collection.js +40 -40
- package/dist/collection.js.map +1 -1
- package/dist/config.js +2 -2
- package/dist/config.js.map +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/util.js +7 -7
- package/dist/util.js.map +1 -1
- package/jest.config.js +3 -3
- package/package.json +17 -16
- package/process +1 -1
- package/src/calendar.decrypt.helper.js +121 -121
- package/src/calendar.encrypt.helper.js +98 -98
- package/src/calendar.js +490 -490
- package/src/collection.js +100 -100
- package/src/config.js +10 -10
- package/src/constants.js +6 -6
- package/src/index.js +241 -241
- package/src/util.js +22 -22
- package/test/integration/spec/calendar.js +624 -624
- package/test/unit/spec/calendar.decrypt.helper.js +145 -145
- package/test/unit/spec/calendar.encrypt.helper.js +52 -52
- package/test/unit/spec/calendar.js +446 -446
- package/test/unit/spec/utils.js +16 -16
package/src/collection.js
CHANGED
|
@@ -1,100 +1,100 @@
|
|
|
1
|
-
import {find} from 'lodash';
|
|
2
|
-
|
|
3
|
-
import CalendarUtil from './util';
|
|
4
|
-
import {CALENDAR} from './constants';
|
|
5
|
-
/**
|
|
6
|
-
* @class CalendarCollection
|
|
7
|
-
*/
|
|
8
|
-
const CalendarCollection = {
|
|
9
|
-
namespace: CALENDAR,
|
|
10
|
-
items: {},
|
|
11
|
-
/**
|
|
12
|
-
* @param {String} id calendar ID
|
|
13
|
-
* @returns {Any} Calendar Item specifc to that id
|
|
14
|
-
* @private
|
|
15
|
-
* @memberof CalendarCollection
|
|
16
|
-
*/
|
|
17
|
-
get(id) {
|
|
18
|
-
return this.items[id];
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* @param {String} key any key and the corresponding calendar Item
|
|
23
|
-
* @param {String} value any values corresponding to calendar item
|
|
24
|
-
* @returns {Any} returns whatever is being stuffed into the collection
|
|
25
|
-
* @private
|
|
26
|
-
* @memberof CalendarCollection
|
|
27
|
-
*/
|
|
28
|
-
getBy(key, value) {
|
|
29
|
-
if (key && value) {
|
|
30
|
-
return find(this.items, (item) => item[key] === value);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return null;
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* @param {Object} item CalendarObject passed to the collection
|
|
38
|
-
* @returns {Any} returns calender id whats get set
|
|
39
|
-
* @private
|
|
40
|
-
* @memberof CalendarCollection
|
|
41
|
-
*/
|
|
42
|
-
set(item) {
|
|
43
|
-
const itemId = item.id;
|
|
44
|
-
const meeting = CalendarUtil.calculateEndTime(item);
|
|
45
|
-
|
|
46
|
-
this.items[itemId] = meeting;
|
|
47
|
-
|
|
48
|
-
return itemId;
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* resets all the values in the calendarcollection
|
|
53
|
-
* @returns {undefined}
|
|
54
|
-
* @private
|
|
55
|
-
* @memberof CalendarCollection
|
|
56
|
-
*/
|
|
57
|
-
reset() {
|
|
58
|
-
this.items = {};
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* @param {Id} id is the id for the calendar item to be removed
|
|
63
|
-
* @returns {Any} calendar item which got removed
|
|
64
|
-
* @private
|
|
65
|
-
* @memberof CalendarCollection
|
|
66
|
-
*/
|
|
67
|
-
remove(id) {
|
|
68
|
-
const meeting = this.get(id);
|
|
69
|
-
|
|
70
|
-
delete this.items[id];
|
|
71
|
-
|
|
72
|
-
return meeting;
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* sets all the item passed to the collection
|
|
77
|
-
* @param {Array} items array of calendar items
|
|
78
|
-
* @private
|
|
79
|
-
* @returns {undefined}
|
|
80
|
-
* @memberof CalendarCollection
|
|
81
|
-
*/
|
|
82
|
-
setAll(items) {
|
|
83
|
-
items.forEach((item) => {
|
|
84
|
-
this.set(item);
|
|
85
|
-
});
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* gets all the calendar stored in the collection
|
|
90
|
-
* @param {Array} items array of calendar items
|
|
91
|
-
* @private
|
|
92
|
-
* @returns {Array} returns an array of calendar items
|
|
93
|
-
* @memberof CalendarCollection
|
|
94
|
-
*/
|
|
95
|
-
getAll() {
|
|
96
|
-
return Object.values(this.items);
|
|
97
|
-
},
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
export default CalendarCollection;
|
|
1
|
+
import {find} from 'lodash';
|
|
2
|
+
|
|
3
|
+
import CalendarUtil from './util';
|
|
4
|
+
import {CALENDAR} from './constants';
|
|
5
|
+
/**
|
|
6
|
+
* @class CalendarCollection
|
|
7
|
+
*/
|
|
8
|
+
const CalendarCollection = {
|
|
9
|
+
namespace: CALENDAR,
|
|
10
|
+
items: {},
|
|
11
|
+
/**
|
|
12
|
+
* @param {String} id calendar ID
|
|
13
|
+
* @returns {Any} Calendar Item specifc to that id
|
|
14
|
+
* @private
|
|
15
|
+
* @memberof CalendarCollection
|
|
16
|
+
*/
|
|
17
|
+
get(id) {
|
|
18
|
+
return this.items[id];
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @param {String} key any key and the corresponding calendar Item
|
|
23
|
+
* @param {String} value any values corresponding to calendar item
|
|
24
|
+
* @returns {Any} returns whatever is being stuffed into the collection
|
|
25
|
+
* @private
|
|
26
|
+
* @memberof CalendarCollection
|
|
27
|
+
*/
|
|
28
|
+
getBy(key, value) {
|
|
29
|
+
if (key && value) {
|
|
30
|
+
return find(this.items, (item) => item[key] === value);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return null;
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @param {Object} item CalendarObject passed to the collection
|
|
38
|
+
* @returns {Any} returns calender id whats get set
|
|
39
|
+
* @private
|
|
40
|
+
* @memberof CalendarCollection
|
|
41
|
+
*/
|
|
42
|
+
set(item) {
|
|
43
|
+
const itemId = item.id;
|
|
44
|
+
const meeting = CalendarUtil.calculateEndTime(item);
|
|
45
|
+
|
|
46
|
+
this.items[itemId] = meeting;
|
|
47
|
+
|
|
48
|
+
return itemId;
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* resets all the values in the calendarcollection
|
|
53
|
+
* @returns {undefined}
|
|
54
|
+
* @private
|
|
55
|
+
* @memberof CalendarCollection
|
|
56
|
+
*/
|
|
57
|
+
reset() {
|
|
58
|
+
this.items = {};
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @param {Id} id is the id for the calendar item to be removed
|
|
63
|
+
* @returns {Any} calendar item which got removed
|
|
64
|
+
* @private
|
|
65
|
+
* @memberof CalendarCollection
|
|
66
|
+
*/
|
|
67
|
+
remove(id) {
|
|
68
|
+
const meeting = this.get(id);
|
|
69
|
+
|
|
70
|
+
delete this.items[id];
|
|
71
|
+
|
|
72
|
+
return meeting;
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* sets all the item passed to the collection
|
|
77
|
+
* @param {Array} items array of calendar items
|
|
78
|
+
* @private
|
|
79
|
+
* @returns {undefined}
|
|
80
|
+
* @memberof CalendarCollection
|
|
81
|
+
*/
|
|
82
|
+
setAll(items) {
|
|
83
|
+
items.forEach((item) => {
|
|
84
|
+
this.set(item);
|
|
85
|
+
});
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* gets all the calendar stored in the collection
|
|
90
|
+
* @param {Array} items array of calendar items
|
|
91
|
+
* @private
|
|
92
|
+
* @returns {Array} returns an array of calendar items
|
|
93
|
+
* @memberof CalendarCollection
|
|
94
|
+
*/
|
|
95
|
+
getAll() {
|
|
96
|
+
return Object.values(this.items);
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export default CalendarCollection;
|
package/src/config.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
calendar: {
|
|
7
|
-
fromDate: new Date(new Date().setDate(new Date().getDate() - 1)),
|
|
8
|
-
toDate: new Date(new Date().setDate(new Date().getDate() + 7)),
|
|
9
|
-
},
|
|
10
|
-
};
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
calendar: {
|
|
7
|
+
fromDate: new Date(new Date().setDate(new Date().getDate() - 1)),
|
|
8
|
+
toDate: new Date(new Date().setDate(new Date().getDate() + 7)),
|
|
9
|
+
},
|
|
10
|
+
};
|
package/src/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export const CALENDAR_REGISTERED = 'calendar:registered';
|
|
2
|
-
export const CALENDAR_UNREGISTERED = 'calendar:unregistered';
|
|
3
|
-
export const CALENDAR_UPDATED = 'calendar:update';
|
|
4
|
-
export const CALENDAR_DELETE = 'calendar:delete';
|
|
5
|
-
export const CALENDAR_CREATE = 'calendar:create';
|
|
6
|
-
export const CALENDAR = 'CALENDAR';
|
|
1
|
+
export const CALENDAR_REGISTERED = 'calendar:registered';
|
|
2
|
+
export const CALENDAR_UNREGISTERED = 'calendar:unregistered';
|
|
3
|
+
export const CALENDAR_UPDATED = 'calendar:update';
|
|
4
|
+
export const CALENDAR_DELETE = 'calendar:delete';
|
|
5
|
+
export const CALENDAR_CREATE = 'calendar:create';
|
|
6
|
+
export const CALENDAR = 'CALENDAR';
|