@sparkvault/sdk-js 19.0.1 → 19.1.1

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 (133) hide show
  1. package/README.md +26 -4
  2. package/dist/npm/chunks/index-C97091lF.mjs +12959 -0
  3. package/dist/npm/chunks/index-C97091lF.mjs.map +1 -0
  4. package/dist/npm/chunks/index-D_p_8VO7.cjs +13024 -0
  5. package/dist/npm/chunks/index-D_p_8VO7.cjs.map +1 -0
  6. package/dist/npm/identity.cjs +23 -0
  7. package/dist/npm/identity.cjs.map +1 -0
  8. package/dist/npm/identity.mjs +12 -0
  9. package/dist/npm/identity.mjs.map +1 -0
  10. package/dist/{index.cjs → npm/index.cjs} +802 -13759
  11. package/dist/npm/index.cjs.map +1 -0
  12. package/dist/{index.mjs → npm/index.mjs} +203 -13159
  13. package/dist/npm/index.mjs.map +1 -0
  14. package/dist/sparkvault-identity.js +2 -0
  15. package/dist/sparkvault-identity.js.map +1 -0
  16. package/dist/sparkvault.js +1 -1
  17. package/dist/sparkvault.js.map +1 -1
  18. package/dist/types/identity.d.ts +8 -0
  19. package/dist/{index.d.ts → types/index.d.ts} +4 -790
  20. package/dist/types/shared/errors-C-gjmGBs.d.ts +800 -0
  21. package/package.json +20 -9
  22. package/dist/api-base.d.ts +0 -116
  23. package/dist/auto-init.d.ts +0 -32
  24. package/dist/config.d.ts +0 -79
  25. package/dist/entropy/index.d.ts +0 -35
  26. package/dist/entropy/types.d.ts +0 -32
  27. package/dist/errors.d.ts +0 -146
  28. package/dist/folders/index.d.ts +0 -102
  29. package/dist/folders/types.d.ts +0 -91
  30. package/dist/health.d.ts +0 -18
  31. package/dist/http.d.ts +0 -46
  32. package/dist/index.cjs.map +0 -1
  33. package/dist/index.mjs.map +0 -1
  34. package/dist/ingots/fetch-download.d.ts +0 -78
  35. package/dist/ingots/history.d.ts +0 -4
  36. package/dist/ingots/index.d.ts +0 -388
  37. package/dist/ingots/revision.d.ts +0 -4
  38. package/dist/ingots/types.d.ts +0 -556
  39. package/dist/logger.d.ts +0 -32
  40. package/dist/notify/index.d.ts +0 -154
  41. package/dist/notify/types.d.ts +0 -232
  42. package/dist/products/help-desk/client.d.ts +0 -198
  43. package/dist/products/help-desk/desk-id.d.ts +0 -2
  44. package/dist/products/help-desk/form-draft.d.ts +0 -37
  45. package/dist/products/help-desk/form-types.d.ts +0 -123
  46. package/dist/products/help-desk/form.d.ts +0 -83
  47. package/dist/products/help-desk/index.d.ts +0 -47
  48. package/dist/products/help-desk/kb-client.d.ts +0 -48
  49. package/dist/products/help-desk/kb-types.d.ts +0 -59
  50. package/dist/products/help-desk/modal.d.ts +0 -8
  51. package/dist/products/help-desk/styles.d.ts +0 -9
  52. package/dist/products/help-desk/support-analytics-types.d.ts +0 -32
  53. package/dist/products/help-desk/support-analytics.d.ts +0 -3
  54. package/dist/products/help-desk/support-brand.d.ts +0 -49
  55. package/dist/products/help-desk/support-controller.d.ts +0 -4
  56. package/dist/products/help-desk/support-history.d.ts +0 -38
  57. package/dist/products/help-desk/support-launcher.d.ts +0 -12
  58. package/dist/products/help-desk/support-styles.d.ts +0 -14
  59. package/dist/products/help-desk/support-types.d.ts +0 -66
  60. package/dist/products/help-desk/support-view.d.ts +0 -173
  61. package/dist/products/help-desk/types.d.ts +0 -285
  62. package/dist/products/help-desk/widget-identity.d.ts +0 -32
  63. package/dist/products/identity/api.d.ts +0 -237
  64. package/dist/products/identity/container.d.ts +0 -44
  65. package/dist/products/identity/dialog-launcher.d.ts +0 -133
  66. package/dist/products/identity/federation-flow.d.ts +0 -31
  67. package/dist/products/identity/handlers/otp-handler.d.ts +0 -69
  68. package/dist/products/identity/handlers/passkey-handler.d.ts +0 -105
  69. package/dist/products/identity/handlers/sparklink-handler.d.ts +0 -34
  70. package/dist/products/identity/index.d.ts +0 -296
  71. package/dist/products/identity/inline-container.d.ts +0 -53
  72. package/dist/products/identity/methods.d.ts +0 -19
  73. package/dist/products/identity/modal.d.ts +0 -51
  74. package/dist/products/identity/pending-signin.d.ts +0 -102
  75. package/dist/products/identity/popup-launcher.d.ts +0 -73
  76. package/dist/products/identity/renderer.d.ts +0 -525
  77. package/dist/products/identity/state.d.ts +0 -84
  78. package/dist/products/identity/styles.d.ts +0 -31
  79. package/dist/products/identity/types.d.ts +0 -561
  80. package/dist/products/identity/utils/cooldown-timer.d.ts +0 -73
  81. package/dist/products/identity/utils.d.ts +0 -85
  82. package/dist/products/identity/views/backup-verify.d.ts +0 -42
  83. package/dist/products/identity/views/base.d.ts +0 -51
  84. package/dist/products/identity/views/error.d.ts +0 -65
  85. package/dist/products/identity/views/icons.d.ts +0 -41
  86. package/dist/products/identity/views/identity-input.d.ts +0 -80
  87. package/dist/products/identity/views/index.d.ts +0 -20
  88. package/dist/products/identity/views/loading.d.ts +0 -23
  89. package/dist/products/identity/views/method-button.d.ts +0 -14
  90. package/dist/products/identity/views/method-select.d.ts +0 -42
  91. package/dist/products/identity/views/origin-not-allowed.d.ts +0 -25
  92. package/dist/products/identity/views/otp-verify.d.ts +0 -58
  93. package/dist/products/identity/views/passkey-auto.d.ts +0 -22
  94. package/dist/products/identity/views/passkey-prompt.d.ts +0 -25
  95. package/dist/products/identity/views/passkey.d.ts +0 -38
  96. package/dist/products/identity/views/product-not-configured.d.ts +0 -21
  97. package/dist/products/identity/views/service-unavailable.d.ts +0 -21
  98. package/dist/products/identity/views/sms-consent.d.ts +0 -16
  99. package/dist/products/identity/views/sparklink-waiting.d.ts +0 -40
  100. package/dist/products/identity/views/two-factor.d.ts +0 -37
  101. package/dist/products/index.d.ts +0 -51
  102. package/dist/products/messaging/index.d.ts +0 -38
  103. package/dist/products/messaging/types.d.ts +0 -162
  104. package/dist/products/notify/index.d.ts +0 -436
  105. package/dist/products/notify/project-types.d.ts +0 -44
  106. package/dist/products/notify/projects.d.ts +0 -15
  107. package/dist/products/notify/types.d.ts +0 -1327
  108. package/dist/products/structured-ingots/index.d.ts +0 -31
  109. package/dist/products/structured-ingots/types-client.d.ts +0 -19
  110. package/dist/products/structured-ingots/types.d.ts +0 -293
  111. package/dist/products/structured-ingots/validation.d.ts +0 -25
  112. package/dist/request-path.d.ts +0 -44
  113. package/dist/sparks/index.d.ts +0 -91
  114. package/dist/sparks/types.d.ts +0 -304
  115. package/dist/ui/chrome.d.ts +0 -16
  116. package/dist/ui/ds-tokens.d.ts +0 -59
  117. package/dist/ui/inline-shell.d.ts +0 -19
  118. package/dist/ui/live-region.d.ts +0 -15
  119. package/dist/ui/modal-shell.d.ts +0 -67
  120. package/dist/ui/target.d.ts +0 -6
  121. package/dist/utils/dom.d.ts +0 -26
  122. package/dist/vault-session.d.ts +0 -2
  123. package/dist/vaults/index.d.ts +0 -254
  124. package/dist/vaults/types.d.ts +0 -368
  125. package/dist/vaults/upload/api.d.ts +0 -310
  126. package/dist/vaults/upload/chrome.d.ts +0 -21
  127. package/dist/vaults/upload/container.d.ts +0 -37
  128. package/dist/vaults/upload/index.d.ts +0 -76
  129. package/dist/vaults/upload/inline-container.d.ts +0 -41
  130. package/dist/vaults/upload/modal.d.ts +0 -55
  131. package/dist/vaults/upload/renderer.d.ts +0 -150
  132. package/dist/vaults/upload/styles.d.ts +0 -14
  133. package/dist/vaults/upload/types.d.ts +0 -220
