@sparkvault/sdk-js 13.0.0 → 13.0.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.
- package/README.md +1 -1
- package/dist/errors.d.ts +12 -3
- package/dist/index.cjs +46 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +37 -13
- package/dist/index.mjs +46 -20
- package/dist/index.mjs.map +1 -1
- package/dist/ingots/index.d.ts +13 -4
- package/dist/ingots/types.d.ts +5 -2
- package/dist/products/index.d.ts +1 -1
- package/dist/sparkvault.js +1 -1
- package/dist/sparkvault.js.map +1 -1
- package/dist/vaults/index.d.ts +5 -2
- package/dist/vaults/types.d.ts +2 -8
- package/dist/vaults/upload/api.d.ts +7 -0
- package/package.json +1 -1
- package/dist/products/identity/types.test-d.d.ts +0 -21
- package/dist/products/notify/types.test-d.d.ts +0 -51
package/dist/index.d.ts
CHANGED
|
@@ -2575,7 +2575,8 @@ declare class VaultsModule {
|
|
|
2575
2575
|
/** Cancel this exact deletion schedule before its deadline; company admins only. */
|
|
2576
2576
|
cancelDeletion(vaultId: string, deletionScheduleId: string): Promise<VaultDetail>;
|
|
2577
2577
|
/**
|
|
2578
|
-
* Get a vault's public-sharing configuration.
|
|
2578
|
+
* Get a vault's public-sharing configuration. Every sharing write below
|
|
2579
|
+
* answers the same configuration as that write left it.
|
|
2579
2580
|
*
|
|
2580
2581
|
* @example
|
|
2581
2582
|
* const sharing = await sv.vaults.getSharingConfig('vlt_abc');
|
|
@@ -2625,7 +2626,9 @@ declare class VaultsModule {
|
|
|
2625
2626
|
*/
|
|
2626
2627
|
updateAccessLogRetention(vaultId: string, seconds: number): Promise<AccessLogRetention>;
|
|
2627
2628
|
/**
|
|
2628
|
-
* Get a vault's upload-channel configuration.
|
|
2629
|
+
* Get a vault's upload-channel configuration. Every upload write below
|
|
2630
|
+
* answers the same configuration as that write left it: both channels, the
|
|
2631
|
+
* shared settings, and the portal's URL while the portal is on.
|
|
2629
2632
|
*
|
|
2630
2633
|
* @example
|
|
2631
2634
|
* const upload = await sv.vaults.getUploadConfig('vlt_abc');
|
|
@@ -2965,9 +2968,12 @@ interface ListIngotsOptions {
|
|
|
2965
2968
|
limit?: number;
|
|
2966
2969
|
/** Pagination cursor */
|
|
2967
2970
|
cursor?: string;
|
|
2968
|
-
/**
|
|
2971
|
+
/**
|
|
2972
|
+
* Sort field (name | size | content_type | created | access_count): it
|
|
2973
|
+
* orders only the page answered, never the list across pages
|
|
2974
|
+
*/
|
|
2969
2975
|
sortBy?: string;
|
|
2970
|
-
/** Sort direction */
|
|
2976
|
+
/** Sort direction of the page */
|
|
2971
2977
|
sortOrder?: 'asc' | 'desc';
|
|
2972
2978
|
}
|
|
2973
2979
|
/** Options for listContents. */
|
|
@@ -3212,9 +3218,9 @@ declare class SparkVaultError extends Error {
|
|
|
3212
3218
|
* refused call of a data-plane module (`vaults`, `ingots`, `folders`,
|
|
3213
3219
|
* `sparks`, `entropy`, `notify`, `products.notify`); `api_error` when the
|
|
3214
3220
|
* answer named none (a gateway's HTML). A typed refusal's `code` names its
|
|
3215
|
-
* class of failure: one per 400 (`validation_error`)
|
|
3216
|
-
* (`authentication_error`),
|
|
3217
|
-
* and 403 (`authorization_error`, `NOTIFY_SUBSCRIPTION_REQUIRED`;
|
|
3221
|
+
* class of failure: one per 400 (`validation_error`), two per 401
|
|
3222
|
+
* (`authentication_error`, `UNAUTHORIZED`), 402 (`PLAN_REQUIRED`,
|
|
3223
|
+
* `QUOTA_EXCEEDED`) and 403 (`authorization_error`, `NOTIFY_SUBSCRIPTION_REQUIRED`;
|
|
3218
3224
|
* http.ts createErrorFromResponse), so this is what tells apart two
|
|
3219
3225
|
* refusals that share a code.
|
|
3220
3226
|
* Undefined on an error the SDK raised itself, on the Identity product's
|
|
@@ -3229,6 +3235,15 @@ declare class SparkVaultError extends Error {
|
|
|
3229
3235
|
declare class AuthenticationError extends SparkVaultError {
|
|
3230
3236
|
constructor(message: string, details?: Record<string, unknown>, retryAfterMs?: number | null, serviceCode?: string);
|
|
3231
3237
|
}
|
|
3238
|
+
/**
|
|
3239
|
+
* A key the request presents was refused (401 UNAUTHORIZED): the DVAK an
|
|
3240
|
+
* unseal names is invalid or revoked. The caller's own credential stood, so
|
|
3241
|
+
* this is no ended session, and signing in again changes nothing: present a
|
|
3242
|
+
* live key. Every other 401 is an {@link AuthenticationError}.
|
|
3243
|
+
*/
|
|
3244
|
+
declare class UnauthorizedError extends SparkVaultError {
|
|
3245
|
+
constructor(message: string, details?: Record<string, unknown>, retryAfterMs?: number | null, serviceCode?: string);
|
|
3246
|
+
}
|
|
3232
3247
|
declare class AuthorizationError extends SparkVaultError {
|
|
3233
3248
|
constructor(message: string, details?: Record<string, unknown>, retryAfterMs?: number | null, serviceCode?: string);
|
|
3234
3249
|
}
|
|
@@ -3399,7 +3414,10 @@ declare class IngotsModule {
|
|
|
3399
3414
|
* `upload_received_publishing`: every byte is received, and the server
|
|
3400
3415
|
* finishes the publication on its own, so never upload the file again; a
|
|
3401
3416
|
* caller that kept the session (`onSessionCreated`) learns what became of
|
|
3402
|
-
* it with {@link resumeUpload}.
|
|
3417
|
+
* it with {@link resumeUpload}. A chunk's upload progress needs the
|
|
3418
|
+
* browser's XMLHttpRequest: where there is none (a Node server) it rejects
|
|
3419
|
+
* with code `environment_unsupported` before any request; a server sends
|
|
3420
|
+
* the bytes over tus to `uploadUrl` itself.
|
|
3403
3421
|
*
|
|
3404
3422
|
* @param options.signal - Cancels this transfer (it rejects with code
|
|
3405
3423
|
* `cancelled`); other transfers carry on.
|
|
@@ -3467,7 +3485,10 @@ declare class IngotsModule {
|
|
|
3467
3485
|
* any way but one the server received whole ({@link isReceivedUploadFailure}:
|
|
3468
3486
|
* the server publishes or ends that one on its own) is given up: the end of
|
|
3469
3487
|
* it with the file its create made ({@link endUpload}) starts as it
|
|
3470
|
-
* rejects, without holding up its own error.
|
|
3488
|
+
* rejects, without holding up its own error. It needs the browser's
|
|
3489
|
+
* XMLHttpRequest, as {@link sendUpload} does: in a server process it
|
|
3490
|
+
* rejects with code `environment_unsupported` before any request, so no
|
|
3491
|
+
* create stages an ingot it cannot send.
|
|
3471
3492
|
*
|
|
3472
3493
|
* @example
|
|
3473
3494
|
* const ingot = await sv.ingots.upload(unsealed, {
|
|
@@ -3484,7 +3505,8 @@ declare class IngotsModule {
|
|
|
3484
3505
|
/**
|
|
3485
3506
|
* Replace an existing ingot's content (high-level flow). Rejects as
|
|
3486
3507
|
* {@link upload} does, a replacement another upload of the same ingot
|
|
3487
|
-
* superseded included (`upload_refused`)
|
|
3508
|
+
* superseded included (`upload_refused`), and `environment_unsupported`
|
|
3509
|
+
* before the replacement is staged where there is no XMLHttpRequest.
|
|
3488
3510
|
*
|
|
3489
3511
|
* @example
|
|
3490
3512
|
* await sv.ingots.replace(unsealed, 'ing_abc', { file: updatedFile });
|
|
@@ -3520,7 +3542,9 @@ declare class IngotsModule {
|
|
|
3520
3542
|
*/
|
|
3521
3543
|
get(vault: UnsealedVault, ingotId: string): Promise<Ingot>;
|
|
3522
3544
|
/**
|
|
3523
|
-
* List ingots in an unsealed vault
|
|
3545
|
+
* List ingots in an unsealed vault, one page at a time in the vault index's
|
|
3546
|
+
* order: follow `nextCursor`. `sortBy` orders only the page answered; for
|
|
3547
|
+
* one order across a vault, search or list a folder's contents.
|
|
3524
3548
|
*
|
|
3525
3549
|
* @example
|
|
3526
3550
|
* const { ingots } = await sv.ingots.list(unsealed);
|
|
@@ -4342,5 +4366,5 @@ declare global {
|
|
|
4342
4366
|
}
|
|
4343
4367
|
}
|
|
4344
4368
|
|
|
4345
|
-
export { AuthenticationError, AuthorizationError, EntropyModule, FoldersModule, IdentityModule, IdentityProviderError, IngotsModule, NAME_CONFLICT_POLICIES, NOTIFY_PRESETS, NetworkError, NotifyModule, NotifyProductModule, NotifySubscriptionRequiredError, PlanRequiredError, PopupBlockedError, ProductsModule, QuotaExceededError, SparkVault, SparkVaultError, SparksModule, TimeoutError, UserCancelledError, ValidationError, VaultsModule, buildNotifyPresetSend, SparkVault as default, fetchDownload, isReceivedUploadFailure, logger, setDebugMode };
|
|
4346
|
-
export type { AccessLogRetention, AccessLogsOptions, CreateFolderOptions, CreateNotifySendOptions, CreateSparkOptions, CreateUploadOptions, CreateVaultOptions, CreatedIngot, CreatedSpark, EntropyFormat, EntropyResult, FetchDownloadOptions, FetchedDownload, Folder, FolderBreadcrumbItem, FolderContents, FolderPage, GenerateEntropyOptions, HealthCheckOptions, HealthCheckResult, AttachOptions as IdentityAttachOptions, Ingot, IngotAccessLog, IngotAccessLogPage, IngotDownloadLink, IngotInvitation, IngotInvite, IngotPage, IngotSharingConfig, IngotUpload, ListContentsOptions, ListFoldersOptions, ListIngotsOptions, ListNotificationsOptions, ListNotificationsResponse, ListNotifyInboxOptions, ListNotifyInboxResponse, ListNotifyReceiptsOptions, ListNotifyReceiptsResponse, ListNotifySendsOptions, ListNotifySendsResponse, ListSparksOptions, MarkAllNotificationsStateOptions, MarkAllNotificationsStateResponse, MarkAllReadResult, MarkNotificationStateOptions, MarkNotificationStateResponse, MarkNotifyInboxAllOptions, MarkNotifyInboxAllResponse, MarkNotifyInboxStateOptions, MarkNotifyInboxStateResponse, NameConflictPolicy, NotificationBulkMarkState, NotificationInboxState, NotificationMarkState, NotificationRow, NotifyCategory, NotifyChannel, NotifyConfig, NotifyConfigCategory, NotifyConfigDelivery, NotifyConfigDeliveryPatch, NotifyConfigEvents, NotifyConfigEventsRead, NotifyConfigHistory, NotifyConfigOverrides, NotifyConfigPatch, NotifyConfigRealtimeFallbackDelay, NotifyConfigReliability, NotifyConfigResponse, NotifyConfigSecurity, NotifyDeliveryMode, NotifyEscalation, NotifyInboxBulkMarkState, NotifyInboxMarkState, NotifyInboxRow, NotifyInboxView, NotifyIngotRef, NotifyInteraction, NotifyPreset, NotifyPresetCategory, NotifyPresetName, NotifyPresetSendOptions, NotifyRecallMode, NotifyReceipt, NotifyReceiptEventType, NotifyRecipient, NotifyRecipientRef, NotifyRecipientState, NotifyReportableVerificationLevel, NotifySendContent, NotifySendPolicy, NotifySendReceipt, NotifySendReceiptsResponse, NotifySendResult, NotifySendState, NotifySendStatus, NotifySendStatusCounts, NotifySendStatusRecipient, NotifySendSummary, NotifySuppressionReason, NotifyVerificationLevel, QuotaResource, RecallNotifySendOptions, RecallNotifySendResponse, RegisterWebPushResponse, ReplaceIngotOptions, ResumeUploadOptions, ScheduledVaultDeletion, SearchIngotsOptions, SendUploadOptions, ShareSparkOptions, Spark, SparkInviteResend, SparkPage, SparkShare, SparkSummary, SparkVaultConfig, SparkVisibility, SubscribeWebPushOptions, SubscribeWebPushResult, SubscribeWebPushStatus, TokenClaims, UnreadCountResponse, UnsealedVault, UnsubscribeWebPushResponse, UpdateFolderOptions, UpdateIngotSharingOptions, UpdateVaultUploadOptions, UpdatedVault, UploadAttachOptions, UploadBranding, UploadEnd, UploadIngotOptions, UploadOptions, UploadProgress, UploadResult, UploadSession, Vault, VaultDetail, VaultLifecycle, VaultSharingConfig, VaultSharingOptions, VaultSummary, VaultUploadConfig, VaultUploadSettings, VerifyOptions, VerifyResult, WebPushKeyResponse, WebPushStatus, WebPushStatusOptions, WebPushStatusResult, WebPushSubscriptionInput };
|
|
4369
|
+
export { AuthenticationError, AuthorizationError, EntropyModule, FoldersModule, IdentityModule, IdentityProviderError, IngotsModule, NAME_CONFLICT_POLICIES, NOTIFY_PRESETS, NetworkError, NotifyModule, NotifyProductModule, NotifySubscriptionRequiredError, PlanRequiredError, PopupBlockedError, ProductsModule, QuotaExceededError, SparkVault, SparkVaultError, SparksModule, TimeoutError, UnauthorizedError, UserCancelledError, ValidationError, VaultsModule, buildNotifyPresetSend, SparkVault as default, fetchDownload, isReceivedUploadFailure, logger, setDebugMode };
|
|
4370
|
+
export type { AccessLogRetention, AccessLogsOptions, CreateFolderOptions, CreateNotifySendOptions, CreateSparkOptions, CreateUploadOptions, CreateVaultOptions, CreatedIngot, CreatedSpark, EntropyFormat, EntropyResult, FetchDownloadOptions, FetchedDownload, Folder, FolderBreadcrumbItem, FolderContents, FolderPage, GenerateEntropyOptions, HealthCheckOptions, HealthCheckResult, AttachOptions as IdentityAttachOptions, Ingot, IngotAccessLog, IngotAccessLogPage, IngotDownloadLink, IngotInvitation, IngotInvite, IngotPage, IngotSharingConfig, IngotUpload, ListContentsOptions, ListFoldersOptions, ListIngotsOptions, ListNotificationsOptions, ListNotificationsResponse, ListNotifyInboxOptions, ListNotifyInboxResponse, ListNotifyReceiptsOptions, ListNotifyReceiptsResponse, ListNotifySendsOptions, ListNotifySendsResponse, ListSparksOptions, MarkAllNotificationsStateOptions, MarkAllNotificationsStateResponse, MarkAllReadResult, MarkNotificationStateOptions, MarkNotificationStateResponse, MarkNotifyInboxAllOptions, MarkNotifyInboxAllResponse, MarkNotifyInboxStateOptions, MarkNotifyInboxStateResponse, NameConflictPolicy, NotificationBulkMarkState, NotificationInboxState, NotificationMarkState, NotificationRow, NotifyCategory, NotifyChannel, NotifyConfig, NotifyConfigCategory, NotifyConfigDelivery, NotifyConfigDeliveryPatch, NotifyConfigEvents, NotifyConfigEventsRead, NotifyConfigHistory, NotifyConfigOverrides, NotifyConfigPatch, NotifyConfigRealtimeFallbackDelay, NotifyConfigReliability, NotifyConfigResponse, NotifyConfigSecurity, NotifyDeliveryMode, NotifyEscalation, NotifyInboxBulkMarkState, NotifyInboxMarkState, NotifyInboxRow, NotifyInboxView, NotifyIngotRef, NotifyInteraction, NotifyPreset, NotifyPresetCategory, NotifyPresetName, NotifyPresetSendOptions, NotifyRecallMode, NotifyReceipt, NotifyReceiptEventType, NotifyRecipient, NotifyRecipientRef, NotifyRecipientState, NotifyReportableVerificationLevel, NotifySendContent, NotifySendPolicy, NotifySendReceipt, NotifySendReceiptsResponse, NotifySendResult, NotifySendState, NotifySendStatus, NotifySendStatusCounts, NotifySendStatusRecipient, NotifySendSummary, NotifySuppressionReason, NotifyVerificationLevel, QuotaResource, RecallNotifySendOptions, RecallNotifySendResponse, RegisterWebPushResponse, ReplaceIngotOptions, ResumeUploadOptions, ScheduledVaultDeletion, SearchIngotsOptions, SendUploadOptions, ShareSparkOptions, SignInOptions, SignInResult, Spark, SparkInviteResend, SparkPage, SparkShare, SparkSummary, SparkVaultConfig, SparkVisibility, SubscribeWebPushOptions, SubscribeWebPushResult, SubscribeWebPushStatus, TokenClaims, UnreadCountResponse, UnsealedVault, UnsubscribeWebPushResponse, UpdateFolderOptions, UpdateIngotSharingOptions, UpdateVaultUploadOptions, UpdatedVault, UploadAttachOptions, UploadBranding, UploadEnd, UploadIngotOptions, UploadOptions, UploadProgress, UploadResult, UploadSession, Vault, VaultDetail, VaultLifecycle, VaultSharingConfig, VaultSharingOptions, VaultSummary, VaultUploadConfig, VaultUploadSettings, VerifyOptions, VerifyResult, WebPushKeyResponse, WebPushStatus, WebPushStatusOptions, WebPushStatusResult, WebPushSubscriptionInput };
|
package/dist/index.mjs
CHANGED
|
@@ -786,6 +786,19 @@ class AuthenticationError extends SparkVaultError {
|
|
|
786
786
|
Object.setPrototypeOf(this, AuthenticationError.prototype);
|
|
787
787
|
}
|
|
788
788
|
}
|
|
789
|
+
/**
|
|
790
|
+
* A key the request presents was refused (401 UNAUTHORIZED): the DVAK an
|
|
791
|
+
* unseal names is invalid or revoked. The caller's own credential stood, so
|
|
792
|
+
* this is no ended session, and signing in again changes nothing: present a
|
|
793
|
+
* live key. Every other 401 is an {@link AuthenticationError}.
|
|
794
|
+
*/
|
|
795
|
+
class UnauthorizedError extends SparkVaultError {
|
|
796
|
+
constructor(message, details, retryAfterMs = null, serviceCode) {
|
|
797
|
+
super(message, 'UNAUTHORIZED', 401, details, retryAfterMs, serviceCode);
|
|
798
|
+
this.name = 'UnauthorizedError';
|
|
799
|
+
Object.setPrototypeOf(this, UnauthorizedError.prototype);
|
|
800
|
+
}
|
|
801
|
+
}
|
|
789
802
|
class AuthorizationError extends SparkVaultError {
|
|
790
803
|
constructor(message, details, retryAfterMs = null, serviceCode) {
|
|
791
804
|
super(message, 'authorization_error', 403, details, retryAfterMs, serviceCode);
|
|
@@ -1554,6 +1567,10 @@ class HttpClient {
|
|
|
1554
1567
|
case 400:
|
|
1555
1568
|
return new ValidationError(message, details, retryAfterMs, code);
|
|
1556
1569
|
case 401:
|
|
1570
|
+
// A refused key the request carries (an unseal's DVAK) is no ended
|
|
1571
|
+
// session: its own class, so a caller never signs out over it.
|
|
1572
|
+
if (code === 'UNAUTHORIZED')
|
|
1573
|
+
return new UnauthorizedError(message, details, retryAfterMs, code);
|
|
1557
1574
|
return new AuthenticationError(message, details, retryAfterMs, code);
|
|
1558
1575
|
case 402:
|
|
1559
1576
|
if (code === 'QUOTA_EXCEEDED')
|
|
@@ -12225,7 +12242,12 @@ function stagingRefusalOf(error) {
|
|
|
12225
12242
|
function cancelledError() {
|
|
12226
12243
|
return new UploadApiError('Upload cancelled', 'cancelled', 0);
|
|
12227
12244
|
}
|
|
12228
|
-
/**
|
|
12245
|
+
/**
|
|
12246
|
+
* Refuse a transfer where the browser's XMLHttpRequest is missing (a server
|
|
12247
|
+
* process: Node has fetch and no XMLHttpRequest): a chunk's upload progress
|
|
12248
|
+
* needs it. A flow that stages its upload with Core first checks this before
|
|
12249
|
+
* the staging request, so a run that cannot transfer stages nothing.
|
|
12250
|
+
*/
|
|
12229
12251
|
function assertBrowserTransfer() {
|
|
12230
12252
|
if (typeof XMLHttpRequest === 'undefined') {
|
|
12231
12253
|
throw new UploadApiError('XMLHttpRequest is required for browser uploads', 'environment_unsupported', 0);
|
|
@@ -15836,7 +15858,8 @@ class VaultsModule {
|
|
|
15836
15858
|
return mapVaultDetail(response.data);
|
|
15837
15859
|
}
|
|
15838
15860
|
/**
|
|
15839
|
-
* Get a vault's public-sharing configuration.
|
|
15861
|
+
* Get a vault's public-sharing configuration. Every sharing write below
|
|
15862
|
+
* answers the same configuration as that write left it.
|
|
15840
15863
|
*
|
|
15841
15864
|
* @example
|
|
15842
15865
|
* const sharing = await sv.vaults.getSharingConfig('vlt_abc');
|
|
@@ -15926,7 +15949,9 @@ class VaultsModule {
|
|
|
15926
15949
|
};
|
|
15927
15950
|
}
|
|
15928
15951
|
/**
|
|
15929
|
-
* Get a vault's upload-channel configuration.
|
|
15952
|
+
* Get a vault's upload-channel configuration. Every upload write below
|
|
15953
|
+
* answers the same configuration as that write left it: both channels, the
|
|
15954
|
+
* shared settings, and the portal's URL while the portal is on.
|
|
15930
15955
|
*
|
|
15931
15956
|
* @example
|
|
15932
15957
|
* const upload = await sv.vaults.getUploadConfig('vlt_abc');
|
|
@@ -15994,17 +16019,7 @@ class VaultsModule {
|
|
|
15994
16019
|
throw new ValidationError('VMK is required');
|
|
15995
16020
|
}
|
|
15996
16021
|
const response = await this.http.post(apiPath `/v1/vaults/${id}/upload/${channel}/${action}`, action === 'enable' ? { vmk } : undefined);
|
|
15997
|
-
|
|
15998
|
-
return {
|
|
15999
|
-
vaultId: d.vault_id,
|
|
16000
|
-
uploadPortalEnabled: d.upload_portal_enabled ?? (channel === 'portal' && action === 'enable'),
|
|
16001
|
-
uploadPortalEnabledAt: channel === 'portal' && action === 'enable' ? d.enabled_at ?? null : null,
|
|
16002
|
-
uploadWidgetEnabled: d.upload_widget_enabled ?? (channel === 'widget' && action === 'enable'),
|
|
16003
|
-
uploadWidgetEnabledAt: channel === 'widget' && action === 'enable' ? d.enabled_at ?? null : null,
|
|
16004
|
-
maxSizeBytes: null,
|
|
16005
|
-
notificationEmail: null,
|
|
16006
|
-
portalUrl: d.portal_url,
|
|
16007
|
-
};
|
|
16022
|
+
return mapUploadSettings(response.data);
|
|
16008
16023
|
}
|
|
16009
16024
|
validateCreateOptions(options) {
|
|
16010
16025
|
// A name's length is Core's to decide (it answers a ValidationError naming
|
|
@@ -16967,7 +16982,10 @@ class IngotsModule {
|
|
|
16967
16982
|
* `upload_received_publishing`: every byte is received, and the server
|
|
16968
16983
|
* finishes the publication on its own, so never upload the file again; a
|
|
16969
16984
|
* caller that kept the session (`onSessionCreated`) learns what became of
|
|
16970
|
-
* it with {@link resumeUpload}.
|
|
16985
|
+
* it with {@link resumeUpload}. A chunk's upload progress needs the
|
|
16986
|
+
* browser's XMLHttpRequest: where there is none (a Node server) it rejects
|
|
16987
|
+
* with code `environment_unsupported` before any request; a server sends
|
|
16988
|
+
* the bytes over tus to `uploadUrl` itself.
|
|
16971
16989
|
*
|
|
16972
16990
|
* @param options.signal - Cancels this transfer (it rejects with code
|
|
16973
16991
|
* `cancelled`); other transfers carry on.
|
|
@@ -17056,7 +17074,10 @@ class IngotsModule {
|
|
|
17056
17074
|
* any way but one the server received whole ({@link isReceivedUploadFailure}:
|
|
17057
17075
|
* the server publishes or ends that one on its own) is given up: the end of
|
|
17058
17076
|
* it with the file its create made ({@link endUpload}) starts as it
|
|
17059
|
-
* rejects, without holding up its own error.
|
|
17077
|
+
* rejects, without holding up its own error. It needs the browser's
|
|
17078
|
+
* XMLHttpRequest, as {@link sendUpload} does: in a server process it
|
|
17079
|
+
* rejects with code `environment_unsupported` before any request, so no
|
|
17080
|
+
* create stages an ingot it cannot send.
|
|
17060
17081
|
*
|
|
17061
17082
|
* @example
|
|
17062
17083
|
* const ingot = await sv.ingots.upload(unsealed, {
|
|
@@ -17069,6 +17090,7 @@ class IngotsModule {
|
|
|
17069
17090
|
throw new ValidationError('Provide folder or folderId, not both');
|
|
17070
17091
|
}
|
|
17071
17092
|
const name = options.name ?? getBlobName(options.file);
|
|
17093
|
+
assertBrowserTransfer();
|
|
17072
17094
|
const created = await this.requestUploadSession(vault, {
|
|
17073
17095
|
name,
|
|
17074
17096
|
content_type: sentContentType(options),
|
|
@@ -17105,7 +17127,8 @@ class IngotsModule {
|
|
|
17105
17127
|
/**
|
|
17106
17128
|
* Replace an existing ingot's content (high-level flow). Rejects as
|
|
17107
17129
|
* {@link upload} does, a replacement another upload of the same ingot
|
|
17108
|
-
* superseded included (`upload_refused`)
|
|
17130
|
+
* superseded included (`upload_refused`), and `environment_unsupported`
|
|
17131
|
+
* before the replacement is staged where there is no XMLHttpRequest.
|
|
17109
17132
|
*
|
|
17110
17133
|
* @example
|
|
17111
17134
|
* await sv.ingots.replace(unsealed, 'ing_abc', { file: updatedFile });
|
|
@@ -17116,6 +17139,7 @@ class IngotsModule {
|
|
|
17116
17139
|
const id = requireResourceId(ingotId, 'ingotId');
|
|
17117
17140
|
const name = options.name ?? getBlobName(options.file);
|
|
17118
17141
|
const contentType = sentContentType(options);
|
|
17142
|
+
assertBrowserTransfer();
|
|
17119
17143
|
const response = await this.http.put(apiPath `/v1/vaults/${vaultId}/ingots/${id}`, {
|
|
17120
17144
|
name,
|
|
17121
17145
|
// Omitted, Core keeps the ingot's stored type (ReplaceIngotOptions.contentType).
|
|
@@ -17183,7 +17207,9 @@ class IngotsModule {
|
|
|
17183
17207
|
return mapIngot(response.data);
|
|
17184
17208
|
}
|
|
17185
17209
|
/**
|
|
17186
|
-
* List ingots in an unsealed vault
|
|
17210
|
+
* List ingots in an unsealed vault, one page at a time in the vault index's
|
|
17211
|
+
* order: follow `nextCursor`. `sortBy` orders only the page answered; for
|
|
17212
|
+
* one order across a vault, search or list a folder's contents.
|
|
17187
17213
|
*
|
|
17188
17214
|
* @example
|
|
17189
17215
|
* const { ingots } = await sv.ingots.list(unsealed);
|
|
@@ -18288,7 +18314,7 @@ class SparkVault {
|
|
|
18288
18314
|
}
|
|
18289
18315
|
/** Get the SDK version */
|
|
18290
18316
|
static get version() {
|
|
18291
|
-
return '13.0.
|
|
18317
|
+
return '13.0.1';
|
|
18292
18318
|
}
|
|
18293
18319
|
}
|
|
18294
18320
|
if (typeof window !== 'undefined') {
|
|
@@ -18298,5 +18324,5 @@ if (typeof window !== 'undefined') {
|
|
|
18298
18324
|
window.SparkVault = instance ?? SparkVault;
|
|
18299
18325
|
}
|
|
18300
18326
|
|
|
18301
|
-
export { AuthenticationError, AuthorizationError, EntropyModule, FoldersModule, IdentityModule, IdentityProviderError, IngotsModule, NAME_CONFLICT_POLICIES, NOTIFY_PRESETS, NetworkError, NotifyModule, NotifyProductModule, NotifySubscriptionRequiredError, PlanRequiredError, PopupBlockedError, ProductsModule, QuotaExceededError, SparkVault, SparkVaultError, SparksModule, TimeoutError, UserCancelledError, ValidationError, VaultsModule, buildNotifyPresetSend, SparkVault as default, fetchDownload, isReceivedUploadFailure, logger, setDebugMode };
|
|
18327
|
+
export { AuthenticationError, AuthorizationError, EntropyModule, FoldersModule, IdentityModule, IdentityProviderError, IngotsModule, NAME_CONFLICT_POLICIES, NOTIFY_PRESETS, NetworkError, NotifyModule, NotifyProductModule, NotifySubscriptionRequiredError, PlanRequiredError, PopupBlockedError, ProductsModule, QuotaExceededError, SparkVault, SparkVaultError, SparksModule, TimeoutError, UnauthorizedError, UserCancelledError, ValidationError, VaultsModule, buildNotifyPresetSend, SparkVault as default, fetchDownload, isReceivedUploadFailure, logger, setDebugMode };
|
|
18302
18328
|
//# sourceMappingURL=index.mjs.map
|