@sparkvault/sdk-js 16.3.0 → 16.4.0

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/dist/index.d.ts CHANGED
@@ -3660,10 +3660,12 @@ interface HelpDeskCustomer {
3660
3660
  requester_id: string;
3661
3661
  email: string;
3662
3662
  display_name: string | null;
3663
- assurance: 'identity' | 'email_pin' | 'external_sso';
3664
- /** Company-session mailbox proof asserted by the trusted server. False forbids update emails. */
3663
+ assurance: 'identity' | 'email_pin' | 'external_sso' | 'federated';
3664
+ /** Whether anyone verified the address. False forbids update emails: a company-session contact their company did not verify, or a person the organization's own identity provider signed in without verifying it. */
3665
3665
  email_verified?: boolean;
3666
3666
  email_updates?: boolean;
3667
+ /** True for a session the organization's own identity provider signed in, whose `assurance` is then `federated`: it changes none of the address's update-email choices. */
3668
+ federated?: boolean;
3667
3669
  needs_display_name: boolean;
3668
3670
  }
3669
3671
  interface HelpDeskSession {
package/dist/index.mjs CHANGED
@@ -18051,7 +18051,12 @@ class HelpDeskClient {
18051
18051
  }, undefined, false);
18052
18052
  if (revision !== this.revision)
18053
18053
  throw sessionChanged();
18054
- if (!validToken(result?.token) || result.customer?.assurance !== 'identity' || !/^hdwip_[A-Za-z0-9_-]{43}$/.test(result.identity_grant?.token)) {
18054
+ // A native sign-in opens a session at the desk's issuer: an email sign-in's customer is linked to
18055
+ // its Secure Identity (`identity`); a sign-in by the organization's own identity provider carries
18056
+ // the `federated` mark and the `federated` assurance together, never one without the other.
18057
+ const customer = result?.customer;
18058
+ const nativeIdentity = customer?.federated === true ? customer.assurance === 'federated' : customer?.assurance === 'identity';
18059
+ if (!validToken(result?.token) || !nativeIdentity || !/^hdwip_[A-Za-z0-9_-]{43}$/.test(result.identity_grant?.token)) {
18055
18060
  throw new SparkVaultError('The help desk returned an invalid support identity.', 'HELP_DESK_INVALID_RESPONSE');
18056
18061
  }
18057
18062
  this.issuedSessions.set(result, result.token);
@@ -29548,7 +29553,7 @@ class SparkVault {
29548
29553
  }
29549
29554
  /** Get the SDK version */
29550
29555
  static get version() {
29551
- return '16.3.0';
29556
+ return '16.4.0';
29552
29557
  }
29553
29558
  }
29554
29559
  if (typeof window !== 'undefined') {