@webex/webex-core 3.8.1-next.1 → 3.8.1-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.
package/README.md CHANGED
@@ -1,16 +1,6 @@
1
1
  # @webex/webex-core
2
2
 
3
- [![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
4
-
5
- > Core library for the Cisco Webex JS SDK.
6
-
7
- Defines the plugin system, storage system, common http behaviors, credentials, services, and basic logging.
8
-
9
- - [Install](#install)
10
- - [Usage](#usage)
11
- - [Contribute](#contribute)
12
- - [Maintainers](#maintainers)
13
- - [License](#license)
3
+ Core library for the Cisco Webex JS SDK.
14
4
 
15
5
  ## Install
16
6
 
@@ -18,11 +8,43 @@ Defines the plugin system, storage system, common http behaviors, credentials, s
18
8
  npm install --save @webex/webex-core
19
9
  ```
20
10
 
21
- ## Usage
11
+ ## What it Does
12
+
13
+ The webex-core package provides the foundational architecture for the Webex JavaScript SDK, including:
14
+
15
+ - Plugin system for loading and managing SDK plugins
16
+ - Storage system for data persistence across environments
17
+ - HTTP core for common request handling
18
+ - Credentials management for token handling
19
+ - Service discovery for dynamic endpoint resolution
20
+ - Logging framework for debugging
21
+
22
+ ## Basic Usage
23
+
24
+ ```js
25
+ import WebexCore from '@webex/webex-core';
26
+
27
+ // Create a basic Webex instance
28
+ const webex = new WebexCore({
29
+ credentials: {
30
+ access_token: 'your-access-token'
31
+ }
32
+ });
33
+
34
+ // Use core functionality
35
+ webex.request({
36
+ method: 'GET',
37
+ uri: 'https://webexapis.com/v1/people/me'
38
+ }).then(response => {
39
+ console.log('User info:', response.body);
40
+ });
41
+ ```
42
+
43
+ ## Configuration
22
44
 
23
45
  ### Client Scope Requirements
24
46
 
25
- To utilize the basic functionality of the `services` plugin that is bound to the `webex-core` plugin upon initialization, the following scopes must be present in the provided client's scopes:
47
+ To utilize the basic functionality of the services plugin, the following scopes must be present in the client's scopes:
26
48
 
27
49
  - `spark:all`
28
50
 
@@ -30,44 +52,82 @@ To utilize the basic functionality of the `services` plugin that is bound to the
30
52
 
31
53
  The following environment variables are used by this plugin:
32
54
 
33
- - `HYDRA_SERVICE_URL` - Stores the public hydra api url for managing Webex resources.
34
- - `U2C_SERVICE_URL` - Stores the service catalog collecting url, typically the **U2C** service.
55
+ - `HYDRA_SERVICE_URL` - Stores the public hydra api url for managing Webex resources
56
+ - `U2C_SERVICE_URL` - Stores the service catalog collecting url, typically the U2C service
35
57
  - `SQDISCOVERY_SERVICE_URL` - Stores the URL for client region information, such as country code and timezone
36
58
 
37
- ### Configuration
59
+ ### Advanced Configuration
38
60
 
39
- The `services` plugin that is bound to the `webex-core` plugin upon initialization supports the ability to inject discovery urls via the constructor:
61
+ The services plugin supports the ability to inject discovery urls via the constructor:
40
62
 
41
63
  ```js
42
- const webex = new Webex({
64
+ const webex = new WebexCore({
43
65
  config: {
44
66
  services: {
45
- // Services that are available before catalog retrieval.
67
+ // Services that are available before catalog retrieval
46
68
  discovery: {
47
69
  hydra: 'https://api.ciscospark.com/v1',
48
70
  sqdiscovery: 'https://ds.ciscospark.com/v1/region'
49
71
  },
50
72
 
51
- // Services that have a persistant host, typically for testing.
73
+ // Services that have a persistent host, typically for testing
52
74
  override: {
53
75
  serviceName: 'https://api.service.com/v1'
54
- }
76
+ },
55
77
 
56
- // Validate domains against the allowed domains.
78
+ // Validate domains against the allowed domains
57
79
  validateDomains: true,
58
80
 
59
- // The allowed domains to validate domains against.
81
+ // The allowed domains to validate domains against
60
82
  allowedDomains: ['allowed-domain']
61
83
  }
62
84
  }
63
85
  });
64
86
  ```
65
87
 
88
+ ### Default Service URLs
89
+
66
90
  The default configuration includes the following service urls:
67
91
 
68
- - `U2C_SERVICE_URL` [ **U2C** ] - `https://u2c.wbx2.com/u2c/api/v1`
69
- - `HYDRA_SERVICE_URL` [ **Hydra** ] - `https://api.ciscospark.com/v1`
70
- - `SQDISCOVERY_SERVICE_URL` [ **SQDISCOVERY** ] - `https://ds.ciscospark.com/v1/region`
92
+ - `U2C_SERVICE_URL` [U2C] - `https://u2c.wbx2.com/u2c/api/v1`
93
+ - `HYDRA_SERVICE_URL` [Hydra] - `https://webexapis.com/v1`
94
+ - `SQDISCOVERY_SERVICE_URL` [SQDISCOVERY] - `https://ds.ciscospark.com/v1/region`
95
+
96
+ ## Plugin System
97
+
98
+ WebexCore provides a plugin architecture that allows extending functionality:
99
+
100
+ ```js
101
+ import WebexCore from '@webex/webex-core';
102
+ import MyPlugin from './my-plugin';
103
+
104
+ // Register a plugin
105
+ WebexCore.registerPlugin('myPlugin', MyPlugin);
106
+
107
+ const webex = new WebexCore();
108
+ // Plugin is now available at webex.myPlugin
109
+ ```
110
+
111
+ ## Storage System
112
+
113
+ WebexCore includes a unified storage interface:
114
+
115
+ ```js
116
+ // Configure storage adapter
117
+ const webex = new WebexCore({
118
+ config: {
119
+ storage: {
120
+ adapter: 'localStorage' // or 'memory', 'indexedDB', etc.
121
+ }
122
+ }
123
+ });
124
+
125
+ // Use storage
126
+ webex.storage.put('key', 'value');
127
+ webex.storage.get('key').then(value => console.log(value));
128
+ ```
129
+
130
+ This package is the foundation for all Webex SDK functionality and is required for most other Webex SDK packages.
71
131
 
72
132
  ## Maintainers
73
133
 
@@ -79,4 +139,4 @@ Pull requests welcome. Please see [CONTRIBUTING.md](https://github.com/webex/web
79
139
 
80
140
  ## License
81
141
 
82
- © 2016-2020 Cisco and/or its affiliates. All Rights Reserved.
142
+ © 2016-2025 Cisco and/or its affiliates. All Rights Reserved.
@@ -286,7 +286,7 @@ var Batcher = _webexPlugin.default.extend({
286
286
  fingerprintResponse: function fingerprintResponse(item) {
287
287
  throw new Error('fingerprintResponse() must be implemented');
288
288
  },
289
- version: "3.8.1-next.1"
289
+ version: "3.8.1-next.2"
290
290
  });
291
291
  var _default2 = exports.default = Batcher;
292
292
  //# sourceMappingURL=batcher.js.map
@@ -558,7 +558,7 @@ var Credentials = _webexPlugin.default.extend((_dec = (0, _common.oneFlight)({
558
558
  this.refresh();
559
559
  }
560
560
  },
561
- version: "3.8.1-next.1"
561
+ version: "3.8.1-next.2"
562
562
  }, ((0, _applyDecoratedDescriptor2.default)(_obj, "getUserToken", [_dec, _dec2], (0, _getOwnPropertyDescriptor.default)(_obj, "getUserToken"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "initialize", [_dec3], (0, _getOwnPropertyDescriptor.default)(_obj, "initialize"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "invalidate", [_common.oneFlight, _dec4], (0, _getOwnPropertyDescriptor.default)(_obj, "invalidate"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "refresh", [_common.oneFlight, _dec5, _dec6], (0, _getOwnPropertyDescriptor.default)(_obj, "refresh"), _obj)), _obj)));
563
563
  var _default = exports.default = Credentials;
564
564
  //# sourceMappingURL=credentials.js.map
@@ -532,7 +532,7 @@ var Token = _webexPlugin.default.extend((_dec = (0, _common.oneFlight)({
532
532
  return res.body;
533
533
  });
534
534
  },
535
- version: "3.8.1-next.1"
535
+ version: "3.8.1-next.2"
536
536
  }, ((0, _applyDecoratedDescriptor2.default)(_obj, "downscope", [_dec], (0, _getOwnPropertyDescriptor.default)(_obj, "downscope"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "refresh", [_common.oneFlight], (0, _getOwnPropertyDescriptor.default)(_obj, "refresh"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "revoke", [_common.oneFlight], (0, _getOwnPropertyDescriptor.default)(_obj, "revoke"), _obj)), _obj)));
537
537
  var _default = exports.default = Token;
538
538
  //# sourceMappingURL=token.js.map
@@ -1067,7 +1067,7 @@ var Services = _webexPlugin.default.extend({
1067
1067
  }
1068
1068
  });
1069
1069
  },
1070
- version: "3.8.1-next.1"
1070
+ version: "3.8.1-next.2"
1071
1071
  });
1072
1072
  /* eslint-enable no-underscore-dangle */
1073
1073
  var _default = exports.default = Services;
@@ -978,7 +978,7 @@ var Services = _webexPlugin.default.extend({
978
978
  }
979
979
  });
980
980
  },
981
- version: "3.8.1-next.1"
981
+ version: "3.8.1-next.2"
982
982
  });
983
983
  /* eslint-enable no-underscore-dangle */
984
984
  var _default = exports.default = Services;
@@ -57,7 +57,7 @@ var Logger = _webexPlugin.default.extend({
57
57
  info: wrapConsoleMethod('info'),
58
58
  debug: wrapConsoleMethod('debug'),
59
59
  trace: wrapConsoleMethod('trace'),
60
- version: "3.8.1-next.1"
60
+ version: "3.8.1-next.2"
61
61
  });
62
62
  (0, _webexCore.registerPlugin)('logger', Logger);
63
63
  var _default = exports.default = Logger;
@@ -96,7 +96,7 @@ var MAX_FILE_SIZE_IN_MB = 2048;
96
96
  * @class
97
97
  */
98
98
  var WebexCore = _ampersandState.default.extend((_obj = {
99
- version: "3.8.1-next.1",
99
+ version: "3.8.1-next.2",
100
100
  children: {
101
101
  internal: _webexInternalCore.default
102
102
  },
@@ -642,7 +642,7 @@ var WebexCore = _ampersandState.default.extend((_obj = {
642
642
  });
643
643
  }
644
644
  }, ((0, _applyDecoratedDescriptor2.default)(_obj, "_uploadPhaseUpload", [_common.retry], (0, _getOwnPropertyDescriptor.default)(_obj, "_uploadPhaseUpload"), _obj)), _obj));
645
- WebexCore.version = "3.8.1-next.1";
645
+ WebexCore.version = "3.8.1-next.2";
646
646
  (0, _webexInternalCorePluginMixin.default)(_webexInternalCore.default, _config.default, interceptors);
647
647
  (0, _webexCorePluginMixin.default)(WebexCore, _config.default, interceptors);
648
648
  var _default = exports.default = WebexCore;
package/package.json CHANGED
@@ -35,12 +35,12 @@
35
35
  "@webex/eslint-config-legacy": "0.0.0",
36
36
  "@webex/jest-config-legacy": "0.0.0",
37
37
  "@webex/legacy-tools": "0.0.0",
38
- "@webex/test-helper-chai": "3.8.1-next.1",
39
- "@webex/test-helper-make-local-url": "3.8.1-next.1",
40
- "@webex/test-helper-mocha": "3.8.1-next.1",
41
- "@webex/test-helper-mock-webex": "3.8.1-next.1",
42
- "@webex/test-helper-refresh-callback": "3.8.1-next.1",
43
- "@webex/test-helper-test-users": "3.8.1-next.1",
38
+ "@webex/test-helper-chai": "3.8.1-next.2",
39
+ "@webex/test-helper-make-local-url": "3.8.1-next.2",
40
+ "@webex/test-helper-mocha": "3.8.1-next.2",
41
+ "@webex/test-helper-mock-webex": "3.8.1-next.2",
42
+ "@webex/test-helper-refresh-callback": "3.8.1-next.2",
43
+ "@webex/test-helper-test-users": "3.8.1-next.2",
44
44
  "chai": "^4.3.4",
45
45
  "chai-as-promised": "^7.1.1",
46
46
  "eslint": "^8.24.0",
@@ -48,12 +48,12 @@
48
48
  "sinon": "^9.2.4"
49
49
  },