package/README.md CHANGED
@@ -30,7 +30,7 @@
30
30
 
31
31
  - `data-account-id` initializes the SDK, and `window.SparkVault` is the instance; without it `window.SparkVault` is the class (`SparkVault.init({ accountId })`). `data-debug="true"` logs verbosely.
32
32
  - Load it as a plain script, ahead of the code that calls it: an `async` script runs whenever its download completes, so an inline script after it can find `SparkVault` unset.
33
- - `sdk/v1/sparkvault.js` is the stable URL, replaced by each release (bust with `?v=<version>`). To pin one build, take the content-hashed file and its SRI digest that `https://cdn.sparkvault.com/sdk/v1/version.json` names (`{ version, hash, umd, integrity }`):
33
+ - `sdk/v1/sparkvault.js` is the stable URL, replaced by each release (bust with `?v=<version>`). To pin one build, read the full SDK's top-level `version`, `hash`, `umd` and `integrity` fields from `https://cdn.sparkvault.com/sdk/v1/version.json`:
34
34
 
35
35
  ```html
36
36
  <script
@@ -48,13 +48,35 @@ npm install @sparkvault/sdk-js
48
48
  ```
49
49
 
50
50
  ```js
51
- import SparkVault from '@sparkvault/sdk-js'; // ESM → dist/index.mjs
52
- const { SparkVault } = require('@sparkvault/sdk-js'); // CJS → dist/index.cjs
51
+ import SparkVault from '@sparkvault/sdk-js'; // ESM → dist/npm/index.mjs
52
+ const { SparkVault } = require('@sparkvault/sdk-js'); // CJS → dist/npm/index.cjs
53
53
 
54
54
  const sv = SparkVault.init({ accountId: 'acc_YOUR_ACCOUNT_ID' });
55
55
  ```
