@webex/common 2.59.3-next.1 → 2.59.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +6 -6
- package/README.md +42 -42
- package/babel.config.js +3 -3
- package/dist/base64.js +22 -22
- package/dist/base64.js.map +1 -1
- package/dist/browser-detection.js.map +1 -1
- package/dist/capped-debounce.js +12 -12
- package/dist/capped-debounce.js.map +1 -1
- package/dist/check-required.js +8 -8
- package/dist/check-required.js.map +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/defer.js +13 -13
- package/dist/defer.js.map +1 -1
- package/dist/deprecated.js +5 -5
- package/dist/deprecated.js.map +1 -1
- package/dist/event-envelope.js +11 -11
- package/dist/event-envelope.js.map +1 -1
- package/dist/events.js +15 -15
- package/dist/events.js.map +1 -1
- package/dist/exception.js +13 -13
- package/dist/exception.js.map +1 -1
- package/dist/in-browser/browser.js +2 -2
- package/dist/in-browser/browser.js.map +1 -1
- package/dist/in-browser/index.js.map +1 -1
- package/dist/in-browser/node.js +2 -2
- package/dist/in-browser/node.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/isBuffer.js +6 -6
- package/dist/isBuffer.js.map +1 -1
- package/dist/make-state-datatype.js +14 -14
- package/dist/make-state-datatype.js.map +1 -1
- package/dist/one-flight.js +13 -13
- package/dist/one-flight.js.map +1 -1
- package/dist/patterns.js +30 -30
- package/dist/patterns.js.map +1 -1
- package/dist/resolve-with.js +19 -19
- package/dist/resolve-with.js.map +1 -1
- package/dist/retry.js +17 -17
- package/dist/retry.js.map +1 -1
- package/dist/tap.js +14 -14
- package/dist/tap.js.map +1 -1
- package/dist/template-container.js +51 -51
- package/dist/template-container.js.map +1 -1
- package/dist/uuid-utils.js +76 -76
- package/dist/uuid-utils.js.map +1 -1
- package/dist/while-in-flight.js +5 -5
- package/dist/while-in-flight.js.map +1 -1
- package/jest.config.js +3 -3
- package/package.json +11 -12
- package/process +1 -1
- package/src/base64.js +67 -67
- package/src/browser-detection.js +37 -37
- package/src/capped-debounce.js +65 -65
- package/src/check-required.js +18 -18
- package/src/constants.js +79 -79
- package/src/defer.js +24 -24
- package/src/deprecated.js +19 -19
- package/src/event-envelope.js +54 -54
- package/src/events.js +55 -55
- package/src/exception.js +45 -45
- package/src/in-browser/browser.js +5 -5
- package/src/in-browser/index.js +11 -11
- package/src/in-browser/node.js +5 -5
- package/src/index.js +44 -44
- package/src/isBuffer.js +12 -12
- package/src/make-state-datatype.js +91 -91
- package/src/one-flight.js +89 -89
- package/src/patterns.js +51 -51
- package/src/resolve-with.js +27 -27
- package/src/retry.js +124 -124
- package/src/tap.js +25 -25
- package/src/template-container.js +222 -222
- package/src/uuid-utils.js +189 -189
- package/src/while-in-flight.js +38 -38
- package/test/unit/spec/capped-debounce.js +103 -103
- package/test/unit/spec/common.js +42 -42
- package/test/unit/spec/exception.js +102 -102
- package/test/unit/spec/one-flight.js +211 -211
- package/test/unit/spec/template-container.js +81 -81
- package/test/unit/spec/while-in-flight.js +70 -70
package/src/base64.js
CHANGED
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import UrlSafeBase64 from 'urlsafe-base64';
|
|
6
|
-
import {Buffer} from 'safe-buffer';
|
|
7
|
-
|
|
8
|
-
import isBuffer from './isBuffer';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Converts a string from a base64url-encoded string
|
|
12
|
-
* @param {string} str
|
|
13
|
-
* @returns {string}
|
|
14
|
-
*/
|
|
15
|
-
export function fromBase64url(str) {
|
|
16
|
-
return UrlSafeBase64.decode(str).toString();
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Converts a string to a base64url-encoded string. It also accepts a buffer
|
|
21
|
-
* @param {string|buffer} str
|
|
22
|
-
* @returns {string}
|
|
23
|
-
*/
|
|
24
|
-
export function toBase64Url(str) {
|
|
25
|
-
let buffer = str;
|
|
26
|
-
|
|
27
|
-
if (!isBuffer(buffer)) {
|
|
28
|
-
buffer = Buffer.from(buffer);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return UrlSafeBase64.encode(buffer);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Converts a string to a base64url-encoded string. It also accepts a buffer
|
|
36
|
-
* @param {string|buffer} str
|
|
37
|
-
* @returns {string}
|
|
38
|
-
*/
|
|
39
|
-
export function encode(str) {
|
|
40
|
-
return toBase64Url(str);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Converts a string from a base64url-encoded string
|
|
45
|
-
* @param {string} str
|
|
46
|
-
* @returns {string}
|
|
47
|
-
*/
|
|
48
|
-
export function decode(str) {
|
|
49
|
-
return fromBase64url(str);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Indicates if the provided string is, in fact, a base64 string
|
|
54
|
-
* @param {String} str
|
|
55
|
-
* @returns {Boolean}
|
|
56
|
-
*/
|
|
57
|
-
export function validate(str) {
|
|
58
|
-
return UrlSafeBase64.validate(str);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export default {
|
|
62
|
-
fromBase64url,
|
|
63
|
-
toBase64Url,
|
|
64
|
-
encode,
|
|
65
|
-
decode,
|
|
66
|
-
validate,
|
|
67
|
-
};
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import UrlSafeBase64 from 'urlsafe-base64';
|
|
6
|
+
import {Buffer} from 'safe-buffer';
|
|
7
|
+
|
|
8
|
+
import isBuffer from './isBuffer';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Converts a string from a base64url-encoded string
|
|
12
|
+
* @param {string} str
|
|
13
|
+
* @returns {string}
|
|
14
|
+
*/
|
|
15
|
+
export function fromBase64url(str) {
|
|
16
|
+
return UrlSafeBase64.decode(str).toString();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Converts a string to a base64url-encoded string. It also accepts a buffer
|
|
21
|
+
* @param {string|buffer} str
|
|
22
|
+
* @returns {string}
|
|
23
|
+
*/
|
|
24
|
+
export function toBase64Url(str) {
|
|
25
|
+
let buffer = str;
|
|
26
|
+
|
|
27
|
+
if (!isBuffer(buffer)) {
|
|
28
|
+
buffer = Buffer.from(buffer);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return UrlSafeBase64.encode(buffer);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Converts a string to a base64url-encoded string. It also accepts a buffer
|
|
36
|
+
* @param {string|buffer} str
|
|
37
|
+
* @returns {string}
|
|
38
|
+
*/
|
|
39
|
+
export function encode(str) {
|
|
40
|
+
return toBase64Url(str);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Converts a string from a base64url-encoded string
|
|
45
|
+
* @param {string} str
|
|
46
|
+
* @returns {string}
|
|
47
|
+
*/
|
|
48
|
+
export function decode(str) {
|
|
49
|
+
return fromBase64url(str);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Indicates if the provided string is, in fact, a base64 string
|
|
54
|
+
* @param {String} str
|
|
55
|
+
* @returns {Boolean}
|
|
56
|
+
*/
|
|
57
|
+
export function validate(str) {
|
|
58
|
+
return UrlSafeBase64.validate(str);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export default {
|
|
62
|
+
fromBase64url,
|
|
63
|
+
toBase64Url,
|
|
64
|
+
encode,
|
|
65
|
+
decode,
|
|
66
|
+
validate,
|
|
67
|
+
};
|
package/src/browser-detection.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import bowser from 'bowser';
|
|
2
|
-
import {memoize} from 'lodash';
|
|
3
|
-
import window from 'global/window';
|
|
4
|
-
|
|
5
|
-
const mockDetectionObject = {
|
|
6
|
-
/* eslint-disable global-require */
|
|
7
|
-
getOSName: () => require('os').platform(),
|
|
8
|
-
getOSVersion: () => require('os').release(),
|
|
9
|
-
/* eslint-enable global-require */
|
|
10
|
-
getBrowserName: () => '',
|
|
11
|
-
getBrowserVersion: () => '',
|
|
12
|
-
isBrowser: () => false,
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const createDetectionObject = (results) => {
|
|
16
|
-
const getOSName = () => results?.getOSName() ?? '';
|
|
17
|
-
const getOSVersion = () => results?.getOSVersion() ?? '';
|
|
18
|
-
|
|
19
|
-
const getBrowserName = () => results?.getBrowserName() ?? '';
|
|
20
|
-
const getBrowserVersion = () => results?.getBrowserVersion() ?? '';
|
|
21
|
-
|
|
22
|
-
const isBrowser = (name) => !!results?.isBrowser(name, true);
|
|
23
|
-
|
|
24
|
-
return {
|
|
25
|
-
getOSName,
|
|
26
|
-
getOSVersion,
|
|
27
|
-
getBrowserName,
|
|
28
|
-
getBrowserVersion,
|
|
29
|
-
isBrowser,
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export default memoize((agent) =>
|
|
34
|
-
agent || window.navigator?.userAgent
|
|
35
|
-
? createDetectionObject(bowser.getParser(agent || window.navigator.userAgent))
|
|
36
|
-
: mockDetectionObject
|
|
37
|
-
);
|
|
1
|
+
import bowser from 'bowser';
|
|
2
|
+
import {memoize} from 'lodash';
|
|
3
|
+
import window from 'global/window';
|
|
4
|
+
|
|
5
|
+
const mockDetectionObject = {
|
|
6
|
+
/* eslint-disable global-require */
|
|
7
|
+
getOSName: () => require('os').platform(),
|
|
8
|
+
getOSVersion: () => require('os').release(),
|
|
9
|
+
/* eslint-enable global-require */
|
|
10
|
+
getBrowserName: () => '',
|
|
11
|
+
getBrowserVersion: () => '',
|
|
12
|
+
isBrowser: () => false,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const createDetectionObject = (results) => {
|
|
16
|
+
const getOSName = () => results?.getOSName() ?? '';
|
|
17
|
+
const getOSVersion = () => results?.getOSVersion() ?? '';
|
|
18
|
+
|
|
19
|
+
const getBrowserName = () => results?.getBrowserName() ?? '';
|
|
20
|
+
const getBrowserVersion = () => results?.getBrowserVersion() ?? '';
|
|
21
|
+
|
|
22
|
+
const isBrowser = (name) => !!results?.isBrowser(name, true);
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
getOSName,
|
|
26
|
+
getOSVersion,
|
|
27
|
+
getBrowserName,
|
|
28
|
+
getBrowserVersion,
|
|
29
|
+
isBrowser,
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export default memoize((agent) =>
|
|
34
|
+
agent || window.navigator?.userAgent
|
|
35
|
+
? createDetectionObject(bowser.getParser(agent || window.navigator.userAgent))
|
|
36
|
+
: mockDetectionObject
|
|
37
|
+
);
|
package/src/capped-debounce.js
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Behaves like debounce, but additionally executes after a number of calls are
|
|
7
|
-
* attempted, rather than just time
|
|
8
|
-
* @param {Function} fn
|
|
9
|
-
* @param {Number} wait
|
|
10
|
-
* @param {Object} options
|
|
11
|
-
* @returns {Function}
|
|
12
|
-
*/
|
|
13
|
-
export default function debounce(fn, wait, options) {
|
|
14
|
-
/* eslint no-invalid-this: [0] */
|
|
15
|
-
|
|
16
|
-
if (!fn) {
|
|
17
|
-
throw new Error('`fn` must be a function');
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
if (!wait) {
|
|
21
|
-
throw new Error('`wait` is required');
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
options = options || {};
|
|
25
|
-
if (!options.maxWait) {
|
|
26
|
-
throw new Error('`options.maxWait` is required');
|
|
27
|
-
}
|
|
28
|
-
if (!options.maxCalls) {
|
|
29
|
-
throw new Error('`options.maxCalls` is required');
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const {maxCalls, maxWait} = options;
|
|
33
|
-
let count = 0;
|
|
34
|
-
let maxWaitTimer;
|
|
35
|
-
let waitTimer;
|
|
36
|
-
|
|
37
|
-
return function wrapper() {
|
|
38
|
-
count += 1;
|
|
39
|
-
|
|
40
|
-
clearTimeout(waitTimer);
|
|
41
|
-
waitTimer = setTimeout(() => exec(), wait);
|
|
42
|
-
|
|
43
|
-
if (!maxWaitTimer) {
|
|
44
|
-
maxWaitTimer = setTimeout(() => exec(), maxWait);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (count >= maxCalls) {
|
|
48
|
-
Reflect.apply(exec, this, []);
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* @private
|
|
54
|
-
* @returns {undefined}
|
|
55
|
-
*/
|
|
56
|
-
function exec() {
|
|
57
|
-
clearTimeout(waitTimer);
|
|
58
|
-
waitTimer = null;
|
|
59
|
-
clearTimeout(maxWaitTimer);
|
|
60
|
-
maxWaitTimer = null;
|
|
61
|
-
count = 0;
|
|
62
|
-
|
|
63
|
-
Reflect.apply(fn, this, []);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Behaves like debounce, but additionally executes after a number of calls are
|
|
7
|
+
* attempted, rather than just time
|
|
8
|
+
* @param {Function} fn
|
|
9
|
+
* @param {Number} wait
|
|
10
|
+
* @param {Object} options
|
|
11
|
+
* @returns {Function}
|
|
12
|
+
*/
|
|
13
|
+
export default function debounce(fn, wait, options) {
|
|
14
|
+
/* eslint no-invalid-this: [0] */
|
|
15
|
+
|
|
16
|
+
if (!fn) {
|
|
17
|
+
throw new Error('`fn` must be a function');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (!wait) {
|
|
21
|
+
throw new Error('`wait` is required');
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
options = options || {};
|
|
25
|
+
if (!options.maxWait) {
|
|
26
|
+
throw new Error('`options.maxWait` is required');
|
|
27
|
+
}
|
|
28
|
+
if (!options.maxCalls) {
|
|
29
|
+
throw new Error('`options.maxCalls` is required');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const {maxCalls, maxWait} = options;
|
|
33
|
+
let count = 0;
|
|
34
|
+
let maxWaitTimer;
|
|
35
|
+
let waitTimer;
|
|
36
|
+
|
|
37
|
+
return function wrapper() {
|
|
38
|
+
count += 1;
|
|
39
|
+
|
|
40
|
+
clearTimeout(waitTimer);
|
|
41
|
+
waitTimer = setTimeout(() => exec(), wait);
|
|
42
|
+
|
|
43
|
+
if (!maxWaitTimer) {
|
|
44
|
+
maxWaitTimer = setTimeout(() => exec(), maxWait);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (count >= maxCalls) {
|
|
48
|
+
Reflect.apply(exec, this, []);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @private
|
|
54
|
+
* @returns {undefined}
|
|
55
|
+
*/
|
|
56
|
+
function exec() {
|
|
57
|
+
clearTimeout(waitTimer);
|
|
58
|
+
waitTimer = null;
|
|
59
|
+
clearTimeout(maxWaitTimer);
|
|
60
|
+
maxWaitTimer = null;
|
|
61
|
+
count = 0;
|
|
62
|
+
|
|
63
|
+
Reflect.apply(fn, this, []);
|
|
64
|
+
}
|
|
65
|
+
}
|
package/src/check-required.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Check object for the specified keys
|
|
7
|
-
* @param {Array<string>} keys
|
|
8
|
-
* @param {Object} object
|
|
9
|
-
* @returns {undefined}
|
|
10
|
-
* @throws Error
|
|
11
|
-
*/
|
|
12
|
-
export default function checkRequired(keys, object) {
|
|
13
|
-
keys.forEach((key) => {
|
|
14
|
-
if (!object[key]) {
|
|
15
|
-
throw new Error(`missing required property ${key} from ${object}`);
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
}
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Check object for the specified keys
|
|
7
|
+
* @param {Array<string>} keys
|
|
8
|
+
* @param {Object} object
|
|
9
|
+
* @returns {undefined}
|
|
10
|
+
* @throws Error
|
|
11
|
+
*/
|
|
12
|
+
export default function checkRequired(keys, object) {
|
|
13
|
+
keys.forEach((key) => {
|
|
14
|
+
if (!object[key]) {
|
|
15
|
+
throw new Error(`missing required property ${key} from ${object}`);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
package/src/constants.js
CHANGED
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
export const SDK_EVENT = {
|
|
2
|
-
INTERNAL: {
|
|
3
|
-
WEBEX_ACTIVITY: 'event:conversation.activity',
|
|
4
|
-
ACTIVITY_FIELD: {
|
|
5
|
-
ACTOR: 'actor',
|
|
6
|
-
OBJECT: 'object',
|
|
7
|
-
TARGET: 'target',
|
|
8
|
-
},
|
|
9
|
-
ACTIVITY_VERB: {
|
|
10
|
-
ACKNOWLEDGE: 'acknowledge',
|
|
11
|
-
CARD_ACTION: 'cardAction',
|
|
12
|
-
CREATE: 'create',
|
|
13
|
-
POST: 'post',
|
|
14
|
-
SHARE: 'share',
|
|
15
|
-
DELETE: 'delete',
|
|
16
|
-
ADD: 'add',
|
|
17
|
-
LEAVE: 'leave',
|
|
18
|
-
ADD_MODERATOR: 'assignModerator',
|
|
19
|
-
REMOVE_MODERATOR: 'unassignModerator',
|
|
20
|
-
LOCK: 'lock',
|
|
21
|
-
UNLOCK: 'unlock',
|
|
22
|
-
HIDE: 'hide',
|
|
23
|
-
UPDATE: 'update',
|
|
24
|
-
},
|
|
25
|
-
ACTIVITY_TAG: {
|
|
26
|
-
HIDDEN: 'HIDDEN',
|
|
27
|
-
ONE_ON_ONE: 'ONE_ON_ONE',
|
|
28
|
-
LOCKED: 'LOCKED',
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
EXTERNAL: {
|
|
32
|
-
EVENT_TYPE: {
|
|
33
|
-
CREATED: 'created',
|
|
34
|
-
DELETED: 'deleted',
|
|
35
|
-
UPDATED: 'updated',
|
|
36
|
-
SEEN: 'seen',
|
|
37
|
-
},
|
|
38
|
-
OWNER: {
|
|
39
|
-
CREATOR: 'creator',
|
|
40
|
-
ORG: 'org',
|
|
41
|
-
},
|
|
42
|
-
STATUS: {
|
|
43
|
-
ACTIVE: 'active',
|
|
44
|
-
DISABLED: 'disabled',
|
|
45
|
-
},
|
|
46
|
-
SPACE_TYPE: {
|
|
47
|
-
DIRECT: 'direct',
|
|
48
|
-
GROUP: 'group',
|
|
49
|
-
},
|
|
50
|
-
RESOURCE: {
|
|
51
|
-
ATTACHMENT_ACTIONS: 'attachmentActions',
|
|
52
|
-
MEMBERSHIPS: 'memberships',
|
|
53
|
-
MESSAGES: 'messages',
|
|
54
|
-
ROOMS: 'rooms',
|
|
55
|
-
},
|
|
56
|
-
ATTACHMENTS: {
|
|
57
|
-
CARD_CONTENT_TYPE: 'application/vnd.microsoft.card.adaptive',
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export const hydraTypes = {
|
|
63
|
-
ATTACHMENT_ACTION: 'ATTACHMENT_ACTION',
|
|
64
|
-
CONTENT: 'CONTENT',
|
|
65
|
-
MEMBERSHIP: 'MEMBERSHIP',
|
|
66
|
-
MESSAGE: 'MESSAGE',
|
|
67
|
-
ORGANIZATION: 'ORGANIZATION',
|
|
68
|
-
PEOPLE: 'PEOPLE',
|
|
69
|
-
ROOM: 'ROOM',
|
|
70
|
-
TEAM: 'TEAM',
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export const deviceType = {
|
|
74
|
-
PROVISIONAL: 'PROVISIONAL',
|
|
75
|
-
WEB: 'WEB',
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
export const INTERNAL_US_CLUSTER_NAME = 'urn:TEAM:us-east-2_a';
|
|
79
|
-
export const INTERNAL_US_INTEGRATION_CLUSTER_NAME = 'urn:TEAM:us-east-1_int13';
|
|
1
|
+
export const SDK_EVENT = {
|
|
2
|
+
INTERNAL: {
|
|
3
|
+
WEBEX_ACTIVITY: 'event:conversation.activity',
|
|
4
|
+
ACTIVITY_FIELD: {
|
|
5
|
+
ACTOR: 'actor',
|
|
6
|
+
OBJECT: 'object',
|
|
7
|
+
TARGET: 'target',
|
|
8
|
+
},
|
|
9
|
+
ACTIVITY_VERB: {
|
|
10
|
+
ACKNOWLEDGE: 'acknowledge',
|
|
11
|
+
CARD_ACTION: 'cardAction',
|
|
12
|
+
CREATE: 'create',
|
|
13
|
+
POST: 'post',
|
|
14
|
+
SHARE: 'share',
|
|
15
|
+
DELETE: 'delete',
|
|
16
|
+
ADD: 'add',
|
|
17
|
+
LEAVE: 'leave',
|
|
18
|
+
ADD_MODERATOR: 'assignModerator',
|
|
19
|
+
REMOVE_MODERATOR: 'unassignModerator',
|
|
20
|
+
LOCK: 'lock',
|
|
21
|
+
UNLOCK: 'unlock',
|
|
22
|
+
HIDE: 'hide',
|
|
23
|
+
UPDATE: 'update',
|
|
24
|
+
},
|
|
25
|
+
ACTIVITY_TAG: {
|
|
26
|
+
HIDDEN: 'HIDDEN',
|
|
27
|
+
ONE_ON_ONE: 'ONE_ON_ONE',
|
|
28
|
+
LOCKED: 'LOCKED',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
EXTERNAL: {
|
|
32
|
+
EVENT_TYPE: {
|
|
33
|
+
CREATED: 'created',
|
|
34
|
+
DELETED: 'deleted',
|
|
35
|
+
UPDATED: 'updated',
|
|
36
|
+
SEEN: 'seen',
|
|
37
|
+
},
|
|
38
|
+
OWNER: {
|
|
39
|
+
CREATOR: 'creator',
|
|
40
|
+
ORG: 'org',
|
|
41
|
+
},
|
|
42
|
+
STATUS: {
|
|
43
|
+
ACTIVE: 'active',
|
|
44
|
+
DISABLED: 'disabled',
|
|
45
|
+
},
|
|
46
|
+
SPACE_TYPE: {
|
|
47
|
+
DIRECT: 'direct',
|
|
48
|
+
GROUP: 'group',
|
|
49
|
+
},
|
|
50
|
+
RESOURCE: {
|
|
51
|
+
ATTACHMENT_ACTIONS: 'attachmentActions',
|
|
52
|
+
MEMBERSHIPS: 'memberships',
|
|
53
|
+
MESSAGES: 'messages',
|
|
54
|
+
ROOMS: 'rooms',
|
|
55
|
+
},
|
|
56
|
+
ATTACHMENTS: {
|
|
57
|
+
CARD_CONTENT_TYPE: 'application/vnd.microsoft.card.adaptive',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const hydraTypes = {
|
|
63
|
+
ATTACHMENT_ACTION: 'ATTACHMENT_ACTION',
|
|
64
|
+
CONTENT: 'CONTENT',
|
|
65
|
+
MEMBERSHIP: 'MEMBERSHIP',
|
|
66
|
+
MESSAGE: 'MESSAGE',
|
|
67
|
+
ORGANIZATION: 'ORGANIZATION',
|
|
68
|
+
PEOPLE: 'PEOPLE',
|
|
69
|
+
ROOM: 'ROOM',
|
|
70
|
+
TEAM: 'TEAM',
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const deviceType = {
|
|
74
|
+
PROVISIONAL: 'PROVISIONAL',
|
|
75
|
+
WEB: 'WEB',
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const INTERNAL_US_CLUSTER_NAME = 'urn:TEAM:us-east-2_a';
|
|
79
|
+
export const INTERNAL_US_INTEGRATION_CLUSTER_NAME = 'urn:TEAM:us-east-1_int13';
|
package/src/defer.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Creates a new `Defer`red object,
|
|
7
|
-
* @returns {Defer}
|
|
8
|
-
*/
|
|
9
|
-
export default function Defer() {
|
|
10
|
-
this.promise = new Promise((resolve, reject) => {
|
|
11
|
-
/**
|
|
12
|
-
* @instance
|
|
13
|
-
* @memberof Defer
|
|
14
|
-
* @type {function}
|
|
15
|
-
*/
|
|
16
|
-
this.resolve = resolve;
|
|
17
|
-
/**
|
|
18
|
-
* @instance
|
|
19
|
-
* @memberof Defer
|
|
20
|
-
* @type {function}
|
|
21
|
-
*/
|
|
22
|
-
this.reject = reject;
|
|
23
|
-
});
|
|
24
|
-
}
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Creates a new `Defer`red object,
|
|
7
|
+
* @returns {Defer}
|
|
8
|
+
*/
|
|
9
|
+
export default function Defer() {
|
|
10
|
+
this.promise = new Promise((resolve, reject) => {
|
|
11
|
+
/**
|
|
12
|
+
* @instance
|
|
13
|
+
* @memberof Defer
|
|
14
|
+
* @type {function}
|
|
15
|
+
*/
|
|
16
|
+
this.resolve = resolve;
|
|
17
|
+
/**
|
|
18
|
+
* @instance
|
|
19
|
+
* @memberof Defer
|
|
20
|
+
* @type {function}
|
|
21
|
+
*/
|
|
22
|
+
this.reject = reject;
|
|
23
|
+
});
|
|
24
|
+
}
|
package/src/deprecated.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import {deprecated} from 'core-decorators';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @private
|
|
9
|
-
* @returns {function}
|
|
10
|
-
*/
|
|
11
|
-
function emptyDecorator() {
|
|
12
|
-
return function noop() {
|
|
13
|
-
/* eslint no-empty:[0] */
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const exportedDeprecated = process.env.NODE_ENV === 'production' ? emptyDecorator : deprecated;
|
|
18
|
-
|
|
19
|
-
export default exportedDeprecated;
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {deprecated} from 'core-decorators';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @private
|
|
9
|
+
* @returns {function}
|
|
10
|
+
*/
|
|
11
|
+
function emptyDecorator() {
|
|
12
|
+
return function noop() {
|
|
13
|
+
/* eslint no-empty:[0] */
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const exportedDeprecated = process.env.NODE_ENV === 'production' ? emptyDecorator : deprecated;
|
|
18
|
+
|
|
19
|
+
export default exportedDeprecated;
|