@sparkvault/sdk-js 1.27.0 → 1.27.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
@@ -305,7 +305,8 @@ app.post('/api/auth/login', async (req, res) => {
305
305
 
306
306
  const { payload } = await jose.jwtVerify(token, JWKS, {
307
307
  issuer: `${IDENTITY_URL}/${ACCOUNT_ID}`,
308
- audience: ACCOUNT_ID
308
+ audience: ACCOUNT_ID,
309
+ algorithms: ['EdDSA']
309
310
  });
310
311
 
311
312
  // Token is valid! Create user session
@@ -2726,7 +2726,7 @@ function getStyles(options) {
2726
2726
 
2727
2727
  .sv-not-activated-badge-svg {
2728
2728
  display: block;
2729
- filter: drop-shadow(0 6px 14px rgba(245, 158, 11, 0.18));
2729
+ filter: drop-shadow(0 8px 18px rgba(15, 23, 42, 0.08));
2730
2730
  }
2731
2731
 
2732
2732
  .sv-not-activated-title {
@@ -5053,41 +5053,54 @@ const ACTIVATION_URL = 'https://app.sparkvault.com/products/identity';
5053
5053
  function createBadge() {
5054
5054
  const badge = div('sv-not-activated-badge');
5055
5055
  const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
5056
- svg.setAttribute('viewBox', '0 0 56 56');
5056
+ svg.setAttribute('viewBox', '0 0 64 64');
5057
5057
  svg.setAttribute('width', '72');
5058
5058
  svg.setAttribute('height', '72');
5059
5059
  svg.setAttribute('fill', 'none');
5060
+ svg.setAttribute('aria-hidden', 'true');
5060
5061
  svg.classList.add('sv-not-activated-badge-svg');
5061
- // Soft outer ring
5062
- const ring = document.createElementNS('http://www.w3.org/2000/svg', 'circle');
5063
- ring.setAttribute('cx', '28');
5064
- ring.setAttribute('cy', '28');
5065
- ring.setAttribute('r', '27');
5066
- ring.setAttribute('fill', '#FFFBEB');
5067
- ring.setAttribute('stroke', '#FDE68A');
5068
- ring.setAttribute('stroke-width', '1');
5069
- svg.appendChild(ring);
5070
- // Shield body
5071
- const shield = document.createElementNS('http://www.w3.org/2000/svg', 'path');
5072
- shield.setAttribute('d', 'M28 13l-10 4.2v8.6c0 6.7 4.27 12.95 10 14.4 5.73-1.45 10-7.7 10-14.4v-8.6L28 13z');
5073
- shield.setAttribute('fill', '#F59E0B');
5074
- svg.appendChild(shield);
5075
- // Exclamation bar
5076
- const bar = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
5077
- bar.setAttribute('x', '26.6');
5078
- bar.setAttribute('y', '20');
5079
- bar.setAttribute('width', '2.8');
5080
- bar.setAttribute('height', '10');
5081
- bar.setAttribute('rx', '1.4');
5082
- bar.setAttribute('fill', '#FFFFFF');
5083
- svg.appendChild(bar);
5084
- // Exclamation dot
5085
- const dot = document.createElementNS('http://www.w3.org/2000/svg', 'circle');
5086
- dot.setAttribute('cx', '28');
5087
- dot.setAttribute('cy', '34');
5088
- dot.setAttribute('r', '1.6');
5089
- dot.setAttribute('fill', '#FFFFFF');
5090
- svg.appendChild(dot);
5062
+ const surface = document.createElementNS('http://www.w3.org/2000/svg', 'circle');
5063
+ surface.setAttribute('cx', '32');
5064
+ surface.setAttribute('cy', '32');
5065
+ surface.setAttribute('r', '29.5');
5066
+ surface.setAttribute('fill', '#F8FAFC');
5067
+ surface.setAttribute('stroke', '#E2E8F0');
5068
+ surface.setAttribute('stroke-width', '1');
5069
+ svg.appendChild(surface);
5070
+ const panel = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
5071
+ panel.setAttribute('x', '18.5');
5072
+ panel.setAttribute('y', '18.5');
5073
+ panel.setAttribute('width', '27');
5074
+ panel.setAttribute('height', '27');
5075
+ panel.setAttribute('rx', '7');
5076
+ panel.setAttribute('fill', '#FFFFFF');
5077
+ panel.setAttribute('stroke', '#CBD5E1');
5078
+ panel.setAttribute('stroke-width', '1');
5079
+ svg.appendChild(panel);
5080
+ const createLine = (y, x2) => {
5081
+ const line = document.createElementNS('http://www.w3.org/2000/svg', 'path');
5082
+ line.setAttribute('d', `M24 ${y}H${x2}`);
5083
+ line.setAttribute('stroke', '#475569');
5084
+ line.setAttribute('stroke-width', '2');
5085
+ line.setAttribute('stroke-linecap', 'round');
5086
+ svg.appendChild(line);
5087
+ };
5088
+ createLine('26', '40');
5089
+ createLine('32', '40');
5090
+ createLine('38', '35');
5091
+ const createKnob = (cx, cy) => {
5092
+ const knob = document.createElementNS('http://www.w3.org/2000/svg', 'circle');
5093
+ knob.setAttribute('cx', cx);
5094
+ knob.setAttribute('cy', cy);
5095
+ knob.setAttribute('r', '2.5');
5096
+ knob.setAttribute('fill', '#4F46E5');
5097
+ knob.setAttribute('stroke', '#FFFFFF');
5098
+ knob.setAttribute('stroke-width', '1.5');
5099
+ svg.appendChild(knob);
5100
+ };
5101
+ createKnob('30', '26');
5102
+ createKnob('36', '32');
5103
+ createKnob('28', '38');
5091
5104
  badge.appendChild(svg);
5092
5105
  return badge;
5093
5106
  }
@@ -5199,6 +5212,14 @@ class ProductNotConfiguredView {
5199
5212
  * Orchestrates view state and rendering for identity verification flows.
5200
5213
  * Uses extracted handlers for TOTP and Passkey operations.
5201
5214
  */
5215
+ const SPARKLINK_CSP_BLOCKED_ERROR = {
5216
+ message: [
5217
+ 'Connection blocked by security policy.',
5218
+ 'Please contact the site administrator to add wss://ws.sparkvault.com',
5219
+ 'to the Content-Security-Policy connect-src directive.',
5220
+ ].join(' '),
5221
+ code: 'sparklink_csp_blocked',
5222
+ };
5202
5223
  class IdentityRenderer {
5203
5224
  constructor(container, api, options, callbacks) {
5204
5225
  // View management
@@ -5238,7 +5259,6 @@ class IdentityRenderer {
5238
5259
  this.callbacks.onSuccess(result);
5239
5260
  }
5240
5261
  catch (err) {
5241
- // eslint-disable-next-line no-console
5242
5262
  console.warn('[SparkVault SDK] onSuccess threw, continuing to redirect', err);
5243
5263
  }
5244
5264
  }
@@ -5645,8 +5665,7 @@ class IdentityRenderer {
5645
5665
  // CSP blocking WebSocket - provide developer-friendly error
5646
5666
  this.setState({
5647
5667
  view: 'error',
5648
- message: 'Connection blocked by security policy. Please contact the site administrator to add wss://*.sparkvault.com to the Content-Security-Policy connect-src directive.',
5649
- code: 'sparklink_csp_blocked',
5668
+ ...SPARKLINK_CSP_BLOCKED_ERROR,
5650
5669
  });
5651
5670
  }
5652
5671
  else {
@@ -6154,8 +6173,7 @@ class IdentityRenderer {
6154
6173
  if (wsResult.error === 'csp') {
6155
6174
  this.setState({
6156
6175
  view: 'error',
6157
- message: 'Connection blocked by security policy. Please contact the site administrator to add wss://*.sparkvault.com to the Content-Security-Policy connect-src directive.',
6158
- code: 'sparklink_csp_blocked',
6176
+ ...SPARKLINK_CSP_BLOCKED_ERROR,
6159
6177
  });
6160
6178
  }
6161
6179
  else {