@webex/webex-core 3.12.0 → 3.13.0-next.10

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 (92) hide show
  1. package/.repo-context.json +653 -0
  2. package/.sdd/manifest.json +615 -0
  3. package/AGENTS.md +209 -0
  4. package/README.md +6 -3
  5. package/dist/config.js +46 -1
  6. package/dist/config.js.map +1 -1
  7. package/dist/credentials-config.js +21 -1
  8. package/dist/credentials-config.js.map +1 -1
  9. package/dist/index.js +14 -0
  10. package/dist/index.js.map +1 -1
  11. package/dist/interceptors/auth.js +10 -1
  12. package/dist/interceptors/auth.js.map +1 -1
  13. package/dist/interceptors/catalog-url.js +87 -0
  14. package/dist/interceptors/catalog-url.js.map +1 -0
  15. package/dist/interceptors/payload-transformer.js +25 -4
  16. package/dist/interceptors/payload-transformer.js.map +1 -1
  17. package/dist/lib/batcher.js +23 -7
  18. package/dist/lib/batcher.js.map +1 -1
  19. package/dist/lib/credentials/credentials.js +117 -5
  20. package/dist/lib/credentials/credentials.js.map +1 -1
  21. package/dist/lib/credentials/token.js +23 -9
  22. package/dist/lib/credentials/token.js.map +1 -1
  23. package/dist/lib/domains.js +90 -0
  24. package/dist/lib/domains.js.map +1 -0
  25. package/dist/lib/interceptors/service.js +5 -1
  26. package/dist/lib/interceptors/service.js.map +1 -1
  27. package/dist/lib/services/catalog-auth.js +114 -0
  28. package/dist/lib/services/catalog-auth.js.map +1 -0
  29. package/dist/lib/services/service-catalog.js +108 -18
  30. package/dist/lib/services/service-catalog.js.map +1 -1
  31. package/dist/lib/services/services.js +287 -40
  32. package/dist/lib/services/services.js.map +1 -1
  33. package/dist/lib/services-v2/service-catalog.js +14 -13
  34. package/dist/lib/services-v2/service-catalog.js.map +1 -1
  35. package/dist/lib/services-v2/services-v2.js +294 -44
  36. package/dist/lib/services-v2/services-v2.js.map +1 -1
  37. package/dist/lib/static-asset-loader.js +153 -0
  38. package/dist/lib/static-asset-loader.js.map +1 -0
  39. package/dist/plugins/logger.js +1 -1
  40. package/dist/webex-core.js +11 -3
  41. package/dist/webex-core.js.map +1 -1
  42. package/docs/adr/index.md +32 -0
  43. package/docs/architecture.md +298 -0
  44. package/docs/getting-started.md +96 -0
  45. package/docs/index.md +55 -0
  46. package/docs/specs/README.md +76 -0
  47. package/package.json +13 -13
  48. package/schemas/repo-context.schema.json +796 -0
  49. package/src/config.js +50 -1
  50. package/src/credentials-config.js +22 -0
  51. package/src/docs/README.md +732 -0
  52. package/src/index.js +2 -0
  53. package/src/interceptors/auth.js +14 -1
  54. package/src/interceptors/catalog-url.js +66 -0
  55. package/src/interceptors/docs/README.md +658 -0
  56. package/src/interceptors/payload-transformer.js +23 -1
  57. package/src/lib/batcher.js +25 -10
  58. package/src/lib/credentials/credentials.js +106 -4
  59. package/src/lib/credentials/docs/README.md +847 -0
  60. package/src/lib/credentials/token.js +15 -8
  61. package/src/lib/domains.ts +94 -0
  62. package/src/lib/interceptors/service.js +11 -3
  63. package/src/lib/services/catalog-auth.js +112 -0
  64. package/src/lib/services/docs/README.md +737 -0
  65. package/src/lib/services/service-catalog.js +112 -16
  66. package/src/lib/services/services.js +274 -24
  67. package/src/lib/services-v2/docs/README.md +751 -0
  68. package/src/lib/services-v2/service-catalog.ts +16 -12
  69. package/src/lib/services-v2/services-v2.ts +282 -26
  70. package/src/lib/static-asset-loader.ts +128 -0
  71. package/src/lib/storage/docs/README.md +646 -0
  72. package/src/webex-core.js +8 -0
  73. package/test/fixtures/activation-email.ts +22 -0
  74. package/test/integration/spec/credentials/credentials.js +3 -1
  75. package/test/integration/spec/credentials/token.js +8 -0
  76. package/test/integration/spec/services/service-catalog.js +5 -0
  77. package/test/integration/spec/services/services.js +183 -112
  78. package/test/integration/spec/services-v2/services-v2.js +169 -98
  79. package/test/integration/spec/unit-browser/token.js +7 -2
  80. package/test/unit/spec/credentials/credentials.js +326 -3
  81. package/test/unit/spec/credentials/token.js +259 -6
  82. package/test/unit/spec/interceptors/auth.js +92 -1
  83. package/test/unit/spec/interceptors/catalog-url.js +224 -0
  84. package/test/unit/spec/interceptors/payload-transformer.js +119 -1
  85. package/test/unit/spec/lib/batcher.js +56 -0
  86. package/test/unit/spec/services/interceptors/service.js +35 -1
  87. package/test/unit/spec/services/service-catalog.js +368 -11
  88. package/test/unit/spec/services/services.js +783 -10
  89. package/test/unit/spec/services-v2/service-catalog.ts +134 -11
  90. package/test/unit/spec/services-v2/services-v2.ts +825 -10
  91. package/test/unit/spec/static-asset-loader.ts +224 -0
  92. package/test/unit/spec/webex-core.js +77 -1
