@zero-transfer/google-drive 0.4.2 → 0.4.6
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 +9 -2
- package/dist/index.cjs +15 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +11 -5
- package/dist/index.d.ts +11 -5
- package/dist/index.mjs +14 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -8,14 +8,21 @@
|
|
|
8
8
|
npm install @zero-transfer/google-drive
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
Installing this package automatically pulls in [`@zero-transfer/core`](https://www.npmjs.com/package/@zero-transfer/core) as a transitive dependency. The full core surface (`createTransferClient`, `uploadFile`, `downloadFile`, profiles, errors, sync planner, …) is re-exported from this package, so a single `import { … } from "@zero-transfer/google-drive"` is all you need. If your app uses multiple protocols, install the umbrella [`@zero-transfer/sdk`](https://www.npmjs.com/package/@zero-transfer/sdk) instead of multiple scoped packages.
|
|
12
|
+
|
|
11
13
|
## Overview
|
|
12
14
|
|
|
13
|
-
Google Drive provider over OAuth bearer tokens
|
|
15
|
+
Google Drive provider over OAuth bearer tokens - paginated folder listings from a configurable root folder id, ranged downloads via `alt=media`, single-shot multipart uploads, and `md5Checksum` exposed as both `uniqueId` and `checksum`.
|
|
14
16
|
|
|
15
17
|
## Usage
|
|
16
18
|
|
|
17
19
|
```ts
|
|
18
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
createTransferClient,
|
|
22
|
+
uploadFile,
|
|
23
|
+
downloadFile,
|
|
24
|
+
createGoogleDriveProviderFactory,
|
|
25
|
+
} from "@zero-transfer/google-drive";
|
|
19
26
|
```
|
|
20
27
|
|
|
21
28
|
## Public surface
|
package/dist/index.cjs
CHANGED
|
@@ -83,6 +83,7 @@ __export(google_drive_exports, {
|
|
|
83
83
|
importOpenSshConfig: () => importOpenSshConfig,
|
|
84
84
|
importWinScpSessions: () => importWinScpSessions,
|
|
85
85
|
isClassicProviderId: () => isClassicProviderId,
|
|
86
|
+
isMainModule: () => isMainModule,
|
|
86
87
|
isSensitiveKey: () => isSensitiveKey,
|
|
87
88
|
joinRemotePath: () => joinRemotePath,
|
|
88
89
|
matchKnownHosts: () => matchKnownHosts,
|
|
@@ -4891,6 +4892,19 @@ function isModifiedAtDifferent2(source, destination, toleranceMs) {
|
|
|
4891
4892
|
return Math.abs(sourceTime - destinationTime) > toleranceMs;
|
|
4892
4893
|
}
|
|
4893
4894
|
|
|
4895
|
+
// src/utils/mainModule.ts
|
|
4896
|
+
var import_node_url = require("url");
|
|
4897
|
+
function isMainModule(importMetaUrl) {
|
|
4898
|
+
if (typeof process === "undefined" || !process.argv || process.argv.length < 2) {
|
|
4899
|
+
return false;
|
|
4900
|
+
}
|
|
4901
|
+
try {
|
|
4902
|
+
return process.argv[1] === (0, import_node_url.fileURLToPath)(importMetaUrl);
|
|
4903
|
+
} catch {
|
|
4904
|
+
return false;
|
|
4905
|
+
}
|
|
4906
|
+
}
|
|
4907
|
+
|
|
4894
4908
|
// src/providers/cloud/GoogleDriveProvider.ts
|
|
4895
4909
|
var import_node_buffer7 = require("buffer");
|
|
4896
4910
|
var import_node_crypto2 = require("crypto");
|
|
@@ -5494,6 +5508,7 @@ function concatChunks3(chunks, totalSize) {
|
|
|
5494
5508
|
importOpenSshConfig,
|
|
5495
5509
|
importWinScpSessions,
|
|
5496
5510
|
isClassicProviderId,
|
|
5511
|
+
isMainModule,
|
|
5497
5512
|
isSensitiveKey,
|
|
5498
5513
|
joinRemotePath,
|
|
5499
5514
|
matchKnownHosts,
|