@webex/internal-plugin-calendar 2.59.2 → 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/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';