50
50
  "dependencies": {
51
- "@webex/common": "3.8.1-next.1",
52
- "@webex/common-timers": "3.8.1-next.1",
53
- "@webex/http-core": "3.8.1-next.1",
54
- "@webex/internal-plugin-device": "3.8.1-next.1",
55
- "@webex/plugin-logger": "3.8.1-next.1",
56
- "@webex/storage-adapter-spec": "3.8.1-next.1",
51
+ "@webex/common": "3.8.1-next.2",
52
+ "@webex/common-timers": "3.8.1-next.2",
53
+ "@webex/http-core": "3.8.1-next.2",
54
+ "@webex/internal-plugin-device": "3.8.1-next.2",
55
+ "@webex/plugin-logger": "3.8.1-next.2",
56
+ "@webex/storage-adapter-spec": "3.8.1-next.2",
57
57
  "ampersand-collection": "^2.0.2",
58
58
  "ampersand-events": "^2.0.2",
59
59
  "ampersand-state": "^5.0.3",
@@ -73,5 +73,5 @@
73
73
  "test:style": "eslint ./src/**/*.*",
74
74
  "test:unit": "webex-legacy-tools test --unit --runner jest"
75
75
  },
76
- "version": "3.8.1-next.1"
76
+ "version": "3.8.1-next.2"
77
77
  }