@haex-space/vault-sdk 4.0.0 → 4.2.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/cli/index.mjs.map +1 -1
- package/dist/{client-GdCi-m2s.d.mts → client-7bZyiRwE.d.mts} +127 -36
- package/dist/{client-C6pEREPM.d.ts → client-BPwsH1so.d.ts} +127 -36
- package/dist/index.d.mts +9 -6
- package/dist/index.d.ts +9 -6
- package/dist/index.js +79 -25
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +78 -24
- package/dist/index.mjs.map +1 -1
- package/dist/node.d.mts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.mjs +1 -1
- package/dist/node.mjs.map +1 -1
- package/dist/nuxt.js +1 -1
- package/dist/nuxt.js.map +1 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +79 -25
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +78 -24
- package/dist/react.mjs.map +1 -1
- package/dist/runtime/nuxt.plugin.client.d.mts +2 -2
- package/dist/runtime/nuxt.plugin.client.d.ts +2 -2
- package/dist/runtime/nuxt.plugin.client.js +77 -23
- package/dist/runtime/nuxt.plugin.client.js.map +1 -1
- package/dist/runtime/nuxt.plugin.client.mjs +77 -23
- package/dist/runtime/nuxt.plugin.client.mjs.map +1 -1
- package/dist/svelte.d.mts +2 -2
- package/dist/svelte.d.ts +2 -2
- package/dist/svelte.js +79 -25
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +78 -24
- package/dist/svelte.mjs.map +1 -1
- package/dist/{types-Ba4G6ZpC.d.mts → types-BwFKGH70.d.mts} +1 -1
- package/dist/{types-Ba4G6ZpC.d.ts → types-BwFKGH70.d.ts} +1 -1
- package/dist/vue.d.mts +2 -2
- package/dist/vue.d.ts +2 -2
- package/dist/vue.js +79 -25
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +78 -24
- package/dist/vue.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as HaexHubEvent, c as EXTERNAL_EVENTS, D as DatabaseQueryResult, M as Migration, d as MigrationResult, W as WebRequestOptions, e as WebResponse, f as EventCallback, H as HaexHubConfig, E as ExtensionInfo, A as ApplicationContext, g as DatabasePermissionRequest, P as PermissionResponse, S as SearchResult, R as RequestOptions } from './types-
|
|
1
|
+
import { b as HaexHubEvent, c as EXTERNAL_EVENTS, D as DatabaseQueryResult, M as Migration, d as MigrationResult, W as WebRequestOptions, e as WebResponse, f as EventCallback, H as HaexHubConfig, E as ExtensionInfo, A as ApplicationContext, g as DatabasePermissionRequest, P as PermissionResponse, S as SearchResult, R as RequestOptions } from './types-BwFKGH70.js';
|
|
2
2
|
import { SqliteRemoteDatabase } from 'drizzle-orm/sqlite-proxy';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -545,20 +545,54 @@ interface S3PublicConfig {
|
|
|
545
545
|
bucket: string;
|
|
546
546
|
}
|
|
547
547
|
/**
|
|
548
|
-
*
|
|
548
|
+
* A storage the extension may use, as the host lists it: names only, never
|
|
549
|
+
* credentials, endpoint or region.
|
|
549
550
|
*/
|
|
550
551
|
interface StorageBackendInfo {
|
|
551
552
|
id: string;
|
|
552
553
|
/** Backend type (e.g., "s3") */
|
|
553
554
|
type: string;
|
|
555
|
+
/** Name of the storage */
|
|
554
556
|
name: string;
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
/**
|
|
557
|
+
/** Name of the provider the user gave the connection (e.g., "Hetzner") */
|
|
558
|
+
providerName: string;
|
|
559
|
+
/** Bucket of the storage */
|
|
560
|
+
bucket: string;
|
|
561
|
+
/** @deprecated Not sent by hosts that keep credentials to themselves (holzi). */
|
|
562
|
+
enabled?: boolean;
|
|
563
|
+
/** @deprecated Not sent by hosts that keep credentials to themselves (holzi). */
|
|
564
|
+
createdAt?: string;
|
|
565
|
+
/** @deprecated Not sent by hosts that keep credentials to themselves (holzi). */
|
|
558
566
|
config?: S3PublicConfig;
|
|
559
567
|
}
|
|
560
568
|
/**
|
|
561
|
-
* S3
|
|
569
|
+
* What an extension proposes for a new S3 storage. The host shows it to the
|
|
570
|
+
* user and asks for credentials in its own window; an extension never sends
|
|
571
|
+
* or sees them.
|
|
572
|
+
*/
|
|
573
|
+
interface S3Proposal {
|
|
574
|
+
/** Custom endpoint URL (for non-AWS S3-compatible services); the host may ask for a permission for its host */
|
|
575
|
+
endpoint?: string;
|
|
576
|
+
/** Region; required unless `sameProviderAs` is given */
|
|
577
|
+
region?: string;
|
|
578
|
+
/** Bucket name */
|
|
579
|
+
bucket: string;
|
|
580
|
+
/** Use path-style URLs instead of virtual-hosted-style */
|
|
581
|
+
pathStyle?: boolean;
|
|
582
|
+
/** Credentials are entered by the host and are never accepted in a proposal. */
|
|
583
|
+
accessKeyId?: never;
|
|
584
|
+
/** Credentials are entered by the host and are never accepted in a proposal. */
|
|
585
|
+
secretAccessKey?: never;
|
|
586
|
+
/** Credentials are entered by the host and are never accepted in a proposal. */
|
|
587
|
+
sessionToken?: never;
|
|
588
|
+
}
|
|
589
|
+
/**
|
|
590
|
+
* S3-compatible backend configuration with credentials.
|
|
591
|
+
*
|
|
592
|
+
* @deprecated Credentials are entered in the host, never passed by an
|
|
593
|
+
* extension: holzi refuses a request that carries `accessKeyId`,
|
|
594
|
+
* `secretAccessKey` or `sessionToken`. Use {@link S3Proposal}. Removed in the
|
|
595
|
+
* next major version.
|
|
562
596
|
*/
|
|
563
597
|
interface S3Config {
|
|
564
598
|
/** Custom endpoint URL (for non-AWS S3-compatible services) */
|
|
@@ -567,37 +601,73 @@ interface S3Config {
|
|
|
567
601
|
region: string;
|
|
568
602
|
/** Bucket name */
|
|
569
603
|
bucket: string;
|
|
570
|
-
/**
|
|
571
|
-
accessKeyId
|
|
572
|
-
/**
|
|
573
|
-
secretAccessKey
|
|
574
|
-
/**
|
|
604
|
+
/** @deprecated Entered in the host. */
|
|
605
|
+
accessKeyId?: string;
|
|
606
|
+
/** @deprecated Entered in the host. */
|
|
607
|
+
secretAccessKey?: string;
|
|
608
|
+
/** @deprecated Entered in the host. */
|
|
575
609
|
sessionToken?: string;
|
|
576
610
|
/** Use path-style URLs instead of virtual-hosted-style */
|
|
577
611
|
pathStyle?: boolean;
|
|
578
612
|
}
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
*/
|
|
582
|
-
interface AddBackendRequest {
|
|
583
|
-
/** Display name for the backend */
|
|
613
|
+
interface AddBackendRequestBase {
|
|
614
|
+
/** Display name for the storage */
|
|
584
615
|
name: string;
|
|
585
616
|
/** Backend type (currently only "s3") */
|
|
586
617
|
type: "s3";
|
|
587
|
-
/** Configuration (structure depends on type) */
|
|
588
|
-
config: S3Config | Record<string, unknown>;
|
|
589
618
|
}
|
|
590
619
|
/**
|
|
591
|
-
* Request to
|
|
592
|
-
*
|
|
620
|
+
* Request to add a new storage on a new connection. The host asks the user to
|
|
621
|
+
* confirm it and enters credentials in its own window.
|
|
622
|
+
*/
|
|
623
|
+
type AddBackendRequest = (AddBackendRequestBase & {
|
|
624
|
+
/** A credential-free proposal for a new connection; region is required. */
|
|
625
|
+
config: S3Proposal & {
|
|
626
|
+
region: string;
|
|
627
|
+
};
|
|
628
|
+
/** A new connection cannot reuse an existing provider. */
|
|
629
|
+
sameProviderAs?: never;
|
|
630
|
+
})
|
|
631
|
+
/**
|
|
632
|
+
* Request to add a bucket on an existing connection. Endpoint, region and
|
|
633
|
+
* addressing are taken from the referenced storage.
|
|
634
|
+
*/
|
|
635
|
+
| (AddBackendRequestBase & {
|
|
636
|
+
/** With an existing provider, only the bucket may be proposed. */
|
|
637
|
+
config: {
|
|
638
|
+
bucket: string;
|
|
639
|
+
endpoint?: never;
|
|
640
|
+
region?: never;
|
|
641
|
+
pathStyle?: never;
|
|
642
|
+
accessKeyId?: never;
|
|
643
|
+
secretAccessKey?: never;
|
|
644
|
+
sessionToken?: never;
|
|
645
|
+
};
|
|
646
|
+
/** A storage the extension may read. */
|
|
647
|
+
sameProviderAs: string;
|
|
648
|
+
});
|
|
649
|
+
/**
|
|
650
|
+
* Request to change a storage. The host asks the user to confirm it; new
|
|
651
|
+
* credentials are entered only in the host's own window.
|
|
593
652
|
*/
|
|
594
653
|
interface UpdateBackendRequest {
|
|
595
654
|
/** Backend ID to update */
|
|
596
655
|
backendId: string;
|
|
597
656
|
/** New display name (optional) */
|
|
598
657
|
name?: string;
|
|
599
|
-
/**
|
|
600
|
-
|
|
658
|
+
/**
|
|
659
|
+
* Only the bucket can be changed through the extension request. Credentials
|
|
660
|
+
* and connection details never cross the bridge.
|
|
661
|
+
*/
|
|
662
|
+
config?: {
|
|
663
|
+
bucket?: string;
|
|
664
|
+
endpoint?: never;
|
|
665
|
+
region?: never;
|
|
666
|
+
pathStyle?: never;
|
|
667
|
+
accessKeyId?: never;
|
|
668
|
+
secretAccessKey?: never;
|
|
669
|
+
sessionToken?: never;
|
|
670
|
+
};
|
|
601
671
|
}
|
|
602
672
|
/**
|
|
603
673
|
* Object info from list operation
|
|
@@ -672,14 +742,16 @@ declare class BackendManagement {
|
|
|
672
742
|
*/
|
|
673
743
|
list(): Promise<StorageBackendInfo[]>;
|
|
674
744
|
/**
|
|
675
|
-
*
|
|
676
|
-
*
|
|
745
|
+
* Propose a new storage. The host asks the user; credentials are entered
|
|
746
|
+
* only there. Resolves with the new storage, which the extension may then
|
|
747
|
+
* read and write.
|
|
748
|
+
* @param request - The proposal, without credentials
|
|
677
749
|
* @returns Created backend info
|
|
678
750
|
*/
|
|
679
751
|
add(request: AddBackendRequest): Promise<StorageBackendInfo>;
|
|
680
752
|
/**
|
|
681
|
-
*
|
|
682
|
-
* Only provided fields are updated
|
|
753
|
+
* Change a storage after the user confirms it in the host.
|
|
754
|
+
* Only provided fields are updated; new credentials are entered in the host.
|
|
683
755
|
* @param request - Update request with backendId and fields to update
|
|
684
756
|
* @returns Updated backend info
|
|
685
757
|
*/
|
|
@@ -1160,7 +1232,20 @@ interface ShellInfo {
|
|
|
1160
1232
|
}
|
|
1161
1233
|
declare class ShellAPI {
|
|
1162
1234
|
private readonly sdk;
|
|
1235
|
+
/** `shell:output` events per session handed on but not yet acknowledged. */
|
|
1236
|
+
private readonly unacknowledged;
|
|
1237
|
+
private flushScheduled;
|
|
1238
|
+
/** The host does not know `extension_shell_ack` (it reads output without backpressure). */
|
|
1239
|
+
private ackUnsupported;
|
|
1163
1240
|
constructor(sdk: HaexVaultSdk);
|
|
1241
|
+
/**
|
|
1242
|
+
* Backpressure: the host keeps reading a shell's output only while this frame has few
|
|
1243
|
+
* events open, so a shell that writes fast waits instead of flooding the page. The SDK
|
|
1244
|
+
* acknowledges every event once the listeners have had it, in one request per session and
|
|
1245
|
+
* task.
|
|
1246
|
+
*/
|
|
1247
|
+
private acknowledge;
|
|
1248
|
+
private flushAcknowledgements;
|
|
1164
1249
|
/**
|
|
1165
1250
|
* List available shell environments on the host system.
|
|
1166
1251
|
* No filesystem permission required.
|
|
@@ -1333,7 +1418,7 @@ interface MailAccount {
|
|
|
1333
1418
|
imap: ImapConfig;
|
|
1334
1419
|
smtp?: SmtpConfig;
|
|
1335
1420
|
}
|
|
1336
|
-
/** Payload of `MAIL_EVENTS.NEW_MESSAGES`, emitted by a background
|
|
1421
|
+
/** Payload of `MAIL_EVENTS.NEW_MESSAGES`, emitted by a background mail watch. */
|
|
1337
1422
|
interface MailNewMessagesEvent {
|
|
1338
1423
|
accountId: string;
|
|
1339
1424
|
mailboxName: string;
|
|
@@ -1481,16 +1566,22 @@ declare class MailAPI {
|
|
|
1481
1566
|
*/
|
|
1482
1567
|
buildRfc822Async(imapHost: string, message: OutgoingMessage): Promise<string>;
|
|
1483
1568
|
/**
|
|
1484
|
-
* Start (or replace) a background
|
|
1485
|
-
*
|
|
1486
|
-
*
|
|
1487
|
-
*
|
|
1569
|
+
* Start (or replace) a background watch for `accountId`/`mailboxName`.
|
|
1570
|
+
* Requires `mail` permission with action `poll` on the account's IMAP
|
|
1571
|
+
* host (`imap.host` when passed; prompted on first call, same as
|
|
1572
|
+
* `fetch`/`send`).
|
|
1573
|
+
*
|
|
1574
|
+
* Pass the account's `imap` config, as for every other mail call: the host
|
|
1575
|
+
* keeps the credentials in memory for as long as the watch runs and never
|
|
1576
|
+
* stores them. Hosts that wait with IMAP IDLE are told about new mail by the
|
|
1577
|
+
* server; `intervalSeconds` (clamped host-side to [30, 3600]) is the polling
|
|
1578
|
+
* interval for servers without IDLE. Listen for results via `onNewMessages`.
|
|
1488
1579
|
*
|
|
1489
|
-
* `
|
|
1490
|
-
*
|
|
1580
|
+
* `imap` is optional for hosts that resolve the credentials themselves from
|
|
1581
|
+
* `accountId`; holzi requires it.
|
|
1491
1582
|
*/
|
|
1492
|
-
startWatchingAsync(accountId: string, mailboxName: string, intervalSeconds: number): Promise<void>;
|
|
1493
|
-
/** Stop a background
|
|
1583
|
+
startWatchingAsync(accountId: string, mailboxName: string, intervalSeconds: number, imap?: ImapConfig): Promise<void>;
|
|
1584
|
+
/** Stop a background watch previously started with `startWatchingAsync`. */
|
|
1494
1585
|
stopWatchingAsync(accountId: string, mailboxName: string): Promise<void>;
|
|
1495
1586
|
/**
|
|
1496
1587
|
* Register a callback for new-mail notifications from any active watch.
|
|
@@ -1720,4 +1811,4 @@ declare class HaexVaultSdk {
|
|
|
1720
1811
|
private log;
|
|
1721
1812
|
}
|
|
1722
1813
|
|
|
1723
|
-
export { PasswordsAPI as $, type AuthorizedClient as A, type BlockedClient as B, type ConfirmOptions as C, DatabaseAPI as D, type ExternalAuthDecision as E, type FileStat as F, type MailMessage as G, HaexVaultSdk as H, type ImapConfig as I, type MailNewMessagesEvent as J, KnownPath as K, LOCALSEND_EVENTS as L, MailAPI as M, type MailboxInfo as N, type MessageEnvelope as O, type NotificationAction as P, type NotificationClickEvent as Q, type NotificationOptions as R, StorageAPI as S, NotificationsAPI as T, type OutgoingAttachment as U, type OutgoingMessage as V, type PasswordInput as W, type PasswordItemFull as X, type PasswordItemSummary as Y, type PasswordKeyValue as Z, type PasswordKeyValueInput as _, type ConnectionSecurity as a, type PendingAuthorization as a0, type PendingTransfer as a1, PermissionsAPI as a2, type AddBackendRequest as a3, type S3Config as a4, type
|
|
1814
|
+
export { PasswordsAPI as $, type AuthorizedClient as A, type BlockedClient as B, type ConfirmOptions as C, DatabaseAPI as D, type ExternalAuthDecision as E, type FileStat as F, type MailMessage as G, HaexVaultSdk as H, type ImapConfig as I, type MailNewMessagesEvent as J, KnownPath as K, LOCALSEND_EVENTS as L, MailAPI as M, type MailboxInfo as N, type MessageEnvelope as O, type NotificationAction as P, type NotificationClickEvent as Q, type NotificationOptions as R, StorageAPI as S, NotificationsAPI as T, type OutgoingAttachment as U, type OutgoingMessage as V, type PasswordInput as W, type PasswordItemFull as X, type PasswordItemSummary as Y, type PasswordKeyValue as Z, type PasswordKeyValueInput as _, type ConnectionSecurity as a, type PendingAuthorization as a0, type PendingTransfer as a1, PermissionsAPI as a2, type AddBackendRequest as a3, type S3Config as a4, type S3Proposal as a5, type S3PublicConfig as a6, RemoteStorageAPI as a7, type StorageBackendInfo as a8, type StorageObjectInfo as a9, WebAPI as aA, canExternalClientSendRequests as aB, isExternalClientConnected as aC, type UpdateBackendRequest as aa, type RequestedExtension as ab, type SelectFileOptions as ac, type SelectFolderOptions as ad, type ServerInfo as ae, type ServerStatus as af, type SessionAuthorization as ag, type SharedSpace as ah, ShellAPI as ai, type ShellCreateOptions as aj, type ShellCreateResponse as ak, type ShellExitEvent as al, type ShellOutputEvent as am, type SmtpConfig as an, type SpaceAccessTokenInfo as ao, type SpaceAssignment as ap, type SpaceInvite as aq, type SpaceKeyGrantInfo as ar, type SpaceMember as as, type SpaceMemberInfo as at, SpacesAPI as au, type SyncBackendInfo as av, TabAPI as aw, type TransferDirection as ax, type TransferProgress as ay, type TransferState as az, type DecryptedSpace as b, type DeepLink as c, type Device as d, type DeviceInfo as e, type DeviceType as f, DialogAPI as g, type DirEntry as h, type ExternalConnection as i, ExternalConnectionErrorCode as j, ExternalConnectionState as k, type ExternalRequest as l, type ExternalRequestEvent as m, type ExternalRequestHandler as n, type ExternalRequestPayload as o, type ExternalResponse as p, FilesystemAPI as q, type KnownPaths as r, LocalSendAPI as s, type LocalSendEvent as t, type FileInfo as u, type LocalSendSettings as v, type MailAccount as w, type MailAddress as x, type Attachment as y, type FetchRange as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { H as HaexVaultSdk } from './client-
|
|
2
|
-
export { A as AuthorizedClient, B as BlockedClient, C as ConfirmOptions, a as ConnectionSecurity, D as DatabaseAPI, b as DecryptedSpace, c as DeepLink, d as Device, e as DeviceInfo, f as DeviceType, g as DialogAPI, h as DirEntry, E as ExternalAuthDecision, i as ExternalConnection, j as ExternalConnectionErrorCode, k as ExternalConnectionState, l as ExternalRequest, m as ExternalRequestEvent, n as ExternalRequestHandler, o as ExternalRequestPayload, p as ExternalResponse, F as FileStat, q as FilesystemAPI, I as ImapConfig, K as KnownPath, r as KnownPaths, L as LOCALSEND_EVENTS, s as LocalSendAPI, t as LocalSendEvent, u as LocalSendFileInfo, v as LocalSendSettings, M as MailAPI, w as MailAccount, x as MailAddress, y as MailAttachment, z as MailFetchRange, G as MailMessage, J as MailNewMessagesEvent, N as MailboxInfo, O as MessageEnvelope, P as NotificationAction, Q as NotificationClickEvent, R as NotificationOptions, T as NotificationsAPI, U as OutgoingAttachment, V as OutgoingMessage, W as PasswordInput, X as PasswordItemFull, Y as PasswordItemSummary, Z as PasswordKeyValue, _ as PasswordKeyValueInput, $ as PasswordsAPI, a0 as PendingAuthorization, a1 as PendingTransfer, a2 as PermissionsAPI, a3 as RemoteAddBackendRequest, a4 as RemoteS3Config, a5 as
|
|
3
|
-
import { h as SignedClaimPresentation, H as HaexHubConfig } from './types-
|
|
4
|
-
export { A as ApplicationContext, C as ClaimRequirement, i as ContextChangedEvent, j as DEFAULT_TIMEOUT, k as DatabaseColumnInfo, l as DatabaseExecuteParams, m as DatabasePermission, g as DatabasePermissionRequest, n as DatabaseQueryParams, D as DatabaseQueryResult, o as DatabaseTableInfo, c as EXTERNAL_EVENTS, p as ErrorCode, f as EventCallback, E as ExtensionInfo, a as ExtensionManifest, q as ExtensionRuntimeMode, r as ExternalEvent, F as FileChangeEvent, s as FileChangePayload, t as FileChangeType, u as FilteredSyncTablesResult, v as HAEXTENSION_EVENTS, b as HaexHubEvent, w as HaexHubRequest, x as HaexHubResponse, y as HaexVaultSdkError, z as HaextensionEvent, I as IdentityClaim, B as MAIL_EVENTS, G as MailEvent, J as ManifestI18nEntry, N as NOTIFICATION_EVENTS, K as NotificationEvent, L as PermissionDeniedError, O as PermissionErrorBase, Q as PermissionErrorCode, T as PermissionPromptError, P as PermissionResponse, U as PermissionStatus, R as RequestOptions, V as SHELL_EVENTS, X as SearchQuery, Y as SearchRequestEvent, S as SearchResult, Z as ShellEvent, _ as SyncTablesUpdatedEvent, $ as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, a0 as getTableName, a1 as isPermissionDeniedError, a2 as isPermissionError, a3 as isPermissionPromptError } from './types-
|
|
1
|
+
import { H as HaexVaultSdk } from './client-7bZyiRwE.mjs';
|
|
2
|
+
export { A as AuthorizedClient, B as BlockedClient, C as ConfirmOptions, a as ConnectionSecurity, D as DatabaseAPI, b as DecryptedSpace, c as DeepLink, d as Device, e as DeviceInfo, f as DeviceType, g as DialogAPI, h as DirEntry, E as ExternalAuthDecision, i as ExternalConnection, j as ExternalConnectionErrorCode, k as ExternalConnectionState, l as ExternalRequest, m as ExternalRequestEvent, n as ExternalRequestHandler, o as ExternalRequestPayload, p as ExternalResponse, F as FileStat, q as FilesystemAPI, I as ImapConfig, K as KnownPath, r as KnownPaths, L as LOCALSEND_EVENTS, s as LocalSendAPI, t as LocalSendEvent, u as LocalSendFileInfo, v as LocalSendSettings, M as MailAPI, w as MailAccount, x as MailAddress, y as MailAttachment, z as MailFetchRange, G as MailMessage, J as MailNewMessagesEvent, N as MailboxInfo, O as MessageEnvelope, P as NotificationAction, Q as NotificationClickEvent, R as NotificationOptions, T as NotificationsAPI, U as OutgoingAttachment, V as OutgoingMessage, W as PasswordInput, X as PasswordItemFull, Y as PasswordItemSummary, Z as PasswordKeyValue, _ as PasswordKeyValueInput, $ as PasswordsAPI, a0 as PendingAuthorization, a1 as PendingTransfer, a2 as PermissionsAPI, a3 as RemoteAddBackendRequest, a4 as RemoteS3Config, a5 as RemoteS3Proposal, a6 as RemoteS3PublicConfig, a7 as RemoteStorageAPI, a8 as RemoteStorageBackendInfo, a9 as RemoteStorageObjectInfo, aa as RemoteUpdateBackendRequest, ab as RequestedExtension, ac as SelectFileOptions, ad as SelectFolderOptions, ae as ServerInfo, af as ServerStatus, ag as SessionAuthorization, ah as SharedSpace, ai as ShellAPI, aj as ShellCreateOptions, ak as ShellCreateResponse, al as ShellExitEvent, am as ShellOutputEvent, an as SmtpConfig, ao as SpaceAccessTokenInfo, ap as SpaceAssignment, aq as SpaceInvite, ar as SpaceKeyGrantInfo, as as SpaceMember, at as SpaceMemberInfo, au as SpacesAPI, av as SyncBackendInfo, aw as TabAPI, ax as TransferDirection, ay as TransferProgress, az as TransferState, aA as WebAPI, aB as canExternalClientSendRequests, aC as isExternalClientConnected } from './client-7bZyiRwE.mjs';
|
|
3
|
+
import { h as SignedClaimPresentation, H as HaexHubConfig } from './types-BwFKGH70.mjs';
|
|
4
|
+
export { A as ApplicationContext, C as ClaimRequirement, i as ContextChangedEvent, j as DEFAULT_TIMEOUT, k as DatabaseColumnInfo, l as DatabaseExecuteParams, m as DatabasePermission, g as DatabasePermissionRequest, n as DatabaseQueryParams, D as DatabaseQueryResult, o as DatabaseTableInfo, c as EXTERNAL_EVENTS, p as ErrorCode, f as EventCallback, E as ExtensionInfo, a as ExtensionManifest, q as ExtensionRuntimeMode, r as ExternalEvent, F as FileChangeEvent, s as FileChangePayload, t as FileChangeType, u as FilteredSyncTablesResult, v as HAEXTENSION_EVENTS, b as HaexHubEvent, w as HaexHubRequest, x as HaexHubResponse, y as HaexVaultSdkError, z as HaextensionEvent, I as IdentityClaim, B as MAIL_EVENTS, G as MailEvent, J as ManifestI18nEntry, N as NOTIFICATION_EVENTS, K as NotificationEvent, L as PermissionDeniedError, O as PermissionErrorBase, Q as PermissionErrorCode, T as PermissionPromptError, P as PermissionResponse, U as PermissionStatus, R as RequestOptions, V as SHELL_EVENTS, X as SearchQuery, Y as SearchRequestEvent, S as SearchResult, Z as ShellEvent, _ as SyncTablesUpdatedEvent, $ as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, a0 as getTableName, a1 as isPermissionDeniedError, a2 as isPermissionError, a3 as isPermissionPromptError } from './types-BwFKGH70.mjs';
|
|
5
5
|
export { H as HaextensionConfig } from './config-D_HXjsEV.mjs';
|
|
6
6
|
import 'drizzle-orm/sqlite-proxy';
|
|
7
7
|
|
|
@@ -135,9 +135,9 @@ declare const MAIL_COMMANDS: {
|
|
|
135
135
|
readonly sendMessage: "extension_mail_send_message";
|
|
136
136
|
/** Build RFC822 bytes without sending (for Drafts via APPEND) */
|
|
137
137
|
readonly buildRfc822: "extension_mail_build_rfc822";
|
|
138
|
-
/** Start (or replace) a background
|
|
138
|
+
/** Start (or replace) a background new-mail watch for an account/mailbox */
|
|
139
139
|
readonly startWatch: "extension_mail_start_watch";
|
|
140
|
-
/** Stop a background
|
|
140
|
+
/** Stop a background new-mail watch */
|
|
141
141
|
readonly stopWatch: "extension_mail_stop_watch";
|
|
142
142
|
};
|
|
143
143
|
type MailCommand = (typeof MAIL_COMMANDS)[keyof typeof MAIL_COMMANDS];
|
|
@@ -647,6 +647,8 @@ declare const SHELL_COMMANDS: {
|
|
|
647
647
|
readonly create: "extension_shell_create";
|
|
648
648
|
/** Write data to a shell session's stdin */
|
|
649
649
|
readonly write: "extension_shell_write";
|
|
650
|
+
/** Acknowledge `shell:output` events handed on (backpressure; sent by the SDK itself) */
|
|
651
|
+
readonly ack: "extension_shell_ack";
|
|
650
652
|
/** Resize a shell session's terminal */
|
|
651
653
|
readonly resize: "extension_shell_resize";
|
|
652
654
|
/** Close a shell session */
|
|
@@ -787,6 +789,7 @@ declare const TAURI_COMMANDS: {
|
|
|
787
789
|
readonly listAvailable: "extension_shell_list_available";
|
|
788
790
|
readonly create: "extension_shell_create";
|
|
789
791
|
readonly write: "extension_shell_write";
|
|
792
|
+
readonly ack: "extension_shell_ack";
|
|
790
793
|
readonly resize: "extension_shell_resize";
|
|
791
794
|
readonly close: "extension_shell_close";
|
|
792
795
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { H as HaexVaultSdk } from './client-
|
|
2
|
-
export { A as AuthorizedClient, B as BlockedClient, C as ConfirmOptions, a as ConnectionSecurity, D as DatabaseAPI, b as DecryptedSpace, c as DeepLink, d as Device, e as DeviceInfo, f as DeviceType, g as DialogAPI, h as DirEntry, E as ExternalAuthDecision, i as ExternalConnection, j as ExternalConnectionErrorCode, k as ExternalConnectionState, l as ExternalRequest, m as ExternalRequestEvent, n as ExternalRequestHandler, o as ExternalRequestPayload, p as ExternalResponse, F as FileStat, q as FilesystemAPI, I as ImapConfig, K as KnownPath, r as KnownPaths, L as LOCALSEND_EVENTS, s as LocalSendAPI, t as LocalSendEvent, u as LocalSendFileInfo, v as LocalSendSettings, M as MailAPI, w as MailAccount, x as MailAddress, y as MailAttachment, z as MailFetchRange, G as MailMessage, J as MailNewMessagesEvent, N as MailboxInfo, O as MessageEnvelope, P as NotificationAction, Q as NotificationClickEvent, R as NotificationOptions, T as NotificationsAPI, U as OutgoingAttachment, V as OutgoingMessage, W as PasswordInput, X as PasswordItemFull, Y as PasswordItemSummary, Z as PasswordKeyValue, _ as PasswordKeyValueInput, $ as PasswordsAPI, a0 as PendingAuthorization, a1 as PendingTransfer, a2 as PermissionsAPI, a3 as RemoteAddBackendRequest, a4 as RemoteS3Config, a5 as
|
|
3
|
-
import { h as SignedClaimPresentation, H as HaexHubConfig } from './types-
|
|
4
|
-
export { A as ApplicationContext, C as ClaimRequirement, i as ContextChangedEvent, j as DEFAULT_TIMEOUT, k as DatabaseColumnInfo, l as DatabaseExecuteParams, m as DatabasePermission, g as DatabasePermissionRequest, n as DatabaseQueryParams, D as DatabaseQueryResult, o as DatabaseTableInfo, c as EXTERNAL_EVENTS, p as ErrorCode, f as EventCallback, E as ExtensionInfo, a as ExtensionManifest, q as ExtensionRuntimeMode, r as ExternalEvent, F as FileChangeEvent, s as FileChangePayload, t as FileChangeType, u as FilteredSyncTablesResult, v as HAEXTENSION_EVENTS, b as HaexHubEvent, w as HaexHubRequest, x as HaexHubResponse, y as HaexVaultSdkError, z as HaextensionEvent, I as IdentityClaim, B as MAIL_EVENTS, G as MailEvent, J as ManifestI18nEntry, N as NOTIFICATION_EVENTS, K as NotificationEvent, L as PermissionDeniedError, O as PermissionErrorBase, Q as PermissionErrorCode, T as PermissionPromptError, P as PermissionResponse, U as PermissionStatus, R as RequestOptions, V as SHELL_EVENTS, X as SearchQuery, Y as SearchRequestEvent, S as SearchResult, Z as ShellEvent, _ as SyncTablesUpdatedEvent, $ as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, a0 as getTableName, a1 as isPermissionDeniedError, a2 as isPermissionError, a3 as isPermissionPromptError } from './types-
|
|
1
|
+
import { H as HaexVaultSdk } from './client-BPwsH1so.js';
|
|
2
|
+
export { A as AuthorizedClient, B as BlockedClient, C as ConfirmOptions, a as ConnectionSecurity, D as DatabaseAPI, b as DecryptedSpace, c as DeepLink, d as Device, e as DeviceInfo, f as DeviceType, g as DialogAPI, h as DirEntry, E as ExternalAuthDecision, i as ExternalConnection, j as ExternalConnectionErrorCode, k as ExternalConnectionState, l as ExternalRequest, m as ExternalRequestEvent, n as ExternalRequestHandler, o as ExternalRequestPayload, p as ExternalResponse, F as FileStat, q as FilesystemAPI, I as ImapConfig, K as KnownPath, r as KnownPaths, L as LOCALSEND_EVENTS, s as LocalSendAPI, t as LocalSendEvent, u as LocalSendFileInfo, v as LocalSendSettings, M as MailAPI, w as MailAccount, x as MailAddress, y as MailAttachment, z as MailFetchRange, G as MailMessage, J as MailNewMessagesEvent, N as MailboxInfo, O as MessageEnvelope, P as NotificationAction, Q as NotificationClickEvent, R as NotificationOptions, T as NotificationsAPI, U as OutgoingAttachment, V as OutgoingMessage, W as PasswordInput, X as PasswordItemFull, Y as PasswordItemSummary, Z as PasswordKeyValue, _ as PasswordKeyValueInput, $ as PasswordsAPI, a0 as PendingAuthorization, a1 as PendingTransfer, a2 as PermissionsAPI, a3 as RemoteAddBackendRequest, a4 as RemoteS3Config, a5 as RemoteS3Proposal, a6 as RemoteS3PublicConfig, a7 as RemoteStorageAPI, a8 as RemoteStorageBackendInfo, a9 as RemoteStorageObjectInfo, aa as RemoteUpdateBackendRequest, ab as RequestedExtension, ac as SelectFileOptions, ad as SelectFolderOptions, ae as ServerInfo, af as ServerStatus, ag as SessionAuthorization, ah as SharedSpace, ai as ShellAPI, aj as ShellCreateOptions, ak as ShellCreateResponse, al as ShellExitEvent, am as ShellOutputEvent, an as SmtpConfig, ao as SpaceAccessTokenInfo, ap as SpaceAssignment, aq as SpaceInvite, ar as SpaceKeyGrantInfo, as as SpaceMember, at as SpaceMemberInfo, au as SpacesAPI, av as SyncBackendInfo, aw as TabAPI, ax as TransferDirection, ay as TransferProgress, az as TransferState, aA as WebAPI, aB as canExternalClientSendRequests, aC as isExternalClientConnected } from './client-BPwsH1so.js';
|
|
3
|
+
import { h as SignedClaimPresentation, H as HaexHubConfig } from './types-BwFKGH70.js';
|
|
4
|
+
export { A as ApplicationContext, C as ClaimRequirement, i as ContextChangedEvent, j as DEFAULT_TIMEOUT, k as DatabaseColumnInfo, l as DatabaseExecuteParams, m as DatabasePermission, g as DatabasePermissionRequest, n as DatabaseQueryParams, D as DatabaseQueryResult, o as DatabaseTableInfo, c as EXTERNAL_EVENTS, p as ErrorCode, f as EventCallback, E as ExtensionInfo, a as ExtensionManifest, q as ExtensionRuntimeMode, r as ExternalEvent, F as FileChangeEvent, s as FileChangePayload, t as FileChangeType, u as FilteredSyncTablesResult, v as HAEXTENSION_EVENTS, b as HaexHubEvent, w as HaexHubRequest, x as HaexHubResponse, y as HaexVaultSdkError, z as HaextensionEvent, I as IdentityClaim, B as MAIL_EVENTS, G as MailEvent, J as ManifestI18nEntry, N as NOTIFICATION_EVENTS, K as NotificationEvent, L as PermissionDeniedError, O as PermissionErrorBase, Q as PermissionErrorCode, T as PermissionPromptError, P as PermissionResponse, U as PermissionStatus, R as RequestOptions, V as SHELL_EVENTS, X as SearchQuery, Y as SearchRequestEvent, S as SearchResult, Z as ShellEvent, _ as SyncTablesUpdatedEvent, $ as TABLE_SEPARATOR, W as WebRequestOptions, e as WebResponse, a0 as getTableName, a1 as isPermissionDeniedError, a2 as isPermissionError, a3 as isPermissionPromptError } from './types-BwFKGH70.js';
|
|
5
5
|
export { H as HaextensionConfig } from './config-D_HXjsEV.js';
|
|
6
6
|
import 'drizzle-orm/sqlite-proxy';
|
|
7
7
|
|
|
@@ -135,9 +135,9 @@ declare const MAIL_COMMANDS: {
|
|
|
135
135
|
readonly sendMessage: "extension_mail_send_message";
|
|
136
136
|
/** Build RFC822 bytes without sending (for Drafts via APPEND) */
|
|
137
137
|
readonly buildRfc822: "extension_mail_build_rfc822";
|
|
138
|
-
/** Start (or replace) a background
|
|
138
|
+
/** Start (or replace) a background new-mail watch for an account/mailbox */
|
|
139
139
|
readonly startWatch: "extension_mail_start_watch";
|
|
140
|
-
/** Stop a background
|
|
140
|
+
/** Stop a background new-mail watch */
|
|
141
141
|
readonly stopWatch: "extension_mail_stop_watch";
|
|
142
142
|
};
|
|
143
143
|
type MailCommand = (typeof MAIL_COMMANDS)[keyof typeof MAIL_COMMANDS];
|
|
@@ -647,6 +647,8 @@ declare const SHELL_COMMANDS: {
|
|
|
647
647
|
readonly create: "extension_shell_create";
|
|
648
648
|
/** Write data to a shell session's stdin */
|
|
649
649
|
readonly write: "extension_shell_write";
|
|
650
|
+
/** Acknowledge `shell:output` events handed on (backpressure; sent by the SDK itself) */
|
|
651
|
+
readonly ack: "extension_shell_ack";
|
|
650
652
|
/** Resize a shell session's terminal */
|
|
651
653
|
readonly resize: "extension_shell_resize";
|
|
652
654
|
/** Close a shell session */
|
|
@@ -787,6 +789,7 @@ declare const TAURI_COMMANDS: {
|
|
|
787
789
|
readonly listAvailable: "extension_shell_list_available";
|
|
788
790
|
readonly create: "extension_shell_create";
|
|
789
791
|
readonly write: "extension_shell_write";
|
|
792
|
+
readonly ack: "extension_shell_ack";
|
|
790
793
|
readonly resize: "extension_shell_resize";
|
|
791
794
|
readonly close: "extension_shell_close";
|
|
792
795
|
};
|
package/dist/index.js
CHANGED
|
@@ -12,9 +12,9 @@ var __export = (target, all) => {
|
|
|
12
12
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
// node_modules/.pnpm/tsup@8.5.1_jiti@2.7.0_postcss@8.5.
|
|
15
|
+
// node_modules/.pnpm/tsup@8.5.1_jiti@2.7.0_postcss@8.5.29_typescript@6.0.3_yaml@2.9.0/node_modules/tsup/assets/cjs_shims.js
|
|
16
16
|
var init_cjs_shims = __esm({
|
|
17
|
-
"node_modules/.pnpm/tsup@8.5.1_jiti@2.7.0_postcss@8.5.
|
|
17
|
+
"node_modules/.pnpm/tsup@8.5.1_jiti@2.7.0_postcss@8.5.29_typescript@6.0.3_yaml@2.9.0/node_modules/tsup/assets/cjs_shims.js"() {
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
|
|
@@ -1111,6 +1111,8 @@ var SHELL_COMMANDS = {
|
|
|
1111
1111
|
create: "extension_shell_create",
|
|
1112
1112
|
/** Write data to a shell session's stdin */
|
|
1113
1113
|
write: "extension_shell_write",
|
|
1114
|
+
/** Acknowledge `shell:output` events handed on (backpressure; sent by the SDK itself) */
|
|
1115
|
+
ack: "extension_shell_ack",
|
|
1114
1116
|
/** Resize a shell session's terminal */
|
|
1115
1117
|
resize: "extension_shell_resize",
|
|
1116
1118
|
/** Close a shell session */
|
|
@@ -1153,9 +1155,9 @@ var MAIL_COMMANDS = {
|
|
|
1153
1155
|
sendMessage: "extension_mail_send_message",
|
|
1154
1156
|
/** Build RFC822 bytes without sending (for Drafts via APPEND) */
|
|
1155
1157
|
buildRfc822: "extension_mail_build_rfc822",
|
|
1156
|
-
/** Start (or replace) a background
|
|
1158
|
+
/** Start (or replace) a background new-mail watch for an account/mailbox */
|
|
1157
1159
|
startWatch: "extension_mail_start_watch",
|
|
1158
|
-
/** Stop a background
|
|
1160
|
+
/** Stop a background new-mail watch */
|
|
1159
1161
|
stopWatch: "extension_mail_stop_watch"
|
|
1160
1162
|
};
|
|
1161
1163
|
|
|
@@ -1791,26 +1793,32 @@ var BackendManagement = class {
|
|
|
1791
1793
|
);
|
|
1792
1794
|
}
|
|
1793
1795
|
/**
|
|
1794
|
-
*
|
|
1795
|
-
*
|
|
1796
|
+
* Propose a new storage. The host asks the user; credentials are entered
|
|
1797
|
+
* only there. Resolves with the new storage, which the extension may then
|
|
1798
|
+
* read and write.
|
|
1799
|
+
* @param request - The proposal, without credentials
|
|
1796
1800
|
* @returns Created backend info
|
|
1797
1801
|
*/
|
|
1798
1802
|
async add(request) {
|
|
1799
1803
|
return this.client.request(
|
|
1800
1804
|
REMOTE_STORAGE_COMMANDS.addBackend,
|
|
1801
|
-
{ request }
|
|
1805
|
+
{ request },
|
|
1806
|
+
// No deadline: the host waits for the user's answer in its dialog.
|
|
1807
|
+
{ timeout: null }
|
|
1802
1808
|
);
|
|
1803
1809
|
}
|
|
1804
1810
|
/**
|
|
1805
|
-
*
|
|
1806
|
-
* Only provided fields are updated
|
|
1811
|
+
* Change a storage after the user confirms it in the host.
|
|
1812
|
+
* Only provided fields are updated; new credentials are entered in the host.
|
|
1807
1813
|
* @param request - Update request with backendId and fields to update
|
|
1808
1814
|
* @returns Updated backend info
|
|
1809
1815
|
*/
|
|
1810
1816
|
async update(request) {
|
|
1811
1817
|
return this.client.request(
|
|
1812
1818
|
REMOTE_STORAGE_COMMANDS.updateBackend,
|
|
1813
|
-
{ request }
|
|
1819
|
+
{ request },
|
|
1820
|
+
// No deadline: the host waits for the user's answer in its dialog.
|
|
1821
|
+
{ timeout: null }
|
|
1814
1822
|
);
|
|
1815
1823
|
}
|
|
1816
1824
|
/**
|
|
@@ -1818,18 +1826,22 @@ var BackendManagement = class {
|
|
|
1818
1826
|
* @param backendId - Backend ID to remove
|
|
1819
1827
|
*/
|
|
1820
1828
|
async remove(backendId) {
|
|
1821
|
-
await this.client.request(
|
|
1822
|
-
|
|
1823
|
-
|
|
1829
|
+
await this.client.request(
|
|
1830
|
+
REMOTE_STORAGE_COMMANDS.removeBackend,
|
|
1831
|
+
{ backendId },
|
|
1832
|
+
{ timeout: null }
|
|
1833
|
+
);
|
|
1824
1834
|
}
|
|
1825
1835
|
/**
|
|
1826
1836
|
* Test connection to a storage backend
|
|
1827
1837
|
* @param backendId - Backend ID to test
|
|
1828
1838
|
*/
|
|
1829
1839
|
async test(backendId) {
|
|
1830
|
-
await this.client.request(
|
|
1831
|
-
|
|
1832
|
-
|
|
1840
|
+
await this.client.request(
|
|
1841
|
+
REMOTE_STORAGE_COMMANDS.testBackend,
|
|
1842
|
+
{ backendId },
|
|
1843
|
+
{ timeout: null }
|
|
1844
|
+
);
|
|
1833
1845
|
}
|
|
1834
1846
|
};
|
|
1835
1847
|
|
|
@@ -2080,9 +2092,44 @@ var SpacesAPI = class {
|
|
|
2080
2092
|
|
|
2081
2093
|
// src/api/shell.ts
|
|
2082
2094
|
init_cjs_shims();
|
|
2095
|
+
var NOT_SUPPORTED = 8e3;
|
|
2096
|
+
function isUnsupported(error) {
|
|
2097
|
+
if (error?.code === NOT_SUPPORTED) return true;
|
|
2098
|
+
return typeof error === "string" && /\bcommand (\S+ )?not found\b/i.test(error);
|
|
2099
|
+
}
|
|
2083
2100
|
var ShellAPI = class {
|
|
2084
2101
|
constructor(sdk) {
|
|
2085
2102
|
this.sdk = sdk;
|
|
2103
|
+
/** `shell:output` events per session handed on but not yet acknowledged. */
|
|
2104
|
+
this.unacknowledged = /* @__PURE__ */ new Map();
|
|
2105
|
+
this.flushScheduled = false;
|
|
2106
|
+
/** The host does not know `extension_shell_ack` (it reads output without backpressure). */
|
|
2107
|
+
this.ackUnsupported = false;
|
|
2108
|
+
this.sdk.on(SHELL_EVENTS.OUTPUT, (event) => this.acknowledge(event));
|
|
2109
|
+
}
|
|
2110
|
+
/**
|
|
2111
|
+
* Backpressure: the host keeps reading a shell's output only while this frame has few
|
|
2112
|
+
* events open, so a shell that writes fast waits instead of flooding the page. The SDK
|
|
2113
|
+
* acknowledges every event once the listeners have had it, in one request per session and
|
|
2114
|
+
* task.
|
|
2115
|
+
*/
|
|
2116
|
+
acknowledge(event) {
|
|
2117
|
+
const sessionId = event.data?.sessionId;
|
|
2118
|
+
if (this.ackUnsupported || typeof sessionId !== "string") return;
|
|
2119
|
+
this.unacknowledged.set(sessionId, (this.unacknowledged.get(sessionId) ?? 0) + 1);
|
|
2120
|
+
if (this.flushScheduled) return;
|
|
2121
|
+
this.flushScheduled = true;
|
|
2122
|
+
queueMicrotask(() => this.flushAcknowledgements());
|
|
2123
|
+
}
|
|
2124
|
+
flushAcknowledgements() {
|
|
2125
|
+
this.flushScheduled = false;
|
|
2126
|
+
const counts = [...this.unacknowledged];
|
|
2127
|
+
this.unacknowledged.clear();
|
|
2128
|
+
for (const [sessionId, count] of counts) {
|
|
2129
|
+
this.sdk.request(SHELL_COMMANDS.ack, { sessionId, count }).catch((error) => {
|
|
2130
|
+
if (isUnsupported(error)) this.ackUnsupported = true;
|
|
2131
|
+
});
|
|
2132
|
+
}
|
|
2086
2133
|
}
|
|
2087
2134
|
/**
|
|
2088
2135
|
* List available shell environments on the host system.
|
|
@@ -2300,22 +2347,29 @@ var MailAPI = class {
|
|
|
2300
2347
|
});
|
|
2301
2348
|
}
|
|
2302
2349
|
/**
|
|
2303
|
-
* Start (or replace) a background
|
|
2304
|
-
*
|
|
2305
|
-
*
|
|
2306
|
-
*
|
|
2350
|
+
* Start (or replace) a background watch for `accountId`/`mailboxName`.
|
|
2351
|
+
* Requires `mail` permission with action `poll` on the account's IMAP
|
|
2352
|
+
* host (`imap.host` when passed; prompted on first call, same as
|
|
2353
|
+
* `fetch`/`send`).
|
|
2354
|
+
*
|
|
2355
|
+
* Pass the account's `imap` config, as for every other mail call: the host
|
|
2356
|
+
* keeps the credentials in memory for as long as the watch runs and never
|
|
2357
|
+
* stores them. Hosts that wait with IMAP IDLE are told about new mail by the
|
|
2358
|
+
* server; `intervalSeconds` (clamped host-side to [30, 3600]) is the polling
|
|
2359
|
+
* interval for servers without IDLE. Listen for results via `onNewMessages`.
|
|
2307
2360
|
*
|
|
2308
|
-
* `
|
|
2309
|
-
*
|
|
2361
|
+
* `imap` is optional for hosts that resolve the credentials themselves from
|
|
2362
|
+
* `accountId`; holzi requires it.
|
|
2310
2363
|
*/
|
|
2311
|
-
async startWatchingAsync(accountId, mailboxName, intervalSeconds) {
|
|
2364
|
+
async startWatchingAsync(accountId, mailboxName, intervalSeconds, imap) {
|
|
2312
2365
|
return this.client.request(MAIL_COMMANDS.startWatch, {
|
|
2313
2366
|
accountId,
|
|
2314
2367
|
mailboxName,
|
|
2315
|
-
intervalSeconds
|
|
2368
|
+
intervalSeconds,
|
|
2369
|
+
imap
|
|
2316
2370
|
});
|
|
2317
2371
|
}
|
|
2318
|
-
/** Stop a background
|
|
2372
|
+
/** Stop a background watch previously started with `startWatchingAsync`. */
|
|
2319
2373
|
async stopWatchingAsync(accountId, mailboxName) {
|
|
2320
2374
|
return this.client.request(MAIL_COMMANDS.stopWatch, {
|
|
2321
2375
|
accountId,
|