@sparkvault/sdk-js 13.0.0 → 13.0.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.
@@ -115,7 +115,8 @@ export declare class VaultsModule {
115
115
  /** Cancel this exact deletion schedule before its deadline; company admins only. */
116
116
  cancelDeletion(vaultId: string, deletionScheduleId: string): Promise<VaultDetail>;
117
117
  /**
118
- * Get a vault's public-sharing configuration.
118
+ * Get a vault's public-sharing configuration. Every sharing write below
119
+ * answers the same configuration as that write left it.
119
120
  *
120
121
  * @example
121
122
  * const sharing = await sv.vaults.getSharingConfig('vlt_abc');
@@ -165,7 +166,9 @@ export declare class VaultsModule {
165
166
  */
166
167
  updateAccessLogRetention(vaultId: string, seconds: number): Promise<AccessLogRetention>;
167
168
  /**
168
- * Get a vault's upload-channel configuration.
169
+ * Get a vault's upload-channel configuration. Every upload write below
170
+ * answers the same configuration as that write left it: both channels, the
171
+ * shared settings, and the portal's URL while the portal is on.
169
172
  *
170
173
  * @example
171
174
  * const upload = await sv.vaults.getUploadConfig('vlt_abc');
@@ -213,6 +213,7 @@ export interface UpdateVaultResponse {
213
213
  description?: string | null;
214
214
  updated_at: number;
215
215
  }
216
+ /** GET /v1/vaults/:id/sharing, and the configuration every sharing write answers. */
216
217
  export interface VaultSharingConfigResponse {
217
218
  vault_id: string;
218
219
  public_sharing_enabled: boolean;
@@ -224,6 +225,7 @@ export interface AccessLogRetentionResponse {
224
225
  vault_id: string;
225
226
  access_log_retention_seconds: number;
226
227
  }
228
+ /** GET /v1/vaults/:id/upload, and the configuration every upload write answers. */
227
229
  export interface VaultUploadSettingsResponse {
228
230
  vault_id: string;
229
231
  upload_portal_enabled: boolean;
@@ -234,12 +236,4 @@ export interface VaultUploadSettingsResponse {
234
236
  notification_email?: string | null;
235
237
  portal_url?: string;
236
238
  }
237
- export interface UploadChannelToggleResponse {
238
- vault_id: string;
239
- upload_portal_enabled?: boolean;
240
- upload_widget_enabled?: boolean;
241
- enabled_at?: number;
242
- disabled_at?: number;
243
- portal_url?: string;
244
- }
245
239
  export {};
@@ -33,6 +33,13 @@ export declare function mapVaultUploadInfo(wire: VaultUploadInfoResponse): Vault
33
33
  * ({@link stagingRefusal}), any other error as it is.
34
34
  */
35
35
  export declare function stagingRefusalOf(error: unknown): unknown;
36
+ /**
37
+ * Refuse a transfer where the browser's XMLHttpRequest is missing (a server
38
+ * process: Node has fetch and no XMLHttpRequest): a chunk's upload progress
39
+ * needs it. A flow that stages its upload with Core first checks this before
40
+ * the staging request, so a run that cannot transfer stages nothing.
41
+ */
42
+ export declare function assertBrowserTransfer(): void;
36
43
  /**
37
44
  * Whether a transfer failed once the server held every byte of its upload,
38
45
  * short of the upload's own end: `upload_received_publishing`, and any other
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sparkvault/sdk-js",
3
- "version": "13.0.0",
3
+ "version": "13.0.2",
4
4
  "description": "SparkVault JavaScript SDK - Identity Verification and Encrypted Vaults",
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,21 +0,0 @@
1
- /**
2
- * Identity wire-contract assertions — COMPILE-TIME ONLY.
3
- *
4
- * These types have no runtime, so a unit test can never catch them drifting from
5
- * the server: the transpiler strips them and every assertion passes. This file is
6
- * the gate instead — `tsc --noEmit` (`pnpm typecheck`) fails the moment a
7
- * declared shape stops matching what the Identity product actually answers.
8
- *
9
- * It is deliberately NOT a `*.test.ts`: that suffix is excluded from `tsconfig`,
10
- * which would put these assertions exactly where the compiler cannot see them.
11
- * Nothing imports this module, so it never reaches the bundle.
12
- */
13
- import type { SparkLinkSendResponse } from './types';
14
- /** Fails to compile unless `T` resolves to exactly `true`. */
15
- type Assert<T extends true> = T;
16
- /** Invariant type equality: `A` and `B` must be the SAME type, not merely mutually assignable. */
17
- type Equals<A, B> = (<T>() => T extends A ? 1 : 2) extends <T>() => T extends B ? 1 : 2 ? true : false;
18
- export type IdentityWireContract = [
19
- Assert<Equals<keyof SparkLinkSendResponse, 'expiresAt' | 'kindling'>>
20
- ];
21
- export {};
@@ -1,51 +0,0 @@
1
- /**
2
- * Notify wire-contract assertions — COMPILE-TIME ONLY.
3
- *
4
- * These types have no runtime, so a unit test can never see how a field is typed:
5
- * the transpiler strips them and every assertion passes. This file is the gate
6
- * for that instead — `tsc --noEmit` (`pnpm typecheck`, which CI runs on every
7
- * push and again on every SDK publish) refuses to compile the moment a published
8
- * field's type or optionality stops matching what a block below states for it.
9
- * Each block names the server source it copies by hand, so a change to that
10
- * source is mirrored here, and the published type then has to follow it.
11
- *
12
- * WHICH fields each response carries is gated across packages rather than here:
13
- * tests/app-sdk-notify-contract.test.ts holds every Notify response type to
14
- * `NOTIFY_RESPONSE_FIELDS` (`@sparkvault/app-sdk/notify-contract`), the lists
15
- * the Core API's suites hold its projections to.
16
- *
17
- * It is deliberately NOT a `*.test.ts`: that suffix is excluded from `tsconfig`,
18
- * which would put these assertions exactly where the compiler cannot see them.
19
- * Nothing imports this module, so it never reaches the bundle.
20
- */
21
- import type { NotificationRow } from '../../notify/types';
22
- import type { NotifyChannel, NotifyConfig, NotifyConfigPatch, NotifyPreset, NotifyReceipt, NotifyRecipientState, NotifyReportableVerificationLevel, NotifySendReceiptsResponse, NotifySendStatusCounts, NotifySendStatusRecipient, NotifySendSummary, NotifySuppressionReason } from './types';
23
- import type * as PackageEntry from '../../index';
24
- /** Fails to compile unless `T` resolves to exactly `true`. */
25
- type Assert<T extends true> = T;
26
- /**
27
- * Invariant type equality — `A` and `B` must be the SAME type, not merely mutually
28
- * assignable. Assignability would accept a union that lost a member, which is the
29
- * precise drift these assertions exist to catch.
30
- */
31
- type Equals<A, B> = (<T>() => T extends A ? 1 : 2) extends <T>() => T extends B ? 1 : 2 ? true : false;
32
- export type NotifyWireContract = [
33
- Assert<Equals<NotificationRow['recalled'], boolean>>,
34
- Assert<Equals<NotificationRow['locked'], boolean>>,
35
- Assert<Equals<NotificationRow['sparklink_code'], string | undefined>>,
36
- Assert<Equals<NotificationRow['pointer_url'], string | undefined>>,
37
- Assert<Equals<NotifyRecipientState, 'pending' | 'delivered' | 'undeliverable' | 'failed' | 'suppressed' | 'rate_limited' | 'recalled'>>,
38
- Assert<Equals<PackageEntry.NotifyRecipientState, NotifyRecipientState>>,
39
- Assert<Equals<NotifySendStatusRecipient['suppressed_reason'], NotifySuppressionReason | null>>,
40
- Assert<Equals<PackageEntry.NotifySuppressionReason, NotifySuppressionReason>>,
41
- Assert<Equals<Pick<NotifySendStatusCounts, NotifyRecipientState>, Record<NotifyRecipientState, number>>>,
42
- Assert<Equals<NotifySendSummary['recalled_at'], number | null>>,
43
- Assert<Equals<NotifyReceipt['verification_level'], NotifyReportableVerificationLevel | null>>,
44
- Assert<Equals<PackageEntry.NotifyReportableVerificationLevel, NotifyReportableVerificationLevel>>,
45
- Assert<Equals<NotifySendReceiptsResponse['truncated'], boolean>>,
46
- Assert<Equals<NotifySendReceiptsResponse['cursor'], string | null>>,
47
- Assert<Equals<NotifyPreset['channels'], readonly NotifyChannel[] | undefined>>,
48
- Assert<Equals<NonNullable<NonNullable<NotifyConfigPatch['delivery']>['channel_priority']>, Record<string, NotifyChannel[] | null>>>,
49
- Assert<Equals<NonNullable<NotifyConfig['delivery']['channel_priority']>, Record<string, NotifyChannel[]>>>
50
- ];
51
- export {};