@sparkvault/sdk-js 11.1.1 → 11.1.3
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 +2 -37
- package/dist/index.cjs +18 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +72 -72
- package/dist/index.mjs +18 -5
- package/dist/index.mjs.map +1 -1
- package/dist/ingots/index.d.ts +1 -1
- package/dist/logger.d.ts +0 -5
- package/dist/products/identity/container.d.ts +0 -8
- package/dist/products/identity/index.d.ts +1 -3
- package/dist/products/identity/methods.d.ts +0 -6
- package/dist/products/identity/utils.d.ts +1 -27
- package/dist/products/identity/views/icons.d.ts +0 -4
- package/dist/products/index.d.ts +1 -3
- package/dist/sparkvault.js +1 -1
- package/dist/sparkvault.js.map +1 -1
- package/dist/vaults/index.d.ts +1 -1
- package/dist/vaults/upload/container.d.ts +0 -8
- package/dist/vaults/upload/index.d.ts +1 -2
- package/package.json +1 -1
- package/dist/products/identity/handlers/index.d.ts +0 -9
- package/dist/products/identity/utils/index.d.ts +0 -5
package/dist/index.d.ts
CHANGED
|
@@ -365,78 +365,6 @@ interface TokenClaims {
|
|
|
365
365
|
picture?: string;
|
|
366
366
|
}
|
|
367
367
|
|
|
368
|
-
/**
|
|
369
|
-
* SparkVault SDK Error Types
|
|
370
|
-
*/
|
|
371
|
-
declare class SparkVaultError extends Error {
|
|
372
|
-
readonly code: string;
|
|
373
|
-
readonly statusCode?: number;
|
|
374
|
-
readonly details?: Record<string, unknown>;
|
|
375
|
-
/**
|
|
376
|
-
* The answer's `Retry-After`, in ms from the answer, read as the platform's
|
|
377
|
-
* transfer policy reads it (RFC 9110 §10.2.3: delay-seconds or an
|
|
378
|
-
* HTTP-date): the earliest a next attempt can expect another answer, which
|
|
379
|
-
* every retry the SDK makes waits out as a floor. Null when the answer
|
|
380
|
-
* carried none the policy could read, or no answer arrived.
|
|
381
|
-
*/
|
|
382
|
-
readonly retryAfterMs: number | null;
|
|
383
|
-
constructor(message: string, code: string, statusCode?: number, details?: Record<string, unknown>, retryAfterMs?: number | null);
|
|
384
|
-
}
|
|
385
|
-
declare class AuthenticationError extends SparkVaultError {
|
|
386
|
-
constructor(message: string, details?: Record<string, unknown>, retryAfterMs?: number | null);
|
|
387
|
-
}
|
|
388
|
-
declare class AuthorizationError extends SparkVaultError {
|
|
389
|
-
constructor(message: string, details?: Record<string, unknown>, retryAfterMs?: number | null);
|
|
390
|
-
}
|
|
391
|
-
declare class ValidationError extends SparkVaultError {
|
|
392
|
-
constructor(message: string, details?: Record<string, unknown>, retryAfterMs?: number | null);
|
|
393
|
-
}
|
|
394
|
-
/**
|
|
395
|
-
* The pooled-capacity resource a quota gate refers to. Only the byte pools
|
|
396
|
-
* hard-gate: licenses are assigned per member, never drawn from a pool
|
|
397
|
-
* (inviting and licensing are never quota-gated), and Identity soft-gates
|
|
398
|
-
* through its own path.
|
|
399
|
-
*/
|
|
400
|
-
type QuotaResource = 'storage' | 'bandwidth';
|
|
401
|
-
/**
|
|
402
|
-
* Plan required gate (402 PLAN_REQUIRED) — the account has no active
|
|
403
|
-
* subscription and attempted a billable/create action. Surface a subscribe CTA
|
|
404
|
-
* to admins, or "ask your account admin" to members.
|
|
405
|
-
*/
|
|
406
|
-
declare class PlanRequiredError extends SparkVaultError {
|
|
407
|
-
constructor(message: string, details?: Record<string, unknown>, retryAfterMs?: number | null);
|
|
408
|
-
}
|
|
409
|
-
/**
|
|
410
|
-
* Quota exceeded gate (402 QUOTA_EXCEEDED) — a pooled-capacity limit is
|
|
411
|
-
* exhausted. `resource` identifies which pool so callers can point the CTA at
|
|
412
|
-
* the right capacity block.
|
|
413
|
-
*/
|
|
414
|
-
declare class QuotaExceededError extends SparkVaultError {
|
|
415
|
-
readonly resource?: QuotaResource;
|
|
416
|
-
constructor(message: string, details?: Record<string, unknown>, retryAfterMs?: number | null);
|
|
417
|
-
}
|
|
418
|
-
/**
|
|
419
|
-
* Notify subscription gate (403 NOTIFY_SUBSCRIPTION_REQUIRED) — the account has
|
|
420
|
-
* no active Notify subscription and attempted a send. Distinct from a generic
|
|
421
|
-
* authorization failure: the credential is fine and re-authenticating changes
|
|
422
|
-
* nothing, so surface a subscribe CTA rather than a sign-in prompt.
|
|
423
|
-
*/
|
|
424
|
-
declare class NotifySubscriptionRequiredError extends SparkVaultError {
|
|
425
|
-
constructor(message: string, details?: Record<string, unknown>, retryAfterMs?: number | null);
|
|
426
|
-
}
|
|
427
|
-
declare class NetworkError extends SparkVaultError {
|
|
428
|
-
constructor(message: string, details?: Record<string, unknown>);
|
|
429
|
-
}
|
|
430
|
-
declare class TimeoutError extends SparkVaultError {
|
|
431
|
-
constructor(message?: string);
|
|
432
|
-
}
|
|
433
|
-
declare class UserCancelledError extends SparkVaultError {
|
|
434
|
-
constructor(message?: string);
|
|
435
|
-
}
|
|
436
|
-
declare class PopupBlockedError extends SparkVaultError {
|
|
437
|
-
constructor();
|
|
438
|
-
}
|
|
439
|
-
|
|
440
368
|
/**
|
|
441
369
|
* Identity Module
|
|
442
370
|
*
|
|
@@ -3409,6 +3337,78 @@ declare const logger: {
|
|
|
3409
3337
|
groupEnd: () => void;
|
|
3410
3338
|
};
|
|
3411
3339
|
|
|
3340
|
+
/**
|
|
3341
|
+
* SparkVault SDK Error Types
|
|
3342
|
+
*/
|
|
3343
|
+
declare class SparkVaultError extends Error {
|
|
3344
|
+
readonly code: string;
|
|
3345
|
+
readonly statusCode?: number;
|
|
3346
|
+
readonly details?: Record<string, unknown>;
|
|
3347
|
+
/**
|
|
3348
|
+
* The answer's `Retry-After`, in ms from the answer, read as the platform's
|
|
3349
|
+
* transfer policy reads it (RFC 9110 §10.2.3: delay-seconds or an
|
|
3350
|
+
* HTTP-date): the earliest a next attempt can expect another answer, which
|
|
3351
|
+
* every retry the SDK makes waits out as a floor. Null when the answer
|
|
3352
|
+
* carried none the policy could read, or no answer arrived.
|
|
3353
|
+
*/
|
|
3354
|
+
readonly retryAfterMs: number | null;
|
|
3355
|
+
constructor(message: string, code: string, statusCode?: number, details?: Record<string, unknown>, retryAfterMs?: number | null);
|
|
3356
|
+
}
|
|
3357
|
+
declare class AuthenticationError extends SparkVaultError {
|
|
3358
|
+
constructor(message: string, details?: Record<string, unknown>, retryAfterMs?: number | null);
|
|
3359
|
+
}
|
|
3360
|
+
declare class AuthorizationError extends SparkVaultError {
|
|
3361
|
+
constructor(message: string, details?: Record<string, unknown>, retryAfterMs?: number | null);
|
|
3362
|
+
}
|
|
3363
|
+
declare class ValidationError extends SparkVaultError {
|
|
3364
|
+
constructor(message: string, details?: Record<string, unknown>, retryAfterMs?: number | null);
|
|
3365
|
+
}
|
|
3366
|
+
/**
|
|
3367
|
+
* The pooled-capacity resource a quota gate refers to. Only the byte pools
|
|
3368
|
+
* hard-gate: licenses are assigned per member, never drawn from a pool
|
|
3369
|
+
* (inviting and licensing are never quota-gated), and Identity soft-gates
|
|
3370
|
+
* through its own path.
|
|
3371
|
+
*/
|
|
3372
|
+
type QuotaResource = 'storage' | 'bandwidth';
|
|
3373
|
+
/**
|
|
3374
|
+
* Plan required gate (402 PLAN_REQUIRED) — the account has no active
|
|
3375
|
+
* subscription and attempted a billable/create action. Surface a subscribe CTA
|
|
3376
|
+
* to admins, or "ask your account admin" to members.
|
|
3377
|
+
*/
|
|
3378
|
+
declare class PlanRequiredError extends SparkVaultError {
|
|
3379
|
+
constructor(message: string, details?: Record<string, unknown>, retryAfterMs?: number | null);
|
|
3380
|
+
}
|
|
3381
|
+
/**
|
|
3382
|
+
* Quota exceeded gate (402 QUOTA_EXCEEDED) — a pooled-capacity limit is
|
|
3383
|
+
* exhausted. `resource` identifies which pool so callers can point the CTA at
|
|
3384
|
+
* the right capacity block.
|
|
3385
|
+
*/
|
|
3386
|
+
declare class QuotaExceededError extends SparkVaultError {
|
|
3387
|
+
readonly resource?: QuotaResource;
|
|
3388
|
+
constructor(message: string, details?: Record<string, unknown>, retryAfterMs?: number | null);
|
|
3389
|
+
}
|
|
3390
|
+
/**
|
|
3391
|
+
* Notify subscription gate (403 NOTIFY_SUBSCRIPTION_REQUIRED) — the account has
|
|
3392
|
+
* no active Notify subscription and attempted a send. Distinct from a generic
|
|
3393
|
+
* authorization failure: the credential is fine and re-authenticating changes
|
|
3394
|
+
* nothing, so surface a subscribe CTA rather than a sign-in prompt.
|
|
3395
|
+
*/
|
|
3396
|
+
declare class NotifySubscriptionRequiredError extends SparkVaultError {
|
|
3397
|
+
constructor(message: string, details?: Record<string, unknown>, retryAfterMs?: number | null);
|
|
3398
|
+
}
|
|
3399
|
+
declare class NetworkError extends SparkVaultError {
|
|
3400
|
+
constructor(message: string, details?: Record<string, unknown>);
|
|
3401
|
+
}
|
|
3402
|
+
declare class TimeoutError extends SparkVaultError {
|
|
3403
|
+
constructor(message?: string);
|
|
3404
|
+
}
|
|
3405
|
+
declare class UserCancelledError extends SparkVaultError {
|
|
3406
|
+
constructor(message?: string);
|
|
3407
|
+
}
|
|
3408
|
+
declare class PopupBlockedError extends SparkVaultError {
|
|
3409
|
+
constructor();
|
|
3410
|
+
}
|
|
3411
|
+
|
|
3412
3412
|
/**
|
|
3413
3413
|
* SparkVault JavaScript SDK
|
|
3414
3414
|
*
|
package/dist/index.mjs
CHANGED
|
@@ -838,7 +838,9 @@ async function readApiFailure(response) {
|
|
|
838
838
|
*
|
|
839
839
|
* Core mints an id as its kind's prefix, an underscore and a body: the hex of a
|
|
840
840
|
* UUIDv7 (apps/api lib/utils.js buildPrefixedIdFromBytes), or a hex digest for
|
|
841
|
-
* an
|
|
841
|
+
* an id derived from what it names (an invitation, an inbox notification, a
|
|
842
|
+
* Messaging or help-desk ingot, a help-desk event an inbound email records).
|
|
843
|
+
* The grammar admits the kind's
|
|
842
844
|
* prefix, '_' and a body of the path-safe alphabet [A-Za-z0-9_-], 128
|
|
843
845
|
* characters in all, so an id that passes is exactly one request-path segment
|
|
844
846
|
* and one file-name component: it can never name a parent path, carry a
|
|
@@ -854,11 +856,19 @@ async function readApiFailure(response) {
|
|
|
854
856
|
/** The prefix Core mints each resource kind's id with. */
|
|
855
857
|
const RESOURCE_ID_PREFIXES = Object.freeze({
|
|
856
858
|
account: 'acc',
|
|
859
|
+
attachment: 'hda',
|
|
857
860
|
folder: 'fld',
|
|
861
|
+
helpDeskJob: 'hdj',
|
|
858
862
|
ingot: 'ing',
|
|
859
863
|
invite: 'inv',
|
|
860
864
|
notification: 'ntf',
|
|
865
|
+
requester: 'hrq',
|
|
866
|
+
routingRule: 'hdr',
|
|
867
|
+
savedReply: 'hds',
|
|
861
868
|
spark: 'spk',
|
|
869
|
+
team: 'team',
|
|
870
|
+
ticket: 'tkt',
|
|
871
|
+
ticketEvent: 'hdev',
|
|
862
872
|
user: 'usr',
|
|
863
873
|
vault: 'vlt'
|
|
864
874
|
});
|
|
@@ -904,8 +914,11 @@ function isResourceId(value) {
|
|
|
904
914
|
* SparkVault-owned domain registry.
|
|
905
915
|
*
|
|
906
916
|
* Keep platform domain decisions centralized: CSP, redirect safety, custom
|
|
907
|
-
* domain reservation, and Identity postMessage trust all
|
|
908
|
-
*
|
|
917
|
+
* domain reservation, and Identity postMessage trust all read this registry.
|
|
918
|
+
* Trust follows the hosts the platform owns (isSparkVaultOwnedHostname);
|
|
919
|
+
* reservation covers those and the help-desk domain's subtree
|
|
920
|
+
* (isSparkVaultReservedDomain), whose hosts are SparkVault's to hand out but
|
|
921
|
+
* never trusted.
|
|
909
922
|
*/
|
|
910
923
|
|
|
911
924
|
const SPARKVAULT_ROOT_DOMAIN = 'sparkvault.com';
|
|
@@ -2093,7 +2106,7 @@ class ExpirationTimer {
|
|
|
2093
2106
|
/**
|
|
2094
2107
|
* Identity Module Utilities
|
|
2095
2108
|
*
|
|
2096
|
-
* The encoding
|
|
2109
|
+
* The encoding and validation helpers the identity renderer, API
|
|
2097
2110
|
* client and module share.
|
|
2098
2111
|
*/
|
|
2099
2112
|
// Re-export timer utilities
|
|
@@ -17290,7 +17303,7 @@ class SparkVault {
|
|
|
17290
17303
|
}
|
|
17291
17304
|
/** Get the SDK version */
|
|
17292
17305
|
static get version() {
|
|
17293
|
-
return '11.1.
|
|
17306
|
+
return '11.1.3';
|
|
17294
17307
|
}
|
|
17295
17308
|
}
|
|
17296
17309
|
if (typeof window !== 'undefined') {
|