56
56
 
57
- Types ship in `dist/index.d.ts` (the sign-in result is `VerifyResult`); the `browser` field is the UMD bundle the CDN serves (`dist/sparkvault.js`).
57
+ Types ship in `dist/types/index.d.ts` (the sign-in result is `VerifyResult`); the `browser` field is the UMD bundle the CDN serves (`dist/sparkvault.js`).
58
+
59
+ ### Identity entry
60
+
61
+ - Import `@sparkvault/sdk-js/identity` when a page only needs sign-in. It uses the same configuration, validation, popup and recovery implementation as `products.identity`, without bundling the other products.
62
+ - `init(config)` returns the Identity module directly. Importing the entry does not initialize an account or change `window.SparkVault`.
63
+ - `isRecoveryPending()` detects a return that needs completing without consuming it or initializing Identity; `version` identifies the package release.
64
+
65
+ ```js
66
+ import { init, isRecoveryPending } from '@sparkvault/sdk-js/identity';
67
+
68
+ const identity = init({ accountId: 'acc_YOUR_ACCOUNT_ID' });
69
+ identity.attach('.login-btn', { onSuccess: signInToApp });
70
+ if (isRecoveryPending()) {
71
+ identity.handleRedirectResult({ onSuccess: signInToApp })
72
+ .catch((error) => console.error('Sign-in failed:', error.message));
73
+ }
74
+ ```
75
+
76
+ - `signInToApp` sends the returned token to your backend for verification, as in the quickstart below.
77
+ - ESM and CommonJS resolve to `dist/npm/identity.mjs` and `dist/npm/identity.cjs`; types resolve to `dist/types/identity.d.ts`. All exports are named. Package entries share their class constructors within each format and one declaration graph, so existing helpers typed against the root Identity module accept this entry's instances.
78
+ - For a script tag, load `https://cdn.sparkvault.com/sdk/v1/sparkvault-identity.js` before your consumer script, then call `SparkVaultIdentity.init(config)`. It does not read `data-account-id` or initialize automatically.
79
+ - The `identity` descriptor in `https://cdn.sparkvault.com/sdk/v1/version.json` names the immutable `sparkvault-identity.<hash>.js` and its SRI `integrity`; the manifest's top-level `version` applies to both entries.
58
80
 
59
81
  ## Quickstart: sign in
60
82