@usync/drive 0.0.3 → 0.0.5

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 CHANGED
@@ -4,4 +4,8 @@
4
4
  ![License](https://img.shields.io/npm/l/@usync/drive.svg)
5
5
  [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@usync/drive)
6
6
 
7
- Providing high-level APIs to manage files from cloud drives and WebDAV.
7
+ Provider adapters and shared types for working with remote file storage.
8
+
9
+ This package isolates provider-specific details such as authentication, listing remote files, reading content, and writing changes. The goal is to present a consistent drive abstraction over multiple backends, including cloud providers and WebDAV-style services.
10
+
11
+ The design centers on a small set of provider implementations plus shared base classes and types. Authentication is handled alongside drive access so callers can work with a connected backend rather than juggling provider-specific protocol details.
package/dist/index.d.ts CHANGED
@@ -1,6 +1,14 @@
1
- import { type IStorage } from '@usync/oauth2';
2
- import { AuthenticatedDriveBase } from './providers/base';
3
- import type { IDriveConfig, IServerConfig } from './types';
4
- export * from './providers';
5
- export * from './types';
6
- export declare function connectDrive(serverConfig: IServerConfig, driveConfig: IDriveConfig, storage?: IStorage, handleOAuth2?: (url: string) => Promise<string>): Promise<AuthenticatedDriveBase>;
1
+ import { type TokenData } from "@usync/oauth2";
2
+ import { AuthenticatedDriveBase } from "./providers/base";
3
+ import type { IDriveConfig, IServerConfig } from "./types";
4
+ export * from "./providers";
5
+ export * from "./types";
6
+ interface IOAuth2TokenState {
7
+ accessToken?: TokenData;
8
+ refreshToken?: TokenData;
9
+ }
10
+ export declare function connectDrive(serverConfig: IServerConfig, driveConfig: IDriveConfig, options?: {
11
+ initialData?: IOAuth2TokenState;
12
+ onUpdateToken?: (data: IOAuth2TokenState) => void;
13
+ onAuthorize?: (url: string) => Promise<string>;
14
+ }): Promise<AuthenticatedDriveBase>;