package/src/config.js CHANGED
@@ -17,6 +17,13 @@ export default {
17
17
  trackingIdSuffix: '',
18
18
  AlternateLogger: undefined,
19
19
  credentials: new CredentialsConfig(),
20
+ /**
21
+ * Explicitly selects the Webex environment. When omitted, the environment is inferred from the
22
+ * U2C discovery URL.
23
+ *
24
+ * @type {'integration'|'production'|undefined}
25
+ */
26
+ environment: undefined,
20
27
  fedramp: process.env.ENABLE_FEDRAMP || false,
21
28
  services: {
22
29
  /**
@@ -27,6 +34,33 @@ export default {
27
34
  */
28
35
  useUserOnboardingServiceForActivations: false,
29
36
 
37
+ /**
38
+ * When true, requests the U2C catalog override.
39
+ *
40
+ * @type {boolean}
41
+ */
42
+ useCatalogOverride: false,
43
+
44
+ /**
45
+ * When true, skips fetching the preauth catalog during initialization
46
+ * while the user is unauthenticated (no existing token). The catalog is
47
+ * expected to be collected manually later instead. When false (default),
48
+ * the preauth catalog is collected automatically during init.
49
+ *
50
+ * @type {boolean}
51
+ */
52
+ skipPreauthCatalogOnUnauthenticated: false,
53
+
54
+ /**
55
+ * Maximum time (in milliseconds) to wait for the initial service catalog
56
+ * collection when `waitForCatalogInit` is enabled, before letting
57
+ * `services.ready` (and therefore `webex.ready`) fire anyway. Prevents a
58
+ * hung catalog request from leaving the app on a permanent spinner.
59
+ *
60
+ * @type {number}
61
+ */
62
+ catalogInitTimeout: 15000,
63
+
30
64
  /**
31
65
  * A list of services that are available prior to catalog collection.
32
66
  *
@@ -50,7 +84,7 @@ export default {
50
84
  *
51
85
  * @type {string}
52
86
  */
53
- u2c: process.env.U2C_SERVICE_URL || 'https://u2c.wbx2.com/u2c/api/v1',
87
+ u2c: process.env.U2C_SERVICE_URL || 'https://u2c.svc.webex.com/u2c/api/v1',
54
88
  },
55
89
 
56
90
  /**
@@ -60,6 +94,16 @@ export default {
60
94
  */
61
95
  validateDomains: true,
62
96
 
97
+ /**
98
+ * When true, enables the CatalogUrlInterceptor which validates that all
99
+ * outbound request URLs are in the service catalog or allowed domains.
100
+ * This prevents SSRF attacks where attacker-controlled URLs could be
101
+ * sent to the SDK.
102
+ *
103
+ * @type {boolean}
104
+ */
105
+ validateCatalogUrls: false,
106
+
63
107
  /**
64
108
  * services that don't need auth validation
65
109
  */
@@ -91,6 +135,11 @@ export default {
91
135
  cacheU2C: false,
92
136
  },
93
137
  payloadTransformer: {
138
+ /**
139
+ * When true, inbound payload transforms run at most once for the same successful response object.
140
+ * This supports request flows that pass a response through more than one interceptor pipeline.
141
+ */
142
+ skipRepeatedInboundTransforms: false,
94
143
  predicates: [],
95
144
  transforms: [],
96
145
  },
@@ -110,6 +110,15 @@ const CredentialsConfig = AmpState.extend({
110
110
  * @type {string}
111
111
  */
112
112
  cisService: ['string', false, 'webex'],
113
+
114
+ /**
115
+ * Whether the client is permitted to upgrade its refresh token scope
116
+ * Should only be set to true if client has extended feature 'refresh-token-scopes-upgrade-allowed'
117
+ * If true, the refresh token scope will be requested to be increased or decreased on refresh,
118
+ * to match the configured scope.
119
+ * @type {boolean}
120
+ */
121
+ canUpgradeScope: ['boolean', false, false],
113
122
  },
114
123
 
115
124
  derived: {
@@ -195,6 +204,19 @@ const CredentialsConfig = AmpState.extend({
195
204
  cache: false,
196
205
  },
197
206
 
207
+ /**
208
+ * URL used to initiate the IdBroker third-party (social provider)
209
+ * sign-in flow.
210
+ * @type {string}
211
+ */
212
+ thirdPartyLoginUrl: {
213
+ deps: ['idbroker.url'],
214
+ fn() {
215
+ return `${this.idbroker.url}/idb/ThirdPartyLogin`;
216
+ },
217
+ cache: false,
218
+ },
219
+
198
220
  /**
199
221
  * Set password URL
200
222
  * @type {string}