@webex/common 3.0.0-bnr.5 → 3.0.0-next.2

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.
Files changed (74) hide show
  1. package/.eslintrc.js +6 -0
  2. package/babel.config.js +3 -0
  3. package/dist/base64.js +1 -2
  4. package/dist/base64.js.map +1 -1
  5. package/dist/browser-detection.js +20 -6
  6. package/dist/browser-detection.js.map +1 -1
  7. package/dist/capped-debounce.js.map +1 -1
  8. package/dist/check-required.js.map +1 -1
  9. package/dist/constants.js +9 -11
  10. package/dist/constants.js.map +1 -1
  11. package/dist/defer.js.map +1 -1
  12. package/dist/deprecated.js +1 -2
  13. package/dist/deprecated.js.map +1 -1
  14. package/dist/event-envelope.js.map +1 -1
  15. package/dist/events.js +6 -2
  16. package/dist/events.js.map +1 -1
  17. package/dist/exception.js +1 -2
  18. package/dist/exception.js.map +1 -1
  19. package/dist/in-browser/browser.js +1 -2
  20. package/dist/in-browser/browser.js.map +1 -1
  21. package/dist/in-browser/index.js.map +1 -1
  22. package/dist/in-browser/node.js +1 -2
  23. package/dist/in-browser/node.js.map +1 -1
  24. package/dist/index.js +12 -1
  25. package/dist/index.js.map +1 -1
  26. package/dist/isBuffer.js +1 -2
  27. package/dist/isBuffer.js.map +1 -1
  28. package/dist/make-state-datatype.js.map +1 -1
  29. package/dist/one-flight.js +7 -3
  30. package/dist/one-flight.js.map +1 -1
  31. package/dist/patterns.js +6 -2
  32. package/dist/patterns.js.map +1 -1
  33. package/dist/resolve-with.js.map +1 -1
  34. package/dist/retry.js +8 -9
  35. package/dist/retry.js.map +1 -1
  36. package/dist/tap.js.map +1 -1
  37. package/dist/template-container.js.map +1 -1
  38. package/dist/uuid-utils.js +0 -1
  39. package/dist/uuid-utils.js.map +1 -1
  40. package/dist/while-in-flight.js +8 -2
  41. package/dist/while-in-flight.js.map +1 -1
  42. package/jest.config.js +3 -0
  43. package/package.json +22 -5
  44. package/process +1 -0
  45. package/src/browser-detection.js +14 -0
  46. package/src/constants.js +4 -0
  47. package/src/index.js +1 -1
  48. package/src/patterns.js +6 -0
  49. package/src/uuid-utils.js +0 -1
  50. package/test/unit/spec/browser-detection.js +44 -0
  51. package/dist/types/base64.d.ts +0 -38
  52. package/dist/types/browser-detection.d.ts +0 -8
  53. package/dist/types/capped-debounce.d.ts +0 -12
  54. package/dist/types/check-required.d.ts +0 -11
  55. package/dist/types/constants.d.ts +0 -76
  56. package/dist/types/defer.d.ts +0 -23
  57. package/dist/types/deprecated.d.ts +0 -7
  58. package/dist/types/event-envelope.d.ts +0 -13
  59. package/dist/types/events.d.ts +0 -15
  60. package/dist/types/exception.d.ts +0 -23
  61. package/dist/types/in-browser/browser.d.ts +0 -2
  62. package/dist/types/in-browser/index.d.ts +0 -1
  63. package/dist/types/in-browser/node.d.ts +0 -2
  64. package/dist/types/index.d.ts +0 -21
  65. package/dist/types/isBuffer.d.ts +0 -2
  66. package/dist/types/make-state-datatype.d.ts +0 -11
  67. package/dist/types/one-flight.d.ts +0 -9
  68. package/dist/types/patterns.d.ts +0 -8
  69. package/dist/types/resolve-with.d.ts +0 -22
  70. package/dist/types/retry.d.ts +0 -13
  71. package/dist/types/tap.d.ts +0 -17
  72. package/dist/types/template-container.d.ts +0 -59
  73. package/dist/types/uuid-utils.d.ts +0 -112
  74. package/dist/types/while-in-flight.d.ts +0 -7
