@finueva/drive 0.28.0 → 0.29.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/CHANGELOG.md +6 -0
- package/README.md +29 -3
- package/dist/client.d.ts +3 -6
- package/dist/client.js +1 -1
- package/dist/contract.d.ts +54 -1
- package/dist/contract2.d.ts +1 -1
- package/dist/contract3.d.ts +10 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +1 -1
- package/dist/types.d.ts +2 -2
- package/package.json +1 -1
package/dist/contract.d.ts
CHANGED
|
@@ -7736,6 +7736,7 @@ interface DriveEditingClientConfig {
|
|
|
7736
7736
|
readonly audience: string;
|
|
7737
7737
|
readonly fetch?: typeof globalThis.fetch;
|
|
7738
7738
|
readonly timeoutMilliseconds?: number;
|
|
7739
|
+
readonly upload?: DriveUploadConfig;
|
|
7739
7740
|
}
|
|
7740
7741
|
type DriveEditingServerClient = VerifiedTransferOperations & Pick<DriveOperations, "getFileAccessContext" | "createDownload" | "downloadItem">;
|
|
7741
7742
|
type DriveEditingClient = DriveEditingServerClient & {
|
|
@@ -7970,7 +7971,40 @@ interface DriveClientConfig {
|
|
|
7970
7971
|
readonly baseUrl: string;
|
|
7971
7972
|
readonly fetch?: typeof globalThis.fetch;
|
|
7972
7973
|
readonly getCredential: DriveCredentialProvider;
|
|
7974
|
+
/**
|
|
7975
|
+
* Deadline for every API request, 1 ms through 120 s, default 30 s. Setting it explicitly also keeps its earlier
|
|
7976
|
+
* meaning for the object upload: it caps the whole provider PUT unless `upload.maxDurationMilliseconds` is set.
|
|
7977
|
+
*/
|
|
7973
7978
|
readonly timeoutMilliseconds?: number;
|
|
7979
|
+
readonly upload?: DriveUploadConfig;
|
|
7980
|
+
}
|
|
7981
|
+
/**
|
|
7982
|
+
* Bounds and transport for the direct provider PUT behind `uploadVerifiedFile`.
|
|
7983
|
+
*
|
|
7984
|
+
* Progress and stall detection need a transport that reports bytes sent. Without a custom `fetch`, browsers and
|
|
7985
|
+
* webviews use `XMLHttpRequest` for a cross-origin provider PUT; other runtimes, and any custom `fetch` that is not
|
|
7986
|
+
* wrapped with `createUploadProgressFetch`, use plain `fetch`. Plain `fetch` reports only 0 and then all bytes and is
|
|
7987
|
+
* not stall-checked.
|
|
7988
|
+
*/
|
|
7989
|
+
interface DriveUploadConfig {
|
|
7990
|
+
/**
|
|
7991
|
+
* Abort the provider PUT when no new byte has been sent for this many milliseconds, or when the response does not
|
|
7992
|
+
* follow the last byte within the same window. Default 30 000, range 1 through 3 600 000. It applies only when the
|
|
7993
|
+
* transport reports progress.
|
|
7994
|
+
*/
|
|
7995
|
+
readonly stallTimeoutMilliseconds?: number;
|
|
7996
|
+
/**
|
|
7997
|
+
* Overall cap on the provider PUT, range 1 through 3 600 000. Without it the PUT is bounded only by stall detection
|
|
7998
|
+
* and the capability expiry, unless `timeoutMilliseconds` was set explicitly, which then applies as this cap. The
|
|
7999
|
+
* expiry always applies and is at most five minutes after admission.
|
|
8000
|
+
*/
|
|
8001
|
+
readonly maxDurationMilliseconds?: number;
|
|
8002
|
+
/**
|
|
8003
|
+
* `auto` (default) selects a progress-reporting transport when the runtime offers one and no custom `fetch` is
|
|
8004
|
+
* configured. `fetch` always uses `fetch` with coarse progress and no stall detection, which also keeps `fetch`'s
|
|
8005
|
+
* `redirect: "manual"`, `referrerPolicy: "no-referrer"` and `credentials: "omit"` guarantees.
|
|
8006
|
+
*/
|
|
8007
|
+
readonly transport?: "auto" | "fetch";
|
|
7974
8008
|
}
|
|
7975
8009
|
interface DriveServerClientConfig {
|
|
7976
8010
|
readonly baseUrl: string;
|
|
@@ -8055,12 +8089,31 @@ type CreateDownloadInput = Readonly<CreateDownloadPath> & Readonly<CreateDownloa
|
|
|
8055
8089
|
};
|
|
8056
8090
|
type DownloadItemResult = Response | DriveOperationResult<ManagedDownloadRestorePending, 202> | DriveOperationResult<undefined, 304>;
|
|
8057
8091
|
type UploadFilePhase = "preparing" | "uploading" | "completing" | "verifying";
|
|
8092
|
+
/**
|
|
8093
|
+
* The step within an upload `phase`, in the order `hashing`, `preparing`, `uploading`, `completing`.
|
|
8094
|
+
* `hashing` and `preparing` both report phase `preparing`. A published replay never uploads and a file of at most
|
|
8095
|
+
* 1 MiB has no separate `preparing` request, so either may skip a stage; a stage never repeats or goes back.
|
|
8096
|
+
*/
|
|
8097
|
+
type UploadFileStage = "hashing" | "preparing" | "uploading" | "completing";
|
|
8058
8098
|
interface UploadFileProgress {
|
|
8059
8099
|
readonly phase: UploadFilePhase;
|
|
8100
|
+
/**
|
|
8101
|
+
* 0 while `preparing`, `sentByteLength` while `uploading` and `totalByteLength` once `completing`. While uploading it
|
|
8102
|
+
* counts bytes the transport has sent, which the service has not accepted yet; only `published` confirms the file.
|
|
8103
|
+
*/
|
|
8060
8104
|
readonly confirmedByteLength: number;
|
|
8061
8105
|
readonly totalByteLength: number;
|
|
8062
8106
|
readonly confirmedPartCount: number;
|
|
8063
8107
|
readonly totalPartCount: number;
|
|
8108
|
+
/** Present from SDK 0.29. The finer step within `phase`. */
|
|
8109
|
+
readonly stage?: UploadFileStage;
|
|
8110
|
+
/** Present from SDK 0.29. Bytes hashed so far; `totalByteLength` from the end of `hashing` on. */
|
|
8111
|
+
readonly hashedByteLength?: number;
|
|
8112
|
+
/**
|
|
8113
|
+
* Present from SDK 0.29. Bytes the transport has sent to storage so far. With a progress-reporting transport it rises
|
|
8114
|
+
* between 0 and `totalByteLength` while `uploading`; otherwise it jumps from 0 to `totalByteLength` at `completing`.
|
|
8115
|
+
*/
|
|
8116
|
+
readonly sentByteLength?: number;
|
|
8064
8117
|
}
|
|
8065
8118
|
type UploadFileProgressCallback = (progress: UploadFileProgress) => void;
|
|
8066
8119
|
interface GetCurrentWorkspaceInput {
|
|
@@ -8167,4 +8220,4 @@ interface DriveClient extends DriveOperations, VerifiedTransferOperations {
|
|
|
8167
8220
|
uploadVerifiedFile(input: UploadVerifiedFileInput): Promise<DriveOperationResult<PublishedVerifiedTransfer, 200>>;
|
|
8168
8221
|
}
|
|
8169
8222
|
//#endregion
|
|
8170
|
-
export {
|
|
8223
|
+
export { ListFolderChildrenInput as $, VisitorEditingSession as $t, DriveUploadConfig as A, RecoverVerifiedTransferInput as At, FolderListedItem as B, UpdateItemInput as Bt, DriveEditingClientConfig as C, PermissionPage as Ct, DriveResponseValidators as D, PublishVerifiedTransferInput as Dt, DriveOperations as E, ProtectionClassification as Et, EffectivePermissionAction as F, RevokeItemPermissionInput as Ft, GetVisitorGrantInput as G, UploadFileProgressCallback as Gt, GetCurrentWorkspaceInput as H, UpdateWorkspaceSharingPolicyInput as Ht, EffectivePermissionResponse as I, RevokeVisitorGrantInput as It, IncomingItemPage as J, UploadVerifiedFileInput as Jt, GetWorkspaceUsageInput as K, UploadFileStage as Kt, FileAccessContext as L, SearchWorkspaceItemsInput as Lt, DriveVisitorClientConfig as M, RegisteredRecipientDisplay as Mt, EditingSession as N, RestoreItemInput as Nt, DriveServerClient as O, PublishedVerifiedTransfer as Ot, EditingSessionCreation as P, RestoreItemVersionInput as Pt, ItemSharingPeoplePage as Q, VisitorDownloadInput as Qt, FolderItem as R, TransferItemOwnershipInput as Rt, DriveEditingClient as S, PermissionMutation as St, DriveOperationResult as T, PreparedVerifiedTransfer as Tt, GetItemInput as U, UploadFilePhase as Ut, FolderPage as V, UpdateItemPermissionInput as Vt, GetItemVersionInput as W, UploadFileProgress as Wt, IncomingSharePage as X, VisitorChildren as Xt, IncomingShareContext as Y, VerifiedTransferOperations as Yt, ItemOwnershipTransfer as Z, VisitorChildrenInput as Zt, DownloadItemResult as _, OwnedItem as _t, CollectOwnedItemsInput as a, VisitorSession as an, ListOwnedItemsInput as at, DriveCredentialContext as b, PermissionGrant as bt, CreateEditingSessionInput as c, WorkspaceItemSearchItem as cn, ManagedDownloadRestorePending as ct, CreateVisitorEditingSessionInput as d, WorkspaceUsage as dn, ManagedItemVersionPage as dt, VisitorGrant as en, ListIncomingItemsInput as et, CreateVisitorGrantInput as f, operations as fn, ManagedItemVersionResource as ft, DeleteItemInput as g, OrganizationMemberStorageUsageInput as gt, CurrentWorkspaceSources as h, OrganizationMemberStorageUsage as ht, ChangeEditingSessionInput as i, VisitorReadInput as in, ListItemVersionsInput as it, DriveVisitorClient as j, RegisterItemRecipientInput as jt, DriveServerClientConfig as k, ReadEffectiveItemPermissionsInput as kt, CreateFolderInput as l, WorkspaceItemSearchPage as ln, ManagedItemMetadata as lt, CurrentWorkspace as m, ManagedLifecycleItem as mt, ArchiveItemInput as n, VisitorGrantPage as nn, ListItemPermissionsInput as nt, CollectedOwnedItems as o, WorkspaceDiscoveryItem as on, ListWorkspaceItemsInput as ot, CurrentUserWorkspaceUsage as p, ManagedItemVersionRestoreResult as pt, IncomingItemMetadata as q, UploadSmallVerifiedFileInput as qt, ArchivedItem as r, VisitorItem as rn, ListItemSharingPeopleInput as rt, CreateDownloadInput as s, WorkspaceDiscoveryPage as sn, ManagedDownloadDescriptor as st, AdmittedVerifiedTransfer as t, VisitorGrantCreation as tn, ListIncomingSharesInput as tt, CreateItemPermissionInput as u, WorkspaceSharingPolicy as un, ManagedItemVersion as ut, DriveClient as v, OwnedItemPage as vt, DriveEditingServerClient as w, PrepareVerifiedTransferInput as wt, DriveCredentialProvider as x, PermissionGrantee as xt, DriveClientConfig as y, PermissionAction as yt, FolderListInclude as z, TrashItemInput as zt };
|
package/dist/contract2.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as DriveOperations, M as DriveVisitorClientConfig, a as CollectOwnedItemsInput, j as DriveVisitorClient, o as CollectedOwnedItems } from "./contract.js";
|
|
2
2
|
//#region src/internal/client/visitors.d.ts
|
|
3
3
|
declare function createDriveVisitorClient(config: DriveVisitorClientConfig): DriveVisitorClient;
|
|
4
4
|
declare function createVisitorSessionToken(): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { C as DriveEditingClientConfig, S as DriveEditingClient, v as DriveClient, y as DriveClientConfig } from "./contract.js";
|
|
2
|
+
//#region src/internal/client/provider-xhr.d.ts
|
|
3
|
+
/** `createProgressFetch` for callers composing their own `fetch`, for example one that fences each dispatch. */
|
|
4
|
+
declare function createUploadProgressFetch(fetchImplementation?: typeof globalThis.fetch): typeof globalThis.fetch;
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/client.d.ts
|
|
7
|
+
declare function createDriveEditingClient(config: DriveEditingClientConfig): DriveEditingClient;
|
|
8
|
+
declare function createDriveClient(config: DriveClientConfig): DriveClient;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { createDriveEditingClient as n, createUploadProgressFetch as r, createDriveClient as t };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as ListFolderChildrenInput, A as DriveUploadConfig, At as RecoverVerifiedTransferInput, B as FolderListedItem, Bt as UpdateItemInput, C as DriveEditingClientConfig, D as DriveResponseValidators, Dt as PublishVerifiedTransferInput, E as DriveOperations, Et as ProtectionClassification, F as EffectivePermissionAction, Ft as RevokeItemPermissionInput, G as GetVisitorGrantInput, Gt as UploadFileProgressCallback, H as GetCurrentWorkspaceInput, Ht as UpdateWorkspaceSharingPolicyInput, It as RevokeVisitorGrantInput, J as IncomingItemPage, Jt as UploadVerifiedFileInput, K as GetWorkspaceUsageInput, Kt as UploadFileStage, L as FileAccessContext, Lt as SearchWorkspaceItemsInput, M as DriveVisitorClientConfig, N as EditingSession, Nt as RestoreItemInput, Ot as PublishedVerifiedTransfer, P as EditingSessionCreation, Pt as RestoreItemVersionInput, Qt as VisitorDownloadInput, R as FolderItem, Rt as TransferItemOwnershipInput, S as DriveEditingClient, St as PermissionMutation, T as DriveOperationResult, Tt as PreparedVerifiedTransfer, U as GetItemInput, Ut as UploadFilePhase, V as FolderPage, Vt as UpdateItemPermissionInput, W as GetItemVersionInput, Wt as UploadFileProgress, Xt as VisitorChildren, Yt as VerifiedTransferOperations, Z as ItemOwnershipTransfer, Zt as VisitorChildrenInput, _ as DownloadItemResult, _t as OwnedItem, a as CollectOwnedItemsInput, an as VisitorSession, at as ListOwnedItemsInput, bt as PermissionGrant, c as CreateEditingSessionInput, cn as WorkspaceItemSearchItem, ct as ManagedDownloadRestorePending, dn as WorkspaceUsage, dt as ManagedItemVersionPage, en as VisitorGrant, et as ListIncomingItemsInput, f as CreateVisitorGrantInput, ft as ManagedItemVersionResource, g as DeleteItemInput, h as CurrentWorkspaceSources, i as ChangeEditingSessionInput, in as VisitorReadInput, it as ListItemVersionsInput, j as DriveVisitorClient, kt as ReadEffectiveItemPermissionsInput, l as CreateFolderInput, ln as WorkspaceItemSearchPage, lt as ManagedItemMetadata, m as CurrentWorkspace, mt as ManagedLifecycleItem, n as ArchiveItemInput, nn as VisitorGrantPage, nt as ListItemPermissionsInput, o as CollectedOwnedItems, on as WorkspaceDiscoveryItem, ot as ListWorkspaceItemsInput, p as CurrentUserWorkspaceUsage, pt as ManagedItemVersionRestoreResult, q as IncomingItemMetadata, r as ArchivedItem, rn as VisitorItem, s as CreateDownloadInput, sn as WorkspaceDiscoveryPage, st as ManagedDownloadDescriptor, t as AdmittedVerifiedTransfer, tn as VisitorGrantCreation, u as CreateItemPermissionInput, un as WorkspaceSharingPolicy, ut as ManagedItemVersion, v as DriveClient, vt as OwnedItemPage, wt as PrepareVerifiedTransferInput, x as DriveCredentialProvider, xt as PermissionGrantee, y as DriveClientConfig, yt as PermissionAction, z as FolderListInclude, zt as TrashItemInput } from "./contract.js";
|
|
2
2
|
import { DRIVE_API_ERROR_CODES, DRIVE_API_ERROR_MESSAGES, DRIVE_API_ERROR_REASONS, DriveApiErrorCode, DriveError, DriveErrorCode, DriveErrorDetails, DriveErrorReason, DriveSdkErrorCode } from "./core.js";
|
|
3
3
|
import { n as createDriveVisitorClient, r as createVisitorSessionToken, t as collectOwnedItems } from "./contract2.js";
|
|
4
|
-
import {
|
|
4
|
+
import { n as createDriveEditingClient, r as createUploadProgressFetch, t as createDriveClient } from "./contract3.js";
|
|
5
5
|
//#region src/internal/client/verified-operation.d.ts
|
|
6
6
|
/** Generate once per logical operation and retain the exact key across ambiguous retries. */
|
|
7
7
|
declare function createVerifiedOperationKey(issuedAtEpochMilliseconds?: number): string;
|
|
8
8
|
//#endregion
|
|
9
|
-
export { type AdmittedVerifiedTransfer, type ArchiveItemInput, type ArchivedItem, type ChangeEditingSessionInput, type CollectOwnedItemsInput, type CollectedOwnedItems, type CreateDownloadInput, type CreateEditingSessionInput, type CreateFolderInput, type CreateItemPermissionInput, type CreateVisitorGrantInput, type CurrentUserWorkspaceUsage, type CurrentWorkspace, type CurrentWorkspaceSources, DRIVE_API_ERROR_CODES, DRIVE_API_ERROR_MESSAGES, DRIVE_API_ERROR_REASONS, type DeleteItemInput, type DownloadItemResult, type DriveApiErrorCode, type DriveClient, type DriveClientConfig, type DriveCredentialProvider, type DriveEditingClient, type DriveEditingClientConfig, DriveError, type DriveErrorCode, type DriveErrorDetails, type DriveErrorReason, type DriveOperationResult, type DriveOperations, type DriveResponseValidators, type DriveSdkErrorCode, type DriveVisitorClient, type DriveVisitorClientConfig, type EditingSession, type EditingSessionCreation, type EffectivePermissionAction, type FileAccessContext, type FolderItem, type FolderListInclude, type FolderListedItem, type FolderPage, type GetCurrentWorkspaceInput, type GetItemInput, type GetItemVersionInput, type GetVisitorGrantInput, type GetWorkspaceUsageInput, type IncomingItemMetadata, type IncomingItemPage, type ItemOwnershipTransfer, type ListFolderChildrenInput, type ListIncomingItemsInput, type ListItemPermissionsInput, type ListItemVersionsInput, type ListOwnedItemsInput, type ListWorkspaceItemsInput, type ManagedDownloadDescriptor, type ManagedDownloadRestorePending, type ManagedItemMetadata, type ManagedItemVersion, type ManagedItemVersionPage, type ManagedItemVersionResource, type ManagedItemVersionRestoreResult, type ManagedLifecycleItem, type OwnedItem, type OwnedItemPage, type PermissionAction, type PermissionGrant, type PermissionGrantee, type PermissionMutation, type PrepareVerifiedTransferInput, type PreparedVerifiedTransfer, type ProtectionClassification, type PublishVerifiedTransferInput, type PublishedVerifiedTransfer, type ReadEffectiveItemPermissionsInput, type RecoverVerifiedTransferInput, type RestoreItemInput, type RestoreItemVersionInput, type RevokeItemPermissionInput, type RevokeVisitorGrantInput, type SearchWorkspaceItemsInput, type TransferItemOwnershipInput, type TrashItemInput, type UpdateItemInput, type UpdateItemPermissionInput, type UpdateWorkspaceSharingPolicyInput, type UploadFilePhase, type UploadFileProgress, type UploadFileProgressCallback, type UploadVerifiedFileInput, type VerifiedTransferOperations, type VisitorChildren, type VisitorChildrenInput, type VisitorDownloadInput, type VisitorGrant, type VisitorGrantCreation, type VisitorGrantPage, type VisitorItem, type VisitorReadInput, type VisitorSession, type WorkspaceDiscoveryItem, type WorkspaceDiscoveryPage, type WorkspaceItemSearchItem, type WorkspaceItemSearchPage, type WorkspaceSharingPolicy, type WorkspaceUsage, collectOwnedItems, createDriveClient, createDriveEditingClient, createDriveVisitorClient, createVerifiedOperationKey, createVisitorSessionToken };
|
|
9
|
+
export { type AdmittedVerifiedTransfer, type ArchiveItemInput, type ArchivedItem, type ChangeEditingSessionInput, type CollectOwnedItemsInput, type CollectedOwnedItems, type CreateDownloadInput, type CreateEditingSessionInput, type CreateFolderInput, type CreateItemPermissionInput, type CreateVisitorGrantInput, type CurrentUserWorkspaceUsage, type CurrentWorkspace, type CurrentWorkspaceSources, DRIVE_API_ERROR_CODES, DRIVE_API_ERROR_MESSAGES, DRIVE_API_ERROR_REASONS, type DeleteItemInput, type DownloadItemResult, type DriveApiErrorCode, type DriveClient, type DriveClientConfig, type DriveCredentialProvider, type DriveEditingClient, type DriveEditingClientConfig, DriveError, type DriveErrorCode, type DriveErrorDetails, type DriveErrorReason, type DriveOperationResult, type DriveOperations, type DriveResponseValidators, type DriveSdkErrorCode, type DriveUploadConfig, type DriveVisitorClient, type DriveVisitorClientConfig, type EditingSession, type EditingSessionCreation, type EffectivePermissionAction, type FileAccessContext, type FolderItem, type FolderListInclude, type FolderListedItem, type FolderPage, type GetCurrentWorkspaceInput, type GetItemInput, type GetItemVersionInput, type GetVisitorGrantInput, type GetWorkspaceUsageInput, type IncomingItemMetadata, type IncomingItemPage, type ItemOwnershipTransfer, type ListFolderChildrenInput, type ListIncomingItemsInput, type ListItemPermissionsInput, type ListItemVersionsInput, type ListOwnedItemsInput, type ListWorkspaceItemsInput, type ManagedDownloadDescriptor, type ManagedDownloadRestorePending, type ManagedItemMetadata, type ManagedItemVersion, type ManagedItemVersionPage, type ManagedItemVersionResource, type ManagedItemVersionRestoreResult, type ManagedLifecycleItem, type OwnedItem, type OwnedItemPage, type PermissionAction, type PermissionGrant, type PermissionGrantee, type PermissionMutation, type PrepareVerifiedTransferInput, type PreparedVerifiedTransfer, type ProtectionClassification, type PublishVerifiedTransferInput, type PublishedVerifiedTransfer, type ReadEffectiveItemPermissionsInput, type RecoverVerifiedTransferInput, type RestoreItemInput, type RestoreItemVersionInput, type RevokeItemPermissionInput, type RevokeVisitorGrantInput, type SearchWorkspaceItemsInput, type TransferItemOwnershipInput, type TrashItemInput, type UpdateItemInput, type UpdateItemPermissionInput, type UpdateWorkspaceSharingPolicyInput, type UploadFilePhase, type UploadFileProgress, type UploadFileProgressCallback, type UploadFileStage, type UploadVerifiedFileInput, type VerifiedTransferOperations, type VisitorChildren, type VisitorChildrenInput, type VisitorDownloadInput, type VisitorGrant, type VisitorGrantCreation, type VisitorGrantPage, type VisitorItem, type VisitorReadInput, type VisitorSession, type WorkspaceDiscoveryItem, type WorkspaceDiscoveryPage, type WorkspaceItemSearchItem, type WorkspaceItemSearchPage, type WorkspaceSharingPolicy, type WorkspaceUsage, collectOwnedItems, createDriveClient, createDriveEditingClient, createDriveVisitorClient, createUploadProgressFetch, createVerifiedOperationKey, createVisitorSessionToken };
|