@@ -1,15 +0,0 @@
1
- /**
2
- * Proxies the event binding methods of emitter onto proxy
3
- * @param {EventEmitter|EventEmitterProxy} emitter
4
- * @param {mixed} proxy (probably a promise)
5
- * @returns {EventEmitter} Returns the source emitter to ease use in promise chains
6
- */
7
- export function proxyEvents(emitter: EventEmitter | EventEmitterProxy, proxy: mixed): EventEmitter;
8
- /**
9
- * Given a list of events, fires them on drain when they're emitted from source
10
- * @param {Array|string} events
11
- * @param {EventEmitter} source
12
- * @param {EventEmitter} drain
13
- * @returns {undefined}
14
- */
15
- export function transferEvents(events: any[] | string, source: EventEmitter, drain: EventEmitter): undefined;
@@ -1,23 +0,0 @@
1
- /*!
2
- * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
3
- */
4
- /**
5
- * Base Exception class
6
- */
7
- export default class Exception extends Error {
8
- static defaultMessage: string;
9
- /**
10
- * Generates the value assigned to `this.message`. You'll probably want to
11
- * override this in your custom Exception
12
- * @param {mixed} args
13
- * @returns {string}
14
- */
15
- static parse(...args: mixed): string;
16
- /**
17
- * constructor
18
- * @param {mixed} args
19
- * @returns {Exception}
20
- */
21
- constructor(...args: mixed);
22
- message: any;
23
- }
@@ -1,2 +0,0 @@
1
- declare const _default: true;
2
- export default _default;
@@ -1 +0,0 @@
1
- export { default } from "./node";
@@ -1,2 +0,0 @@
1
- declare const _default: false;
2
- export default _default;
@@ -1,21 +0,0 @@
1
- export { default as base64 } from "./base64";
2
- export { default as isBuffer } from "./isBuffer";
3
- export { default as cappedDebounce } from "./capped-debounce";
4
- export { default as checkRequired } from "./check-required";
5
- export { default as Defer } from "./defer";
6
- export { default as makeStateDataType } from "./make-state-datatype";
7
- export { default as make } from "./template-container";
8
- export { default as oneFlight } from "./one-flight";
9
- export { default as patterns } from "./patterns";
10
- export { default as resolveWith } from "./resolve-with";
11
- export { default as retry } from "./retry";
12
- export { default as tap } from "./tap";
13
- export { default as whileInFlight } from "./while-in-flight";
14
- export { default as Exception } from "./exception";
15
- export { default as deprecated } from "./deprecated";
16
- export { default as inBrowser } from "./in-browser";
17
- export { default as BrowserDetection } from "./browser-detection";
18
- export { proxyEvents, transferEvents } from "./events";
19
- export { createEventEnvelope, ensureMyIdIsAvailable } from "./event-envelope";
20
- export { deviceType, hydraTypes, SDK_EVENT, INTERNAL_US_CLUSTER_NAME, INTERNAL_US_INTEGRATION_CLUSTER_NAME } from "./constants";
21
- export { buildHydraMembershipId, buildHydraMessageId, buildHydraOrgId, buildHydraPersonId, buildHydraRoomId, getHydraRoomType, getHydraClusterString, getHydraFiles, constructHydraId, deconstructHydraId } from "./uuid-utils";
@@ -1,2 +0,0 @@
1
- declare function _default(buffer: buffer): boolean;
2
- export default _default;
@@ -1,11 +0,0 @@
1
- /*!
2
- * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
3
- */
4
- /**
5
- * Creates an ampersand state object that wires its event handlers like a an
6
- * ampersand child
7
- * @param {Function} Constructor
8
- * @param {string} name
9
- * @returns {Object}
10
- */
11
- export default function makeStateDataType(Constructor: Function, name: string): any;
@@ -1,9 +0,0 @@
1
- /**
2
- * @memberof Util
3
- * @param {Object} options
4
- * @param {Function} options.keyFactory
5
- * @param {boolean} options.cacheFailures
6
- * @param {boolean} options.cacheSuccesses
7
- * @returns {Function}
8
- */
9
- export default function oneFlight(...params: any[]): Function;
@@ -1,8 +0,0 @@
1
- declare namespace _default {
2
- const email: RegExp;
3
- const containsEmails: RegExp;
4
- const uuid: RegExp;
5
- const execEmail: RegExp;
6
- const execUuid: RegExp;
7
- }
8
- export default _default;
@@ -1,22 +0,0 @@
1
- /*!
2
- * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
3
- */
4
- /**
5
- * Sugar method for returning the desired object at the end of a promise chain
6
- * @param {any} object the item with which to resolve the promise chain
7
- * @returns {function}
8
- * @example
9
- * var item = {
10
- * prop: 2
11
- * };
12
- * Promise
13
- * .resolve(item.prop)
14
- * .then(resolveWith(item))
15
- * .then(function(res) {
16
- * require('assert').deepEqual(res, {prop:2});
17
- * return 'success'
18
- * })
19
- * // => success
20
- *
21
- */
22
- export default function resolveWith(object: any): Function;
@@ -1,13 +0,0 @@
1
- /**
2
- * Makes a promise-returning method retryable according to the specified backoff
3
- * pattern
4
- * @param {Object} options
5
- * @param {boolean} options.backoff
6
- * @param {number} options.delay
7
- * @param {number} options.initialDelay
8
- * @param {number} options.maxAttempts
9
- * @param {number} options.maxDelay
10
- *
11
- * @returns {Function}
12
- */
13
- export default function retry(...params: any[]): Function;
@@ -1,17 +0,0 @@
1
- /*!
2
- * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
3
- */
4
- /**
5
- * Injects code into a promise chain without modifying the promise chain's result
6
- * @param {Function} fn
7
- * @returns {Promise}
8
- * @example
9
- * function f() {
10
- * return Promise.resolve(5);
11
- * }
12
- *
13
- * f()
14
- * .then(tap(() => 12))
15
- * // => 5
16
- */
17
- export default function tap(fn: Function): Promise<any>;
@@ -1,59 +0,0 @@
1
- export { make as default };
2
- /**
3
- * Factory which produces a multi-keyed container based on the provided set of
4
- * constructors
5
- * @param {mixed} containers
6
- * @returns {Container}
7
- */
8
- declare function make(...containers: mixed): {
9
- /**
10
- * getter for .size
11
- * @returns {number}
12
- */
13
- readonly size: number;
14
- /**
15
- * Identical to Container#set() but leads slightly more intuitive code when
16
- * the container is based on a Set rather than a Map.
17
- * @returns {Container}
18
- */
19
- add(...args: any[]): any;
20
- /**
21
- * Removes all items from the container
22
- * @returns {undefined}
23
- */
24
- clear(): undefined;
25
- /**
26
- * Removes the specified item to the container
27
- * @param {mixed} key
28
- * @param {Array<mixed>} keys
29
- * @returns {boolean}
30
- */
31
- delete(key: mixed, ...keys: Array<mixed>): boolean;
32
- /**
33
- * Retrieves the specified item from the container
34
- * @param {mixed} key
35
- * @param {Array<mixed>} keys
36
- * @returns {mixed}
37
- */
38
- get(key: mixed, ...keys: Array<mixed>): mixed;
39
- /**
40
- * Indicates whether the container holds the specified item
41
- * @param {mixed} key
42
- * @param {Array<mixed>} keys
43
- * @returns {Boolean}
44
- */
45
- has(...args: any[]): boolean;
46
- /**
47
- * Stores the specified item in the container
48
- * @param {mixed} key
49
- * @param {Array<mixed>} args
50
- * @param {mixed} value
51
- * @returns {Container}
52
- */
53
- set(...args: Array<mixed>): any;
54
- /**
55
- * @private
56
- * @returns {string}
57
- */
58
- inspect(): string;
59
- };
@@ -1,112 +0,0 @@
1
- /**
2
- * Constructs a Hydra ID for a given UUID and type.
3
- *
4
- * @export
5
- * @param {string} type one of PEOPLE, TEAM, ROOM
6
- * @param {any} id identifying the "TYPE" object
7
- * @param {string} cluster containing the "TYPE" object
8
- * @returns {string}
9
- */
10
- export function constructHydraId(type?: string, id?: any, cluster?: string): string;
11
- /**
12
- * @typedef {Object} DeconstructedHydraId
13
- * @property {UUID} id identifying the object
14
- * @property {String} type of the object
15
- * @property {String} cluster containing the object
16
- */
17
- /**
18
- * Deconstructs a Hydra ID.
19
- *
20
- * @export
21
- * @param {String} id Hydra style id
22
- * @returns {DeconstructedHydraId} deconstructed id
23
- */
24
- export function deconstructHydraId(id: string): DeconstructedHydraId;
25
- /**
26
- * Constructs a Hydra ID for a message based on internal UUID
27
- *
28
- * @export
29
- * @param {any} uuid
30
- * @param {string} cluster containing the message
31
- * @returns {string}
32
- */
33
- export function buildHydraMessageId(uuid: any, cluster: string): string;
34
- /**
35
- * Constructs a Hydra ID for a person based on internal UUID
36
- *
37
- * @export
38
- * @param {any} uuid
39
- * @param {string} cluster containing the person
40
- * @returns {string}
41
- */
42
- export function buildHydraPersonId(uuid: any, cluster: string): string;
43
- /**
44
- * Constructs a Hydra ID for a room based on internal UUID
45
- *
46
- * @export
47
- * @param {any} uuid
48
- * @param {string} cluster containing the room
49
- * @returns {string}
50
- */
51
- export function buildHydraRoomId(uuid: any, cluster: string): string;
52
- /**
53
- * Constructs a Hydra ID for an organization based on internal UUID
54
- *
55
- * @export
56
- * @param {any} uuid
57
- * @param {string} cluster containing the organization
58
- * @returns {string}
59
- */
60
- export function buildHydraOrgId(uuid: any, cluster: string): string;
61
- /**
62
- * Constructs a Hydra ID for an membership based on an
63
- * internal UUID for the person, and the space
64
- *
65
- * @export
66
- * @param {any} personUUID
67
- * @param {any} spaceUUID
68
- * @param {string} cluster containing the membership
69
- * @returns {string}
70
- */
71
- export function buildHydraMembershipId(personUUID: any, spaceUUID: any, cluster: string): string;
72
- /**
73
- * Returns a hydra cluster string based on a conversation url
74
- * @private
75
- * @memberof Messages
76
- * @param {Object} webex sdk instance
77
- * @param {String} conversationUrl url of space where activity took place
78
- * @returns {String} string suitable for UUID -> public ID encoding
79
- */
80
- export function getHydraClusterString(webex: any, conversationUrl: string): string;
81
- /**
82
- * Returns a Hydra roomType based on conversation tags
83
- *
84
- * @export
85
- * @param {arra} tags
86
- * @param {any} spaceUUID
87
- * @returns {string}
88
- */
89
- export function getHydraRoomType(tags: arra): string;
90
- /**
91
- * Returns file URLs for the activity, adhering to Hydra details,
92
- * e.g., https://api.ciscospark.com/v1/contents/Y2lzY29zcGF...
93
- * @see https://developer.webex.com/docs/api/v1/messages/get-message-details
94
- * @param {Object} activity from mercury
95
- * @param {string} cluster containing the files
96
- * @returns {Array} file URLs
97
- */
98
- export function getHydraFiles(activity: any, cluster: string): any[];
99
- export type DeconstructedHydraId = {
100
- /**
101
- * identifying the object
102
- */
103
- id: UUID;
104
- /**
105
- * of the object
106
- */
107
- type: string;
108
- /**
109
- * containing the object
110
- */
111
- cluster: string;
112
- };
@@ -1,7 +0,0 @@
1
- /**
2
- * While the promise returned by the decorated is unfullfilled, sets, the
3
- * specified boolean on the target class to `true`
4
- * @param {string} param
5
- * @returns {Function}
6
- */
7
- export default function whileInFlight(param: string): Function;